/* ============================================================================
   DNA of a Leader — Unified Demo
   Cathedral design system (cool charcoal · one copper accent · no green).
   Self-contained: all tokens defined here so the demo needs no other sheet.
   Mobile-first app column; frames as a device on wider screens.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Surfaces (Chief of Staff — near-black command-center) */
  --bg:         #0a0a0e;
  --bg-deep:    #07070a;
  --surface:    #1a1a24;
  --surface-2:  #22222e;
  --surface-3:  #2a2a36;

  /* Text (white-alpha, per chief) */
  --cream:        rgba(255, 255, 255, 0.88);
  --cream-bright: #ffffff;
  --muted:        rgba(255, 255, 255, 0.55);
  --muted-2:      rgba(255, 255, 255, 0.38);
  --muted-3:      rgba(255, 255, 255, 0.30);

  /* Gold — the single accent (kept under the old names) */
  --copper:       #C8A96E;
  --copper-soft:  #d4b87a;
  --copper-deep:  #8a6d3b;
  --copper-ink:   #0a0a0e;

  /* Lines & fills */
  --line:        rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --fill-soft:   rgba(255, 255, 255, 0.04);
  --copper-tint: rgba(200, 169, 110, 0.14);
  --copper-tint-2: rgba(200, 169, 110, 0.22);

  /* Status colors — the CoS dot language */
  --status-done:     #27ae60;
  --status-done-ink: #2ecc71;
  --status-done-bg:  rgba(39, 174, 96, 0.16);

  /* Fonts */
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans:  "Inter", ui-sans-serif, -apple-system, system-ui, sans-serif;
  --mono:  "Inter", ui-sans-serif, -apple-system, system-ui, sans-serif;

  /* Chief radii (soft, not sharp) */
  --radius-xs:  6px;
  --radius:     8px;
  --radius-lg:  12px;
  --radius-pill: 999px;

  /* Spacing */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;

  /* Elevation */
  --shadow-sm: 0 2px 10px rgba(0,0,0,.45);
  --shadow-md: 0 14px 40px rgba(0,0,0,.55);
  --shadow-lg: 0 26px 60px rgba(0,0,0,.6);
  --glow: 0 0 0 1px rgba(200,169,110,.35), 0 12px 40px rgba(200,169,110,.10);
  --focus-ring: 0 0 0 3px rgba(200,169,110,.30);

  --ease: cubic-bezier(.2,.7,.2,1);
  --t: 180ms var(--ease);

  /* legacy names used by the ported video-library card styles */
  --ink: var(--cream); --gold: var(--copper); --gold-deep: var(--copper-deep);
  --gold-soft: var(--copper-soft); --c-copper-ink: var(--copper-ink);
  --c-copper: var(--copper); --c-cream-bright: var(--cream-bright);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(circle at 12% 8%, rgba(200,169,110,.05), transparent 34%),
    radial-gradient(circle at 90% 92%, rgba(200,169,110,.04), transparent 32%),
    var(--bg-deep);
  color: var(--cream);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

::selection { background: var(--copper); color: var(--copper-ink); }
h1,h2,h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; }

/* ============================================================================
   Device frame — the app is a phone column; on desktop it sits in a frame
   ========================================================================== */
.app {
  position: relative;
  width: 100%;
  max-width: 448px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 720px) {
  body { display: grid; place-items: center; padding: 28px 16px; }
  .app {
    min-height: 0;
    height: min(920px, calc(100vh - 56px));
    border-radius: 30px;
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--line);
    border: 1px solid var(--line-strong);
  }
}

/* ---- Top bar ---- */
.topbar {
  flex: none;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(10,10,14,.86);
  backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; cursor: pointer; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 10px; background: var(--copper); color: var(--copper-ink);
  font-family: var(--serif); font-weight: 600; font-size: 1.1rem;
  box-shadow: var(--shadow-sm);
}
.brand-name { display: block; line-height: 1; }
.brand-name strong {
  display: block; font-family: var(--serif); font-weight: 500;
  font-size: 1.06rem; letter-spacing: .06em; color: var(--cream-bright);
}
.brand-name small {
  display: block; margin-top: 3px; font-size: .5rem; font-weight: 700;
  letter-spacing: .34em; color: var(--muted-2); text-transform: uppercase;
}

/* language toggle */
.lang {
  display: inline-flex; gap: 2px; padding: 3px;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: var(--fill-soft);
}
.lang button {
  appearance: none; border: 0; cursor: pointer; background: none;
  padding: 6px 11px; border-radius: var(--radius-pill);
  font-family: var(--sans); font-size: .74rem; font-weight: 700;
  letter-spacing: .02em; color: var(--muted); transition: var(--t);
}
.lang button.on { background: var(--copper); color: var(--copper-ink); }

/* ---- Scrollable screen area ---- */
.stage {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.stage::-webkit-scrollbar { width: 0; height: 0; }

.screen { display: none; animation: fade .32s var(--ease); }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.pad { padding: 22px 20px 30px; }
.pad-b { padding-bottom: 30px; }

/* ---- Bottom tab nav ---- */
.tabbar {
  flex: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
  background: #05050a;
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-strong);
  box-shadow: 0 -8px 24px rgba(0,0,0,.35);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  position: relative; z-index: 20;
}
.tab {
  appearance: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px 7px; border-radius: 12px;
  background: var(--fill-soft); border: 1px solid var(--line);
  color: var(--muted); font-family: var(--sans);
  font-size: .6rem; font-weight: 700; letter-spacing: .02em;
  transition: color var(--t), background var(--t), border-color var(--t);
}
.tab:hover { background: var(--copper-tint); color: var(--cream); }
.tab:active { transform: translateY(1px); }
.tab svg { width: 22px; height: 22px; stroke-width: 1.7; }
.tab.on { color: var(--copper); background: var(--copper-tint); border-color: var(--copper-tint-2); }
.tab.on svg { stroke-width: 2; }

/* ============================================================================
   Typography helpers
   ========================================================================== */
.eyebrow {
  font-family: var(--mono); font-size: .68rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--copper);
  margin: 0 0 10px;
}
.display {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.9rem, 8vw, 2.5rem); line-height: 1.05;
  letter-spacing: -.02em; color: var(--cream-bright); margin: 0 0 12px;
}
.lead { color: var(--muted); font-size: 1rem; line-height: 1.6; margin: 0 0 8px; }
.section-title { font-size: 1.35rem; color: var(--cream-bright); margin: 0 0 4px; }
.section-sub { color: var(--muted-2); font-size: .9rem; line-height: 1.55; margin: 0 0 16px; }
.muted { color: var(--muted); }
.serif-quote { font-family: var(--serif); font-style: italic; color: var(--cream); line-height: 1.5; }

.scripture {
  font-family: var(--serif); font-style: italic; font-size: 1.02rem;
  line-height: 1.55; color: var(--copper-soft);
}

/* ============================================================================
   Buttons
   ========================================================================== */
.btn {
  appearance: none; cursor: pointer; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 54px; padding: 0 22px; width: 100%;
  border-radius: var(--radius); font-family: var(--sans);
  font-size: 1rem; font-weight: 700; letter-spacing: .01em;
  transition: transform var(--t), background var(--t), box-shadow var(--t);
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn-primary { background: var(--copper); color: var(--copper-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--copper-soft); }
.btn-ghost { background: var(--fill-soft); color: var(--cream); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--copper-deep); color: var(--cream-bright); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn-sm { min-height: 44px; font-size: .9rem; width: auto; }
.link-btn {
  appearance: none; background: none; border: 0; cursor: pointer;
  color: var(--copper); font-family: var(--sans); font-weight: 700;
  font-size: .9rem; padding: 4px 0;
}
.link-btn:hover { color: var(--copper-soft); }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { width: auto; flex: 1; }

/* ============================================================================
   Cards & surfaces
   ========================================================================== */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px;
}
.card + .card { margin-top: 12px; }
.card-inset { background: var(--surface-2); border-radius: var(--radius); padding: 14px; }

.hero {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  min-height: 240px; display: flex; align-items: flex-end;
  background-size: cover; background-position: center;
  margin-bottom: 18px;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,7,10,.15), rgba(7,7,10,.55) 55%, rgba(7,7,10,.94));
}
.hero-copy { position: relative; z-index: 2; padding: 20px; }
.hero-copy .display { margin-bottom: 8px; }

.eyebrow-line { display: inline-flex; align-items: center; gap: 8px; }
.eyebrow-line::before { content: ""; width: 16px; height: 1px; background: var(--copper-deep); }

/* pill row / chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  appearance: none; cursor: pointer;
  padding: 9px 14px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--muted); font-family: var(--sans); font-size: .84rem; font-weight: 700;
  transition: var(--t);
}
.chip:hover { color: var(--cream); border-color: var(--line-strong); }
.chip.on { background: var(--copper); color: var(--copper-ink); border-color: var(--copper); }
.chip .n { font-family: var(--mono); font-size: .72rem; opacity: .7; margin-left: 6px; }

/* index badge (mono number) */
.index {
  flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--bg-deep); border: 1px solid var(--line-strong);
  color: var(--copper); font-family: var(--mono); font-size: .82rem; font-weight: 700;
}

/* progress bar */
.bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--copper); border-radius: 999px; transition: width .6s var(--ease); }

/* base health meter */
.meter { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: var(--copper); }

/* divider */
.rule { height: 1px; background: var(--line); border: 0; margin: 20px 0; }

/* toast */
.toast {
  position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px);
  background: var(--surface-3); color: var(--cream-bright);
  border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
  padding: 11px 20px; font-size: .86rem; font-weight: 600;
  box-shadow: var(--shadow-md); opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease); z-index: 40;
  max-width: 88%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* back link */
.back {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  background: none; border: 0; color: var(--muted); font-family: var(--sans);
  font-size: .86rem; font-weight: 600; padding: 2px 0; margin-bottom: 14px;
}
.back:hover { color: var(--cream); }
.back svg { width: 18px; height: 18px; }

/* ============================================================================
   HOME
   ========================================================================== */
.home-greeting { font-size: .82rem; color: var(--muted-2); font-family: var(--mono); letter-spacing: .04em; margin: 0 0 4px; }
.tagline {
  font-family: var(--serif); font-style: italic; color: var(--copper-soft);
  font-size: .96rem; margin: 0;
}
.tool-list { display: grid; gap: 12px; margin-top: 6px; }
.tool {
  appearance: none; text-align: left; cursor: pointer; width: 100%;
  display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 16px; color: inherit;
  transition: var(--t);
}
.tool:hover { border-color: var(--copper-deep); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.tool-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--copper-tint); color: var(--copper); }
.tool-ico svg { width: 24px; height: 24px; stroke-width: 1.8; }
.tool-txt strong { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.15rem; color: var(--cream-bright); }
.tool-txt span { display: block; font-size: .85rem; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.tool-arrow { color: var(--muted-2); }
.tool .status-tag {
  font-family: var(--mono); font-size: .58rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--copper); background: var(--copper-tint);
  padding: 3px 8px; border-radius: 999px; margin-top: 6px; display: inline-block;
}

/* ============================================================================
   ASSESSMENT
   ========================================================================== */
.progress-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.progress-head .count { font-family: var(--mono); font-size: .72rem; color: var(--muted-2); letter-spacing: .06em; }
.progress-head .pct { font-family: var(--mono); font-size: .82rem; color: var(--copper); font-weight: 700; }

.q-base { color: var(--copper); }
.q-text { font-family: var(--serif); font-size: 1.5rem; line-height: 1.28; color: var(--cream-bright); margin: 6px 0 8px; }
.q-help { color: var(--muted); font-size: .9rem; line-height: 1.5; margin: 0 0 20px; }

.options { display: grid; gap: 10px; }
.option {
  appearance: none; cursor: pointer; text-align: left; width: 100%;
  display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 13px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; color: var(--cream);
  font-family: var(--sans); font-size: 1rem; line-height: 1.35; transition: var(--t);
}
.option:hover { border-color: var(--line-strong); background: var(--surface-2); }
.option .dot {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong);
  display: grid; place-items: center; flex: none;
}
.option .dot::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: transparent; transition: var(--t); }
.option.sel { border-color: var(--copper); background: var(--copper-tint); }
.option.sel .dot { border-color: var(--copper); }
.option.sel .dot::after { background: var(--copper); }

/* ============================================================================
   RESULTS (results-first, tap-to-expand bases)
   ========================================================================== */
.result-hero { text-align: left; margin-bottom: 20px; }
.base-list { display: grid; gap: 10px; }
.base-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; transition: var(--t); }
.base-item.open { border-color: var(--copper-deep); box-shadow: var(--shadow-sm); }
.base-btn {
  appearance: none; cursor: pointer; width: 100%; text-align: left; color: inherit;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px;
  background: none; border: 0; padding: 16px; font-family: var(--sans);
}
.base-btn:hover { background: var(--surface-2); }
.base-name { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.2rem; color: var(--cream-bright); }
.base-kind { display: block; font-family: var(--mono); font-size: .58rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); margin-top: 3px; }
.base-score { display: flex; align-items: center; gap: 10px; }
.base-score .val { font-family: var(--mono); font-weight: 700; font-size: .82rem; color: var(--copper); text-align: right; white-space: nowrap; }
.base-meter { width: 56px; flex: none; }
.base-chev { color: var(--muted-2); transition: transform .2s var(--ease); }
.base-item.open .base-chev { transform: rotate(180deg); color: var(--copper); }
.base-body { display: none; padding: 0 16px 18px; border-top: 1px solid var(--line); }
.base-item.open .base-body { display: block; }
.base-body p { color: var(--muted); font-size: .94rem; line-height: 1.6; margin: 14px 0 0; }
.base-body .label { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--copper); margin-top: 16px; }

.health-summary { display: flex; gap: 10px; margin-bottom: 18px; }
.health-summary .hs {
  flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px;
}
.health-summary .hs .k { font-family: var(--mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.health-summary .hs .v { font-family: var(--serif); font-size: 1.15rem; color: var(--cream-bright); margin-top: 4px; }

/* ============================================================================
   PATHWAY
   ========================================================================== */
.tracks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.track { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.track .tl { font-size: .74rem; color: var(--muted-2); letter-spacing: .04em; }
.track .tv { font-family: var(--serif); font-size: 1.5rem; color: var(--cream-bright); margin: 4px 0 8px; }
.track.wide { grid-column: 1 / -1; }
.focus-card { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--copper); border-radius: var(--radius); padding: 16px; }
.focus-card + .focus-card { margin-top: 10px; }
.focus-card .fh { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.focus-card h4 { font-family: var(--serif); font-weight: 500; font-size: 1.15rem; margin: 0; color: var(--cream-bright); }
.focus-card .base-tag { font-family: var(--mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--copper); }
.focus-card p { color: var(--muted); font-size: .9rem; line-height: 1.55; margin: 8px 0 0; }
.ground-item { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ground-item .flag { color: var(--copper); }
.ground-item strong { color: var(--cream); font-weight: 600; font-size: .95rem; }
.ground-item span { color: var(--muted-2); font-size: .82rem; }
.moment { background: var(--copper-tint); border: 1px solid var(--copper-deep); border-radius: var(--radius); padding: 16px; margin-top: 14px; }
.moment .mq { font-family: var(--serif); font-style: italic; color: var(--cream); line-height: 1.5; margin: 8px 0; }
.moment .mn { color: var(--muted); font-size: .86rem; line-height: 1.5; }

/* ============================================================================
   STEWARDSHIP MAP
   ========================================================================== */
.day-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.day-head .dow { font-family: var(--mono); font-size: .72rem; color: var(--copper); letter-spacing: .1em; text-transform: uppercase; }
.station { position: relative; padding-left: 26px; }
.station::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: -6px; width: 2px; background: var(--line); }
.station:last-child::before { display: none; }
.station-dot { position: absolute; left: 2px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--copper-deep); }
.station.done .station-dot { background: var(--status-done); border-color: var(--status-done); }
.station-base { font-family: var(--mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--copper); }
.task {
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin: 8px 0 16px; cursor: pointer; transition: var(--t);
}
.task:hover { border-color: var(--line-strong); }
.task .check {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line-strong);
  display: grid; place-items: center; flex: none; transition: var(--t);
}
.task .check svg { width: 16px; height: 16px; opacity: 0; transition: var(--t); color: #fff; }
.task.done .check { background: var(--status-done); border-color: var(--status-done); }
.task.done .check svg { opacity: 1; }
.task .tt { display: block; font-weight: 600; color: var(--cream); font-size: .96rem; line-height: 1.35; }
.task .tm { display: block; font-size: .82rem; color: var(--muted-2); margin-top: 3px; line-height: 1.4; }
.task.done .tt { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--muted-3); }
/* Prayerful refine checks: affirm, never strike through */
.task.refine-check.done .tt { color: var(--cream-bright); text-decoration: none; }
.task.refine-check.done { border-color: var(--copper-deep); background: var(--copper-tint); }
.phys { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.phys .pill-stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-align: center; }
.phys .pill-stat .v { font-family: var(--serif); font-size: 1.3rem; color: var(--copper-soft); }
.phys .pill-stat .k { font-size: .68rem; color: var(--muted-2); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }

/* morning email card */
.email {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
}
.email-head { background: var(--bg-deep); padding: 14px 16px; border-bottom: 1px solid var(--line); }
.email-head .from { font-size: .8rem; color: var(--muted); }
.email-head .subj { font-family: var(--serif); font-size: 1.1rem; color: var(--cream-bright); margin-top: 2px; }
.email-body { padding: 16px; }
.email-body p { color: var(--muted); font-size: .92rem; line-height: 1.6; margin: 0 0 12px; }

/* ============================================================================
   MISSION BUILDER
   ========================================================================== */
.stepper { display: flex; gap: 6px; margin-bottom: 18px; }
.stepper .sd { flex: 1; height: 4px; border-radius: 999px; background: var(--surface-3); }
.stepper .sd.on { background: var(--copper); }
.field-label { display: block; font-weight: 700; color: var(--cream); margin: 0 0 6px; font-size: 1rem; }
.field-help { color: var(--muted-2); font-size: .86rem; line-height: 1.5; margin: 0 0 12px; }
textarea.field, input.field {
  width: 100%; background: var(--fill-soft); border: 1px solid var(--line-strong);
  border-radius: var(--radius); color: var(--cream); font-family: var(--sans);
  font-size: 1rem; line-height: 1.5; padding: 14px; resize: vertical; transition: var(--t);
}
textarea.field { min-height: 110px; }
textarea.field:focus, input.field:focus { outline: none; border-color: var(--copper-deep); box-shadow: var(--focus-ring); }
textarea.field::placeholder, input.field::placeholder { color: var(--muted-3); }
.suggest { margin-top: 10px; }
.suggest .s-label { font-family: var(--mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 8px; }
.suggest button {
  appearance: none; cursor: pointer; text-align: left; width: 100%;
  background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--radius);
  color: var(--muted); font-family: var(--serif); font-style: italic; font-size: .94rem; line-height: 1.45;
  padding: 12px 14px; margin-bottom: 8px; transition: var(--t);
}
.suggest button:hover { color: var(--cream); border-color: var(--copper-deep); }
.mission-result {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--copper-deep); border-radius: var(--radius-lg); padding: 22px; text-align: center;
}
.mission-result .mr-label { font-family: var(--mono); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--copper); }
.mission-result .mr-text { font-family: var(--serif); font-size: 1.3rem; line-height: 1.4; color: var(--cream-bright); margin: 14px 0; }

/* ============================================================================
   AI COACH (chat)
   ========================================================================== */
.chat { display: flex; flex-direction: column; gap: 14px; padding: 4px 0 10px; }
.msg { max-width: 86%; padding: 13px 16px; border-radius: 18px; font-size: .95rem; line-height: 1.55; }
.msg.coach { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; color: var(--cream); white-space: pre-wrap; }
.msg.coach strong { color: var(--copper-soft); font-weight: 700; }
.msg.me { align-self: flex-end; background: var(--copper); color: var(--copper-ink); border-bottom-right-radius: 6px; font-weight: 500; }
.msg.coach .scripture { margin-top: 8px; display: block; }
.coach-ava { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.coach-ava .a { width: 34px; height: 34px; border-radius: 50%; background: var(--copper-tint); color: var(--copper); display: grid; place-items: center; font-family: var(--serif); }
.coach-ava .nm strong { display: block; font-family: var(--serif); color: var(--cream-bright); font-size: 1rem; }
.coach-ava .nm span { font-size: .74rem; color: var(--muted-2); }
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); animation: blink 1.2s infinite; }
.typing i:nth-child(2){ animation-delay: .2s; } .typing i:nth-child(3){ animation-delay: .4s; }
@keyframes blink { 0%,60%,100%{ opacity:.25; transform: translateY(0);} 30%{ opacity:1; transform: translateY(-3px);} }
.prompt-chips { display: grid; gap: 8px; margin-top: 4px; }
.prompt-chips button {
  appearance: none; cursor: pointer; text-align: left; width: 100%;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
  color: var(--cream); font-family: var(--sans); font-size: .9rem; font-weight: 500;
  padding: 12px 16px; transition: var(--t);
}
.prompt-chips button:hover { border-color: var(--copper); color: var(--cream-bright); }
.coach-note { text-align: center; color: var(--muted-3); font-size: .74rem; margin-top: 14px; line-height: 1.5; }
.coach-inputrow { display: flex; gap: 8px; margin-top: 14px; }
.coach-inputrow .field { flex: 1; min-width: 0; border-radius: var(--radius-pill); padding: 12px 18px; }
.coach-inputrow .btn { flex: none; width: 50px; min-height: 50px; padding: 0; border-radius: 50%; }
#coachStatus { margin-top: 8px; }

/* --- Voice (car-friendly) --- */
.mic-btn {
  appearance: none; cursor: pointer; flex: none;
  width: 50px; min-height: 50px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--fill-soft); border: 1px solid var(--line-strong);
  color: var(--copper); transition: var(--t);
}
.mic-btn:hover { border-color: var(--copper-deep); }
.mic-btn.listening {
  background: var(--copper); color: var(--copper-ink); border-color: var(--copper);
  animation: micpulse 1.2s ease-in-out infinite;
}
@keyframes micpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 169, 110, .45); }
  50% { box-shadow: 0 0 0 12px rgba(200, 169, 110, 0); }
}
.dictate-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.dictate-row .mic-btn { width: 44px; min-height: 44px; }
.dictate-hint { color: var(--muted-3); font-size: .8rem; }
.speak-btn {
  appearance: none; cursor: pointer;
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--fill-soft); border: 1px solid var(--line);
  color: var(--muted); transition: var(--t); flex: none;
}
.speak-btn:hover { color: var(--copper); border-color: var(--copper-deep); }
#coachStatus .live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--copper); margin-right: 5px; vertical-align: 1px; }

/* ============================================================================
   VIDEO LIBRARY (ported vl-* styles, retuned to the app column)
   ========================================================================== */
.vl-toolbar { margin: 2px 0 14px; }
.vl-search {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px;
  background: var(--bg-deep); border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
  transition: var(--t);
}
.vl-search:focus-within { border-color: var(--copper-deep); box-shadow: var(--focus-ring); }
.vl-search svg { color: var(--muted-2); flex: none; width: 18px; height: 18px; }
.vl-search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--cream); font-family: var(--sans); font-size: 1rem; }
.vl-search input::placeholder { color: var(--muted-2); }
.vl-count { margin: 10px 0 0; font-family: var(--mono); font-size: .74rem; letter-spacing: .04em; color: var(--muted-2); }
.vl-filters { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; padding: 14px 0 16px; margin-bottom: 8px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.vl-filters::-webkit-scrollbar { display: none; }
.vl-pill { flex: none; }
.vl-section { margin-bottom: 30px; scroll-margin-top: 12px; }
.vl-section-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.vl-section-head h2 { font-size: 1.4rem; margin: 0; color: var(--cream-bright); }
.vl-section-head .n { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--copper); }
.vl-grid { display: grid; gap: 12px; }
.vl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; transition: var(--t); }
.vl-card.open { border-color: var(--copper-deep); box-shadow: var(--shadow-sm); }
.vl-card-btn { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; width: 100%; text-align: left; cursor: pointer; padding: 16px; background: none; border: 0; color: inherit; font-family: var(--sans); }
.vl-card:not(.open) .vl-card-btn:hover { background: var(--surface-2); }
.vl-index { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-deep); border: 1px solid var(--line-strong); color: var(--copper); font-family: var(--mono); font-size: .8rem; font-weight: 700; }
.vl-card-meta { min-width: 0; }
.vl-card-title { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.1rem; line-height: 1.2; color: var(--cream-bright); margin: 0 0 3px; }
.vl-card-speaker { display: block; font-size: .82rem; color: var(--muted); }
.vl-card-speaker .note { color: var(--muted-2); font-style: italic; }
.vl-chevron { flex: none; color: var(--muted-2); transition: transform .2s var(--ease); }
.vl-card.open .vl-chevron { transform: rotate(180deg); color: var(--copper); }
.vl-body { display: none; padding: 2px 16px 20px; border-top: 1px solid var(--line); }
.vl-card.open .vl-body { display: block; }
.vl-body-inner { padding-top: 14px; }
.vl-player { position: relative; aspect-ratio: 16 / 9; width: 100%; margin: 0 0 16px; border-radius: var(--radius); overflow: hidden; background: var(--bg-deep); border: 1px solid var(--line); }
.vl-player iframe, .vl-player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vl-qgroup + .vl-qgroup { margin-top: 16px; }
.vl-qlabel { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; font-family: var(--mono); font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--copper); }
.vl-qlabel::before { content: ""; width: 14px; height: 1px; background: var(--copper-deep); }
.vl-qlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: q; }
.vl-qlist li { counter-increment: q; display: grid; grid-template-columns: auto 1fr; gap: 10px; font-size: .92rem; line-height: 1.55; color: var(--cream); }
.vl-qlist li::before { content: counter(q, decimal-leading-zero); font-family: var(--mono); font-size: .72rem; color: var(--muted-2); padding-top: 3px; }
.vl-apply .vl-qlist li { color: var(--muted); }
.vl-empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ============================================================================
   CLASS — lessons, player placeholder, notes
   ========================================================================== */
.lesson-row {
  appearance: none; cursor: pointer; width: 100%; text-align: left; color: inherit;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 10px;
  font-family: var(--sans); transition: var(--t);
}
.lesson-row:hover { border-color: var(--copper-deep); }
.lesson-row.done { border-color: rgba(39, 174, 96, .35); }
.lesson-meta { min-width: 0; }
.lesson-title { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.06rem; line-height: 1.25; color: var(--cream-bright); }
.lesson-sub { display: block; font-size: .78rem; color: var(--muted-2); margin-top: 3px; }
.unlock-chip {
  display: inline-block; margin-top: 7px; padding: 3px 9px; border-radius: 999px;
  font-size: .64rem; font-weight: 700; letter-spacing: .04em;
  background: var(--fill-soft); border: 1px solid var(--line); color: var(--muted-2);
}
.unlock-chip.open { background: var(--status-done-bg); border-color: rgba(39,174,96,.4); color: var(--status-done-ink); }
.lesson-player {
  aspect-ratio: 16 / 9; width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: var(--bg-deep); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
  color: var(--muted-2); font-size: .84rem;
}
.lesson-player svg { color: var(--copper); opacity: .9; }
.note-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.note-stamp { font-size: .68rem; color: var(--copper); font-weight: 700; letter-spacing: .04em; }
.note-text { color: var(--cream); font-size: .92rem; line-height: 1.5; }

/* utility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
[hidden] { display: none !important; }
.center { text-align: center; }
.mt-s { margin-top: 12px; } .mt-m { margin-top: 20px; } .mt-l { margin-top: 32px; }
.stack > * + * { margin-top: 12px; }

/* ============================================================================
   LIGHT MODE — "cathedral in daylight"
   Warm ivory paper · white cards · deep antique-gold accent.
   Everything is token-driven, so overriding :root tokens re-skins the whole app.
   Toggle sets <html data-theme="light">. Removable by deleting this block +
   the small theme script in index.html.
   ========================================================================== */
html[data-theme="light"] {
  color-scheme: light;

  /* Surfaces — deeper warm ivory page so white cards lift off it */
  --bg:         #EBE3D1;
  --bg-deep:    #E0D6C0;
  --surface:    #ffffff;
  --surface-2:  #FAF6ED;
  --surface-3:  #F1E9D9;

  /* Text — warm charcoal, not pure black */
  --cream:        rgba(38, 33, 24, 0.90);
  --cream-bright: #1c1810;
  --muted:        rgba(38, 33, 24, 0.56);
  --muted-2:      rgba(38, 33, 24, 0.40);
  --muted-3:      rgba(38, 33, 24, 0.30);

  /* Gold — deepened so it reads as text on white AND fills buttons with light ink */
  --copper:       #8a6d3b;
  --copper-soft:  #a6822f;
  --copper-deep:  #6e5530;
  --copper-ink:   #ffffff;

  /* Lines & fills — warmer, a touch stronger for definition */
  --line:          rgba(60, 48, 24, 0.16);
  --line-strong:   rgba(60, 48, 24, 0.26);
  --fill-soft:     rgba(60, 48, 24, 0.05);
  --copper-tint:   rgba(138, 109, 59, 0.14);
  --copper-tint-2: rgba(138, 109, 59, 0.24);

  /* Elevation with enough depth that cards read as distinct objects */
  --shadow-sm: 0 2px 12px rgba(40, 30, 12, 0.13);
  --shadow-md: 0 16px 42px rgba(40, 30, 12, 0.17);
  --shadow-lg: 0 24px 58px rgba(40, 30, 12, 0.20);
  --glow: 0 0 0 1px rgba(138, 109, 59, 0.30), 0 12px 40px rgba(138, 109, 59, 0.08);
  --focus-ring: 0 0 0 3px rgba(138, 109, 59, 0.28);
}
/* Body wash: warmer paper with a little more presence than flat ivory */
html[data-theme="light"] body {
  background:
    radial-gradient(circle at 12% 8%, rgba(138, 109, 59, 0.09), transparent 38%),
    radial-gradient(circle at 90% 92%, rgba(138, 109, 59, 0.07), transparent 34%),
    var(--bg-deep);
}
/* The two hard-coded dark bars → paper, with a warm gold hairline to frame them */
html[data-theme="light"] .topbar { background: rgba(255, 255, 255, 0.86); border-bottom: 1px solid rgba(138, 109, 59, 0.22); }
html[data-theme="light"] .tabbar { background: #ffffff; border-top: 1px solid rgba(138, 109, 59, 0.20); box-shadow: 0 -8px 24px rgba(40, 30, 12, 0.12); }
/* Distinguishing marks: cards lift off the deeper paper instead of blending in */
html[data-theme="light"] .card,
html[data-theme="light"] .tool { box-shadow: var(--shadow-sm); }
html[data-theme="light"] .app { background: var(--bg); box-shadow: var(--shadow-lg); }

/* Hero copy sits over a dark photo scrim in BOTH themes → keep it light */
html[data-theme="light"] .hero-copy { color: rgba(255, 255, 255, 0.90); }
html[data-theme="light"] .hero-copy .display,
html[data-theme="light"] .hero-copy h1,
html[data-theme="light"] .hero-copy h2 { color: #ffffff; }
html[data-theme="light"] .hero-copy .eyebrow { color: #d9be86; }

/* ---- Theme toggle button (sun in dark mode → tap for light; moon in light) ---- */
.theme-toggle {
  appearance: none; cursor: pointer;
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-pill);
  background: var(--fill-soft);
  border: 1px solid var(--line-strong);
  color: var(--copper);
  transition: var(--t);
}
.theme-toggle:hover { border-color: var(--copper-deep); color: var(--copper-soft); }
.theme-toggle svg { width: 17px; height: 17px; }
html[data-theme="light"] .theme-toggle .ico-sun { display: none; }
html:not([data-theme="light"]) .theme-toggle .ico-moon { display: none; }
