/* ============================================================
   Garden Moves — design system
   Palette: 70s organic / earthy. Sage & avocado greens, ochre
   & mustard, terracotta, dusty eucalyptus, warm cream, cocoa
   ink for text. Modern-retro: chunky rounded type, soft arches
   and a calm sunrise glow. Token-driven from :root.
   ============================================================ */

@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../lib/fonts/fredoka-latin-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('../lib/fonts/nunito-latin-var.woff2') format('woff2');
}

:root {
  /* 70s organic / earthy — sage & avocado replace the leafy greens */
  --green-100: #E7E3CE;
  --green-200: #CFD2A6;
  --green-300: #A7B274;
  --green-500: #7C8B4A;
  --green-600: #5E6B36;
  --green-700: #465227;
  --ink: #33291E;            /* warm cocoa-ink */
  --ink-soft: #6B5644;
  /* dusty eucalyptus replaces the sky family */
  --sky-100: #DDE7E0;
  --sky-300: #A9C4BC;
  --sky-400: #7AA69A;
  /* ochre / mustard replaces sunshine */
  --sun-200: #F3E3BE;
  --sun-300: #EBCF8C;
  --sun-500: #D9A23E;
  --sun-700: #A66A1E;
  --sun-800: #855317;        /* AA-safe ochre for small body text on cream (5.6:1) */
  --coral: #C9603F;          /* terracotta */
  --cream: #F7EFE1;
  --card: #FCF6EA;
  --shadow: 0 6px 20px rgba(74, 51, 30, 0.12);
  --shadow-soft: 0 2px 10px rgba(74, 51, 30, 0.09);
  /* radius tiers (one source of truth; --radius keeps working as the mid tier) */
  --radius-pill: 999px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius: var(--radius-md);
  --radius-sm: 12px;
  /* spacing 4 / 8 ramp */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
  /* type scale */
  --fs-display: 2.05rem; --fs-h1: 1.55rem; --fs-h2: 1.25rem; --fs-h3: 1.05rem;
  --fs-body: 1.0625rem; --fs-sm: 0.9375rem; --fs-label: 0.75rem;
  --lh-display: 1.05; --lh-head: 1.15; --lh-body: 1.55;
  --ls-display: -0.01em; --ls-label: 0.14em;
  /* motion — one unified easing system with a gentle retro settle */
  --ease-settle: cubic-bezier(0.34, 0.01, 0.18, 1);
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0.06, 0.68, 0.19);
  --dur-1: 120ms; --dur-2: 200ms; --dur-3: 320ms; --dur-4: 480ms;
  --line: #E0D6C4;           /* warm divider */
  --font-display: 'Fredoka', 'Avenir Next Rounded', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --font-body: 'Nunito', -apple-system, 'Segoe UI', system-ui, sans-serif;
}

/* ---- dark mode: earthy-night. Toggled by the moon/sun control (profile.theme). ----
   Flips surfaces + text and re-tones the ramps so the "light tint" steps (100/200) become
   DARK tints (light text stays legible) while the saturated steps lighten for fills/text.
   --green-700 is intentionally LIGHT here: the chrome uses it both as a button fill (whose
   on-color text is var(--card)) AND as nav/link text, so one light value keeps both readable. */
html[data-theme="dark"] {
  --cream: #1E1813;
  --card: #2A2219;
  --ink: #F0E6D6;
  --ink-soft: #B6A488;
  --line: #3A3026;
  --shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.35);
  --green-100: #2C3320;   /* dark sage — light-bg uses (buttons, bars, quiz) */
  --green-200: #3A4329;
  --green-300: #8FA15B;
  --green-500: #A4B86A;
  --green-600: #BFD08A;   /* grace notes / pillar hover — light on dark */
  --green-700: #C9D88F;   /* LIGHT: primary-btn fill + nav link text both read */
  --sun-200: #3A2E18;     /* dark ochre — chip-streak bg, stage top, hero glow */
  --sun-300: #4A3A1E;     /* dark ochre — btn-skip bg */
  --sun-500: #E0B25A;
  --sun-700: #D89A3E;
  --sun-800: #E6C07A;
  --coral: #D2724E;       /* terracotta, lifted for dark */
  --sky-100: #243029;     /* dark eucalyptus — chip bg, stage mid */
  --sky-300: #557066;
  --sky-400: #6E9388;
  /* base Soul / Finance(+Mind) tints for dark. The per-subject [data-track] tints stay
     light on their lesson screens — a known, still-readable limitation. */
  --soul-tint: #2E2630; --soul-border: #4A3D4E; --soul-ink: #DAC7DC; --soul-accent: #BD93C0;
  --finance-tint: #1E2E30; --finance-border: #34474A; --finance-ink: #BBD6DA; --finance-accent: #6FA9B3; --finance-accent-soft: #5E8F99;
}
/* dark: the primary/duration buttons are a LIGHT sage fill, so keep hover light enough
   that the dark on-color text stays legible; darken the hardcoded "wrong" quiz pink. */
html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .duration-btn:hover { background: #B3C47B; }
html[data-theme="dark"] .quiz-opt.wrong,
html[data-theme="dark"] .sort-bucket.wrong,
html[data-theme="dark"] .order-pick.wrong { background: #3A2620; }
/* Surfaces that hardcode white in light mode would render near-white text on white in dark
   mode — remap them to the themed card colour so cards, inputs and chips stay legible. */
html[data-theme="dark"] .you-subject,
html[data-theme="dark"] .you-weight-form input,
html[data-theme="dark"] .you-weight-form select,
html[data-theme="dark"] .you-bday-form input,
html[data-theme="dark"] .you-name-form input,
html[data-theme="dark"] .you-meal-form input,
html[data-theme="dark"] .journal-compose,
html[data-theme="dark"] .journal-entry,
html[data-theme="dark"] .cycle-field input,
html[data-theme="dark"] .cal-cell,
html[data-theme="dark"] .intim-desire-btn,
html[data-theme="dark"] .intim-pick-btn,
html[data-theme="dark"] .intim-sym-chip { background: var(--card); color: var(--ink); }

/* moon/sun theme toggle in the top nav */
.theme-toggle {
  background: none; border: 0; cursor: pointer; font-size: 1.15rem; line-height: 1;
  min-width: 44px; min-height: 44px; padding: 8px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
}

/* persistent bottom tab bar (primary destinations). Additive — the top-nav links stay.
   Hidden during an active session for an immersive workout. Sits below overlays (z 50). */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; gap: 2px; max-width: 560px; margin: 0 auto;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(74, 51, 30, 0.10);
}
.tabbar a {
  flex: 1 1 0; min-height: 48px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; text-decoration: none;
  color: var(--ink-soft); font: 800 0.64rem var(--font-body); letter-spacing: 0.02em;
  border-radius: var(--radius-sm); padding: 4px 2px; white-space: nowrap;
  transition: color var(--dur-2) var(--ease-settle), background-color var(--dur-2) var(--ease-settle);
}
.tabbar a .tab-ic { font-size: 1.25rem; line-height: 1; }
.tabbar a .tab-ic .tab-veronica { width: 1.3em; height: 1.3em; display: block; }
.tabbar a.active { color: var(--green-700); background: var(--green-100); }
.tabbar[hidden] { display: none; }
.has-tabbar #app { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }

/* ---- journal as a two-page book ---- */
/* The composer sits above; this is the book below it. Paper + leather tones are fixed in
   both themes (a book is its own object), with dark-brown ink that stays legible. */
.journal-compose-card .hint { margin-top: 0; }
.journal-book-card { padding: 16px; }
.book2-shelf { display: flex; justify-content: center; padding: 4px 0; }
.book2-closed {
  position: relative; width: 100%; max-width: 300px; min-height: 156px; cursor: pointer; border: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; text-align: center;
  padding: 22px 20px; color: #F7EBD2; font-family: var(--font-body);
  background: linear-gradient(135deg, #6E3B2A 0%, #8A4E33 48%, #5C3120 100%);
  border-radius: 5px 13px 13px 5px;
  box-shadow: var(--shadow), inset 0 0 0 2px rgba(0, 0, 0, 0.22), inset 0 0 0 8px rgba(235, 207, 140, 0.16);
  transition: transform var(--dur-2) var(--ease-settle);
}
.book2-closed:hover { transform: translateY(-2px); }
.book2-closed-flourish { font-size: 1.3rem; color: var(--sun-300); }
.book2-closed-kicker { text-transform: uppercase; letter-spacing: 0.3em; font-size: 0.66rem; font-weight: 800; color: var(--sun-300); }
.book2-closed-name { font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; color: #FBF1DC; }
.book2-closed-sub { font-size: 0.82rem; opacity: 0.85; }
.book2-closed-hint { margin-top: 6px; font-size: 0.7rem; color: var(--sun-300); opacity: 0.85; }

.book2-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 6px; }
.book2-bar .linkish { padding: 6px 2px; font-size: 0.82rem; }

/* the open spread — two parchment pages with a center spine */
.book2 {
  display: grid; grid-template-columns: 1fr 1fr; border-radius: 6px; overflow: hidden;
  background: #FBF3DF; box-shadow: var(--shadow); min-height: 320px;
}
.book2.is-open { animation: bookTurn var(--dur-3) var(--ease-out); transform-origin: left center; }
@keyframes bookTurn { from { opacity: 0.45; transform: perspective(900px) rotateY(-7deg); } to { opacity: 1; transform: none; } }
.book2-page {
  position: relative; padding: 18px 15px; background: #FBF3DF; color: #3A2F1F; min-height: 320px;
  max-height: 60vh; overflow-y: auto;
}
.book2-page:first-child { box-shadow: inset -11px 0 14px -11px rgba(60, 30, 10, 0.30); }
.book2-page:last-child { box-shadow: inset 11px 0 14px -11px rgba(60, 30, 10, 0.30); }
.book2-h { font: 700 1.05rem var(--font-display); color: #5C3120; margin: 0 0 10px; text-align: center; border-bottom: 1px solid rgba(92, 49, 32, 0.25); padding-bottom: 6px; }
.book2-chapter { margin-bottom: 12px; }
.book2-chapter-title { font: 700 0.8rem var(--font-display); color: #6E4322; margin: 0 0 4px; }
.book2-toc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.book2-toc-entry { width: 100%; min-height: 32px; display: flex; gap: 8px; align-items: baseline; text-align: left; background: none; border: 0; cursor: pointer; padding: 5px 4px; border-radius: 6px; color: #3A2F1F; }
.book2-toc-entry:hover { background: rgba(92, 49, 32, 0.08); }
.book2-toc-entry .t { flex: 0 0 auto; min-width: 52px; font-weight: 800; font-size: 0.72rem; color: #8A5A33; }
.book2-toc-entry .s { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.85rem; }
.book2-blank { display: flex; align-items: flex-end; justify-content: center; cursor: pointer; }
.book2-turnhint { color: #8A5A33; font-size: 0.8rem; font-weight: 700; opacity: 0.85; padding-bottom: 14px; }
.book2-entry-head { display: flex; flex-direction: column; gap: 1px; margin-bottom: 8px; border-bottom: 1px solid rgba(92, 49, 32, 0.22); padding-bottom: 5px; }
.book2-day { font: 700 0.92rem var(--font-display); color: #5C3120; }
.book2-time { font-size: 0.72rem; font-weight: 700; color: #8A5A33; }
.book2-text { font-size: 0.95rem; line-height: 1.6; white-space: pre-wrap; color: #3A2F1F; }
.book2-page-empty { background: #FBF3DF; }
.book2-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; }
.book2-entry .journal-entry-actions { margin-top: 10px; }
.book2-entry .journal-entry-actions .linkish { color: #6E4322; }

/* journal entries surfaced in the personal-calendar day detail */
.intim-journal-day { margin: 8px 0 4px; }
.intim-journal-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.intim-journal-open {
  width: 100%; min-height: 40px; display: flex; gap: 8px; align-items: center; text-align: left; cursor: pointer;
  background: var(--soul-tint); color: var(--ink); border: 1px solid var(--soul-border); border-radius: var(--radius-sm); padding: 7px 10px;
}
.intim-journal-open:hover { border-color: var(--soul-accent); }
.ij-time { flex: 0 0 auto; min-width: 58px; font-weight: 800; font-size: 0.74rem; color: var(--ink-soft); }
.ij-snip { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.4em;
  line-height: 1.15;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--sun-500);
  outline-offset: 2px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- layout ---- */
#app { max-width: 560px; margin: 0 auto; padding: 0 14px calc(20px + env(safe-area-inset-bottom)); }
.narrow { display: flex; flex-direction: column; gap: 14px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 2px 10px;
  gap: 10px;
}
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.topnav { display: flex; gap: 6px; }
.topnav a, .back { color: var(--green-700); font-weight: 800; text-decoration: none; padding: 10px 8px; display: inline-block; }
.topnav a:hover, .back:hover { text-decoration: underline; }
.page-title { font-size: var(--fs-h1); font-weight: 700; letter-spacing: var(--ls-display); margin: 0; }
/* retro double-rule flourish under the page title */
.page-title::after { content: ""; display: block; width: 48px; height: 5px; margin-top: 6px; border-top: 2px solid var(--sun-700); border-bottom: 2px solid var(--sun-700); }

.card, .garden-card, .level-card, .start-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

/* Collapsible section cards — click the title to minimize/expand (js makeSectionsCollapsible).
   A right-pointing chevron means collapsed; down means open. Tap target stays the full title. */
.collapsible-head { cursor: pointer; position: relative; user-select: none; padding-right: 30px; min-height: 28px; }
.collapsible-head::after {
  content: '▾'; position: absolute; right: 2px; top: 0.15em;
  font-size: 0.8em; color: var(--ink-soft); transition: transform var(--dur-2, 0.18s) var(--ease-settle, ease);
}
.is-collapsed > .collapsible-head::after { transform: rotate(-90deg); }
.is-collapsed > :nth-child(n+2) { display: none; }
.collapsible-head:focus-visible { outline: 2px solid var(--green-600, #3E8E4F); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { .collapsible-head::after { transition: none; } }

/* Per-section count chip ("how many there are") shown after a section title. */
.you-count { display: inline-block; min-width: 1.5em; padding: 0 0.45em; margin-left: 6px; border-radius: 999px;
  background: var(--green-100, #E3EFE0); color: var(--green-700, #2E6B3D); font-size: 0.66em; font-weight: 800;
  line-height: 1.7; text-align: center; vertical-align: middle; }

.btn {
  border: 0; border-radius: var(--radius-pill); padding: var(--sp-3) var(--sp-5);
  background: var(--green-100); color: var(--ink);
  font-weight: 800; font-family: var(--font-body);
  transition: transform var(--dur-2) var(--ease-settle), background-color var(--dur-2) var(--ease-settle), box-shadow var(--dur-2) var(--ease-settle);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-primary { background: var(--green-700); color: var(--card); }
.btn-primary:hover { background: #384119; }
.btn-skip { background: var(--sun-300); }
.btn-danger { background: #F4DED3; color: #7A2E16; }
.linkish { background: none; border: 0; color: var(--ink-soft); text-decoration: underline; font-size: 0.9rem; padding: 13px 12px; }

.chip {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: var(--sky-100); color: var(--ink); font-weight: 800; font-size: 0.88rem;
}
.chip-streak { background: var(--sun-200); }

/* ---- home ---- */
.home { display: flex; flex-direction: column; gap: 14px; }
.garden-card { text-align: center; padding-top: 12px; }
.garden-svg svg { width: 100%; height: auto; border-radius: var(--radius-sm); display: block; }
.garden-svg.small svg { max-width: 260px; margin: 0 auto; }
.garden-card .chip { margin-top: 10px; }
.garden-caption { color: var(--ink-soft); font-size: 0.95rem; margin: 8px 0 2px; }
.grace-note { color: var(--green-600); font-weight: 800; font-size: 0.9rem; margin: 6px 0 0; }

.level-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 0.95rem; }
.level-row span { color: var(--ink-soft); font-size: 0.85rem; }
.level-bar { height: 12px; background: var(--green-100); border-radius: 999px; margin-top: 8px; overflow: hidden; }
.level-fill { height: 100%; background: linear-gradient(90deg, var(--green-300), var(--green-500)); border-radius: var(--radius-pill); transition: width var(--dur-3) var(--ease-out); }
.level-next { margin: 6px 0 0; color: var(--ink-soft); font-size: 0.85rem; }

.start-card { position: relative; overflow: hidden; border-radius: var(--radius-lg) var(--radius-lg) var(--radius-md) var(--radius-md); }
/* retro sunrise glow on the hero card — calm, static (never animated) */
.start-card::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 50% -10%, var(--sun-200) 0%, transparent 60%); opacity: 0.6; }
.start-card > * { position: relative; z-index: 1; }
.start-card h2 { font-size: var(--fs-h2); text-align: center; }
.mode-group { margin-top: 12px; }
.mode-label { font-weight: 800; color: var(--ink); margin: 0 2px 6px; }
.mode-label small { font-weight: 400; color: var(--ink-soft); }
.duration-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.duration-btn {
  border: 0; border-radius: var(--radius-sm); padding: 14px 4px;
  background: var(--green-700); color: var(--card); display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: transform var(--dur-1) var(--ease-settle), background-color var(--dur-2) var(--ease-settle);
  box-shadow: 0 4px 0 #2d3618;
}
.duration-btn:hover { background: #384119; }
.duration-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #2d3618; }
.d-num { font-family: var(--font-display); font-weight: 600; font-size: 1.7rem; line-height: 1; }
.d-label { font-size: 0.7rem; }
.start-note { text-align: center; color: var(--ink-soft); font-size: 0.85rem; margin: 12px 0 0; }

.privacy-note { text-align: center; font-size: 0.85rem; color: var(--ink-soft); padding: 4px 10px 12px; }
.privacy-note a { color: var(--green-700); }

/* ---- session ---- */
.session { display: flex; flex-direction: column; gap: 12px; min-height: 96vh; }
.stage {
  position: relative; height: 44vh; min-height: 300px;
  background: linear-gradient(180deg, var(--sun-200) 0%, var(--sky-100) 45%, var(--green-200) 100%);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft);
  margin-top: calc(10px + env(safe-area-inset-top));
}
.stage canvas { width: 100%; height: 100%; display: block; }
.stage.no-webgl canvas { display: none; }
.stage.no-webgl::before {
  content: '🧘‍♀️'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 90px;
}
.caption-bubble {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  background: rgba(255, 255, 255, 0.92); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 0.95rem; font-weight: 700; color: var(--ink);
  min-height: 1.4em; box-shadow: var(--shadow-soft);
}
.move-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-soft); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.move-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.move-head h2 { font-size: 1.35rem; margin: 4px 0 0; }
.chip-block { background: var(--green-100); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.ring-wrap { position: relative; width: 86px; height: 86px; flex: 0 0 auto; }
.ring { width: 86px; height: 86px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--green-100); stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--green-500); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 0.9s linear; }
.ring-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600; font-size: 1.5rem;
}
.progress-dots { display: flex; flex-wrap: wrap; gap: 5px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green-100); }
.dot.done { background: var(--green-500); }
.dot.now { background: var(--sun-500); transform: scale(1.3); }
.controls { display: flex; gap: 10px; }
.controls .btn { flex: 1; }

.done-screen .center { text-align: center; }
.done-stats { font-size: 1.05rem; }
.grew { color: var(--green-600); font-weight: 800; }
.badge-pops { margin: 10px 0; }
.badge-pop { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--sun-200); border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 8px; }
.badge-pop svg { width: 44px; height: 44px; flex: 0 0 auto; }

/* ---- badges ---- */
.badge-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.badge-cell {
  background: var(--card); border-radius: var(--radius-sm); box-shadow: var(--shadow-soft);
  padding: 14px; text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center;
  position: relative;
}
.badge-cell .badge-icon svg { width: 52px; height: 52px; }
.badge-cell small { color: var(--ink-soft); font-size: 0.78rem; }
.badge-cell.locked { opacity: 0.55; }
.badge-cell.locked .badge-icon { filter: grayscale(1); }
.badge-lock { position: absolute; top: 8px; right: 10px; }
.badge-date { font-size: 0.7rem; color: var(--green-600); font-weight: 800; }

/* ---- settings ---- */
.settings .card { display: flex; flex-direction: column; gap: 10px; }
.settings input[type='text'] {
  font: inherit; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 2px solid var(--green-200); background: var(--cream); color: var(--ink); width: 100%;
}
.settings select { font: inherit; padding: 8px 10px; border-radius: 10px; border: 2px solid var(--green-200); background: var(--cream); color: var(--ink); flex: 1; min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; }
.toggle { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.toggle small { color: var(--ink-soft); font-weight: 400; }
.toggle input { width: 20px; height: 20px; accent-color: var(--green-500); }
.vol-label { font-size: 0.85rem; color: var(--ink-soft); }
input[type='range'] { accent-color: var(--green-500); }
.char-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.char-card {
  border: 3px solid transparent; border-radius: var(--radius-sm); background: var(--cream);
  padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.char-card svg { width: 64px; height: 64px; }
.char-card .char-face { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; object-position: center top; background: var(--green-100); }
.char-card.selected { border-color: var(--green-500); background: var(--green-100); }
.char-card small { color: var(--ink-soft); font-size: 0.75rem; }
.style-row { display: grid; grid-template-columns: 1fr; gap: 8px; }
.style-card {
  border: 3px solid transparent; border-radius: var(--radius-sm); background: var(--cream);
  padding: 10px 12px; text-align: left; display: flex; flex-direction: column; gap: 2px;
}
.style-card.selected { border-color: var(--green-500); background: var(--green-100); }
.style-card small { color: var(--ink-soft); font-style: italic; }
.privacy-inline { font-size: 0.85rem; color: var(--ink-soft); }

/* ---- overlay ---- */
.overlay {
  position: fixed; inset: 0; background: rgba(51, 41, 30, 0.55);
  display: grid; place-items: center; padding: 18px; z-index: 50;
}
.overlay-card {
  background: var(--card); border-radius: var(--radius-lg); padding: 22px;
  max-width: 430px; max-height: 84vh; overflow: auto; box-shadow: var(--shadow);
}
.overlay-card ul { padding-left: 20px; }
.overlay-card li { margin-bottom: 8px; }
.overlay-card .btn { width: 100%; margin-top: 10px; }

/* Gated launch disclaimer: the notice scrolls, the dismiss button stays pinned and
   visible at the bottom on every viewport (short / landscape phones included), so the
   user can always reach the button to leave. min-height:0 lets the scroll area shrink
   inside the flex column instead of pushing the actions off-screen. */
.overlay-card--gated { display: flex; flex-direction: column; max-height: 88vh; padding: 0; overflow: hidden; }
.overlay-card--gated .overlay-scroll { overflow-y: auto; padding: 22px 22px 14px; min-height: 0; }
.overlay-card--gated .overlay-actions { flex: none; padding: 12px 22px 18px; border-top: 1px solid var(--line, #E3E0D8); background: var(--card); }
.overlay-card--gated .overlay-actions .btn { width: 100%; margin-top: 0; }
.overlay-once { text-align: center; color: var(--ink-soft); font-size: 0.8rem; margin: 8px 0 0; }
/* Styled confirm/alert dialogs (js/ui-dialog.js) — reuse .overlay / .overlay-card. */
.dialog-card { max-width: 360px; }
.dialog-msg { margin: 0 0 16px; color: var(--ink); line-height: 1.45; }
.dialog-actions { display: flex; gap: 10px; }
.dialog-actions .btn { width: auto; flex: 1; margin-top: 0; min-height: 44px; }
.btn-danger { background: var(--coral); color: var(--card); }
.btn-danger:hover, .btn-danger:focus-visible { background: #A8492B; }

/* ---- tutorial + FAQ (help screens) ---- */
.help-intro { margin: 2px 2px 4px; }
.help-step-head { display: flex; align-items: center; gap: 10px; }
.help-num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--green-500, #5BA869); color: #fff; font-weight: 700; font-size: 0.85rem; }
.help-step-title { font-size: 1.05rem; margin: 0; }
.help-ic { margin-right: 2px; }
.help-step p { margin: 8px 0 0; }
.help-step a, .privacy-list a, .faq-answer a { color: var(--green-700, #2E6B3D); }
.help-cta { text-align: center; }
.help-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.help-links .btn { width: auto; flex: 1 1 auto; min-width: 130px; }
.home-help-links, .set-help-links { font-size: 0.85rem; }
.home-help-links { margin-top: 4px; }
.home-help-links a { color: var(--green-700, #2E6B3D); }

.privacy-hero { border: 2px solid var(--green-500, #5BA869); background: var(--card); }
.privacy-hero h2 { margin: 0 0 2px; font-size: 1.15rem; }
.privacy-list { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.privacy-list li { line-height: 1.45; }
.help-faq-heading { margin: 6px 2px 0; font-size: 1.1rem; }
.faq-item { padding: 0; }
.faq-item summary { padding: 14px 16px; cursor: pointer; font-weight: 600; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; float: right; color: var(--ink-soft); font-weight: 400; }
.faq-item[open] summary::after { content: '–'; }
.faq-answer { padding: 0 16px 14px; }
.faq-answer p { margin: 0; line-height: 1.5; }

/* ---- confetti / dev ---- */
.confetti-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 99; }
.dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; padding: 10px; }
.dev-cell { background: #fff; border-radius: 10px; padding: 8px; text-align: center; }
.dev-cell img { background: linear-gradient(180deg, #DDE7E0, #CFD2A6); border-radius: 8px; }
.dev-missing { width: 220px; height: 220px; display: grid; place-items: center; background: #fbe3de; border-radius: 8px; margin: 0 auto; }

@media (min-width: 560px) {
  .style-row { grid-template-columns: repeat(3, 1fr); }
  .char-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---- milestone-1 hello card (replaced by app on JS load) ---- */
.hello {
  max-width: 420px;
  margin: 12vh auto 0;
  padding: 32px 24px;
  text-align: center;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hello-flower { border-radius: 24px; }
.hello h1 { font-size: 2rem; margin-top: 12px; }
.beta-chip {
  display: inline-block; background: var(--green-200); color: var(--ink);
  font-size: 0.7rem; font-weight: 800; padding: 2px 8px; border-radius: 999px;
  vertical-align: middle; margin-left: 6px; text-transform: uppercase; letter-spacing: 0.04em;
}
.hint { color: var(--ink-soft); font-size: 0.88rem; margin: 6px 0 10px; }
.nv-progress { margin-top: 10px; }
.nv-track { height: 10px; border-radius: 999px; background: var(--green-100); overflow: hidden; }
.nv-bar { height: 100%; width: 0; border-radius: 999px; background: var(--green-600); transition: width 0.3s ease; }
.nv-progress small { color: var(--ink-soft); display: block; margin-top: 6px; }

.hello-logo { margin: 0 0 6px; }
.hello-logo .logo-svg { height: clamp(48px, 13vw, 72px); width: auto; max-width: 100%; }
.brand .logo-svg { height: 36px; width: auto; display: block; }
.hello-sub { color: var(--ink-soft); font-size: 0.95rem; }
.hello-soon { font-weight: 800; color: var(--green-600); }

/* ---- v2: tiers, programs, intake, chair mode ---- */
.start-links { display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; }
.start-links a { color: var(--green-700); font-weight: 800; }
.inline-toggle { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); }
.inline-toggle input { width: 18px; height: 18px; accent-color: var(--green-500); }

.program-card { background: var(--sun-200); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-soft); }
.prog-row { display: flex; justify-content: space-between; align-items: baseline; }
.prog-row .small { font-size: 0.8rem; }
.prog-sug { margin: 6px 0 10px; color: var(--ink); }
.program-card .btn { width: 100%; }
.prog-note { font-size: 0.78rem; color: var(--ink-soft); margin: 8px 0 0; text-align: center; }
.program-invite { margin-top: 4px; }
.program-invite a { color: var(--green-700); font-weight: 800; }

.tier-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.tier-card {
  border: 3px solid transparent; border-radius: var(--radius-sm); background: var(--cream);
  padding: 14px 16px; text-align: left; display: flex; flex-direction: column; gap: 3px;
}
.tier-card strong { font-size: 1.05rem; }
.tier-card small { color: var(--ink-soft); }
.tier-card:not(.locked):hover { border-color: var(--green-500); background: var(--green-100); }
.tier-card.locked { opacity: 0.7; background: #f4f1ea; cursor: not-allowed; }
.tier-gate { margin-top: 6px; font-size: 0.8rem; color: var(--green-700); font-weight: 700; }

.med-lib { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 8px; }
.med-lib-btn {
  border: 2px solid var(--sky-300); border-radius: var(--radius-sm); background: var(--sky-100);
  padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left;
}
.med-lib-btn small { color: var(--ink-soft); }

.intake .flag-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.intake .flag { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; font-weight: 700; }
.intake .flag input { width: 18px; height: 18px; accent-color: var(--green-500); }
.intake label { display: flex; flex-direction: column; gap: 6px; font-weight: 800; }
.intake label.toggle, .intake label.flag { flex-direction: row; align-items: center; font-weight: 700; }
.parq-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 600 !important; font-size: 0.9rem; }
.parq-item span { flex: 1; }
.parq-item select { flex: 0 0 auto; width: auto; }

@media (min-width: 560px) {
  .tier-grid { grid-template-columns: repeat(2, 1fr); }
  .med-lib { grid-template-columns: repeat(2, 1fr); }
}

/* reduced-motion override (auto follows OS; on forces calm; off opts out) */
html[data-reduced-motion="on"] *, html[data-reduced-motion="on"] *::before, html[data-reduced-motion="on"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

/* ============================================================
   Finance — "Money Garden" sub-theme (ADDITIVE). Extends the
   garden tokens: the periwinkle of the veronica logo is the
   finance signature, gold (sun) is value. No existing rule is
   modified, so the fitness UI is byte-for-byte unchanged. The
   duration picker (.duration-grid/.duration-btn) is reused
   verbatim — no finance override.
   ============================================================ */
:root {
  --finance-accent: #3F6E78;       /* dusty teal — finance signature (earthy) */
  --finance-accent-soft: #5E8F99;
  --finance-tint: #E1EAE9;         /* eucalyptus wash for banners/cards */
  --finance-border: #B7CFCD;
  --finance-ink: #2E5A63;          /* readable text on teal tints (6.5:1) */
  --finance-gold-deep: #9A6500;    /* readable text on gold tints */
}

.finance-hero { display: flex; align-items: center; gap: 10px; }
.finance-hero .veronica { width: 28px; height: 28px; flex: 0 0 auto; }

.fin-banner {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--finance-tint); border: 1px solid var(--finance-border);
  border-radius: var(--radius-sm); padding: 11px 13px;
  color: var(--finance-ink); font-size: 0.86rem; line-height: 1.4;
}
.fin-banner .fin-info { flex: 0 0 auto; font-size: 1.15rem; line-height: 1.1; }
.fin-banner strong { color: var(--finance-ink); }

.fin-lib { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 8px; }
/* Optional dropdown wrapping the full lesson list — hidden until the user opens it. */
.fin-lib-details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; }
.fin-lib-details > summary::-webkit-details-marker { display: none; }
.fin-lib-summary-txt { flex: 1; min-width: 0; }
.fin-lib-summary-txt strong { display: block; font-size: 1.15rem; }
.fin-lib-summary-txt small { color: var(--ink-soft); }
.fin-lib-chevron { flex: 0 0 auto; font-size: 1.1rem; color: var(--ink-soft); transition: transform 0.18s ease; }
.fin-lib-details[open] > summary .fin-lib-chevron { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .fin-lib-chevron { transition: none; } }
.fin-lib-btn {
  border: 2px solid var(--finance-border); border-radius: var(--radius-sm); background: var(--card);
  padding: 12px 14px; display: flex; align-items: center; gap: 12px; text-align: left;
}
.fin-lib-btn:hover { border-color: var(--finance-accent); background: var(--finance-tint); }
.fin-lib-ic { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center;
  background: var(--sun-200); border-radius: 13px; }
.fin-lib-txt { flex: 1; min-width: 0; }
.fin-lib-txt strong { display: block; }
.fin-lib-txt small { color: var(--ink-soft); }
.fin-lib-meta { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.fin-mins { font-family: var(--font-display); font-weight: 600; color: var(--finance-accent); }
.fin-src-pill { background: var(--sun-200); color: var(--finance-gold-deep);
  border: 1px solid var(--sun-300); border-radius: 999px; padding: 2px 8px;
  font-size: 0.68rem; font-weight: 800; white-space: nowrap; }
.fin-done-tag { color: var(--green-600); font-weight: 800; font-size: 0.72rem; }

/* finance badges — distinct gold + periwinkle treatment vs the green fitness set */
.badge-cell.finance { background: #FFFCF2; box-shadow: inset 0 0 0 2px var(--finance-border), var(--shadow-soft); }
.badge-cell.finance strong { color: var(--finance-ink); }
.badge-cell.finance .badge-date { color: var(--finance-accent); }
.badge-section-label { grid-column: 1 / -1; margin: 8px 2px 0; font-family: var(--font-display);
  font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.badge-section-label .veronica { width: 20px; height: 20px; }

/* sources list (accuracy protocol — every fact-heavy lesson cites its sources) */
.fin-sources { text-align: left; margin-top: 10px; }
.fin-sources h3 { font-size: 1rem; }
.fin-sources ul { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 6px; }
.fin-sources li { font-size: 0.82rem; color: var(--ink-soft); }
.fin-sources a { color: var(--finance-accent); font-weight: 700; word-break: break-word; }
.fin-sources .fin-year { color: var(--finance-gold-deep); font-weight: 800; }

/* collapsible transcript (accessibility: read what the coach said) */
.fin-transcript { text-align: left; margin-top: 10px; }
.fin-transcript summary { cursor: pointer; font-weight: 800; color: var(--green-700); }
.fin-transcript p { font-size: 0.9rem; color: var(--ink); margin: 8px 0; }
.fin-transcript .fin-seg-name { font-weight: 800; color: var(--ink); }

@media (min-width: 560px) {
  .fin-lib { grid-template-columns: repeat(2, 1fr); }
}

/* finance: surface the existing on-device natural voice (best free quality) */
.fin-voice p { margin: 0 0 10px; }
.fin-voice-on { text-align: center; color: var(--green-600); font-weight: 700; font-size: 0.9rem; }

/* ====================================================================
   Mind / Body / Soul — the three pillars (ADDITIVE). The home screen's
   primary navigation; each pillar owns its own duration/option step and
   all grow the same shared garden. Body = green, Mind = the learning
   periwinkle (shared with Money), Soul = a calm amethyst.
   ==================================================================== */
:root {
  --soul-accent: #8A6B8C;   /* dusty mauve — the Soul signature (earthy) */
  --soul-tint: #EFE6E8;     /* warm mauve wash for cards/banners */
  --soul-border: #D7C3CE;
  --soul-ink: #6E5170;      /* readable text on mauve tints (5.9:1) */
}

.pillars { margin-top: 4px; }
.pillar-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.pillar-card {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 16px 18px; border-radius: var(--radius);
  border: 2px solid #CDE9D3; background: var(--card);
  box-shadow: var(--shadow-soft); cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease, background 0.15s ease;
}
.pillar-card:hover { transform: translateY(-1px); }
.pillar-card:active { transform: translateY(0); }
.pillar-ic { font-size: 1.9rem; line-height: 1; flex: 0 0 auto; width: 52px; height: 52px;
  display: grid; place-items: center; border-radius: 50%; }
.pillar-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pillar-txt strong { font-family: var(--font-display); font-size: 1.3rem; }
.pillar-txt small { color: var(--ink-soft); font-size: 0.86rem; }

.pillar-card.body { border-color: #BFE3C7; }
.pillar-card.body:hover { border-color: var(--green-500); background: #F2FAF3; }
.pillar-card.body .pillar-ic { background: #EAF6EC; }
.pillar-card.mind { border-color: var(--finance-border); }
.pillar-card.mind:hover { border-color: var(--finance-accent); background: var(--finance-tint); }
.pillar-card.mind .pillar-ic { background: var(--finance-tint); }
.pillar-card.soul { border-color: var(--soul-border); }
.pillar-card.soul:hover { border-color: var(--soul-accent); background: var(--soul-tint); }
.pillar-card.soul .pillar-ic { background: var(--soul-tint); }

@media (min-width: 560px) {
  .pillar-grid { grid-template-columns: repeat(3, 1fr); }
  .pillar-card { flex-direction: column; text-align: center; gap: 8px; }
  .pillar-txt { align-items: center; }
}

/* Soul page accents + reserved "coming soon" practices (crystal/dream) */
.soul-screen .page-title { color: var(--soul-ink); }
.soul-soon { display: flex; align-items: center; gap: 12px; padding: 12px 14px; opacity: 0.78;
  border: 2px dashed var(--soul-border); border-radius: var(--radius-sm); margin-top: 8px; background: var(--soul-tint); }
.soul-soon .pillar-ic { width: 40px; height: 40px; font-size: 1.4rem; background: #fff; }
.soon-tag { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--soul-ink); background: var(--soul-tint); border: 1px solid var(--soul-border);
  border-radius: 999px; padding: 2px 8px; margin-left: auto; white-space: nowrap; }
/* Mind subjects reuse .fin-lib-btn; the not-yet-live ones read as disabled */
.mind-subject.locked { opacity: 0.72; cursor: default; }
.mind-subject.locked:hover { border-color: var(--finance-border); background: var(--card); }
.mind-subject.locked .soon-tag { color: var(--finance-ink); background: var(--finance-tint); border-color: var(--finance-border); }

/* ====================================================================
   Per-subject Mind themes (ADDITIVE). The shared hub/completion UI uses
   the --finance-* token family throughout; each subject re-skins those
   tokens within its own data-track scope, so money stays periwinkle while
   parenting reads warm-coral and communication reads calm-teal — with NO
   change to the shared .fin-* rules. Plus the generic instructor "prop".
   ==================================================================== */
[data-track="parenting"] {
  --finance-accent: #E07856;
  --finance-accent-soft: #F08A66;
  --finance-tint: #FBEEE8;
  --finance-border: #F3D3C6;
  --finance-ink: #8A3D26;
  --finance-gold-deep: #8A3D26;
}
[data-track="communication"] {
  --finance-accent: #2F9E8F;
  --finance-accent-soft: #54C2B2;
  --finance-tint: #E4F4F1;
  --finance-border: #BFE6DF;
  --finance-ink: #1F6E63;
  --finance-gold-deep: #1F6E63;
}

/* distinct badge treatments per learning subject (cf. .badge-cell.finance) */
.badge-cell.parenting { background: #FFF8F5; box-shadow: inset 0 0 0 2px #F3D3C6, var(--shadow-soft); }
.badge-cell.parenting strong { color: #8A3D26; }
.badge-cell.parenting .badge-date { color: #8A3D26; }  /* AA on #FFF8F5 (7.2:1) */
.badge-cell.communication { background: #F4FBF9; box-shadow: inset 0 0 0 2px #BFE6DF, var(--shadow-soft); }
.badge-cell.communication strong { color: #1F6E63; }
.badge-cell.communication .badge-date { color: #1F6E63; }  /* AA on #F4FBF9 (5.8:1) */

/* The coral/teal accents pass AA for borders/fills/large headings but NOT for the
   small accent TEXT (.fin-mins ~14px, source links ~14px) on white cards. Within the
   two new subjects' scope, paint that small text in the darker, AA-passing ink. Money
   (#5B6BD0, 4.7:1) is unaffected. */
[data-track="parenting"] .fin-mins, [data-track="parenting"] .fin-sources a,
[data-track="communication"] .fin-mins, [data-track="communication"] .fin-sources a {
  color: var(--finance-ink);
}

/* ====================================================================
   Memory subject (ADDITIVE) — orchid theme + the two memory games.
   ==================================================================== */
[data-track="memory"] {
  --finance-accent: #B5478B;
  --finance-accent-soft: #D77FB6;
  --finance-tint: #F7E9F2;
  --finance-border: #E6C7DC;
  --finance-ink: #7A2E5E;
  --finance-gold-deep: #7A2E5E;
}
.badge-cell.memory { background: #FDF6FA; box-shadow: inset 0 0 0 2px #E6C7DC, var(--shadow-soft); }
.badge-cell.memory strong { color: #7A2E5E; }
.badge-cell.memory .badge-date { color: #7A2E5E; }

/* ====================================================================
   Soul sections (ADDITIVE) — crystal-amethyst + dream-indigo. They reuse the
   shared learning hub, so they re-skin the --finance-* token family within their
   own data-track scope (like the Mind subjects), with NO change to shared .fin-*
   rules. Plus the live reflective cards that replaced the soul "coming soon" stubs.
   ==================================================================== */
[data-track="crystals"] {
  --finance-accent: #7A57C2;
  --finance-accent-soft: #B79CE8;
  --finance-tint: #F0EBFA;
  --finance-border: #DDD2F1;
  --finance-ink: #5E3FA6;
  --finance-gold-deep: #5E3FA6;
}
[data-track="dreams"] {
  --finance-accent: #4B3FB0;
  --finance-accent-soft: #8B7FE8;
  --finance-tint: #ECEAFA;
  --finance-border: #D3CDF1;
  --finance-ink: #3C3196;
  --finance-gold-deep: #3C3196;
}
/* small accent text (.fin-mins ~14px, source links) on white cards needs the darker
   AA-passing ink within each section's scope (cf. the parenting/communication rule). */
[data-track="crystals"] .fin-mins, [data-track="crystals"] .fin-sources a,
[data-track="dreams"] .fin-mins, [data-track="dreams"] .fin-sources a {
  color: var(--finance-ink);
}
.badge-cell.crystals { background: #F8F5FD; box-shadow: inset 0 0 0 2px #DDD2F1, var(--shadow-soft); }
.badge-cell.crystals strong { color: #5E3FA6; }
.badge-cell.crystals .badge-date { color: #5E3FA6; }
.badge-cell.dreams { background: #F5F4FD; box-shadow: inset 0 0 0 2px #D3CDF1, var(--shadow-soft); }
.badge-cell.dreams strong { color: #3C3196; }
.badge-cell.dreams .badge-date { color: #3C3196; }

/* Belief & reflection section — Crystals/Dreams now live under Mind · Learn but in a
   visually distinct (soul-purple) card so they read as a different kind of learning. */
.reflective-section { background: var(--soul-tint); border: 2px solid var(--soul-border); }
.reflective-section > h2 { color: var(--soul-ink); }
.reflective-section > .hint { color: var(--soul-ink); opacity: 0.85; }
.reflective-section .soul-reflective { background: #fff; }

/* live reflective cards (Crystals/Dreams) */
.soul-reflectives { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.soul-reflective { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; border: 2px solid var(--soul-border); border-radius: var(--radius-sm);
  background: var(--soul-tint); color: var(--soul-ink); cursor: pointer;
  transition: border-color 0.15s ease, transform 0.08s ease, background 0.15s ease; }
.soul-reflective:hover { border-color: var(--soul-accent); transform: translateY(-1px); }
.soul-reflective .pillar-ic { width: 40px; height: 40px; font-size: 1.4rem; background: #fff;
  border-radius: var(--radius-sm); display: grid; place-items: center; flex: 0 0 auto; }
.soul-reflective .pillar-txt { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; }
.soul-reflective .pillar-txt strong { color: var(--soul-ink); }
.soul-reflective .pillar-txt small { color: var(--soul-ink); opacity: 0.82; }
.soul-reflective .soul-go { font-size: 1.2rem; color: var(--soul-accent); flex: 0 0 auto; }

/* Playful · for the bedroom (tasteful intimacy games + tips) */
.soul-bedroom h2 { margin-bottom: 4px; }
.bedroom-btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.bedroom-result { margin-top: 10px; font-size: 1.05rem; min-height: 1.4em; color: var(--ink); }
.bedroom-result:empty { display: none; }
.bedroom-tips { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 10px; }
.bedroom-tips li { display: flex; flex-direction: column; gap: 2px; }
.bedroom-tips li strong { color: var(--ink); }
.bedroom-tips li span { color: var(--ink-soft); font-size: 0.92rem; }

/* games — quick, tap-based memory practice */
.game { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.game-help { text-align: center; max-width: 34ch; }
.game-status { font-weight: 700; color: var(--finance-ink, #7A2E5E); text-align: center; min-height: 1.2em; margin: 0; }
.game-done-btns { display: flex; flex-direction: column; gap: 8px; align-items: stretch; margin-top: 8px; }

.match-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; max-width: 320px; }
.match-card { aspect-ratio: 1 / 1; border: 2px solid var(--finance-border, #E6C7DC); border-radius: var(--radius-sm); background: var(--finance-tint, #F7E9F2); font-size: 1.7rem; cursor: pointer; display: grid; place-items: center; transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease; }
.match-card:hover { transform: translateY(-1px); }
.match-card.flipped { background: #fff; border-color: var(--finance-accent, #B5478B); }
.match-card.matched { background: #EAF6EC; border-color: var(--green-500); cursor: default; }
.match-card span { line-height: 1; }

.seq-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; width: 100%; max-width: 260px; }
.seq-tile { aspect-ratio: 1 / 1; border: 2px solid var(--finance-border, #E6C7DC); border-radius: var(--radius-sm); background: var(--finance-tint, #F7E9F2); cursor: pointer; transition: background 0.1s ease, transform 0.08s ease, box-shadow 0.1s ease; }
.seq-tile:hover { transform: translateY(-1px); }
.seq-tile.lit { background: var(--finance-accent, #B5478B); box-shadow: 0 0 16px var(--finance-accent-soft, #D77FB6); }

/* data-driven concept games: quiz / sort / order (themed per [data-track]) */
.game-quiz, .game-sort, .game-order { width: 100%; max-width: 440px; }
.quiz-stage, .sort-stage { width: 100%; }
.quiz-prompt { font-weight: 600; text-align: center; margin: 4px 0 12px; line-height: 1.4; }
.sort-item { font-weight: 600; text-align: center; margin: 4px 0 12px; padding: 14px 12px; font-size: 1.05rem;
  background: var(--finance-tint, #F7E9F2); border: 2px solid var(--finance-border, #E6C7DC); border-radius: var(--radius-sm); }
.quiz-opts { display: flex; flex-direction: column; gap: 8px; }
.sort-buckets { display: flex; flex-wrap: wrap; gap: 8px; }
.quiz-opt, .sort-bucket, .order-chip {
  padding: 12px 14px; border-radius: var(--radius-sm); border: 2px solid var(--finance-border, #E6C7DC);
  background: #fff; cursor: pointer; font: inherit; color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease; }
.quiz-opt, .order-chip { width: 100%; text-align: left; }
.sort-bucket { flex: 1 1 40%; text-align: center; font-weight: 600; }
.quiz-opt:hover:not(:disabled), .sort-bucket:hover:not(:disabled), .order-chip:hover:not(:disabled) {
  border-color: var(--finance-accent, #B5478B); background: var(--finance-tint, #F7E9F2); }
.quiz-opt:disabled, .sort-bucket:disabled { cursor: default; }
.quiz-opt.correct, .sort-bucket.correct, .order-pick.correct { background: var(--green-100); border-color: var(--green-500); }
.quiz-opt.wrong, .sort-bucket.wrong, .order-pick.wrong { background: #F3E0DA; border-color: var(--coral); }
.quiz-feedback { min-height: 1.2em; margin: 10px 0 6px; color: var(--ink-soft); text-align: center; line-height: 1.4; }
.quiz-next { width: 100%; }
.order-answer { width: 100%; list-style: decimal inside; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.order-pick { background: var(--finance-tint, #F7E9F2); border: 2px solid var(--finance-border, #E6C7DC); border-radius: var(--radius-sm); padding: 8px 10px; }
.order-pool { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.order-chip.used { opacity: 0.4; cursor: default; }

/* major takeaways card on the lesson completion screen */
.fin-takeaways h3 { color: var(--finance-ink, #7A2E5E); }
.fin-takeaways .takeaway-group + .takeaway-group { margin-top: 10px; }
.fin-takeaways h4 { margin: 8px 0 2px; font-size: 0.95rem; color: var(--finance-ink, #7A2E5E); }
.takeaway-list { margin: 4px 0; padding-left: 1.15rem; }
.takeaway-list li { margin: 5px 0; line-height: 1.45; }
.takeaway-list li::marker { color: var(--finance-accent, #B5478B); }

/* blitz arcade — timed HUD + big two-up options */
.game-blitz { width: 100%; max-width: 460px; }
.blitz-hud { display: flex; justify-content: space-between; gap: 8px; width: 100%; font-weight: 800;
  color: var(--finance-ink, #7A2E5E); margin: 2px 0 8px; font-variant-numeric: tabular-nums; }
.blitz-combo { color: var(--finance-accent, #B5478B); }
.blitz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.blitz-opts .quiz-opt { text-align: center; font-size: 1.05rem; padding: 18px 12px; }

/* completion quiz card + done tag */
.fin-quiz.is-complete { border: 2px solid var(--green-500); background: #EAF6EC; }
.fin-quiz-status { margin: 6px 0 10px; color: var(--ink-soft); }
.fin-done-tag { color: var(--green-700); font-weight: 800; }

/* expert tips */
.tip-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.tip-list li { border-left: 3px solid var(--finance-accent, #B5478B); padding: 1px 0 1px 12px; }
.tip-from { display: block; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; color: var(--finance-ink, #7A2E5E); }
.tip-text { display: block; line-height: 1.45; }

/* You dashboard */
.you-hello { font-weight: 700; margin: 8px 0 2px; }
.you-stats { display: flex; justify-content: center; gap: 20px; margin-top: 8px; }
.you-stats div { display: flex; flex-direction: column; }
.you-stats strong { font-size: 1.3rem; color: var(--green-700); }
.you-stats span { font-size: 0.76rem; color: var(--ink-soft); }
.you-subjects { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.you-subject { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  border: 1px solid var(--line, #E3E0D8); border-radius: var(--radius-sm); background: #fff; padding: 10px 12px; cursor: pointer; font: inherit; color: inherit; }
.you-subject:hover { border-color: var(--green-500); }
.you-subj-ic { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; }
.you-subj-body { flex: 1; min-width: 0; }
.you-subj-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.you-subj-stats { display: block; color: var(--ink-soft); font-size: 0.84rem; margin-top: 2px; }
.you-weight-now { margin: 4px 0; }
.you-spark { width: 100%; height: 64px; display: block; margin: 6px 0; }
.you-weight-form, .you-bday-form, .you-name-form, .you-meal-form { display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.you-weight-form input { flex: 1; min-width: 120px; }
.you-weight-form input, .you-weight-form select, .you-bday-form input, .you-name-form input, .you-meal-form input {
  padding: 11px 12px; border: 2px solid var(--line, #E3E0D8); border-radius: var(--radius-sm); font: inherit; background: #fff; }
.you-bday-form input, .you-name-form input, .you-meal-form input { flex: 1; min-width: 150px; }
/* Usage / engagement graphs (You page) — read-only reflection, never a scoreboard.
   Single-hue lightness ramp so it reads under any colour vision; static (no motion). */
.usage-heatmap-wrap, .usage-bars-wrap { overflow-x: auto; margin-top: 8px; -webkit-overflow-scrolling: touch; }
.usage-heatmap { width: 100%; max-width: 340px; height: auto; display: block; }
.uh-cell { stroke: rgba(0,0,0,0.04); stroke-width: 0.5; }
.uh-0 { fill: var(--line, #ECE9E1); background: var(--line, #ECE9E1); }
.uh-1 { fill: #CDEBD2; background: #CDEBD2; }
.uh-2 { fill: #92D69D; background: #92D69D; }
.uh-3 { fill: #57BD6B; background: #57BD6B; }
.uh-4 { fill: var(--green-700, #2F8F46); background: var(--green-700, #2F8F46); }
.usage-legend { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 0.74rem; color: var(--ink-soft); }
.usage-legend .uh-cell { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.usage-sub { font-weight: 700; margin: 12px 0 0; font-size: 0.84rem; color: var(--ink-soft); }
.usage-bars { width: 100%; max-width: 280px; height: auto; display: block; }
.usage-bar { fill: var(--green-600); }
.usage-bars-base { stroke: var(--line, #E3E0D8); stroke-width: 1; }
/* In-lesson difficulty controls (S4): "Explain it simpler" / "Go deeper". */
.lesson-levels { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 4px 0 10px; }
.btn-level { font-size: 0.92rem; padding: 9px 16px; }
/* Journal (S5): private composer + the "book". */
.you-journal-open { display: inline-block; margin-top: 8px; text-decoration: none; }
.journal-compose { width: 100%; padding: 11px 12px; border: 2px solid var(--line, #E3E0D8); border-radius: var(--radius-sm); font: inherit; background: #fff; resize: vertical; min-height: 90px; }
.journal-compose-actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.journal-book-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.journal-book-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.journal-now { color: var(--green-700); font-style: italic; min-height: 0; margin: 6px 0 0; }
.journal-now:empty { display: none; }
.journal-book { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.journal-entry { border: 1px solid var(--line, #EFECE4); border-radius: var(--radius-sm); padding: 10px 12px; background: #fff; }
.journal-entry-head { display: flex; justify-content: space-between; gap: 8px; font-size: 0.78rem; color: var(--ink-soft); }
.journal-text { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.journal-entry-actions { margin-top: 6px; text-align: right; }
.journal-rec-dot { color: #c0392b; }
/* Cycle tracking (S7) — opt-in, descriptive only. */
.cycle-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 8px; }
.cycle-field { display: flex; flex-direction: column; font-size: 0.78rem; color: var(--ink-soft); gap: 3px; }
.cycle-field input { padding: 9px 10px; border: 2px solid var(--line, #E3E0D8); border-radius: var(--radius-sm); font: inherit; background: #fff; }
.cycle-avg-note { margin-top: 10px; }
.cycle-viz { height: 74px; width: auto; max-width: 100%; display: block; margin-top: 8px; }
.cycle-bar { fill: var(--soul-accent, #8E7CC3); }
.cycle-bar-num { fill: var(--ink-soft); font-size: 9px; }
.cycle-avg { stroke: var(--ink-soft); stroke-width: 1; stroke-dasharray: 4 3; }
.cycle-disclaimer { border-left: 3px solid var(--line, #E3E0D8); padding-left: 10px; margin-top: 10px; }
.you-wlist, .you-log { list-style: none; margin: 10px 0 0; padding: 0; }
.you-wlist li, .you-log li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line, #EFECE4); }
.you-log-date { color: var(--ink-soft); font-size: 0.82rem; flex: 0 0 auto; }
.you-log-what { min-width: 0; }

/* Intimacy calendar (v6) — opt-in, descriptive only, emoji-based. */
.intimacy-note { color: var(--ink-soft); }
.topbar-action { margin-left: auto; background: none; border: none; font-size: 1.2rem; cursor: pointer; padding: 4px 8px; }
/* stats strip */
.intim-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 6px; margin-bottom: 12px; }
.intim-stats > div { text-align: center; background: var(--soul-tint, #F3F0FA); border-radius: var(--radius-sm); padding: 8px 4px; }
.intim-stats strong { display: block; font-size: 1.1rem; }
.intim-stats span { font-size: 0.7rem; color: var(--ink-soft); }
/* layer toggles */
.intim-layers { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.intim-layer-chip { border: 2px solid var(--line, #E3E0D8); border-radius: 999px; background: #fff; padding: 4px 11px; cursor: pointer; font: inherit; font-size: 0.78rem; color: var(--ink-soft); opacity: 0.6; }
.intim-layer-chip.is-sel { border-color: var(--soul-accent, #8E7CC3); background: var(--soul-tint, #F6F3FC); color: var(--ink, #2E2A24); opacity: 1; }
.intim-onday { background: var(--soul-tint, #F6F3FC); border-radius: var(--radius-sm); padding: 7px 10px; }
/* month nav */
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cal-title { font-weight: 700; }
.cal-prev, .cal-next { padding: 4px 14px; font-size: 1.1rem; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.cal-dow span { text-align: center; font-size: 0.7rem; color: var(--ink-soft); }
/* day grid */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell { min-height: 52px; border: 2px solid var(--line, #E3E0D8); border-radius: var(--radius-sm); background: #fff;
  display: flex; flex-direction: column; align-items: center; padding: 3px 1px; cursor: pointer; font: inherit; position: relative; overflow: hidden; }
.cal-cell.cal-empty { border: none; background: transparent; cursor: default; }
.cal-cell.has-log { border-color: var(--soul-accent, #8E7CC3); background: var(--soul-tint, #F6F3FC); }
.cal-cell.is-today { box-shadow: inset 0 0 0 2px var(--soul-accent, #8E7CC3); }
.cal-cell.is-sel { outline: 3px solid var(--soul-accent, #8E7CC3); outline-offset: -1px; }
.cal-num { font-size: 0.72rem; color: var(--ink-soft); align-self: flex-start; padding-left: 3px; }
.cal-face { font-size: 1.05rem; line-height: 1; }
.cal-marks { font-size: 0.6rem; line-height: 1.1; text-align: center; margin-top: auto; }
.cal-legend { font-size: 0.7rem; color: var(--ink-soft); margin-top: 8px; }
/* day editor */
.intim-day h2 { font-size: 1.05rem; }
/* The selected day's drawer spans the full grid width, expanding in place under its week. */
.cal-daydetail { grid-column: 1 / -1; }
.cal-daydetail .intim-day { margin: 4px 0 2px; animation: calDayExpand .22s ease both; }
.intim-day-close { float: right; border: none; background: transparent; color: var(--ink-soft); font-size: 1rem; line-height: 1; cursor: pointer; padding: 4px 6px; min-width: 32px; min-height: 32px; }
@keyframes calDayExpand { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cal-daydetail .intim-day { animation: none; } }
.intim-desire-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 12px; }
.intim-desire-btn { border: 2px solid var(--line, #E3E0D8); border-radius: var(--radius-sm); background: #fff; padding: 6px 8px; cursor: pointer; font: inherit; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.intim-desire-btn small { font-size: 0.62rem; color: var(--ink-soft); }
.intim-desire-btn.is-sel { border-color: var(--soul-accent, #8E7CC3); background: var(--soul-tint, #F6F3FC); }
.intim-enc-list { list-style: none; margin: 8px 0; padding: 0; }
.intim-enc-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line, #EFECE4); }
.intim-add summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.intim-enc-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.intim-enc-form input[type="number"] { width: 6em; }
.intim-type { display: flex; gap: 16px; }
.intim-partner-wrap { display: flex; gap: 8px; flex-wrap: wrap; }
.intim-note-field { flex: 1 1 100%; }
.intim-note-field input { width: 100%; }
.intim-faces { display: flex; gap: 6px; }
.intim-face-btn { font-size: 1.4rem; background: none; border: 2px solid transparent; border-radius: var(--radius-sm); cursor: pointer; padding: 2px 4px; filter: grayscale(0.6); opacity: 0.7; }
.intim-face-btn.is-sel { border-color: var(--soul-accent, #8E7CC3); filter: none; opacity: 1; }
.intim-check { display: flex; align-items: center; gap: 8px; }
/* graphs */
.intim-line { stroke: var(--soul-accent, #8E7CC3); stroke-width: 2; }
.intim-dot { fill: var(--soul-accent, #8E7CC3); }
/* settings + PIN */
.intim-sub { font-size: 0.9rem; margin: 16px 0 6px; color: var(--ink-soft); }
.intim-partner-list li em { color: var(--soul-accent, #8E7CC3); font-style: normal; }
.intim-pin-row { display: flex; gap: 8px; justify-content: center; margin: 10px 0; }
.intim-pin-row input { width: 8em; text-align: center; letter-spacing: 0.3em; padding: 9px 10px; border: 2px solid var(--line, #E3E0D8); border-radius: var(--radius-sm); font: inherit; }
.intim-err { color: #c0392b; }
/* mood / energy pickers + symptom chips + insights + backup */
.intim-pick-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 12px; }
.intim-pick-btn { border: 2px solid var(--line, #E3E0D8); border-radius: var(--radius-sm); background: #fff; padding: 5px 9px; cursor: pointer; font: inherit; font-size: 1.3rem; line-height: 1; filter: grayscale(0.55); opacity: 0.7; }
.intim-pick-btn.is-sel { border-color: var(--soul-accent, #8E7CC3); filter: none; opacity: 1; background: var(--soul-tint, #F6F3FC); }
.intim-symptoms { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 12px; }
.intim-sym-chip { border: 2px solid var(--line, #E3E0D8); border-radius: 999px; background: #fff; padding: 5px 12px; cursor: pointer; font: inherit; font-size: 0.82rem; color: var(--ink-soft); }
.intim-sym-chip.is-sel { border-color: var(--soul-accent, #8E7CC3); background: var(--soul-tint, #F6F3FC); color: var(--ink, #2E2A24); }
.intim-insights { list-style: none; margin: 8px 0 0; padding: 0; }
.intim-insights li { padding: 8px 0; border-top: 1px solid var(--line, #EFECE4); }
.intim-insights li:first-child { border-top: none; }
.intim-import-label { display: inline-block; cursor: pointer; margin-left: 8px; }

/* Body workout paths (Stretching / Yoga / Exercises) */
.move-paths { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.move-path { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  border: 2px solid var(--line, #E3E0D8); border-radius: var(--radius-sm); background: #fff; padding: 16px; cursor: pointer; font: inherit; color: inherit; transition: border-color 0.15s ease, background 0.15s ease; }
.move-path:hover { border-color: var(--green-500); background: #F3FAF4; }
.move-path-ic { font-size: 1.9rem; flex: 0 0 auto; line-height: 1; }
.move-path-txt strong { display: block; font-size: 1.05rem; }
.move-path-txt small { color: var(--ink-soft); }

/* birthday party overlay */
.birthday-card { max-width: 390px; }
.party-card { max-width: 390px; }
/* Ginuana's garden stage inside a celebration card: garden backdrop with the host coach
   rendered on a transparent canvas above it, and her name tag once she has arrived. */
.party-stage {
  position: relative; width: 100%; aspect-ratio: 4 / 3; margin: 0 auto 12px;
  border-radius: var(--radius, 16px); overflow: hidden;
  background: linear-gradient(180deg, var(--sky-100) 0%, var(--green-200) 100%);
}
.party-garden { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; }
.party-garden svg, .party-garden .garden-svg { width: 100%; height: 100%; }
.party-coach-slot, .celebrate-coach-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.party-coach-name {
  position: absolute; left: 0; right: 0; bottom: 6px; text-align: center;
  font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  letter-spacing: 0.02em; pointer-events: none;
}
.bday-emoji { font-size: 2.6rem; line-height: 1; }
.bday-age { color: var(--green-700); font-weight: 700; margin: 4px 0 10px; }
.bday-affirm { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.bday-affirm li { background: var(--sun-200, #FBF3D6); border-radius: var(--radius-sm); padding: 9px 12px; line-height: 1.4; }

/* ===== Ship-readiness polish (audit: a11y + mobile touch targets) — additive only ===== */

/* Visually hidden, screen-reader available (e.g. move-change announcements) */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Non-color emphasis for genuine safety cautions (the .safety-note class was undefined) */
.safety-note { border-left: 4px solid #C2731B; background: rgba(194, 115, 27, 0.09); color: var(--ink, #2E2A24); padding: 8px 12px; border-radius: var(--radius-sm, 10px); margin: 8px 0; }

/* Color-independent quiz/sort/order feedback (WCAG 1.4.1 — meaning not by color alone) */
.quiz-opt.correct, .sort-bucket.correct, .order-pick.correct { border-width: 2px; }
.quiz-opt.wrong, .order-pick.wrong { border-width: 2px; border-style: dashed; }
.quiz-opt.correct::after, .sort-bucket.correct::after, .order-pick.correct::after { content: " ✓"; font-weight: 800; }
.quiz-opt.wrong::after, .order-pick.wrong::after { content: " ✗"; font-weight: 800; }

/* Mobile touch-target floors — WCAG 2.5.5. Button-only, so text links are unaffected. */
.intim-layer-chip, .intim-sym-chip { min-height: 40px; display: inline-flex; align-items: center; }
.intim-pick-btn, .intim-desire-btn, .intim-face-btn { min-height: 44px; justify-content: center; }
.btn-level { min-height: 44px; }
.cal-prev, .cal-next { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
.you-meal-del, .intim-enc-del, .intim-prem { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; padding: 6px; }
.topnav a, .back { min-height: 44px; display: inline-flex; align-items: center; }
/* Remaining tap targets: cycle/quick-log inputs, layer + symptom chips, and the
   collapsible summaries all meet the 44px floor on touch screens. */
.cycle-field input, .cycle-field select { min-height: 44px; }
.intim-layer-chip, .intim-sym-chip { min-height: 44px; }
.intim-add summary, .intim-quicklog summary, details.intim-add > summary { min-height: 44px; display: flex; align-items: center; }

/* Realistic-coach loading state — never open the flagship feature to a blank stage */
.stage.is-loading::after {
  content: "Your coach is getting ready…";
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px;
  color: var(--green-700, #2f6b3f); font-weight: 700;
  background: linear-gradient(180deg, #e1f0e6, #cfe8d6);
}
@media (prefers-reduced-motion: no-preference) {
  .stage.is-loading::after { animation: stage-loading-pulse 1.6s ease-in-out infinite; }
  @keyframes stage-loading-pulse { 0%, 100% { opacity: 0.72; } 50% { opacity: 1; } }
}

/* ====================================================================
   Mobile optimizations (phone-first). Additive — desktop is unaffected.
   ==================================================================== */
/* No long word or wide token forces a horizontal scroll on a narrow phone. */
.narrow, .card, .hint, .page-title, h1, h2, h3, p, li { overflow-wrap: break-word; }
html, body { overflow-x: hidden; }
/* Respect landscape notches: pad the app by the larger of 14px or the safe-area inset. */
#app { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
/* iOS zooms the page when focusing a control whose text is < 16px. Keep form text at
   16px on phones so focus never triggers that jarring zoom. */
@media (max-width: 480px) {
  input, select, textarea, button { font-size: max(16px, 1rem); }
}
/* Very small phones (< 380px): give cramped 3-up grids room by dropping to 2 columns,
   and tighten the page gutter a touch. */
@media (max-width: 380px) {
  #app { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .duration-grid { grid-template-columns: repeat(2, 1fr); }
  .card, .garden-card, .level-card, .start-card { padding: 15px; }
  .pillar-card { padding: 14px 10px; }
}
/* Keep the session stage from eating a tall phone's whole screen. */
@media (max-height: 720px) { .stage { max-height: 46vh; } }
