/* =====================================================================
   MAGGie Pro — Shared Design System
   ---------------------------------------------------------------------
   Single source of truth for the visual language across every page.
   Built on the legacy MAGGie purple gradient (#667eea -> #764ba2) but
   elevated for an experienced-professional audience: more whitespace,
   varied layout primitives (hero/split/grid/timeline/dashboard) and a
   small set of reusable components so no page re-invents its own styles.

   Conventions:
   - All colors / spacing / radii are CSS custom properties (theme tokens)
     so a future re-skin only touches :root.
   - Dark mode is supported via [data-theme="dark"] on <html>; app.js
     toggles it and persists the choice.
   - Everything is responsive; the single breakpoint lives at 820px.
   ===================================================================== */

/* Editorial type pairing: a serif display face for headings gives the site a
   publisher's voice instead of the default system-UI look; Source Sans 3 keeps
   long-form body copy comfortable. Both degrade to system stacks offline. */
@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Source+Sans+3:wght@400;600;700;800&display=swap");

/* ----- Theme tokens ------------------------------------------------- */
:root {
  /* Typefaces */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Brand gradient (kept identical to legacy site for continuity) */
  --brand-1: #667eea;
  --brand-2: #764ba2;
  --brand-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  /* Accent colors for gamification / status states */
  --accent-gold: #f6b73c;
  --accent-green: #2bb673;
  --accent-rose: #e0608a;
  --accent-sky: #4aa3df;

  /* Neutral surface palette (light mode defaults) */
  --bg: #eef0fb;            /* page background behind cards            */
  --surface: #ffffff;       /* card / panel background                 */
  --surface-2: #f5f6fd;     /* subtle inset background                 */
  --border: #e4e6f5;        /* hairline borders                        */
  --text: #23253a;          /* primary text                           */
  --text-soft: #4a4e6b;     /* secondary text (darkened for contrast) */
  --text-faint: #7b80a2;    /* tertiary / captions                    */

  /* Effects */
  --shadow-sm: 0 2px 8px rgba(46, 41, 78, 0.08);
  --shadow-md: 0 10px 30px rgba(46, 41, 78, 0.12);
  --shadow-lg: 0 20px 50px rgba(46, 41, 78, 0.18);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 28px;

  --maxw: 1240px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Dark mode overrides — only the neutrals change; brand stays vivid. */
[data-theme="dark"] {
  --bg: #14152a;
  --surface: #1e2040;
  --surface-2: #262a52;
  --border: #33376b;
  --text: #eef0ff;
  --text-soft: #b9bce0;
  --text-faint: #8488b8;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* ----- Reset / base ------------------------------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  /* 17px base: the previous 16px read small against the generous layout. */
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

img { max-width: 100%; display: block; }
a { color: var(--brand-1); }

h1, h2, h3, h4 { line-height: 1.15; color: var(--text); font-family: var(--font-display); }
h1 { font-size: clamp(2.15rem, 4.4vw, 3rem); font-weight: 700; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.55rem, 2.8vw, 2.05rem); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.22rem; font-weight: 600; letter-spacing: -0.005em; }
h4 { font-size: 1.02rem; font-weight: 600; }
/* Numeric UI (stats, prices, XP) stays in the sans face for tabular clarity. */
.stat-chip .num, .price-amount, .ring-wrap .pct { font-family: var(--font-body); font-variant-numeric: tabular-nums; }

/* Visually-hidden helper for screen-reader-only labels */
.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;
}

/* Focus ring — keep keyboard navigation obvious for accessibility. */
:focus-visible { outline: 3px solid var(--brand-1); outline-offset: 2px; border-radius: 4px; }

/* ----- Layout primitives ------------------------------------------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
/* Tightened vertical rhythm — the old 64/40 pairing left the page feeling empty. */
.section { padding: 48px 0; }
.section--tight { padding: 30px 0; }

/* Eyebrow label above section titles */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--brand-2);
  background: color-mix(in srgb, var(--brand-1) 12%, transparent);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 14px;
}
[data-theme="dark"] .eyebrow { color: #c9b8ff; }

.section-head { max-width: 760px; margin-bottom: 26px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 + .lead, .section-head .lead { margin-top: 8px; }
.lead { font-size: 1.1rem; color: var(--text-soft); }

/* Grid helpers — autofit cards without per-page media queries */
.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Split layout: text on one side, media on the other */
.split {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 40px; align-items: center;
}
.split--media-first .split__media { order: -1; }

/* ----- Navbar (shared, rendered by app.js) ------------------------- */
.navbar {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1000;
}
.nav-container {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.35rem; font-weight: 800; text-decoration: none; color: var(--text);
}
.nav-brand .brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--brand-gradient);
  display: grid; place-items: center; color: #fff; font-weight: 800; flex: none;
  box-shadow: var(--shadow-sm);
}
.nav-brand .brand-mark svg { width: 20px; height: 20px; }
.nav-links { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav-link {
  color: var(--text-soft); text-decoration: none; padding: 9px 14px;
  border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  transition: all 0.2s var(--ease); white-space: nowrap;
  font-family: inherit; border: none; background: none; cursor: pointer;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--brand-gradient); color: #fff; }
.nav-actions { display: flex; align-items: center; gap: 8px; }

/* ----- Grouped nav (dropdown sections) ------------------------------ */
/* Twelve flat tabs were a sitemap, not navigation: secondary destinations now
   live in labelled groups that also describe where each link goes. */
.nav-group { position: relative; }
.nav-group__btn { display: inline-flex; align-items: center; gap: 5px; }
.nav-group__btn svg { transition: transform 0.2s var(--ease); }
.nav-group__btn[aria-expanded="true"] svg { transform: rotate(180deg); }
/* A group whose child page is open reads as active, without the solid pill. */
.nav-group__btn.in-section { color: var(--brand-2); background: color-mix(in srgb, var(--brand-1) 12%, transparent); }
[data-theme="dark"] .nav-group__btn.in-section { color: #c9b8ff; }

.nav-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 1200;
  min-width: 290px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  display: grid; gap: 2px;
}
.nav-menu[hidden] { display: none; }
.nav-menu__item {
  display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start;
  padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--text);
}
.nav-menu__item:hover, .nav-menu__item:focus-visible { background: var(--surface-2); }
.nav-menu__item.active { background: color-mix(in srgb, var(--brand-1) 12%, transparent); }
.nav-menu__ic { color: var(--brand-2); display: grid; place-items: center; padding-top: 2px; }
[data-theme="dark"] .nav-menu__ic { color: #c9b8ff; }
.nav-menu__item strong { display: block; font-size: 0.94rem; font-weight: 700; line-height: 1.3; }
.nav-menu__item small { display: block; color: var(--text-soft); font-size: 0.81rem; line-height: 1.35; }

/* Primary call to action lives in the bar and reflects onboarding state.
   Scoped to .nav-links so it outranks the later .btn padding rule. */
.nav-links .nav-cta { margin-left: 6px; padding: 9px 18px; font-size: 0.92rem; }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; display: grid; place-items: center;
  color: var(--text); transition: all 0.2s var(--ease);
}
.theme-toggle:hover { background: var(--surface-2); }
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--text); padding: 8px;
}
/* Mobile nav: collapse links behind the hamburger. Groups flatten into
   inline sections so nothing is buried two taps deep. */
@media (max-width: 1080px) {
  .nav-toggle { display: grid; place-items: center; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 12px; box-shadow: var(--shadow-md);
    max-height: calc(100vh - 70px); overflow-y: auto;
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 12px 16px; text-align: left; }
  .nav-group__btn { width: 100%; justify-content: space-between; }
  .nav-menu {
    position: static; min-width: 0; box-shadow: none; border: none;
    border-left: 2px solid var(--border); border-radius: 0;
    margin: 2px 0 6px 16px; padding: 2px 0 2px 8px;
  }
  .nav-links .nav-cta { margin: 8px 0 2px; }
}

/* ----- Buttons ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 13px 26px; border-radius: 999px; font-size: 1rem; font-weight: 700;
  text-decoration: none; cursor: pointer; border: none;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand-gradient); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn--ghost:hover { border-color: var(--brand-1); color: var(--brand-1); }
.btn--light { background: rgba(255,255,255,0.16); color: #fff; border: 1.5px solid rgba(255,255,255,0.4); }
.btn--light:hover { background: rgba(255,255,255,0.28); }
.btn--sm { padding: 8px 16px; font-size: 0.9rem; }
.btn--danger { background: var(--accent-rose); color: #fff; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ----- Cards -------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
/* Body copy inside cards sits a notch below page text; .lead keeps its size. */
.card p:not(.lead) { font-size: 1rem; }
.card--hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card__icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--brand-1) 12%, transparent); color: var(--brand-2);
  margin-bottom: 16px;
}
[data-theme="dark"] .card__icon { color: #c9b8ff; }
.card__icon svg { width: 26px; height: 26px; }
.muted { color: var(--text-soft); }
.faint { color: var(--text-faint); font-size: 0.9rem; }

/* ----- Hero --------------------------------------------------------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background: var(--brand-gradient);
}
/* Imagery overlay sits behind the gradient tint for depth */
.hero__bg {
  position: absolute; inset: 0; object-fit: cover; width: 100%; height: 100%;
  opacity: 0.22; mix-blend-mode: luminosity;
}
.hero__inner { position: relative; z-index: 1; padding: 64px 0 68px; }
.hero h1 { color: #fff; text-shadow: 0 2px 16px rgba(0,0,0,0.18); max-width: 15ch; }
.hero .lead { color: rgba(255,255,255,0.94); font-size: 1.18rem; max-width: 54ch; margin: 16px 0 26px; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center; }

/* Proof bar: the hero's supporting stats, moved out of the first viewport and
   turned into links so each claim leads somewhere it can be verified. */
.proof-bar {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.proof-bar__item {
  background: var(--surface); padding: 16px 20px; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 2px; transition: background 0.18s var(--ease);
}
.proof-bar__item:hover { background: var(--surface-2); }
.proof-bar__num { font-size: 1.5rem; font-weight: 800; color: var(--brand-2); line-height: 1.1; font-variant-numeric: tabular-nums; }
[data-theme="dark"] .proof-bar__num { color: #c9b8ff; }
.proof-bar__lbl { font-size: 0.9rem; color: var(--text-soft); }
.proof-bar__go { font-size: 0.78rem; font-weight: 700; color: var(--brand-1); }

/* Floating stat chips used on hero / dashboards */
.stat-chip {
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.28);
  border-radius: var(--radius-sm); padding: 14px 18px; backdrop-filter: blur(6px);
}
.stat-chip .num { font-size: 1.6rem; font-weight: 800; }
.stat-chip .lbl { font-size: 0.82rem; opacity: 0.85; }

/* ----- Pills / badges / tags --------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
  border-radius: 999px; font-size: 0.8rem; font-weight: 700;
  background: var(--surface-2); color: var(--text-soft);
}
.pill--brand { background: color-mix(in srgb, var(--brand-1) 14%, transparent); color: var(--brand-2); }
.pill--green { background: color-mix(in srgb, var(--accent-green) 16%, transparent); color: var(--accent-green); }
.pill--gold  { background: color-mix(in srgb, var(--accent-gold) 20%, transparent); color: #b9821a; }
[data-theme="dark"] .pill--brand { color: #c9b8ff; }

/* ----- Progress bar & ring ----------------------------------------- */
.progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress__fill { height: 100%; border-radius: 999px; background: var(--brand-gradient); transition: width 0.6s var(--ease); }

/* SVG progress ring uses stroke-dashoffset; .ring__value is set inline/JS */
.ring { transform: rotate(-90deg); }
.ring__track { fill: none; stroke: var(--surface-2); }
.ring__value { fill: none; stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 0.8s var(--ease); }
.ring-wrap { position: relative; display: inline-grid; place-items: center; }
.ring-wrap .ring-label { position: absolute; text-align: center; }
.ring-wrap .ring-label .pct { font-size: 1.6rem; font-weight: 800; }

/* ----- Forms -------------------------------------------------------- */
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 600; margin-bottom: 8px; }
.field .hint { font-size: 0.85rem; color: var(--text-faint); margin-top: 4px; }
.input, .select, .textarea {
  width: 100%; padding: 13px 15px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 1rem; font-family: inherit; transition: border-color 0.2s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-1); outline: none; }
.textarea { resize: vertical; min-height: 90px; }

/* Selectable chip group (radio/checkbox replacement used in onboarding) */
.choice-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.choice {
  position: relative; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; cursor: pointer; background: var(--surface); transition: all 0.18s var(--ease);
  display: flex; flex-direction: column; gap: 4px;
}
.choice:hover { border-color: var(--brand-1); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice__title { font-weight: 700; }
.choice__desc { font-size: 0.85rem; color: var(--text-soft); }
/* Checked state driven by :has() — falls back gracefully on old browsers */
.choice:has(input:checked) {
  border-color: var(--brand-1); background: color-mix(in srgb, var(--brand-1) 8%, var(--surface));
  box-shadow: var(--shadow-sm);
}
.choice:has(input:checked)::after {
  content: "✓"; position: absolute; top: 10px; right: 12px;
  color: #fff; background: var(--brand-gradient); width: 22px; height: 22px;
  border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; font-weight: 800;
}
.choice:has(input:focus-visible) { outline: 3px solid var(--brand-1); outline-offset: 2px; }

/* ----- Timeline (used for pathway & ethics) ------------------------ */
.timeline { position: relative; padding-left: 36px; }
.timeline::before {
  content: ""; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 3px;
  background: linear-gradient(var(--brand-1), var(--brand-2)); border-radius: 3px;
}
.timeline__item { position: relative; margin-bottom: 22px; }
.timeline__dot {
  position: absolute; left: -36px; top: 4px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--brand-1); display: grid; place-items: center;
  font-weight: 800; color: var(--brand-2); font-size: 0.85rem; z-index: 1;
}
.timeline__item.done .timeline__dot { background: var(--brand-gradient); color: #fff; border-color: transparent; }

/* ----- Badges (achievements) --------------------------------------- */
.badge-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.badge { text-align: center; opacity: 0.4; filter: grayscale(1); transition: all 0.3s var(--ease); }
.badge.earned { opacity: 1; filter: none; }
.badge__medal { width: 72px; height: 72px; margin: 0 auto 8px; }
.badge__name { font-weight: 700; font-size: 0.9rem; }
.badge__desc { font-size: 0.78rem; color: var(--text-faint); }

/* ----- Toast (milestone celebrations / feedback) ------------------- */
.toast-stack { position: fixed; bottom: 22px; right: 22px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
/* Lift toasts above the floating session dial so they stay readable. */
body.has-session-timer .toast-stack { bottom: 118px; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--accent-green);
  border-radius: var(--radius-sm); padding: 14px 18px; box-shadow: var(--shadow-md);
  max-width: 340px; animation: toastIn 0.4s var(--ease);
}
.toast--celebrate { border-left-color: var(--accent-gold); }
.toast strong { display: block; margin-bottom: 2px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }

/* ----- Floating session timer (all pages via app.js) --------------- */
.session-timer {
  position: fixed;
  right: max(14px, env(safe-area-inset-right, 0px));
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  z-index: 1900;
  width: 92px;
  height: 92px;
  /* Widget only — never covers the page with a blocking layer. */
  pointer-events: auto;
}
.session-timer__dial {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.session-timer__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.session-timer__track {
  fill: none;
  stroke: var(--border);
}
.session-timer__progress {
  fill: none;
  stroke: var(--accent-sky);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.35s var(--ease);
}
.session-timer--expired .session-timer__progress { stroke: var(--accent-rose); }

/* Four selectable duration wedges (NW/NE/SW/SE). */
.session-timer__quads {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.session-timer__quad {
  position: absolute;
  width: 50%;
  height: 50%;
  margin: 0;
  padding: 0;
  border: 0;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  line-height: 1;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.session-timer__quad--nw { top: 0; left: 0; padding: 14px 0 0 12px; text-align: left; }
.session-timer__quad--ne { top: 0; right: 0; padding: 14px 12px 0 0; text-align: right; }
.session-timer__quad--sw { bottom: 0; left: 0; padding: 0 0 14px 12px; text-align: left; }
.session-timer__quad--se { bottom: 0; right: 0; padding: 0 12px 14px 0; text-align: right; }
.session-timer__quad:hover,
.session-timer__quad:focus-visible {
  background: color-mix(in srgb, var(--accent-sky) 22%, var(--surface));
  color: var(--text);
  outline: none;
}
.session-timer__quad.is-selected {
  background: color-mix(in srgb, var(--accent-sky) 28%, var(--surface));
  color: var(--text);
}
.session-timer__center {
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-content: center;
  text-align: center;
  z-index: 2;
  /* Capture hits so the center label doesn't click through to a quadrant. */
  pointer-events: auto;
  box-shadow: var(--shadow-sm);
}
.session-timer__time {
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.session-timer__sub {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}
/* Attention pulse on the dial only — page stays fully interactive. */
.session-timer--expired .session-timer__dial {
  animation: sessionTimerPulse 1.1s var(--ease) infinite;
  border-color: color-mix(in srgb, var(--accent-rose) 55%, var(--border));
}
.session-timer--expired .session-timer__time { color: var(--accent-rose); }
@keyframes sessionTimerPulse {
  0%, 100% { box-shadow: var(--shadow-md); transform: scale(1); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent-rose) 28%, transparent); transform: scale(1.03); }
}
@media (max-width: 560px) {
  .session-timer { width: 80px; height: 80px; }
  .session-timer__quad { font-size: 0.66rem; }
  .session-timer__quad--nw { padding: 11px 0 0 10px; }
  .session-timer__quad--ne { padding: 11px 10px 0 0; }
  .session-timer__quad--sw { padding: 0 0 11px 10px; }
  .session-timer__quad--se { padding: 0 10px 11px 0; }
  .session-timer__time { font-size: 0.74rem; }
  body.has-session-timer .toast-stack { bottom: 104px; }
}

/* ----- Footer ------------------------------------------------------- */
.footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 40px 0 28px; margin-top: 40px; color: var(--text-soft);
}
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer__grid a { display: block; color: var(--text-soft); text-decoration: none; padding: 4px 0; }
.footer__grid a:hover { color: var(--brand-1); }
.footer__bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 0.85rem; color: var(--text-faint); }

/* ----- Mission block (landing page — people-first positioning) ------- */
.mission-block {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 44px;
  box-shadow: var(--shadow-md);
}
.mission-block__quote {
  margin: 0;
  padding: 28px 26px;
  border-radius: var(--radius);
  background: var(--brand-gradient);
  color: #fff;
  border: none;
  align-self: center;
}
.mission-block__quote p {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.45;
  color: #fff;
  margin-bottom: 14px;
}
.mission-block__quote footer {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.5;
}

/* ----- Banners / callouts ------------------------------------------ */
.banner {
  border-radius: var(--radius); padding: 18px 22px; display: flex; gap: 14px; align-items: flex-start;
  border: 1px solid var(--border); background: var(--surface-2);
}
.banner--info { border-left: 5px solid var(--accent-sky); }
.banner--ethics { border-left: 5px solid var(--brand-2); }
.banner svg { flex: none; width: 24px; height: 24px; }

/* Data table for transparency center */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); }
.table code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: 0.85rem; }

/* Utility spacing */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .flex-wrap { flex-wrap: wrap; } .items-center { align-items: center; }
.justify-between { justify-content: space-between; } .gap-2 { gap: 16px; } .gap-1 { gap: 8px; }
.text-center { text-align: center; } .w-full { width: 100%; }

/* ----- Responsive collapse ----------------------------------------- */
@media (max-width: 820px) {
  /* .footer__grid collapses in the page-connections block further down. */
  .split, .hero__split, .mission-block { grid-template-columns: 1fr; gap: 28px; }
  .mission-block { padding: 28px 22px; }
  .split--media-first .split__media { order: 0; }
  .section { padding: 44px 0; }
  .hero__inner { padding: 56px 0; }
}

/* =====================================================================
   NOVICE-FRIENDLY COMPONENTS (added in follow-up)
   Goal: guide newcomers without slowing experts down.
   ===================================================================== */

/* ----- "What you'll learn" callout -------------------------------- */
/* A reassuring, scannable preview placed at the top of dense sections. */
.learn-callout {
  background: color-mix(in srgb, var(--brand-1) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand-1) 25%, transparent);
  border-radius: var(--radius); padding: 20px 24px; margin-bottom: 24px;
}
.learn-callout__head { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--brand-2); margin-bottom: 10px; }
[data-theme="dark"] .learn-callout__head { color: #c9b8ff; }
.learn-callout__head svg { width: 22px; height: 22px; flex: none; }
.learn-callout ul { margin: 0; padding-left: 22px; }
.learn-callout li { margin-bottom: 6px; color: var(--text); }
.learn-callout li::marker { color: var(--brand-1); }

/* ----- "In plain terms" line -------------------------------------- */
/* A soft, friendly restatement under a dense concept block. */
.plain-terms {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface-2); border-left: 4px solid var(--accent-green);
  border-radius: var(--radius-sm); padding: 12px 16px; margin: 6px 0 16px;
  font-size: 0.97rem;
}
.plain-terms .tag {
  flex: none; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent-green); padding-top: 2px;
}

/* ----- Glossary term tooltip -------------------------------------- */
/* Inline term gets a dotted underline; the gloss appears on hover/focus/tap. */
.term {
  position: relative; cursor: help; font-weight: 600; color: var(--brand-2);
  border-bottom: 1.5px dotted var(--brand-1); border-radius: 2px;
}
[data-theme="dark"] .term { color: #c9b8ff; }
.term:focus-visible { outline: 3px solid var(--brand-1); outline-offset: 2px; }
.term__tip {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 50;
  width: max-content; max-width: 280px; font-weight: 400; font-size: 0.88rem; line-height: 1.45;
  color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md); padding: 10px 12px;
  white-space: normal; cursor: auto;
}
/* Little pointer arrow above the tooltip body. */
.term__tip::before {
  content: ""; position: absolute; bottom: 100%; left: 14px;
  border: 6px solid transparent; border-bottom-color: var(--surface);
}
.term__tip[hidden] { display: none; }

/* =====================================================================
   PRICING PAGE COMPONENTS
   ===================================================================== */
.price-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: stretch; }
.price-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  padding: 30px 26px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.price-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
/* Featured tier stands out with the brand gradient border + ribbon. */
.price-card--featured { border-color: transparent; position: relative; box-shadow: var(--shadow-md);
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--brand-gradient) border-box; border: 2px solid transparent; }
.price-card__ribbon {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--brand-gradient); color: #fff; font-size: 0.74rem; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase; padding: 6px 14px; border-radius: 999px; white-space: nowrap;
}
.price-card__name { font-size: 1.25rem; font-weight: 800; }
.price-card__tagline { color: var(--text-soft); font-size: 0.92rem; min-height: 2.6em; }
.price-amount { font-size: 2.6rem; font-weight: 800; line-height: 1; margin: 14px 0 2px; }
.price-amount small { font-size: 1rem; font-weight: 600; color: var(--text-faint); }
.price-period { color: var(--text-faint); font-size: 0.9rem; min-height: 1.4em; }
.price-features { list-style: none; margin: 18px 0; padding: 0; display: grid; gap: 10px; flex: 1; }
.price-features li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-soft); }
.price-features li svg { flex: none; width: 18px; height: 18px; color: var(--accent-green); margin-top: 3px; }
.price-features li.muted-feature { opacity: 0.55; }
.price-features li.muted-feature svg { color: var(--text-faint); }

/* Billing toggle (monthly / annual) */
.billing-toggle { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 4px; }
.billing-toggle button { border: none; background: transparent; padding: 8px 18px; border-radius: 999px; cursor: pointer; font-weight: 700; color: var(--text-soft); }
.billing-toggle button.active { background: var(--brand-gradient); color: #fff; }

/* FAQ accordion (uses native <details> for accessibility) */
.faq { display: grid; gap: 12px; }
.faq__item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0; }
.faq__item summary {
  cursor: pointer; padding: 16px 20px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; font-size: 1.4rem; color: var(--brand-1); font-weight: 400; }
.faq__item[open] summary::after { content: "\2212"; }
.faq__item .faq__body { padding: 0 20px 18px; color: var(--text-soft); }

/* =====================================================================
   FORM EXTRAS (coach application)
   ===================================================================== */
.req::after { content: " *"; color: var(--accent-rose); }
.check-row { display: flex; gap: 12px; align-items: flex-start; background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px 16px; }
.check-row input[type="checkbox"] { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--brand-1); }
.form-grid { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-note { font-size: 0.9rem; color: var(--text-faint); }

/* Long-form legal/terms readability */
.legal { max-width: 820px; }
.legal h2 { margin: 30px 0 8px; font-size: 1.25rem; }
.legal h3 { margin: 18px 0 6px; font-size: 1.05rem; }
.legal p, .legal li { color: var(--text-soft); }
.legal ul, .legal ol { margin: 0 0 14px 22px; }
.legal li { margin-bottom: 6px; }

/* =====================================================================
   ACCOUNT / SIGN-IN, STORAGE BANNER, VOICE HINTS (follow-up 3)
   ===================================================================== */

/* Nav account button (sits beside the theme toggle) */
.account-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 0.9rem; cursor: pointer;
  max-width: 160px; transition: all 0.2s var(--ease);
}
.account-btn:hover { border-color: var(--brand-1); color: var(--brand-1); }
.account-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Modal (account / sign-in dialog) */
/* Same-tab handoff to Stripe Customer Portal (no blur — must not trap clicks). */
.billing-handoff {
  position: fixed; inset: 0; z-index: 4000; display: grid; place-items: center;
  background: rgba(248, 246, 242, 0.96); padding: 24px;
}
.billing-handoff__card {
  max-width: 420px; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow-sm);
}
.billing-handoff__title {
  margin: 0 0 8px; font-family: var(--font-display); font-size: 1.25rem; font-weight: 700;
}

.modal {
  position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center;
  background: rgba(20, 18, 40, 0.55); backdrop-filter: blur(3px); padding: 20px;
  animation: fadeIn 0.2s var(--ease);
}
/* Author display:grid must not override the HTML hidden attribute, or the overlay
   stays visible (backdrop blur) and traps the page — see add-goal modal on dashboard. */
.modal[hidden] {
  display: none !important;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal__card {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; padding: 26px;
  animation: popIn 0.25s var(--ease);
}
@keyframes popIn { from { transform: translateY(12px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__close {
  background: var(--surface-2); border: none; border-radius: 50%; width: 36px; height: 36px;
  display: grid; place-items: center; cursor: pointer; color: var(--text-soft); transform: rotate(45deg);
}
.modal__close:hover { background: var(--border); color: var(--text); }

/* First-visit browser-storage banner (bottom, dismissible) */
.storage-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2500;
  background: var(--surface); border-top: 2px solid var(--brand-1); box-shadow: var(--shadow-lg);
  animation: slideUp 0.4s var(--ease);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.storage-banner__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 16px;
}
.storage-banner__icon { color: var(--brand-1); flex: none; display: grid; place-items: center; }
.storage-banner p { margin: 0; font-size: 0.92rem; color: var(--text-soft); flex: 1; }
.storage-banner #storageOk { flex: none; }
@media (max-width: 640px) {
  .storage-banner__inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .storage-banner #storageOk { align-self: flex-end; }
}

/* Voice-input (dictation) hint */
.voice-hint {
  background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; margin: -8px 0 18px; font-size: 0.9rem; color: var(--text-soft);
}
.voice-hint__row { display: flex; align-items: flex-start; gap: 10px; }
.voice-hint__row > span:nth-child(2) { flex: 1; }
.voice-hint__mic { font-size: 1.1rem; line-height: 1.3; flex: none; }
.voice-hint__dismiss {
  flex: none; background: none; border: none; cursor: pointer; color: var(--text-faint);
  display: grid; place-items: center; transform: rotate(45deg); padding: 2px;
}
.voice-hint__dismiss:hover { color: var(--text); }
.voice-hint kbd {
  background: var(--surface); border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px; font-size: 0.82em; font-family: inherit; white-space: nowrap;
}
.voice-hint__more { margin-top: 8px; }
.voice-hint__more summary { cursor: pointer; font-weight: 600; color: var(--brand-2); width: max-content; }
[data-theme="dark"] .voice-hint__more summary { color: #c9b8ff; }
.voice-hint__more ul { margin: 8px 0 0 18px; }
.voice-hint__more li { margin-bottom: 5px; }
.voice-hint__note { margin: 8px 0 0; font-size: 0.8rem; color: var(--text-faint); display: flex; align-items: center; gap: 5px; }
.voice-hint__note svg { flex: none; }

/* =====================================================================
   REFERENCE / CITATION MARKERS ("give credit where credit is due")
   Distinct from glossary tooltips: a superscript book marker (📖) opens a
   credit popup with a clean "Open in new page" link (no raw URLs shown).
   ===================================================================== */
.ref-wrap { position: relative; display: inline; }
.ref {
  cursor: pointer; font-size: 0.62em; line-height: 0; margin-left: 1px;
  vertical-align: super; user-select: none; border-radius: 3px;
  /* Subtle accent so it's clearly a "credit", not a glossary term. */
  filter: saturate(1.1);
}
.ref:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; }
.ref[aria-expanded="true"] { background: color-mix(in srgb, var(--brand-2) 18%, transparent); }

.ref__pop {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 60;
  width: max-content; max-width: 300px; text-align: left;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--brand-2); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); padding: 12px 14px; font-size: 0.86rem; line-height: 1.5;
  font-weight: 400; color: var(--text); white-space: normal; cursor: auto;
}
.ref__pop::before {
  content: "\1F4D6"; /* 📖 small header glyph */
  position: absolute; top: -10px; left: 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px; padding: 0 4px; font-size: 0.8rem; line-height: 1.3;
}
.ref__pop[hidden] { display: none; }
.ref__name { display: block; font-weight: 800; color: var(--brand-2); margin-top: 2px; }
[data-theme="dark"] .ref__name { color: #c9b8ff; }
.ref__work { display: block; font-style: italic; color: var(--text-soft); margin: 2px 0; }
.ref__note { display: block; color: var(--text-soft); margin-bottom: 8px; }
.ref__link {
  display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--brand-1);
  text-decoration: none; border-bottom: 1.5px solid transparent;
}
.ref__link:hover, .ref__link:focus-visible { border-bottom-color: var(--brand-1); }

/* On small screens, keep the popup within the viewport edge. */
@media (max-width: 520px) {
  .ref__pop { max-width: min(300px, 86vw); }
}

/* =====================================================================
   COMPETENCY LADDER + LEVEL BADGES + EVIDENCE
   The 5-rung ladder, per-dimension level chips, and the proof/evidence UI.
   ===================================================================== */
/* Small level chip used on dashboard, pathway and the competency page.
   --lc is the dimension's accent colour, set inline per dimension. */
.level-badge {
  --lc: var(--brand-1);
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 800; font-size: 0.82rem; line-height: 1;
  padding: 6px 12px; border-radius: 999px; color: var(--lc);
  background: color-mix(in srgb, var(--lc) 14%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--lc) 45%, transparent);
}
.level-badge--none { --lc: var(--text-faint); color: var(--text-faint); }

details.learn-callout > summary { cursor: pointer; list-style: none; }
details.learn-callout > summary::-webkit-details-marker { display: none; }
details.learn-callout[open] > summary { margin-bottom: 8px; }

/* The ladder: five stacked rungs with an ascending accent. */
.ladder { display: grid; gap: 12px; }
.rung {
  display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: start;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 5px solid var(--brand-1); border-radius: var(--radius-sm); padding: 16px 18px;
}
.rung__num {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 900; font-size: 1.2rem; color: #fff; background: var(--brand-1);
}
.rung--1 { border-left-color: #8a6cf0; } .rung--1 .rung__num { background: #8a6cf0; }
.rung--2 { border-left-color: #4aa3df; } .rung--2 .rung__num { background: #4aa3df; }
.rung--3 { border-left-color: #2bb673; } .rung--3 .rung__num { background: #2bb673; }
.rung--4 { border-left-color: #f6b73c; } .rung--4 .rung__num { background: #f6b73c; }
.rung--5 { border-left-color: #e0608a; } .rung--5 .rung__num { background: #e0608a; }
.rung__name { font-weight: 800; font-size: 1.08rem; margin: 0; }
.rung__tag { color: var(--text-faint); font-size: 0.85rem; font-weight: 600; }
.rung__body { color: var(--text-soft); font-size: 0.92rem; }
.rung__body ul { margin: 8px 0 0 18px; }
.rung.is-current { box-shadow: 0 0 0 2px var(--brand-2) inset; }

/* Proof tags: clearly distinguish self-reported from verified evidence. */
.proof-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 0.74rem; font-weight: 800;
  padding: 3px 9px; border-radius: 999px; }
.proof-tag--self { color: var(--text-soft); background: var(--surface-2); border: 1px solid var(--border); }
.proof-tag--verified { color: var(--accent-green); background: color-mix(in srgb, var(--accent-green) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-green) 40%, transparent); }

/* Evidence rows in the transparency / competency views. */
.evidence-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); margin-bottom: 8px; }
.evidence-item small { color: var(--text-faint); }

/* Printable credential card. */
.cred-card { border: 2px solid var(--brand-1); border-radius: var(--radius-md, 14px);
  padding: 24px; background: linear-gradient(135deg, color-mix(in srgb, var(--brand-1) 8%, var(--surface)), var(--surface)); }
.cred-card h3 { margin: 0 0 4px; }
.cred-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.cred-row:last-child { border-bottom: 0; }

/* When printing the credential, hide everything except the card. */
@media print {
  body * { visibility: hidden; }
  #credentialPrintArea, #credentialPrintArea * { visibility: visible; }
  #credentialPrintArea { position: absolute; left: 0; top: 0; width: 100%; }
  .navbar, .footer, #nav-root, #footer-root { display: none !important; }
}

/* =====================================================================
   REMINDERS — "Upcoming reminders" list rows (scheduler reuses .modal)
   ===================================================================== */
.reminder-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); margin-bottom: 8px;
}
.reminder-item__main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.reminder-item__main svg { flex: none; color: var(--brand-1); }
.reminder-item__main strong { display: block; overflow-wrap: anywhere; }
.reminder-item__actions { display: flex; gap: 6px; flex: none; }
.reminder-item__actions .btn { padding: 6px 10px; }

/* =====================================================================
   DATA PORTABILITY — nav backup button + gentle backup reminder banner
   ===================================================================== */
/* Prominent "Backup" button in the nav actions. */
.download-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid color-mix(in srgb, var(--brand-1) 45%, var(--border));
  background: color-mix(in srgb, var(--brand-1) 10%, var(--surface));
  color: var(--brand-1); border-radius: 999px; padding: 8px 13px;
  font-weight: 700; font-size: 0.88rem; cursor: pointer; transition: all 0.2s var(--ease);
}
.download-btn:hover { background: var(--brand-1); color: #fff; }
.download-btn svg { flex: none; }
.download-btn.is-locked,
.download-btn:disabled {
  opacity: 0.42; cursor: not-allowed; filter: grayscale(0.35);
  pointer-events: auto; /* keep hover/title for “for paid subscriptions” */
}
.download-btn.is-locked:hover,
.download-btn:disabled:hover {
  background: var(--surface-2); color: var(--text-soft);
}
/* On small screens the label is hidden to save room (icon stays, aria-label covers it). */
@media (max-width: 980px) { .download-btn span { display: none; } .download-btn { padding: 8px; border-radius: 50%; } }

/* Backup reminder banner — slides in from the top, distinct from storage notice. */
.backup-banner {
  position: fixed; left: 0; right: 0; top: 0; z-index: 2600;
  background: var(--surface); border-bottom: 2px solid var(--accent-gold, #f6b73c);
  box-shadow: var(--shadow-lg); animation: slideDown 0.4s var(--ease);
}
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: none; } }
.backup-banner__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 16px;
}
.backup-banner__icon { color: var(--accent-gold, #f6b73c); flex: none; display: grid; place-items: center; }
.backup-banner p { margin: 0; font-size: 0.92rem; color: var(--text-soft); flex: 1; }
.backup-banner__actions { display: flex; gap: 8px; flex: none; flex-wrap: wrap; }
@media (max-width: 700px) {
  .backup-banner__inner { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* =====================================================================
   LIFEBOOK — holistic life-area grid, two-thread tracks, continuous thread
   ===================================================================== */
/* Life-area cards (the Bagua / 16-Practices map). */
.area-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.area-card {
  --ac: var(--brand-1);
  border: 1px solid var(--border); border-top: 4px solid var(--ac);
  border-radius: var(--radius-sm); background: var(--surface); padding: 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.area-card__head { display: flex; align-items: center; gap: 10px; }
.area-card__ic {
  width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center;
  color: var(--ac); background: color-mix(in srgb, var(--ac) 16%, transparent);
}
.area-card__bagua { font-size: 0.74rem; color: var(--text-faint); font-weight: 600; }
.area-card .field { margin: 0; }
/* Focus slider readout pill. */
.focus-readout { font-weight: 800; color: var(--ac); }

/* The two parallel threads on the dashboard. */
.thread-tracks { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.thread-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  padding: 18px; border-left: 5px solid var(--brand-1);
}
.thread-card--b { border-left-color: var(--accent-green, #2bb673); }
.thread-card h3 { margin: 0 0 2px; }
.thread-card .thread-kicker { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); }
.thread-stat { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* The continuous Lifebook thread (a vertical, typed timeline). */
/* Cap ~6 rows visible; longer threads scroll inside the card. */
.lb-thread {
  display: grid;
  gap: 0;
  max-height: calc(6 * 5.5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}
.lb-item {
  display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.lb-item:last-child { border-bottom: 0; }
.lb-item__ic {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  color: #fff; background: var(--brand-gradient);
}
.lb-item__body { min-width: 0; }
.lb-item__title { font-weight: 700; overflow-wrap: anywhere; }
.lb-item__detail { color: var(--text-soft); white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.lb-item__meta { font-size: 0.78rem; color: var(--text-faint); margin-top: 4px; }
.lb-type { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--text-soft); }

/* =====================================================================
   PAGE CONNECTIONS — breadcrumbs, journey strip and related-page cards
   Injected by app.js on every page so no page is a dead end.
   ===================================================================== */

/* Breadcrumb bar sits directly under the navbar on all non-home pages. */
.crumbs { background: var(--surface-2); border-bottom: 1px solid var(--border); }
.crumbs__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 9px 24px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--text-faint);
}
.crumbs a { color: var(--text-soft); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--brand-1); text-decoration: underline; }
.crumbs__sep { opacity: 0.6; }
.crumbs [aria-current="page"] { color: var(--text); font-weight: 700; }

/* The journey strip makes the product's sequence explicit and clickable. */
.journey {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; align-items: stretch;
}
.journey__step {
  position: relative; display: flex; flex-direction: column; gap: 3px;
  padding: 14px 16px; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); transition: all 0.18s var(--ease);
}
.journey__step:hover { border-color: var(--brand-1); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.journey__step.is-current { border-color: var(--brand-1); box-shadow: 0 0 0 1px var(--brand-1) inset; }
.journey__n {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--brand-2);
}
[data-theme="dark"] .journey__n { color: #c9b8ff; }
.journey__name { font-weight: 700; font-size: 0.97rem; }
.journey__desc { font-size: 0.82rem; color: var(--text-soft); }

/* "Where to next" cards, appended above the footer on every page. */
.related { border-top: 1px solid var(--border); padding: 34px 0 6px; }
.related__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.related__head h2 { font-size: 1.3rem; }
.related__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.related__card {
  display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start;
  padding: 16px 18px; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); transition: all 0.18s var(--ease);
}
.related__card:hover { border-color: var(--brand-1); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.related__ic {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  color: var(--brand-2); background: color-mix(in srgb, var(--brand-1) 12%, transparent);
}
[data-theme="dark"] .related__ic { color: #c9b8ff; }
.related__card strong { display: block; font-size: 0.98rem; }
.related__card small { display: block; color: var(--text-soft); font-size: 0.84rem; line-height: 1.4; margin-top: 2px; }

/* Inline "jump to" link row, used inside dense sections. */
.link-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.link-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: 999px; text-decoration: none;
  font-size: 0.88rem; font-weight: 700; color: var(--brand-2);
  background: color-mix(in srgb, var(--brand-1) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand-1) 28%, transparent);
  transition: all 0.16s var(--ease);
}
.link-chip:hover { background: var(--brand-1); color: #fff; border-color: var(--brand-1); }
[data-theme="dark"] .link-chip { color: #c9b8ff; }
[data-theme="dark"] .link-chip:hover { color: #fff; }

/* Footer gains a fourth column now that more destinations are linked. */
.footer__grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
@media (max-width: 980px) { .footer__grid { grid-template-columns: 1fr 1fr; gap: 24px; } }
@media (max-width: 560px) { .footer__grid { grid-template-columns: 1fr; gap: 22px; } }

/* ----- Import Career wizard (competency.html) --------------------- */
.career-import-cta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  margin: 0 0 18px; padding: 14px 16px;
  background: color-mix(in srgb, var(--brand-1) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand-1) 30%, var(--border));
  border-radius: var(--radius);
}
.career-import-cta__copy { flex: 1; min-width: 200px; }
.career-import-cta__copy p { margin: 4px 0 0; font-size: .88rem; color: var(--text-soft); }
.career-import-modal { max-width: 720px; }
.career-import-steps {
  display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px;
}
.career-import-steps li {
  font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border);
}
.career-import-steps li.is-active {
  background: color-mix(in srgb, var(--brand-1) 16%, var(--surface));
  color: var(--brand-2); border-color: color-mix(in srgb, var(--brand-1) 40%, var(--border));
}
.career-import-steps li.is-done { opacity: .7; }
.career-import-proofs { display: flex; flex-direction: column; gap: 10px; max-height: 42vh; overflow-y: auto; }
.career-import-proof {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start;
  padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.career-import-proof__check { font-size: .78rem; font-weight: 700; padding-top: 6px; }
.career-import-proof__fields { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 560px) {
  .career-import-proof { grid-template-columns: 1fr; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ----- Articles & Discussion -------------------------------------- */
.hero--compact { min-height: auto; padding: 48px 0 32px; }
.hero--compact .hero__inner { padding-bottom: 0; }
.container--reading { max-width: 720px; }
.article-breadcrumb { font-size: .88rem; margin-bottom: 1rem; }
.article-breadcrumb a { color: var(--brand-1); text-decoration: none; }
.article-header h1 { margin-top: .5rem; }
.prose h2 { margin-top: 2rem; margin-bottom: .75rem; font-size: 1.25rem; }
.prose p, .prose li { line-height: 1.7; color: var(--text); }
.prose ul { margin: .75rem 0 1rem 1.25rem; }
.prose hr { margin: 2rem 0; border: none; border-top: 1px solid var(--border); }
.article-sources { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.article-sources ul { margin-left: 1.25rem; }
.article-card { display: block; text-decoration: none; color: inherit; transition: box-shadow .2s; }
.article-card:hover { box-shadow: var(--shadow-md); }
.comment-thread { display: flex; flex-direction: column; gap: 12px; }
.comment-card {
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.comment-card__meta { font-size: .88rem; margin-bottom: .5rem; }
.comment-card__body { white-space: pre-wrap; line-height: 1.6; }
.great-knock-dialogue {
  margin: 12px 0; padding: 12px; border-left: 3px solid var(--brand-1);
  background: color-mix(in srgb, var(--brand-1) 6%, var(--surface));
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.great-knock-dialogue__mod p, .great-knock-dialogue__you p { margin: .35rem 0 0; }
.great-knock-dialogue__you { margin-top: 10px; opacity: .95; }
.comment-compose h3 { margin-top: 0; }

/* =====================================================================
   READING STORE (in-app + maggie-pro.store catalog)
   ===================================================================== */
.book-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.book-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--dim-color, var(--brand-1));
  border-radius: var(--radius-sm); padding: 18px 18px 16px;
  display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow .18s, transform .18s;
}
.book-card:hover, .book-card:focus-within { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.book-card__title { margin: 0; font-size: 1.02rem; font-weight: 800; line-height: 1.3; cursor: help; }
.book-card__author { margin: 4px 0 0; font-size: .88rem; color: var(--text-faint); }
.book-card__why { font-size: .86rem; color: var(--text-soft); margin: 0; }
.dim-label { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--dim-color, var(--brand-1)); }
.level-pill {
  flex-shrink: 0; font-size: .68rem; font-weight: 800; padding: 4px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--dim-color, var(--brand-1)) 12%, transparent);
  color: var(--dim-color, var(--brand-1));
  border: 1px solid color-mix(in srgb, var(--dim-color, var(--brand-1)) 35%, transparent);
}
.store-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.dim-chip {
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text-soft);
  font: inherit; font-weight: 700; font-size: .82rem; padding: 8px 14px; border-radius: 999px; cursor: pointer;
}
.dim-chip.is-active {
  background: color-mix(in srgb, var(--chip-color, var(--brand-1)) 16%, transparent);
  border-color: var(--chip-color, var(--brand-1)); color: var(--chip-color, var(--brand-1));
}
.learn-fly { position: relative; display: inline; }
.learn-fly__tip {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 80;
  width: min(320px, 86vw); background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--dim-color, var(--brand-2)); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); padding: 14px 16px; font-size: .84rem; line-height: 1.5;
  pointer-events: none; opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity .15s, transform .15s, visibility .15s;
}
.learn-fly__tip::before {
  content: "What you will learn"; display: block; font-weight: 800; font-size: .72rem;
  letter-spacing: .04em; text-transform: uppercase; color: var(--dim-color, var(--brand-2)); margin-bottom: 8px;
}
.learn-fly__tip ul { margin: 0; padding-left: 18px; }
.book-card:hover .learn-fly__tip, .learn-fly.is-open .learn-fly__tip {
  opacity: 1; visibility: visible; transform: translateY(0);
}
