/* ─────────────────────────────────────────────────────────────────────
   Loren
   Navy + white for trust, one confident blue for action, a soft sky tint
   for the things you're saving toward. Cool-gray field, white cards.
   Every token here is shared app-wide, so the whole app moves
   together when the palette does.
   ───────────────────────────────────────────────────────────────────── */

/* Self-hosted fonts (see fonts/README.md for sources and the SIL OFL).
   Variable files: Sora (headlines) covers weights 100-800, Manrope (body, UI
   and amounts) 200-800. Split by unicode-range the way Google Fonts serves
   them, so the Latin Extended file is only fetched when a page needs it. */
@font-face {
  font-family: 'Sora'; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url(fonts/sora-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Sora'; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url(fonts/sora-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/manrope-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/manrope-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --tap-min: 44px;           /* the smallest thing a thumb is asked to hit */
  /* Contrast (WCAG): --text on --bg 15.4:1 · --muted on white 5.4:1, on
     --accent-soft 4.7:1 · --accent on white 5.8:1, on --accent-soft 5.1:1 ·
     white on --accent-strong 8.2:1 · --sky-ink on --navy 9.8:1. */
  --navy: #0B1F3A;           /* nav, headings, the landing band */
  --navy-2: #13305A;
  --brand-navy: #053885;     /* logo navy (brand/loren-brand-tokens.css): the over-plan bar; 10.1:1 on paper */
  --bg: #F4F7FB;             /* light cool gray */
  --bg-tint: #EAF0F8;
  --panel: #FFFFFF;
  --panel-raised: #F7F9FC;
  --border: #D8E1EE;
  --border-soft: #E6ECF4;
  --text: #0B1F3A;
  --text-2: #334766;
  --muted: #5B6B82;
  --accent: #1D5FD1;         /* primary blue — actions */
  --accent-strong: #1549A8;
  --accent-soft: #E6F0FF;    /* sky tint — goal & balance cards */
  --accent-ink: #FFFFFF;     /* text on the accent */
  --sky: #3BA3F5;            /* bright accent: fills, highlights (never body text on white) */
  --sky-soft: #D6ECFF;
  --sky-ink: #9CCBFF;        /* readable blue on navy */

  --take: #0E7A54;      --take-bg: #E4F3EC;   --take-line: #10905F;
  --qualified: #8A5A00; --qualified-bg: #FBF1DC;
  --notrade: #5B6B82;   --notrade-bg: #EDF1F7;
  --error: #B23A2E;     --error-bg: #FBEAE7;  --error-line: #C0392B;
  --warn-bg: #FBF1DC;   --warn-text: #7A5A0A; --warn-border: #E8CE93;


  /* Added for the dark theme: roles that used to be literal colours. Light values are the old literals. */
  --band: #0B1F3A;           /* navy used as a SURFACE (landing band, unit band, monogram); --navy is the heading INK and flips in dark */
  --band-from: #1549A8;      /* start of the band gradients */
  --band-ink: #FFFFFF;
  --on-bright: #0B1F3A;      /* ink on sky / gold fills */
  --fill-ink: #FFFFFF;       /* ink on take / error / accent fills */
  --line-sky: #CFE0FA;       /* hairline on sky-tint cards */
  --line-sky-2: #BFD3F2;
  --edge-strong: #9AAAC0;
  --glass: #FFFFFFEB;        /* header */
  --glass-97: rgba(255, 255, 255, .97);   /* bottom tab bar */
  --close-line: #D39A12;     /* "nearly used" bar */
  --warm-1: #FFFCF4; --warm-2: #FFF8E6; --warm-3: #FFF4D6;
  --take-edge: #BFE3D0; --take-hover: #D3EBDD;
  --error-edge: #F1C6BF;
  --error-solid: #B23A2E; --error-solid-hover: #962F25;   /* danger button fill (white text) */
  --flame: #C2410C;
  --switch-off: #B9C6D8; --switch-on: #1D5FD1;
  color-scheme: light;

  --shadow-sm: 0 1px 2px rgba(11, 31, 58, .05), 0 1px 3px rgba(11, 31, 58, .06);
  --shadow-md: 0 2px 6px rgba(11, 31, 58, .06), 0 10px 26px rgba(11, 31, 58, .08);
  --shadow-lg: 0 14px 44px rgba(11, 31, 58, .16);

  --font-display: 'Sora', 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Mono', 'Cascadia Code', Consolas, monospace;

  --col-tool: 880px;
  --col-wide: 1080px;
  --ease: cubic-bezier(.22, .8, .3, 1);
  --radius: 16px;
  --radius-sm: 10px;
  --tabbar-h: 0px;           /* set on phones, where the bottom tab bar shows */
}

/* Dark theme. Chosen by the person in You (switch "Dark mode"); never by the
   phone setting. Every colour variable of :root is redefined here
   (test/dark-theme.test.js checks that, and the contrast of the pairs). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --navy: #E6EDF8;           /* heading ink: light on dark. Surfaces use --band */
  --navy-2: #C9D8EE;
  --brand-navy: #D4E2FA;     /* the over-plan bar and pill: a pale solid, calm, never red (PRINCIPLES.md rule 8) */
  --bg: #0A111F;
  --bg-tint: #141E33;
  --panel: #111A2C;
  --panel-raised: #172238;
  --border: #2C3B58;
  --border-soft: #1E2B44;
  --text: #E6EDF8;
  --text-2: #BAC7DC;
  --muted: #96A5BF;
  --accent: #7FB0FF;
  --accent-strong: #A8C8FF;
  --accent-soft: #15284A;
  --accent-ink: #0A1A33;
  --sky: #3BA3F5;
  --sky-soft: #1A3556;
  --sky-ink: #9CCBFF;

  --take: #5FD3A1;      --take-bg: #0F2E22;   --take-line: #2FBF85;
  --qualified: #EBB95E; --qualified-bg: #33270D;
  --notrade: #96A5BF;   --notrade-bg: #1A2438;
  --error: #FF9E94;     --error-bg: #3A1B1D;  --error-line: #E5584A;
  --warn-bg: #33270D;   --warn-text: #F0CC84; --warn-border: #6B5320;

  --band: #0F2447;
  --band-from: #1B3F86;
  --band-ink: #E6EDF8;
  --on-bright: #0A1A33;
  --fill-ink: #08101F;
  --line-sky: #274A7A;
  --line-sky-2: #2F5688;
  --edge-strong: #6A7C99;
  --glass: rgba(10, 17, 31, .92);
  --glass-97: rgba(10, 17, 31, .97);
  --close-line: #D68A0A;
  --warm-1: #2A2210; --warm-2: #2E2511; --warm-3: #33270D;
  --take-edge: #1E5A42; --take-hover: #164A36;
  --error-edge: #6A2B2E;
  --error-solid: #B23A2E; --error-solid-hover: #C8473A;
  --flame: #FF9A5C;
  --switch-off: #6A7B99; --switch-on: #2F6FE0;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, .35), 0 10px 26px rgba(0, 0, 0, .35);
  --shadow-lg: 0 14px 44px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }

/* Layout rules below set display on elements the app toggles via [hidden];
   without this they would outrank the UA sheet and stay visible. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font: 15px/1.55 var(--font-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  /* Sticky footer: on a short page the footer sits at the viewport bottom; on a
     long page it flows after the content. */
  min-height: 100vh;
  /* dvh tracks the iOS toolbar as it collapses; 100vh alone leaves the footer
     stranded below the fold. Ordered so browsers without dvh keep the vh rule. */
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }

a { color: var(--accent); }

/* ── Motion (respected-reduced below) ──────────────────────────────── */
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

.skip-link {
  position: absolute; top: 8px; left: 8px; z-index: 100;
  padding: 10px 16px; font: 700 15px/1.2 var(--font-body);
  color: var(--accent-ink); background: var(--accent-strong); border-radius: 10px;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
main:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ── Header ───────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 24px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.brand {
  display: flex;
  align-items: center;
  min-height: var(--tap-min);
  gap: 11px;
  text-decoration: none;
  color: inherit;
}

.monogram {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font: 800 19px/1 var(--font-display);
  color: var(--band-ink);
  background: var(--band);
  border-radius: 11px;
  box-shadow: inset 0 -4px 0 var(--accent);
}

.wordmark {
  font: 700 20px/1 var(--font-display);
  letter-spacing: -.01em;
  color: var(--navy);
}

.tabs { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; }

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 14px;
  font: 600 14.5px/1.2 var(--font-body);
  color: var(--text-2);
  text-decoration: none;
  border-radius: 12px;
  transition: background .15s, color .15s;
}
.tab.active { color: var(--accent-strong); background: var(--accent-soft); }
.nav-ico { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sprite symbol, .tabbar svg, .nav-ico { fill: none; stroke: currentColor; }

.eyebrow {
  margin: 0 0 12px;
  font: 500 11px/1 var(--font-mono);
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.mark {
  display: block;
  width: 7px;
  height: 7px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--accent-strong);
}

@keyframes rail-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes mark-in { from { opacity: 0; transform: translateX(-50%) translateY(4px); } }

.stage { padding: 24px 22px 26px; background: var(--panel); }
.stage h3 {
  margin: 0 0 9px;
  font: 400 18px/1.25 var(--font-display);
  color: var(--text);
}
.stage p { margin: 0; font-size: 13.5px; color: var(--text-2); }

.tool {
  display: flex;
  flex-direction: column;
  padding: 26px 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.tool h3 {
  margin: 0 0 12px;
  font: 400 24px/1.15 var(--font-display);
  color: var(--text);
}

.tool .btn { margin-top: auto; align-self: flex-start; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  font: 600 14.5px/1.2 var(--font-body);
  border: 1.5px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s var(--ease);
}
.btn .ico { width: 19px; height: 19px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(11, 31, 58, .12), 0 4px 12px -4px rgba(29, 95, 209, .45); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: var(--panel);
  border-color: var(--border);
  color: var(--text-2);
}
.btn-soft { background: var(--accent-soft); color: var(--accent-strong); }
.btn-danger-ghost { background: transparent; border-color: var(--border); color: var(--error); }
.btn-sm { position: relative; min-height: 36px; padding: 6px 12px; font-size: 13.5px; border-radius: 10px; }
/* The look stays 36px; an invisible layer lifts the tappable area to the 44px floor. */
.btn-sm::after { content: ''; position: absolute; top: 50%; left: 0; right: 0; min-height: var(--tap-min); transform: translateY(-50%); }
.btn-lg { min-height: 48px; padding: 12px 20px; font-size: 15.5px; }
.btn-xl { min-height: 56px; padding: 14px 24px; font-size: 17px; border-radius: 14px; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { background: var(--bg-tint); border-color: transparent; color: var(--muted); cursor: default; box-shadow: none; transform: none; }

.tickers {
  flex: 1;
  min-width: 220px;
  padding: 10px 12px;
  font: 500 15px/1.2 var(--font-mono);
  letter-spacing: .04em;
  color: var(--text);
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 5px;
}
.tickers::placeholder { color: var(--muted); letter-spacing: .04em; }

.universe {
  flex: 1 1 100%;
  margin: 0;
  font: 400 12px/1.5 var(--font-mono);
  color: var(--muted);
}
.universe .linklike { font: inherit; }

.settings { width: 100%; }
.settings summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  padding: 4px 0;
}

.warning {
  padding: 11px 13px;
  margin-bottom: 12px;
  font-size: 13.5px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 8px;
  color: var(--warn-text);
}

.card {
  margin-bottom: 14px;
  padding: 0 16px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.verdict-take .banner { background: var(--take-bg); color: var(--take); border-bottom: 1px solid var(--take); }
.verdict-qualified .banner { background: var(--qualified-bg); color: var(--qualified); border-bottom: 1px solid var(--qualified); }
.verdict-no_trade .banner { background: var(--notrade-bg); color: var(--notrade); border-bottom: 1px solid var(--notrade); }
.verdict-error .banner { background: var(--error-bg); color: var(--error); border-bottom: 1px solid var(--error); }
.score { float: right; font-weight: 400; letter-spacing: .06em; }

.card h2 {
  margin: 0 0 8px;
  font: 400 22px/1.2 var(--font-display);
  color: var(--text);
}
.card h2 small {
  font: 400 12.5px/1.2 var(--font-mono);
  color: var(--muted);
  letter-spacing: .02em;
}

.trade {
  font: 400 13px/1.65 var(--font-mono);
  color: var(--text-2);
}
.trade strong { color: var(--text); letter-spacing: .04em; text-transform: uppercase; font-size: 12px; }

.why {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 13.5px;
  color: var(--muted);
}
.why li { margin-bottom: 3px; }

.exit {
  margin: 12px 0;
  padding: 10px 14px 12px;
  font-size: 13.5px;
  background: var(--panel-raised);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}
.exit summary {
  cursor: pointer;
  font: 500 11px/1.4 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
.took { background: var(--take-bg); color: var(--take); border-color: var(--take); }
/* An action that cannot be taken must not wear the colour of one that can:
   the take-green disabled state was near-identical to the live button and
   silently absorbed clicks. `.is-unavailable` stays clickable so the handler
   can explain itself; `:disabled` is the settled post-log state. */
.took:disabled {
  background: var(--panel-raised);
  color: var(--muted);
  border-color: var(--border);
}
.took:disabled { cursor: not-allowed; }
.save:disabled { opacity: .7; }

.status { padding: 10px 0; font-size: 13.5px; color: var(--muted); }

/* ── Footer ───────────────────────────────────────────────────────── */
.site-footer {
  max-width: var(--col-wide);
  margin: 0 auto;
  padding: 30px 24px 44px;
  border-top: 1px solid var(--border-soft);
}
.disclaimer {
  margin: 0 0 10px;
  max-width: 78ch;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--muted);
}
.disclaimer em { font-style: italic; }
.copyright {
  margin: 0;
  font: 400 11px/1 var(--font-mono);
  letter-spacing: .08em;
  color: var(--muted);
}

@media (max-width: 620px) {
  .site-header { padding: 10px 16px; }
  .wordmark { font-size: 15px; }
  .tabs { width: 100%; }
  .tab { padding: 7px 10px; font-size: 13px; }
  .tab.active::after { left: 10px; right: 10px; }
  .site-footer { padding-left: 16px; padding-right: 16px; }

}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  /* Seed System doc, "Respect Reduce Motion": every animation becomes a
     150ms cross-fade instead of the blanket near-instant snap above — the
     plant still visibly changes state, it just doesn't move to get there. */
  .seed-mark-ring-fill, .seed-mark-stem, .seed-mark-leaves, .seed-water-drop {
    transition-duration: 150ms !important;
  }
  /* The confetti burst is pure motion with no state change behind it, so
     it's off entirely. */
  .seed-confetti { display: none !important; }

}

/* ── Auth (header + modal) ─────────────────────────────────────────── */
.auth { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-user { display: flex; align-items: center; gap: 10px; }
.auth-name { font: 600 14px/1 var(--font-body); color: var(--text-2); }
.auth .btn { padding: 7px 13px; font-size: 13px; }

/* A modal taller than the screen (the onboarding quick check is 8 questions)
   used to be centred in both directions with no overflow, so its top and
   bottom were unreachable. Now the backdrop itself scrolls, and the card's
   auto margins centre it when it fits and pin it to the top when it doesn't.
   The page behind is locked while a modal is open (html.modal-open, set by
   app.js). */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: flex;
  background: rgba(11, 31, 58, .52); backdrop-filter: blur(3px);
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
html.modal-open, html.modal-open body { overflow: hidden; }
.modal {
  position: relative;
  margin: auto;
  flex: none;
  width: 100%; max-width: 400px;
  padding: 28px 26px 24px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow-lg);
  animation: fade-up .35s var(--ease) both;
}
.modal.is-nudged { animation: nudge .38s ease-in-out; }
@keyframes nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
.modal-close {
  position: absolute; top: 8px; right: 8px;
  display: grid; place-items: center; width: 44px; height: 44px;
  background: none; border: 0; border-radius: 12px; color: var(--muted);
  font-size: 24px; line-height: 1; cursor: pointer;
}
.modal-title { margin: 0 0 4px; font: 700 24px/1.2 var(--font-display); letter-spacing: -.01em; color: var(--text); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font: 600 14px/1.2 var(--font-body); color: var(--text-2); }
.auth-form input {
  min-height: 48px; padding: 10px 13px; font: 500 16px/1.2 var(--font-body);
  color: var(--text); background: var(--panel); border: 1.5px solid var(--border); border-radius: 12px;
}
.auth-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.auth-form input:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.auth-form .btn { margin-top: 4px; }
.auth-error { margin: 0; padding: 8px 10px; font-size: 13px; background: var(--error-bg); color: var(--error); border-radius: 6px; }
.auth-switch { margin: 16px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.linklike { background: none; border: 0; color: var(--accent-strong); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
.pf-step.pf-due .pf-label { color: var(--qualified); }
.pf-step.pf-due .pf-date { color: var(--qualified); }
.pf-step.pf-past { opacity: .5; }
.pf-step.pf-past .pf-label { text-decoration: line-through; }

@media (max-width: 620px) {
  .site-header { flex-wrap: wrap; }
  .auth { margin-left: 0; }

}

/* ── Risk assessment view ─────────────────────────────────────────── */
.panel-assessment { max-width: 760px; margin: 0 auto; padding: 40px 24px 72px; }
.pillars { display: grid; gap: 12px; max-width: 460px; margin: 0 auto 26px; text-align: left; }

.chart-empty { font-size: 13px; color: var(--muted); }

.viz { display: block; width: 100%; height: auto; overflow: visible; }
.viz-tick { font: 400 10px var(--font-mono); fill: var(--muted); }
.viz-rowlabel { font: 500 11.5px var(--font-mono); fill: var(--navy); }
.viz-rowval { font: 400 11px var(--font-mono); fill: var(--muted); }
.viz-rowval.is-out { fill: var(--error); font-weight: 500; }
.viz-bar { stroke: var(--panel); stroke-width: 2; paint-order: stroke; }
.viz-target { stroke: var(--navy); stroke-width: 1.5; stroke-dasharray: 4 3; }

/* ── iOS safe areas ───────────────────────────────────────────────────
   index.html sets viewport-fit=cover, which lets the page paint into the
   rounded corners and under the Dynamic Island and home indicator. That is
   only correct if the chrome then insets itself. Without this block the
   installed app draws the brand lockup under the status bar and the footer
   under the home indicator.

   The insets are 0 on every non-notched device and on desktop, so these rules
   are inert there; the @supports guard keeps older browsers off env() maths. */
@supports (padding: env(safe-area-inset-top)) {
  .site-header {
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-left: calc(24px + env(safe-area-inset-left));
    padding-right: calc(24px + env(safe-area-inset-right));
  }
  .site-footer {
    padding-bottom: calc(44px + env(safe-area-inset-bottom));
    padding-left: calc(24px + env(safe-area-inset-left));
    padding-right: calc(24px + env(safe-area-inset-right));
  }
  /* Fixed to the viewport, so it owns its own insets on all four sides. */
  .modal-backdrop {
    padding: calc(20px + env(safe-area-inset-top)) calc(20px + env(safe-area-inset-right))
             calc(20px + env(safe-area-inset-bottom)) calc(20px + env(safe-area-inset-left));
  }
  /* The narrow breakpoints drop the side padding to 16px; keep them in step so
     content still clears the rounded corners in landscape. */
  @media (max-width: 620px) {
    .site-footer {
      padding-left: calc(16px + env(safe-area-inset-left));
      padding-right: calc(16px + env(safe-area-inset-right));
    }
    /* The compact header is `padding: 10px 16px` — a shorthand, so re-state the
       top inset against 10px or it keeps the 12px from the desktop rule above. */
    .site-header {
      padding-top: calc(10px + env(safe-area-inset-top));
      padding-left: calc(16px + env(safe-area-inset-left));
      padding-right: calc(16px + env(safe-area-inset-right));
    }
  
}

}


/* ═════════════════════════════════════════════════════════════════════
   Loren — personal finance (Home, Budget, Goals, Accounts, onboarding)
   One obvious action per screen, plain words, big touch targets (44px+),
   depth behind "More options". Sky-tint cards hold the things you're saving
   toward; navy carries trust; the primary blue is only ever "do this".
   ═════════════════════════════════════════════════════════════════════ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.panel-finance { max-width: var(--col-wide); margin: 0 auto; padding: 0 24px; }
.fin-page { padding: 32px 0 48px; }
.page-head { margin: 4px 0 24px; }
.page-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-title { margin: 0; font: 800 clamp(28px, 4.4vw, 40px)/1.08 var(--font-display); letter-spacing: -.025em; color: var(--navy); text-wrap: balance; }
.page-sub { margin: 8px 0 0; max-width: 60ch; font-size: 16.5px; color: var(--text-2); }
.fine { margin: 0; font-size: 13.5px; color: var(--muted); }
.page-fine { margin-top: 32px; text-align: center; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.empty-state { max-width: 520px; margin: 40px auto; text-align: center; }
.empty-state .row-actions { justify-content: center; margin-top: 22px; }
.empty-state .page-sub { margin-left: auto; margin-right: auto; }
.empty-ico { display: inline-grid; place-items: center; width: 72px; height: 72px; margin-bottom: 18px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 22px; }
.empty-ico .ico { width: 36px; height: 36px; }

/* Visually hidden radios/checkboxes whose styled <span> is the control. */
.goal-pick, .seg label, .tile-check, .opt, .type-pick { position: relative; }
.goal-pick input, .seg input, .tile-check input, .opt input, .type-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.goal-pick input:focus-visible + span, .seg input:focus-visible + span, .tile-check input:focus-visible + span,
.opt input:focus-visible + span, .type-pick input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ── Fields ──────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field-label { font: 600 14.5px/1.3 var(--font-body); color: var(--text-2); padding: 0; }
.field-label em { font-style: normal; font-weight: 500; color: var(--muted); }
.field > input, .field > select, .field > textarea, .pg-custom input, .pg-other-cur select {
  width: 100%; min-height: 48px; padding: 10px 13px;
  font: 500 16px/1.2 var(--font-body); color: var(--text);
  background: var(--panel); border: 1.5px solid var(--border); border-radius: 12px;
}
.field > textarea { font-family: var(--font-body); resize: vertical; }
.field > input:focus, .field > select:focus, .field > textarea:focus, .pg-custom input:focus, .pg-other-cur select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field > input:focus-visible, .field > select:focus-visible, .field > textarea:focus-visible, .pg-custom input:focus-visible, .pg-other-cur select:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.stack-form { display: grid; gap: 16px; }
.stack-form > .btn { justify-self: start; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 10px 0 12px; }
.inline-form .field { flex: 1 1 200px; }
.form-error { margin: 0; padding: 10px 12px; font-size: 14.5px; color: var(--error); background: var(--error-bg); border-radius: 10px; }

.money-input {
  display: flex; align-items: stretch; min-height: 48px; width: 100%;
  background: var(--panel); border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden;
}
.money-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.money-input > span, .money-input > select {
  display: flex; align-items: center; flex: none; padding: 0 12px;
  font: 700 14.5px/1 var(--font-body); color: var(--text-2);
  background: var(--panel-raised); border: 0; border-right: 1px solid var(--border-soft);
}
.money-input > select { cursor: pointer; padding-right: 6px; min-width: 9.5rem; max-width: 70%; text-overflow: ellipsis; }
.money-input > select:focus { outline: none; }
.money-input input { flex: 1; min-width: 0; padding: 10px 12px; font: 600 18px/1.2 var(--font-body); color: var(--text); background: transparent; border: 0; font-variant-numeric: tabular-nums; }
.money-input input:focus { outline: none; }
.money-input-lg { min-height: 58px; }
.money-input-lg input { font: 800 26px/1 var(--font-body); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px;
  font: 600 14.5px/1.1 var(--font-body); color: var(--text-2);
  background: var(--panel); border: 1.5px solid var(--border); border-radius: 999px; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.chip .ico { width: 18px; height: 18px; }

.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg-tint); border-radius: 14px; }
.seg span {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: var(--tap-min); padding: 8px 16px;
  font: 600 14.5px/1 var(--font-body); color: var(--text-2); border-radius: 10px; cursor: pointer; transition: background .15s, color .15s;
}
.seg span .ico { width: 18px; height: 18px; }
.seg input:checked + span { background: var(--panel); color: var(--accent-strong); box-shadow: var(--shadow-sm); }
.seg-2 { display: flex; width: 100%; }
.seg-2 label { flex: 1; }
.seg-2 span { width: 100%; }

.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; flex: none; color: var(--muted); background: none; border: 0; border-radius: 12px; cursor: pointer; }

details.more > summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  font: 600 14.5px/1 var(--font-body); color: var(--accent-strong); cursor: pointer; list-style: none;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after {
  content: ''; width: 7px; height: 7px; margin: -3px 0 0 2px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
  transition: transform .18s var(--ease);
}
details.more[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.more-card { margin-top: 18px; padding: 2px 18px; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; }
.more-card[open] { padding-bottom: 18px; }
.more-card .sheet-card { margin: 4px 0 0; box-shadow: none; border: 0; padding: 0; }

/* ── Progress bar (savings milestones, budget use) ─────────────────── */
.pbar { position: relative; height: 14px; margin: 14px 0 10px; background: var(--bg-tint); border-radius: 999px; overflow: hidden; }
.pbar.on-soft { background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-sky); }
.pbar-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--sky), var(--accent)); transition: width .6s var(--ease); }
.pbar i { position: absolute; top: 3px; bottom: 3px; width: 2px; margin-left: -1px; background: rgba(255, 255, 255, .85); border-radius: 1px; }
.pbar.on-soft i { background: var(--line-sky); }
.pbar.is-good .pbar-fill { background: var(--take-line); }
.pbar.is-close .pbar-fill { background: var(--close-line); }
.pbar.is-over .pbar-fill { background: var(--error-line); }

.pill { flex: none; padding: 4px 10px; font: 700 12.5px/1.2 var(--font-body); border-radius: 999px; }
.pill.is-good { color: var(--take); background: var(--take-bg); }
.pill.is-close { color: var(--warn-text); background: var(--warn-bg); }
.pill.is-over { color: var(--error); background: var(--error-bg); }
.is-good { color: var(--take); }
.is-close { color: var(--warn-text); }
.is-over { color: var(--error); }
/* Spent past the plan (budget bars, pills, Home tile): a fact, not an error, so no red
   (PRINCIPLES.md rule 8), and navy rather than gold so it can never be mistaken for the amber
   'Nearly used'. Bar is the brand navy (>= 3:1 on track, white and the summary card); the pill is
   navy on the soft sky tint with a navy-tint hairline. The red .is-over above is for genuine errors. */
.pbar.is-above .pbar-fill { background: var(--brand-navy); }
.pill.is-above { color: var(--brand-navy); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(5, 56, 133, .28); }
.is-above { color: inherit; }

/* ── Landing (logged-out Home): the savings playground ─────────────── */
.landing { padding: 20px 0 48px; }
.land-hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 40px; align-items: center;
  padding: 52px 48px; color: #fff; border-radius: 30px;
  background:
    radial-gradient(520px 320px at 8% 108%, rgba(59, 163, 245, .30), transparent 70%),
    radial-gradient(420px 260px at 96% -8%, rgba(29, 95, 209, .55), transparent 70%),
    var(--band);
}
.land-copy { padding-top: 12px; }
.land-copy h1 { margin: 0; font: 800 clamp(36px, 5.4vw, 60px)/1.0 var(--font-display); letter-spacing: -.025em; color: #fff; text-wrap: balance; }
.land-lede { margin: 18px 0 0; max-width: 44ch; font-size: 18.5px; line-height: 1.55; color: #C9D8EE; }
.land-points { margin: 26px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.land-points li { display: flex; align-items: center; gap: 10px; font: 600 16px/1.3 var(--font-body); color: #E6EEF9; }
.land-points .ico { width: 22px; height: 22px; padding: 3px; color: var(--on-bright); background: var(--sky); border-radius: 50%; stroke-width: 2.6; }
.land-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 26px 0 0; }
.land-cta > span { font-size: 14.5px; color: var(--sky-ink); }
.land-glimpse { position: relative; justify-self: center; width: min(100%, 360px); }
.lg-tag { position: absolute; top: -10px; right: 14px; z-index: 1; margin: 0; padding: 3px 10px; font: 700 12px/1.4 var(--font-body); letter-spacing: .04em; text-transform: uppercase; color: var(--on-bright); background: var(--sky); border-radius: 999px; }
.lg-card { padding: 20px 20px 16px; color: var(--text); background: var(--accent-soft); border: 1px solid var(--border-soft); border-radius: 22px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .45); }
.lg-head { display: flex; align-items: center; gap: 12px; }
.lg-head > span:last-child { display: grid; gap: 2px; }
.lg-seed { flex: none; width: 48px; height: 48px; margin: 0; }
.lg-kicker { font: 600 13px/1.2 var(--font-body); color: var(--text-2); }
.lg-name { font: 800 22px/1.15 var(--font-display); color: var(--navy); }
.lg-amt { margin: 14px 0 0; font-size: 15.5px; color: var(--text-2); }
.lg-amt strong { font: 800 22px/1.1 var(--font-body); color: var(--navy); font-variant-numeric: tabular-nums; }
.lg-meta { margin: 0; font-size: 14.5px; color: var(--text-2); }
.landing > .founding-strip { margin: 14px 0 0; }
.land-play { max-width: 720px; margin: 56px auto 0; }
.land-play .section-title { text-align: center; }
.land-play .playground { border: 1px solid var(--border-soft); box-shadow: var(--shadow-md); }

.playground {
  color: var(--text); background: var(--panel); border-radius: 24px; padding: 26px 24px 22px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .45);
}
.pg-block { margin: 0 0 22px; padding: 0; border: 0; min-width: 0; }
.pg-q { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 0; font: 700 17px/1.25 var(--font-display); color: var(--navy); }
.pg-n { display: grid; place-items: center; width: 28px; height: 28px; flex: none; font: 800 14px/1 var(--font-body); color: var(--accent-strong); background: var(--accent-soft); border-radius: 50%; }
.goal-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.goal-pick span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 10px 15px;
  font: 600 15px/1.1 var(--font-body); color: var(--text-2);
  background: var(--panel); border: 1.5px solid var(--border); border-radius: 999px; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.goal-pick input:checked + span { color: var(--accent-strong); background: var(--accent-soft); border-color: var(--accent); }
.goal-pick .ico { width: 20px; height: 20px; }
.pg-custom, .pg-other-cur { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.pg-slider { display: grid; grid-template-columns: 1fr 170px; gap: 14px; align-items: center; margin-top: 14px; }
.pg-slider input[type=range] { width: 100%; height: 32px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.pg-result { margin: 0 0 18px; padding: 16px 18px 14px; background: var(--accent-soft); border-radius: 18px; }
.stairs { display: block; width: 100%; height: auto; }
.stairs .st-bar { fill: var(--sky); opacity: .5; }
.stairs .st-last { fill: var(--accent); opacity: 1; }
.stairs .st-goal { stroke: var(--navy); stroke-width: 1.5; stroke-dasharray: 4 4; }
.stairs .st-base { stroke: var(--border); stroke-width: 1.5; }
.stairs .st-flag path { fill: none; stroke: var(--accent-strong); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.stairs .st-label { font: 600 11.5px var(--font-body); fill: var(--text-2); }
.pg-when { display: flex; flex-direction: column; gap: 4px; margin: 12px 0 0; font-size: 16px; color: var(--text-2); }
.pg-when strong { color: var(--navy); }
.pg-big { font: 800 32px/1.05 var(--font-body); letter-spacing: -.02em; color: var(--navy); font-variant-numeric: tabular-nums; }
.pg-nudge { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin: 12px 0 0; padding: 10px 12px; font-size: 15px; color: var(--text-2); background: var(--panel); border-radius: 12px; }
.pg-nudge > .ico { color: var(--accent); }
.pg-nudge > span { flex: 1 1 200px; }
.pg-nudge strong { color: var(--navy); }
.pg-foot { margin: 14px 0 0; font-size: 15px; color: var(--muted); text-align: center; }
.pg-foot .linklike { font-weight: 600; min-height: 44px; }

.section-title { margin: 0 0 18px; font: 800 clamp(24px, 3vw, 32px)/1.15 var(--font-display); letter-spacing: -.02em; color: var(--navy); text-wrap: balance; }
.land-how { margin: 64px 0 0; }
.how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 0; padding: 0; list-style: none; }
.how-steps li { position: relative; padding: 24px 22px; background: var(--panel); border: 1px solid var(--border-soft); border-radius: 22px; box-shadow: var(--shadow-sm); }
.how-ico { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 16px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 16px; }
.how-ico .ico { width: 28px; height: 28px; }
.how-steps h3 { margin: 0 0 6px; font: 700 19px/1.25 var(--font-display); color: var(--navy); }
.how-steps p { margin: 0; font-size: 15.5px; color: var(--text-2); }
.land-trust { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: center; margin: 40px 0 0; padding: 32px; background: var(--panel); border: 1px solid var(--border-soft); border-radius: 24px; }
.land-trust .section-title { margin-bottom: 8px; }
.land-trust p { margin: 0; max-width: 58ch; font-size: 16px; color: var(--text-2); }
.land-ways { margin: 56px 0 0; }
.land-own { margin: 40px 0 0; padding: 28px 32px; background: var(--accent-soft); border: 1px solid var(--line-sky); border-radius: 22px; }
.land-own .section-title { margin-bottom: 8px; }
.land-own p { margin: 0; max-width: 62ch; font-size: 16px; color: var(--text-2); }
.land-trust .land-end { display: flex; justify-content: flex-end; }
.soon { display: inline-block; margin-left: 6px; padding: 2px 10px; vertical-align: middle; font: 700 12px/1.5 var(--font-body); letter-spacing: .02em; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--line-sky-2); border-radius: 999px; }
.land-own .soon { background: var(--panel); }

/* ── Logged-in Home ─────────────────────────────────────────────────── */
.hero-goal { position: relative; padding: 28px; background: var(--accent-soft); border: 1px solid var(--line-sky); border-radius: 26px; }
.hg-header { display: flex; align-items: flex-start; gap: 16px; }
.hg-header-text { min-width: 0; flex: 1; }
.hg-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.hg-kicker { margin: 0; font: 700 14.5px/1.2 var(--font-body); color: var(--accent-strong); }
.hg-sheng { font-weight: 500; color: var(--text-2); }
.goal-switch select { min-height: 44px; padding: 6px 10px; font: 600 15px var(--font-body); color: var(--text); background: var(--panel); border: 1.5px solid var(--border); border-radius: 10px; }
.hg-name { margin: 6px 0 4px; font: 800 clamp(26px, 3.8vw, 38px)/1.1 var(--font-display); letter-spacing: -.025em; color: var(--navy); overflow-wrap: anywhere; }
.hg-amount { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin: 0; font-size: 17px; color: var(--text-2); }
.hg-amount strong { font: 800 30px/1.1 var(--font-body); letter-spacing: -.02em; color: var(--navy); font-variant-numeric: tabular-nums; }
.hg-pct { align-self: center; margin-left: 4px; padding: 3px 10px; font: 700 13.5px/1.3 var(--font-body); color: var(--accent-strong); background: var(--panel); border-radius: 999px; }
.hg-meta { margin: 0; font-size: 15.5px; color: var(--text-2); }
.hg-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.hg-save-box { max-width: 480px; margin-top: 16px; padding: 18px; background: var(--panel); border-radius: 18px; box-shadow: var(--shadow-sm); }
.hero-goal.is-done .pbar-fill { background: linear-gradient(90deg, var(--accent), var(--accent-strong)); }
.hero-goal-empty { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.hero-goal-empty h2 { margin: 0 0 4px; font: 800 26px/1.15 var(--font-display); color: var(--navy); }
.hero-goal-empty p { margin: 0; color: var(--text-2); font-size: 16px; }
.setup-dots { display: flex; gap: 6px; margin: 16px 0 0; }
.setup-dots span { width: 40px; height: 6px; background: var(--panel); border-radius: 999px; }
.setup-dots .is-done { background: var(--accent); }
.setup-dots .is-now { background: var(--sky); }

.save-form { display: grid; gap: 12px; }
.save-form .fine { text-align: center; }

.insights { display: grid; gap: 12px; margin: 20px 0 0; }
.insight { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; padding: 16px 14px 16px 18px; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; }
.insight-ico { display: grid; place-items: center; width: 40px; height: 40px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 50%; }
.insight h3 { margin: 0 0 3px; font: 700 16.5px/1.3 var(--font-display); color: var(--navy); }
.insight p { margin: 0; font-size: 15px; color: var(--text-2); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin: 20px 0 0; }
.tile { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 22px; background: var(--panel); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-sm); }
.tile > .btn { align-self: flex-start; margin-top: auto; }
.tile-title { display: flex; align-items: center; gap: 10px; margin: 0; font: 700 18.5px/1.2 var(--font-display); color: var(--navy); }
.tile-title .ico { color: var(--accent); }
.tile-figure { margin: 0; font-size: 15.5px; color: var(--text-2); }
.tile-figure strong { font: 800 26px/1.2 var(--font-body); letter-spacing: -.02em; color: var(--navy); font-variant-numeric: tabular-nums; }
.tile-note { margin: 0; font: 600 14.5px/1.3 var(--font-body); }
.tile-empty { margin: 0; font-size: 15.5px; color: var(--text-2); }
.tile-sub { margin: 14px 0 0; font: 700 15.5px/1.2 var(--font-display); color: var(--navy); }
.tile .pbar { margin: 4px 0 0; }
.tile .viz { margin-top: 6px; }

/* Home: Import a budget, first (owner instruction 24 Oct 2026). Navy outline, soft accent icon; reuses .btn and .linklike. */
.import-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 14px 18px; align-items: center; margin: 0 0 20px; padding: 20px 22px; background: var(--panel); border: 2px solid var(--navy); border-radius: 20px; }
.import-hero h2 { margin: 0 0 4px; font: 700 19px/1.25 var(--font-display); color: var(--navy); }
.import-hero p { margin: 0; font-size: 15px; color: var(--text-2); }
.ih-actions { display: grid; justify-items: center; gap: 4px; }
.ih-actions .linklike, .import-line .linklike { min-height: 44px; font-weight: 600; }
.import-line { margin: 18px 0 0; text-align: center; }
.describe-budget, .import-budget { scroll-margin-top: 84px; }
.callout { display: grid; grid-template-columns: auto 1fr auto; gap: 14px 16px; align-items: center; margin: 20px 0 0; padding: 18px 20px; background: var(--panel); border: 1.5px dashed var(--line-sky-2); border-radius: 20px; }
.callout-ico { display: grid; place-items: center; width: 48px; height: 48px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 14px; }
.callout h3 { margin: 0 0 3px; font: 700 17px/1.3 var(--font-display); color: var(--navy); }
.callout p { margin: 0; font-size: 15px; color: var(--text-2); }
.callout + .hero-goal { margin-top: 20px; }

/* ── Admin (operator metrics, #admin) ───────────────────────────────── */
.admin-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.admin-stat { min-width: 0; padding: 18px 20px; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-sm); }
.admin-stat:first-child { background: var(--accent-soft); border-color: var(--line-sky); }
.admin-stat-label { margin: 0; font: 600 13.5px/1.3 var(--font-body); color: var(--text-2); }
.admin-stat-value { margin: 6px 0 4px; font: 800 32px/1.1 var(--font-body); letter-spacing: -.02em; color: var(--navy); font-variant-numeric: tabular-nums; }
.admin-stat-note { margin: 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.admin-refresh { align-self: flex-end; }
.admin-records, .admin-referrals, .admin-feedback { grid-column: 1 / -1; }
.admin-referrals code { font: 700 14px/1 ui-monospace, Consolas, monospace; letter-spacing: .06em; }
.admin-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 32px; align-items: start; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.admin-table th, .admin-table td { padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.admin-table th { font-weight: 600; text-align: left; color: var(--navy); }
.admin-table td { text-align: right; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.admin-table tr.is-sub th { padding-left: 16px; font-weight: 400; color: var(--text-2); }
.admin-table tr.is-sub td { font-weight: 400; color: var(--text-2); }
.admin-table tr:last-child th, .admin-table tr:last-child td { border-bottom: 0; }
.admin-learning > .page-head-row { align-items: center; }
.admin-scroll { margin-top: 8px; overflow-x: auto; }
.admin-table-3 thead th { font-size: 13px; font-weight: 600; color: var(--muted); }
.admin-table-3 thead th + th { text-align: right; }
.admin-table-3 td { padding-left: 12px; white-space: nowrap; }
.admin-table-3 tbody th { overflow-wrap: anywhere; }
@media (max-width: 900px) { .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } 
}
@media (max-width: 759px) {
  .admin-stat { padding: 14px 16px; }
  .admin-stat-value { font-size: 26px; }
  .auth .auth-admin { padding: 7px 10px; }

}

/* ── Goals ───────────────────────────────────────────────────────────── */
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.goal-card { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 20px; background: var(--accent-soft); border: 1px solid var(--line-sky); border-radius: 24px; transition: box-shadow .18s; }
.gc-top { display: flex; align-items: center; gap: 16px; }
.gc-ring { width: 84px; flex: none; }
.gc-ring .viz-rowlabel { font: 800 17px var(--font-body); fill: var(--navy); }
.gc-ring circle:first-child { stroke: var(--panel); }
.gc-text { min-width: 0; }
.gc-name { margin: 0; font: 700 20px/1.2 var(--font-display); color: var(--navy); overflow-wrap: anywhere; }
.gc-amount { margin: 4px 0 0; font-size: 15px; color: var(--text-2); }
.gc-choice-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.gc-convert { margin-top: 12px; }
.gc-amount strong { color: var(--navy); font-variant-numeric: tabular-nums; }
.gc-meta { margin: 3px 0 0; font-size: 14px; color: var(--muted); }
.gc-save-box { padding: 16px; background: var(--panel); border-radius: 18px; }
.goal-card details.more { border-top: 1px solid var(--line-sky); }
.goal-card details.more .btn-danger-ghost { margin: 4px 0 6px; }
.goal-card.is-done { background: linear-gradient(160deg, var(--accent-soft), var(--sky-soft)); }

.sheet-card { margin: 0 0 22px; padding: 22px; background: var(--panel); border: 1.5px solid var(--line-sky); border-radius: 24px; box-shadow: var(--shadow-md); }
.sheet-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: -6px -8px 12px 0; min-height: 44px; }
.add-goal .chips { margin-bottom: 16px; }

/* ── Budget ──────────────────────────────────────────────────────────── */
.bs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.budget-summary { padding: 24px; background: var(--accent-soft); border: 1px solid var(--line-sky); border-radius: 24px; }
.bs-label { margin: 0; font: 600 15px/1.3 var(--font-body); color: var(--text-2); }
.bs-figure { margin: 6px 0 0; font-size: 17px; color: var(--text-2); }
.bs-figure strong { font: 800 34px/1.1 var(--font-body); letter-spacing: -.02em; color: var(--navy); font-variant-numeric: tabular-nums; }
.budget-summary .pbar { background: var(--panel); }
.bs-left { margin: 0; font: 600 15.5px/1.3 var(--font-body); }
.bud-list { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.bud-row { padding: 16px 18px 6px; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; }
.bud-row-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.bud-name { font: 700 16.5px/1.3 var(--font-display); color: var(--navy); }
.bud-row .pbar { height: 10px; margin: 12px 0 4px; }
.bud-row-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14.5px; color: var(--text-2); }
.bud-row-bottom strong { color: var(--navy); font-variant-numeric: tabular-nums; }
.bud-edit { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px; font-weight: 600; text-decoration: none; }
.bud-edit .ico { width: 17px; height: 17px; }
.suggest-card.is-lead { border-color: var(--accent); }
.suggest-card .tile-title { margin-bottom: 8px; }
.budget-suggest-list { margin: 10px 0 14px; padding: 0; list-style: none; }
.budget-suggest-list li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; font-size: 15.5px; color: var(--text-2); border-bottom: 1px solid var(--border-soft); }
.budget-suggest-list strong { color: var(--navy); font-variant-numeric: tabular-nums; }

/* ── Describe your budget (natural-language parser confirm card) ──────── */
.describe-budget textarea { min-height: 84px; }
.describe-result:empty { margin: 0; }
.dnl-cadence { margin: 4px 0 14px; }
.dnl-list { display: grid; gap: 10px; margin: 10px 0 14px; padding: 0; list-style: none; }
.dnl-line { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; }
.dnl-keep { flex: none; padding-top: 3px; }
.dnl-keep input { width: 20px; height: 20px; }
.dnl-line-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.dnl-source { margin: 0; font-size: 13.5px; color: var(--muted); font-style: italic; }
.dnl-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dnl-fields select { min-height: 44px; padding: 8px 10px; font: 500 15px/1.2 var(--font-body); color: var(--text); background: var(--panel); border: 1.5px solid var(--border); border-radius: 10px; flex: 1 1 160px; }
.dnl-fields .money-input { flex: 0 1 160px; min-height: 44px; }
.dnl-kind-label { font: 700 13px/1 var(--font-body); color: var(--accent-strong); text-transform: uppercase; letter-spacing: .03em; }
.dnl-line .pill { align-self: flex-start; }
.dnl-unparsed { margin: 14px 0; }
.dnl-unparsed .mini-list li { color: var(--muted); }
.dnl-unparsed .ico { width: 15px; height: 15px; color: var(--muted); }

/* ── Accounts ────────────────────────────────────────────────────────── */
.mpesa-card { display: grid; grid-template-columns: auto 1fr auto; gap: 16px 20px; align-items: center; margin: 0 0 20px; padding: 22px 24px; color: #C9D8EE; background: var(--band); border-radius: 24px; }
.mpesa-card h2 { margin: 0 0 4px; font: 700 21px/1.2 var(--font-display); color: #fff; }
.mpesa-card p { margin: 0; max-width: 62ch; font-size: 15px; }
.mpesa-ico { display: grid; place-items: center; width: 56px; height: 56px; color: var(--sky-ink); background: rgba(59, 163, 245, .16); border-radius: 16px; }
.mpesa-ico .ico { width: 30px; height: 30px; }
.mpesa-card .btn-primary { color: var(--on-bright); background: #fff; box-shadow: none; }
.mpesa-card .btn:disabled { color: #C9D8EE; background: rgba(255, 255, 255, .1); }
.acct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.acct-list, .tx-list { display: grid; margin: 4px 0 0; padding: 0; list-style: none; }
.acct-row { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 12px; align-items: center; padding: 12px 0 4px; border-bottom: 1px solid var(--border-soft); }
.acct-row:last-child, .tx-row:last-child { border-bottom: 0; }
.acct-ico, .tx-ico { display: grid; place-items: center; width: 42px; height: 42px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 12px; }
.acct-name, .tx-what { min-width: 0; }
.acct-name strong, .tx-what strong { display: block; font: 600 15.5px/1.3 var(--font-body); color: var(--navy); overflow-wrap: anywhere; }
.acct-name small, .tx-what small { display: block; font-size: 13.5px; color: var(--muted); }
.acct-bal { font: 700 16px/1.2 var(--font-body); color: var(--navy); font-variant-numeric: tabular-nums; }
.acct-bal.is-owed { color: var(--error); }
.acct-more { grid-column: 2 / -1; }
.acct-more .btn-danger-ghost { margin-top: 2px; }
.acct-more .fine { margin: 6px 0 10px; }
.tx-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.tx-ico.is-out { color: var(--text-2); background: var(--bg-tint); }
.tx-ico.is-in { color: var(--take); background: var(--take-bg); }
.tx-amt { font: 700 15.5px/1.2 var(--font-body); font-variant-numeric: tabular-nums; }
.tx-amt.is-out { color: var(--navy); }
.tx-amt.is-in { color: var(--take); }
.type-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.type-pick span { display: flex; align-items: center; gap: 9px; min-height: 50px; padding: 10px 12px; font: 600 14.5px/1.2 var(--font-body); color: var(--text-2); background: var(--panel); border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; }
.type-pick input:checked + span { color: var(--accent-strong); background: var(--accent-soft); border-color: var(--accent); }

/* ── Onboarding ──────────────────────────────────────────────────────── */
.onboarding-modal { max-width: 560px; padding: 20px 24px 26px; }
.ob-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 18px; }
.ob-progress { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ob-dot { width: 28px; height: 6px; background: var(--border); border-radius: 999px; }
.ob-dot.is-done { background: var(--accent); }
.ob-dot.is-active { background: var(--sky); }
.onboarding-modal .modal-title { font-size: 27px; outline: none; }
.ob-copy { margin: 6px 0 18px; font-size: 16px; line-height: 1.55; color: var(--text-2); }
.ob-note { margin: -6px 0 16px; padding: 10px 12px; font-size: 14.5px; color: var(--warn-text); background: var(--warn-bg); border-radius: 10px; }
.ob-promises { display: grid; gap: 10px; margin: 0 0 8px; padding: 0; list-style: none; }
.ob-promises li { display: flex; align-items: center; gap: 10px; font: 600 15.5px/1.3 var(--font-body); color: var(--text-2); }
.ob-promises .ico { padding: 3px; color: var(--accent-ink); background: var(--accent); border-radius: 50%; stroke-width: 2.6; }
.ob-form { display: grid; gap: 14px; }
.ob-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.ob-actions .ob-back { margin-right: auto; }
.tile-checks { display: grid; gap: 8px; }
.tile-check span { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; font: 600 15.5px/1.25 var(--font-body); color: var(--text); background: var(--panel); border: 1.5px solid var(--border); border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.tile-check span > .ico { color: var(--accent); }
.tile-check .tick { display: grid; place-items: center; width: 26px; height: 26px; margin-left: auto; flex: none; color: var(--fill-ink); border: 1.5px solid var(--edge-strong); border-radius: 8px; }
.tile-check .tick .ico { width: 16px; height: 16px; opacity: 0; stroke-width: 2.8; }
.tile-check input:checked + span { background: var(--accent-soft); border-color: var(--accent); }
.tile-check input:checked + span .tick { background: var(--accent); border-color: var(--accent); }
.tile-check input:checked + span .tick .ico { opacity: 1; }
.ob-goal-rows { display: grid; gap: 12px; }
.ob-goal-row { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 16px; border: 1.5px solid var(--border-soft); border-radius: 16px; }
.ob-add-goal { justify-self: start; }
.ob-risk-q { margin: 0 0 22px; padding: 0; border: 0; min-width: 0; }
.ob-risk-q legend { margin-bottom: 10px; padding: 0; font: 700 16.5px/1.35 var(--font-display); color: var(--navy); }
.opt-list { display: grid; gap: 8px; }
.opt span { position: relative; display: flex; align-items: center; min-height: 50px; padding: 11px 14px 11px 46px; font-size: 15.5px; color: var(--text); background: var(--panel); border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.opt span::before { content: ''; position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; margin-top: -10px; box-sizing: border-box; border: 2px solid var(--edge-strong); border-radius: 50%; background: var(--panel); transition: border-width .15s, border-color .15s; }
.opt input:checked + span { background: var(--accent-soft); border-color: var(--accent); }
.opt input:checked + span::before { border: 6px solid var(--accent); }
.ob-error { margin: 0 0 12px; padding: 10px 12px; font-size: 14.5px; color: var(--error); background: var(--error-bg); border-radius: 10px; }
.ob-done-art { display: grid; place-items: center; width: 68px; height: 68px; margin: 4px 0 14px; color: var(--accent-ink); background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 8px var(--accent-soft); animation: pop .5s var(--ease) both; }
.ob-done-art .ico { width: 34px; height: 34px; stroke-width: 2.6; }
.ob-personality strong { color: var(--accent-strong); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* ── Inline notices (there are no toasts or pop-ups) ──────────────────
   Confirmations and errors appear inside the card where the action
   happened (public/finance/ui.js showNotice). Success fades after a few
   seconds; the goal-milestone band stays until dismissed. */
.inline-notice, .celebrate-band {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center;
  margin: 12px 0; padding: 8px 4px 8px 12px; border-radius: 16px;
  animation: notice-in .3s var(--ease) both; transition: opacity .4s var(--ease);
}
.inline-notice.is-ok { color: var(--text); background: var(--take-bg); border: 1px solid var(--take-edge); }
.inline-notice.is-error { color: var(--error); background: var(--error-bg); border: 1px solid var(--error-edge); }
.inline-notice.is-fading { opacity: 0; }
.celebrate-band { color: #fff; background: linear-gradient(135deg, var(--band-from), var(--band) 75%); padding-top: 12px; padding-bottom: 12px; }
.notice-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--fill-ink); }
.notice-ico .ico { width: 19px; height: 19px; stroke-width: 2.6; }
.is-ok .notice-ico { background: var(--take-line); }
.is-error .notice-ico { background: var(--error-line); }
.celebrate-band .notice-ico { width: 42px; height: 42px; color: var(--on-bright); background: var(--sky-ink); }
.notice-text strong { display: block; font: 700 15.5px/1.25 var(--font-display); }
.notice-text span { display: block; margin-top: 2px; font-size: 14px; line-height: 1.4; }
.is-ok .notice-text span { color: var(--text-2); }
.celebrate-band .notice-text strong { font-size: 17px; }
.celebrate-band .notice-text span { color: #C9D8EE; }
.notice-close { display: grid; place-items: center; width: 44px; height: 44px; color: inherit; opacity: .75; background: none; border: 0; border-radius: 12px; cursor: pointer; }
.notice-close .ico { width: 19px; height: 19px; }
.goal-card > .inline-notice, .goal-card > .celebrate-band, .hero-goal > .inline-notice, .hero-goal > .celebrate-band { margin: 0 0 12px; }
.acct-row > .inline-notice { grid-column: 1 / -1; margin: 6px 0 8px; }
.inline-error { margin-top: 8px; }

/* ── Sorting card (public/finance/sort.js) ───────────────────────────── */
.sort-slot:not(:empty) { margin: 0 0 20px; }
.sort-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.sort-confirm { margin: 12px 0; padding: 14px 16px; background: var(--bg-tint); border-radius: 14px; }
.sort-confirm p { margin: 0 0 8px; }
.sort-note { margin: 10px 0 0; font-size: 15px; color: var(--text-2); }
.sort-list, .sort-rule-list { margin: 8px 0 0; padding: 0; list-style: none; }
.sort-line { padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.sort-what { display: grid; gap: 2px; margin-bottom: 8px; }
.sort-what small { color: var(--muted); }
.sort-picks { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sort-pick, .sort-pick-else { min-height: 44px; }
.sort-else { flex-basis: 100%; }
.sort-else-select { min-height: 44px; margin: 6px 8px 0 0; max-width: 100%; }
.sort-rule-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.sort-rule-list small { color: var(--muted); }
@keyframes notice-in { from { opacity: 0; transform: translateY(-4px); } }

/* ── "Did you know?" cards (public/finance/tips.js) ──────────────────── */
.dyk-card { margin: 0 0 20px; background: var(--panel); border: 1.5px solid var(--line-sky); border-radius: 18px; }
.dyk-card > summary { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 16px; cursor: pointer; list-style: none; }
.dyk-card > summary::-webkit-details-marker { display: none; }
.dyk-card > summary::after {
  content: ''; flex: none; width: 8px; height: 8px; margin: -4px 4px 0 auto;
  border-right: 2px solid var(--accent-strong); border-bottom: 2px solid var(--accent-strong); transform: rotate(45deg);
  transition: transform .18s var(--ease);
}
.dyk-card[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.dyk-ico { display: grid; place-items: center; width: 36px; height: 36px; flex: none; color: var(--accent-strong); background: var(--accent-soft); border-radius: 12px; }
.dyk-ico .ico { width: 20px; height: 20px; }
.dyk-text { display: flex; flex-direction: column; min-width: 0; }
.dyk-kicker { font: 700 12px/1.3 var(--font-body); letter-spacing: .05em; text-transform: uppercase; color: var(--accent-strong); }
.dyk-title { font: 700 15.5px/1.3 var(--font-display); color: var(--navy); }
.dyk-body { padding: 0 16px 16px 64px; }
.dyk-body p { margin: 0 0 12px; font-size: 15px; color: var(--text-2); }
.dyk-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dyk-actions .btn { white-space: normal; }
.draft-flag { display: inline-block; margin: 0 0 10px !important; padding: 3px 10px; font: 700 12.5px/1.3 var(--font-body) !important; color: var(--qualified) !important; background: var(--qualified-bg); border-radius: 999px; }

/* ── Learn: the Money Path ───────────────────────────────────────────── */
.learn-next { margin: 0 0 16px; padding: 20px; background: var(--accent-soft); border: 1px solid var(--line-sky); border-radius: 24px; }
.learn-next-kicker { margin: 0 0 10px; font: 700 12.5px/1.2 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-strong); text-align: center; }
.learn-next .btn-xl { white-space: normal; text-align: center; }
.learn-next-title { margin: 10px 0 0; font-weight: 600; color: var(--text-2); text-align: center; }
.learn-next.is-finished { display: flex; align-items: center; gap: 14px; }
.learn-next.is-finished h2 { margin: 0; font: 700 18px/1.25 var(--font-display); color: var(--navy); }
.learn-next.is-finished p { margin: 4px 0 0; color: var(--text-2); }
.learn-next-ico { display: grid; place-items: center; width: 52px; height: 52px; flex: none; color: var(--accent-ink); background: var(--accent); border-radius: 50%; }
.learn-meta { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 0 0 8px; }
.learn-streak { display: flex; align-items: center; gap: 12px; margin: 0; padding: 10px 16px 10px 10px; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; }
.streak-ico { display: grid; place-items: center; width: 40px; height: 40px; flex: none; color: var(--muted); background: var(--bg-tint); border-radius: 50%; }
.learn-streak.is-on .streak-ico { color: var(--accent-strong); background: var(--accent-soft); }
.streak-text strong { display: block; font: 700 15.5px/1.25 var(--font-display); color: var(--navy); }
.streak-text span { display: block; font-size: 13.5px; color: var(--muted); }
.learn-guest { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-size: 14.5px; color: var(--text-2); }
.learn-guest > .ico { color: var(--accent); }
.learn-guest .linklike, .done-note .linklike { min-height: 44px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px 6px 8px; font: 600 13.5px/1.2 var(--font-body); color: var(--accent-strong); background: var(--panel); border: 1.5px solid var(--line-sky); border-radius: 999px; }
.badge .ico { width: 20px; height: 20px; }

.money-path { display: grid; gap: 30px; margin-top: 22px; }
.unit-band { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 16px 18px; color: #fff; background: var(--band); border-radius: 22px; }
.unit-ico { display: grid; place-items: center; width: 48px; height: 48px; color: var(--sky-ink); background: rgba(255, 255, 255, .1); border-radius: 14px; }
.unit-ico .ico { width: 26px; height: 26px; }
.unit-text h2 { margin: 0; font: 700 19px/1.2 var(--font-display); }
.unit-text p { margin: 3px 0 0; font-size: 14px; line-height: 1.45; color: #C9D8EE; }
.unit-count { font: 600 13.5px/1.2 var(--font-body); color: var(--sky-ink); white-space: nowrap; }
.path-list { --wind: 34px; display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 22px 0 0; padding: 0; list-style: none; }
.path-node { transform: translateX(calc(var(--x) * var(--wind))); }
.node-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 230px; padding: 4px; color: inherit; text-align: center; text-decoration: none; border-radius: 18px; }
.node-dot { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; box-shadow: 0 5px 0 rgba(11, 31, 58, .16); transition: transform .15s var(--ease); }
.node-dot .ico { width: 30px; height: 30px; stroke-width: 2.2; }
.is-done .node-dot { color: var(--accent-ink); background: var(--accent); }
.is-current .node-dot { width: 82px; height: 82px; color: var(--accent-ink); background: var(--accent-strong); box-shadow: 0 0 0 8px var(--accent-soft), 0 6px 0 rgba(11, 31, 58, .2); animation: node-breathe 2.6s ease-in-out infinite; }
.is-current .node-dot .ico { width: 34px; height: 34px; fill: currentColor; }
.is-locked .node-dot { color: var(--muted); background: var(--bg-tint); border: 2px solid var(--border); box-shadow: none; }
.is-draft .node-dot { color: var(--qualified); background: var(--panel); border: 2.5px dashed var(--qualified); box-shadow: none; }
.node-label strong { display: block; font: 700 15px/1.25 var(--font-display); color: var(--navy); }
.node-label small { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); }
.is-locked .node-label strong { color: var(--muted); }
.is-current .node-label strong { color: var(--accent-strong); }
@keyframes node-breathe { 50% { box-shadow: 0 0 0 13px var(--accent-soft), 0 6px 0 rgba(11, 31, 58, .2); } }

.review-drafts { margin: 0 0 22px; padding: 18px 20px; background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 20px; }
.review-drafts .tile-title .pill { margin-left: 4px; }
.review-drafts > .fine { margin-top: 6px; color: var(--warn-text); }
.review-drafts.is-clear { padding: 12px 16px; background: var(--panel); border-color: var(--border); }
.review-drafts.is-clear .fine { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); }
.review-list { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.review-item { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 8px 10px 8px 14px; background: var(--panel); border-radius: 14px; }
.review-item > .inline-notice { flex-basis: 100%; margin: 0; }
.review-bulk { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin: 12px 0 0; }
.review-pick { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 6px; font: 600 14.5px/1.3 var(--font-body); color: var(--navy); cursor: pointer; }
.review-pick input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--accent); }
.review-item > .review-pick { padding: 0; }
.review-confirm { margin: 12px 0 0; padding: 14px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; }
.review-confirm[hidden] { display: none; }
.review-confirm-title { margin: 0 0 6px; font: 700 16px/1.3 var(--font-body); color: var(--navy); }
.review-confirm-list { margin: 0 0 8px; padding-left: 20px; font-size: 14.5px; color: var(--text); }
.review-confirm .row-actions { margin-top: 8px; }
.review-link { display: flex; flex-direction: column; justify-content: center; flex: 1 1 200px; min-width: 0; min-height: 44px; color: var(--navy); text-decoration: none; }
.review-link small { color: var(--muted); font-size: 13px; }
.review-problems { margin-top: 10px; }
.review-problems ul { margin: 6px 0 8px; padding-left: 18px; font-size: 13.5px; color: var(--text-2); }
.review-problems code { font-size: 12.5px; overflow-wrap: anywhere; }

/* ── Learn: one lesson ───────────────────────────────────────────────── */
.lesson-page, .gloss-page { max-width: 700px; margin: 0 auto; }
.lesson-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 0 16px; }
.lesson-where { font: 600 13.5px/1.3 var(--font-body); color: var(--muted); }
.draft-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin: 0 0 16px; padding: 14px 16px; color: var(--warn-text); background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 16px; }
.draft-bar p { flex: 1 1 260px; margin: 0; font-size: 14.5px; }
.admin-lesson { margin: 0 0 12px; }
.admin-lesson .fine { margin: 0 0 8px; }
.lesson-title { margin: 0; font: 800 clamp(26px, 4.2vw, 34px)/1.12 var(--font-display); letter-spacing: -.02em; color: var(--navy); text-wrap: balance; }
.lesson-summary { margin: 8px 0 0; font-size: 16px; color: var(--text-2); }
.lesson-min { white-space: nowrap; font-size: 14px; color: var(--muted); }
.lesson-progress { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin: 18px 0 16px; }
.lesson-progress span { height: 8px; background: var(--bg-tint); border-radius: 999px; transition: background .2s; }
.lesson-progress span.is-done { background: var(--accent); }
.lesson-progress span.is-now { background: var(--sky); }
.lesson-progress span.is-quiz-start { margin-left: 6px; }
.lesson-card { min-height: 240px; padding: 24px; background: var(--panel); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow-md); animation: fade-up .35s var(--ease) both; }
.card-count { margin: 0 0 8px; font: 700 12.5px/1.2 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-strong); }
.card-heading { margin: 0 0 12px; font: 800 22px/1.25 var(--font-display); color: var(--navy); outline: none; }
.card-body { font-size: 17px; line-height: 1.65; color: var(--text); overflow-wrap: break-word; }
.card-body p { margin: 0 0 12px; }
.card-body p:last-child { margin-bottom: 0; }
.card-body strong { color: var(--navy); }
/* A tappable glossary word. The ::after widens the hit area to 44px tall
   without pushing the lines of text apart. */
.gloss-term {
  position: relative; display: inline; padding: 0 2px; font: inherit; line-height: inherit; font-weight: 600;
  color: var(--accent-strong); background: var(--accent-soft); border: 0; border-bottom: 2px dotted var(--accent); border-radius: 4px; cursor: pointer;
}
.gloss-term::after { content: ''; position: absolute; left: -2px; right: -2px; top: 50%; height: 44px; transform: translateY(-50%); }
.gloss-term[aria-expanded="true"] { color: var(--accent-ink); background: var(--accent); border-bottom-color: var(--accent-strong); }
.gloss-def { margin: 0 0 14px; padding: 12px 14px; font-size: 15.5px; line-height: 1.55; background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 0 12px 12px 0; animation: fade-up .25s var(--ease) both; }
.gloss-def p { margin: 0; }
.gloss-def .gloss-def-term { margin-bottom: 4px; color: var(--navy); }
.gloss-sw { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.gloss-more { display: inline-flex; align-items: center; min-height: 44px; font-size: 14.5px; }
.lesson-nav { display: flex; gap: 10px; margin: 16px 0 0; }
.lesson-nav .btn { flex: 1 1 auto; }
.lesson-nav .btn-ghost { flex: 0 1 auto; }
.swipe-hint { margin-top: 10px; text-align: center; }
@media (hover: hover) and (pointer: fine) { .swipe-hint { display: none; } 
}
.quiz-options { display: grid; gap: 10px; margin-top: 6px; }
.quiz-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; padding: 12px 16px;
  font: 600 16.5px/1.35 var(--font-body); text-align: left; color: var(--text);
  background: var(--panel); border: 2px solid var(--border); border-radius: 14px; box-shadow: 0 3px 0 var(--border-soft); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.quiz-opt:disabled { cursor: default; }
.quiz-opt:disabled:not(.is-right):not(.is-wrong) { opacity: .7; }
.quiz-opt .ico { width: 22px; height: 22px; stroke-width: 2.6; }
.quiz-opt.is-right { color: var(--take); background: var(--take-bg); border-color: var(--take-line); }
.quiz-opt.is-wrong { color: var(--error); background: var(--error-bg); border-color: var(--error-line); }
.quiz-explain { margin-top: 14px; padding: 14px 16px; border-radius: 14px; animation: fade-up .25s var(--ease) both; }
.quiz-explain.is-right { background: var(--take-bg); }
.quiz-explain.is-wrong { background: var(--bg-tint); }
.quiz-verdict { margin: 0 0 6px; font-size: 16px; }
.quiz-explain.is-right .quiz-verdict strong { color: var(--take); }
.quiz-explain .card-body { font-size: 16px; }
.lesson-done { padding: 28px 22px; text-align: center; background: var(--accent-soft); border: 1px solid var(--line-sky); border-radius: 24px; animation: fade-up .4s var(--ease) both; }
.done-ico { display: inline-grid; place-items: center; width: 72px; height: 72px; margin-bottom: 12px; color: var(--accent-ink); background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 8px var(--panel); }
.done-ico .ico { width: 36px; height: 36px; stroke-width: 2.6; }
.lesson-done .card-heading { margin-bottom: 8px; font-size: 26px; }
.done-score { margin: 0 0 8px; font-size: 17px; color: var(--text-2); }
.done-note { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 8px; margin: 8px 0 0; font-size: 15.5px; color: var(--text-2); }
.done-note .ico { color: var(--accent-strong); }
.done-actions { display: grid; gap: 12px; margin-top: 20px; }
.done-actions .btn-xl { white-space: normal; }
.done-actions .row-actions { justify-content: center; }
.lesson-foot { display: grid; gap: 10px; margin-top: 28px; padding: 16px 18px; background: var(--panel-raised); border: 1px solid var(--border-soft); border-radius: 16px; }
.lesson-disclaimer { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-size: 14.5px; font-weight: 600; color: var(--text-2); }
.lesson-disclaimer .ico { color: var(--accent); }
.lesson-sources ul { margin: 2px 0 0; padding-left: 18px; font-size: 14.5px; }
.lesson-sources a { display: inline-block; padding: 8px 0; overflow-wrap: anywhere; }

/* ── Learn: glossary ─────────────────────────────────────────────────── */
.gloss-tools { margin: 0 0 8px; }
.search-input { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; color: var(--muted); background: var(--panel); border: 1.5px solid var(--border); border-radius: 12px; }
.search-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.search-input input { flex: 1; min-width: 0; min-height: 44px; font: 500 16px/1.2 var(--font-body); color: var(--text); background: transparent; border: 0; }
.search-input input:focus { outline: none; }
.az { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0 8px; }
.az-btn { min-width: 44px; min-height: 44px; font: 700 15px/1 var(--font-display); color: var(--accent-strong); background: var(--panel); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.gloss-letter { scroll-margin-top: 84px; }
.gloss-letter-h { margin: 22px 0 8px; font: 800 22px/1 var(--font-display); color: var(--navy); }
.gloss-item { margin: 0 0 8px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; scroll-margin-top: 84px; }
.gloss-item[open] { border-color: var(--line-sky-2); }
.gloss-item > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-height: 52px; padding: 14px 16px; list-style: none; cursor: pointer; }
.gloss-item > summary::-webkit-details-marker { display: none; }
.gloss-item-term { font: 700 16.5px/1.3 var(--font-display); color: var(--navy); }
.gloss-item-body { padding: 0 16px 12px; }
.gloss-item-body p { margin: 0 0 8px; }
.gloss-related a { display: inline-block; padding: 6px 2px; }

/* ── Learn: loading skeleton (learn.js's showPath, before the catalog
   arrives) — shaped like the Money Path it is about to become: a "next
   lesson" banner, then unit bands with a few lesson nodes under each. No
   other page in the app has a shimmer skeleton yet, so this pattern is new;
   reuse it rather than a bare "Loading…" string if another view needs one. */
.skeleton-block {
  border-radius: 16px;
  background: linear-gradient(100deg, var(--bg-tint) 30%, var(--border-soft) 50%, var(--bg-tint) 70%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
.skeleton-next { height: 108px; margin: 0 0 16px; border-radius: 24px; }
.skeleton-unit { height: 72px; margin: 0 0 16px; border-radius: 22px; }
.skeleton-nodes { display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 0 0 30px; }
.skeleton-node { width: 68px; height: 68px; border-radius: 50%; }
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 759px) {
  .path-list { --wind: 22px; }
  .node-btn { max-width: 190px; }
  .unit-band { grid-template-columns: auto minmax(0, 1fr); }
  .unit-count { grid-column: 2; }
  .lesson-card { padding: 20px 18px; }
  .dyk-body { padding-left: 16px; }
  .learn-next { padding: 16px; }
  .lesson-nav .btn-xl { padding-left: 14px; padding-right: 14px; }

}

/* ── Bottom tab bar + phone layout ───────────────────────────────────── */
.tabbar { display: none; }

@media (max-width: 759px) {
  :root { --tabbar-h: 64px; }
  /* Room for the fixed tab bar (plus the home indicator) under the last
     thing on every page — the footer included. */
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }

  .site-header { flex-wrap: nowrap; gap: 10px; background: var(--panel); backdrop-filter: none; }
  .tabs { width: auto; }
  .tabs .tab-main { display: none; }
  .auth { margin-left: auto; }
  .auth .btn { min-height: var(--tap-min); padding: 7px 12px; font-size: 14px; }
  .auth-name { display: none; }

  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: repeat(5, 1fr);
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding: 6px max(6px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(6px, env(safe-area-inset-left, 0px));
    background: var(--glass-97); border-top: 1px solid var(--border);
    box-shadow: 0 -6px 20px -12px rgba(11, 31, 58, .25);
  }
  .tabbar-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 52px; padding: 0; font: 600 12px/1 var(--font-body); color: var(--muted);
    text-decoration: none; background: none; border: 0; border-radius: 14px; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar-item svg { width: 24px; height: 24px; padding: 3px 16px; box-sizing: content-box; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; border-radius: 999px; transition: background .15s; }
  .tabbar-item.active, .tabbar-item[aria-expanded="true"] { color: var(--accent-strong); }
  .tabbar-item.active svg, .tabbar-item[aria-expanded="true"] svg { background: var(--accent-soft); }

  .panel-finance { padding: 0 16px; }
  .fin-page { padding: 20px 0 32px; }
  .page-head-row > .btn { width: 100%; }
  .land-hero { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 28px 12px 12px; border-radius: 24px; }
  .land-copy { padding: 0 8px; }
  .land-lede { font-size: 17px; }
  .land-points { margin-top: 18px; gap: 10px; }
  .land-points li { font-size: 15px; }
  .land-copy h1 { font-size: clamp(32px, 9vw, 40px); }
  .land-lede { margin-top: 12px; }
  .land-cta { margin-top: 18px; }
  .land-cta .btn { flex: 1 1 100%; }
  .land-glimpse { width: 100%; }
  .lg-card { padding: 14px 16px 12px; }
  .land-play { margin-top: 40px; }
  .playground { padding: 20px 16px 18px; border-radius: 20px; }
  .pg-slider { grid-template-columns: 1fr; gap: 8px; }
  .pg-big { font-size: 28px; }
  .how-steps { grid-template-columns: 1fr; }
  .land-trust { grid-template-columns: 1fr; padding: 22px 18px; }
  .land-own { padding: 22px 18px; }
  .land-trust .land-end { justify-content: stretch; }
  .land-trust .land-end .btn { width: 100%; }
  .hero-goal { padding: 22px 18px; }
  .hg-actions > .btn { flex: 1 1 100%; }
  .import-hero { grid-template-columns: auto 1fr; padding: 18px; }
  .import-hero .ih-actions { grid-column: 1 / -1; }
  .import-hero .callout-ico { width: 40px; height: 40px; }
  .callout { grid-template-columns: auto 1fr; }
  .callout > .btn, .callout > .row-actions { grid-column: 1 / -1; }
  .mpesa-card { grid-template-columns: auto 1fr; padding: 20px 18px; }
  .mpesa-card > .btn { grid-column: 1 / -1; }
  .tile, .sheet-card, .budget-summary { padding: 18px; }
  .stack-form > .btn { justify-self: stretch; }
  .acct-grid, .tiles, .goal-grid { grid-template-columns: minmax(0, 1fr); }

  /* Onboarding is a full-screen page on phones: no backdrop to mis-tap, and
     it scrolls like any page. */
  .modal-sheet { padding: 0 !important; }
  .modal-sheet .modal {
    min-height: 100%; max-width: none; border: 0; border-radius: 0;
    padding: calc(14px + env(safe-area-inset-top, 0px)) calc(18px + env(safe-area-inset-right, 0px))
             calc(28px + env(safe-area-inset-bottom, 0px)) calc(18px + env(safe-area-inset-left, 0px));
  }
  .ob-actions > .btn-primary { flex: 1; }

}

@supports (padding: env(safe-area-inset-top)) {
  @media (max-width: 759px) {
    .panel-finance {
      padding-left: calc(16px + env(safe-area-inset-left));
      padding-right: calc(16px + env(safe-area-inset-right));
    }
  
}

}

/* ═════════════════════════════════════════════════════════════════════
   The Loren shell: logo kit v1 mark, Home · Money · Goals · Learn · Chama,
   the "You" menu and pages, sign-up, the Kenyan footer.
   ═════════════════════════════════════════════════════════════════════ */
/* Transparent line-art mark (a coin with a seed and sprout): no background
   tile, no shadow or gradient per the logo kit's usage rules. */
.brand-mark { display: block; width: 38px; height: 38px; flex: none; }

/* ── You menu ─────────────────────────────────────────────────────── */
.you-menu { position: relative; }
.you-summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 12px 4px 5px;
  list-style: none; cursor: pointer; font: 600 14.5px/1 var(--font-body); color: var(--text-2);
  background: var(--panel); border: 1.5px solid var(--border); border-radius: 999px;
  transition: border-color .15s, background .15s;
}
.you-summary::-webkit-details-marker { display: none; }
.you-menu[open] .you-summary, .you-menu.active .you-summary { border-color: var(--accent); color: var(--accent-strong); }
.you-avatar { display: grid; place-items: center; width: 32px; height: 32px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 50%; }
.you-avatar svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.you-menu .caret { font-size: 10px; opacity: .7; transition: transform .15s ease; }
.you-menu[open] .caret { transform: rotate(180deg); }
.you-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30;
  display: flex; flex-direction: column; gap: 2px; min-width: 250px; padding: 8px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 16px 38px -14px rgba(11, 31, 58, .32);
}
.you-profile { display: flex; flex-direction: column; gap: 3px; margin: 0 0 6px; padding: 8px 12px 12px; border-bottom: 1px solid var(--border-soft); }
.you-profile .auth-name { display: block; font: 700 16px/1.25 var(--font-display); color: var(--navy); }
.you-phone { font: 500 13.5px/1.3 var(--font-body); color: var(--muted); font-variant-numeric: tabular-nums; }
.you-phone:empty { display: none; }
.you-item {
  display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: 10px;
  font: 600 14.5px/1.2 var(--font-body); color: var(--text-2); text-decoration: none; text-align: left;
  background: none; border: 0; cursor: pointer; width: 100%;
}
.you-danger { color: var(--error); }
.auth-admin { color: var(--navy); }
.auth-logout { border-top: 1px solid var(--border-soft); border-radius: 0 0 10px 10px; margin-top: 4px; }

/* ── Money: Plan | Accounts ─────────────────────────────────────── */
.panel-money { max-width: var(--col-wide); margin: 0 auto; padding: 0 24px; }
.panel-money > .panel-finance { max-width: none; padding: 0; }

/* Loren (the personal-finance side: Home, Money, Goals, Learn, Chama, You)
   fills whatever screen it is on: phone, tablet or desktop. It used to be
   capped to a 560px phone-width card from 640px up (owner asked for it to
   extend to fit the screen instead, 3 Oct 2026). Only the side padding
   scales with the viewport, so content never touches the edge and lines of
   text keep their own ch-based max-widths (.page-sub, .land-lede, etc.).
   The invite-only pages (options/bundle.css) keep their own widths. */
.panel-finance, .panel-money {
  max-width: none;
  margin: 0;
  padding: 0 clamp(24px, 4vw, 56px);
}
.money-switch { display: flex; padding: 24px 0 0; }
.money-seg a {
  display: inline-flex; align-items: center; justify-content: center; min-width: 112px; min-height: 44px; padding: 8px 18px;
  font: 700 15px/1 var(--font-body); color: var(--text-2); text-decoration: none; border-radius: 11px;
}
.money-seg a.is-on { background: var(--panel); color: var(--accent-strong); box-shadow: var(--shadow-sm); }
.panel-money .fin-page { padding-top: 18px; }

/* ── Sign-up ────────────────────────────────────────────────────── */
.auth-modal { max-width: 440px; }
.signup-only { display: flex; flex-direction: column; gap: 12px; }
.field-hint { margin: -6px 0 0; font-size: 13px; color: var(--muted); }
.field-error { margin: -4px 0 0; padding: 8px 10px; font-size: 13.5px; line-height: 1.45; color: var(--error); background: var(--error-bg); border-radius: 8px; }
.auth-form input[aria-invalid="true"] { border-color: var(--error-line); }
.check { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 10px; font: 500 15px/1.4 var(--font-body) !important; color: var(--text) !important; cursor: pointer; }
.check input { flex: none; width: 22px; height: 22px; min-height: 0 !important; margin: 0; padding: 0; accent-color: var(--accent); }
.check em { font-style: normal; color: var(--muted); }
.check-optional { color: var(--text-2) !important; }
.privacy-note { padding: 12px 14px; font-size: 13.5px; line-height: 1.5; color: var(--text-2); background: var(--accent-soft); border-radius: 12px; }
.privacy-note p { margin: 0; }
.field-optional { font-weight: 500; color: var(--muted); }

/* ── "Forgot password?" (same modal, a different inner view) ──────── */
.reset-flow { display: flex; flex-direction: column; gap: 14px; }
.reset-copy { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--text-2); }
.reset-step { display: flex; flex-direction: column; gap: 14px; }
.reset-step .auth-form { gap: 12px; }
.reset-step .linklike { align-self: flex-start; font-size: 13.5px; }
.form-status { margin: 0; padding: 10px 12px; font-size: 14.5px; line-height: 1.45; color: var(--text-2); background: var(--accent-soft); border-radius: 10px; }

/* ── Footer (Kenyan) ────────────────────────────────────────────── */
.footer-lede { margin: 0 0 12px; max-width: 72ch; font-size: 13px; line-height: 1.6; color: var(--muted); }
.footer-lede strong { color: var(--text-2); }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 14px; }
.footer-links a { display: inline-flex; align-items: center; min-height: var(--tap-min); font: 600 13.5px/1 var(--font-body); color: var(--accent-strong); text-decoration: none; }

/* ── You pages ─────────────────────────────────────────────────── */
.btn-danger { background: var(--error-solid); color: #fff; }
.you-page .tile + .tile { margin-top: 16px; }
.you-card .inline-notice, .you-card .celebrate-band { margin-top: 6px; }
.you-facts { display: grid; gap: 10px; margin: 0; }
.you-facts > div { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 12px; align-items: baseline; }
.you-facts dt { font: 600 14px/1.3 var(--font-body); color: var(--muted); }
.you-facts dd { margin: 0; font: 600 15.5px/1.35 var(--font-body); color: var(--navy); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.you-facts dd em { font-style: normal; font-weight: 500; color: var(--muted); }
.you-consents { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.you-consents li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--panel-raised); border: 1px solid var(--border-soft); border-radius: 12px; }
.you-consents strong { font-size: 15px; color: var(--navy); }
.you-consents span { font-size: 13.5px; color: var(--muted); }
.you-consents .you-withdraw { align-self: flex-start; margin-top: 6px; }
.you-delete { border-color: var(--error-edge); }
.you-delete .tile-title .ico { color: var(--error); }
.you-delete-step { display: grid; gap: 12px; }
.you-delete-input { font-family: var(--font-mono) !important; letter-spacing: .08em; }
.you-edit { margin-top: 4px; }

.data-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 0 24px; }
.data-facts .callout { margin: 0; grid-template-columns: auto 1fr; align-items: start; }
.data-facts .callout > .btn { grid-column: 2; justify-self: start; }
.data-export { margin: 0 0 28px; }
.data-tables { display: grid; gap: 10px; margin: 0 0 30px; }
.data-page .section-title { margin: 8px 0 6px; }
.data-page .section-title + .fine { margin-bottom: 12px; }
.data-table { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; }
.data-table > summary { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; cursor: pointer; list-style: none; }
.data-table > summary::-webkit-details-marker { display: none; }
.data-table > summary strong { font: 700 16.5px/1.3 var(--font-display); color: var(--navy); }
.data-table > summary span { font-size: 14.5px; color: var(--text-2); }
.data-table[open] > summary { border-bottom: 1px solid var(--border-soft); }
.data-cols { display: grid; gap: 8px; margin: 0; padding: 14px 18px 16px; }
.data-cols > div { display: grid; grid-template-columns: minmax(110px, 190px) 1fr; gap: 12px; }
.data-cols dt code { font: 500 12.5px/1.5 var(--font-mono); color: var(--muted); overflow-wrap: anywhere; }
.data-cols dd { margin: 0; font-size: 14.5px; color: var(--text-2); }

.legal-text { max-width: 72ch; font-size: 16px; line-height: 1.65; color: var(--text-2); }
.legal-text h2 { margin: 0 0 14px; font: 800 clamp(28px, 4.4vw, 38px)/1.1 var(--font-display); color: var(--navy); }
.legal-text h3 { margin: 28px 0 8px; font: 700 20px/1.25 var(--font-display); color: var(--navy); }
.legal-text h4, .legal-text h5 { margin: 20px 0 6px; font: 700 16.5px/1.3 var(--font-body); color: var(--navy); }
.legal-text p, .legal-text ul, .legal-text ol { margin: 0 0 12px; }
.legal-text li { margin-bottom: 6px; }


/* The inline "complete your profile" banner on Home. */
.identity-banner { grid-template-columns: auto 1fr; margin: 0 0 20px; border-style: solid; border-color: var(--line-sky-2); }
.identity-form { grid-column: 1 / -1; display: grid; gap: 12px; max-width: 560px; }
.identity-form .btn { justify-self: start; }

/* ── Onboarding: the M-Pesa step ─────────────────────────────── */
.ob-choices { display: grid; gap: 12px; margin: 0 0 18px; }
.ob-choice {
  display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; width: 100%; min-height: 72px; padding: 14px 16px;
  text-align: left; font: inherit; color: var(--text); background: var(--panel); border: 1.5px solid var(--border); border-radius: 16px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ob-choice:disabled { cursor: default; opacity: .6; }
.ob-choice strong { display: block; font: 700 16px/1.3 var(--font-display); color: var(--navy); }
.ob-choice small { display: block; margin-top: 2px; font-size: 14px; color: var(--text-2); }
.ob-choice-ico { display: grid; place-items: center; width: 44px; height: 44px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 13px; }
.ob-have { display: flex; gap: 8px; align-items: center; }
.ob-have .ico { color: var(--take); }
.ob-balance-form .money-input { max-width: 320px; }

/* The M-Pesa importer's one-time consent (public/finance/mpesa-import.js). */
#mpesa-import .mpi-consent { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; padding: 12px 14px; font-size: 14px; line-height: 1.5; color: var(--text-2); background: var(--accent-soft); border-radius: 12px; cursor: pointer; }
#mpesa-import .mpi-consent input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }

/* Admin: the strategy report. */
.strategy-frame { display: block; width: 100%; height: calc(100vh - 220px); height: calc(100dvh - 220px); min-height: 480px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; }

@media (max-width: 759px) {
  .brand-mark { width: 34px; height: 34px; }
  .you-label, .you-menu .caret { display: none; }
  .you-summary { padding: 4px; border-width: 0; background: none; }
  .you-avatar { width: 38px; height: 38px; }
  /* Below the header, full width: a plain panel that drops down. */
  .you-dropdown { position: fixed; top: calc(62px + env(safe-area-inset-top, 0px)); left: 10px; right: 10px; min-width: 0; max-height: calc(100dvh - 62px - var(--tabbar-h) - 24px); overflow-y: auto; }
  .panel-money { padding: 0 16px; }
  .money-switch { padding-top: 16px; }
  .money-seg { display: flex; width: 100%; }
  .money-seg a { flex: 1; min-width: 0; }
  .data-facts { grid-template-columns: minmax(0, 1fr); }
  .you-facts > div, .data-cols > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .strategy-frame { height: calc(100dvh - var(--tabbar-h) - 200px); border-radius: 12px; }

}
@supports (padding: env(safe-area-inset-top)) {
  @media (max-width: 759px) {
    .panel-money {
      padding-left: calc(16px + env(safe-area-inset-left));
      padding-right: calc(16px + env(safe-area-inset-right));
    }
  
}

}

/* ── Chama, Loren Plus, share cards (finance/chama.js, plus.js, share-card.js)
   Big buttons and plain words: every action on these pages is at least
   44px tall, and the main ones are the xl size. ─────────────────────── */
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: 0 0 4px; font-weight: 600; text-decoration: none; }
.back-link .ico { width: 18px; height: 18px; }
.chama-page .tile, .plus-page .tile { margin-top: 18px; }
.chama-page .tiles .tile, .plus-page .tiles .tile { margin-top: 0; }
.chama-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 0 0 20px; }
.chama-actions .btn { width: 100%; }
.chama-list { display: grid; gap: 12px; }
.chama-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 18px; color: var(--text); text-decoration: none; background: var(--panel);
  border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-sm);
  transition: border-color .15s var(--ease), transform .15s var(--ease);
}
.chama-card-ico { display: grid; place-items: center; width: 48px; height: 48px; color: var(--accent); background: var(--accent-soft); border-radius: 14px; }
.chama-card-text strong { display: block; font: 700 18px/1.25 var(--font-display); color: var(--navy); overflow-wrap: anywhere; }
.chama-card-text span { color: var(--muted); font-size: 14.5px; }
.chama-card-num { text-align: right; font: 800 19px/1.2 var(--font-display); color: var(--navy); font-variant-numeric: tabular-nums; }
.chama-card-num small { display: block; font: 500 12.5px/1.3 var(--font-body); color: var(--muted); }
.chama-card .pill { grid-column: 2 / -1; justify-self: start; }
.chama-empty { margin: 24px auto; }
.chama-trust { display: flex; gap: 12px; align-items: flex-start; margin: 22px 0 0; padding: 14px 16px; font-size: 14.5px; color: var(--text-2); background: var(--accent-soft); border-radius: 16px; }
.chama-trust .ico { flex: none; width: 22px; height: 22px; color: var(--accent); }
.chama-challenges { margin-top: 30px; }
.challenge p { margin: 0; }
.challenge .eyebrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.ch-stats { display: grid; gap: 6px; margin: 4px 0; padding: 0; list-style: none; font-size: 15.5px; }
.ch-stats li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ch-stats .ico { width: 18px; height: 18px; color: var(--flame); }
.ch-stats strong { font: 800 20px/1 var(--font-display); color: var(--navy); }
.choice-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span { display: grid; place-items: center; min-height: 52px; padding: 10px 14px; font-weight: 700; color: var(--text-2); background: var(--panel); border: 1.5px solid var(--border); border-radius: 14px; }
.choice input:checked + span { color: var(--accent-strong); background: var(--accent-soft); border-color: var(--accent); }
.choice input:focus-visible + span { box-shadow: 0 0 0 4px var(--accent-soft); outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.chama-page .field > select, .plus-page .field > select { min-height: 48px; }
.field > input.code-input { font: 800 24px/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.join-card { display: grid; gap: 12px; }
.join-card p { margin: 0; }

.cm-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.cm-figures p { margin: 0; padding: 12px 14px; background: var(--panel-raised); border: 1px solid var(--border-soft); border-radius: 14px; }
.cm-figures span { display: block; font-size: 13.5px; color: var(--muted); }
.cm-figures strong { display: block; font: 800 24px/1.2 var(--font-body); color: var(--navy); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cm-figures em { font-style: normal; font-size: 13.5px; color: var(--text-2); }
.cm-people { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cm-people li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--panel-raised); }
.cm-people .ico { width: 20px; height: 20px; }
.cm-people .is-paid .ico { color: var(--take-line); }
.cm-people .is-partly .ico, .cm-people .is-behind .ico { color: var(--qualified); }
.cm-people span { font-weight: 700; overflow-wrap: anywhere; }
.cm-people em { font-style: normal; font-size: 13.5px; color: var(--muted); text-align: right; }

.chama-record { margin-top: 18px; }
.chama-big-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.chama-big-actions .btn { width: 100%; }
.rec-form { margin: 14px 0 0; }
.rec-form .tile-title { margin: 0; }
.ledger-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ledger-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 14px; }
.ledger-row > div:first-child { min-width: 0; }
.ledger-row strong { display: block; overflow-wrap: anywhere; }
.ledger-row .fine { display: block; overflow-wrap: anywhere; }
.ledger-row .row-actions { grid-column: 1 / -1; }
.ledger-row.is-rejected { opacity: .65; }
.ledger-row.is-rejected .ledger-amt { text-decoration: line-through; }
.ledger-amt { font: 800 16.5px/1.2 var(--font-body); color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chama-waiting { border-color: var(--warn-border); background: var(--warm-1); }
.members-table td { font-variant-numeric: tabular-nums; }
.members-table th[scope=row] { overflow-wrap: anywhere; }
.mb-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.mb-role { min-height: 40px; padding: 4px 8px; font: inherit; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.rotation-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rotation-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--panel-raised); }
.rotation-list li.is-next { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.rotation-list li.is-done { opacity: .75; }
.rotation-list em { font-style: normal; color: var(--muted); font-size: 14px; }
.rot-n { display: grid; place-items: center; width: 30px; height: 30px; font-weight: 800; color: var(--accent-strong); background: var(--panel); border-radius: 50%; }
.rot-edit { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.rot-edit li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; align-items: center; padding: 4px 4px 4px 10px; border: 1px solid var(--border-soft); border-radius: 12px; }
.rot-edit label { display: flex; gap: 8px; align-items: center; min-height: 44px; font-weight: 600; }
.rot-edit input { width: 20px; height: 20px; }
.invite-code { margin: 0; font: 800 30px/1.2 var(--font-mono); letter-spacing: .14em; color: var(--navy); }
.invite-code-sm { font-size: 20px; }
.copy-fallback { width: 100%; min-height: 48px; padding: 8px 12px; font: 600 14px var(--font-mono); border: 1px solid var(--border); border-radius: 12px; }
.streak-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.streak-list li { display: grid; gap: 2px; padding: 8px 12px; border-radius: 12px; background: var(--panel-raised); }
.streak-list span { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; font-size: 14.5px; color: var(--text-2); }
.streak-list .ico { width: 16px; height: 16px; color: var(--flame); }
.share-amounts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-height: 44px; font-weight: 600; cursor: pointer; }
.share-amounts input { width: 22px; height: 22px; flex: none; }
.chama-streaks .share-amounts { flex-wrap: nowrap; }
.chama-settings { margin-top: 18px; }
.chama-settings summary { min-height: 52px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.set-extras { margin-top: 14px; }

.inline-notice.is-upgrade { color: var(--text); background: var(--warm-2); border: 1px solid var(--warn-border); grid-template-columns: auto minmax(0, 1fr); padding-right: 12px; }
.is-upgrade .notice-ico { color: var(--on-bright); background: #F2B233; }
.is-upgrade .notice-text span { color: var(--text-2); }

.share-panel { display: grid; gap: 12px; margin: 14px 0 0; padding: 16px; background: var(--panel-raised); border: 1px solid var(--border); border-radius: 18px; }
.share-head { display: flex; justify-content: space-between; align-items: center; }
.share-title { display: flex; gap: 8px; align-items: center; margin: 0; font: 700 16.5px/1.2 var(--font-display); color: var(--navy); }
.share-title .ico { width: 18px; height: 18px; color: var(--accent); }
.share-preview img { display: block; width: 100%; max-width: 320px; aspect-ratio: 1; border-radius: 14px; box-shadow: var(--shadow-md); }

.founding-strip { display: flex; gap: 10px; align-items: center; margin: 0 0 14px; padding: 10px 14px; font-size: 14.5px; color: var(--navy); background: var(--warm-3); border: 1px solid var(--warn-border); border-radius: 14px; }
.founding-strip .ico { flex: none; width: 22px; height: 22px; color: var(--qualified); }
.plus-status { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 16px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; }
.plus-status > .ico { flex: none; width: 28px; height: 28px; color: var(--accent); }
.plus-status strong { display: block; font: 700 18px/1.25 var(--font-display); color: var(--navy); }
.plus-status span { color: var(--text-2); }
.plus-status.is-plus { color: #fff; background: linear-gradient(135deg, var(--band-from), var(--band) 75%); border: 0; }
.plus-status.is-plus strong { color: #fff; }
.plus-status.is-plus span { color: #C9D8EE; }
.plus-status.is-plus > .ico { color: #F2B233; }
.plus-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 18px; }
.plus-page .plus-tiers .tile { margin-top: 0; }
.plus-tier.is-plus { border: 1.5px solid var(--accent); box-shadow: var(--shadow-md); }
.plus-tier .eyebrow { margin: 0; }
.plus-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.plus-list li { display: flex; gap: 8px; align-items: flex-start; }
.plus-list .ico { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--take-line); }
.plus-join { margin-top: 20px; }
/* "Would you pay for this?" — an inline, non-modal signal (finance/plus.js's
   wtpHtml), never a pop-up. Sits under the Plus price. */
.wtp { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.wtp-q { margin: 0 0 8px; font: 600 14.5px/1.3 var(--font-body); color: var(--navy); }
.wtp-thanks { margin-top: 8px; }
.trend-bars { display: flex; gap: 6px; align-items: flex-end; height: 160px; padding: 8px 0 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
.trend-col { flex: 1 0 34px; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.trend-pair { flex: 1; display: flex; gap: 3px; align-items: flex-end; width: 100%; justify-content: center; }
.trend-pair i { display: block; width: 42%; max-width: 18px; min-height: 2px; border-radius: 5px 5px 0 0; }
.trend-col small { font-size: 11.5px; color: var(--muted); }
.trend-pair .is-in, .key.is-in { background: var(--take-line); }
.trend-pair .is-out, .key.is-out { background: var(--sky); }
.key { display: inline-block; width: 10px; height: 10px; margin: 0 4px 0 8px; border-radius: 3px; vertical-align: middle; }
.key:first-child { margin-left: 0; }

@media (max-width: 620px) {
  .chama-card { grid-template-columns: auto minmax(0, 1fr); }
  .chama-card-num { grid-column: 2; text-align: left; }
  .ledger-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ledger-row .pill { grid-column: 1 / -1; justify-self: start; }
  .cm-people li { grid-template-columns: auto minmax(0, 1fr); }
  .cm-people em { grid-column: 2; text-align: left; }
  .invite-code { font-size: 24px; }
  .rotation-list li { grid-template-columns: auto minmax(0, 1fr) auto; }
  .rotation-list .pill { grid-column: 2 / -1; justify-self: start; }

}

/* ── Seed Mark (Loren Seed System, Phase 1) ─────────────────────────────
   public/finance/seed-mark.js draws the mark itself; these rules only cover
   (a) the CSS-transition technique an animated mark relies on for its
   in-place "Grow" updates, (b) the splash's seed-crack + sway, (c) the
   Water drop, and (d) the first-deposit confetti. New rules — the existing
   .viz*/.pbar rules progressRing() and progressBar() use are untouched. */
.seed-mark { display: block; overflow: visible; }
.gc-seed, .hero-seed, .setup-seed { position: relative; flex: none; }
.gc-seed { width: 56px; }
.hero-seed { width: 80px; }
.home-empty-seed { width: 160px; margin: 0 auto 14px; }

/* The three attributes the doc's "Tech build" names — stroke-dashoffset,
   y2, transform — get the same 600ms ease-out curve everywhere. Only marks
   rendered with { animate: true } carry these classes (see seed-mark.js). */
.seed-mark-ring-fill { transition: stroke-dashoffset .6s cubic-bezier(.2, .8, .2, 1); }
.seed-mark-stem { transition: y2 .6s cubic-bezier(.2, .8, .2, 1), opacity .6s cubic-bezier(.2, .8, .2, 1); }
.seed-mark-leaves { transition: transform .6s cubic-bezier(.2, .8, .2, 1), opacity .6s cubic-bezier(.2, .8, .2, 1); }

/* ── Water: a small drop that falls onto the seed just before Grow (deposit
   flow — ui.js wireSaveForm). Positioned by its caller (absolute, over the
   seed's on-screen position); ~350ms per the doc. */
.seed-water-drop {
  position: absolute; width: 10px; height: 14px; z-index: 5; pointer-events: none;
  background: var(--sky, #3BA3F5); border-radius: 0 60% 60% 60%; transform: rotate(45deg);
  opacity: 0; animation: seed-water-fall .35s cubic-bezier(.2, .8, .2, 1) forwards;
}
@keyframes seed-water-fall {
  0% { opacity: 0; transform: translateY(-22px) rotate(45deg) scale(.6); }
  30% { opacity: 1; }
  85% { opacity: 1; transform: translateY(0) rotate(45deg) scale(1); }
  100% { opacity: 0; transform: translateY(2px) rotate(45deg) scale(.8); }
}

/* ── First-deposit confetti: fires once, ever (see ui.js logSaving's
   caller in goals.js/home.js). Not a pop-up — nothing blocks or requires
   dismissal; a handful of falling squares that clean themselves up. */
.seed-confetti { position: absolute; inset: 0; overflow: visible; pointer-events: none; z-index: 6; }
.seed-confetti i {
  position: absolute; top: -6px; left: var(--x, 50%); width: 6px; height: 10px;
  background: var(--c, var(--accent)); border-radius: 1px;
  opacity: 0; animation: seed-confetti-fall .9s cubic-bezier(.2, .8, .2, 1) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes seed-confetti-fall {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--dx, 12px), 70px) rotate(var(--r, 200deg)); }
}

/* ── App chrome: no text-selection on tap targets ─────────────────────────
   Dragging a finger across a button or nav item used to select its label
   like plain web text — another tell that the UI is a web page rather than
   an app. Scoped to fixed-label interactive chrome only (buttons, tabs, nav,
   icon buttons, predefined option pickers) — never to actual content, so
   transaction descriptions, amounts, goal/chama names, lesson body copy and
   form inputs all stay selectable/copyable as normal. */
.btn,
.tab,
.tabbar,
.tabbar-item,
.icon-btn,
.modal-close,
.notice-close,
.az-btn,
.money-seg a,
.you-summary,
.you-item,
.seg span,
.chip,
.type-pick span,
.tile-check span,
.opt span,
.goal-pick span,
.choice span,
.ob-choice,
.quiz-opt {
  user-select: none;
  -webkit-user-select: none;
}

/* ── Hover states, gated to devices that actually have a mouse ───────────
   Without (hover: hover), a tap on a touch screen "locks in" the :hover
   style until the person taps something else — the classic tell that a UI
   is a web page, not an app. Every hover-only rule in this file lives here
   instead of next to the selector it styles, so this is the one place to
   check when adding a new one. Selectors that also carry :focus-visible or
   :disabled (keyboard-visibility and disabled styling must never depend on
   pointer type) were split at the source instead of moved here — only the
   :hover half of those rules appears below. */
@media (hover: hover) and (pointer: fine) {
  .tab:hover { color: var(--navy); background: var(--bg-tint); }
  .tool:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
  .btn-primary:hover { background: var(--accent-strong); box-shadow: 0 2px 4px rgba(11, 31, 58, .12), 0 8px 18px -6px rgba(29, 95, 209, .55); transform: translateY(-1px); }
  .btn-ghost:hover { border-color: var(--accent); color: var(--accent-strong); }
  .btn-soft:hover { background: var(--sky-soft); }
  .btn-danger-ghost:hover { border-color: var(--error); background: var(--error-bg); }
  .btn:disabled:hover { background: var(--bg-tint); border-color: transparent; color: var(--muted); cursor: default; box-shadow: none; transform: none; }
  .settings summary:hover { color: var(--text-2); }
  .took:hover { background: var(--take-hover); }
  .modal-close:hover { color: var(--text); background: var(--bg-tint); }
  .chip:hover { border-color: var(--accent); color: var(--accent-strong); }
  .icon-btn:hover { color: var(--text); background: var(--bg-tint); }
  .goal-pick span:hover { border-color: var(--accent); color: var(--accent-strong); }
  .goal-card:hover { box-shadow: var(--shadow-md); }
  .mpesa-card .btn-primary:hover { background: var(--sky-soft); }
  .mpesa-card .btn:disabled:hover { color: #C9D8EE; background: rgba(255, 255, 255, .1); }
  .type-pick span:hover { border-color: var(--accent); }
  .tile-check span:hover { border-color: var(--accent); }
  .opt span:hover { border-color: var(--accent); }
  .notice-close:hover { opacity: 1; background: rgba(11, 31, 58, .06); }
  .celebrate-band .notice-close:hover { background: rgba(255, 255, 255, .12); }
  a.node-btn:hover .node-dot { transform: translateY(-2px); }
  .review-link:hover strong { text-decoration: underline; }
  .quiz-opt:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
  .az-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
  .you-summary:hover { border-color: var(--accent); color: var(--accent-strong); }
  .you-item:hover { background: var(--bg-tint); color: var(--navy); }
  .you-danger:hover { background: var(--error-bg); color: var(--error); }
  .money-seg a:hover { color: var(--navy); }
  .footer-links a:hover { text-decoration: underline; }
  .btn-danger:hover { background: var(--error-solid-hover); }
  .ob-choice:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
  .chama-card:hover { border-color: var(--accent); transform: translateY(-1px); }

}

/* ── Pressed states: what a thumb feels ──────────────────────────────────
   Hover is mouse-only (above), so on a phone almost nothing answered a tap
   (the site report card counted 47 :hover rules against 1 :active). These
   fire on touch and mouse alike, are instant, and stay subtle: a small
   squeeze for buttons and cards, a tint for rows and chips. test/
   app-feel-css.test.js lists what must have one. */
.btn:not(:disabled):active { transform: scale(.97); }
.tool:active,
.goal-card:active,
.chama-card:active { transform: scale(.985); }
.tabbar-item:active, .tab:active, .icon-btn:active, .modal-close:active, .notice-close:active,
.you-item:active, .money-seg a:active { background: var(--bg-tint); }
.chip:active, .you-summary:active, .goal-pick span:active, .type-pick span:active,
.tile-check span:active, .opt span:active { border-color: var(--accent); color: var(--accent-strong); }
.quiz-opt:not(:disabled):active,
.ob-choice:not(:disabled):active,
.az-btn:active {
  border-color: var(--accent); background: var(--accent-soft);
}
@media (prefers-reduced-motion: reduce) {
  .btn:not(:disabled):active,
.tool:active,
.goal-card:active,
.chama-card:active { transform: none; }

}

/* ── Feedback box for the first members (public/finance/feedback.js) ──────
   One collapsed control at the bottom of the page; opens in place, no pop-up. */
.feedback-slot { padding: 0 clamp(24px, 4vw, 56px) 28px; }
.feedback-box { max-width: 720px; padding: 6px; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; }
.feedback-toggle { display: flex; gap: 12px; align-items: center; width: 100%; min-height: 48px; padding: 10px 12px; text-align: left; font: 600 15px/1.35 var(--font-body); color: var(--navy); background: none; border: 0; border-radius: 14px; cursor: pointer; }
.feedback-toggle .ico { flex: none; width: 22px; height: 22px; color: var(--accent); }
.feedback-toggle:active { background: var(--bg-tint); }
.feedback-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.feedback-form { display: flex; flex-direction: column; gap: 10px; padding: 8px 12px 14px; }
.feedback-form .btn { align-self: flex-start; }
.feedback-form .field-hint { margin: 0; }
.feedback-count { text-align: right; font-variant-numeric: tabular-nums; }
.feedback-result:empty, .feedback-status:empty { display: none; }
.feedback-result > .inline-notice { margin: 6px 6px 8px; }
.feedback-list { margin: 0 0 12px; padding: 0; list-style: none; }
.feedback-item { padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.feedback-meta { margin: 0 0 4px; font-size: 13.5px; color: var(--muted); }
.feedback-meta strong { color: var(--navy); }
.feedback-text { margin: 0; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 759px) { .feedback-slot { padding: 0 16px 24px; } }
@media (hover: hover) { .feedback-toggle:hover { background: var(--bg-tint); } }

/* The one-time announcement for the first members (public/finance/feedback-intro.js): a native
   <dialog>, an owner-approved exception to "no pop-ups" (23 Oct 2026). */
.feedback-intro { width: calc(100% - 32px); max-width: 460px; padding: 0; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); }
.feedback-intro::backdrop { background: rgba(11, 31, 58, .52); }
.feedback-intro .intro-card { display: flex; flex-direction: column; gap: 14px; padding: 24px 22px 20px; }
.feedback-intro .modal-title { margin: 0; }
.feedback-intro .intro-body { display: flex; flex-direction: column; gap: 14px; }
.feedback-intro .intro-block { padding: 12px 14px; background: var(--bg-tint); border-radius: 14px; }
.feedback-intro h3 { margin: 0 0 4px; font: 700 16px/1.3 var(--font-display); color: var(--navy); }
.feedback-intro p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-2); }
.feedback-intro .intro-actions { display: flex; flex-direction: column; gap: 10px; }
.feedback-intro .intro-actions .btn { width: 100%; min-height: 48px; }
.feedback-intro .intro-link { align-self: center; min-height: 44px; padding: 8px 6px; font-size: 15px; }
.feedback-intro .intro-link:active { opacity: .7; }
html:has(dialog.feedback-intro[open]) { overflow: hidden; }
@media (min-width: 560px) { .feedback-intro .intro-actions { flex-direction: row-reverse; } .feedback-intro .intro-actions .btn { flex: 1; } }
@media (prefers-reduced-motion: no-preference) { .feedback-intro[open] { animation: fade-up .3s var(--ease) both; } }
@media (prefers-reduced-motion: reduce) { .feedback-intro { animation: none; } }

/* ── "Email me a code instead" (public/email-code.js, loaded on tap) ── */
.auth-emailcode { align-self: flex-start; font-size: 13.5px; min-height: 44px; }
.emailcode-input { font-size: 22px; letter-spacing: 0.35em; text-align: center; font-variant-numeric: tabular-nums; }
.emailcode-resend:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.you-verified { color: var(--text-2); font-size: 13px; }

/* Admin members list (finance/admin-members.js): cards so it reads at 390 px. */
.member-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.member-card { border: 1px solid var(--border-soft); border-radius: 12px; padding: 10px 12px; }
.member-card p { margin: 0; }
.member-name { font-weight: 700; color: var(--navy); overflow-wrap: anywhere; }
.member-tags { margin-top: 4px !important; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.member-dates { margin-top: 4px !important; }
.members-q { flex: 1 1 160px; min-width: 0; }
.members-pager { align-items: center; justify-content: space-between; margin-top: 8px; }

/* Dark mode switch card (You). The switch itself is .switch-row in finance/intel.css. */
.you-theme .switch-row { width: 100%; }
.you-dark-state { margin-left: auto; font: 700 14px/1 var(--font-body); color: var(--muted); }
@media (hover: hover) { :root[data-theme="dark"] .notice-close:hover { background: rgba(255, 255, 255, .1); } }
