/* ==========================================================================
   Sparqle design system -- calm LIGHT theme (default) + opt-in night theme
   ([data-theme="dark"]).

   Foundation rebuilt to pixel-match the founder's design files (Sparqle
   Design System / M2 / M3 references): a cool cream ground (#F9F9F7),
   near-black espresso ink and PRIMARY BUTTONS (#0B0B0B on white -- never
   gold), white cards, a terracotta/clay brand accent (#C6613F family), and
   the four-point gold spark (#F0A63A) reserved as a SPARSE accent: the
   logo glyph and mastered/current trail stones only. Subject accents stay
   the design's muted earthy set (clay math, sage science, ...).

   Every color flows through a token, so both themes flip cleanly from the
   two blocks below; component rules never hardcode a theme-specific color.

   The previous dark-terminal treatments (neon text glows, scanlines,
   terminal traffic-light dots, blinking block cursor) are retired:
   --glow-text-sm and --scanlines-soft resolve to `none` in both themes,
   --glow-box resolves to a soft shadow, and the terminal-only ornaments
   paint nothing. The one earned ceremony (sparkleBurst on mastery) keeps
   its gold warmth in both themes -- see sparkle.css / sparkle.js.

   Type: headings are Nunito 700 (titles) / 600 (subtitles), never below
   20px. The design names Fredoka, but Fredoka has no glyphs for
   c/d/e/n/r/t-caron or u-ring, so per the founder (2026-10-28) Fredoka 600
   is used ONLY for the ASCII wordmark "MaStezka" (--font-wordmark) and
   Nunito carries every heading (Fredoka 600 -> Nunito 700, 500 -> 600).
   DM Sans for body (17-18px, line-height 1.55), buttons (700 16px pill)
   and labels (700 12px uppercase, 0.08em). --font-mono is a legacy token
   name kept because templates reference it inline; it resolves to DM Sans.

   Fonts are vendored locally under app/static/fonts/ (Fredoka latin only,
   Nunito, DM Sans; all SIL Open Font License 1.1, see
   app/static/fonts/OFL-LICENSE.md); latin + latin-ext subsets only. No
   external CDN font references (GDPR + offline dev).
   ========================================================================== */

@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/fredoka-normal-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('/static/fonts/nunito-normal-600_700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('/static/fonts/nunito-normal-600_700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/fonts/dm-sans-normal-400_700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/fonts/dm-sans-normal-400_700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   LIGHT theme -- the default. Base values come straight from the design
   files' foundation layer: cool cream ground, near-black ink, white cards,
   hairline alpha-black borders, terracotta brand accent (darkened to
   #A84A2B where it must carry small text -- 5.4:1 on the ground), espresso
   primary buttons. Gold/spark tokens survive ONLY for the logo glyph, the
   mastery ceremony, and mastered/current trail stones.
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* MaStezka brand tokens (docs/BRAND_TOKENS.md). Legacy variables below map onto these. */
  --ms-papir: #FBF5EA;      /* ground */
  --ms-inkoust: #1F2E3D;    /* text, trail line, node rings */
  --ms-svit: #FF8A3D;       /* the one accent; never text on light ground */
  --ms-svit-text: #A33F0A;  /* links, accent text (5.9:1 on Papir) */
  --ms-krem: #F5ECDC;       /* cards, fields */
  --ms-pisek: #EBDFC9;      /* lines, dividers */
  --ms-mech: #6F9C7C;       /* done node fill */
  --ms-mech-text: #3E6B4C;  /* done label text */
  --ms-noc: #10202E;        /* evening, look-back */
  --ms-mlha: #5B6670;       /* secondary text (not on Pisek) */
  --ms-noc-mlha: #B8C2CC;   /* secondary text on Noc */

  /* node states: mastered fill, path ahead */
  --mastered: var(--ms-mech);
  --mastered-text: var(--ms-mech-text);
  --ahead-line: rgba(91, 102, 112, 0.5);
  --on-brand: var(--ms-papir); /* text on a --brand fill (5.9:1) */


  /* surfaces -- cool cream ground, white cards, whisper-grey insets */
  --bg: var(--ms-papir);
  --surface-card: #FFFFFF;
  --surface-inset: var(--ms-krem);

  /* borders -- hairline alpha-black; strong = darker neutral (active) */
  --border-hairline: var(--ms-pisek);
  --border-soft: rgba(31, 46, 61, 0.06);
  --border-strong: var(--ms-inkoust);

  /* text -- the ink scale. strong 18.7:1; muted 7.5:1; faint 4.9:1 on the
     ground -- all AA at their sizes. */
  --text-strong: var(--ms-inkoust);
  --text-body: var(--ms-inkoust);
  --text-muted: var(--ms-mlha);
  --text-faint: var(--ms-mlha);

  /* brand accent -- terracotta/clay. --brand is the fill/decor value
     (>= 3:1 UI); --accent is the darkened TEXT-safe value (5.4:1). */
  --brand: var(--ms-svit-text);
  --accent: var(--ms-svit-text);

  /* primary action -- espresso near-black with white text. NOT gold. */
  --primary: var(--ms-svit);
  --primary-hover: #F07A2C;
  --on-primary: var(--ms-inkoust);
  /* legacy aliases (older component rules + templates) -> espresso */
  --accent-fill: var(--primary);
  --on-accent: var(--on-primary);

  /* the spark -- gold ceremony family, SPARSE accent only (logo glyph,
     mastered/current trail stones, sparkleBurst). Never buttons, never a
     dominant surface. */
  --spark: var(--ms-svit);
  --spark-glow: rgba(255, 138, 61, 0.30);
  --on-spark: var(--ms-inkoust);
  --gold: var(--ms-svit);
  --gold-text: var(--ms-svit-text);
  --gold-soft: var(--ms-krem);

  /* status -- muted, AA as text on ground/cards */
  --success: #38705A;
  --amber: #8A6420;
  --info: #48579E;
  --danger: #8E2626;
  --danger-bg: #FAD6D6;
  --danger-bord: #F09595;
  --on-danger: #FFFFFF;

  /* subject accents (design taxonomy palette -- earthy, never candy) */
  --sub-mathematics: #BD7A34;
  --sub-science: #3E7C64;
  --sub-english: #6E5C93;
  --sub-history: #A3573C;
  --sub-personal-social: #3C6E8C;
  --sub-life-skills: #A6863E;
  --sub-computing: #48579E;
  --sub-learning-to-learn: #6E7A3A;

  /* rgb companions so every rgba() derivative follows one token edit */
  --spark-rgb: 255, 138, 61;
  --gold-rgb: 255, 138, 61;
  --success-rgb: 56, 112, 90;
  --ink-soft-rgb: 91, 102, 112;
  --danger-rgb: 142, 38, 38;

  /* fonts -- Fredoka wordmark only, Nunito headings, DM Sans the rest */
  --font-wordmark: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-display: 'Nunito', 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: var(--font-body);

  /* effects -- calm: no text halos, no scanlines; one soft box shadow. */
  --glow-text-sm: none;
  --glow-box: 0 2px 10px rgba(31, 46, 61, 0.08);
  --shadow: 0 2px 10px rgba(31, 46, 61, 0.08);
  --shadow-pop: 0 12px 32px rgba(31, 46, 61, 0.18);
  --scanlines-soft: none;
  --mastered-glow: drop-shadow(0 0 6px var(--spark-glow));

  /* chrome washes / overlays */
  --hov: rgba(31, 46, 61, 0.05);
  --header-bg: rgba(251, 245, 234, 0.88);
  --scrim: rgba(16, 32, 46, 0.45);
  --wash-1: rgba(31, 46, 61, 0.05);
  --wash-2: rgba(31, 46, 61, 0.03);
  --hold-fill: rgba(255, 255, 255, 0.30);
  --selection: rgba(255, 138, 61, 0.30);

  /* layout -- cards keep the design radius 14px; buttons are 12px */
  --site-pad: clamp(20px, 5vw, 64px);
  --radius-sm: 14px;
  --radius-btn: 999px; /* pill, DESIGN.md 4 */
}

/* --------------------------------------------------------------------------
   NIGHT theme -- opt-in via the header toggle. The design files' night
   inversion: near-black ground, warm charcoal cards, white ink, INVERTED
   primary (white button, espresso text). Terracotta lifts to clay #D97757
   (4.5:1 on card); spark gold stays the same sparse ceremony accent.
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
  color-scheme: dark;

  --mastered-text: var(--ms-mech);
  --ahead-line: rgba(184, 194, 204, 0.5);
  --on-brand: var(--ms-inkoust); /* text on a --brand (Svit) fill */

  --bg: var(--ms-noc);
  --surface-card: #1A2D3F;
  --surface-inset: #223A4F;

  --border-hairline: rgba(251, 245, 234, 0.14);
  --border-soft: rgba(251, 245, 234, 0.07);
  --border-strong: rgba(251, 245, 234, 0.55);

  --text-strong: var(--ms-papir);
  --text-body: var(--ms-papir);
  --text-muted: var(--ms-noc-mlha);
  --text-faint: var(--ms-noc-mlha);

  --brand: var(--ms-svit);
  --accent: var(--ms-svit);

  --primary: var(--ms-svit);
  --primary-hover: #FF9C5C;
  --on-primary: var(--ms-inkoust);

  --spark: var(--ms-svit);
  --spark-glow: rgba(255, 138, 61, 0.35);
  --on-spark: var(--ms-inkoust);
  --gold: var(--ms-svit);
  --gold-text: var(--ms-svit);
  --gold-soft: #3A3128;

  --success: #79AE89;
  --amber: #D2A04A;
  --info: #8EA0D8;
  --danger: #EC7E7E;
  --danger-bg: #3C0E0E;
  --danger-bord: #641919;
  --on-danger: #0B0B0B;

  /* subject accents -- the design files' night set */
  --sub-mathematics: #D18F4A;
  --sub-science: #79AE89;
  --sub-english: #A594C8;
  --sub-history: #CF8663;
  --sub-personal-social: #7BA6BB;
  --sub-life-skills: #BAA04F;
  --sub-computing: #8EA0D8;
  --sub-learning-to-learn: #9DA452;

  --spark-rgb: 255, 138, 61;
  --gold-rgb: 255, 138, 61;
  --success-rgb: 121, 174, 137;
  --ink-soft-rgb: 184, 194, 204;
  --danger-rgb: 236, 126, 126;

  --glow-text-sm: none;
  --glow-box: 0 2px 14px rgba(0, 0, 0, 0.45);
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.55);
  --scanlines-soft: none;
  --mastered-glow: drop-shadow(0 0 8px rgba(255, 138, 61, 0.55));

  --hov: rgba(251, 245, 234, 0.06);
  --header-bg: rgba(16, 32, 46, 0.85);
  --scrim: rgba(0, 0, 0, 0.60);
  --wash-1: rgba(251, 245, 234, 0.05);
  --wash-2: rgba(251, 245, 234, 0.03);
  --hold-fill: rgba(11, 11, 11, 0.18);
  --selection: rgba(255, 138, 61, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body { transition: background-color 0.2s ease, color 0.2s ease; }

a { color: inherit; }

::selection { background: var(--selection); }

/* Visible focus rings, both themes (keyboard nav). :focus-visible keeps
   pointer clicks quiet. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hx-wrap {
  position: relative;
  min-height: 100vh;
  overflow-x: clip;
}

/* Scanline overlay -- retired via tokens (--scanlines-soft: none in both
   themes); the element stays in the templates but paints nothing. */
.hx-scanoverlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--scanlines-soft);
  opacity: 0.6;
  mix-blend-mode: overlay;
}

.hx-section { position: relative; z-index: 1; }

/* ---- header / nav ---- */
.hx-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--site-pad);
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-hairline);
}

/* Wordmark -- founder spec section 4: mark left, "MaStezka" Fredoka 600,
   letter-spacing -0.015em, gap 0.17 x mark height (28px mark -> 4.76px). */
.hx-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 4.76px;
  font-family: var(--font-wordmark);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.015em;
  text-decoration: none;
  color: var(--text-strong);
}
.hx-wordmark .k { color: inherit; }
.hx-wordmark__glyph { width: 28px; height: 28px; flex: none; } /* never below 24px */

/* Primary mark (_brand/mark.html). Light: ink path and rings, Papir ring
   fills, Svit last node, glow .3. Noc inverse (dark): Papir path and rings,
   Noc ring fills, Svit last node, glow .35. */
.ms-mark__glow { fill: var(--ms-svit); opacity: 0.3; }
.ms-mark__path { fill: none; stroke: var(--ms-inkoust); stroke-width: 11; stroke-linecap: round; }
.ms-mark__ring { fill: var(--ms-papir); stroke: var(--ms-inkoust); stroke-width: 6; }
.ms-mark__next { fill: var(--ms-svit); stroke: var(--ms-inkoust); stroke-width: 6; }
[data-theme="dark"] .ms-mark__glow { opacity: 0.35; }
[data-theme="dark"] .ms-mark__path { stroke: var(--ms-papir); }
[data-theme="dark"] .ms-mark__ring { fill: var(--ms-noc); stroke: var(--ms-papir); }
[data-theme="dark"] .ms-mark__next { stroke: var(--ms-papir); }

.hx-nav { display: flex; align-items: center; gap: 22px; }

.hx-navlink {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.hx-navlink:hover { color: var(--text-strong); }
/* Logged-in moment links (Zápis, Pohled zpět): 44 x 44 tap box. */
.hx-nav > .hx-navlink:not(.hx-navlink--marketing):not(.hx-navlink--auth) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  white-space: nowrap;
}
.hx-navlink.active { color: var(--text-strong); }

/* Lang toggle: buttons restyled as nav links (was inline style). */
.hx-lang-toggle { display: inline-flex; gap: 2px; align-items: center; }
.hx-lang-toggle__form { display: inline; }
.hx-lang-toggle__btn { background: none; border: none; cursor: pointer; padding: 2px 6px; min-width: 44px; min-height: 44px; }

/* Logged-in overflow: plain <details>, no JS. Every control is >= 44 x 44. */
.hx-more { position: relative; }
.hx-more__summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  list-style: none;
  cursor: pointer;
  border-radius: 999px;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
}
.hx-more__summary::-webkit-details-marker { display: none; }
.hx-more__summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hx-more[open] > .hx-more__summary { color: var(--text-strong); }
.hx-more__panel {
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  padding: 6px;
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.hx-more__link,
.hx-more__row .theme-toggle,
.hx-more .hx-lang-toggle__btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
}
.hx-more__row { display: flex; align-items: center; gap: 4px; min-height: 44px; }
.hx-more__row .theme-toggle { justify-content: center; padding: 0; width: 44px; height: 44px; }
.hx-more__btn { background: none; border: none; cursor: pointer; width: 100%; }
.hx-more__logout { margin: 0; }

/* Look-back child switcher (story.html), shown with 2+ children. */
.story-switch { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 12px; }
.story-switch__current { font-weight: 600; color: var(--text-strong); }
.story-switch__link { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 0 8px; }
.story-switch__current { display: inline-flex; align-items: center; min-height: 44px; }

/* ---- theme toggle (base.html header) ---- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border-hairline);
  background: var(--surface-card);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { color: var(--text-strong); border-color: var(--border-strong); }
.theme-toggle__moon { display: inline; }
.theme-toggle__sun { display: none; }
[data-theme="dark"] .theme-toggle__moon { display: none; }
[data-theme="dark"] .theme-toggle__sun { display: inline; }

/* ---- buttons ----
   Design spec: sans body face, weight 700-ish, radius 12px. Primary is
   espresso (near-black fill, white text) -- inverts to white-on-espresso
   at night. Quiet/secondary is a bordered card-surface button. */
.hx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}
.hx-btn:active { transform: translateY(1px); }
/* Phone floor: every button is a 44px touch target (DESIGN.md 4). */
.hx-btn { min-height: 44px; }
.hx-btn--sm { padding: 8px 16px; font-size: 14px; }
.hx-btn--lg { padding: 13px 24px; font-size: 16px; }
.hx-btn--block { width: 100%; }

.hx-btn--primary {
  background: var(--primary);
  color: var(--on-primary);
}
.hx-btn--primary:hover { background: var(--primary-hover); }

.hx-btn--secondary {
  background: var(--surface-card);
  border-color: var(--border-hairline);
  color: var(--text-strong);
}
.hx-btn--secondary:hover { border-color: var(--border-strong); background: var(--hov); }

.hx-btn--ghost {
  background: transparent;
  border-color: var(--border-hairline);
  color: var(--text-muted);
}
.hx-btn--ghost:hover { color: var(--text-strong); background: var(--hov); }

/* ---- kicker (section eyebrow -- mono label, terracotta slash) ---- */
.hx-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted); font-weight: 700;
}
.hx-kicker .slash { color: var(--accent); }
.hx-kicker.hx-rule { width: 100%; }
.hx-kicker .line {
  flex: 1;
  height: 1px;
  background: var(--border-hairline);
}

/* ---- hx-term (legacy "terminal card" class -- now a plain quiet card:
   white surface, hairline border; the mac traffic-light dots and any
   terminal chrome paint nothing). ---- */
.hx-term {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hx-term--glow { box-shadow: var(--glow-box); }

.hx-term__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--wash-2);
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}
/* terminal traffic lights retired -- calm, not a dev tool */
.hx-term__dots { display: none; }
.hx-term__dots i { display: none; }

.hx-term__body { padding: 18px 20px; }

/* blinking block cursor retired with the terminal character */
.hx-cursor::after { content: none; }
@keyframes hx-blink { 50% { opacity: 0; } }

/* ---- cards ---- */
.hx-card {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.hx-card--hover:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
/* corner "ticks" retired with the terminal character -- plain cards */
.hx-card--ticks::before,
.hx-card--ticks::after { content: none; }

/* ---- badges ---- */
.hx-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-hairline);
  background: var(--surface-card);
  text-transform: uppercase;
}
.hx-badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  display: inline-block;
}
.hx-badge--success { color: var(--success); }
.hx-badge--success .dot { background: var(--success); }
.hx-badge--amber { color: var(--amber); }
.hx-badge--amber .dot { background: var(--amber); }
.hx-badge--info { color: var(--info); }
.hx-badge--info .dot { background: var(--info); }

/* ---- callout ---- */
.hx-callout {
  display: flex;
  gap: 14px;
  border: 1px solid var(--border-hairline);
  background: var(--surface-card);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
}
.hx-callout__title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-strong);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.hx-callout__body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ---- links ---- */
.hx-link {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}
.hx-link:hover { color: var(--text-strong); text-decoration: underline; }

/* ---- footer (Sparqle-only chrome: wordmark + spark, link columns) ---- */
.hx-footer {
  position: relative;
  z-index: 1;
  padding: 40px var(--site-pad) 56px;
  border-top: 1px solid var(--border-hairline);
}
.hx-footer__inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.hx-footer__brand { max-width: 320px; }
.hx-footer__note {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  margin-top: 14px;
  line-height: 1.6;
}
.hx-footer__cols {
  display: flex;
  gap: clamp(32px, 5vw, 56px);
  flex-wrap: wrap;
}
.hx-footer__col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}
.hx-footer__head {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

/* ---- forms (product app: signup/login/dashboard) ---- */
.hx-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.hx-field label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em; font-weight: 700;
}
.hx-input, .hx-select, textarea.hx-input {
  background: var(--surface-card);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 11px 13px;
  min-height: 48px;
  color: var(--text-strong);
  font-family: var(--font-body);
  font-size: 16px; /* under 16px makes iOS Safari zoom on focus */
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.hx-input:focus, .hx-select:focus {
  border-color: var(--text-strong);
  box-shadow: 0 0 0 1px var(--text-strong);
}

.hx-checkrow {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  min-height: 44px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
}
/* 24px box (WCAG 2.2 target size) and the label pads the row to 44px, so the
   whole row toggles; every checkrow label already carries a matching `for`. */
.hx-checkrow input { flex: 0 0 auto; width: 24px; height: 24px; margin: 10px 0 0; accent-color: var(--primary); }
.hx-checkrow label { flex: 1 1 auto; padding: 11px 0; cursor: pointer; }

/* WS-B: the "done on paper" attestation -- a dashed, clearly-offline
   affordance, never mistakable for the canonical evidence checklist. */
.coach-hands-confirm {
  border: 1.5px dashed var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 6px;
}

.hx-alert {
  border: 1px solid var(--danger-bord);
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 18px;
}
.hx-alert .hx-link { color: var(--danger); font-weight: 700; }
/* Verify-email banner under the header: one row, never above the main action. */
.hx-alert--banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 var(--site-pad); }
.hx-alert--banner[hidden] { display: none; }
.hx-alert--success {
  border-color: rgba(var(--success-rgb), 0.4);
  background: rgba(var(--success-rgb), 0.1);
  color: var(--success);
}
/* WS6-F5: the toast host hx-alerts.js fills on htmx:responseError -- fixed,
   above content, hidden until a refusal body arrives. */
.hx-alert--toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  max-width: min(480px, 90vw);
  margin-bottom: 0;
  box-shadow: var(--shadow-pop);
}

.hx-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.hx-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-hairline); font-weight: 700;
}
.hx-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-hairline);
  color: var(--text-body);
}
.hx-table tr:last-child td { border-bottom: none; }

.hx-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase; font-weight: 700;
}
/* A pill that is a control (subject toggle on the child page) keeps the
   pill look but grows to the 44px touch floor. */
button.hx-pill { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; }
.hx-pill--mastered { background: rgba(var(--success-rgb), 0.12); color: var(--success); }
.hx-pill--in_progress { background: rgba(var(--gold-rgb), 0.12); color: var(--amber); }
.hx-pill--not_started { background: var(--wash-1); color: var(--text-faint); }
/* WS6-F4: the drawer's compute_state vocabulary -- frontier gets the
   ready/open affordance (gold ring, like the design's "open" stone),
   locked the muted treatment (like trail-stone--locked's opacity). */
.hx-pill--frontier { background: rgba(var(--spark-rgb), 0.08); color: var(--amber); box-shadow: inset 0 0 0 1px rgba(var(--gold-rgb), 0.45); }
.hx-pill--locked { background: var(--wash-2); color: var(--text-faint); opacity: 0.6; }

@media (max-width: 760px) {
  .hx-nav { gap: 12px; }
  /* Collapse ONLY the marketing links on a phone. This used to hide every
     non-button link, which took "log in" with it: a signed-out visitor on an
     iPhone was left with nothing but "sign up", and a signed-in one lost the
     dashboard and account links entirely. Reported by testers. */
  .hx-nav a.hx-navlink--marketing { display: none; }
  /* ...and make log-in read as a tappable control rather than small text,
     since "not clearly visible quickly" was the actual complaint. */
  .hx-nav a.hx-navlink--auth {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    border: 1px solid var(--border-hairline);
    border-radius: 999px;
    padding: 6px 14px;
    font-weight: 600;
  }
  .hx-roster-grid { grid-template-columns: 1fr !important; }
}

/* Signed-out header at phone width: MaStezka wordmark + log in + sign up +
   language + theme no longer fit one row (they clipped the toggles off the
   right edge and wrapped "přihlásit se"). Drop the nav to a second row. The
   signed-in nav fits one row, so it is left alone. */
@media (max-width: 420px) {
  .hx-header { flex-wrap: wrap; row-gap: 6px; }
  /* With 44px toggles the second row no longer fits at 360. The nav becomes
     display: contents so its items lay out in the header: wordmark and theme
     toggle on row one, log in, sign up and language on row two. */
  .hx-header:has(.hx-navlink--auth) { gap: 8px; }
  .hx-header:has(.hx-navlink--auth) .hx-wordmark { flex: 1 1 calc(100% - 52px); }
  .hx-nav:has(.hx-navlink--auth) { display: contents; }
  .hx-nav:has(.hx-navlink--auth) .theme-toggle { order: 1; }
  .hx-nav:has(.hx-navlink--auth) .hx-lang-toggle { order: 2; margin-left: auto; }
  .hx-nav a.hx-navlink--auth { order: 2; white-space: nowrap; }
  .hx-nav:has(.hx-navlink--auth) .hx-btn { order: 2; }
}

/* ==== trail ====
   Child trail view: one strand as a vertical rail (see the "Trail rail"
   block below). The page only ever scrolls vertically; .hx-wrap sets
   overflow-x: clip. */

.hx-header--child { justify-content: flex-start; gap: 20px; }
.hx-navlink--back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; }

.trail-intro {
  padding: clamp(28px, 5vw, 44px) var(--site-pad) clamp(12px, 2vw, 16px);
}
.trail-intro__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 6vw, 44px);
  letter-spacing: -0.01em;
  color: var(--text-strong);
  margin: 0;
}

.trail-empty {
  padding: 0 var(--site-pad) clamp(40px, 6vw, 64px);
  color: var(--text-muted);
  font-size: 16px;
}

/* ------------------------------------------------------------------ */
/* Trail rail ("Linka", PR 3 2026-10-28): one strand per page as a     */
/* vertical rail drawn in Ink only. Done steps are Mech, the single    */
/* "Další krok" step is Svit with a glow, steps still ahead are rings  */
/* on Papír joined by a dashed Mlha line. Every step also prints its   */
/* state as a word, so no state rests on colour alone. Columns: rail   */
/* (48px) | interchange branch (40px, only when one is drawn) | name.  */
/* ------------------------------------------------------------------ */

.trail-subject { padding: 0 var(--site-pad) 8px; }
.trail-subject__label {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}
.trail-line__name {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  color: var(--text-strong);
  text-wrap: balance;
}

.trail-rail { list-style: none; margin: 16px 0 0; padding: 0; --rail: 4px; --b: 0px; }
.trail-rail--branch { --b: 40px; }
.trail-rail__step { position: relative; }

.trail-stone {
  display: grid;
  grid-template-columns: 48px var(--b) minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 64px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-body);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.trail-stone:disabled { cursor: default; color: var(--text-body); }
.trail-stone:focus-visible { outline: 3px solid var(--text-strong); outline-offset: 2px; border-radius: 10px; }

.trail-rail__a, .trail-rail__b { position: relative; align-self: stretch; display: grid; place-items: center; }
.trail-rail__a::before, .trail-rail__a::after {
  content: "";
  position: absolute;
  left: calc(50% - var(--rail) / 2);
  width: var(--rail);
  background: var(--text-strong);
}
.trail-rail__a::before { top: 0; bottom: 50%; }
.trail-rail__a::after { top: 50%; bottom: 0; }
.is-first .trail-rail__a::before, .is-last .trail-rail__a::after { display: none; }
.trail-rail__step--cross.is-first .trail-rail__a::after { display: none; }
/* the path still to travel: dashed Mlha, never Písek on Papír (1.2:1) */
.is-ahead .trail-rail__a::before, .is-ahead .trail-rail__a::after, .is-current .trail-rail__a::after {
  background: repeating-linear-gradient(to bottom, var(--text-muted) 0 6px, transparent 6px 12px);
}

.trail-rail__dot {
  position: relative;
  z-index: 1;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-sizing: border-box;
  background: var(--mastered);
  border: 3px solid var(--text-strong);
}
.is-ahead .trail-rail__a .trail-rail__dot { background: var(--bg); border-color: var(--text-muted); }
.is-current .trail-rail__dot {
  width: 34px;
  height: 34px;
  background: var(--spark);
  border: 4px solid var(--bg);
  box-shadow: 0 0 0 3px var(--text-strong);
}
.trail-rail__glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100px;
  height: 100px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none; /* 100px disc on 64px rows: never steal a neighbour's tap */
  background: radial-gradient(circle closest-side, rgba(var(--spark-rgb), 0.55) 0, rgba(var(--spark-rgb), 0.22) 45%, rgba(var(--spark-rgb), 0) 100%);
}

/* interchange: a short Ink branch from the joining step into the rail */
.trail-rail__b--open::before, .trail-rail__b--ends::before {
  content: "";
  position: absolute;
  left: calc(50% - var(--rail) / 2);
  width: var(--rail);
  background: var(--text-strong);
  top: 50%;
  bottom: 0;
}
.trail-rail__b--ends::before { top: 0; bottom: 50%; }
.trail-rail__b--ends::after {
  content: "";
  position: absolute;
  left: -24px;
  right: calc(50% - var(--rail) / 2);
  top: calc(50% - var(--rail) / 2);
  height: var(--rail);
  background: var(--text-strong);
}
.trail-rail__b .trail-rail__dot { width: 18px; height: 18px; border-width: 3px; }
.trail-rail__b .trail-rail__dot--frontier,
.trail-rail__b .trail-rail__dot--locked,
.trail-rail__b .trail-rail__dot--in_progress { background: var(--bg); border-color: var(--text-muted); }

.trail-stone__label {
  padding: 10px 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.3;
  color: var(--text-strong);
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.trail-stone__state {
  display: block;
  margin-top: 2px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.35;
  color: var(--text-muted);
}
.trail-stone--mastered .trail-stone__state { color: var(--mastered-text); font-weight: 600; }
.trail-stone--current .trail-stone__label { font-size: 20px; }
.trail-stone__word { color: var(--gold-text); font-weight: 700; }
.trail-rail__step--cross .trail-stone__label { font-size: 15px; }
.trail-stone__star { margin-left: 6px; color: var(--gold-text); font-size: 14px; }

.trail-stub { margin: 8px 0 0; padding-left: 48px; }
.trail-stub--count { display: flex; align-items: center; min-height: 32px; margin: 0; color: var(--text-muted); font-size: 14px; }
.trail-stub__link {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.3em;
  min-height: 44px;
  color: var(--text-strong);
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.trail-others { padding: 24px var(--site-pad) clamp(28px, 4vw, 40px); }
.trail-others__title { display: flex; align-items: center; justify-content: space-between; max-width: 20rem; list-style: none; min-height: 44px; cursor: pointer; font-size: 15px; font-weight: 700; color: var(--text-strong); }
.trail-others__title::-webkit-details-marker { display: none; }
.trail-others__title::after { content: ""; width: 8px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.trail-others[open] > .trail-others__title::after { transform: rotate(-135deg); }
.trail-others__list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; column-gap: 20px; }

/* Brand motion, the lit step only: the rail draws into it (400ms), then
   its glow comes up (600ms). Base styles are the finished picture, so
   reduced motion simply gets no animation. Nothing bounces. */
@keyframes trail-draw { from { transform: scaleY(0); } }
@keyframes trail-glow { from { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .is-current .trail-rail__a::before { transform-origin: top; animation: trail-draw 400ms ease-out backwards; }
  .is-current .trail-rail__glow { animation: trail-glow 600ms ease-out 400ms backwards; }
}

.trail-intro__hint {
  color: var(--text-muted);
  font-size: 15px;
  margin: 8px 0 0;
}
.trail-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0 var(--site-pad);
  font-size: 14px;
  color: var(--text-muted);
}
.trail-legend li { display: inline-flex; align-items: center; gap: 8px; }
.trail-legend__dot { width: 16px; height: 16px; border-radius: 50%; display: inline-block; box-sizing: border-box; }
.trail-legend__dot--mastered { background: var(--mastered); border: 2px solid var(--text-strong); }
.trail-legend__dot--current { background: var(--spark); box-shadow: 0 0 0 2px var(--text-strong); }
.trail-legend__dot--ahead { background: var(--bg); border: 3px solid var(--text-muted); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.trail-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  max-height: min(72vh, 720px);
  overflow-y: auto;
  background: var(--surface-card);
  border-top: 1px solid var(--border-hairline);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow-pop);
}
.trail-drawer:empty { display: none; }

/* FIX-K: scrim + close control for the drawer (the design's .scrim spec,
   colors flowing through --scrim per theme). Visibility is pure CSS keyed
   off #trail-drawer:not(:empty), which flips on every htmx content swap
   into the drawer with zero JS state; the scrim itself appears only on
   desktop (the established 760px breakpoint), the close button
   everywhere. */
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--scrim);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.trail-drawer__close {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -6px -8px -6px 0;
  border-radius: 999px;
  border: 1px solid var(--border-hairline);
  background: var(--surface-card);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 16px;
  cursor: pointer;
}
.trail-drawer__close:hover {
  color: var(--text-strong);
  border-color: var(--border-strong);
}
@media (min-width: 761px) {
  /* DESIGN.md 4: the sheet is a card on desktop, not edge to edge. */
  .trail-drawer { left: 50%; right: auto; width: min(480px, 100%); transform: translateX(-50%); }
  #trail-drawer:not(:empty) ~ .drawer-scrim {
    opacity: 1;
    pointer-events: auto;
  }
}

.trail-drawer__panel { padding: 22px var(--site-pad) clamp(24px, 5vw, 36px); }
.trail-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.trail-drawer__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(20px, 4vw, 24px);
  letter-spacing: -0.01em;
  color: var(--text-strong);
  margin: 0;
}
.trail-drawer__description {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-body);
  margin: 10px 0 12px;
}
.trail-drawer__facts { margin: 14px 0 0; display: grid; gap: 12px; }
.trail-drawer__fact dt {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint);
  font-weight: 700;
}
.trail-drawer__fact dd { margin: 2px 0 0; font-weight: 600; color: var(--text-strong); }
.trail-drawer__depth { color: var(--text-muted); font-weight: 500; }
.trail-drawer__standard {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-body);
  background: var(--wash-1);
  border-radius: 6px;
  padding: 2px 6px;
}
.trail-drawer__gloss {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
}
/* Full-width 44px tappable row: a prerequisite or unlock that opens its
   own sheet. */
.trail-drawer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid var(--border-hairline);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.trail-drawer__row-label { flex: 1; }
/* WS2-F6: chip whose topic's subject is off for this child -- dimmed with
   a dotted underline (there's a title tooltip explaining why). */
.trail-drawer__chip--inactive { opacity: 0.55; border-bottom: 1px dotted var(--text-faint); }
.trail-drawer__actions { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin-top: 16px; }
/* UX audit item 8: the drawer's mark/quiz buttons are the Light-up tap
   targets, one-handed with a child on the shoulder -- 44px, not 35px. */
.trail-drawer__actions .hx-btn { min-height: 44px; width: 100%; }

/* ==== story ====
   M2.3 the Look-back -- parent-facing, normal account chrome (extends
   base.html, not base_child.html). Calm tone per SPARQLE_DIRECTION.md: no
   gamification, no shame copy, warm rather than blank when a month was
   quiet. Reuses .hx-pill/.hx-callout/.hx-kicker from the rest of the app;
   only the list/chip layout below is story-specific. */

.story-head { padding: clamp(40px, 6vw, 56px) var(--site-pad) clamp(20px, 3vw, 28px); max-width: 860px; margin: 0 auto; }
.story-block { padding: 0 var(--site-pad) clamp(32px, 5vw, 44px); max-width: 860px; margin: 0 auto; }
.story-block--last { padding-bottom: clamp(56px, 8vw, 80px); }
.story-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 5vw, 38px);
  letter-spacing: -0.01em;
  color: var(--text-strong);
  margin: 0;
}
.story-window-note {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 10px;
}

/* the reflection hero -- "This month, Ema mastered N skills — X, Y." */
.story-hero {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(21px, 3.6vw, 27px);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text-strong);
  max-width: 34ch;
  margin: 0 0 22px;
}

/* recent milestones -- spark-dotted timeline */
.story-ms-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  color: var(--text-faint);
  margin: 0 0 4px;
}
.story-ms { list-style: none; margin: 0; padding: 0; }
.story-ms__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border-soft);
}
.story-ms__item:first-of-type { border-top: none; }
.story-ms__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--spark);
  margin-top: 6px;
  flex: none;
}
.story-ms__body { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.story-ms__text { font-size: 14px; font-weight: 600; color: var(--text-strong); }
.story-ms__date {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
  padding-top: 3px;
}
.story-growth-note {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
  font-style: italic;
  margin: 18px 0 0;
}
.story-list__kind {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase; font-weight: 700;
}
/* soft pill (hands marker on coached sessions) -- quiet, dashed accent */
.hx-pill--soft {
  background: var(--wash-2);
  color: var(--text-muted);
  box-shadow: inset 0 0 0 1px var(--border-hairline);
}

.story-lede {
  font-size: 15px;
  color: var(--text-body);
  margin: 0 0 14px;
}

.story-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.story-list__item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
}
.story-list__label { font-size: 14px; color: var(--text-strong); font-weight: 600; }
.story-list__date {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}

.story-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* Look-back (PR 6): month keepsake on the trail rail, strand-grouped dated
   list, O krok dal. Line colours cycle through brand tokens. */
.story-h2 { margin: 28px 0 4px; font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.25; color: var(--text-strong); }
.story-note { margin: 0 0 8px; font-size: 15px; color: var(--text-muted); }
.story-kicker { margin-bottom: 16px; }
.story-strand { --c: var(--ms-mech); margin-top: 20px; }
.story-strand:nth-of-type(3n+2) { --c: var(--ms-svit); }
.story-strand:nth-of-type(3n) { --c: var(--ms-mlha); }
.story-strand__name { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 16px; font-weight: 600; color: var(--text-muted); }
.story-strand__name::before { content: ""; flex: none; width: 28px; height: 4px; border-radius: 2px; background: var(--c); }
.story-ms__text { font-family: var(--font-display); font-size: 17px; line-height: 1.35; }
.story-ms__date { font-size: 14px; color: var(--text-muted); }
.story-keep__line { margin: 20px 0 0; font-size: 16px; font-weight: 600; color: var(--text-muted); }
.story-keep__chain { margin-top: 4px; }
.story-keep__chain .trail-stone { cursor: default; }
.story-ahead { list-style: none; margin: 8px 0 0; padding: 0; }
.story-ahead__item { display: grid; grid-template-columns: 40px 1fr; align-items: center; min-height: 64px; padding: 8px 0; border-bottom: 1px solid var(--border-hairline); }
.story-ahead__item:first-child { border-top: 1px solid var(--border-hairline); }
.story-ahead__dot { justify-self: center; width: 22px; height: 22px; box-sizing: border-box; border-radius: 50%; background: var(--bg); border: 3px solid var(--text-muted); }
.story-ahead__name { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.35; color: var(--text-strong); }
.story-ahead__why { display: block; font-family: var(--font-body); font-weight: 400; font-size: 14px; color: var(--text-muted); }
.story-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--text-strong); text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 480px) {
  .story-list__item { flex-direction: column; align-items: flex-start; }
  .story-list__date { margin-left: 0; }
}

/* ==== landing, combo D (2026-09-22): the family photo goes across the page ====
   Full-bleed hero (photo, left scrim, eyebrow pill, one compact CTA card on
   the sofa), then the stone-trail moment on an inset band, trust ledger,
   editorial beats, look-back pull-quote, subjects ledger, a plain final
   band. One boxed surface on the page: the hero card. The hero is theme
   invariant (photo + ink), everything below follows the tokens. */

.land-cta-note { font-size: 13px; color: var(--text-faint); margin: 10px 0 0; }

.hero-wrap { position: relative; }
.hero { position: relative; height: min(86vh, 820px); overflow: hidden; display: flex; align-items: flex-end; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 48% 40%; }
.hero-scrim { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(11,11,11,.84) 0%, rgba(11,11,11,.8) 40%, rgba(11,11,11,.5) 62%, rgba(11,11,11,.12) 100%); }
.hero-cap { position: absolute; right: var(--site-pad); top: 12px; z-index: 2; margin: 0; font: 11px/1.3 var(--font-mono); color: #F9F9F7; letter-spacing: .03em; background: rgba(11,11,11,.55); padding: 4px 8px; border-radius: 6px; }
.hero-inner { position: relative; width: 100%; padding: 0 var(--site-pad) clamp(48px, 7vw, 88px); }
.hero-text { max-width: 560px; }
.hero-eyebrow { display: inline-flex; align-items: center; margin: 0; font: 700 12px/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: #F9F9F7; padding: 7px 14px; border: 1px solid rgba(251,250,246,.45); border-radius: 999px; background: rgba(11,11,11,.35); }
.hero h1 { font-family: var(--font-display); font-size: clamp(38px, 5.1vw, 64px); font-weight: 700; line-height: 1.08; margin: 16px 0 0; color: #F9F9F7; letter-spacing: -.02em; text-shadow: 0 2px 10px rgba(0,0,0,.5); text-wrap: balance; }
.hero-sub { margin: 16px 0 0; color: #F9F9F7; font-size: clamp(16px, 1.6vw, 19px); line-height: 1.5; max-width: 46ch; opacity: .97; text-shadow: 0 1px 8px rgba(0,0,0,.55); }

.hero-card-wrap { padding: 0 var(--site-pad); }
.hero-card { background: var(--surface-card); border: 1px solid var(--border-hairline); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 22px 24px; max-width: 340px; margin-left: auto; }
.hero-card .hx-btn { width: 100%; }
.hero-card__head { font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--text-strong); margin: 0 0 14px; }
.hero-card__help { margin: 10px 0 0; font-size: 13px; color: var(--text-faint); }

@media (min-width: 760px) {
  .hero-card-wrap { position: absolute; right: var(--site-pad); bottom: clamp(36px, 6vw, 60px); left: auto; width: min(320px, 36%); padding: 0; }
  .hero-card { max-width: none; }
}
@media (max-width: 759px) {
  .hero-wrap { background: #0B0B0B; }
  .hero { height: auto; min-height: 0; overflow: visible; display: block; }
  .hero-img { height: 294px; inset: auto; top: 0; left: 0; right: 0; object-position: 40% 30%; }
  .hero-scrim { height: 294px; inset: auto; top: 0; left: 0; right: 0; background: linear-gradient(180deg, rgba(11,11,11,.08) 0%, rgba(11,11,11,.35) 55%, rgba(11,11,11,.97) 100%); }
  .hero-inner { padding: 294px var(--site-pad) 28px; }
  .hero-text { max-width: none; }
  .hero-card-wrap { padding: 20px var(--site-pad) 28px; }
}

.land-sec { max-width: 1080px; margin: 0 auto; padding: clamp(36px, 6vw, 56px) var(--site-pad); }
.land-sec--rule { border-top: 1px solid var(--border-hairline); }
.sec-label { display: block; font: 700 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 22px; }

/* the moment: stone trail on an inset paper band. Static: the resting
   state IS the after state (lit stone + next stone clear), no loop. */
.moment-band { background: var(--surface-inset); border-radius: var(--radius-sm); padding: clamp(28px, 5vw, 52px) clamp(20px, 5vw, 48px); }
.moment-band figure { margin: 0; }
.lu-trail { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; position: relative; }
.lu-trail::before { content: ''; position: absolute; left: 8%; right: 8%; top: 28px; height: 2px; background: repeating-linear-gradient(90deg, var(--border-strong) 0 6px, transparent 6px 13px); opacity: .5; }
.lu-stone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.lu-stone__circle { position: relative; width: 56px; height: 56px; border-radius: 50%; background: var(--surface-card); border: 2px solid var(--border-strong); display: grid; place-items: center; flex-shrink: 0; }
.lu-stone__check { color: var(--on-primary); font-size: 20px; font-weight: 700; opacity: 0; grid-area: 1 / 1; }
.lu-stone__dot { width: 14px; height: 14px; border-radius: 50%; background: var(--spark); opacity: 0; grid-area: 1 / 1; }
.lu-stone__label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); line-height: 1.3; }
.lu-stone__tag { position: absolute; top: -24px; left: 50%; transform: translateX(-50%); background: var(--spark); color: var(--on-spark); font: 700 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.lu-stone--done .lu-stone__circle { background: var(--mastered); border-color: var(--mastered); }
.lu-stone--done .lu-stone__check { opacity: 1; }
.lu-stone--done .lu-stone__label { color: var(--text-strong); }
.lu-stone--lights .lu-stone__circle { border-width: 3px; background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 7px rgba(var(--spark-rgb), .22), 0 0 18px var(--spark-glow); }
.lu-stone--lights .lu-stone__dot { opacity: 1; }
.lu-stone--lights .lu-stone__label { color: var(--text-strong); font-weight: 700; }
.lu-stone--next .lu-stone__circle { border-style: dotted; border-color: var(--border-strong); background: transparent; }
.lu-stone--next .lu-stone__label { color: var(--text-muted); }
.lu-stone--far { opacity: .55; }
.lu-stone--far .lu-stone__circle { border-style: dotted; border-color: var(--border-hairline); background: transparent; }
.moment-caption { margin: 28px auto 0; font-family: var(--font-display); font-size: 17px; line-height: 1.5; color: var(--text-body); text-align: center; max-width: 52ch; }
@media (max-width: 759px) {
  .lu-stone__circle { width: 44px; height: 44px; }
  .lu-stone__check { font-size: 16px; }
  .lu-stone__dot { width: 11px; height: 11px; }
  .lu-stone__label { font-size: 11px; }
  .lu-trail::before { top: 22px; }
  .lu-stone__tag { top: -20px; }
}

.trust-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--border-hairline); font-size: 14px; line-height: 1.55; color: var(--text-body); }
.trust-row:last-child { border-bottom: 1px solid var(--border-hairline); }
.trust-ic { color: var(--success); font-weight: 700; flex: none; margin-top: 1px; }

.beat-row { display: flex; gap: 22px; padding: 24px 0; border-top: 1px solid var(--border-hairline); }
.beat-row:last-child { border-bottom: 1px solid var(--border-hairline); }
.beat-num { flex: 0 0 44px; font-family: var(--font-mono); font-weight: 700; font-size: 14px; color: var(--accent); padding-top: 3px; }
.beat-title { font-family: var(--font-display); font-weight: 600; font-size: 21px; color: var(--text-strong); margin: 0 0 8px; letter-spacing: -.005em; }
.beat-body { font-size: 14.5px; line-height: 1.6; color: var(--text-muted); margin: 0; max-width: 58ch; }

.ritual { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 760px) { .ritual { grid-template-columns: 1fr 1fr; } .ritual > :last-child { border-left: 1px solid var(--border-hairline); padding-left: 32px; } }
@media (max-width: 759px) { .ritual > :last-child { border-top: 1px solid var(--border-hairline); padding-top: 24px; } }
.ritual .sec-label { margin-bottom: 12px; }
.quote-block { border-top: 1px solid var(--border-hairline); border-bottom: 1px solid var(--border-hairline); padding-block: 24px; }
.quote-block__title { font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: .01em; color: var(--text-strong); margin: 0 0 14px; }
.quote-block__quote { font-family: var(--font-display); font-weight: 400; font-size: clamp(26px, 3vw, 30px); line-height: 1.42; color: var(--text-strong); margin: 0; }
.land-not__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.land-not__list li { font-size: 14.5px; line-height: 1.55; color: var(--text-body); padding-left: 18px; position: relative; }
.land-not__list li::before { content: ''; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; background: var(--brand); }

.ledger-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 0; border-top: 1px solid var(--border-hairline); }
.ledger-row:last-child { border-bottom: 1px solid var(--border-hairline); }
.ledger-name { font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--text-strong); }
.ledger-grade { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); white-space: nowrap; }

.final-band { background: var(--surface-inset); border-top: 1px solid var(--border-hairline); }
.final-band__inner { max-width: 640px; margin: 0 auto; padding: clamp(48px, 8vw, 80px) var(--site-pad); text-align: center; }
.final-band__title { font-family: var(--font-display); font-weight: 600; font-size: clamp(28px, 4.6vw, 38px); letter-spacing: -.01em; color: var(--text-strong); margin: 0 0 12px; text-wrap: balance; }
.final-band__body { font-size: 15px; line-height: 1.6; color: var(--text-muted); margin: 0 auto 28px; max-width: 48ch; }

/* Web board look (founder spec section 12): Krem cards with a 1px Pisek
   border, radius 16; pill buttons 999px / 48px (56px on phones), primary =
   Svit fill with Inkoust text. Scoped to the landing so app buttons stay. */
.hero-card, .moment-band { background: var(--surface-inset); border: 1px solid var(--border-hairline); border-radius: 16px; }
.hero-card .hx-btn, .final-band .hx-btn { min-height: 48px; padding: 0 28px; border-radius: 999px; font-size: 16px; font-weight: 700; }
@media (max-width: 759px) { .hero-card .hx-btn, .final-band .hx-btn { min-height: 56px; font-size: 18px; } }
.lu-stone__check svg { width: 20px; height: 20px; stroke-width: 2.5; }
.trust-ic { color: var(--mastered-text); display: inline-flex; }
@media (max-width: 759px) { .lu-stone__check svg { width: 16px; height: 16px; } }

/* ==== the Log (dashboard, M3 screen 2) ====
   A log, not a dashboard-dashboard: one calm column, tonight's child
   pre-opened as the hero card, per-subject "what's next" rows each with a
   ONE-TAP filled "Mark mastered" button (the whole point is a parent on
   a phone at 22:00). Every color flows through the theme tokens. */

.log-head {
  padding: clamp(36px, 6vw, 52px) var(--site-pad) clamp(18px, 3vw, 26px);
  max-width: 760px;
  margin: 0 auto;
}
.log-sub { margin: 4px 0 0; font-size: 15px; color: var(--text-muted); }
.log-quiet { margin: 18px 0 0; font-size: 14px; }
.log-title a { color: inherit; text-decoration: none; }
.log-title a:hover { text-decoration: underline; }
/* Page title, sentence case (DESIGN.md 3). Same scale as .log-title. */
.hx-h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 5vw, 38px);
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--text-strong);
  margin: 0;
}
.hx-h1--hero { font-size: clamp(36px, 6vw, 56px); max-width: 20ch; }

.log-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 5vw, 38px);
  letter-spacing: -0.01em;
  color: var(--text-strong);
  margin: 0;
}
.log-main {
  padding: 0 var(--site-pad) clamp(64px, 9vw, 96px);
  max-width: 760px;
  margin: 0 auto;
}
.log-list { display: flex; flex-direction: column; gap: 14px; }

.log-child {
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.log-child--tonight { box-shadow: var(--shadow); }

.log-child__bar { display: flex; align-items: center; gap: 12px; }
.log-avatar {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--on-brand);
  background: var(--brand);
}
/* deterministic earthy hue per child (child.id % 5) */
.log-avatar--h0 { background: var(--sub-mathematics); }
.log-avatar--h1 { background: var(--sub-science); }
.log-avatar--h2 { background: var(--sub-english); }
.log-avatar--h3 { background: var(--sub-history); }
.log-avatar--h4 { background: var(--sub-personal-social); }

.log-child__id { min-width: 0; }
.log-child__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--text-strong);
}
.log-child__name a { text-decoration: none; color: inherit; }
.log-child__name a:hover { text-decoration: underline; }
.log-child__tonight { color: var(--text-muted); font-weight: 400; }
.log-child__meta { font-size: 12.5px; color: var(--text-muted); margin: 2px 0 0; }
.log-child__switch {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: underline;
  white-space: nowrap;
}
.log-child__switch:hover { color: var(--text-strong); }

/* "How Sparqle works" -- the in-app explainer on the Log. */
.log-how-wrap {
  padding: 0 var(--site-pad) clamp(16px, 3vw, 24px);
  max-width: 760px;
  margin: 0 auto;
}
.log-how {
  border: 1px solid var(--border-soft); border-radius: 12px;
  background: var(--surface-card); padding: 12px 16px;
}
.log-how__summary {
  cursor: pointer; font-family: var(--font-display); text-transform: uppercase;
  letter-spacing: 0.08em; font-size: 13px; color: var(--text-strong); min-height: 24px;
}
.log-how__summary:hover { color: var(--text-muted); }
.log-how__intro { margin: 12px 0 10px; font-size: 15px; font-weight: 600; color: var(--text-strong); }
.log-how__moments {
  margin: 0 0 10px; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 18px;
}
.log-how__moments li { display: grid; gap: 3px; font-size: 14px; line-height: 1.5; color: var(--text-body); }
.log-how__moments strong { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.log-how__shoulder { margin: 0; font-size: 13px; color: var(--text-muted); font-style: italic; }
.log-details { margin-top: 6px; }
.log-details__summary {
  cursor: pointer; font-family: var(--font-mono); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint);
  padding: 10px 0; min-height: 44px; display: flex; align-items: center;
}
.log-details__summary:hover { color: var(--text-muted); }
.log-band__empty { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); padding: 6px 0; }

/* per-subject band -- the design's .subj-row */
.subj-band {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--surface-inset);
  padding: 12px 14px;
  margin: 0 0 10px;
}
.subj-band__head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.subj-band__next {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.subj-band__item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border-soft);
}
.subj-band__item:first-of-type { border-top: none; }
.subj-band__topic { font-size: 13.5px; font-weight: 600; color: var(--text-strong); min-width: 0; }
.subj-band__tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.subj-band__empty { font-size: 12.5px; color: var(--text-faint); font-style: italic; margin: 6px 0 2px; }

.mark-btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: var(--on-primary);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  padding: 0 14px;
  min-height: 44px; /* UX audit item 8: >=44px touch target, not 40px */
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.mark-btn:hover { background: var(--primary-hover); }

/* Mark is the one filled button on the Log (one tap, ninety seconds); the
   quiz is the optional outlined act beneath it. Full contrast, 44px. */
.subj-band__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quiz-btn {
  display: block;
  width: 100%;
  min-height: 44px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-strong);
  box-shadow: inset 0 0 0 1px var(--border-soft);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.quiz-btn:hover {
  background: var(--surface-sunk, transparent);
  box-shadow: inset 0 0 0 1px var(--text-faint);
}

/* subject pill -- tinted subject hue; color-mix toward --text-strong keeps
   the label AA in BOTH themes (darkens on paper, lightens at night). */
.subj-pill {
  --pill-c: var(--brand);
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: color-mix(in srgb, var(--pill-c) 14%, var(--surface-card));
  color: color-mix(in srgb, var(--pill-c) 62%, var(--text-strong));
}
.subj-pill--mathematics { --pill-c: var(--sub-mathematics); }
.subj-pill--science { --pill-c: var(--sub-science); }
.subj-pill--english { --pill-c: var(--sub-english); }
.subj-pill--history { --pill-c: var(--sub-history); }
.subj-pill--czech { --pill-c: var(--sub-personal-social); }

/* ==== onboarding / add-child (M3 screen 5) ====
   Minimal friction: three fields, then the privacy-minimal collection
   presented as a FEATURE (the reassuring consent panel), and the backfill
   beat after create. Reuses hx-field/hx-input/hx-btn throughout. */

.ob-page {
  padding: clamp(40px, 6vw, 56px) var(--site-pad) clamp(64px, 9vw, 96px);
  max-width: 560px;
  margin: 0 auto;
}
.ob-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 5vw, 38px);
  letter-spacing: -0.01em;
  color: var(--text-strong);
  margin: 0 0 24px;
}
.ob-card {
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 24px;
}
.ob-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .ob-row2 { grid-template-columns: 1fr; } }
.ob-help { font-size: 12.5px; line-height: 1.5; color: var(--text-faint); margin: -6px 0 18px; }

/* consent as a feature -- a calm inset panel, success-check headed, the
   legal checkbox living INSIDE the reassurance rather than below it */
.consent-feature {
  background: var(--surface-inset);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 14px 16px;
}
.consent-feature__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-strong);
  margin-bottom: 6px;
}
.consent-feature__check { color: var(--success); }
.consent-feature__body { font-size: 13px; line-height: 1.55; color: var(--text-muted); margin: 0 0 12px; }

.backfill-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(20px, 3.6vw, 24px);
  letter-spacing: -0.01em;
  color: var(--text-strong);
  margin: 0 0 10px;
}
.backfill-card__body { font-size: 14px; line-height: 1.6; color: var(--text-muted); margin: 0 0 12px; }
.backfill-card__sample {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.6;
  margin: 0 0 16px;
}
.backfill-card__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.backfill-card__actions .hx-btn { padding: 10px 18px; font-size: 13.5px; }
.backfill-card__spotcheck { font-size: 12.5px; color: var(--text-faint); font-style: italic; margin: 14px 0 0; }

/* ==== quiz (M3 screen 4) ====
   The rite of passage: progress pips (done-ok / done-wrong / current /
   pending), the question big and centered in the display face, three
   answer options as big calm cards -- each card IS the submit. Result
   states stay warm; the pass ceremony is sparkle.js via data-sparkle. */

.quiz-panel {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  box-shadow: var(--shadow);
  padding: 16px 18px 18px;
  margin-top: 8px;
}
.quiz-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.quiz-topic {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--text-strong);
}
.quiz-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.quiz-pips { display: flex; gap: 5px; margin-bottom: 16px; }
.quiz-pip { height: 5px; flex: 1; border-radius: 3px; background: var(--surface-inset); border: 1px solid var(--border-soft); }
.quiz-pip--good { background: var(--success); border-color: var(--success); }
.quiz-pip--bad { background: var(--danger); border-color: var(--danger); }
.quiz-pip--cur { background: var(--gold); border-color: var(--gold); }
.quiz-question {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(20px, 4vw, 26px);
  line-height: 1.3;
  color: var(--text-strong);
  text-align: center;
  margin: 6px 0 18px;
}
.quiz-opts { display: grid; gap: 10px; margin: 0; }
.quiz-opt {
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-card);
  border-radius: 14px;
  padding: 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--text-strong);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}
.quiz-opt:hover { border-color: var(--text-strong); background: var(--hov); }
.quiz-opt:active { transform: translateY(1px); }
/* htmx marks the whole form while the answer round-trips */
.quiz-opts.htmx-request .quiz-opt { opacity: 0.6; pointer-events: none; }

.quiz-panel--result { text-align: center; padding: 24px 20px; }
.quiz-result-icon { font-size: 32px; line-height: 1; margin-bottom: 10px; color: var(--text-muted); }
.quiz-result-icon--pass { color: var(--spark); filter: drop-shadow(0 0 6px var(--spark-glow)); }
.quiz-result-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  color: var(--text-strong);
  margin: 0 0 8px;
}
.quiz-result-sub { font-size: 13px; color: var(--text-muted); margin: 0 0 18px; }
.quiz-result-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 0; }

/* ==== coach-loop ==== */
/* C3: Brief/Do/Reflect/Payoff beats. Reuses
   hx-card/hx-btn/hx-pill/hx-callout/hx-checkrow/hx-field from the rest of
   the design system; only the pieces with no existing equivalent (the
   hold-to-confirm fill) get new rules here. */

.coach-beat {
  padding: 18px 20px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  margin-top: 16px;
}
.coach-beat__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px; font-weight: 700;
}
.coach-beat__kid-task {
  font-size: clamp(18px, 3.2vw, 22px);
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.4;
  margin-bottom: 14px;
}
.coach-beat__parent-check {
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-hairline);
  padding-top: 12px;
  margin-top: 14px;
}
.coach-beat__elapsed {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 10px; font-weight: 700;
}
/* app/static/coach.js flips this on once elapsed >= durationMin -- a
   quiet color change, never a sound/alarm/animation. */
.coach-beat__elapsed--ready { color: var(--accent); }
.coach-beat__section { margin-top: 18px; }
.coach-beat__section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px; font-weight: 700;
}

.coach-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }

.coach-outcome { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.coach-outcome label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.coach-outcome input { accent-color: var(--primary); }

/* Hold-to-confirm (app/static/coach.js): the fill bar animates scaleX
   0 -> 1 over --hold-ms while [data-hold-confirm] carries .is-holding; a
   release before the transition finishes never dispatches the "confirmed"
   event coach.js listens for, so the button's own base background is the
   only thing left showing -- no partial-submit state to worry about.
   --hold-fill is a translucent overlay tuned per theme to stay visible on
   the espresso (light) / white (night) primary button. */
.hold-confirm { position: relative; overflow: hidden; }
.hold-confirm__fill {
  position: absolute;
  inset: 0;
  z-index: 0;
  transform-origin: left;
  transform: scaleX(0);
  background: var(--hold-fill);
  pointer-events: none;
}
.hold-confirm.is-holding .hold-confirm__fill {
  transform: scaleX(1);
  transition: transform var(--hold-ms, 1500ms) linear;
}
.hold-confirm__label { position: relative; z-index: 1; }

/* Calm holds for everyone: honor reduced-motion (design files' rule). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* The quiz replaces the sheet header in the trail sheet, so it carries its
   own close control, right-aligned above the question. */
.quiz-close { margin: 0 0 8px auto; }
