/* Njia — Design System
 * Mobile-first, vanilla CSS. No preprocessor, no build step, no external fonts.
 *
 * "Warm premium" theme: paper backgrounds, warm ink text, serif display
 * headings (system serif stack), and a terracotta action colour — one
 * accent doing the talking, everything else calm. Njia's brand hues from
 * the mark (circuit-blue, navy-teal, leaf-green, arrow-orange) survive as
 * data-visualisation colours (clusters, bars, the report accent strip) and
 * the dark navy landing bands, deepened where needed so they hold WCAG
 * contrast on light surfaces.
 */

:root {
  /* Action colour — terracotta. ~4.9:1 against white, so white button
   * text passes AA at normal size. --primary-dark is the link/eyebrow
   * ink variant (~7:1). */
  --primary: #b4552d;
  --primary-dark: #8a3f20;
  --primary-light: #f7e9e0;
  --secondary: #55802d;      /* leaf green, deepened for light bg */
  --accent: #ed8b2d;         /* brand gold — reserved for dark bands */
  --accent-ink: #8a5310;     /* gold's text-on-light variant — AA-safe at small sizes on all light surfaces */
  --danger: #c0392b;
  --purple: #8b5cf6;
  --pink: #ec4899;

  /* Surfaces — warm paper, not grey. Cards sit white on paper; insets
   * (meta grids, inputs, chips) sit oat on white. */
  --bg: #faf9f5;
  --bg-elevated: #ffffff;
  --bg-card: #f2efe7;
  --bg-input: #ece8dd;

  --text-primary: #1f1e1d;
  --text-secondary: #52504a;
  --text-muted: #6b6862;

  --border: #e6e2d7;
  --border-light: #d6d1c2;

  /* Ink fill for selected chips/tabs — dark neutral, so terracotta stays
   * reserved for primary actions and "current location" signals. */
  --ink: #1f1e1d;
  --ink-contrast: #faf9f5;

  --serif: Charter, 'Bitstream Charter', 'Sitka Text', Cambria, Georgia, 'Times New Roman', serif;
  /* Reserved for data figures — fees, percentages, dates, grades — never
   * for prose. Tabular mono is the signature analytical-fintech texture
   * the "family" sites all share (Mwangaza Yield's font-mono .num, JK's
   * numeric callouts): it makes columns of numbers actually align and
   * reads as measured data rather than marketing copy. */
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'Roboto Mono', 'JetBrains Mono', Consolas, monospace;

  --shadow-sm: 0 1px 2px rgba(31, 30, 29, 0.05);
  --shadow-md: 0 6px 18px rgba(31, 30, 29, 0.08);
  --shadow-lg: 0 16px 40px rgba(31, 30, 29, 0.14);
  /* Flatter than shadow-lg on purpose — the family sites keep even their
   * most prominent standalone cards nearly flush with the page (a 1-4px
   * blur, not a floating 40px one); shadow-lg stays reserved for actual
   * overlays (modals, dropdowns) where "lifted above the page" is the
   * point. */
  --shadow-card: 0 1px 2px rgba(31, 30, 29, 0.04), 0 4px 14px rgba(31, 30, 29, 0.05);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --header-h: 60px;
  --nav-h: 64px;
  --content-max: 600px;
  --sidebar-w: 240px;
  /* Content width. --page-max is the working width for data-dense modules;
   * --prose-max keeps running text at a readable measure inside it, so a
   * wide page never turns body copy into a 1200px line. */
  --page-max: 1280px;
  --prose-max: 68ch;

  /* ---- Structural tokens (Kanda discipline: component rules reference
   * tokens, never raw values — if you're typing a hex or px in a
   * component rule, the token is missing; add it here instead). ---- */

  /* Spacing — 4px grid. Adopt in new rules; legacy rems migrate as
   * they're touched. */
  --space-1: 4px;  --space-2: 8px;   --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px;  --space-8: 32px; --space-10: 40px;
  --space-12: 48px; --space-16: 64px;

  /* Fluid display sizes — a fixed 28px headline is a phone headline
   * shown on a desktop. */
  --text-lg-fluid: clamp(1.25rem, 2.2vw, 1.5rem);
  --text-xl-fluid: clamp(1.6rem, 3vw, 2.05rem);
  --text-2xl-fluid: clamp(1.9rem, 4.2vw, 2.75rem);

  /* Action-colour states + text-on-fill */
  --primary-deep: #a34b26;
  --primary-soft: rgba(180, 85, 45, 0.09);
  --on-fill: #ffffff;

  /* Tint panels — soft background + AA-safe ink + hairline, per state.
   * Never raw success/warn/danger as small text on tints. */
  --success-soft: rgba(85, 128, 45, 0.12);
  --success-ink: #46691f;
  --success-border: rgba(85, 128, 45, 0.3);
  --warn-soft: rgba(237, 139, 45, 0.12);
  --warn-ink: #8a5310;
  --warn-border: #eac48d;
  --danger-soft: rgba(192, 57, 43, 0.1);
  --danger-ink: #a02e20;
  --danger-border: rgba(192, 57, 43, 0.3);

  /* Cluster inks — the cluster palette in data/questions.js is tuned for
   * fills (bars, dots, tints). These are its text-safe counterparts, one
   * per scheme, so a cluster name never drops under the AA floor. */
  --cluster-carer-ink: #9c1f56;
  --cluster-creator-ink: #8a5310;
  --cluster-business-ink: #46691f;
  --cluster-tech-ink: #0a5f81;
  --cluster-people-ink: #5a34ab;
  --cluster-numbers-ink: #a02e20;

  /* Odyssey plan accents — one per life. Light values sit on white cards;
   * the dark scheme lifts each to clear the AA floor on the espresso card. */
  --plan-life1: #0e7ba6;
  --plan-life2: #55802d;
  --plan-life3: #8a5310;

  /* Neutral veils */
  --ink-veil: rgba(31, 30, 29, 0.08);
  --scrim: rgba(31, 30, 29, 0.42);
  --header-veil: rgba(250, 249, 245, 0.92);

  color-scheme: light;
}

/* ---------- Dark scheme — "warm ink" ----------
 * The same paper-and-terracotta identity, inverted: deep espresso
 * grounds (never pure black), cream text, the terracotta accent
 * lightened where it carries text so the contrast floor holds. JS
 * stamps data-theme from the stored choice or system preference
 * (see applyTheme in js/app.js); a head inline script stamps it
 * pre-paint so there is no light flash. */
:root[data-theme="dark"] {
  --primary: #c96a3f;
  --primary-dark: #dd9a72;
  --primary-light: #3a2519;
  --primary-deep: #b4552d;
  --primary-soft: rgba(201, 106, 63, 0.14);
  --secondary: #82a95a;
  --accent-ink: #dfa35f;
  --danger: #e0685a;

  --bg: #16130f;
  --bg-elevated: #201c16;
  --bg-card: #29241d;
  --bg-input: #322c24;

  --text-primary: #f0ece3;
  --text-secondary: #c6bfb2;
  --text-muted: #98917f;

  --border: #37312a;
  --border-light: #47403a;

  --ink: #f0ece3;
  --ink-contrast: #16130f;
  --on-fill: #1c1206;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.25), 0 4px 14px rgba(0, 0, 0, 0.25);

  --success-soft: rgba(130, 169, 90, 0.16);
  --success-ink: #a5c583;
  --success-border: rgba(130, 169, 90, 0.4);
  --warn-soft: rgba(223, 163, 95, 0.14);
  --warn-ink: #e3b075;
  --warn-border: rgba(223, 163, 95, 0.45);
  --danger-soft: rgba(224, 104, 90, 0.14);
  --danger-ink: #eb9a8e;
  --danger-border: rgba(224, 104, 90, 0.4);

  --cluster-carer-ink: #f191b9;
  --cluster-creator-ink: #e3b075;
  --cluster-business-ink: #a5c583;
  --cluster-tech-ink: #74c6e6;
  --cluster-people-ink: #bba4f2;
  --cluster-numbers-ink: #eb9a8e;

  --plan-life1: #6fc3e4;
  --plan-life2: #a5c583;
  --plan-life3: #e3b075;

  --ink-veil: rgba(240, 236, 227, 0.1);
  --scrim: rgba(0, 0, 0, 0.6);
  --header-veil: rgba(22, 19, 15, 0.92);

  color-scheme: dark;
}

/* The landing page is a scoped composition on its own tokens — swap
 * them as a set so its dark bands, cards and copy re-balance together. */
:root[data-theme="dark"] #page-home {
  --landing-bg: #16130f;
  --landing-card: #201c16;
  --landing-ink: #f0ece3;
  --landing-ink-muted: #a89f8f;
  --landing-border: #37312a;
}

/* ---------- noscript fallback ---------- */
.noscript-fallback {
  max-width: 480px;
  margin: 3rem auto;
  padding: 1.5rem;
  font-family: system-ui, sans-serif;
  text-align: center;
  color: #1f1e1d;
  background: #faf9f5;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
/* The UA rule for [hidden] is display:none at the lowest specificity, so any
   component rule setting display (.btn, .filter-row) silently defeats it.
   Restore it here so `el.hidden = true` is reliable everywhere. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overscroll-behavior-y: none;
}
img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary-dark); text-decoration: none; }
ul { list-style: none; }
input[type="range"] { accent-color: var(--primary); }

/* Display type is serif — the single strongest "premium editorial"
 * signal available without shipping a webfont. Body stays sans. */
h1, h2, h3 { font-family: var(--serif); letter-spacing: -0.01em; line-height: 1.25; }
h1 { font-size: var(--text-xl-fluid); font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }
/* Module card/section headings are semantically level 2 (they sit under
 * the page h1) but keep the level-3 visual scale — semantics and type
 * scale are separate concerns. */
.card > h2, .empty-state h2, .help-tutorial-head h2, .course-card h2 { font-size: 1.25rem; }
small, .caption { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* Data figures only — fees, percentages, counts, grades. Never prose. */
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Small trust/freshness signal — dot + label in a pill, matching every
 * "family" site's opening move (e.g. "● Built on public CBK data · Always
 * free"). Sits above the hero headline, distinct from the eyebrow label. */
.status-pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--secondary); flex-shrink: 0; }

/* Focus states — visible everywhere, WCAG requirement */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
/* …except page headings, which navigateTo() focuses programmatically for
 * screen-reader users (tabindex="-1"). They aren't interactive, so the
 * outline just reads as a broken debug box around every page title. */
h1[tabindex="-1"]:focus-visible, h2[tabindex="-1"]:focus-visible { outline: none; }

/* ---------- Chrome icons ----------
 * Stroke SVGs from the sprite in index.html (24-grid, 2px, round caps,
 * currentColor) — the family rule: app chrome gets these, emoji stays
 * reserved for content voice. Sized by the em of their context. */
svg.icon {
  width: 1.15em; height: 1.15em;
  flex-shrink: 0;
  vertical-align: -0.18em;
}

/* ---------- Page header ----------
 * Editorial module header: overline eyebrow above the serif h1, matching
 * the landing page's section overlines. */
.page-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

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

/* ---------- App Shell ---------- */
#app {
  max-width: var(--content-max);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg);
}

.app-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  background: var(--header-veil);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.app-header .logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
}
.header-page-label {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.logo-mark {
  width: 28px; height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}
/* The mark assets carry a cream (#f5f2ea) plate. multiply blends that
 * plate into any light surface, so the artwork sits directly on the
 * paper with no visible square. Scoped to light contexts only — on the
 * dark footer the same trick would sink the art into black. */
.app-header .logo-mark { mix-blend-mode: multiply; }
/* On dark grounds multiply sinks the cream plate into mud — show the
 * plate as a small rounded badge instead. */
:root[data-theme="dark"] .app-header .logo-mark,
:root[data-theme="dark"] .landing-hero-logo,
:root[data-theme="dark"] .logo-mark {
  mix-blend-mode: normal;
  border-radius: 6px;
}
.header-btn {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.install-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--ink-contrast);
  position: sticky;
  top: var(--header-h);
  z-index: 19;
}
.install-banner-text { font-size: 0.85rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.5rem; }
.install-banner-actions { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.install-banner .btn-sm { width: auto; }
.install-banner .header-btn { color: var(--ink-contrast); width: 48px; height: 48px; }
.install-banner .header-btn:hover { background: rgba(250,249,245,0.15); }
.header-btn:hover { background: var(--bg-card); }

.header-actions { display: flex; align-items: center; gap: 0.4rem; }
/* The hamburger holds both glyphs and swaps them from aria-expanded.
 * Replacing its innerHTML on click used to destroy the very node the
 * click was dispatched on, so the outside-click handler below could no
 * longer recognise the target as the toggle and closed the menu again
 * the instant it opened. Never mutate an element out from under an
 * in-flight event. */
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: inline-block; }
.nav-back { display: none; }
body:not([data-page="home"]) .nav-back { display: flex; }

/* ---------- Landing nav (header) + mobile menu — home page only.
   Hidden by default everywhere; body[data-page="home"] (set by
   renderRoute) reveals the hamburger on mobile and the full nav row +
   CTA on desktop, so module pages keep their existing minimal header. */
.landing-nav, .landing-cta-header, .nav-toggle { display: none; }
.nav-toggle { display: flex; }

.landing-nav { align-items: center; gap: 1.75rem; }
.landing-nav-link {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: none; border: none;
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.4rem 0;
  transition: color 0.15s ease;
}
.landing-nav-link:hover, .landing-nav-link:focus-visible { color: var(--primary-dark); }
.landing-nav-dropdown { position: relative; }
.landing-nav-dropdown-btn .caret { font-size: 0.7rem; transition: transform 0.15s ease; opacity: 0.6; }
.landing-nav-dropdown-btn[aria-expanded="true"] .caret,
.landing-nav-dropdown:hover .caret, .landing-nav-dropdown:focus-within .caret { transform: rotate(180deg); opacity: 1; }
.landing-nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.75rem);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  min-width: 280px;
  z-index: 25;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.landing-nav-dropdown-menu.open,
.landing-nav-dropdown:hover .landing-nav-dropdown-menu,
.landing-nav-dropdown:focus-within .landing-nav-dropdown-menu {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
/* Two-line rows (title + one-line description) — matching the mega-menu
 * pattern the family sites use for their tool/module dropdowns, instead
 * of a flat list of bare labels. */
.landing-nav-dropdown-menu button {
  display: flex; align-items: flex-start; gap: 0.7rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  background: none; border: none;
  color: var(--text-primary);
  text-align: left;
  min-height: 48px;
}
.landing-nav-dropdown-menu button > span:first-child { flex-shrink: 0; display: inline-flex; margin-top: 0.15rem; color: var(--primary); }
.landing-nav-dropdown-menu button .icon { width: 18px; height: 18px; }
.landing-nav-dropdown-menu button > span:last-child { display: flex; flex-direction: column; gap: 0.1rem; }
.landing-nav-dropdown-menu button strong { font-size: 0.9rem; font-weight: 600; }
.landing-nav-dropdown-menu button small { font-size: 0.76rem; font-weight: 400; text-transform: none; letter-spacing: normal; color: var(--text-muted); }
.landing-nav-dropdown-menu button:hover { background: var(--bg-card); }

/* Specificity bump (.header-actions .landing-cta-header, not just the
   class alone) so this beats .btn's display:inline-flex — same
   specificity would otherwise tie and let source order decide. */
.header-actions .landing-cta-header { display: none; white-space: nowrap; }
.nav-toggle { font-size: 1.3rem; }

/* Mobile menu: a floating panel below the sticky header, not a full-page
   scrim — #app is the nearest position:relative ancestor, so top matches
   the header's own height exactly. */
.mobile-menu {
  display: none;
  position: absolute;
  top: var(--header-h); left: 0; right: 0;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  flex-direction: column;
  padding: 0.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0));
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  z-index: 32;
  animation: fadeIn 0.2s ease;
}
.mobile-menu.open { display: flex; }
.mobile-menu a, .mobile-menu button:not(.btn) {
  display: flex; align-items: center; gap: 0.6rem;
  min-height: 48px;
  padding: 0.5rem 0.25rem;
  font-size: 1rem; font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}
.mobile-menu-label {
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted);
  margin: 0.75rem 0 0.1rem;
}
.mobile-menu .btn { margin-top: 1rem; }
.mobile-menu .menu-icon { display: inline-flex; margin-right: 0.55rem; color: var(--primary); vertical-align: -0.2em; }
.mobile-menu .menu-icon .icon { width: 18px; height: 18px; }

@media (min-width: 1024px) {
  .landing-nav { display: flex; }
  body[data-page="home"] .header-actions .landing-cta-header { display: inline-flex; }
  .nav-toggle { display: none; }
  .mobile-menu { display: none !important; }
}

main {
  flex: 1;
  padding-bottom: calc(var(--nav-h) + 1rem);
  width: 100%;
}

.page { display: none; padding: 1rem; animation: fadeIn 0.3s ease; }
.page.active { display: block; }
@media (min-width: 480px) { .page { padding: 1.5rem; } }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.25s ease; }

/* ---------- Bottom Nav ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--content-max);
  height: var(--nav-h);
  display: flex;
  background: var(--header-veil);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  background: none; border: none;
  color: var(--text-muted);
  min-height: 48px;
  position: relative;
}
.nav-item .nav-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.nav-item .nav-icon .icon { width: 21px; height: 21px; }
.nav-item .nav-label { font-size: 0.65rem; font-weight: 600; }
.nav-item.active { color: var(--primary-dark); }
.nav-item.active::before {
  content: '';
  position: absolute; top: 4px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--primary);
}
.nav-item.active::after {
  content: '';
  position: absolute; top: 4px; bottom: 4px; left: 6px; right: 6px;
  background: var(--primary-soft);
  border-radius: 12px;
  z-index: -1;
}
.nav-item.has-badge .nav-icon::after {
  content: '';
  position: absolute; top: -2px; right: -4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg);
}
.nav-item:active { transform: scale(0.95); }

/* =====================================================================
   MID-WIDTH TIER — the gap between the 600px mobile cap and the full
   sidebar shell below. Below this, #app just sat pinned at 600px with a
   growing dead margin on both sides — 190px+ of empty background on
   each edge at a common ~980px laptop/tablet-landscape width, reading
   as "squeezed into the middle" rather than deliberately narrow. The
   full sidebar+grid restructure below needs real width to breathe (a
   240px sidebar eating into anything much under 1024px leaves its own
   2-column grids cramped), so this tier instead just widens #app itself
   and lets the grids that already respond to their container's width —
   the course/funding results-grid (auto-fill), the stats/footer grid
   (own 480px breakpoint) — fill it. (The landing page's hero/evidence/
   process grids get their own matching override further down, in the
   LANDING PAGE section, so it stays after their base rules in source
   order — same reason the DESKTOP SHELL's landing overrides below live
   next to this tier's instead of up here.)
   ===================================================================== */
@media (min-width: 768px) {
  #app { max-width: 880px; }
  .bottom-nav { max-width: 880px; }
}

/* =====================================================================
   DESKTOP SHELL — Kanda anatomy: one slim top nav with grouped
   dropdowns on every page, no sidebar. The bottom nav is a phone
   affordance (thumb reach on the low-end Android devices Njia targets)
   and disappears at desktop widths, where the top nav's two module
   groups take over. Content centers on --page-max.
   ===================================================================== */
@media (min-width: 1024px) {
  #app { max-width: none; }
  .app-header { padding: 0 1.5rem; }
  main { padding-bottom: 1rem; }
  .bottom-nav { display: none; }

  .page { max-width: var(--page-max); margin: 0 auto; padding: 2rem 2.5rem; }
  #page-home.page { max-width: none; margin: 0; padding: 0 !important; }

  /* Running text stays at a readable measure even though the page is wide.
   * Cards, grids and tables are free to use the full width. */
  .page > p.text-secondary,
  .page > .data-disclaimer,
  .page > .page-eyebrow + h1 + p { max-width: var(--prose-max); }

  /* The three Odyssey lives belong side by side — comparing futures is the
   * whole point of the exercise, and stacking them hid the comparison. */
  .odyssey-plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; align-items: start; }
  .odyssey-plan-grid .card { margin-bottom: 0; }
  .odyssey-plan-grid .odyssey-anchor-row { flex-direction: column; gap: 0.5rem; }
  .odyssey-plan-grid .odyssey-anchor-row > div { min-width: 0; }

  /* Discover results: findings left, constraints and actions right. */
  .discover-results-grid { display: grid; grid-template-columns: 1.35fr 0.65fr; gap: 1.5rem; align-items: start; }
  .discover-results-grid > * { min-width: 0; }
  .discover-results-aside { position: sticky; top: calc(var(--header-h) + 1rem); }
}

/* =====================================================================
   WIDE DESKTOP — Decide gets a persistent filter rail instead of filters
   stacked above the results. The rail is the single biggest space win:
   it turns the dead left gutter into working chrome and keeps every
   filter visible while the user scrolls a long catalogue.
   ===================================================================== */
@media (min-width: 1100px) {
  .decide-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1.75rem; align-items: start; }
  .decide-rail {
    position: sticky;
    top: calc(var(--header-h) + 1rem);
    display: flex; flex-direction: column; gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    max-height: calc(100vh - var(--header-h) - 2rem);
    overflow-y: auto;
  }
  .decide-rail .filter-toolbar { flex-direction: column; align-items: stretch; gap: 0.6rem; margin-bottom: 0; }
  .decide-rail .filter-toolbar .form-control { width: 100%; max-width: none; flex: none; }
  .decide-rail .filter-spacer { display: none; }
  .decide-rail .card { margin-bottom: 0; border: none; box-shadow: none; padding: 0; background: transparent; }
  .decide-rail-title {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.4px; color: var(--text-muted);
  }
  .decide-results { min-width: 0; }

  /* Full-width buttons are a phone tap-target pattern; stretched across
   * the desktop content column they read as unfinished. Size to content
   * with a floor, except where a layout explicitly manages widths. */
  .page .btn { width: auto; min-width: 200px; }
  .page .btn-row .btn { min-width: 0; }
  .page .btn-sm { min-width: 0; }

  .toast-container { max-width: 420px; }
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--border-light); box-shadow: var(--shadow-md); }
.card-tap { cursor: pointer; }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
}
.hero h1 { margin-bottom: 0.5rem; }
.hero p { color: var(--text-secondary); max-width: 420px; margin: 0 auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.1s ease, opacity 0.15s ease, background 0.15s ease;
  width: 100%;
}
.btn:active { transform: scale(0.95); }
.btn-primary { background: var(--primary); color: var(--on-fill); }
.btn-primary:hover { background: var(--primary-deep); }
.btn-secondary { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-light); }
.btn-secondary:hover { background: var(--bg-card); }
.btn-success { background: var(--secondary); color: var(--on-fill); }
.btn-danger { background: var(--danger); color: var(--on-fill); }
.btn-ghost { background: transparent; color: var(--primary-dark); }
.btn-sm { min-height: 48px; padding: 0.5rem 1rem; font-size: 0.85rem; width: auto; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; gap: 0.75rem; }
.btn-row .btn { width: auto; flex: 1; }

/* ---------- Feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.feature-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: left;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.feature-card .icon { font-size: 1.75rem; }
.feature-card h3 { font-size: 1rem; }
.feature-card p { font-size: 0.8rem; color: var(--text-muted); }

/* ---------- Stats row ---------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.5rem;
  text-align: center;
}
.stat .value { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 1.4rem; font-weight: 700; color: var(--primary-dark); }
.stat .label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* ---------- Progress bar ---------- */
.progress-track {
  height: 8px;
  background: var(--bg-input);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Questionnaire ---------- */
.q-section-header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.25rem; }
.q-section-header .icon { font-size: 1.5rem; }
.q-progress-label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }

.option-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.6rem;
  min-height: 48px;
  color: var(--text-primary);
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
}
.option-card:hover { border-color: var(--border-light); }
.option-card:active { transform: scale(0.98); }
.option-card.selected { border-color: var(--primary); background: var(--primary-light); }
.option-card.selected::after { content: ' ✓'; color: var(--primary); font-weight: 700; }

textarea.q-input {
  width: 100%;
  min-height: 100px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  color: var(--text-primary);
  resize: vertical;
}
textarea.q-input::placeholder { color: var(--text-muted); }

/* Shared text/select input chrome — same visual language as q-input above.
 * Centralises the ~20 identical inline style="..." blocks that used to be
 * duplicated across decide.js/track.js/design.js/connect.js/index.html;
 * width/max-width/margin stay inline since those genuinely vary by
 * placement (e.g. compact same-row filter selects vs full-width form
 * fields), but the input's own chrome shouldn't need a find-and-replace
 * across five files every time it changes. */
.form-control {
  min-height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 0.5rem;
  font-size: 0.95rem;
}

.voice-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: 999px; padding: 0.4rem 0.9rem; font-size: 0.8rem;
  margin-top: 0.5rem; color: var(--text-secondary);
  min-height: 48px;
}
.voice-btn.recording { color: var(--danger); border-color: var(--danger); }

/* ---------- Score bars (Four Elements) ---------- */
.score-row { margin-bottom: 0.9rem; }
.score-row .score-label { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 0.3rem; }
.score-bar-track { height: 10px; background: var(--bg-input); border-radius: 999px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 999px; transition: width 1s cubic-bezier(0.4, 0, 0.2, 1); }

/* ---------- Cluster result cards ---------- */
.cluster-primary {
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1rem;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}
.cluster-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.6rem;
}
.cluster-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; margin-top: 0.75rem; }
.tag {
  background: var(--bg-card);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.cluster-secondary-list .cluster-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.cluster-row:last-child { border-bottom: none; }
.cluster-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 0.5rem; }

/* ---------- Segmented controls (module tabs) ----------
 * One contained control instead of loose full-width pills: a bordered
 * track with flat segments, active segment takes the ink fill (the
 * family's deliberate selected-state, see token comment at the top). */
.odyssey-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}
.odyssey-tab {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.45rem;
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  min-height: 44px;
  color: var(--text-secondary);
  transition: background 0.15s ease, color 0.15s ease;
}
.odyssey-tab:hover { color: var(--text-primary); }
.odyssey-tab.active { background: var(--ink); color: var(--ink-contrast); }
.odyssey-tab .icon { width: 1em; height: 1em; }
@media (min-width: 1024px) {
  .odyssey-tabs { display: inline-flex; }
  .odyssey-tab { flex: none; padding: 0.55rem 1.4rem; }
}
/* Anchor selects (cluster / course / confidence) sit in one wrapping row
 * above the year inputs — three side-by-side where the card is wide
 * enough, stacking naturally on narrow screens via min-width + wrap. */
.odyssey-anchor-row { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.odyssey-anchor-row > div { flex: 1; min-width: 170px; }
.odyssey-year-row { display: flex; gap: 0.5rem; align-items: flex-start; margin-bottom: 0.6rem; }
.odyssey-year-badge {
  min-width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); border-radius: var(--radius-sm);
  font-weight: 700; font-size: 0.8rem; flex-shrink: 0;
}
.odyssey-year-row input {
  flex: 1;
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 0.6rem;
  color: var(--text-primary); min-height: 48px;
}

/* ---------- Life portfolio gauges ---------- */
.portfolio-gauge { margin-bottom: 1.25rem; }
.portfolio-gauge .gauge-label { display: flex; justify-content: space-between; margin-bottom: 0.4rem; font-size: 0.9rem; font-weight: 600; }
.portfolio-gauge input[type="range"] {
  width: 100%; height: 48px;
  accent-color: var(--primary);
}

/* ---------- Prototype checklist ---------- */
.check-item {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.check-item:last-child { border-bottom: none; }
.check-item input[type="checkbox"] { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--secondary); flex-shrink: 0; }
.check-item.done label { text-decoration: line-through; color: var(--text-muted); }

/* ---------- Course / Funding cards ---------- */
/* auto-fill/minmax instead of viewport-width breakpoints: adapts to
 * whatever width the grid's parent actually has, not the raw viewport —
 * #app stays capped at --content-max below the 1024px desktop shell
 * breakpoint, so a viewport-width breakpoint here would try to force 2
 * columns into a still-narrow container. This just fits as many 320px+
 * columns as actually fit, correct at every width automatically. */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  align-items: start;
}
.results-grid .card { margin-bottom: 0; }
/* Denser catalogue on desktop. Declared after the base rule above because
 * a media query adds no specificity — source order is what decides. */
@media (min-width: 1024px) {
  .results-grid { grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 1.1rem; }
}
.match-badge {
  display: inline-block;
  background: var(--secondary);
  color: var(--on-fill);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}
.verified-badge {
  display: inline-block;
  background: var(--success-soft);
  color: var(--success-ink);
  border: 1px solid var(--success-border);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}
/* Estimate marker. Deliberately quiet but never invisible: these figures sit
 * beside verified ones, and the whole point is that a reader can tell which
 * is which at a glance. Uses the warn triplet, not raw colour, so it holds
 * the AA floor in both schemes. */
.est-mark {
  display: inline-block;
  background: var(--warn-soft);
  color: var(--warn-ink);
  border: 1px solid var(--warn-border);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  margin-left: 0.3rem;
  vertical-align: middle;
}
.meta-value.is-estimate { opacity: 0.92; }
.course-card .institution-name { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 0.5rem; }
/* Ledger rows — label left, value right, hairline dividers, no box — the
 * ledger/breakdown-table treatment every "family" site uses for financial
 * figures (e.g. a T-bill's gross-yield-to-net-yield breakdown) instead of
 * a boxed 2-column grid. Same meta-grid/meta-item/meta-label/meta-value
 * DOM shape as before; only the layout direction changed, so no render
 * function needed touching to pick this up. */
.meta-grid {
  display: flex;
  flex-direction: column;
  margin: 0.85rem 0;
  border-top: 1px solid var(--border);
}
.meta-grid .meta-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.meta-grid .meta-item .meta-label { font-size: 0.8rem; color: var(--text-muted); }
.meta-grid .meta-item .meta-value { font-size: 0.92rem; font-weight: 700; text-align: right; }

/* ---------- Comparison table (Decide: Compare Saved Courses) ----------
 * Same ledger language as .meta-grid — hairline rows, mono numerals for
 * data cells — but transposed into a real table since comparing N saved
 * courses needs N value columns per attribute row, not one. */
.comparison-hint { font-size: 0.78rem; color: var(--text-muted); margin: -0.4rem 0 0.6rem; }
.comparison-scroll {
  overflow-x: auto;
  margin: 0 -0.25rem;
  padding: 0 0.25rem 0.6rem;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-ink) var(--bg-card);
  /* Scroll-shadow trick: two background gradients scroll with the content
   * (masking the edges once there's room to scroll) and two stay fixed to
   * the viewport (hinting more content), so the cue works even where the
   * native scrollbar renders as an invisible overlay. */
  background-image:
    linear-gradient(to right, var(--bg-elevated) 50%, rgba(0,0,0,0)),
    linear-gradient(to left, var(--bg-elevated) 50%, rgba(0,0,0,0)),
    linear-gradient(to right, rgba(31,30,29,0.14), rgba(0,0,0,0)),
    linear-gradient(to left, rgba(31,30,29,0.14), rgba(0,0,0,0));
  background-position: left, right, left, right;
  background-repeat: no-repeat;
  background-size: 24px 100%, 24px 100%, 12px 100%, 12px 100%;
  background-attachment: local, local, scroll, scroll;
}
.comparison-scroll::-webkit-scrollbar { height: 8px; }
.comparison-scroll::-webkit-scrollbar-track { background: var(--bg-card); border-radius: 999px; }
.comparison-scroll::-webkit-scrollbar-thumb { background: var(--accent-ink); border-radius: 999px; }
.comparison-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.comparison-table th, .comparison-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.comparison-table thead th {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: normal;
  min-width: 140px;
  vertical-align: bottom;
}
.comparison-table tbody th {
  font-weight: 500;
  color: var(--text-muted);
  white-space: normal;
}
.comparison-table tbody th, .comparison-table thead th:first-child {
  position: sticky;
  left: 0;
  background: var(--bg-elevated);
}
.comparison-table td { font-weight: 600; }
.comparison-table td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.comparison-table td.wrap { white-space: normal; max-width: 170px; }
.career-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0; }
.type-badge {
  display: inline-block;
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  padding: 0.2rem 0.6rem; border-radius: 999px;
  background: var(--bg-card); color: var(--accent-ink);
  margin-bottom: 0.5rem;
}
.data-disclaimer {
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  display: flex; gap: 0.5rem; align-items: flex-start;
}
.data-disclaimer > .icon { width: 16px; height: 16px; margin-top: 0.15rem; color: var(--accent-ink); }

/* Section-card headings that lead with a chrome icon */
h3 > .icon { color: var(--primary); margin-right: 0.2rem; }

/* ---------- Filters ---------- */
.filter-row { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.5rem; margin-bottom: 1rem; }
/* One wrapping toolbar for a set of filter selects — side by side where
 * the container allows, wrapping 2-up on phones, instead of each select
 * stacking as its own full-width row. */
.filter-toolbar {
  display: flex; flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}
.filter-toolbar .form-control { width: auto; flex: 1 1 150px; max-width: 230px; }
.filter-toolbar .filter-spacer { flex: 1 0 auto; }
.filter-chip {
  flex-shrink: 0;
  background: var(--bg-elevated); border: 1px solid var(--border-light);
  border-radius: 999px; padding: 0.4rem 0.9rem;
  font-size: 0.8rem; white-space: nowrap; min-height: 48px;
  color: var(--text-secondary);
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.filter-chip:active { transform: scale(0.95); }
.filter-chip.active { background: var(--ink); border-color: var(--ink); color: var(--ink-contrast); }

/* ---------- Analytical signal layers ----------
 * Honest, audit-style indicators: how decisive the cluster result is,
 * and how a course's tuition sits against the user's stated budget. */
.confidence-line {
  margin-top: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-left: 3px solid var(--border);
  background: var(--bg-card);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.confidence-clear { border-left-color: var(--secondary); }
.confidence-moderate { border-left-color: var(--accent-ink); }
.confidence-close, .confidence-unclear { border-left-color: var(--danger); }

.feas-chip {
  display: inline-flex; align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.feas-within { background: var(--success-soft); color: var(--success-ink); border-color: var(--success-border); }
.feas-stretch { background: var(--warn-soft); color: var(--warn-ink); border-color: var(--warn-border); }
.feas-over { background: var(--danger-soft); color: var(--danger-ink); border-color: var(--danger-border); }

.comparison-table td.best {
  background: var(--success-soft);
  font-weight: 700;
}

/* ---------- "Why this match?" breakdown ----------
 * The match score explains itself factor by factor — trust in the
 * algorithm comes from showing the working, not from the number. */
/* Fee provenance travels with every card, but 86 of the 127 sourced courses
 * share one KMTC note — rendering it open on each card meant reading the same
 * paragraph down the whole grid. Collapsed, the provenance is still attached
 * to the card (so it survives comparison and saved views) without repeating. */
.fee-provenance { margin-bottom: 0.6rem; font-size: 0.78rem; }
.fee-provenance summary {
  cursor: pointer;
  color: var(--text-muted);
  font-style: italic;
  padding: 0.2rem 0;
}
.fee-provenance summary:hover { text-decoration: underline; }
.fee-provenance p { margin-top: 0.35rem; font-style: italic; }
.decide-caveat { margin-bottom: 0.75rem; }

.match-why { margin-bottom: 0.9rem; font-size: 0.82rem; }
.match-why summary {
  cursor: pointer;
  color: var(--primary-dark);
  font-weight: 600;
  padding: 0.2rem 0;
}
.match-why summary:hover { text-decoration: underline; }
.match-why ul { list-style: none; margin-top: 0.4rem; }
.match-why li {
  padding: 0.35rem 0 0.35rem 1rem;
  border-left: 2px solid var(--border);
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}
.match-why li.match-why-up { border-left-color: var(--secondary); }
.match-why li.match-why-down { border-left-color: var(--danger); }

/* ---------- Landing: two tracks + tool grids (Kanda anatomy) ---------- */
.landing-track-grid { display: grid; gap: 1rem; margin-top: 1.25rem; }
@media (min-width: 768px) { .landing-track-grid { grid-template-columns: 1fr 1fr; } }
.landing-track-card {
  background: var(--landing-card);
  border: 1px solid var(--landing-border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.landing-track-card.track-make { border-left-color: var(--secondary); }
.landing-track-eyebrow {
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--primary-dark);
}
.landing-track-card.track-make .landing-track-eyebrow { color: var(--success-ink); }
.landing-track-card h3 { margin: 0.3rem 0 0.35rem; }
.landing-track-card p { font-size: 0.88rem; color: var(--landing-ink-muted); }
.landing-track-count { display: inline-block; margin-top: 0.6rem; font-size: 0.8rem; font-weight: 700; color: var(--primary-dark); }

.landing-tool-section { margin-top: 2.5rem; }
/* Tool grid — the landing page's main index of what Njia actually does.
   Measured against the Kanda reference: cards there carry noticeably more
   internal air and a title that reads as a heading rather than a label.
   Njia's were 16px padding around a 15.2px title in a 377px card, which is
   why the page read denser than the target even though the structure
   already matched. Spacing goes through the scale tokens, never raw px. */
.landing-tool-grid { display: grid; gap: var(--space-4); margin-top: var(--space-5); }
@media (min-width: 768px) { .landing-tool-grid { grid-template-columns: repeat(3, 1fr); } }
.landing-tool-card {
  display: flex; gap: var(--space-4); align-items: flex-start;
  background: var(--landing-card);
  border: 1px solid var(--landing-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  text-align: left; width: 100%;
  color: var(--landing-ink);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.landing-tool-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.landing-tool-card .icon-disc { width: 42px; height: 42px; margin: 0; flex-shrink: 0; color: var(--primary); }
.landing-tool-card .icon-disc .icon { width: 20px; height: 20px; }
.landing-tool-card h3 { font-size: 1rem; font-weight: 650; margin-bottom: var(--space-1); letter-spacing: -0.01em; }
.landing-tool-card p { font-size: 0.85rem; color: var(--landing-ink-muted); line-height: 1.55; }
.landing-tool-arrow { margin-left: auto; color: var(--primary); align-self: center; flex-shrink: 0; }


/* ---------- Module header: intro left, live coverage panel right ----------
 * Running text keeps a readable measure, so on a wide screen the right of
 * the header was dead space. It now carries the dataset's own numbers. */
.module-header-aside { display: none; }
.coverage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1rem; margin-top: 0.6rem; }
.coverage-grid > div { display: flex; flex-direction: column; gap: 0.1rem; }
.coverage-num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 1.15rem; font-weight: 700; color: var(--primary-dark); line-height: 1.1; }
.coverage-label { font-size: 0.72rem; color: var(--text-muted); }
.coverage-note { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.75rem; }

@media (min-width: 1100px) {
  .module-header { display: grid; grid-template-columns: 1fr 280px; gap: 2rem; align-items: start; }
  .module-header-main { min-width: 0; }
  .module-header-aside {
    display: block;
    padding: 1.1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
  }
}

/* ---------- Header brand lockup (Kanda pattern) ----------
 * Mark + wordmark + a descriptor line, so the header says what this is
 * without spending a nav slot on it. The descriptor drops on phones
 * where the space genuinely is not there. */
.logo-lockup { display: flex; flex-direction: column; line-height: 1.05; }
.logo-word { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; }
.logo-descriptor {
  display: none;
  font-size: 0.6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-top: 2px;
}
@media (min-width: 720px) { .logo-descriptor { display: block; } }
/* Nav sits hard right against the utility icons rather than floating. */
@media (min-width: 1024px) { .landing-nav { margin-left: auto; margin-right: 1.25rem; } }

/* ---------- Help page ---------- */
.help-columns { display: grid; gap: 1rem; }
@media (min-width: 900px) { .help-columns { grid-template-columns: 1fr 1fr; align-items: start; } }
.help-group .caption { display: block; margin-bottom: 0.35rem; }
.help-qa { border-bottom: 1px solid var(--border); padding: 0.15rem 0; }
.help-qa:last-child { border-bottom: none; }
.help-qa summary {
  cursor: pointer; padding: 0.6rem 0;
  font-weight: 600; font-size: 0.9rem; color: var(--text-primary);
}
.help-qa summary:hover { color: var(--primary-dark); }
.help-qa p { font-size: 0.86rem; color: var(--text-secondary); padding: 0 0 0.7rem; line-height: 1.6; }
.help-tutorial-head { display: flex; gap: 0.8rem; align-items: flex-start; margin-bottom: 0.75rem; }
.help-tutorial-head .icon-disc { margin: 0; flex-shrink: 0; color: var(--primary); }
.help-steps { margin: 0 0 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.55rem; }
.help-steps li { font-size: 0.86rem; color: var(--text-secondary); line-height: 1.6; padding-left: 0.3rem; }
.glossary-list { display: flex; flex-direction: column; gap: 0.7rem; }
.glossary-row { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.9rem; align-items: baseline; }
.glossary-row dt { font-weight: 700; font-size: 0.85rem; color: var(--primary-dark); }
.glossary-row dd { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.55; }
@media (max-width: 560px) { .glossary-row { grid-template-columns: 1fr; gap: 0.15rem; } }
.link-btn { background: none; border: none; padding: 0; color: var(--primary-dark); font-weight: 600; text-decoration: underline; cursor: pointer; font-size: inherit; }

/* ---------- Footer learn tiles (Kanda pattern) ---------- */
.footer-learn { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid rgba(248,250,252,0.14); }
.footer-learn-grid { display: grid; gap: 0.75rem; margin-top: 0.9rem; }
@media (min-width: 700px) { .footer-learn-grid { grid-template-columns: repeat(4, 1fr); } }
.footer-learn-tile {
  text-align: left; width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(248,250,252,0.05);
  border: 1px solid rgba(248,250,252,0.14);
  border-radius: var(--radius-md);
  color: #f8fafc;
}
.footer-learn-tile:hover { background: rgba(248,250,252,0.1); }
.footer-learn-tile strong { display: block; font-size: 0.88rem; margin-bottom: 0.15rem; }
.footer-learn-tile span { font-size: 0.75rem; color: rgba(248,250,252,0.6); line-height: 1.4; }
.footer-about { margin-top: 1.75rem; }
.footer-about p { font-size: 0.82rem; color: rgba(248,250,252,0.66); line-height: 1.6; max-width: 62ch; }

.course-tagline { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.4rem 0 0.2rem; }
.mini-tag {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem; border-radius: var(--radius-sm);
  background: var(--ink-veil); color: var(--text-secondary);
}
.mini-public { background: var(--success-soft); color: var(--success-ink); }
.mini-private { background: var(--primary-soft); color: var(--primary-dark); }
.mini-online { background: var(--warn-soft); color: var(--warn-ink); }

/* ---------- Suggestion menus ----------
 * A filler control, not a state control: it drops a starting phrase into
 * the field beside it and resets itself. Styled quieter than a real
 * input so it never reads as the primary way to answer. */
.odyssey-year-field { flex: 1; display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.odyssey-suggest {
  font-size: 0.78rem;
  padding: 0.35rem 0.6rem;
  min-height: 40px;
  color: var(--text-muted);
  background: var(--bg-card);
  border-style: dashed;
}
.odyssey-suggest:focus { color: var(--text-primary); }

/* ---------- Analytical result components ---------- */
.decide-count { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.9rem; }

.spread-list { display: flex; flex-direction: column; gap: 0.5rem; }
.spread-row { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; }
.spread-rank { width: 1.2rem; color: var(--text-muted); font-size: 0.78rem; flex-shrink: 0; }
.spread-name { width: 8.5rem; flex-shrink: 0; color: var(--text-secondary); }
.spread-row.spread-top .spread-name { color: var(--text-primary); font-weight: 600; }
.spread-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--bg-input); overflow: hidden; min-width: 40px; }
.spread-fill { display: block; height: 100%; border-radius: 999px; }
.spread-share { width: 2.6rem; text-align: right; flex-shrink: 0; color: var(--text-secondary); }

.evidence-card { border-left: 3px solid var(--primary); }
.evidence-list { list-style: none; margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.7rem; }
.evidence-list li {
  font-size: 0.86rem; line-height: 1.55; color: var(--text-secondary);
  padding-left: 0.9rem; border-left: 2px solid var(--border);
}
.evidence-list strong { color: var(--text-primary); }

@media (max-width: 560px) {
  .spread-name { width: 6.5rem; font-size: 0.8rem; }
}

/* ---------- Mentor cards ---------- */
.mentor-card { display: flex; gap: 0.85rem; align-items: center; }
.mentor-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff;
}
.mentor-info { flex: 1; }
.mentor-info .role { font-size: 0.8rem; color: var(--text-muted); }

/* ---------- OKR items ---------- */
.okr-item .okr-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.status-badge { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; padding: 0.2rem 0.6rem; border-radius: 999px; }
.status-badge.on-track { background: var(--success-soft); color: var(--success-ink); }
.status-badge.at-risk { background: var(--warn-soft); color: var(--warn-ink); }
.status-badge.done { background: var(--ink-veil); color: var(--text-muted); }

/* ---------- Application timeline ---------- */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 1.25rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -1.5rem; top: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg-card); border: 2px solid var(--border-light);
}
.timeline-item.complete .timeline-dot { background: var(--secondary); border-color: var(--secondary); }
.timeline-item .t-date { font-size: 0.75rem; color: var(--text-muted); }

/* ---------- Empty states ---------- */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}
.icon-disc {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  color: var(--text-muted);
}
.icon-disc .icon { width: 26px; height: 26px; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 0.5rem; }
.empty-state p { max-width: 320px; margin: 0 auto 1.25rem; font-size: 0.9rem; }

/* ---------- Toast ---------- */
.toast-container {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--content-max);
  z-index: 100; padding: 0.75rem; pointer-events: none;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex; align-items: center; gap: 0.6rem;
  box-shadow: var(--shadow-lg);
  animation: slideDown 0.3s ease;
  pointer-events: auto;
}
.toast.success { border-color: var(--secondary); }
.toast.error { border-color: var(--danger); }
.toast .icon { width: 18px; height: 18px; }
.toast.success .icon { color: var(--secondary); }
.toast.error .icon { color: var(--danger); }
.toast.info .icon { color: var(--primary-dark); }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: var(--scrim);
  z-index: 90;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-sheet {
  background: var(--bg-elevated);
  width: 100%; max-width: var(--content-max);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0));
  max-height: 85vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }
@media (min-width: 600px) {
  .modal-overlay { align-items: center; }
  .modal-sheet { border-radius: var(--radius-xl); max-width: 480px; }
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.modal-close { background: var(--bg-card); border: none; border-radius: 50%; width: 44px; height: 44px; color: var(--text-secondary); }

/* ---------- Utility ---------- */
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; } .gap-2 { gap: 1rem; }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}

/* =====================================================================
   LANDING PAGE — the Home page is Njia's "sell" surface: evidence-led,
   editorial (serif display headlines, cited stat cards, a pull-quote
   thesis, numbered process steps, final CTA + guarantee, structured
   footer). Since the whole app now shares the warm paper/ink/terracotta
   system, the landing reads as the cover of the same book rather than a
   different product — its dark navy bands (stats/final CTA/footer) stay
   as deliberate full-bleed contrast moments tied to the wordmark navy.
   ===================================================================== */

#page-home {
  --landing-bg: #faf9f5;
  --landing-card: #ffffff;
  --landing-ink: #1f1e1d;
  --landing-ink-muted: #5d5a52;
  --landing-border: #e6e2d7;
  --landing-dark: #0f172a;
  background: var(--landing-bg);
  color: var(--landing-ink);
  padding: 0 !important;
}

.landing-serif { font-family: var(--serif); }

.landing-eyebrow {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--primary-dark);
  margin-bottom: 0.75rem;
}
.landing-dark .landing-eyebrow { color: var(--accent); }

.landing-block { padding: 2.5rem 1.25rem; }
.landing-block-tight { padding: 1.5rem 1.25rem; }

.landing-hero {
  padding: 2.5rem 1.25rem 2.25rem;
  text-align: left;
  /* Kanda hero anatomy in Njia's palette: deep navy ground with warm
   * terracotta/gold radials, cream type, gold accent word. */
  background:
    radial-gradient(120% 120% at 88% 0%, rgba(237, 139, 45, 0.16), transparent 55%),
    radial-gradient(110% 110% at 0% 100%, rgba(180, 85, 45, 0.2), transparent 60%),
    var(--landing-dark);
  color: #f8fafc;
}
.landing-hero .landing-hero-logo { mix-blend-mode: normal; border-radius: 12px; }
.landing-hero .landing-h1 { color: #f8fafc; }
.landing-hero .landing-sub { color: rgba(248, 250, 252, 0.82); }
.landing-hero .landing-proverb { color: rgba(248, 250, 252, 0.7); border-left-color: var(--accent); }
.landing-hero .status-pill { background: rgba(248, 250, 252, 0.08); border-color: rgba(248, 250, 252, 0.2); color: rgba(248, 250, 252, 0.85); }
.landing-hero .landing-trust-item { color: rgba(248, 250, 252, 0.75); }
.landing-hero .btn-outline-dark { color: #f8fafc; border-color: rgba(248, 250, 252, 0.4); }
.landing-hero .btn-outline-dark:hover { background: rgba(248, 250, 252, 0.1); }
.landing-hero-eyebrow {
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.6px;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

/* Floating utility card — Kanda's "Regulatory Clock" pattern, powered by
 * Njia's verified funding deadlines. */
.landing-clock-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(248, 250, 252, 0.18);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  color: #f8fafc;
}
.landing-clock-title {
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.landing-clock-row {
  display: flex; gap: 0.6rem; align-items: flex-start;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(248, 250, 252, 0.12);
}
.landing-clock-row:last-of-type { border-bottom: none; margin-bottom: 0.4rem; }
.landing-clock-row .icon { width: 15px; height: 15px; color: var(--accent); margin-top: 0.15rem; flex-shrink: 0; }
.landing-clock-name { font-weight: 600; font-size: 0.85rem; line-height: 1.35; }
.landing-clock-when { font-size: 0.74rem; color: rgba(248, 250, 252, 0.65); margin-top: 0.1rem; }
.landing-clock-btn {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(248, 250, 252, 0.35);
  background: transparent;
  color: #f8fafc;
  font-weight: 600; font-size: 0.85rem;
}
.landing-clock-btn:hover { background: rgba(248, 250, 252, 0.1); }
.landing-hero-logo {
  width: 64px; height: 64px; object-fit: contain; margin-bottom: 1.25rem;
  mix-blend-mode: multiply;
  border-radius: 12px;
}
.landing-h1 {
  font-family: var(--serif);
  font-size: var(--text-2xl-fluid);
  line-height: 1.25;
  font-weight: 700;
  color: var(--landing-ink);
  margin-bottom: 1rem;
}
.landing-h1 .hl-gold { color: var(--primary); }
.landing-h1 .hl-blue { color: var(--primary-dark); }
.landing-sub {
  font-size: 1rem;
  color: var(--landing-ink-muted);
  max-width: 46ch;
  margin-bottom: 1.5rem;
}
.landing-proverb {
  font-size: 0.85rem;
  color: var(--landing-ink-muted);
  font-style: italic;
  max-width: 42ch;
  margin: -0.75rem 0 1.25rem;
  border-left: 3px solid var(--primary);
  padding-left: 0.75rem;
}
.landing-teaser-box {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--landing-card);
  border: 1px solid var(--landing-border);
  border-left: 4px solid var(--secondary);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  color: var(--landing-ink);
  box-shadow: var(--shadow-sm);
}
.landing-teaser-box a { color: var(--primary-dark); font-weight: 600; }
.landing-h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 700;
  color: var(--landing-ink);
  margin-bottom: 0.6rem;
}
.landing-h2-sub { color: var(--landing-ink-muted); font-size: 0.95rem; margin-bottom: 1.5rem; max-width: 50ch; }

.landing-cta-row { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.25rem; }
.btn-gold {
  background: var(--primary);
  color: var(--on-fill);
  font-weight: 700;
}
.btn-gold:hover { background: var(--primary-deep); }
.btn-outline-dark {
  background: transparent;
  border: 1.5px solid var(--landing-ink);
  color: var(--landing-ink);
}

.landing-trust-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.landing-trust-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; font-weight: 600; color: var(--landing-ink-muted); }
.landing-trust-item svg { flex: 0 0 auto; color: var(--secondary); }

/* ---------- Hero sidecar: "Njia in numbers" ----------
   Mobile: flows naturally below the CTA/trust row. Desktop (>=1024px,
   see DESKTOP SHELL): .landing-hero becomes a two-column grid so the
   hero stops being a centred mobile stack stretched across a wide
   viewport with dead space beside it. */
.landing-hero-aside { margin-top: 1.75rem; }
.landing-numbers-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}
.landing-numbers-eyebrow {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}
/* A styled <p>, not a heading — this card sits directly beside the hero's
 * h1 with no h2 in between (the page's next real heading is much further
 * down), so an h3 here would skip a level and fail heading-order. */
.landing-numbers-title { font-family: var(--serif); font-size: 1.1rem; font-weight: 700; line-height: 1.3; margin-bottom: 1.1rem; color: var(--landing-ink); }
.landing-numbers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.25rem; margin-bottom: 1.1rem; }
.landing-numbers-item { display: flex; flex-direction: column; gap: 0.2rem; }
.landing-numbers-figure { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 1.6rem; font-weight: 700; color: var(--primary-dark); line-height: 1; }
.landing-numbers-label { font-size: 0.78rem; color: var(--landing-ink-muted); line-height: 1.35; }
.landing-numbers-note { font-size: 0.72rem; color: var(--landing-ink-muted); border-top: 1px solid var(--landing-border); padding-top: 0.75rem; margin: 0; }

.landing-dark {
  background: var(--landing-dark);
  color: #f8fafc;
}
.landing-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem 1rem;
}
.landing-stat-num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.4rem;
}
.landing-stat-label { font-size: 0.8rem; color: #cbd5e1; }

.landing-evidence-grid { display: grid; gap: 1rem; }
.landing-evidence-card {
  background: var(--landing-card);
  border: 1px solid var(--landing-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.landing-evidence-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.landing-evidence-num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1;
}
.landing-evidence-card h3 { font-size: 1rem; color: var(--landing-ink); margin: 0.5rem 0 0.4rem; }
.landing-evidence-card p { font-size: 0.88rem; color: var(--landing-ink-muted); margin-bottom: 0.6rem; }
.landing-source {
  font-size: 0.72rem;
  color: var(--landing-ink-muted);
  border-top: 1px solid var(--landing-border);
  padding-top: 0.5rem;
  font-style: italic;
}

.landing-quote-section {
  padding: 2.5rem 1.25rem;
  background: var(--landing-card);
  border-top: 1px solid var(--landing-border);
  border-bottom: 1px solid var(--landing-border);
}
.landing-quote {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.4;
  font-weight: 700;
  color: var(--landing-ink);
}
.landing-quote .hl-gold { color: var(--primary); }
.landing-quote-caption { margin-top: 1rem; font-size: 0.85rem; color: var(--landing-ink-muted); }

.landing-process-list { display: flex; flex-direction: column; gap: 1rem; }
.landing-process-card {
  background: var(--landing-card);
  border: 1px solid var(--landing-border);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  display: flex; gap: 0.9rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.landing-process-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.landing-process-num {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-family: var(--serif);
}
.landing-process-card h3 { font-size: 1rem; margin-bottom: 0.25rem; color: var(--landing-ink); }
.landing-process-card p { font-size: 0.85rem; color: var(--landing-ink-muted); margin-bottom: 0.5rem; }
.landing-process-card a.landing-link { font-size: 0.82rem; font-weight: 600; color: var(--primary-dark); }

.landing-example-card {
  background: var(--landing-card);
  border: 1px dashed var(--landing-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.landing-example-tag {
  display: inline-block;
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  background: var(--primary-light); color: var(--primary-dark);
  padding: 0.25rem 0.6rem; border-radius: 999px; margin-bottom: 0.75rem;
}
.landing-example-card ol { list-style: decimal; padding-left: 1.2rem; }
.landing-example-card li { margin-bottom: 0.5rem; font-size: 0.9rem; color: var(--landing-ink); }

.landing-final-cta {
  text-align: center;
  padding: 2.75rem 1.25rem;
}
.landing-final-cta .landing-h2 { color: #f8fafc; }
.landing-final-cta .landing-sub { color: #cbd5e1; margin-left: auto; margin-right: auto; }
.landing-guarantee-box {
  display: flex; gap: 0.75rem; align-items: flex-start;
  background: rgba(248,250,252,0.08);
  border: 1px solid rgba(248,250,252,0.2);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1.5rem;
  text-align: left;
  font-size: 0.85rem;
  color: #e2e8f0;
}

.landing-footer {
  background: var(--landing-dark);
  color: #cbd5e1;
  padding: 2.5rem 1.25rem 1.5rem;
}
.landing-footer-grid { display: grid; grid-template-columns: 1fr; gap: 1.75rem; margin-bottom: 2rem; }
.landing-footer-brand p { font-size: 0.85rem; color: #94a3b8; margin-top: 0.5rem; max-width: 32ch; }
.landing-footer-col .footer-col-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px;
  color: #94a3b8; margin-bottom: 0.75rem;
}
.landing-footer-col button, .landing-footer-col a {
  display: block; background: none; border: none; color: #e2e8f0;
  font-size: 0.85rem; padding: 0.3rem 0; text-align: left;
}
.landing-footer-sources {
  font-size: 0.72rem; color: #94a3b8; border-top: 1px solid #334155;
  padding-top: 1.25rem; margin-bottom: 1.25rem; line-height: 1.6;
}
.landing-footer-bottom {
  display: flex; flex-direction: column; gap: 0.5rem;
  font-size: 0.75rem; color: #94a3b8;
  border-top: 1px solid #334155; padding-top: 1.25rem;
}
.landing-footer-bottom a {
  color: #94a3b8;
  /* Was a bare 14px-tall inline link: under the WCAG 2.2 target-size
   * floor and awkward to hit on a phone. Padding gives it a real
   * hit area without changing how the row reads. */
  display: inline-flex; align-items: center;
  min-height: 32px;
  padding: 0 0.55rem;
  margin: 0 0.35rem 0 -0.55rem;
  border-radius: var(--radius-sm);
}
.landing-footer-bottom a:hover { background: rgba(248,250,252,0.08); color: #f8fafc; }
.landing-footer-bottom > div { display: flex; flex-wrap: wrap; align-items: center; }

@media (min-width: 480px) {
  .landing-cta-row { flex-direction: row; }
  .landing-cta-row .btn { width: auto; }
  .landing-stats-grid { grid-template-columns: repeat(4, 1fr); }
  /* Brand block spans its own row above a 2x2 grid of link columns —
     four single-column-wide link lists at this width would be too
     cramped to read. */
  .landing-footer-grid { grid-template-columns: repeat(2, 1fr); }
  .landing-footer-brand { grid-column: 1 / -1; }
}

/* Mid-width tier's landing-page half (see MID-WIDTH TIER, near the top of
 * this file, for #app itself) — needs to sit after the base rules above
 * so it actually wins the cascade, hence living down here instead of next
 * to that block. #page-home isn't widened to fill #app yet at this tier
 * (that's a 1024px+ thing below), so these sections just render at
 * whatever #app's new ~880px cap gives them — plenty of room for a real
 * two-up hero and two-column card grids without needing the sidebar. */
@media (min-width: 768px) {
  .landing-hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 2.5rem; align-items: start; }
  .landing-hero-aside { margin-top: 3rem; }
  .landing-evidence-grid { grid-template-columns: repeat(2, 1fr); }
  .landing-process-list { display: grid; grid-template-columns: repeat(2, 1fr); }
}

/* Desktop: #page-home now fills the full width next to the sidebar (see
 * DESKTOP SHELL) instead of a 600px column, so cream/white-backed
 * sections get their own content capped and centred here — the dark,
 * full-bleed-worthy bands (stats/final-cta/footer) stay edge to edge and
 * only their inner grid gets capped instead, so the colour block still
 * reads as a deliberate full-width band, not an accidentally-wide one. */
@media (min-width: 1024px) {
  .landing-hero, .landing-block, .landing-quote-section {
    max-width: 1200px;
    margin: 0 auto;
  }
  /* The hero stops being a centred mobile column stretched across a wide
     viewport (all the width, none of it used) and becomes a genuine
     two-up layout: headline/CTA left, the numbers card as a sidecar
     right — the same "content + evidence panel" shape as the benchmark
     sites' hero sections. */
  .landing-hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 3rem; align-items: start; }
  .landing-hero-aside { margin-top: 3.75rem; }
  /* Brand column resumes its own place beside a single row of four link
     columns — the wasted right-hand gap this replaces at 1024px+ came
     from being stuck at the 480px breakpoint's 3-column grid. */
  .landing-footer-grid { grid-template-columns: 1.4fr repeat(4, 1fr); }
  .landing-footer-brand { grid-column: auto; }
  .landing-stats-grid, .landing-footer-grid, .landing-guarantee-box {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }
  .landing-evidence-grid { grid-template-columns: repeat(2, 1fr); }
  .landing-process-list { display: grid; grid-template-columns: repeat(2, 1fr); }
}

/* =====================================================================
   SHAREABLE REPORT CARD — one compact, logo-branded card used for all
   three share paths: printed to PDF via window.print() (no JS PDF
   library, keeping the app dependency-free and offline-safe), shown
   full-size on-screen in the "Preview & Share" modal for screenshotting,
   and summarised as text for WhatsApp/native share. Deliberately built
   as its own compact layout rather than reusing the full in-app results
   view, so it stays to 1-2 printed pages. The accent strip keeps the
   original four-colour brand palette from the mark — this card travels
   off-app, so it carries the full logo identity.
   ===================================================================== */
.print-only { display: none; }

.report-card {
  position: relative;
  background: #ffffff;
  color: #1f1e1d;
  border-radius: var(--radius-lg);
  padding: 1.7rem 1.5rem 1.4rem;
  overflow: hidden;
  border: 1px solid var(--border);
}
.report-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: linear-gradient(90deg, #1ca0d0, #ed8b2d, #6fae48);
}
.report-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; flex-wrap: wrap;
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e6e2d7;
}
.report-header img { width: 180px; height: auto; flex-shrink: 0; }
.report-header-meta { text-align: right; }
.report-eyebrow {
  display: block; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase; color: #6b6862;
}
.report-date { font-size: 0.82rem; color: #a5a29a; }

.report-primary { border-left: 5px solid; padding-left: 1.1rem; margin-bottom: 0.9rem; }
.report-primary-label { display: block; font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; }
.report-primary h2 { font-size: 1.65rem; margin: 0.2rem 0 0.4rem; }
.report-primary p { font-size: 0.95rem; color: #52504a; margin-bottom: 0.6rem; }
.report-paths { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.report-path-tag { font-size: 0.76rem; background: #f2efe7; color: #52504a; padding: 0.2rem 0.65rem; border-radius: 999px; }

.report-secondary-line { font-size: 0.88rem; color: #52504a; margin-bottom: 1.1rem; }

.report-columns { display: grid; grid-template-columns: 1fr; gap: 1.2rem; margin-bottom: 1.1rem; }
@media (min-width: 480px) { .report-columns { grid-template-columns: 1fr 1fr; } }

.report-section-title { display: block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: #6b6862; margin-bottom: 0.55rem; }
/* The legend the on-screen results carry and the exported card used to drop.
 * Deliberately small and quiet — it exists so a number cannot be misread on
 * paper, not to compete with the number itself. Fixed colours throughout this
 * card because it prints, and a theme-dependent grey can come out invisible. */
.report-legend { font-size: 0.66rem; line-height: 1.35; color: #6b6862; margin: -0.3rem 0 0.55rem; }
.report-bar-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.report-bar-label { font-size: 0.78rem; width: 68px; flex-shrink: 0; color: #52504a; }
.report-bar-track { flex: 1; height: 8px; background: #ece8dd; border-radius: 999px; overflow: hidden; }
.report-bar-fill { height: 100%; border-radius: 999px; }
.report-bar-pct { font-size: 0.78rem; width: 32px; text-align: right; color: #52504a; flex-shrink: 0; }

.report-chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.report-chip { font-size: 0.76rem; background: #f2efe7; color: #52504a; padding: 0.2rem 0.6rem; border-radius: 6px; }

.report-courses ul { list-style: disc; padding-left: 1.2rem; font-size: 0.88rem; color: #52504a; line-height: 1.5; }
.report-progress { margin-top: 0.55rem; }
.report-progress-line { font-size: 0.88rem; color: #52504a; margin-bottom: 0.7rem; }

.report-footer { border-top: 1px solid #e6e2d7; padding-top: 0.85rem; margin-top: 0.6rem; text-align: center; }
.report-footer p { font-size: 0.78rem; color: #6b6862; margin: 0; }
.report-footer .report-url { font-weight: 600; color: var(--primary-dark) !important; }

@page { size: A4; margin: 12mm 10mm; }

@media print {
  .app-header, .bottom-nav, .install-banner, .toast-container,
  .modal-overlay, .mobile-menu, .btn, .btn-row, button, .odyssey-tabs, .filter-row {
    display: none !important;
  }
  body, #app, main, .page {
    background: #ffffff !important;
    color: #1f1e1d !important;
  }
  .discover-full-results { display: none !important; }
  .print-only { display: block !important; }
  .report-card { padding: 0; border: none; }
  .report-columns { grid-template-columns: 1fr 1fr; }
}

/* Labour-market card — sector earnings with their entry caveat.
   The caveat is body-weight, not fine print: it is the difference between
   informing a school-leaver and misleading one. */
.sector-row { padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.sector-row:last-of-type { border-bottom: none; }
.sector-row-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.sector-name { font-weight: 600; }
.sector-figure { font-weight: 700; color: var(--text); white-space: nowrap; }
.sector-per { font-size: 0.75rem; font-weight: 500; color: var(--text-muted); margin-left: 0.2rem; }
.sector-reality { color: var(--text-secondary); font-size: 0.9rem; margin-top: var(--space-1); max-width: var(--prose-max); }

/* Disclosure for the contested automation estimates. Collapsed by default —
   the disagreement matters, but it should not bury the actionable line above
   it for a reader who only wants the answer for their own cluster. */
.automation-detail { margin: var(--space-3) 0 var(--space-2); }
.automation-detail summary { cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); padding: var(--space-2) 0; }
.automation-detail summary:hover { color: var(--text); }
.automation-detail[open] summary { margin-bottom: var(--space-2); }
.automation-detail > p { max-width: var(--prose-max); }

/* Scroll lock while a modal sheet is open. Without it the page behind scrolls
   under the user's finger on a phone and the sheet appears to lose its place. */
body.modal-open { overflow: hidden; }

/* Skip link — the first focusable element on the page. Visually hidden until
   focused. axe cannot flag a *missing* skip link, which is why the 56-state
   sweep passed clean without one; keyboard users still had to tab the whole
   header and nav before reaching content. */
.skip-link {
  position: absolute; left: var(--space-3); top: -100px;
  z-index: 200;
  background: var(--ink); color: var(--ink-contrast);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-weight: 600; text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: var(--space-3); }

/* Two growth rankings side by side. The percentage list is the one every
   article quotes; the absolute list is the one a school-leaver can act on.
   Showing them together is the whole point — separating them visually stops
   the tech list reading as "the" answer. */
.growth-split { display: grid; gap: var(--space-4); margin-top: var(--space-3); }
@media (min-width: 640px) { .growth-split { grid-template-columns: 1fr 1fr; } }
.growth-split > div { padding: var(--space-4); background: var(--surface-2, var(--surface)); border: 1px solid var(--border); border-radius: var(--radius-md); }
.growth-split p { margin-top: var(--space-1); max-width: none; }

/* The informal-economy note sits directly above the sector earnings, because
   those averages describe formal wage employment — where roughly one working
   Kenyan in six ends up. Shown as context, not a warning: for five in six
   workers the informal sector is the economy, not the failure case. */
.informal-note {
  background: var(--accent-soft, var(--surface));
  border-left: 3px solid var(--accent, var(--primary));
  border-radius: var(--radius-sm, 6px);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}
.informal-note p { max-width: var(--prose-max); color: var(--text-secondary); }
.informal-note p:last-child { margin-bottom: 0; }

/* The absorption note. A shortage of posts is not the same as an opening you
   can walk into, and in health and teaching the two have come apart. Styled as
   a distinct panel because the "and yet" is the part a reader most needs to
   register, not skim past. */
.absorption-note {
  border: 1px solid var(--warn-border);
  background: var(--warn-soft);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin: var(--space-4) 0;
}
.absorption-note p { color: var(--warn-ink); max-width: var(--prose-max); }
.absorption-note .caption { color: var(--warn-ink); }
.absorption-note p:last-child { margin-bottom: 0; }

/* Entry pay — the number a school-leaver is actually asking for, and the one
   the sector averages could not answer. Leads the card; the averages moved
   behind a disclosure because they are context, not the answer. */
.pay-list { margin: var(--space-3) 0 var(--space-4); }
.pay-row { padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.pay-row:last-child { border-bottom: none; }
.pay-row-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.pay-role { font-weight: 600; }
.pay-figure { font-weight: 700; white-space: nowrap; }
.pay-per { font-size: 0.75rem; font-weight: 500; color: var(--text-muted); margin-left: 0.15rem; }
.pay-note { color: var(--text-secondary); font-size: 0.85rem; margin-top: var(--space-1); max-width: var(--prose-max); }

/* Progressive disclosure for the supporting evidence. The card ran past 1,000
   words with facts repeating across layers; the decision-relevant figures now
   lead and the rest is one tap away rather than a wall to scroll past. */
.evidence-more { margin-top: var(--space-4); border-top: 1px solid var(--border); padding-top: var(--space-3); }
.evidence-more > summary, .inline-detail > summary {
  cursor: pointer; font-size: 0.85rem; font-weight: 600;
  color: var(--text-secondary); padding: var(--space-2) 0;
}
.evidence-more > summary:hover, .inline-detail > summary:hover { color: var(--text); }
.inline-detail { margin-top: var(--space-2); }
.inline-detail > summary { color: var(--warn-ink); }
.inline-detail p { color: var(--warn-ink); }

/* An OKR with no key results. Uses the warn triplet rather than the at-risk
   danger styling: nothing has gone wrong, there is simply nothing to measure
   yet, and the label says what to do about it. */
.status-badge.needs-key-results {
  background: var(--warn-soft);
  color: var(--warn-ink);
  border: 1px solid var(--warn-border);
}
