﻿:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef3f8;
  --panel: rgba(255, 255, 255, 0.92);
  --chip-bg: rgba(255, 255, 255, 0.8);
  --tab-bg: rgba(255, 255, 255, 0.74);
  --ink: #1d2433;
  --muted: #697386;
  --line: #d8e0ea;
  --focus: #1769e0;
  --focus-ring: rgba(23, 105, 224, 0.16);
  --hover-bg: #f8fbff;
  --hover-line: #b9c5d4;
  --primary: #1769e0;
  --primary-hover: #155ccc;
  --primary-line: #1f6fe5;
  --on-primary: #ffffff;
  --shadow: 0 18px 45px rgba(31, 43, 64, 0.11);
  --panel-glow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d121a;
  --surface: #161d29;
  --surface-soft: #222b3a;
  --panel: rgba(18, 24, 34, 0.94);
  --chip-bg: rgba(22, 29, 41, 0.88);
  --tab-bg: rgba(17, 23, 33, 0.86);
  --ink: #eef4ff;
  --muted: #9aa7bb;
  --line: #303a4d;
  --focus: #6ea8ff;
  --focus-ring: rgba(110, 168, 255, 0.2);
  --hover-bg: #1d2635;
  --hover-line: #4d5b72;
  --primary: #4d8dff;
  --primary-hover: #6ba2ff;
  --primary-line: #74a8ff;
  --on-primary: #08111f;
  --shadow: 0 20px 52px rgba(0, 0, 0, 0.32);
  --panel-glow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 92%, var(--surface-soft) 8%), var(--bg) 360px),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 44px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 4.2rem;
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  font-size: 1rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 720;
  letter-spacing: 0;
  text-transform: uppercase;
}

.total-chip,
.detected-pill,
.density-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 620;
  white-space: nowrap;
}

.total-chip {
  display: grid;
  min-width: 158px;
  padding: 12px 16px;
  text-align: right;
  box-shadow: 0 8px 22px rgba(31, 43, 64, 0.08);
}

.total-chip span:first-child {
  color: var(--ink);
  font-size: 1.28rem;
}

.detected-pill,
.density-chip {
  padding: 7px 10px;
}

.workspace {
  display: grid;
  gap: 16px;
}

.view-tabs {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--tab-bg);
  padding: 5px;
  box-shadow: 0 10px 26px rgba(31, 43, 64, 0.08);
}

.tab-button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 760;
  padding: 0 14px;
}

.tab-button.is-active {
  background: var(--ink);
  color: var(--bg);
}

[hidden],
.view-pane[hidden] {
  display: none !important;
}

.entry-panel,
.brain-panel,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--panel-glow), var(--shadow);
}

.entry-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) 110px 190px auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
}

.entry-panel.is-custom {
  grid-template-columns: minmax(220px, 1.3fr) 110px 180px minmax(150px, 0.9fr) 86px auto;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
  letter-spacing: 0;
  text-transform: uppercase;
}

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 580;
  letter-spacing: 0;
  outline: none;
  padding: 0 12px;
  text-transform: none;
}

.entry-panel:not(.is-custom) .custom-category-field,
.entry-panel:not(.is-custom) .color-field {
  display: none;
}

.field input[type="color"] {
  min-width: 72px;
  padding: 4px;
}

.field input:focus,
.field select:focus,
.feedback-field textarea:focus,
.button:focus-visible,
.icon-button:focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.form-actions {
  display: flex;
  gap: 8px;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 720;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease;
}

.button {
  min-height: 44px;
  gap: 8px;
  padding: 0 14px;
  text-decoration: none;
}

.button svg,
.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  border-color: var(--hover-line);
  background: var(--hover-bg);
}

.button-primary {
  border-color: var(--primary-line);
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 22%, transparent);
}

.button-primary:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
}

.button.is-active {
  border-color: var(--primary-line);
  background: var(--primary);
  color: var(--on-primary);
}

.button-quiet {
  color: var(--muted);
}

.theme-toggle {
  min-width: 92px;
}

.tutorial-button {
  min-width: 112px;
}

.feedback-button {
  min-width: 118px;
}

.topbar-actions .button {
  min-height: 60px;
  padding-inline: 20px;
}

.topbar-actions .total-chip {
  align-content: center;
  justify-items: center;
  min-width: 124px;
  min-height: 60px;
  padding: 8px 18px;
  text-align: center;
}

.topbar-actions .total-chip span:first-child {
  font-size: 1.16rem;
  line-height: 1;
}

.brain-grid,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.brain-panel,
.detail-panel {
  min-width: 0;
  padding: 16px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.brain-panel > .panel-heading > div:first-child,
.report-visual-panel > .panel-heading > div:first-child {
  flex: 0 0 auto;
  min-width: max-content;
}

.brain-panel > .panel-heading h2,
.report-visual-panel > .panel-heading h2 {
  white-space: nowrap;
}

.panel-actions {
  display: inline-flex;
  align-items: center;
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.render-style-button {
  min-height: 36px;
  flex: 0 0 auto;
  gap: 6px;
  padding-inline: 10px;
  color: var(--ink);
  font-size: 0.78rem;
  white-space: nowrap;
}

.render-style-button svg {
  width: 17px;
  height: 17px;
}

.brain-svg {
  display: block;
  width: 100%;
  aspect-ratio: 64 / 47;
  overflow: visible;
}

.brain-raster-base {
  filter: grayscale(1) saturate(0.06) brightness(2.05) contrast(0.74);
  mix-blend-mode: screen;
  opacity: 0.22;
}

.brain-raster-overlay {
  filter: grayscale(1) saturate(0.04) brightness(2.25) contrast(0.92) drop-shadow(0 0 7px rgba(210, 245, 255, 0.75));
  mix-blend-mode: screen;
  opacity: 0.5;
  pointer-events: none;
}

.brain-raster-dark {
  filter: grayscale(1) saturate(0.08) brightness(1.65) contrast(0.98) drop-shadow(0 0 8px rgba(190, 230, 255, 0.45));
  mix-blend-mode: screen;
  opacity: 0.28;
  pointer-events: none;
}

.brain-color-segment {
  mix-blend-mode: normal;
  filter: saturate(1.35) contrast(1.12);
}

.brain-color-glow {
  mix-blend-mode: screen;
  filter: saturate(1.45);
}

.brain-hologram-wash {
  fill: rgba(246, 253, 255, 0.12);
  pointer-events: none;
}

.brain-outline {
  fill: none;
  stroke: rgba(29, 36, 51, 0.82);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.brain-outline.neural-outline {
  stroke: rgba(216, 237, 248, 0.62);
  stroke-width: 3.4;
}

.brain-crease {
  fill: none;
  stroke: rgba(29, 36, 51, 0.18);
  stroke-linecap: round;
  stroke-width: 3;
}

.brain-fold-major,
.brain-fold-minor,
.brain-fold-fine {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.brain-fold-major {
  stroke: rgba(29, 36, 51, 0.28);
  stroke-width: 4.2;
}

.brain-fold-minor {
  stroke: rgba(29, 36, 51, 0.18);
  stroke-width: 2.4;
}

.brain-fold-fine {
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 1.5;
}

.segment-label {
  fill: rgba(29, 36, 51, 0.82);
  font-size: 18px;
  font-weight: 760;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.74);
  stroke-width: 5px;
  stroke-linejoin: round;
}

.verification-bar-track {
  fill: rgba(238, 243, 248, 0.92);
  stroke: rgba(29, 36, 51, 0.28);
  stroke-width: 1;
}

.verification-bar-segment {
  opacity: 0.92;
}

.verification-bar-divider {
  stroke: rgba(255, 255, 255, 0.8);
  stroke-linecap: round;
  stroke-width: 3;
}

.verification-bar-label {
  fill: rgba(29, 36, 51, 0.78);
  font-size: 12px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.75);
  stroke-linejoin: round;
  stroke-width: 4px;
}

.stem-path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  mix-blend-mode: screen;
}

.stem-glow,
.stem-core,
.stem-spark {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stem-glow {
  mix-blend-mode: screen;
  filter: saturate(1.9) brightness(1.16) contrast(1.12);
}

.stem-core {
  mix-blend-mode: screen;
  filter: saturate(1.9) brightness(1.12) contrast(1.2);
}

.stem-spark {
  stroke: rgba(255, 246, 225, 0.68);
  mix-blend-mode: screen;
}

.stem-spark-center {
  stroke: rgba(255, 255, 255, 0.94);
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.42));
}

.stem-node {
  mix-blend-mode: screen;
}

.neural-haze {
  fill: none;
  stroke: rgba(187, 216, 234, 0.38);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.neural-brain-shell {
  fill: rgba(23, 35, 48, 0.86);
  stroke: rgba(208, 229, 241, 0.26);
  stroke-linejoin: round;
  stroke-width: 2;
}

.cartoon-color-segment {
  mix-blend-mode: screen;
  filter: saturate(1.22) contrast(1.04) brightness(1.05);
}

.cartoon-divider {
  stroke: rgba(255, 255, 255, 0.82);
  stroke-linecap: round;
  stroke-width: 4.6;
}

.cartoon-brain-shadow {
  fill: rgba(5, 7, 18, 0.34);
  filter: blur(3px);
}

.cartoon-brain-base {
  filter:
    drop-shadow(0 0 18px rgba(220, 96, 255, 0.32))
    drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
}

.cartoon-brain-highlight {
  fill: rgba(255, 255, 255, 0.2);
}

.cartoon-brain-wash {
  fill: rgba(255, 255, 255, 0.14);
}

.cartoon-brain-raster {
  opacity: 0.96;
  filter:
    drop-shadow(0 0 16px rgba(232, 240, 255, 0.16))
    drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
  pointer-events: none;
}

.cartoon-signal-glow,
.cartoon-signal-color,
.cartoon-signal-highlight {
  mix-blend-mode: screen;
}

.cartoon-signal-color {
  filter: saturate(1.18) brightness(1.03);
}

.cartoon-signal-highlight {
  stroke-linecap: round;
}

.cartoon-signal-node-glow {
  mix-blend-mode: normal;
}

.cartoon-signal-node {
  stroke: rgba(255, 255, 255, 0.42);
  stroke-width: 0.7;
  filter: saturate(1.18) brightness(1.03);
}

.cartoon-signal-node-shine {
  pointer-events: none;
}

.cartoon-brain-outline {
  fill: none;
  stroke: rgba(54, 37, 120, 0.84);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 5.2;
  filter: drop-shadow(0 0 4px rgba(210, 128, 255, 0.22));
}

.cartoon-brain-fold {
  fill: none;
  stroke: rgba(76, 38, 142, 0.38);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.4;
}

.cartoon-brain-fold-thin {
  stroke: rgba(110, 61, 170, 0.26);
  stroke-width: 2.1;
}

.cartoon-segment-label {
  fill: rgba(21, 28, 40, 0.9);
  font-weight: 760;
}

.tree-scene-bg {
  fill: #101827;
}

.leaf-scene-bg {
  fill: #111827;
}

.tree-moon {
  fill: rgba(255, 255, 255, 0.72);
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 1;
  filter:
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.34))
    drop-shadow(0 0 28px rgba(192, 220, 255, 0.38));
}

.tree-ground {
  fill: rgba(37, 45, 52, 0.62);
}

.tree-root-glow {
  mix-blend-mode: screen;
}

.growth-tree-shadow {
  fill: rgba(86, 92, 104, 0.64);
}

.study-tree-shadow {
  fill: rgba(80, 86, 98, 0.74);
}

.growth-tree-base-contact-pool,
.study-tree-base-contact-pool {
  fill: rgba(104, 110, 124, 0.3);
  mix-blend-mode: screen;
}

.growth-tree-base-contact,
.study-tree-base-contact {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  mix-blend-mode: screen;
}

.growth-tree-base-contact {
  stroke: rgba(244, 214, 255, 0.74);
  stroke-width: 2.4;
  filter: drop-shadow(0 0 6px rgba(226, 154, 255, 0.34));
}

.study-tree-base-contact {
  stroke: rgba(190, 125, 76, 0.72);
  stroke-width: 2.2;
  filter: drop-shadow(0 0 5px rgba(255, 188, 122, 0.22));
}

.growth-tree-render {
  mix-blend-mode: normal;
  filter: none;
  pointer-events: none;
}

.tree1-stage-render,
.tree2-classic-render {
  image-rendering: auto;
}

.tree1-stage-render {
  filter: none;
}

.tree2-classic-render {
  mix-blend-mode: normal;
  filter: none;
}

.tree2-neutral-fallback {
  filter:
    grayscale(1)
    saturate(0)
    brightness(1.22)
    contrast(1.08);
  opacity: 0.72;
}

.growth-tree-color-layer {
  mix-blend-mode: screen;
  pointer-events: none;
}

.growth-tree-color-wash {
  mix-blend-mode: screen;
  filter: blur(0.85px) saturate(1.28) brightness(1.04);
}

.arbor-signal-layer {
  mix-blend-mode: screen;
}

.arbor-tree-limb,
.arbor-tree-twig {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.arbor-tree-limb {
  stroke: rgba(79, 61, 49, 0.72);
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.32));
}

.arbor-tree-twig {
  stroke: rgba(95, 80, 70, 0.48);
}

.study-tree-trunk,
.study-tree-branch {
  fill: none;
  stroke: #6a4228;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter:
    drop-shadow(0 0 4px rgba(255, 184, 122, 0.16))
    drop-shadow(0 5px 7px rgba(0, 0, 0, 0.28));
}

.study-tree-trunk {
  stroke: #6a4228;
}

.study-tree-branch {
  stroke: #6a4228;
}

.study-tree-leaf-wrap {
  transform-box: fill-box;
  transform-origin: center;
}

.study-tree-leaf {
  mix-blend-mode: normal;
  filter: saturate(1.34) contrast(1.08) brightness(1.03);
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 0.35;
}

.study-tree-leaf-vein {
  fill: none;
  stroke: rgba(255, 255, 255, 0.48);
  stroke-linecap: round;
  stroke-width: 0.65;
}

.study-tree-leaf-wrap.is-falling .study-tree-leaf {
  opacity: 0.78;
}

.scenic-canopy-bg {
  fill: #071222;
}

.scenic-canopy-frame {
  opacity: 1;
  pointer-events: none;
}

.scenic-canopy-vignette {
  fill: rgba(4, 9, 20, 0.12);
  pointer-events: none;
}

.scenic-canopy-leaf-layer {
  pointer-events: none;
}

.scenic-canopy-attached-leaves {
  mix-blend-mode: screen;
  filter: saturate(1.16) brightness(1.04);
}

.scenic-canopy-falling-leaves {
  mix-blend-mode: screen;
  filter:
    saturate(1.22)
    brightness(1.1)
    drop-shadow(0 0 4px rgba(255, 255, 255, 0.14));
}

.scenic-canopy-leaf-wrap {
  transform-box: fill-box;
  transform-origin: center;
}

.scenic-canopy-leaf {
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 0.18;
}

.scenic-canopy-leaf-vein {
  fill: none;
  stroke: rgba(255, 255, 255, 0.54);
  stroke-linecap: round;
  stroke-width: 0.38;
}

.scenic-canopy-leaf-wrap.is-falling .scenic-canopy-leaf {
  filter: saturate(1.3) brightness(1.12);
}

.empty-note {
  fill: var(--muted);
  font-size: 18px;
  font-weight: 720;
  text-anchor: middle;
}

.detail-grid {
  align-items: start;
}

.entry-list,
.summary-list {
  margin: 0;
  padding: 0;
}

.entry-list {
  display: grid;
  gap: 9px;
  list-style: none;
}

.entry-item,
.summary-row {
  display: grid;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.entry-item {
  grid-template-columns: 12px minmax(0, 1fr) auto 36px;
  min-height: 52px;
  padding: 8px;
}

.swatch {
  width: 12px;
  height: 34px;
  border-radius: 999px;
}

.entry-name,
.summary-name {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.entry-meta,
.summary-meta {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 620;
}

.entry-hours {
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
}

.summary-list {
  display: grid;
  gap: 10px;
}

.history-grid {
  display: grid;
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.history-list-panel {
  overflow: hidden;
}

.history-list-panel .panel-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.history-list-panel .panel-heading > div {
  min-width: 0;
}

.history-week-button {
  width: 100%;
  max-width: 100%;
  min-height: 48px;
}

.history-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.history-title-panel {
  padding-block: 12px;
}

.history-total {
  min-width: 132px;
  box-shadow: none;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-limit-box {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(135deg, var(--surface), var(--surface-soft));
  padding: 12px;
}

.history-limit-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-limit-top strong {
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.2;
  text-align: right;
}

.history-limit-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(105, 115, 134, 0.16);
}

.history-limit-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 180ms ease;
}

#historyLimitMeta {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.35;
}

.custom-average-box {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 10px;
}

.custom-average-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.custom-average-fields .summary-edit-field {
  min-width: 0;
}

.custom-average-fields .summary-edit-field input {
  min-width: 0;
  padding-inline: 8px;
}

#customAverageButton {
  width: 100%;
  max-width: 100%;
}

.paywall-note {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.4;
}

.history-item {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.history-item:hover {
  border-color: var(--hover-line);
  background: var(--hover-bg);
}

.history-item.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.history-date {
  font-weight: 800;
}

.history-meta {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 680;
}

.history-hours {
  font-weight: 850;
  white-space: nowrap;
}

.report-view {
  gap: 14px;
}

.report-header-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.report-title-block {
  display: grid;
  gap: 6px;
}

.report-title-block h2 {
  font-size: 1.7rem;
  line-height: 1.06;
}

.report-subtitle {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 620;
  line-height: 1.4;
}

.report-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.report-total-chip {
  min-width: 136px;
  box-shadow: none;
}

.report-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.report-metric {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.report-metric span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
  text-transform: uppercase;
}

.report-metric strong {
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  overflow-wrap: anywhere;
}

.report-metric small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 620;
  line-height: 1.35;
}

.report-visual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.report-visual-panel .panel-heading {
  min-height: 44px;
}

.report-visual-controls {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
  min-width: 0;
}

.report-visual-select {
  min-width: 132px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 720;
}

.report-visual-select:focus-visible {
  outline: 2px solid var(--primary-line);
  outline-offset: 2px;
}

.report-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.report-category-list,
.report-highlight-list {
  display: grid;
  gap: 10px;
}

.report-category-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 10px;
}

.report-category-percent {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 820;
  white-space: nowrap;
}

.report-highlight {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 620;
  line-height: 1.45;
  padding: 12px;
}

.category-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.category-manager-form {
  display: grid;
  gap: 14px;
}

.palette-field {
  text-transform: uppercase;
}

.basic-color-grid {
  display: grid;
  grid-template-columns: repeat(7, 30px);
  gap: 8px;
}

.color-swatch-button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--swatch-color);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.26);
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    border-color 120ms ease;
}

.color-swatch-button:hover,
.color-swatch-button.is-active {
  transform: translateY(-1px);
  border-color: var(--ink);
  box-shadow:
    0 0 0 3px var(--focus-ring),
    inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.category-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 680;
}

.category-manager-list {
  display: grid;
  gap: 10px;
}

.category-manager-row {
  display: grid;
  grid-template-columns: 14px minmax(140px, 1fr) minmax(240px, 1.4fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 10px;
}

.category-preview {
  width: 14px;
  height: 42px;
  border-radius: 999px;
  background: var(--category-color);
}

.category-name {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.category-kind {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
  text-transform: uppercase;
}

.category-color-tools {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.category-color-picker {
  width: 54px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 4px;
}

.category-color-tools .basic-color-grid {
  grid-template-columns: repeat(7, 26px);
  gap: 6px;
}

.category-color-tools .color-swatch-button {
  width: 26px;
  height: 26px;
}

.category-row-actions {
  display: inline-flex;
  gap: 8px;
  justify-content: end;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr);
  gap: 24px;
  align-items: start;
}

.auth-form,
.account-card,
.account-feature-list {
  display: grid;
  gap: 14px;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-card {
  border: 1px solid rgba(142, 178, 230, 0.44);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(71, 111, 170, 0.28), rgba(41, 64, 103, 0.2)),
    var(--surface-soft);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 34px rgba(25, 46, 79, 0.18);
  margin-top: 28px;
  padding: 16px;
}

.account-card .eyebrow {
  color: #bfdbfe;
}

.plan-chip {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 7px 10px;
}

.plan-chip.is-pro {
  border-color: var(--primary-line);
  background: var(--primary);
  color: var(--on-primary);
}

.account-note {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 620;
  line-height: 1.45;
}

.account-feature {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 12px;
}

.account-feature-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 850;
}

.account-feature h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 0.94rem;
}

.account-feature p {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 580;
  line-height: 1.45;
}

.account-disclaimer {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 560;
  line-height: 1.4;
  opacity: 0.58;
  text-align: center;
}

.pricing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 16px;
  align-items: stretch;
}

.pricing-hero-panel,
.pricing-plan-panel {
  display: grid;
  align-content: center;
  gap: 16px;
  min-height: 280px;
}

.pricing-hero-panel h2 {
  max-width: 720px;
  color: var(--ink);
  font-size: 3.75rem;
  line-height: 0.96;
}

.pricing-lede {
  max-width: 650px;
  color: var(--muted);
  font-size: 1.03rem;
  font-weight: 600;
  line-height: 1.55;
}

.pricing-proof-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pricing-proof-row span,
.pricing-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  padding: 8px 10px;
}

.pricing-plan-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.pricing-plan-top h2 {
  color: var(--ink);
  font-size: 1.65rem;
}

.pricing-price {
  display: flex;
  align-items: end;
  gap: 8px;
  color: var(--muted);
  font-weight: 760;
}

.pricing-price span:first-child {
  color: var(--ink);
  font-size: 3.4rem;
  font-weight: 850;
  line-height: 0.9;
}

.pricing-checkout {
  width: 100%;
}

.pricing-note {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 620;
  line-height: 1.45;
}

.pricing-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pricing-feature {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.pricing-feature-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  height: 34px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 850;
}

.pricing-feature h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.pricing-feature p {
  color: var(--muted);
  font-size: 0.91rem;
  font-weight: 580;
  line-height: 1.48;
}

.pro-modal,
.feedback-modal,
.create-account-modal {
  width: min(520px, calc(100% - 28px));
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  padding: 0;
}

.render-style-modal {
  width: min(680px, calc(100% - 28px));
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  padding: 0;
}

.render-style-modal.is-preview {
  width: min(900px, calc(100% - 28px));
}

.pro-modal::backdrop,
.feedback-modal::backdrop,
.create-account-modal::backdrop {
  background: rgba(6, 10, 18, 0.62);
  backdrop-filter: blur(4px);
}

.render-style-modal::backdrop {
  background: rgba(6, 10, 18, 0.62);
  backdrop-filter: blur(4px);
}

.pro-modal-card,
.feedback-card,
.create-account-card {
  position: relative;
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.28);
  padding: 22px;
}

.create-account-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.12;
}

.create-account-card > p:not(.eyebrow):not(.create-account-status) {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 620;
  line-height: 1.45;
}

.create-account-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.create-account-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.4;
}

.create-account-status.is-error {
  color: #ff8d9a;
}

.create-account-status.is-success {
  color: #74e0bd;
}

.create-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.render-style-card {
  position: relative;
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.28);
  padding: 22px;
}

.pro-modal-close,
.feedback-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.render-style-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.pro-modal h2,
.feedback-card h2 {
  max-width: 390px;
  color: var(--ink);
  font-size: 1.8rem;
  line-height: 1.02;
}

.render-style-card h2 {
  max-width: 440px;
  color: var(--ink);
  font-size: 1.8rem;
  line-height: 1.02;
}

.pro-modal p:not(.eyebrow),
.feedback-card p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.5;
}

.feedback-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
  letter-spacing: 0;
  text-transform: uppercase;
}

.feedback-field textarea {
  width: 100%;
  min-height: 168px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 580;
  line-height: 1.45;
  outline: none;
  padding: 12px;
  text-transform: none;
}

.feedback-meta,
.feedback-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.feedback-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
}

.feedback-status {
  min-height: 22px;
}

.feedback-status[data-tone="success"] {
  color: #16834b;
}

.feedback-status[data-tone="error"] {
  color: #c2394b;
}

.feedback-status[data-tone="pending"] {
  color: var(--muted);
}

.render-style-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.render-style-modal.is-preview .render-style-options {
  grid-template-columns: 1fr;
}

.render-preview-shell {
  display: grid;
  gap: 12px;
}

.render-preview-stage {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1724;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.render-preview-svg {
  width: min(100%, 760px);
  height: auto;
  opacity: 0.94;
}

.premium-preview-button {
  position: absolute;
  left: 50%;
  bottom: 34px;
  isolation: isolate;
  min-height: 52px;
  border: 1px solid rgba(202, 228, 255, 0.65);
  border-radius: 8px;
  background: linear-gradient(135deg, #1a4e9c, #21a8df 48%, #37d7b4);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 760;
  padding: 0 24px;
  transform: translateX(-50%);
  box-shadow:
    0 16px 34px rgba(19, 129, 202, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.premium-preview-button::before {
  content: "";
  position: absolute;
  inset: -16px -22px;
  z-index: -1;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(25, 77, 160, 0.6), rgba(47, 218, 181, 0.52));
  filter: blur(18px);
  opacity: 0.9;
}

.premium-preview-button:hover {
  transform: translateX(-50%) translateY(-1px);
}

.render-preview-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.render-preview-tab {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 720;
  padding: 0 12px;
}

.render-preview-tab:hover,
.render-preview-tab.is-active {
  border-color: var(--primary-line);
  background: var(--hover-bg);
  color: var(--ink);
}

.render-preview-note {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 620;
  text-align: center;
}

.render-style-option {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 106px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.render-style-option:hover,
.render-style-option.is-active {
  border-color: var(--primary-line);
  background: var(--hover-bg);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.render-style-option strong,
.render-style-option small {
  display: block;
}

.render-style-option strong {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 0.95rem;
}

.render-style-option small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 620;
  line-height: 1.35;
}

.render-style-preview {
  width: 82px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background:
    radial-gradient(circle at 32% 34%, rgba(255, 255, 255, 0.76), transparent 12%),
    linear-gradient(135deg, #df4c5f 0 28%, #2f7de1 28% 50%, #dca90d 50% 74%, #737d8c 74%);
}

.render-style-preview-tree1 {
  background:
    linear-gradient(80deg, transparent 0 47%, rgba(255, 245, 255, 0.86) 48% 52%, transparent 53%),
    conic-gradient(from 230deg at 50% 82%, #df4c5f, #2f7de1, #dca90d, #7862d5, #df4c5f),
    #101826;
}

.render-style-preview-tree2 {
  background:
    radial-gradient(circle at 52% 80%, rgba(255, 255, 255, 0.8), transparent 9%),
    conic-gradient(from 210deg at 50% 78%, #123f7a, #1c86c8, #6d61d8, #28d0aa, #123f7a),
    #101826;
}

.render-style-preview-leafTree {
  background:
    radial-gradient(circle at 42% 30%, rgba(216, 79, 159, 0.9) 0 4px, transparent 5px),
    radial-gradient(circle at 60% 24%, rgba(47, 125, 225, 0.92) 0 4px, transparent 5px),
    radial-gradient(circle at 74% 54%, rgba(220, 169, 13, 0.9) 0 5px, transparent 6px),
    linear-gradient(180deg, rgba(6, 17, 37, 0.08), rgba(6, 17, 37, 0.48)),
    url("assets/canopy-scene.png") center / cover;
}

.pro-modal-price {
  display: flex;
  align-items: end;
  gap: 8px;
  color: var(--muted);
  font-weight: 760;
}

.pro-modal-price span:first-child {
  color: var(--ink);
  font-size: 3rem;
  font-weight: 850;
  line-height: 0.9;
}

.pro-modal-benefits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pro-modal-benefits span {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 740;
  padding: 10px;
}

.pro-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pro-modal-actions .button {
  min-height: 46px;
}

.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: auto;
}

.tour-highlight {
  position: fixed;
  z-index: 1201;
  pointer-events: none;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 10px;
  box-shadow:
    0 0 0 9999px rgba(7, 11, 20, 0.58),
    0 0 0 6px rgba(77, 141, 255, 0.28),
    0 0 28px rgba(125, 176, 255, 0.72);
  transition:
    left 180ms ease,
    top 180ms ease,
    width 180ms ease,
    height 180ms ease;
}

.tour-callout {
  position: fixed;
  z-index: 1202;
  display: grid;
  gap: 13px;
  width: min(360px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
  padding: 18px;
  pointer-events: auto;
  transition:
    left 180ms ease,
    top 180ms ease;
}

.tour-callout::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--line);
  border-right: 0;
  border-bottom: 0;
  background: var(--panel);
  transform: rotate(45deg);
}

.tour-callout.is-below::before {
  top: -8px;
  left: 28px;
}

.tour-callout.is-above::before {
  bottom: -8px;
  left: 28px;
  transform: rotate(225deg);
}

.tour-callout.is-right::before {
  left: -8px;
  top: 28px;
  transform: rotate(-45deg);
}

.tour-callout.is-left::before {
  right: -8px;
  top: 28px;
  transform: rotate(135deg);
}

.tour-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.tour-callout h2 {
  max-width: 280px;
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.08;
}

.tour-callout p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 560;
  line-height: 1.48;
}

.tour-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(105, 115, 134, 0.18);
}

.tour-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 180ms ease;
}

.tour-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.tour-actions .button {
  min-height: 42px;
}

.summary-row {
  grid-template-columns: 12px minmax(0, 1fr) auto;
  padding: 10px;
}

.summary-row.has-actions {
  grid-template-columns: 12px minmax(0, 1fr) auto max-content;
}

.summary-row.is-editing {
  background: var(--surface-soft);
}

.summary-edit-button {
  align-self: start;
  min-height: 36px;
  gap: 6px;
  padding-inline: 10px;
}

.share-track {
  grid-column: 2 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.share-bar {
  height: 100%;
  border-radius: inherit;
}

.summary-edit-form {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(150px, 1fr) 116px minmax(180px, 1.3fr) auto;
  gap: 10px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.summary-edit-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  text-transform: uppercase;
}

.summary-edit-field input,
.summary-edit-field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 620;
  outline: none;
  padding: 0 10px;
}

.summary-edit-field input:focus,
.summary-edit-field select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.summary-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: end;
}

.summary-edit-actions .button {
  min-height: 38px;
  padding-inline: 12px;
}

.empty-list {
  border: 1px dashed var(--line);
  border-radius: 7px;
  padding: 18px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 620;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 860px) {
  h1 {
    font-size: 3.2rem;
  }

  .entry-panel,
  .entry-panel.is-custom,
  .brain-grid,
  .detail-grid,
  .report-visual-grid,
  .report-detail-grid,
  .pricing-layout,
  .pricing-feature-grid {
    grid-template-columns: 1fr;
  }

  .entry-panel {
    align-items: stretch;
  }

  .form-actions {
    justify-content: stretch;
  }

  .button {
    flex: 1;
  }

  .panel-actions .render-style-button {
    flex: 0 0 auto;
  }

  .report-visual-panel .panel-heading {
    align-items: stretch;
  }

  .report-visual-controls {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .report-visual-select {
    width: 100%;
    min-width: 0;
  }

  .summary-edit-form {
    grid-template-columns: minmax(150px, 1fr) 110px;
  }

  .pricing-hero-panel h2 {
    font-size: 3rem;
  }

  .summary-edit-field-wide,
  .summary-edit-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .total-chip {
    width: 100%;
    text-align: left;
  }

  .view-tabs {
    width: 100%;
  }

  .tab-button {
    flex: 1;
  }

  h1 {
    font-size: 2.45rem;
  }

  .pricing-hero-panel h2 {
    font-size: 2.25rem;
  }

  .panel-heading {
    align-items: start;
    flex-direction: column;
  }

  .brain-panel > .panel-heading > div:first-child,
  .report-visual-panel > .panel-heading > div:first-child {
    min-width: 0;
  }

  .brain-panel > .panel-heading h2,
  .report-visual-panel > .panel-heading h2 {
    white-space: normal;
  }

  .report-header-panel,
  .report-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .report-actions .button,
  .report-total-chip {
    width: 100%;
  }

  .panel-actions {
    justify-content: flex-start;
  }

  .detected-pill,
  .density-chip {
    white-space: normal;
  }

  .brain-panel,
  .detail-panel {
    padding: 12px;
  }

  .entry-item {
    grid-template-columns: 10px minmax(0, 1fr) 36px;
  }

  .entry-item .entry-hours {
    grid-column: 2;
  }

  .summary-row.has-actions {
    grid-template-columns: 12px minmax(0, 1fr) max-content;
  }

  .summary-row.has-actions .swatch {
    grid-row: 1 / span 2;
  }

  .summary-row.has-actions .entry-hours {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
  }

  .summary-edit-button {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .summary-row.has-actions .share-track {
    grid-column: 2 / -1;
    grid-row: 3;
  }

  .summary-edit-form {
    grid-template-columns: 1fr;
  }

  .custom-average-fields {
    grid-template-columns: 1fr;
  }

  .history-limit-top {
    align-items: start;
    flex-direction: column;
  }

  .history-limit-top strong {
    text-align: left;
  }

  .pro-modal-card,
  .feedback-card {
    padding: 18px;
  }

  .pro-modal h2,
  .feedback-card h2 {
    font-size: 1.5rem;
  }

  .pro-modal-benefits {
    grid-template-columns: 1fr;
  }

  .render-style-options {
    grid-template-columns: 1fr;
  }

  .tour-callout {
    width: min(330px, calc(100vw - 22px));
    padding: 16px;
  }

  .tour-actions {
    justify-content: stretch;
  }

  .summary-edit-actions {
    justify-content: stretch;
  }

  .feedback-actions,
  .create-account-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }
}

@media (max-width: 960px) {
  .history-grid,
  .category-grid,
  .account-grid,
  .report-metric-grid,
  .pricing-layout {
    grid-template-columns: 1fr;
  }

  .pricing-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-manager-row {
    grid-template-columns: 14px minmax(0, 1fr);
  }

  .category-color-tools,
  .category-row-actions {
    grid-column: 2;
  }
}

@media (max-width: 640px) {
  .pricing-feature-grid {
    grid-template-columns: 1fr;
  }

  .pricing-hero-panel,
  .pricing-plan-panel {
    min-height: 0;
  }

  .pricing-price span:first-child {
    font-size: 2.8rem;
  }

  .basic-color-grid,
  .category-color-tools .basic-color-grid {
    grid-template-columns: repeat(5, 30px);
  }

  .category-color-tools {
    grid-template-columns: 54px minmax(0, 1fr);
  }
}

@media print {
  @page {
    size: letter portrait;
    margin: 0.45in;
  }

  :root,
  :root[data-theme="dark"] {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-soft: #f1f4f8;
    --panel: #ffffff;
    --chip-bg: #ffffff;
    --ink: #111827;
    --muted: #4b5563;
    --line: #d5dbe5;
    --primary: #1f6fe5;
    --primary-line: #1f6fe5;
    --on-primary: #ffffff;
    --shadow: none;
  }

  body {
    min-height: 0;
    background: #ffffff;
    color: #111827;
  }

  .topbar,
  .view-tabs,
  .report-actions,
  .report-visual-select,
  .pro-modal,
  .feedback-modal,
  .create-account-modal,
  .render-style-modal,
  .tour-overlay {
    display: none !important;
  }

  .app-shell {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .view-pane:not(#reportView) {
    display: none !important;
  }

  #reportView {
    display: grid !important;
    gap: 10px;
  }

  .detail-panel,
  .brain-panel,
  .report-metric,
  .report-category-row,
  .report-highlight {
    border-color: #d5dbe5;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  .report-header-panel {
    display: block;
    padding: 0 0 10px;
  }

  .report-title-block h2 {
    font-size: 24pt;
    line-height: 1;
  }

  .report-subtitle {
    color: #4b5563;
  }

  .report-metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .report-metric {
    break-inside: avoid;
    padding: 10px;
  }

  .report-metric strong {
    font-size: 18pt;
  }

  .report-visual-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .report-detail-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 8px;
  }

  .brain-panel,
  .detail-panel {
    break-inside: avoid;
    padding: 9px;
  }

  .panel-heading {
    align-items: center;
    flex-direction: row;
    margin-bottom: 5px;
  }

  .brain-panel > .panel-heading > div:first-child,
  .report-visual-panel > .panel-heading > div:first-child {
    min-width: max-content;
  }

  .brain-panel > .panel-heading h2,
  .report-visual-panel > .panel-heading h2 {
    white-space: nowrap;
  }

  .brain-svg {
    aspect-ratio: 64 / 47;
    max-height: 2.45in;
  }

  .growth-tree-render {
    mix-blend-mode: normal !important;
    filter: saturate(1.24) brightness(0.96) contrast(1.2) !important;
  }

  .density-chip,
  .detected-pill,
  .total-chip,
  .plan-chip {
    border-color: #d5dbe5;
    background: #f6f8fb;
    color: #374151;
  }

  .report-category-row,
  .report-highlight {
    break-inside: avoid;
    padding: 8px;
  }
}
