/* ==========================================================================
   Sparqle design system -- DARK ("night") theme, adopted from the M1/M4
   design documents (canonical token table; dark contrast matrix verified
   0 AA failures against these exact pairings). This file previously held a
   Hexenkraft terminal-aesthetic reconstruction; FIX-L redefines the app's
   EXISTING token NAMES with the design system's VALUES, so every template's
   var() reference keeps working unchanged.

   Fonts are vendored locally under app/static/fonts/ (Fraunces, Public
   Sans, IBM Plex Mono -- all SIL Open Font License 1.1, see
   app/static/fonts/OFL-LICENSE.md); latin + latin-ext subsets only (Czech
   diacritics live in latin-ext). No external CDN font references (GDPR +
   offline dev).
   ========================================================================== */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/fonts/fraunces-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/fonts/fraunces-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;
}

@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/fonts/public-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/fonts/public-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;
}

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

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/ibm-plex-mono-normal-500-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;
}

:root {
  color-scheme: dark;

  /* surfaces -- design: paper / paper-raised / line-soft (as inset) */
  --bg: #1f221a;
  --surface-card: #2a2d23;
  --surface-inset: #35372b;

  /* borders -- design: line-soft hairlines, spark-tinted strong */
  --border-hairline: #35372b;
  --border-strong: rgba(var(--spark-rgb), 0.35);

  /* text -- design's ink scale: ink 13.0:1 (AAA) and ink-soft 6.7:1 (AAA)
     on paper, both from the AA-verified dark matrix. The design has no
     third text level: --text-faint is ink-soft at 70% alpha (est. ~4.8:1,
     still AA -- our computation, NOT from the matrix). */
  --text-strong: #ece7d3;
  --text-body: #ece7d3;
  --text-muted: #aca88f;
  --text-faint: rgba(var(--ink-soft-rgb), 0.7);

  /* accent + status -- design: spark 7.9:1 AA, gold 6.8:1 AA, success
     6.3:1 AA (as verified on paper). --info has no design token; mapped to
     the design's computing subject accent (6.3:1 AA). --danger is
     semantic, not brand: no design value exists, kept as-is. */
  --accent: #f0a63a;
  --success: #79ae89;
  --amber: #d2a04a;
  --info: #8ea0d8;
  --danger: #f87171;

  /* rgb companions so every rgba() derivative follows one token edit */
  --spark-rgb: 240, 166, 58;
  --gold-rgb: 210, 160, 74;
  --success-rgb: 121, 174, 137;
  --ink-soft-rgb: 172, 168, 143;

  /* fonts -- the design's three faces */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-body: 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* effects */
  --glow-text-sm: 0 0 12px rgba(var(--spark-rgb), 0.35);
  --glow-box: 0 0 50px rgba(var(--spark-rgb), 0.07);
  --scanlines-soft: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.015) 0px,
    rgba(255, 255, 255, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );

  /* layout -- design radius is 14px */
  --site-pad: clamp(20px, 5vw, 64px);
  --radius-sm: 14px;
}

* { 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;
}

a { color: inherit; }

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

/* CRT scanline overlay */
.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: 16px var(--site-pad);
  background: rgba(7, 8, 11, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-hairline);
}

.hx-wordmark {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  font-size: 15px;
  color: var(--text-strong);
}
.hx-wordmark .k { color: var(--accent); }

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

.hx-navlink {
  font-family: var(--font-mono);
  font-size: 13px;
  text-decoration: none;
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.hx-navlink:hover { color: var(--text-strong); }
.hx-navlink.active { color: var(--accent); }

/* ---- buttons ---- */
.hx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.hx-btn--sm { padding: 8px 16px; font-size: 12px; }
.hx-btn--lg { padding: 14px 26px; font-size: 14px; }
.hx-btn--block { width: 100%; }

.hx-btn--primary {
  background: var(--accent);
  color: #17120a;
  box-shadow: 0 0 22px rgba(var(--spark-rgb), 0.25);
}
.hx-btn--primary:hover { filter: brightness(1.08); }

.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); }

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

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

/* ---- terminal card ---- */
.hx-term {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  overflow: hidden;
}
.hx-term--glow { box-shadow: var(--glow-box); border-color: var(--border-strong); }

.hx-term__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-hairline);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}
.hx-term__dots { display: inline-flex; gap: 6px; }
.hx-term__dots i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-faint);
  display: inline-block;
}
.hx-term__dots i:nth-child(1) { background: #f87171; }
.hx-term__dots i:nth-child(2) { background: var(--accent); }
.hx-term__dots i:nth-child(3) { background: #4ade80; }

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

.hx-cursor::after {
  content: "\2588";
  margin-left: 4px;
  color: var(--accent);
  animation: hx-blink 1s steps(1) infinite;
}
@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;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.hx-card--hover:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.hx-card--ticks::before,
.hx-card--ticks::after {
  content: "";
  position: absolute;
  width: 8px; height: 8px;
  border-color: var(--border-strong);
  opacity: 0.6;
}
.hx-card--ticks::before {
  top: 6px; left: 6px;
  border-top: 1px solid var(--border-strong);
  border-left: 1px solid var(--border-strong);
}
.hx-card--ticks::after {
  bottom: 6px; right: 6px;
  border-bottom: 1px solid var(--border-strong);
  border-right: 1px solid var(--border-strong);
}

/* ---- badges ---- */
.hx-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-hairline);
  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); box-shadow: 0 0 6px var(--success); }
.hx-badge--amber { color: var(--amber); }
.hx-badge--amber .dot { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.hx-badge--info { color: var(--info); }
.hx-badge--info .dot { background: var(--info); box-shadow: 0 0 6px 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: 0.04em;
}
.hx-callout__body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

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

/* ---- footer ---- */
.hx-footer {
  position: relative;
  z-index: 1;
  padding: 40px var(--site-pad) 56px;
  border-top: 1px solid var(--border-hairline);
}

/* ---- 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: 0.06em;
}
.hx-input, .hx-select, textarea.hx-input {
  background: var(--surface-inset);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-strong);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}
.hx-input:focus, .hx-select:focus { border-color: var(--border-strong); }

.hx-checkrow {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}
.hx-checkrow input { margin-top: 3px; accent-color: var(--accent); }

/* 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 rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 18px;
}
.hx-alert--success {
  border-color: rgba(var(--success-rgb), 0.35);
  background: rgba(var(--success-rgb), 0.08);
  color: #86efac;
}
/* 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: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.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: 0.06em;
  color: var(--text-faint);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-hairline);
}
.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;
}
.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: rgba(255, 255, 255, 0.05); color: var(--text-faint); }
/* WS6-F4: the drawer's compute_state vocabulary -- frontier gets the
   ready/open affordance (accent outline, like trail-stone--frontier's
   accent stroke), locked the muted treatment (like trail-stone--locked's
   opacity). */
.hx-pill--frontier { background: rgba(var(--spark-rgb), 0.08); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(var(--spark-rgb), 0.35); }
.hx-pill--locked { background: rgba(255, 255, 255, 0.03); color: var(--text-faint); opacity: 0.6; }

@media (max-width: 760px) {
  .hx-nav { gap: 12px; }
  .hx-nav a:not(.hx-btn) { display: none; }
  .hx-roster-grid { grid-template-columns: 1fr !important; }
}

/* ==== trail ====
   M1.3 child trail view -- this page is handed to a kid, no account
   chrome. Stone states match DESIGN_M1.md section 3's table exactly:
   mastered = accent fill + check + glow; in-progress = inset surface +
   dashed amber stroke; frontier = card surface + solid accent stroke;
   locked = dimmed, inert (no hx-get on the element at all -- see
   app/templates/_fragments/_trail_stone.html). 375px works because the
   horizontal scroll lives on .trail-subject__scroll (per subject), never
   on the page itself -- .hx-wrap already sets overflow-x: clip above. */

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

.trail-intro {
  padding: clamp(28px, 5vw, 44px) var(--site-pad) clamp(12px, 2vw, 16px);
}
.trail-intro__title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: clamp(32px, 7vw, 52px);
  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-subject { padding: 0 var(--site-pad) clamp(28px, 4vw, 40px); }
.trail-subject__label {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.trail-subject__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.trail-svg { display: block; max-width: none; }

.trail-edge {
  stroke: var(--border-hairline);
  stroke-width: 2;
}

.trail-stone__circle {
  fill: var(--surface-card);
  stroke: var(--border-hairline);
  stroke-width: 2;
  transition: fill 0.15s ease, stroke 0.15s ease;
}
.trail-stone[hx-get] { cursor: pointer; }
.trail-stone:not([hx-get]) { cursor: default; }

.trail-stone--frontier .trail-stone__circle {
  fill: var(--surface-card);
  stroke: var(--accent);
  stroke-width: 2;
}
.trail-stone--in_progress .trail-stone__circle {
  fill: var(--surface-inset);
  stroke: var(--amber);
  stroke-width: 2;
  stroke-dasharray: 4 3;
}
.trail-stone--mastered .trail-stone__circle {
  fill: var(--accent);
  stroke: var(--accent);
  filter: drop-shadow(0 0 8px rgba(var(--spark-rgb), 0.55));
}
.trail-stone--mastered .trail-stone__check {
  fill: var(--bg);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 18px;
}
.trail-stone--locked {
  opacity: 0.4;
}

.trail-stone__label {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.3;
  color: var(--text-muted);
  text-align: center;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.trail-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  background: var(--surface-card);
  border-top: 1px solid var(--border-strong);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
}
.trail-drawer:empty { display: none; }

/* FIX-K: scrim + close control for the drawer (the prototype's .scrim spec,
   recolored to the house dark palette -- app --bg #07080b rather than the
   prototype's light-theme rgba). 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: rgba(7, 8, 11, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.trail-drawer__close {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border-hairline);
  background: var(--surface-card);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 16px;
  cursor: pointer;
}
.trail-drawer__close:hover {
  color: var(--text-strong);
  border-color: var(--border-strong);
}
#trail-drawer:not(:empty) ~ .trail-drawer__close { display: flex; }
@media (min-width: 761px) {
  #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);
  text-transform: uppercase;
  font-size: clamp(20px, 4vw, 26px);
  color: var(--text-strong);
  margin: 0;
}
.trail-drawer__description {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-body);
  margin: 0 0 12px;
}
.trail-drawer__standard {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  border: 1px solid var(--border-hairline);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 14px;
}
.trail-drawer__chips { margin-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* 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__chips-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-right: 4px;
}
.trail-drawer__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

@media (max-width: 400px) {
  .trail-drawer__actions { flex-direction: column; align-items: stretch; }
}

/* ==== 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-window-note {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 10px;
}

.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; }

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

/* ==== log-flow ==== */
/* M1.6: mobile-first dashboard log flow. Chips are the one-tap mark
   surface -- the whole point is a parent on a phone at 22:00. */
.log-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.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: 12px 0; min-height: 44px; display: flex; align-items: center;
}
.log-band { margin: 0 0 10px; }
.log-band__label {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px;
}
.log-band__chips {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.log-chip {
  display: flex; align-items: center; gap: 8px; flex: 0 0 auto;
  max-width: 240px; min-height: 44px; padding: 6px 6px 6px 12px;
  border: 1px solid var(--border-hairline); border-radius: 8px;
  background: var(--surface-card);
}
.log-chip--review { border-color: var(--accent); }
.log-chip__tag {
  font-family: var(--font-mono); font-size: 9px; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.06em; flex: 0 0 auto;
}
.log-chip__name {
  font-size: 13px; font-weight: 600; color: var(--text-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.log-chip__mark {
  flex: 0 0 auto; min-width: 44px; min-height: 44px; border-radius: 8px;
  border: 1px solid var(--accent); background: transparent; color: var(--accent);
  font-size: 16px; cursor: pointer;
}
.log-chip__mark:hover { background: var(--accent); color: #17120a; }
.log-band__empty { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); padding: 6px 0; }

/* ==== coach-loop ==== */
/* C3: spark card (atop the trail) + 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
   spark card's own layout, the hold-to-confirm fill) get new rules here. */

.coach-spark-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px;
  margin-bottom: 24px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
}
.coach-spark-card__kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.coach-spark-card__title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: clamp(20px, 3vw, 26px);
  color: var(--text-strong);
}
.coach-spark-card__why { font-size: 13px; color: var(--text-muted); margin: 0; }
.coach-spark-card__alternates { font-size: 12px; color: var(--text-faint); margin: 0; }
.coach-spark-card__actions { margin-top: 4px; }

.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: 0.06em;
  margin-bottom: 10px;
}
.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: 0.06em;
  margin-top: 10px;
}
/* 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: 0.06em;
  margin-bottom: 10px;
}

.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(--accent); }

/* 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-confirm { position: relative; overflow: hidden; }
.hold-confirm__fill {
  position: absolute;
  inset: 0;
  z-index: 0;
  transform-origin: left;
  transform: scaleX(0);
  background: rgba(255, 255, 255, 0.25);
  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; }
