﻿: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;
  --pro-accent: #c98314;
  --pro-accent-strong: #9a5f08;
  --pro-accent-line: rgba(201, 131, 20, 0.46);
  --pro-accent-soft: rgba(245, 183, 72, 0.16);
  --pro-accent-glow: rgba(201, 131, 20, 0.18);
  --on-pro-accent: #2f1d03;
  --shadow: 0 18px 45px rgba(31, 43, 64, 0.11);
  --panel-glow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/fonts/manrope-latin-wght-normal.woff2") format("woff2");
}

: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;
  --pro-accent: #cdd6e3;
  --pro-accent-strong: #f4f7fb;
  --pro-accent-line: rgba(205, 214, 227, 0.34);
  --pro-accent-soft: rgba(205, 214, 227, 0.1);
  --pro-accent-glow: rgba(205, 214, 227, 0.14);
  --on-pro-accent: #101722;
  --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;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  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:
    "Manrope", 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: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.topbar-main {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.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;
}

.log-total {
  display: grid;
  gap: 0;
  justify-items: end;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.log-total .eyebrow {
  margin-bottom: 7px;
}

.log-total h2 {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.15;
  font-weight: 850;
}

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

.label-mode-toggle {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--tab-bg);
  padding: 3px;
}

.label-mode-button {
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 9px;
  font-size: 0.74rem;
  font-weight: 760;
  white-space: nowrap;
}

.label-mode-button:hover,
.label-mode-button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(31, 43, 64, 0.1);
}

.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 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 760;
  padding: 0 14px;
}

.tab-button svg {
  display: none;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.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 {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) 132px 190px auto;
  gap: 12px;
  align-items: end;
  margin-top: 40px;
  padding: 14px;
}

.topbar-entry-panel {
  margin-top: 0;
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--surface) 46%, transparent);
  box-shadow: none;
}

.topbar-entry-panel .entry-mode-tabs {
  position: static;
  grid-column: 1 / -1;
  justify-self: end;
  margin-bottom: -2px;
}

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

.entry-mode-tabs {
  position: absolute;
  top: -40px;
  right: 12px;
  display: inline-flex;
  align-items: flex-end;
  overflow: visible;
  background: transparent;
}

.entry-mode-tab {
  position: relative;
  min-width: 78px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--tab-bg);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
  padding: 0 16px;
  box-shadow: 0 -8px 18px rgba(31, 43, 64, 0.08);
}

.entry-mode-tab + .entry-mode-tab {
  margin-left: -1px;
}

.entry-mode-tab:hover {
  background: var(--surface);
  color: var(--ink);
}

.entry-mode-tab.is-active {
  z-index: 2;
  border-bottom-color: var(--panel);
  background: var(--panel);
  color: var(--ink);
  transform: translateY(1px);
}

.entry-mode-tab.is-active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--panel);
  content: "";
}

.entry-mode-tab:focus-visible {
  position: relative;
  z-index: 3;
  box-shadow: inset 0 0 0 2px var(--focus);
  outline: none;
}

.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;
}

.timer-display {
  display: flex;
  align-items: center;
  min-height: 44px;
  min-width: 120px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 820;
  letter-spacing: 0;
  padding: 0 12px;
  white-space: nowrap;
}

.entry-panel.is-timer .field-time input {
  display: none;
}

.entry-panel:not(.is-timer) .timer-display {
  display: 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,
.goal-field input:focus,
.goal-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);
}

.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid .timer-display,
.goal-field.is-invalid input,
.goal-field.is-invalid select,
.summary-edit-field.is-invalid input,
.summary-edit-field.is-invalid select,
.feedback-field.is-invalid textarea,
.button.is-invalid {
  border-color: #f05263;
  box-shadow: 0 0 0 4px rgba(240, 82, 99, 0.16);
}

.field.is-invalid span,
.goal-field.is-invalid span,
.summary-edit-field.is-invalid span,
.feedback-field.is-invalid span {
  color: #f05263;
}

.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-small {
  min-height: 34px;
  gap: 6px;
  border-radius: 6px;
  font-size: 0.83rem;
  padding: 0 10px;
}

.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);
}

.button-danger {
  border-color: color-mix(in srgb, #f05263 58%, var(--line));
  color: #f05263;
}

.button-danger:hover,
.button-danger:focus-visible {
  border-color: #f05263;
  background: color-mix(in srgb, #f05263 12%, var(--surface));
  color: #ff7a87;
}

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

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

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

.add-goal-button {
  flex: 0 0 auto;
  min-height: 32px;
  gap: 6px;
  border-radius: 6px;
  font-size: 0.78rem;
  padding-inline: 9px;
  white-space: nowrap;
}

.add-goal-button svg {
  width: 16px;
  height: 16px;
}

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

.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;
}

.render-swipe-frame {
  position: relative;
  touch-action: pan-y;
}

.render-swipe-frame .brain-svg {
  aspect-ratio: 640 / 448;
  user-select: none;
}

.render-trial-badge {
  position: absolute;
  right: 10px;
  bottom: 24px;
  z-index: 3;
  pointer-events: none;
  border: 1px solid rgba(226, 232, 240, 0.28);
  border-radius: 999px;
  background: rgba(8, 13, 22, 0.68);
  color: rgba(248, 250, 252, 0.86);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
  font-size: 0.58rem;
  font-weight: 760;
  line-height: 1;
  letter-spacing: 0;
  padding: 5px 7px;
  backdrop-filter: blur(8px);
}

.render-trial-badge[hidden] {
  display: none !important;
}

.render-style-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 18px;
  margin-top: -2px;
}

.render-style-dots[hidden] {
  display: none;
}

.render-style-dot {
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 999px;
  background: rgba(142, 152, 170, 0.62);
  padding: 0;
  transition:
    transform 140ms ease,
    background 140ms ease,
    opacity 140ms ease;
}

.render-style-dot.is-active {
  background: #ffffff;
  transform: scale(1.28);
}

:root[data-theme="light"] .render-style-dot {
  background: rgba(125, 137, 154, 0.52);
}

:root[data-theme="light"] .render-style-dot.is-active {
  background: #1f2937;
}

:root[data-theme="light"] .render-swipe-frame {
  overflow: hidden;
  padding: 8px 8px 6px;
  border: 1px solid #c7d1df;
  border-radius: 8px;
  border-color: #c7d1df;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), transparent 32%),
    linear-gradient(180deg, #172235, #0c1220);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 16px 28px rgba(255, 255, 255, 0.035),
    0 16px 34px rgba(15, 23, 42, 0.14);
}

:root[data-theme="light"] .render-swipe-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -18px 34px rgba(0, 0, 0, 0.16);
}

:root[data-theme="light"] .render-swipe-frame .brain-svg {
  overflow: hidden;
  border-radius: 6px;
  background: #101827;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 0 42px rgba(0, 0, 0, 0.16);
}

:root[data-theme="light"] .render-swipe-frame .render-style-dots {
  margin-top: 4px;
}

:root[data-theme="light"] .render-swipe-frame .render-style-dot {
  background: rgba(148, 163, 184, 0.66);
}

:root[data-theme="light"] .render-swipe-frame .render-style-dot.is-active {
  background: #ffffff;
}

:root[data-theme="light"] .render-trial-badge {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.7);
  color: rgba(15, 23, 42, 0.76);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.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;
}

.neural-brain-fill {
  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;
  dominant-baseline: middle;
  paint-order: stroke;
  pointer-events: none;
  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;
}

.brain2-scene-bg {
  fill: transparent;
}

:root[data-theme="light"] .brain2-scene-bg {
  fill: #101827;
}

:root[data-theme="light"] .tree-scene-bg {
  fill: #101827;
}

:root[data-theme="light"] .leaf-scene-bg {
  fill: #111827;
}

:root[data-theme="light"] .tree-ground {
  fill: rgba(37, 45, 52, 0.62);
}

:root[data-theme="light"] .tree-moon {
  fill: rgba(255, 255, 255, 0.72);
  stroke: rgba(255, 255, 255, 0.92);
  filter:
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.34))
    drop-shadow(0 0 28px rgba(192, 220, 255, 0.38));
}

.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);
}

:root[data-theme="light"] .growth-tree-shadow {
  fill: rgba(86, 92, 104, 0.64);
}

:root[data-theme="light"] .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;
}

:root[data-theme="light"] .growth-tree-base-contact-pool,
:root[data-theme="light"] .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));
}

:root[data-theme="light"] .growth-tree-base-contact,
:root[data-theme="light"] .study-tree-base-contact {
  mix-blend-mode: screen;
}

:root[data-theme="light"] .growth-tree-base-contact {
  stroke: rgba(244, 214, 255, 0.74);
  filter: drop-shadow(0 0 6px rgba(226, 154, 255, 0.34));
}

:root[data-theme="light"] .study-tree-base-contact {
  stroke: rgba(190, 125, 76, 0.72);
  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;
}

:root[data-theme="light"] .tree1-stage-render {
  filter: none;
}

:root[data-theme="light"] .tree2-classic-render {
  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;
}

.share-note {
  margin: 2px 0 0;
  color: color-mix(in srgb, var(--muted) 78%, transparent);
  font-size: 0.72rem;
  font-weight: 620;
  letter-spacing: 0;
  text-align: center;
}

.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 fit-content(58%) max-content minmax(12px, 1fr) 32px;
  min-height: 46px;
  padding: 6px 8px;
}

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

.entry-copy {
  min-width: 0;
}

.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;
}

.entry-remove {
  grid-column: 5;
  width: 32px;
  height: 32px;
}

.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-visuals-section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.history-selected-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 2px 2px 0;
}

.history-selected-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.2;
}

.history-inline-total {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 760;
  text-align: right;
  white-space: nowrap;
}

.history-brain-grid .brain-panel:first-child .panel-heading {
  align-items: start;
  margin-bottom: 6px;
}

.history-brain-grid .brain-panel:first-child .panel-actions {
  align-items: start;
}

.history-summary-panel .panel-heading {
  align-items: start;
}

.add-history-activity-button {
  min-height: 32px;
  gap: 6px;
  padding-inline: 9px;
  font-size: 0.76rem;
  white-space: nowrap;
}

.add-history-activity-button svg {
  width: 14px;
  height: 14px;
}

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

.history-add-day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  margin-top: 8px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  color: var(--muted);
  font-size: 1.55rem;
  font-weight: 820;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease,
    color 120ms ease,
    box-shadow 120ms ease;
}

.history-add-day:hover,
.history-add-day:focus-visible {
  transform: translateY(-1px);
  border-color: var(--hover-line);
  background: var(--hover-bg);
  color: var(--ink);
}

.history-add-day:focus-visible {
  box-shadow: 0 0 0 4px var(--focus-ring);
  outline: none;
}

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

.custom-average-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
}

.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,
#customAverageApply {
  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-more-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  color: var(--muted);
  font-size: 1.28rem;
  font-weight: 850;
  letter-spacing: 0;
}

.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: 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-manager-row > .category-color-tools:last-child {
  grid-column: 3 / -1;
}

.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-session-actions {
  gap: 8px;
}

.account-session-actions .button-small {
  flex: 0 0 auto;
}

.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;
}

.inline-link,
.policy-card a,
.policy-back-link {
  color: var(--primary);
  font-weight: 760;
  text-decoration: none;
}

.inline-link:hover,
.policy-card a:hover,
.policy-back-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

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

.policy-shell {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 52px;
}

.policy-header {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.policy-header h1 {
  font-size: clamp(2.4rem, 10vw, 5rem);
}

.policy-updated {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 650;
}

.policy-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--panel-glow);
  padding: 22px;
}

.policy-card + .policy-card {
  margin-top: 14px;
}

.policy-card h2 {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 1.18rem;
}

.policy-card h3 {
  margin: 18px 0 6px;
  color: var(--ink);
  font-size: 0.98rem;
}

.policy-card p,
.policy-card li {
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 570;
  line-height: 1.65;
}

.policy-card p + p {
  margin-top: 12px;
}

.policy-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.support-form {
  display: grid;
  gap: 16px;
}

.support-field {
  display: grid;
  gap: 8px;
}

.support-field span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.support-field input,
.support-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-deep);
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  outline: none;
}

.support-field input {
  min-height: 52px;
  padding: 0 14px;
}

.support-field textarea {
  min-height: 168px;
  resize: vertical;
  padding: 14px;
  line-height: 1.45;
}

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

.support-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.support-status {
  min-height: 1.4em;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

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

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

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

.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: 230px;
}

.pricing-hero-panel {
  overflow: hidden;
  border-color: color-mix(in srgb, var(--pro-accent-line) 72%, var(--line));
  background:
    radial-gradient(circle at 10% 12%, color-mix(in srgb, var(--pro-accent) 16%, transparent), transparent 36%),
    linear-gradient(135deg, color-mix(in srgb, var(--pro-accent-soft) 78%, var(--panel)), var(--panel) 58%);
}

.pricing-plan-panel {
  position: relative;
  overflow: hidden;
  border-color: var(--pro-accent-line);
  background:
    radial-gradient(circle at 85% 10%, color-mix(in srgb, var(--pro-accent) 18%, transparent), transparent 34%),
    linear-gradient(160deg, color-mix(in srgb, var(--pro-accent-soft) 92%, var(--panel)), var(--panel) 62%);
  box-shadow:
    0 18px 44px var(--pro-accent-glow),
    var(--panel-glow),
    var(--shadow);
}

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

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

.pricing-badge {
  border: 1px solid color-mix(in srgb, var(--pro-accent-line) 76%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--pro-accent-soft) 72%, var(--surface));
  color: color-mix(in srgb, var(--ink) 78%, var(--pro-accent-strong));
  font-size: 0.78rem;
  font-weight: 760;
  padding: 8px 10px;
}

.pricing-badge {
  background: linear-gradient(135deg, var(--pro-accent), color-mix(in srgb, var(--pro-accent) 72%, #ffffff));
  color: var(--on-pro-accent);
  box-shadow: 0 10px 24px var(--pro-accent-glow);
}

.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(--pro-accent-strong);
  font-size: 3.4rem;
  font-weight: 850;
  line-height: 0.9;
}

.pricing-checkout {
  width: 100%;
  border-color: color-mix(in srgb, var(--pro-accent) 72%, var(--primary-line));
  background: linear-gradient(135deg, var(--pro-accent), color-mix(in srgb, var(--pro-accent) 70%, var(--primary)));
  color: var(--on-pro-accent);
  box-shadow: 0 14px 28px var(--pro-accent-glow);
}

.pricing-checkout:hover {
  border-color: color-mix(in srgb, var(--pro-accent-strong) 70%, var(--primary-hover));
  background: linear-gradient(135deg, var(--pro-accent-strong), color-mix(in srgb, var(--pro-accent) 72%, var(--primary-hover)));
}

.pricing-store-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pricing-store-actions[hidden] {
  display: none !important;
}

.pricing-store-actions .button {
  min-width: 0;
  min-height: 38px;
  padding-inline: 10px;
}

.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: 14px;
}

.pricing-feature {
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 94%, var(--surface-soft)), var(--surface));
  padding: 15px;
  box-shadow: 0 10px 24px color-mix(in srgb, #000000 5%, transparent);
}

.pricing-feature-highlight {
  border-color: var(--pro-accent-line);
  background:
    radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--pro-accent) 13%, transparent), transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--pro-accent-soft) 82%, var(--surface)), var(--surface));
  box-shadow: 0 14px 30px var(--pro-accent-glow);
}

.pricing-feature-icon {
  display: inline-grid;
  place-items: center;
  width: fit-content;
  min-width: 42px;
  height: 34px;
  max-width: 100%;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--pro-accent-line) 54%, var(--line));
  background: color-mix(in srgb, var(--pro-accent-soft) 62%, var(--surface-soft));
  color: color-mix(in srgb, var(--ink) 78%, var(--pro-accent-strong));
  font-size: 0.74rem;
  font-weight: 850;
  padding: 0 11px;
}

.pricing-feature-highlight .pricing-feature-icon {
  background: linear-gradient(135deg, var(--pro-accent), color-mix(in srgb, var(--pro-accent) 72%, #ffffff));
  color: var(--on-pro-accent);
  box-shadow: 0 10px 22px var(--pro-accent-glow);
}

.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,
.goal-modal,
.app-update-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,
.goal-modal::backdrop,
.app-update-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,
.goal-card,
.app-update-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,
.goal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

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

.pro-modal h2,
.feedback-card h2,
.goal-card h2,
.app-update-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),
.goal-card p:not(.eyebrow),
.app-update-card p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.5;
}

.app-update-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 760;
}

.app-update-button {
  width: 100%;
  justify-content: center;
}

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

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

.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,
.goal-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;
}

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

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

.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-more-tab {
  min-width: 42px;
  font-size: 1.15rem;
}

.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-more-option {
  display: grid;
  place-items: center;
  grid-template-columns: 1fr;
  min-height: 106px;
}

.render-style-plus {
  color: var(--muted);
  font-size: 2.25rem;
  font-weight: 780;
  line-height: 1;
}

.render-style-more-option:hover .render-style-plus {
  color: var(--ink);
}

.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 {
  position: relative;
  isolation: isolate;
  width: 82px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 7px;
  --preview-image: url("assets/brain-diagram-cutout-gray.png");
  --preview-position: center;
  --preview-size: contain;
  --preview-wash: linear-gradient(90deg, #df4c5f 0 25%, #2f7de1 25% 50%, #dca90d 50% 75%, #7862d5 75%);
  background: #101826;
  overflow: hidden;
}

.render-style-preview::before,
.render-style-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background-position: var(--preview-position);
  background-repeat: no-repeat;
  background-size: var(--preview-size);
}

.render-style-preview::before {
  z-index: 0;
  background-image: var(--preview-image);
  filter: saturate(0.92) contrast(1.05);
  opacity: 0.92;
}

.render-style-preview::after {
  z-index: 1;
  background: var(--preview-wash);
  mix-blend-mode: color;
  opacity: 0.74;
  -webkit-mask-image: var(--preview-image);
  mask-image: var(--preview-image);
  -webkit-mask-position: var(--preview-position);
  mask-position: var(--preview-position);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: var(--preview-size);
  mask-size: var(--preview-size);
}

.render-style-preview-hologram {
  --preview-image: url("assets/brain-diagram-cutout-gray.png");
  --preview-size: 122% auto;
  --preview-position: center;
  --preview-wash: linear-gradient(90deg, #df4c5f 0 22%, #2f7de1 22% 50%, #dca90d 50% 72%, #7862d5 72%);
}

.render-style-preview-tree1 {
  --preview-image: url("assets/tree-stage-10-line.png");
  --preview-size: 128% auto;
  --preview-position: center 58%;
  --preview-wash: conic-gradient(from 220deg at 50% 78%, #df4c5f, #2f7de1, #dca90d, #7862d5, #df4c5f);
}

.render-style-preview-tree2 {
  --preview-image: url("assets/tree1-classic.png");
  --preview-size: 112% auto;
  --preview-position: center 60%;
  --preview-wash: conic-gradient(from 210deg at 50% 78%, #123f7a, #1c86c8, #6d61d8, #28d0aa, #123f7a);
}

.render-style-preview-leafTree {
  --preview-image: url("assets/canopy-scene.png");
  --preview-size: cover;
  --preview-position: center;
  --preview-wash:
    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));
}

.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;
  width: 100vw;
  width: 100dvw;
  min-height: 100vh;
  min-height: 100dvh;
  z-index: 1200;
  pointer-events: auto;
  --tour-scrim: rgba(7, 11, 20, 0.64);
  --tour-target-accent: #f8fafc;
  --tour-target-ring: rgba(226, 232, 240, 0.36);
  --tour-target-ring-strong: rgba(255, 255, 255, 0.52);
  --tour-target-glow: rgba(226, 232, 240, 0.76);
  --tour-target-glow-strong: rgba(255, 255, 255, 0.96);
  --tour-callout-accent: #e5edf8;
  --tour-callout-ring: rgba(226, 232, 240, 0.2);
  --tour-callout-bg: #172033;
  --tour-callout-text: #f8fafc;
  --tour-callout-muted: #c7d2e3;
  --tour-connector-start: #ffffff;
  --tour-connector-end: #cbd5e1;
  --tour-connector-outline: rgba(7, 11, 20, 0.62);
  --tour-connector-shadow: rgba(226, 232, 240, 0.72);
}

:root[data-theme="light"] .tour-overlay {
  --tour-scrim: rgba(15, 23, 42, 0.38);
  --tour-target-accent: #243447;
  --tour-target-ring: rgba(15, 23, 42, 0.18);
  --tour-target-ring-strong: rgba(15, 23, 42, 0.28);
  --tour-target-glow: rgba(51, 65, 85, 0.46);
  --tour-target-glow-strong: rgba(51, 65, 85, 0.62);
  --tour-callout-accent: #334155;
  --tour-callout-ring: rgba(15, 23, 42, 0.12);
  --tour-callout-bg: #e8edf5;
  --tour-callout-text: #111827;
  --tour-callout-muted: #475569;
  --tour-connector-start: #334155;
  --tour-connector-end: #64748b;
  --tour-connector-outline: rgba(255, 255, 255, 0.74);
  --tour-connector-shadow: rgba(51, 65, 85, 0.34);
}

:root.is-tutorial-scroll-locked,
:root.is-tutorial-scroll-locked body {
  overscroll-behavior: none;
}

:root.is-tutorial-scroll-locked .tour-overlay {
  touch-action: none;
}

.tour-highlight {
  position: fixed;
  z-index: 1201;
  pointer-events: none;
  border: 3px solid var(--tour-target-accent);
  border-radius: 10px;
  box-shadow:
    0 0 0 9999px var(--tour-scrim),
    0 0 0 9px var(--tour-target-ring),
    0 0 46px var(--tour-target-glow);
  animation: tour-target-pulse 1.45s ease-in-out infinite;
  transition:
    left 180ms ease,
    top 180ms ease,
    width 180ms ease,
    height 180ms ease;
  will-change: left, top, width, height;
}

.tour-connector {
  position: fixed;
  z-index: 1202;
  height: 4px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, var(--tour-connector-start), var(--tour-connector-end));
  box-shadow:
    0 0 0 2px var(--tour-connector-outline),
    0 0 18px var(--tour-connector-shadow);
  pointer-events: none;
  transform-origin: left center;
  transition:
    left 180ms ease,
    top 180ms ease,
    width 180ms ease,
    transform 180ms ease;
  will-change: left, top, width, transform;
}

.tour-connector[hidden] {
  display: none !important;
}

.tour-connector::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -2px;
  width: 12px;
  height: 12px;
  border-top: 4px solid var(--tour-connector-end);
  border-right: 4px solid var(--tour-connector-end);
  transform: translateY(-50%) rotate(45deg);
}

.tour-callout {
  position: fixed;
  z-index: 1203;
  display: grid;
  gap: 13px;
  width: min(360px, calc(100vw - 28px));
  border: 2px solid var(--tour-callout-accent);
  border-radius: 10px;
  background: var(--tour-callout-bg, var(--panel));
  color: var(--tour-callout-text, var(--ink));
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.34),
    0 0 0 5px var(--tour-callout-ring);
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px;
  pointer-events: auto;
  -webkit-overflow-scrolling: touch;
  transition:
    left 180ms ease,
    top 180ms ease;
  will-change: left, top;
}

.tour-overlay.is-repositioning .tour-highlight,
.tour-overlay.is-repositioning .tour-connector,
.tour-overlay.is-repositioning .tour-callout {
  opacity: 0;
  transition-duration: 45ms;
  visibility: hidden;
}

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

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

.tour-callout.is-above::before {
  bottom: -8px;
  left: calc(var(--tour-anchor-x, 36px) - 7px);
  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(--tour-callout-text, var(--ink));
  font-size: 1.35rem;
  line-height: 1.08;
}

.tour-callout p:not(.eyebrow) {
  color: var(--tour-callout-muted, 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;
}

.tour-overlay.is-required .tour-close {
  display: none;
}

@keyframes tour-target-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 9999px var(--tour-scrim),
      0 0 0 9px var(--tour-target-ring),
      0 0 46px var(--tour-target-glow);
  }

  50% {
    box-shadow:
      0 0 0 9999px var(--tour-scrim),
      0 0 0 13px var(--tour-target-ring-strong),
      0 0 62px var(--tour-target-glow-strong);
  }
}

.action-toast-region {
  position: fixed;
  top: max(18px, calc(env(safe-area-inset-top) + 12px));
  right: max(14px, calc(env(safe-area-inset-right) + 12px));
  z-index: 1320;
  display: grid;
  justify-items: end;
  gap: 8px;
  max-width: min(320px, calc(100vw - 28px));
  pointer-events: none;
}

.action-toast {
  pointer-events: auto;
  min-height: 42px;
  border: 1px solid color-mix(in srgb, var(--primary-line) 54%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 16%, var(--panel)), var(--panel));
  color: var(--ink);
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 0.84rem;
  font-weight: 830;
  line-height: 1.2;
  opacity: 1;
  padding: 0 13px;
  transform: translateY(0) scale(1);
  transition:
    opacity 500ms ease,
    transform 500ms ease;
}

.action-toast.is-slow {
  transition-duration: 1000ms;
}

.action-toast.is-exiting {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
}

.center-toast-region {
  position: fixed;
  inset: 0;
  z-index: 1420;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}

.center-toast {
  max-width: min(320px, calc(100vw - 48px));
  border: 1px solid color-mix(in srgb, var(--primary-line) 58%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 18%, var(--panel)), var(--panel));
  color: var(--ink);
  box-shadow:
    0 24px 62px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  font-size: 0.95rem;
  font-weight: 850;
  line-height: 1.25;
  opacity: 1;
  padding: 13px 16px;
  text-align: center;
  transform: translateY(0) scale(1);
  transition:
    opacity 360ms ease,
    transform 360ms ease;
}

.center-toast.is-exiting {
  opacity: 0;
  transform: translateY(8px) scale(0.97);
}

.entry-item.is-new {
  animation: entry-added-pulse 1300ms ease both;
}

.saved-day-transfer {
  position: fixed;
  z-index: 1180;
  display: grid;
  align-content: center;
  gap: 2px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary-line) 64%, var(--line));
  border-radius: 9px;
  background:
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 45%),
    linear-gradient(135deg, var(--panel), color-mix(in srgb, var(--surface-soft) 78%, var(--panel)));
  color: var(--ink);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  padding: 10px 12px;
  pointer-events: none;
  transform-origin: center;
  transition:
    left 1120ms cubic-bezier(0.2, 0.8, 0.2, 1),
    top 1120ms cubic-bezier(0.2, 0.8, 0.2, 1),
    width 1120ms cubic-bezier(0.2, 0.8, 0.2, 1),
    height 1120ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 840ms ease,
    transform 1120ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.saved-day-transfer span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.saved-day-transfer strong {
  font-size: 0.92rem;
  line-height: 1.1;
}

.saved-day-transfer small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.saved-day-transfer.is-traveling {
  transform: scale(1.03);
}

.saved-day-transfer.is-expanding {
  opacity: 0;
  transform: scale(1.04);
}

.brain-svg.is-arrival,
.history-item.is-arrival {
  animation: saved-day-arrival 1520ms ease both;
}

@keyframes entry-added-pulse {
  0% {
    border-color: var(--primary-line);
    box-shadow:
      0 0 0 0 color-mix(in srgb, var(--primary) 34%, transparent),
      0 8px 18px color-mix(in srgb, #000000 12%, transparent);
    transform: translateY(-3px);
  }
  55% {
    border-color: var(--primary-line);
    box-shadow:
      0 0 0 5px color-mix(in srgb, var(--primary) 16%, transparent),
      0 12px 22px color-mix(in srgb, #000000 14%, transparent);
    transform: translateY(0);
  }
  100% {
    box-shadow: 0 8px 18px color-mix(in srgb, #000000 12%, transparent);
  }
}

@keyframes saved-day-arrival {
  0% {
    filter: brightness(1.2) saturate(1.18);
    transform: scale(0.985);
  }
  45% {
    filter: brightness(1.35) saturate(1.22);
    transform: scale(1.015);
  }
  100% {
    filter: none;
    transform: scale(1);
  }
}

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

.summary-row.has-goal-action {
  grid-template-columns: 12px minmax(0, 1fr) auto 30px;
}

.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;
}

.summary-goal-remove {
  align-self: start;
  width: 30px;
  height: 30px;
  opacity: 0.72;
}

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

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

.share-track.has-goal {
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
}

.share-goal-bar,
.share-progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
}

.share-goal-bar {
  opacity: 0.34;
}

.share-progress-bar {
  box-shadow: 0 0 14px color-mix(in srgb, currentColor 24%, transparent);
}

.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;
  }

  .topbar-main {
    width: 100%;
    align-items: start;
    flex-direction: column;
    gap: 12px;
  }

  .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;
  }

  .summary-panel .panel-heading,
  .history-summary-panel .panel-heading {
    flex-direction: row;
  }

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

  .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;
  }

  .label-mode-toggle {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .label-mode-button {
    flex: 1;
  }

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

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

  .entry-item .entry-remove {
    grid-column: 3;
  }

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

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

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

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

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

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

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

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

  .summary-goal-remove {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
  }

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

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

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

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

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

  .pro-modal h2,
  .feedback-card h2,
  .goal-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;
  }

  .tour-actions .button {
    flex: 1 1 0;
  }

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

  .feedback-actions,
  .goal-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-manager-row > .category-color-tools:last-child,
  .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);
  }
}

:root[data-display="tablet"] .app-shell {
  width: min(100% - 24px, 1180px);
  padding-top: 22px;
}

:root[data-display="tablet"] .topbar {
  align-items: flex-start;
}

:root[data-display="tablet"] .topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

:root[data-display="phone"] .app-shell {
  width: 100%;
  padding:
    max(24px, calc(env(safe-area-inset-top) + 10px))
    max(16px, calc(env(safe-area-inset-right) + 16px))
    30px
    max(16px, calc(env(safe-area-inset-left) + 16px));
}

:root[data-display="phone"] .topbar {
  align-items: stretch;
  gap: 12px;
  margin-bottom: 18px;
}

:root[data-display="phone"] .topbar-main {
  display: grid;
  gap: 10px;
}

:root[data-display="phone"] .topbar-main > div:first-child {
  min-width: 0;
}

:root[data-display="phone"] h1 {
  font-size: 2.22rem;
  line-height: 1;
}

:root[data-display="phone"] h2 {
  font-size: 0.96rem;
}

:root[data-display="phone"] .eyebrow {
  margin-bottom: 5px;
  font-size: 0.68rem;
}

:root[data-display="phone"] .topbar-actions {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) 48px 48px 48px;
  gap: 8px;
  margin-top: 4px;
}

:root[data-display="phone"] .topbar-actions .button {
  min-height: 48px;
  border-radius: 8px;
  padding-inline: 12px;
}

:root[data-display="phone"] .tutorial-button,
:root[data-display="phone"] .feedback-button {
  min-width: 0;
  width: 48px;
  justify-self: start;
  padding-inline: 0;
}

:root[data-display="phone"] .tutorial-button {
  grid-column: 2;
}

:root[data-display="phone"] .feedback-button {
  grid-column: 3;
}

:root[data-display="phone"] .tutorial-button span,
:root[data-display="phone"] .feedback-button span {
  display: none;
}

:root[data-display="phone"] .theme-toggle {
  grid-column: 4;
  min-width: 0;
  padding-inline: 0;
}

:root[data-display="phone"] #saveDay {
  grid-column: 1;
  min-height: 48px;
}

:root[data-display="phone"] .view-tabs {
  position: sticky;
  top: 0;
  z-index: 16;
  display: flex;
  width: calc(100% - 4px);
  margin: 0 auto 16px;
  overflow-x: auto;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
  padding: 7px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  backdrop-filter: blur(14px);
}

:root[data-display="phone"] .view-tabs::-webkit-scrollbar {
  display: none;
}

:root[data-display="phone"] .tab-button {
  flex: 0 0 auto;
  min-width: 78px;
  min-height: 36px;
  border-radius: 7px;
  padding: 0 12px;
  scroll-snap-align: start;
}

:root[data-display="phone"] .workspace,
:root[data-display="phone"] .history-main,
:root[data-display="phone"] .report-view {
  gap: 12px;
}

:root[data-display="phone"] .entry-panel,
:root[data-display="phone"] .entry-panel.is-custom {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-top: 40px;
  padding: 14px;
}

:root[data-display="phone"] .entry-mode-tabs {
  top: -40px;
  right: 10px;
}

:root[data-display="phone"] .entry-mode-tab {
  min-width: 74px;
  min-height: 40px;
  padding-inline: 13px;
}

:root[data-display="phone"] .field-wide,
:root[data-display="phone"] .field-category,
:root[data-display="phone"] .field-time,
:root[data-display="phone"] .entry-panel.is-custom .field-category,
:root[data-display="phone"] .entry-panel.is-custom .custom-category-field {
  grid-column: 1 / -1;
}

:root[data-display="phone"] .field-time {
  justify-items: start;
}

:root[data-display="phone"] .entry-panel.is-custom .color-field {
  grid-column: 1;
}

:root[data-display="phone"] .field {
  gap: 6px;
  font-size: 0.7rem;
}

:root[data-display="phone"] .field input,
:root[data-display="phone"] .field select {
  min-height: 46px;
  border-radius: 6px;
  font-size: 16px;
  padding-inline: 10px;
}

:root[data-display="phone"] .field-time input {
  width: 128px;
  max-width: 100%;
}

:root[data-display="phone"] .timer-display {
  width: 128px;
  max-width: 100%;
}

:root[data-display="phone"] .form-actions {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

:root[data-display="phone"] .brain-grid,
:root[data-display="phone"] .detail-grid,
:root[data-display="phone"] .history-grid,
:root[data-display="phone"] .category-grid,
:root[data-display="phone"] .account-grid,
:root[data-display="phone"] .report-metric-grid,
:root[data-display="phone"] .report-visual-grid,
:root[data-display="phone"] .report-detail-grid,
:root[data-display="phone"] .pricing-layout,
:root[data-display="phone"] .pricing-feature-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

:root[data-display="phone"] .brain-panel,
:root[data-display="phone"] .detail-panel {
  border-radius: 8px;
  padding: 14px;
}

:root[data-display="phone"] .panel-heading {
  gap: 10px;
  margin-bottom: 12px;
}

:root[data-display="phone"] .summary-panel .panel-heading,
:root[data-display="phone"] .history-summary-panel .panel-heading {
  align-items: start;
  flex-direction: row;
}

:root[data-display="phone"] .summary-panel .panel-heading > div,
:root[data-display="phone"] .history-summary-panel .panel-heading > div {
  min-width: 0;
}

:root[data-display="phone"] .log-panel .panel-heading {
  align-items: start;
  flex-direction: row;
}

:root[data-display="phone"] .log-panel .panel-heading > div {
  min-width: 0;
}

:root[data-display="phone"] .log-total {
  flex: 0 0 auto;
  margin-left: auto;
}

:root[data-display="phone"] .brain-panel .panel-actions {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: stretch;
}

:root[data-display="phone"] .detected-pill,
:root[data-display="phone"] .density-chip {
  justify-self: start;
  max-width: 100%;
  padding: 7px 11px;
  white-space: normal;
}

:root[data-display="phone"] .label-mode-toggle {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
}

:root[data-display="phone"] .history-brain-grid .brain-panel:first-child .label-mode-toggle {
  grid-column: 1;
  grid-row: 1;
  width: auto;
  align-self: start;
}

:root[data-display="phone"] .history-brain-grid .brain-panel:first-child .panel-actions {
  grid-template-columns: minmax(142px, 1fr) auto;
  align-items: start;
}

:root[data-display="phone"] .label-mode-button {
  flex: 1;
  min-width: 0;
  padding-inline: 6px;
}

:root[data-display="phone"] .render-style-button {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: stretch;
  min-width: 0;
  min-height: 42px;
  font-size: 0.76rem;
}

:root[data-display="phone"] .brain-panel .panel-actions > .icon-button {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}

:root[data-display="phone"] .render-style-button span {
  overflow: hidden;
  text-overflow: ellipsis;
}

:root[data-display="phone"] .brain-svg {
  max-height: 292px;
  overflow: hidden;
}

:root[data-display="phone"] .segment-label {
  font-size: 24px;
  stroke-width: 5px;
}

:root[data-display="phone"] .verification-bar-label {
  font-size: 18px;
  stroke-width: 4px;
}

:root[data-display="phone"] .entry-item {
  grid-template-columns: 10px minmax(0, 1fr) 36px;
  column-gap: 8px;
  row-gap: 3px;
  min-height: 48px;
  padding: 8px;
}

:root[data-display="phone"] .entry-item .entry-hours {
  grid-column: 2;
  line-height: 1.05;
  margin-top: -3px;
}

:root[data-display="phone"] .entry-item .entry-remove {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  width: 32px;
  height: 32px;
}

:root[data-display="phone"] .report-header-panel,
:root[data-display="phone"] .report-actions,
:root[data-display="phone"] .feedback-actions,
:root[data-display="phone"] .goal-actions,
:root[data-display="phone"] .create-account-actions {
  align-items: stretch;
  flex-direction: column;
}

:root[data-display="phone"] .report-total-chip,
:root[data-display="phone"] .report-actions .button {
  width: 100%;
}

:root[data-display="phone"] .render-style-modal,
:root[data-display="phone"] .pro-modal,
:root[data-display="phone"] .feedback-modal,
:root[data-display="phone"] .goal-modal,
:root[data-display="phone"] .create-account-modal,
:root[data-display="phone"] .app-update-modal {
  width: calc(100% - 20px);
  max-height: calc(100dvh - 20px);
}

:root[data-display="phone"] .render-style-card,
:root[data-display="phone"] .pro-modal-card,
:root[data-display="phone"] .feedback-card,
:root[data-display="phone"] .goal-card,
:root[data-display="phone"] .create-account-card,
:root[data-display="phone"] .app-update-card {
  max-height: calc(100dvh - 20px);
  overflow: auto;
  padding: 18px;
}

:root[data-display="phone"] .render-style-option {
  grid-template-columns: 70px minmax(0, 1fr);
  min-height: 88px;
  padding: 10px;
}

:root[data-display="phone"] .render-style-preview {
  width: 70px;
  height: 62px;
}

:root[data-display="phone"] .render-preview-stage {
  min-height: 310px;
}

:root[data-display="phone"] .premium-preview-button {
  bottom: 18px;
  width: calc(100% - 36px);
  padding-inline: 12px;
}

:root[data-display="phone"] .neural-brain-fill {
  fill: #172638;
  opacity: 0.62;
}

:root[data-display="phone"] .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;
}

:root[data-display="phone"] .brain-raster-base {
  opacity: 0.14;
}

:root[data-display="phone"] .brain-raster-overlay {
  opacity: 0.34;
}

:root[data-display="phone"] .brain-color-segment {
  opacity: 0.66;
}

:root[data-display="phone"] .brain-color-glow {
  opacity: 0.32;
}

:root[data-display="phone"] .stem-path,
:root[data-display="phone"] .stem-glow,
:root[data-display="phone"] .stem-core,
:root[data-display="phone"] .stem-spark,
:root[data-display="phone"] .stem-node {
  mix-blend-mode: screen;
}

:root[data-display="phone"] .stem-glow {
  filter: saturate(1.75) brightness(1.12) contrast(1.08);
  opacity: 0.9;
}

:root[data-display="phone"] .stem-core {
  filter: saturate(1.75) brightness(1.1) contrast(1.12);
  opacity: 0.92;
}

:root[data-display="phone"] .stem-node {
  opacity: 0.88;
}

:root[data-display="phone"] .brain-hologram-wash {
  fill: rgba(246, 253, 255, 0.1);
}

:root[data-shell="native"] {
  color-scheme: dark;
  --bg: #090f18;
  --panel: rgba(17, 24, 36, 0.96);
  --surface: #141c2a;
  --surface-soft: #202a3a;
  --chip-bg: rgba(20, 28, 42, 0.9);
  --tab-bg: rgba(15, 22, 33, 0.96);
  --ink: #eef4ff;
  --muted: #a7b2c5;
  --line: #344259;
  --focus: #7aafff;
  --focus-ring: rgba(122, 175, 255, 0.22);
  --hover-bg: #1d2736;
  --hover-line: #55667f;
  --primary: #4f8dff;
  --primary-hover: #6ca1ff;
  --primary-line: #77aaff;
  --on-primary: #07111f;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  scroll-padding-top: max(82px, calc(env(safe-area-inset-top) + 72px));
  scroll-padding-bottom: max(132px, calc(env(safe-area-inset-bottom) + 122px));
}

:root[data-shell="native"] body {
  min-height: 100dvh;
  background: var(--bg);
}

:root[data-shell="native"] .app-shell {
  width: 100%;
  min-height: 100dvh;
  padding:
    max(16px, calc(env(safe-area-inset-top) + 10px))
    max(14px, calc(env(safe-area-inset-right) + 14px))
    max(132px, calc(env(safe-area-inset-bottom) + 122px))
    max(14px, calc(env(safe-area-inset-left) + 14px));
}

:root[data-shell="native"] .view-pane {
  animation: native-pane-in 180ms ease both;
}

:root[data-shell="native"] .topbar {
  position: relative;
  top: auto;
  z-index: 20;
  align-items: center;
  gap: 10px;
  margin: -10px -6px 18px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
  padding: 10px;
  backdrop-filter: blur(18px);
}

:root[data-shell="native"] .topbar-main > div:first-child {
  min-width: 0;
}

:root[data-shell="native"] .topbar .eyebrow {
  display: none;
}

:root[data-shell="native"] h1 {
  font-size: 1.25rem;
  line-height: 1;
}

:root[data-shell="native"] .topbar-actions {
  flex: 0 0 auto;
  gap: 7px;
}

:root[data-shell="native"] .topbar-actions .button {
  min-width: 42px;
  min-height: 42px;
  padding-inline: 11px;
}

:root[data-shell="native"] .tutorial-button span,
:root[data-shell="native"] .feedback-button span,
:root[data-shell="native"] .theme-toggle span,
:root[data-shell="native"] #saveDay span {
  display: none;
}

:root[data-shell="native"] .view-tabs {
  position: fixed;
  top: auto;
  right: max(10px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  left: max(10px, env(safe-area-inset-left));
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  width: auto;
  margin: 0;
  overflow: visible;
  border-radius: 14px;
  background: color-mix(in srgb, var(--tab-bg) 92%, transparent);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
  padding: 6px;
  scroll-snap-type: none;
  backdrop-filter: blur(20px);
}

:root[data-shell="native"] .tab-button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 56px;
  border-radius: 10px;
  padding: 0 3px;
  font-size: clamp(0.56rem, 2.25vw, 0.72rem);
  line-height: 1;
}

:root[data-shell="native"] .tab-button svg {
  display: block;
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

:root[data-shell="native"] .tab-button span {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
}

:root[data-shell="native"] .tab-button.is-active {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--on-primary) 18%, transparent);
}

:root[data-billing="restricted"] #pricingTab,
:root[data-billing="restricted"] #billingPortalButton,
:root[data-billing="restricted"] #proModalUpgrade,
:root[data-billing="restricted"] #proModalPricing,
:root[data-billing="restricted"] .pricing-price,
:root[data-billing="restricted"] .pricing-badge {
  display: none !important;
}

:root[data-billing="restricted"] .pricing-checkout {
  box-shadow: none;
}

:root[data-shell="native"] .workspace {
  gap: 13px;
}

:root[data-shell="native"] .entry-panel,
:root[data-shell="native"] .entry-panel.is-custom,
:root[data-shell="native"] .brain-grid,
:root[data-shell="native"] .detail-grid,
:root[data-shell="native"] .history-grid,
:root[data-shell="native"] .category-grid,
:root[data-shell="native"] .account-grid,
:root[data-shell="native"] .report-metric-grid,
:root[data-shell="native"] .report-visual-grid,
:root[data-shell="native"] .report-detail-grid,
:root[data-shell="native"] .pricing-layout,
:root[data-shell="native"] .pricing-feature-grid {
  grid-template-columns: minmax(0, 1fr);
}

:root[data-shell="native"] .entry-panel,
:root[data-shell="native"] .entry-panel.is-custom {
  gap: 12px;
  align-items: stretch;
  margin-top: 42px;
  padding: 14px;
  scroll-margin-top: max(82px, calc(env(safe-area-inset-top) + 72px));
  scroll-margin-bottom: max(132px, calc(env(safe-area-inset-bottom) + 122px));
}

:root[data-shell="native"] .entry-mode-tabs {
  top: -42px;
  right: 12px;
}

:root[data-shell="native"] .entry-mode-tab {
  min-width: 86px;
  min-height: 42px;
  font-size: 0.82rem;
}

:root[data-shell="native"] .field-wide,
:root[data-shell="native"] .field-time,
:root[data-shell="native"] .field-category,
:root[data-shell="native"] .entry-panel.is-custom .field-category,
:root[data-shell="native"] .entry-panel.is-custom .custom-category-field,
:root[data-shell="native"] .entry-panel.is-custom .color-field,
:root[data-shell="native"] .form-actions {
  grid-column: 1 / -1;
}

:root[data-shell="native"] .field input,
:root[data-shell="native"] .field select,
:root[data-shell="native"] .timer-display {
  min-height: 48px;
  font-size: 16px;
  scroll-margin-bottom: max(132px, calc(env(safe-area-inset-bottom) + 122px));
}

:root[data-shell="native"] .form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

:root[data-shell="native"] .brain-panel,
:root[data-shell="native"] .detail-panel {
  border-radius: 10px;
  padding: 14px;
}

:root[data-shell="native"] .panel-heading {
  gap: 10px;
}

:root[data-shell="native"] .panel-actions {
  gap: 7px;
}

:root[data-shell="native"] .entry-list,
:root[data-shell="native"] .summary-list,
:root[data-shell="native"] .history-list {
  gap: 10px;
}

:root[data-shell="native"] .brain-svg {
  max-height: min(320px, 66vw);
}

:root[data-shell="native"] .history-main,
:root[data-shell="native"] .report-view {
  gap: 13px;
}

:root[data-shell="native"] .history-list-panel {
  order: -1;
}

:root[data-shell="native"] .share-note {
  display: none;
}

:root[data-shell="native"] {
  --native-bottom-bar: max(92px, calc(env(safe-area-inset-bottom) + 86px));
  --native-top-bar: max(144px, calc(env(safe-area-inset-top) + 132px));
}

:root[data-shell="native"] body::before {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 19;
  height: var(--native-top-bar);
  background: linear-gradient(180deg, #05080d 0%, #05080d 56%, rgba(5, 8, 13, 0) 100%);
  content: "";
  pointer-events: none;
}

:root[data-shell="native"][data-view="today"] {
  --native-top-bar: env(safe-area-inset-top);
}

:root[data-shell="native"][data-view="today"] body::before {
  background: #05080d;
}

:root[data-shell="native"][data-theme="light"] body::before {
  background: linear-gradient(180deg, #f6f8fc 0%, #f6f8fc 56%, rgba(246, 248, 252, 0) 100%);
}

:root[data-shell="native"][data-theme="light"][data-view="today"] body::before {
  background: #f6f8fc;
}

:root[data-shell="native"] body::after {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 29;
  height: var(--native-bottom-bar);
  background: linear-gradient(180deg, rgba(3, 5, 9, 0) 0%, #030509 28%, #030509 100%);
  content: "";
  pointer-events: none;
}

:root[data-shell="native"]:not([data-view="today"]) {
  --native-top-bar: max(34px, calc(env(safe-area-inset-top) + 14px));
}

:root[data-shell="native"]:not([data-view="today"]) body::before {
  background: #0b111b;
}

:root[data-shell="native"][data-theme="light"]:not([data-view="today"]) body::before {
  background: #f6f8fc;
}

:root[data-shell="native"] .topbar[hidden] {
  display: none !important;
  margin: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

:root[data-shell="native"] .app-shell {
  padding-bottom: max(148px, calc(env(safe-area-inset-bottom) + 136px));
}

:root[data-shell="native"] .topbar {
  align-items: stretch;
  border-color: rgba(96, 117, 148, 0.42);
  background:
    linear-gradient(135deg, rgba(21, 31, 48, 0.98), rgba(10, 16, 27, 0.98) 58%, rgba(15, 28, 48, 0.98));
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.3);
}

:root[data-shell="native"] .topbar-actions {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) 44px 44px 44px;
  gap: 8px;
}

:root[data-shell="native"] .tutorial-button,
:root[data-shell="native"] .feedback-button,
:root[data-shell="native"] .theme-toggle {
  width: 44px;
  min-width: 44px;
  min-height: 46px;
  padding: 0;
}

:root[data-shell="native"] .tutorial-button {
  grid-column: 2;
  grid-row: 1;
}

:root[data-shell="native"] .feedback-button {
  grid-column: 3;
  grid-row: 1;
}

:root[data-shell="native"] .theme-toggle {
  grid-column: 4;
  grid-row: 1;
}

:root[data-shell="native"] #saveDay {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  min-height: 46px;
  border-color: color-mix(in srgb, var(--primary-line) 64%, transparent);
  box-shadow: 0 12px 24px rgba(79, 141, 255, 0.26);
  padding-inline: 14px;
}

:root[data-shell="native"] #saveDay span {
  display: inline;
}

:root[data-shell="native"] .view-tabs {
  right: max(10px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  left: max(10px, env(safe-area-inset-left));
  z-index: 30;
  border-color: rgba(82, 99, 125, 0.72);
  background: #070b12;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03),
    0 18px 46px rgba(0, 0, 0, 0.48);
  backdrop-filter: none;
}

:root[data-shell="native"] .entry-panel,
:root[data-shell="native"] .entry-panel.is-custom {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 0;
  border-color: rgba(87, 105, 135, 0.58);
  background:
    linear-gradient(180deg, rgba(23, 33, 51, 0.98), rgba(13, 20, 32, 0.98)),
    var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 16px 34px rgba(0, 0, 0, 0.28);
  padding: 12px;
}

:root[data-shell="native"] .entry-mode-tabs {
  position: static;
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  border: 1px solid rgba(73, 89, 117, 0.76);
  border-radius: 8px;
  background: rgba(5, 10, 18, 0.82);
  padding: 3px;
}

:root[data-shell="native"] .entry-mode-tab {
  min-width: 0;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: #aab5c8;
  font-size: 0.84rem;
  transform: none;
}

:root[data-shell="native"] .entry-mode-tab + .entry-mode-tab {
  margin-left: 0;
}

:root[data-shell="native"] .entry-mode-tab.is-active {
  background: linear-gradient(180deg, #263653, #1c2940);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.22);
  color: #f3f7ff;
  transform: none;
}

:root[data-shell="native"] .entry-mode-tab.is-active::after {
  display: none;
}

:root[data-shell="native"] .field {
  gap: 7px;
  border: 1px solid rgba(65, 81, 108, 0.72);
  border-radius: 8px;
  background: rgba(9, 15, 25, 0.74);
  padding: 9px;
}

:root[data-shell="native"] .field span {
  color: #9faabd;
  font-size: 0.68rem;
}

:root[data-shell="native"] .field-wide {
  grid-column: 1 / -1;
}

:root[data-shell="native"] .field-category,
:root[data-shell="native"] .entry-panel.is-custom .field-category {
  grid-column: 1;
  grid-row: 3;
}

:root[data-shell="native"] .field-time {
  grid-column: 2;
  grid-row: 3;
  justify-items: stretch;
}

:root[data-shell="native"] .entry-panel.is-custom .custom-category-field {
  grid-column: 1;
}

:root[data-shell="native"] .entry-panel.is-custom .color-field {
  grid-column: 2;
}

:root[data-shell="native"] .field input,
:root[data-shell="native"] .field select,
:root[data-shell="native"] .timer-display {
  width: 100%;
  min-height: 42px;
  border-color: rgba(83, 101, 132, 0.64);
  border-radius: 7px;
  background: rgba(13, 21, 34, 0.95);
  padding-inline: 10px;
}

:root[data-shell="native"] .field-time input,
:root[data-shell="native"] .timer-display {
  max-width: none;
}

:root[data-shell="native"] .form-actions {
  grid-column: 1 / -1;
  gap: 10px;
  margin-top: 2px;
}

:root[data-shell="native"] .form-actions .button {
  min-height: 48px;
  border-radius: 8px;
}

/* Native app polish layer. */
:root[data-shell="native"] {
  --bg: #080d14;
  --surface: #121a28;
  --surface-soft: #182235;
  --panel: rgba(15, 23, 36, 0.98);
  --chip-bg: rgba(20, 29, 44, 0.92);
  --tab-bg: rgba(10, 16, 26, 0.96);
  --ink: #f3f7ff;
  --muted: #a8b3c6;
  --line: #2a3548;
  --hover-bg: #1a2638;
  --hover-line: #52627c;
  --primary: #4f8dff;
  --primary-hover: #6ca1ff;
  --primary-line: #82afff;
  --on-primary: #06111f;
  --pro-accent: #cdd6e3;
  --pro-accent-strong: #f7f9fc;
  --pro-accent-line: rgba(205, 214, 227, 0.46);
  --pro-accent-soft: rgba(205, 214, 227, 0.13);
  --pro-accent-glow: rgba(205, 214, 227, 0.18);
  --on-pro-accent: #101722;
  --shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
  --panel-glow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --native-card: rgba(16, 24, 38, 0.98);
  --native-card-soft: rgba(21, 31, 47, 0.96);
  --native-field: rgba(9, 15, 25, 0.74);
  --native-input: rgba(13, 21, 34, 0.95);
  --native-elevated: 0 12px 28px rgba(0, 0, 0, 0.2);
  --native-hairline: rgba(87, 105, 135, 0.58);
}

:root[data-shell="native"][data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #edf2f8;
  --panel: rgba(255, 255, 255, 0.98);
  --chip-bg: rgba(255, 255, 255, 0.95);
  --tab-bg: rgba(255, 255, 255, 0.98);
  --ink: #172033;
  --muted: #667085;
  --line: #d7dee9;
  --focus: #2563eb;
  --focus-ring: rgba(37, 99, 235, 0.16);
  --hover-bg: #f4f7fb;
  --hover-line: #aebccd;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-line: #2d6cf3;
  --on-primary: #ffffff;
  --pro-accent: #d89b1f;
  --pro-accent-strong: #8e5705;
  --pro-accent-line: rgba(202, 137, 21, 0.5);
  --pro-accent-soft: rgba(246, 188, 78, 0.18);
  --pro-accent-glow: rgba(202, 137, 21, 0.2);
  --on-pro-accent: #2d1b03;
  --shadow: 0 14px 34px rgba(27, 39, 64, 0.12);
  --panel-glow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  --native-card: rgba(255, 255, 255, 0.98);
  --native-card-soft: rgba(247, 250, 254, 0.98);
  --native-field: rgba(248, 251, 255, 0.96);
  --native-input: #ffffff;
  --native-elevated: 0 12px 28px rgba(27, 39, 64, 0.1);
  --native-hairline: rgba(191, 203, 219, 0.9);
}

:root[data-shell="native"] body {
  background:
    linear-gradient(180deg, #0b111b 0, #080d14 40%, #060a10 100%),
    var(--bg);
}

:root[data-shell="native"][data-theme="light"] body {
  background:
    linear-gradient(180deg, #f9fbff 0, #f2f6fb 42%, #eaf0f7 100%),
    var(--bg);
}

:root[data-shell="native"][data-theme="light"] body::before {
  background: linear-gradient(180deg, #f7faff 0%, #f7faff 56%, rgba(247, 250, 255, 0) 100%);
}

:root[data-shell="native"][data-theme="light"] body::after {
  background: linear-gradient(180deg, rgba(247, 250, 255, 0) 0%, #f7faff 28%, #f7faff 100%);
}

:root[data-shell="native"][data-theme="light"]:not([data-view="today"]) body::before {
  background: #f7faff;
}

:root[data-shell="native"] .app-shell {
  padding-top: max(32px, calc(env(safe-area-inset-top) + 22px));
}

:root[data-shell="native"] .topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  top: auto;
  margin: 4px 0 18px;
  border-radius: 8px;
  border-color: var(--native-hairline);
  background:
    linear-gradient(135deg, rgba(24, 34, 52, 0.98), rgba(10, 16, 27, 0.98) 58%, rgba(16, 29, 48, 0.98));
  box-shadow: var(--native-elevated);
  padding: 14px;
}

:root[data-shell="native"][data-theme="light"] .topbar {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.99), rgba(246, 249, 253, 0.99) 58%, rgba(236, 243, 252, 0.99));
}

:root[data-shell="native"] .topbar-main {
  display: grid;
  gap: 4px;
}

:root[data-shell="native"] .topbar .eyebrow {
  display: block;
  margin: 0;
  color: color-mix(in srgb, var(--muted) 86%, transparent);
  font-size: 0.7rem;
}

:root[data-shell="native"] h1 {
  font-size: 1.38rem;
  font-weight: 850;
}

:root[data-shell="native"] .topbar-actions {
  grid-template-columns: minmax(0, 1fr) 46px 46px 46px;
  gap: 8px;
}

:root[data-shell="native"] .tutorial-button,
:root[data-shell="native"] .feedback-button,
:root[data-shell="native"] .theme-toggle {
  width: 46px;
  min-width: 46px;
  min-height: 46px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

:root[data-shell="native"] #saveDay {
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 820;
}

:root[data-shell="native"] .view-tabs {
  border-radius: 8px;
  border-color: color-mix(in srgb, var(--line) 72%, transparent);
  background: #05080d;
  padding: 7px;
}

:root[data-shell="native"][data-theme="light"] .view-tabs {
  border-color: rgba(202, 212, 226, 0.96);
  background: #ffffff;
  box-shadow:
    0 0 0 1px rgba(12, 18, 32, 0.03),
    0 18px 42px rgba(17, 24, 39, 0.17);
}

:root[data-shell="native"] .tab-button {
  min-height: 54px;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 760;
}

:root[data-shell="native"] .tab-button.is-active {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 8px 16px color-mix(in srgb, var(--primary) 22%, transparent);
}

:root[data-shell="native"][data-theme="light"] .tab-button.is-active {
  color: #ffffff;
}

:root[data-shell="native"] .workspace,
:root[data-shell="native"] .history-main,
:root[data-shell="native"] .report-view {
  gap: 14px;
}

:root[data-shell="native"] .entry-panel,
:root[data-shell="native"] .entry-panel.is-custom {
  gap: 11px;
  margin-top: 6px;
  border-color: var(--native-hairline);
  border-radius: 8px;
  background: var(--native-card);
  box-shadow: var(--native-elevated);
  padding: 13px;
}

:root[data-shell="native"] .entry-mode-tabs {
  border-color: var(--native-hairline);
  background: color-mix(in srgb, var(--surface-soft) 76%, transparent);
}

:root[data-shell="native"] .entry-mode-tab {
  color: var(--muted);
}

:root[data-shell="native"] .entry-mode-tab.is-active {
  background: var(--surface);
  box-shadow: 0 7px 14px rgba(0, 0, 0, 0.14);
  color: var(--ink);
}

:root[data-shell="native"][data-theme="light"] .entry-mode-tab.is-active {
  box-shadow: 0 7px 14px rgba(27, 39, 64, 0.1);
}

:root[data-shell="native"] .field {
  border-color: color-mix(in srgb, var(--line) 76%, transparent);
  background: var(--native-field);
}

:root[data-shell="native"] .field span {
  color: var(--muted);
  font-weight: 800;
}

:root[data-shell="native"] .field input,
:root[data-shell="native"] .field select,
:root[data-shell="native"] .timer-display {
  border-color: color-mix(in srgb, var(--line) 78%, transparent);
  background: var(--native-input);
  color: var(--ink);
}

:root[data-shell="native"] .button,
:root[data-shell="native"] .icon-button {
  border-radius: 8px;
}

:root[data-shell="native"] .button-primary {
  box-shadow: 0 10px 20px color-mix(in srgb, var(--primary) 24%, transparent);
}

:root[data-shell="native"] .brain-panel,
:root[data-shell="native"] .detail-panel,
:root[data-shell="native"] .report-metric,
:root[data-shell="native"] .pricing-feature,
:root[data-shell="native"] .account-feature,
:root[data-shell="native"] .entry-item,
:root[data-shell="native"] .summary-row,
:root[data-shell="native"] .history-item,
:root[data-shell="native"] .category-manager-row,
:root[data-shell="native"] .report-category-row,
:root[data-shell="native"] .report-highlight,
:root[data-shell="native"] .custom-average-box {
  border-color: var(--native-hairline);
  border-radius: 8px;
  background: var(--native-card);
  box-shadow: 0 8px 18px color-mix(in srgb, #000000 12%, transparent);
}

:root[data-shell="native"][data-theme="light"] .brain-panel,
:root[data-shell="native"][data-theme="light"] .detail-panel,
:root[data-shell="native"][data-theme="light"] .report-metric,
:root[data-shell="native"][data-theme="light"] .pricing-feature,
:root[data-shell="native"][data-theme="light"] .account-feature,
:root[data-shell="native"][data-theme="light"] .entry-item,
:root[data-shell="native"][data-theme="light"] .summary-row,
:root[data-shell="native"][data-theme="light"] .history-item,
:root[data-shell="native"][data-theme="light"] .category-manager-row,
:root[data-shell="native"][data-theme="light"] .report-category-row,
:root[data-shell="native"][data-theme="light"] .report-highlight,
:root[data-shell="native"][data-theme="light"] .custom-average-box {
  box-shadow: 0 8px 18px rgba(27, 39, 64, 0.08);
}

:root[data-shell="native"] .brain-panel,
:root[data-shell="native"] .detail-panel {
  padding: 15px;
}

:root[data-shell="native"] .panel-heading {
  align-items: start;
  gap: 10px;
  margin-bottom: 14px;
}

:root[data-shell="native"] .panel-heading h2 {
  font-size: 1.02rem;
  font-weight: 850;
}

:root[data-shell="native"] .detected-pill,
:root[data-shell="native"] .density-chip,
:root[data-shell="native"] .plan-chip,
:root[data-shell="native"] .pricing-badge {
  border-color: color-mix(in srgb, var(--line) 76%, transparent);
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
  color: var(--muted);
}

:root[data-shell="native"] .history-item,
:root[data-shell="native"] .entry-item,
:root[data-shell="native"] .summary-row {
  min-height: 58px;
}

:root[data-shell="native"] .history-more-button {
  min-height: 44px;
}

:root[data-shell="native"] .history-item.is-active {
  border-color: var(--primary-line);
  background: color-mix(in srgb, var(--primary) 11%, var(--native-card));
  box-shadow:
    0 0 0 3px var(--focus-ring),
    0 8px 18px color-mix(in srgb, #000000 10%, transparent);
}

:root[data-shell="native"] .history-add-day {
  min-height: 60px;
  border-radius: 8px;
  border-color: color-mix(in srgb, var(--primary-line) 48%, var(--line));
  background: color-mix(in srgb, var(--primary) 8%, var(--native-card));
  color: var(--primary-line);
}

:root[data-shell="native"] .report-header-panel {
  align-items: stretch;
}

:root[data-shell="native"] .report-title-block h2,
:root[data-shell="native"] .pricing-hero-panel h2 {
  font-size: clamp(1.55rem, 8vw, 2.2rem);
  line-height: 1;
}

:root[data-shell="native"] .report-metric strong {
  font-size: 1.42rem;
}

:root[data-shell="native"] .account-card {
  margin-top: 0;
  border-color: color-mix(in srgb, var(--primary-line) 38%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 18%, var(--native-card)), var(--native-card));
  box-shadow: var(--native-elevated);
}

:root[data-shell="native"][data-theme="light"] .account-card .eyebrow {
  color: #2563eb;
}

:root[data-shell="native"] .account-feature-icon,
:root[data-shell="native"] .pricing-feature-icon {
  background: color-mix(in srgb, var(--primary) 10%, var(--surface-soft));
  color: var(--ink);
}

:root[data-shell="native"] .pricing-hero-panel,
:root[data-shell="native"] .pricing-plan-panel {
  border-color: color-mix(in srgb, var(--pro-accent-line) 78%, var(--native-hairline));
}

:root[data-shell="native"] .pricing-hero-panel .eyebrow,
:root[data-shell="native"] .pricing-plan-panel .eyebrow {
  color: color-mix(in srgb, var(--pro-accent-strong) 76%, var(--muted));
}

:root[data-shell="native"] .pricing-hero-panel {
  background:
    radial-gradient(circle at 12% 10%, color-mix(in srgb, var(--pro-accent) 22%, transparent), transparent 38%),
    linear-gradient(135deg, color-mix(in srgb, var(--pro-accent-soft) 92%, var(--native-card)), var(--native-card) 62%);
}

:root[data-shell="native"] .pricing-plan-panel {
  background:
    radial-gradient(circle at 88% 8%, color-mix(in srgb, var(--pro-accent) 26%, transparent), transparent 35%),
    linear-gradient(160deg, color-mix(in srgb, var(--pro-accent-soft) 100%, var(--native-card)), var(--native-card) 64%);
  box-shadow:
    0 16px 32px var(--pro-accent-glow),
    var(--native-elevated);
}

:root[data-shell="native"] .pricing-badge {
  border-color: color-mix(in srgb, var(--pro-accent-line) 92%, transparent);
  background: linear-gradient(135deg, var(--pro-accent), color-mix(in srgb, var(--pro-accent) 64%, #ffffff));
  color: var(--on-pro-accent);
  box-shadow: 0 10px 22px var(--pro-accent-glow);
}

:root[data-shell="native"] .pricing-price span:first-child {
  color: var(--pro-accent-strong);
  text-shadow: 0 0 22px var(--pro-accent-glow);
}

:root[data-shell="native"] .pricing-checkout {
  border-color: color-mix(in srgb, var(--pro-accent) 82%, var(--native-hairline));
  background: linear-gradient(135deg, var(--pro-accent), color-mix(in srgb, var(--pro-accent) 68%, var(--primary)));
  color: var(--on-pro-accent);
  box-shadow: 0 14px 28px var(--pro-accent-glow);
}

:root[data-shell="native"] .pricing-feature {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--native-card) 88%, var(--native-card-soft)), var(--native-card));
}

:root[data-shell="native"] .pricing-feature-highlight {
  border-color: color-mix(in srgb, var(--pro-accent-line) 86%, var(--native-hairline));
  background:
    radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--pro-accent) 13%, transparent), transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--pro-accent-soft) 82%, var(--native-card)), var(--native-card));
  box-shadow: 0 14px 28px var(--pro-accent-glow);
}

:root[data-shell="native"] .pricing-feature-icon {
  border-color: color-mix(in srgb, var(--pro-accent-line) 52%, var(--line));
  background: color-mix(in srgb, var(--pro-accent-soft) 62%, var(--surface-soft));
  color: color-mix(in srgb, var(--ink) 80%, var(--pro-accent-strong));
}

:root[data-shell="native"] .pricing-feature-highlight .pricing-feature-icon {
  background: linear-gradient(135deg, var(--pro-accent), color-mix(in srgb, var(--pro-accent) 72%, #ffffff));
  color: var(--on-pro-accent);
  box-shadow: 0 9px 20px var(--pro-accent-glow);
}

:root[data-shell="native"][data-theme="light"] .pricing-checkout,
:root[data-shell="native"][data-theme="light"] .pricing-badge,
:root[data-shell="native"][data-theme="light"] .pricing-feature-highlight .pricing-feature-icon {
  background: linear-gradient(135deg, #f4c65e, var(--pro-accent) 58%, #b8750d);
  color: var(--on-pro-accent);
}

:root[data-shell="native"][data-theme="light"] .pricing-feature-highlight {
  background:
    radial-gradient(circle at 16% 0%, rgba(246, 188, 78, 0.24), transparent 42%),
    linear-gradient(180deg, rgba(255, 248, 231, 0.9), var(--native-card));
}

:root[data-shell="native"] .app-shell {
  padding-top: max(24px, calc(env(safe-area-inset-top) + 16px));
}

:root[data-shell="native"] .topbar {
  gap: 9px;
  margin-bottom: 12px;
  padding: 11px;
}

:root[data-shell="native"] .workspace,
:root[data-shell="native"] .history-main,
:root[data-shell="native"] .report-view {
  gap: 9px;
}

:root[data-shell="native"] .brain-grid,
:root[data-shell="native"] .detail-grid,
:root[data-shell="native"] .history-grid,
:root[data-shell="native"] .category-grid,
:root[data-shell="native"] .account-grid,
:root[data-shell="native"] .report-metric-grid,
:root[data-shell="native"] .report-visual-grid,
:root[data-shell="native"] .report-detail-grid,
:root[data-shell="native"] .pricing-layout,
:root[data-shell="native"] .pricing-feature-grid {
  gap: 10px;
}

:root[data-shell="native"] .entry-panel,
:root[data-shell="native"] .entry-panel.is-custom {
  gap: 8px;
  padding: 10px;
}

:root[data-shell="native"] .topbar-entry-panel,
:root[data-shell="native"] .topbar-entry-panel.is-custom {
  border-color: color-mix(in srgb, var(--native-hairline) 72%, transparent);
  background: color-mix(in srgb, var(--native-card) 54%, transparent);
  box-shadow: none;
}

:root[data-shell="native"] .field {
  gap: 5px;
  padding: 7px;
}

:root[data-shell="native"] .field input,
:root[data-shell="native"] .field select,
:root[data-shell="native"] .timer-display {
  min-height: 40px;
  padding-inline: 9px;
}

:root[data-shell="native"] .form-actions {
  gap: 8px;
}

:root[data-shell="native"] .form-actions .button {
  min-height: 44px;
}

:root[data-shell="native"] .brain-panel,
:root[data-shell="native"] .detail-panel {
  padding: 11px;
}

:root[data-shell="native"] .panel-heading {
  gap: 8px;
  margin-bottom: 8px;
}

:root[data-shell="native"] .panel-actions {
  gap: 6px;
}

:root[data-shell="native"] .brain-svg {
  max-height: min(282px, 58vw);
}

:root[data-shell="native"] .entry-list,
:root[data-shell="native"] .summary-list,
:root[data-shell="native"] .history-list {
  gap: 6px;
}

:root[data-shell="native"] .history-item,
:root[data-shell="native"] .entry-item,
:root[data-shell="native"] .summary-row {
  min-height: 48px;
  padding: 7px;
}

:root[data-shell="native"] .entry-item {
  column-gap: 7px;
  row-gap: 2px;
}

:root[data-shell="native"] .entry-item .entry-hours {
  line-height: 1.05;
  margin-top: -4px;
}

:root[data-shell="native"] .entry-item .entry-remove {
  grid-row: 1 / span 2;
  align-self: center;
  width: 31px;
  height: 31px;
}

:root[data-shell="native"] .summary-row {
  column-gap: 8px;
  row-gap: 5px;
}

:root[data-shell="native"] .summary-name,
:root[data-shell="native"] .entry-name {
  font-size: 0.92rem;
}

:root[data-shell="native"] .summary-meta,
:root[data-shell="native"] .entry-meta {
  font-size: 0.78rem;
  line-height: 1.16;
}

:root[data-shell="native"] .entry-hours {
  font-size: 0.92rem;
}

:root[data-shell="native"] .swatch {
  width: 11px;
  height: 26px;
}

:root[data-shell="native"] .share-track {
  height: 6px;
}

:root[data-shell="native"] .summary-edit-button {
  min-height: 32px;
  padding-inline: 8px;
}

:root[data-shell="native"] .summary-goal-remove {
  width: 28px;
  height: 28px;
}

:root[data-shell="native"] .add-goal-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 30px;
  padding-inline: 8px;
  font-size: 0.76rem;
}

:root[data-shell="native"] .add-goal-button svg {
  width: 14px;
  height: 14px;
}

:root[data-shell="native"] .add-history-activity-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 30px;
  padding-inline: 8px;
  font-size: 0.74rem;
}

:root[data-shell="native"] .add-history-activity-button svg {
  width: 13px;
  height: 13px;
}

:root[data-shell="native"] .history-add-day {
  min-height: 54px;
}

:root[data-shell="native"] .tour-callout {
  gap: 10px;
  width: min(330px, calc(100vw - 28px));
  padding: 14px;
}

:root[data-shell="native"] .tour-callout h2 {
  font-size: 1.15rem;
}

:root[data-shell="native"] .tour-callout p:not(.eyebrow) {
  font-size: 0.86rem;
  line-height: 1.42;
}

:root[data-shell="native"] .tour-actions .button {
  min-height: 40px;
}

:root.is-tutorial-entry-room .app-shell {
  padding-top: calc(30px + var(--tutorial-entry-top-space, 0px));
}

:root[data-shell="native"].is-tutorial-entry-room .app-shell {
  padding-top: calc(max(24px, calc(env(safe-area-inset-top) + 16px)) + var(--tutorial-entry-top-space, 0px));
}

:root[data-shell="native"] .history-brain-grid .brain-panel .panel-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px 10px;
  margin-bottom: 8px;
}

:root[data-shell="native"] .history-brain-grid .brain-panel .panel-heading > div:first-child {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

:root[data-shell="native"] .history-brain-grid .brain-panel .panel-actions {
  display: contents;
}

:root[data-shell="native"] .history-brain-grid .brain-panel .panel-actions > .icon-button {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  justify-self: end;
}

:root[data-shell="native"] .history-brain-grid .brain-panel:first-child .label-mode-toggle,
:root[data-shell="native"] .history-brain-grid .brain-panel:nth-child(2) .render-style-button {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  justify-self: stretch;
  margin-top: 0;
}

:root[data-shell="native"] .history-brain-grid .brain-panel:nth-child(2) .density-chip:not([hidden]) {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: start;
}

:root[data-shell="native"] .history-brain-grid .brain-panel:nth-child(2) .density-chip:not([hidden]) + .render-style-button {
  grid-row: 3;
}

:root[data-shell="native"] .history-brain-grid .brain-panel .brain-svg {
  margin-top: 0;
}

:root[data-shell="native"] .action-toast-region {
  top: max(18px, calc(env(safe-area-inset-top) + 10px));
}

@keyframes native-pane-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@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,
  .app-update-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;
  }
}

.history-report-gate {
  display: none;
}

.auto-save-note {
  display: none;
}

:root[data-shell="native"] #saveDay {
  display: none !important;
}

:root[data-shell="native"] .topbar-actions {
  justify-content: end;
  grid-template-columns: repeat(3, 46px);
}

:root[data-shell="native"] .tutorial-button {
  grid-column: 1;
}

:root[data-shell="native"] .feedback-button {
  grid-column: 2;
}

:root[data-shell="native"] .theme-toggle {
  grid-column: 3;
}

:root[data-shell="native"][data-pro="false"] .view-tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

:root[data-shell="native"][data-pro="true"] .view-tabs {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

:root[data-shell="native"] .history-report-gate {
  display: flex;
  width: 100%;
  min-height: 48px;
  justify-content: center;
  border-color: color-mix(in srgb, var(--pro-accent-line) 90%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--pro-accent-soft) 92%, var(--native-card)), var(--native-card));
  color: color-mix(in srgb, var(--pro-accent-strong) 72%, var(--ink));
  box-shadow: 0 12px 24px var(--pro-accent-glow);
}

:root[data-shell="native"][data-pro="true"] .history-report-gate {
  display: none;
}

:root[data-shell="native"][data-theme="light"] .history-report-gate {
  border-color: rgba(202, 137, 21, 0.56);
  background:
    linear-gradient(135deg, rgba(255, 248, 231, 0.98), rgba(255, 255, 255, 0.98));
  color: #8e5705;
}

:root[data-shell="native"] .auto-save-note {
  display: block;
  margin: 2px 2px 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
  text-align: center;
}

:root[data-shell="native"],
:root[data-shell="native"] body {
  touch-action: pan-x pan-y;
}

:root[data-shell="native"] button,
:root[data-shell="native"] input,
:root[data-shell="native"] select,
:root[data-shell="native"] textarea,
:root[data-shell="native"] .button,
:root[data-shell="native"] .icon-button {
  touch-action: manipulation;
}

:root[data-shell="native"] body::before {
  display: none;
}

:root[data-shell="native"] .app-shell,
:root[data-shell="native"]:not([data-view="today"]) .app-shell {
  padding-top: 0;
}

:root[data-shell="native"] .account-view,
:root[data-shell="native"] .category-view,
:root[data-shell="native"] .history-view,
:root[data-shell="native"] .pricing-view,
:root[data-shell="native"] .report-view {
  padding-top: 0;
}

:root[data-shell="native"] .account-grid {
  gap: 12px;
}

:root[data-shell="native"] .auth-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

:root[data-shell="native"] #signInButton {
  grid-column: 1 / -1;
}

:root[data-shell="native"] .auth-actions .button {
  min-width: 0;
  min-height: 52px;
  gap: 8px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 820;
  line-height: 1.05;
  padding: 0 10px;
  text-align: center;
  white-space: nowrap;
}

:root[data-shell="native"] .auth-actions .button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:root[data-shell="native"] .auth-actions .button svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

:root[data-shell="native"] .account-session-actions .button-danger {
  grid-column: 1 / -1;
}

:root[data-shell="native"] .entry-panel,
:root[data-shell="native"] .brain-panel,
:root[data-shell="native"] .detail-panel {
  contain: layout style;
}

:root[data-shell="native"] .tour-highlight,
:root[data-shell="native"] .tour-callout,
:root[data-shell="native"] .brain-svg {
  transform: translateZ(0);
}

:root[data-shell="native"] .brain-grid .brain-panel:first-child {
  position: relative;
  padding-top: 12px;
}

:root[data-shell="native"] .brain-grid .brain-panel:first-child .panel-heading {
  display: block;
  margin-bottom: 6px;
}

:root[data-shell="native"] .brain-grid .brain-panel:first-child .panel-heading > div:first-child {
  min-width: 0;
  padding-right: 50px;
}

:root[data-shell="native"] .brain-grid .brain-panel:first-child .panel-actions {
  display: block;
  width: 100%;
  margin-top: 9px;
}

:root[data-shell="native"] .brain-grid .brain-panel:first-child .label-mode-toggle {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

:root[data-shell="native"] .brain-grid .brain-panel:first-child .label-mode-button {
  min-height: 30px;
}

:root[data-shell="native"] .brain-grid .brain-panel:first-child .panel-actions > .icon-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
}

:root[data-shell="native"] .brain-grid .brain-panel:first-child .brain-svg {
  margin-top: 0;
  max-height: min(246px, 58vw);
}

:root[data-shell="native"] .entry-item {
  row-gap: 7px;
  padding: 10px;
}

:root[data-shell="native"] .entry-copy {
  align-self: end;
}

:root[data-shell="native"] .entry-meta {
  margin-top: 2px;
  line-height: 1.18;
}

:root[data-shell="native"] .entry-item .entry-hours {
  align-self: start;
  line-height: 1;
  margin-top: 1px;
}

:root[data-shell="native"] .field.is-first-entry-target {
  border-color: var(--primary-line);
  box-shadow:
    0 0 0 3px var(--focus-ring),
    0 12px 28px color-mix(in srgb, var(--primary) 16%, transparent);
}

:root[data-shell="native"] .first-entry-prompt {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  border: 1px solid color-mix(in srgb, var(--primary-line) 42%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  color: var(--ink);
  padding: 9px 10px;
}

:root[data-shell="native"] .first-entry-prompt strong {
  font-size: 0.88rem;
  line-height: 1.1;
}

:root[data-shell="native"] .first-entry-prompt span {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}
