/* Interview Coach: the one stylesheet. No build step, no external resources (the CSP allows same-origin only).
 * Design tokens, type, buttons, cards and chips are ported from the Lingua 5.4 interface; the coach hue replaces
 * its second brand colour. Light is the default, dark follows the system setting. */

/* ------------------------------------------------------------------------------------------------ fonts */
@font-face { font-family: "DM Sans"; src: url(/static/fonts/dm-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url(/static/fonts/dm-sans-latin-ext-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "DM Sans"; src: url(/static/fonts/dm-sans-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url(/static/fonts/dm-sans-latin-ext-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "DM Sans"; src: url(/static/fonts/dm-sans-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url(/static/fonts/dm-sans-latin-ext-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Newsreader"; src: url(/static/fonts/newsreader-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url(/static/fonts/newsreader-latin-ext-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Bricolage Grotesque"; src: url(/static/fonts/bricolage-grotesque-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url(/static/fonts/bricolage-grotesque-latin-ext-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB; }

/* ------------------------------------------------------------------------------------------------ tokens */
:root {
  color-scheme: light;
  --bg: #f5f1e8;
  --surface: #ffffff;
  --surface-2: #efeadf;
  --surface-sunken: #e9e4d8;
  --overlay: #17231f99;

  --text: #1a2433;
  --text-muted: #4f5a68;
  --text-on-primary: #ffffff;
  --border: #d9d2c3;
  --border-strong: #7d8796;

  --primary: #0b6b8f;
  --primary-hover: #095a79;
  --primary-edge: #084f6b;
  --primary-soft: #d9eef6;
  --text-on-primary-soft: #08506b;

  --coach: #5b4bb7;
  --coach-soft: #ece9fb;
  --text-on-coach: #ffffff;
  --text-on-coach-soft: #3d3290;

  --success: #17803d;
  --success-soft: #dcf3e2;
  --text-on-success-soft: #125f2e;
  --warning: #a15c00;
  --warning-soft: #fdedc8;
  --text-on-warning-soft: #6e3f00;
  --danger: #c0312b;
  --danger-soft: #fde3e0;
  --text-on-danger-soft: #8a1f1a;

  --band: #0c4660;
  --band-chip: #1d5a76;
  --text-on-band: #fbf7ef;
  --text-on-band-muted: #b9d6e3;

  --focus: #1d4ed8;
  --shadow-1: 0 1px 2px #1a243310, 0 1px 1px #1a24330a;
  --shadow-2: 0 2px 4px #1a24330f, 0 8px 20px #1a243314;

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem; --space-5: 1.25rem;
  --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem;
  --radius-sm: 10px; --radius-md: 14px; --radius-lg: 22px; --radius-full: 999px;
  --text-2xs: 0.8125rem; --text-xs: 0.875rem; --text-sm: 1rem; --text-md: 1.125rem; --text-lg: 1.375rem;
  --text-xl: 1.75rem; --text-2xl: 2.25rem; --text-3xl: 3.25rem;
  --leading-tight: 1.2; --leading-normal: 1.55; --leading-reading: 1.7;
  --font-ui: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-read: "Newsreader", Georgia, "Times New Roman", serif;
  --font-display: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;
  --target: 2.75rem;
  --dur-fast: 120ms; --dur-base: 200ms; --ease: cubic-bezier(0.2, 0, 0, 1);
  --nav-side: 15.5rem; --nav-bar: 4.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f151d; --surface: #18212c; --surface-2: #212c39; --surface-sunken: #0b1016; --overlay: #000000b3;
    --text: #eef1f5; --text-muted: #aab4c2; --text-on-primary: #06222e;
    --border: #334152; --border-strong: #7a889a;
    --primary: #5cc3e6; --primary-hover: #7fd0ee; --primary-edge: #2a8db1; --primary-soft: #14384a;
    --text-on-primary-soft: #bfe9f8;
    --coach: #b8aaff; --coach-soft: #2a2550; --text-on-coach: #1b1640; --text-on-coach-soft: #dcd5ff;
    --success: #6ee59a; --success-soft: #163626; --text-on-success-soft: #c4f5d6;
    --warning: #ffc35c; --warning-soft: #3a2a0c; --text-on-warning-soft: #ffe3ad;
    --danger: #ff9e94; --danger-soft: #45201d; --text-on-danger-soft: #ffd3cd;
    --band: #123b4f; --band-chip: #1d4c63; --text-on-band: #eef6fa; --text-on-band-muted: #a9cadb;
    --focus: #8ab4ff;
    --shadow-1: inset 0 1px 0 #ffffff0a; --shadow-2: inset 0 1px 0 #ffffff0d, 0 8px 24px #00000080;
  }
}

/* ------------------------------------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--text-sm) / var(--leading-normal) var(--font-ui); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; line-height: var(--leading-tight); font-weight: 700; font-family: var(--font-display); text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: var(--text-xl); }
h2 { font-size: var(--text-lg); }
h3 { font-size: var(--text-md); }
h4 { font-size: var(--text-sm); }
p { margin: 0; }
ul, ol { margin: 0; padding-left: 1.25rem; }
a { color: var(--primary); text-underline-offset: 0.2em; }
a:hover { color: var(--primary-hover); }
code, pre, kbd { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.92em; }
button, input, textarea, select { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
:focus:not(:focus-visible) { outline: none; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-4) 0; }
.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; }
.skip-link { position: absolute; left: var(--space-2); top: -4rem; z-index: 100; padding: var(--space-3) var(--space-4); background: var(--primary); color: var(--text-on-primary); border-radius: var(--radius-sm); }
.skip-link:focus { top: var(--space-2); }
.muted { color: var(--text-muted); }
.small { font-size: var(--text-xs); }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.right { text-align: right; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

.icon { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ------------------------------------------------------------------------------------------------ shell */
.shell { min-height: 100dvh; padding-bottom: calc(var(--nav-bar) + env(safe-area-inset-bottom, 0px)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-4); background: var(--band); color: var(--text-on-band); position: sticky; top: 0; z-index: 30; }
.brand { display: inline-flex; align-items: center; gap: var(--space-2); font: 700 var(--text-md) / 1 var(--font-display); color: inherit; text-decoration: none; letter-spacing: -0.01em; }
.brand__mark { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: var(--radius-sm); background: var(--text-on-band); color: var(--band); font: 700 1.05rem / 1 var(--font-display); }
.topbar .brand:hover { color: var(--text-on-band); }
.topbar__user { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-xs); color: var(--text-on-band-muted); }
.topbar__user form { margin: 0; }
.topbar .btn--ghost { color: var(--text-on-band); min-height: 2.25rem; padding: 0 var(--space-3); font-size: var(--text-xs); }
.topbar .btn--ghost:hover { background: var(--band-chip); color: var(--text-on-band); }
.topbar__email { display: none; }

.nav-side { display: none; }
.nav-side__inner { display: contents; }
.nav-bar { position: fixed; inset: auto 0 0 0; z-index: 40; display: flex; justify-content: space-around; min-height: calc(var(--nav-bar) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--surface); border-top: 1px solid var(--border); }
.nav-link { position: relative; flex: 1 1 0; min-width: var(--target); min-height: var(--target); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: var(--space-1); border: 0; background: transparent; color: var(--text-muted); font-size: 0.75rem; font-weight: 600; text-decoration: none; cursor: pointer; list-style: none; }
.nav-link:hover { color: var(--text); }
.nav-link .icon { width: 1.4rem; height: 1.4rem; }
.nav-link.is-active { color: var(--primary); }
.nav-link.is-active::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
.nav-badge { position: absolute; top: 4px; left: calc(50% + 4px); min-width: 1.25rem; height: 1.25rem; padding: 0 5px; border-radius: var(--radius-full); background: var(--danger); color: var(--surface); font-size: 0.7rem; font-weight: 700; line-height: 1.25rem; text-align: center; }
.nav-more { position: relative; flex: 1 1 0; display: flex; }
.nav-more > summary { width: 100%; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more__sheet { position: absolute; right: 0; bottom: calc(100% + 1px); width: min(20rem, 100vw); max-height: 70dvh; overflow: auto; padding: var(--space-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-2); display: grid; gap: 2px; }
.nav-more__sheet .nav-link { flex-direction: row; justify-content: flex-start; gap: var(--space-3); font-size: var(--text-sm); border-radius: var(--radius-md); padding: 0 var(--space-3); }
.nav-more__sheet .nav-link.is-active::before { display: none; }
.nav-more__sheet .nav-link.is-active { background: var(--primary-soft); color: var(--text-on-primary-soft); }
.nav-more__sheet .nav-badge { position: static; margin-left: auto; }

.main { width: 100%; max-width: 74rem; margin: 0 auto; padding: var(--space-5) var(--space-4) var(--space-8); display: grid; gap: var(--space-5); align-content: start; }
.main:focus { outline: none; }

@media (min-width: 960px) {
  .shell { padding-bottom: 0; display: grid; grid-template-columns: var(--nav-side) minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .topbar { grid-column: 1 / -1; }
  .nav-bar { display: none; }
  .nav-side { display: block; border-right: 1px solid var(--border); background: var(--surface); }
  .nav-side__inner { display: grid; align-content: start; gap: 2px; padding: var(--space-4) var(--space-3); position: sticky; top: 3.25rem; max-height: calc(100dvh - 3.25rem); overflow-y: auto; }
  .nav-side .nav-link { flex-direction: row; justify-content: flex-start; gap: var(--space-3); padding: 0 var(--space-3); font-size: var(--text-sm); border-radius: var(--radius-md); color: var(--text); }
  .nav-side .nav-link:hover { background: var(--surface-2); }
  .nav-side .nav-link.is-active { background: var(--primary-soft); color: var(--text-on-primary-soft); }
  .nav-side .nav-link.is-active::before { display: none; }
  .nav-side .nav-badge { position: static; margin-left: auto; }
  .nav-side__label { margin: var(--space-4) var(--space-3) var(--space-1); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
  .main { padding: var(--space-8) var(--space-8) var(--space-12); }
  .topbar__email { display: inline; }
}

/* ------------------------------------------------------------------------------------------------ page */
.page-head { display: grid; gap: var(--space-2); }
.page-head__row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3) var(--space-5); }
.eyebrow { font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-muted); }
.page-title { font-size: var(--text-xl); line-height: 1.1; letter-spacing: -0.02em; }
.page-sub { color: var(--text-muted); max-width: 62ch; }
@media (min-width: 960px) { .page-title { font-size: var(--text-2xl); } }
.crumbs { font-size: var(--text-xs); color: var(--text-muted); display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.crumbs a { color: var(--text-muted); }
.stack { display: grid; gap: var(--space-4); align-content: start; }
.stack--sm { gap: var(--space-2); }
.stack--lg { gap: var(--space-6); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.cluster--between { justify-content: space-between; }
.grid { display: grid; gap: var(--space-4); align-content: start; }
@media (min-width: 760px) {
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--main { grid-template-columns: minmax(0, 1.7fr) minmax(18rem, 1fr); align-items: start; }
}
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.section-title h2 { font-size: var(--text-md); }
.section-title a { font-size: var(--text-xs); font-weight: 600; }

/* ------------------------------------------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--target); padding: 0 var(--space-5); border: 1px solid transparent; border-radius: var(--radius-md); font-weight: 600; font-size: var(--text-sm); line-height: 1.2; cursor: pointer; text-decoration: none; transition: background-color var(--dur-fast) var(--ease), transform 80ms var(--ease); }
.btn--primary { background: var(--primary); color: var(--text-on-primary); box-shadow: 0 3px 0 var(--primary-edge); }
.btn--primary:hover { background: var(--primary-hover); color: var(--text-on-primary); }
.btn--secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: 0 2px 0 var(--border-strong); }
.btn--secondary:hover { background: var(--surface-2); color: var(--text); }
.btn--ghost { background: transparent; color: var(--primary); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--success { background: var(--success); color: var(--surface); box-shadow: 0 3px 0 #0e5a29; }
.btn--danger { background: var(--danger-soft); color: var(--text-on-danger-soft); border-color: var(--danger); }
.btn--danger:hover { background: var(--danger); color: var(--surface); }
.btn--coach { background: var(--coach); color: var(--text-on-coach); box-shadow: 0 3px 0 #3d3290; }
.btn--sm { min-height: 2.25rem; padding: 0 var(--space-3); font-size: var(--text-xs); border-radius: var(--radius-sm); }
.btn--block { width: 100%; }
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); box-shadow: none; cursor: not-allowed; }
.link-button { background: none; border: 0; padding: 0; color: var(--primary); font-weight: 600; text-decoration: underline; cursor: pointer; min-height: 0; }

/* ------------------------------------------------------------------------------------------------ chips */
.chip { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 1.75rem; padding: 0 0.65rem; border-radius: var(--radius-full); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: var(--text-2xs); font-weight: 600; line-height: 1.3; white-space: nowrap; text-decoration: none; }
a.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip--primary { background: var(--primary-soft); color: var(--text-on-primary-soft); border-color: var(--primary); }
.chip--coach { background: var(--coach-soft); color: var(--text-on-coach-soft); border-color: var(--coach); }
.chip--success { background: var(--success-soft); color: var(--text-on-success-soft); border-color: var(--success); }
.chip--warning { background: var(--warning-soft); color: var(--text-on-warning-soft); border-color: var(--warning); }
.chip--danger { background: var(--danger-soft); color: var(--text-on-danger-soft); border-color: var(--danger); }
.chip--muted { background: transparent; color: var(--text-muted); border-style: dashed; }
.chip--solid { background: var(--text); color: var(--bg); border-color: var(--text); }
.pl-badge { display: inline-block; padding: 0 0.4rem; margin-left: 0.35rem; border-radius: 6px; background: var(--warning-soft); color: var(--text-on-warning-soft); border: 1px solid var(--warning); font: 700 0.65rem / 1.5 var(--font-ui); letter-spacing: 0.06em; vertical-align: 0.1em; }
.confirm-marker { display: inline-block; padding: 0 0.35rem; border-radius: 6px; background: var(--warning-soft); color: var(--text-on-warning-soft); border: 1px dashed var(--warning); font-weight: 600; text-decoration: none; font-size: 0.9em; }
a.confirm-marker:hover { background: var(--warning); color: var(--surface); }
.track { display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 8px; font: 700 0.9rem / 1 var(--font-display); color: var(--text-on-primary); background: var(--primary); }
.track--B { background: var(--coach); color: var(--text-on-coach); }
.track--C { background: var(--success); color: var(--surface); }
.track--X { background: var(--warning); color: var(--surface); }
.dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--border-strong); }
.dot--ok { background: var(--success); } .dot--warn { background: var(--warning); } .dot--bad { background: var(--danger); }

/* ------------------------------------------------------------------------------------------------ cards, banners */
.card { padding: var(--space-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); display: grid; gap: var(--space-4); align-content: start; min-width: 0; }
.card--flush { padding: 0; overflow: hidden; gap: 0; }
.card--primary { background: var(--primary-soft); border-color: var(--primary); color: var(--text-on-primary-soft); }
.card--coach { background: var(--coach-soft); border-color: var(--coach); color: var(--text-on-coach-soft); }
.card--success { background: var(--success-soft); border-color: var(--success); color: var(--text-on-success-soft); }
.card--warning { background: var(--warning-soft); border-color: var(--warning); color: var(--text-on-warning-soft); }
.card--danger { background: var(--danger-soft); border-color: var(--danger); color: var(--text-on-danger-soft); }
.card--sunken { background: var(--surface-2); box-shadow: none; }
.card__title { font-size: var(--text-md); }
.card__title--row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.card__pad { padding: var(--space-5); }
.card--coach a, .card--primary a, .card--warning a, .card--danger a, .card--success a { color: inherit; font-weight: 600; }
.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-5); padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg); border: 1px solid var(--warning); background: var(--warning-soft); color: var(--text-on-warning-soft); }
.banner strong { font-family: var(--font-display); font-size: var(--text-md); }
.banner--info { border-color: var(--primary); background: var(--primary-soft); color: var(--text-on-primary-soft); }
.banner--danger { border-color: var(--danger); background: var(--danger-soft); color: var(--text-on-danger-soft); }
.banner--success { border-color: var(--success); background: var(--success-soft); color: var(--text-on-success-soft); }
.flash { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--success); background: var(--success-soft); color: var(--text-on-success-soft); font-weight: 600; }
.flash--error { border-color: var(--danger); background: var(--danger-soft); color: var(--text-on-danger-soft); }
.empty { padding: var(--space-8) var(--space-4); text-align: center; color: var(--text-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }

/* hero band */
.hero { position: relative; overflow: hidden; display: grid; gap: var(--space-4); padding: var(--space-6); border-radius: var(--radius-lg); background: var(--band); color: var(--text-on-band); box-shadow: var(--shadow-2); }
.hero::after { content: ""; position: absolute; right: -4rem; top: -4rem; width: 14rem; height: 14rem; border-radius: 50%; background: var(--band-chip); opacity: 0.55; pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-5); }
.hero__day { font: 700 var(--text-3xl) / 0.95 var(--font-display); letter-spacing: -0.03em; }
.hero__total { font-size: var(--text-lg); opacity: 0.8; }
.hero__day small { display: block; margin-bottom: var(--space-1); font: 600 var(--text-2xs) / 1 var(--font-ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-on-band-muted); }
.hero__focus { font: 700 var(--text-lg) / 1.2 var(--font-display); max-width: 34ch; }
.hero .chip { background: var(--band-chip); color: var(--text-on-band); border-color: transparent; }
.hero a { color: var(--text-on-band); }

progress.meter { appearance: none; -webkit-appearance: none; display: block; width: 100%; min-width: 5rem; height: 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--surface-sunken); overflow: hidden; color: var(--primary); }
progress.meter::-webkit-progress-bar { background: var(--surface-sunken); }
progress.meter::-webkit-progress-value { background: var(--primary); border-radius: var(--radius-full); }
progress.meter::-moz-progress-bar { background: var(--primary); border-radius: var(--radius-full); }
progress.meter--success::-webkit-progress-value { background: var(--success); }
progress.meter--success::-moz-progress-bar { background: var(--success); }
progress.meter--on-band { background: var(--band-chip); border-color: transparent; }
progress.meter--on-band::-webkit-progress-bar { background: var(--band-chip); }
progress.meter--on-band::-webkit-progress-value { background: var(--text-on-band); }
progress.meter--on-band::-moz-progress-bar { background: var(--text-on-band); }
.progress-line { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--space-3); font-size: var(--text-2xs); color: var(--text-muted); }

/* ------------------------------------------------------------------------------------------------ forms */
label, .label { display: block; font-weight: 600; font-size: var(--text-xs); margin-bottom: var(--space-1); }
.field { display: grid; gap: var(--space-1); align-content: start; min-width: 0; }
.field > label { margin: 0; }
.hint { font-size: var(--text-2xs); color: var(--text-muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=url], input[type=file], select, textarea {
  width: 100%; min-height: var(--target); padding: var(--space-2) var(--space-3); background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-md); }
textarea { min-height: 5.5rem; resize: vertical; line-height: 1.45; }
select { appearance: auto; }
input[type=checkbox], input[type=radio] { width: 1.25rem; height: 1.25rem; accent-color: var(--primary); flex: none; }
.check { display: flex; align-items: center; gap: var(--space-2); font-weight: 500; font-size: var(--text-sm); margin: 0; min-height: var(--target); }
.form { display: grid; gap: var(--space-3); }
.form-row { display: grid; gap: var(--space-3); }
@media (min-width: 640px) { .form-row { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); align-items: end; } }
.inline-form { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin: 0; }
.inline-form select, .inline-form input { width: auto; }
.filters { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: end; padding: var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.filters .field { min-width: 8rem; flex: 1 1 8rem; }
.filters .btn { flex: none; }
details > summary { cursor: pointer; }
details.disclosure { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
details.disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: var(--target); padding: 0 var(--space-4); font-weight: 600; list-style: none; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after { content: "+"; font: 700 1.25rem / 1 var(--font-display); color: var(--text-muted); }
details.disclosure[open] > summary::after { content: "\2212"; }
details.disclosure > .disclosure__body { padding: 0 var(--space-4) var(--space-4); display: grid; gap: var(--space-3); }

/* tabs (links) */
.tabs { display: flex; gap: var(--space-1); padding: var(--space-1); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; min-height: 2.25rem; padding: 0 var(--space-4); border-radius: var(--radius-sm); font-weight: 600; color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.tabs a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); outline: 1px solid var(--border-strong); }

/* ------------------------------------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
table.table { width: 100%; border-collapse: collapse; font-size: var(--text-xs); }
.table th { text-align: left; font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; padding: var(--space-3) var(--space-3); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: var(--space-3); border-bottom: 1px solid var(--border); vertical-align: top; }
.table .title-cell { min-width: 15rem; width: 36%; }
.table .title-cell .cluster { margin-top: var(--space-1); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--primary-soft) 45%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .rank { font: 700 var(--text-lg) / 1 var(--font-display); color: var(--text-muted); width: 3.2rem; }
.table .title-cell strong { display: block; font-size: var(--text-sm); }
.table .title-cell a { color: var(--text); font-weight: 700; text-decoration: none; }
.table .title-cell a:hover { color: var(--primary); text-decoration: underline; }
.table .score { font: 700 var(--text-md) / 1 var(--font-display); }
@media (max-width: 759px) {
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; }
  .table--stack tr { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
  .table--stack td { padding: 2px 0; border: 0; display: flex; gap: var(--space-3); align-items: baseline; justify-content: space-between; text-align: right; }
  .table--stack td[data-label]::before { content: attr(data-label); color: var(--text-muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; text-align: left; flex: none; }
  .table--stack td.title-cell { display: block; text-align: left; padding-bottom: var(--space-1); }
  .table--stack td.title-cell::before, .table--stack td.rank::before { content: none; }
  .table--stack td.rank { display: inline-block; width: auto; margin-right: var(--space-2); }
  .table--stack td.num { text-align: right; }
}
.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); margin: 0; font-size: var(--text-xs); }
.kv dt { color: var(--text-muted); font-weight: 600; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.list-plain { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.list-rows { list-style: none; padding: 0; margin: 0; }
.list-rows > li { padding: var(--space-3) 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.list-rows > li:last-child { border-bottom: 0; padding-bottom: 0; }
.list-rows > li:first-child { padding-top: 0; }
.grow { flex: 1 1 12rem; min-width: 0; }

/* ------------------------------------------------------------------------------------------------ prose and copy */
.prose { max-width: 70ch; font-family: var(--font-read); font-size: var(--text-md); line-height: var(--leading-reading); }
.prose--ui { font-family: var(--font-ui); font-size: var(--text-sm); line-height: 1.6; }
.prose > * + * { margin-top: var(--space-4); }
.prose h1, .prose h2, .prose h3 { margin-top: var(--space-6); font-family: var(--font-display); }
.prose h1 { font-size: var(--text-lg); } .prose h2 { font-size: var(--text-md); } .prose h3 { font-size: var(--text-sm); }
.prose blockquote { margin-left: 0; padding: var(--space-3) var(--space-4); border-left: 4px solid var(--primary); background: var(--primary-soft); color: var(--text-on-primary-soft); border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.prose blockquote > * + * { margin-top: var(--space-2); }
.prose table { border-collapse: collapse; width: 100%; font-family: var(--font-ui); font-size: var(--text-xs); display: block; overflow-x: auto; }
.prose th, .prose td { padding: var(--space-2) var(--space-3); border: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); }
.prose code { background: var(--surface-2); padding: 0 0.3em; border-radius: 5px; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: var(--space-1); }
.prose-card { padding: var(--space-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.copywrap { position: relative; }
.copybox { position: relative; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); padding-right: 5.5rem; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--text-xs); line-height: 1.5; }
.copybox--plain { font-family: var(--font-ui); font-size: var(--text-sm); }
.copybox--tall { max-height: 22rem; overflow: auto; }
.copybox__btn { position: absolute; top: var(--space-2); right: var(--space-2); }
.say { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--coach-soft); color: var(--text-on-coach-soft); border: 1px solid var(--coach); font-weight: 600; }
.say::before { content: "Say: "; font-weight: 700; opacity: 0.75; }
.say--plain::before { content: none; }

/* ------------------------------------------------------------------------------------------------ login */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: var(--space-5) var(--space-4); background: var(--band); }
.auth__card { width: min(26rem, 100%); background: var(--surface); border-radius: var(--radius-lg); padding: var(--space-6); display: grid; gap: var(--space-4); box-shadow: var(--shadow-2); }
.auth__card--wide { width: min(44rem, 100%); }
.auth .brand { color: var(--text); }
.auth .brand__mark { background: var(--band); color: var(--text-on-band); }
.error { color: var(--danger); font-weight: 600; margin: 0; }

/* ------------------------------------------------------------------------------------------------ today */
.block-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); }
.block { display: grid; grid-template-columns: 4.25rem 1fr; gap: var(--space-4); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.block__min { display: grid; place-items: center; align-content: center; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--text-on-primary-soft); font: 700 var(--text-lg) / 1 var(--font-display); min-height: 3.5rem; }
.block__min small { display: block; font: 600 0.65rem / 1 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 2px; }
.block__do { font-weight: 600; }
.block__out { font-size: var(--text-xs); color: var(--text-muted); }
.when { display: inline-grid; place-items: center; min-width: 3.4rem; padding: 0.2rem 0.5rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font: 700 var(--text-xs) / 1.15 var(--font-display); text-align: center; }
.when--soon { background: var(--warning-soft); border-color: var(--warning); color: var(--text-on-warning-soft); }
.when--urgent { background: var(--danger-soft); border-color: var(--danger); color: var(--text-on-danger-soft); }
.task-check { display: flex; align-items: flex-start; gap: var(--space-3); }
.task-check form { margin: 0; flex: none; }
.checkbox-btn { width: 1.75rem; height: 1.75rem; margin-top: 2px; border-radius: 8px; border: 2px solid var(--border-strong); background: var(--surface); cursor: pointer; padding: 0; display: grid; place-items: center; color: transparent; font-weight: 700; }
.checkbox-btn:hover { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.checkbox-btn::after { content: "\2713"; }
.is-done .task-title { text-decoration: line-through; color: var(--text-muted); }
.is-done .checkbox-btn { border-color: var(--success); background: var(--success-soft); color: var(--success); pointer-events: none; }

/* ------------------------------------------------------------------------------------------------ lessons */
.track-head { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-5); border-radius: var(--radius-lg); background: var(--band); color: var(--text-on-band); }
.track-head h2 { font-size: var(--text-lg); }
.track-head p { color: var(--text-on-band-muted); font-size: var(--text-xs); }
.track-head--ai { background: #3d3290; }
.track-head--process { background: #0e5a3a; }
@media (prefers-color-scheme: dark) { .track-head--ai { background: #2a2550; } .track-head--process { background: #123b2c; } .track-head--ai h2, .track-head--process h2 { color: var(--text-on-band); } }
.track-head__count { margin-left: auto; font: 700 var(--text-xl) / 1 var(--font-display); text-align: right; }
.track-head__count small { display: block; font: 600 0.7rem / 1.2 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-on-band-muted); }
.module { display: grid; gap: var(--space-2); }
.module h3 { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.module h3 span { font: 600 var(--text-xs) / 1.3 var(--font-ui); color: var(--text-muted); }
.lesson-row { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-4); align-items: center; padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); text-decoration: none; }
a.lesson-row:hover { border-color: var(--primary); box-shadow: var(--shadow-1); color: var(--text); }
.lesson-row--planned { background: transparent; border-style: dashed; color: var(--text-muted); }
.lesson-row__id { font: 700 var(--text-xs) / 1 var(--font-display); min-width: 3.5rem; padding: 0.4rem 0.5rem; border-radius: var(--radius-sm); background: var(--surface-2); text-align: center; }
.lesson-row__main { min-width: 0; }
.lesson-row__title { font-weight: 600; }
.lesson-row__meta { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; grid-column: 2; }
.ev { font-weight: 700; }
.ev--E0 { color: var(--text-muted); }

.lesson-head { display: grid; gap: var(--space-4); padding: var(--space-6); border-radius: var(--radius-lg); background: var(--band); color: var(--text-on-band); }
.lesson-head .chip { background: var(--band-chip); color: var(--text-on-band); border-color: transparent; }
.lesson-head h1 { font-size: var(--text-xl); }
.lesson-head p { color: var(--text-on-band-muted); max-width: 64ch; font-size: var(--text-md); }
.lesson-head .eyebrow { color: var(--text-on-band-muted); }
.tile { display: grid; align-content: start; gap: var(--space-2); padding: var(--space-4); border-radius: var(--radius-md); background: var(--primary-soft); color: var(--text-on-primary-soft); }
.tile h3 { font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; }
.tile ul { margin: 0; padding-left: 1.1rem; display: grid; gap: var(--space-1); }
.dialogue { display: grid; gap: var(--space-3); }
.dialogue__line { display: grid; gap: var(--space-1); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--surface-2); max-width: 46rem; }
.dialogue__line--alt { background: var(--primary-soft); color: var(--text-on-primary-soft); margin-left: auto; }
.dialogue__who { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; opacity: 0.8; }
.gloss { font-size: var(--text-xs); color: var(--text-muted); }
.gloss summary { display: inline-block; cursor: pointer; font-weight: 600; color: var(--primary); }
.dialogue__line--alt .gloss { color: inherit; }
.phrase-grid { display: grid; gap: var(--space-3); }
@media (min-width: 760px) { .phrase-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.phrase { padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); display: grid; gap: var(--space-1); }
.phrase strong { font-size: var(--text-md); font-family: var(--font-display); }
.phrase .gloss summary::marker { content: ""; }
.script-line { padding: var(--space-4); border-left: 5px solid var(--coach); background: var(--surface); border-radius: 0 var(--radius-md) var(--radius-md) 0; border-top: 1px solid var(--border); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: grid; gap: var(--space-2); }
.script-line__id { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-on-coach-soft); }
.script-line__en { font: var(--text-md) / 1.55 var(--font-read); }
.slot { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); display: grid; gap: var(--space-1); }
.slot--open { border-style: dashed; border-color: var(--warning); background: var(--warning-soft); color: var(--text-on-warning-soft); }
.slot__name { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.slot--open .slot__name { color: inherit; }

/* exercises */
.exercise { display: grid; gap: var(--space-4); padding: var(--space-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); border-left: 6px solid var(--primary); scroll-margin-top: 5rem; }
.exercise[data-state="done"] { border-left-color: var(--success); }
.exercise[data-state="partly"] { border-left-color: var(--warning); }
.exercise--coach { border-left-color: var(--coach); }
.exercise__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.exercise__head h3 { flex: 1 1 14rem; }
.exercise__prompt { font-size: var(--text-md); }
.exercise__body { display: grid; gap: var(--space-4); }
.exercise__result { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--surface-2); font-weight: 600; }
.exercise__result--ok { background: var(--success-soft); color: var(--text-on-success-soft); }
.exercise__result--bad { background: var(--warning-soft); color: var(--text-on-warning-soft); }
.exercise__saved { font-size: var(--text-xs); color: var(--text-muted); }
.needs-js { padding: var(--space-3) var(--space-4); border: 1px dashed var(--border-strong); border-radius: var(--radius-md); color: var(--text-muted); font-size: var(--text-xs); }
.js .needs-js { display: none; }
.q { display: grid; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg); }
.q__prompt { font-weight: 600; font-size: var(--text-md); }
.opts { display: grid; gap: var(--space-2); }
.opt { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); min-height: var(--target); border: 2px solid var(--border); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; text-align: left; font-weight: 500; width: 100%; }
.opt:hover { border-color: var(--primary); }
.opt[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--text-on-primary-soft); }
.opt[data-verdict="right"] { border-color: var(--success); background: var(--success-soft); color: var(--text-on-success-soft); }
.opt[data-verdict="wrong"] { border-color: var(--danger); background: var(--danger-soft); color: var(--text-on-danger-soft); }
.opt[data-verdict="key"] { border-color: var(--success); border-style: dashed; }
.opt:disabled { cursor: default; }
.explain { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--primary-soft); color: var(--text-on-primary-soft); font-size: var(--text-xs); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); counter-reset: step; }
.steps li { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-md); counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--surface-2); font: 700 var(--text-xs) / 1 var(--font-display); }
.steps li[data-verdict="right"] { border-color: var(--success); background: var(--success-soft); }
.steps li[data-verdict="wrong"] { border-color: var(--danger); background: var(--danger-soft); }
.steps__text { flex: 1; min-width: 0; }
.steps__move { display: inline-flex; gap: var(--space-1); }
.steps__move button { width: 2.5rem; height: 2.5rem; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-weight: 700; }
.flash-card { display: grid; gap: var(--space-3); padding: var(--space-6); border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--border); text-align: center; min-height: 12rem; align-content: center; }
.flash-card__front { font: 700 var(--text-xl) / 1.15 var(--font-display); }
.flash-card__back { display: grid; gap: var(--space-2); text-align: left; max-width: 40rem; margin: 0 auto; }
.flash-card__box { font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.boxes { display: flex; gap: var(--space-1); justify-content: center; }
.boxes span { width: 1.9rem; height: 0.5rem; border-radius: var(--radius-full); background: var(--surface-sunken); border: 1px solid var(--border); }
.boxes span[data-on] { background: var(--primary); border-color: var(--primary); }
.timer { display: grid; gap: var(--space-3); justify-items: center; padding: var(--space-5); border-radius: var(--radius-lg); background: var(--primary-soft); color: var(--text-on-primary-soft); }
.timer__time { font: 700 var(--text-3xl) / 1 var(--font-display); font-variant-numeric: tabular-nums; }
.timer progress.meter { width: min(24rem, 100%); background: var(--surface); }
.rate { display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg); }
.rate__choices { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.rate__choice { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target); padding: 0 var(--space-4); border: 2px solid var(--border); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; font-weight: 600; }
.rate__choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--text-on-primary-soft); }
.rate__choice input { position: absolute; opacity: 0; pointer-events: none; }
.cloze { font: var(--text-md) / 2.4 var(--font-read); }
.cloze input { display: inline-block; width: 7rem; min-height: 2rem; padding: 0 var(--space-2); margin: 0 0.15rem; vertical-align: baseline; text-align: center; border-radius: var(--radius-sm); }
.cloze input[data-verdict="right"] { border-color: var(--success); background: var(--success-soft); }
.cloze input[data-verdict="wrong"] { border-color: var(--danger); background: var(--danger-soft); }
.recorder { display: grid; gap: var(--space-3); padding: var(--space-4); border: 1px dashed var(--border-strong); border-radius: var(--radius-md); }
.recorder audio { width: 100%; }
.rec-dot { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--danger); }

/* ------------------------------------------------------------------------------------------------ facts */
.fact-card { display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--warning); border-radius: var(--radius-lg); scroll-margin-top: 5rem; }
.fact-card[data-status="confirmed"] { border-left-color: var(--success); }
.fact-card[data-status="do_not_use"] { border-left-color: var(--danger); }
.fact-card[data-status="unknown"] { border-left-color: var(--border-strong); }
.fact-card[data-conflict] { border-left-color: var(--danger); }
.fact-card.is-done { border-left-color: var(--success); background: var(--success-soft); color: var(--text-on-success-soft); }
.fact-card.is-done .fact-card__actions, .fact-card.is-done .fact-edit { display: none; }
.fact-card__top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.fact-card__label { font-weight: 600; font-size: var(--text-sm); }
.fact-card__id { font-size: var(--text-2xs); color: var(--text-muted); }
.fact-card__value { font: 700 var(--text-lg) / 1.15 var(--font-display); overflow-wrap: anywhere; }
.fact-card__value small { font: 500 var(--text-sm) / 1.2 var(--font-ui); color: var(--text-muted); margin-left: var(--space-2); }
.fact-card__meta { font-size: var(--text-xs); color: var(--text-muted); }
.fact-card__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.fact-card__actions form { margin: 0; }
.fact-card__actions > form:first-child { flex: 1 1 8rem; }
.fact-card__actions .more { flex: 0 0 auto; }
.more > summary { list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more[open] { flex: 1 1 100%; }
.more__body { display: grid; gap: var(--space-3); padding: var(--space-3); margin-top: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg); }
.fact-card__msg { font-weight: 600; }
.conflicts { display: grid; gap: var(--space-2); }
.conflict { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--danger-soft); color: var(--text-on-danger-soft); }
.conflict__val { font-weight: 700; font-family: var(--font-display); }
.conflict__src { font-size: var(--text-2xs); flex: 1 1 8rem; opacity: 0.9; }
.conflict form { margin: 0; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--space-3); }
.stat { padding: var(--space-4); border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); display: grid; gap: 2px; }
.stat__n { font: 700 var(--text-2xl) / 1 var(--font-display); overflow-wrap: anywhere; }
.stat__n.mono { font-size: var(--text-lg); font-family: ui-monospace, monospace; }
.stat__l { font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.stat--warn { background: var(--warning-soft); border-color: var(--warning); color: var(--text-on-warning-soft); }
.stat--bad { background: var(--danger-soft); border-color: var(--danger); color: var(--text-on-danger-soft); }
.stat--ok { background: var(--success-soft); border-color: var(--success); color: var(--text-on-success-soft); }
.stat--warn .stat__l, .stat--bad .stat__l, .stat--ok .stat__l { color: inherit; opacity: 0.85; }

/* ------------------------------------------------------------------------------------------------ offers */
.offer-head { display: grid; gap: var(--space-4); padding: var(--space-6); border-radius: var(--radius-lg); background: var(--band); color: var(--text-on-band); }
.offer-head h1 { font-size: var(--text-xl); }
.offer-head .eyebrow { color: var(--text-on-band-muted); }
.offer-head .chip { background: var(--band-chip); color: var(--text-on-band); border-color: transparent; }
.offer-head .chip--warning { background: var(--warning-soft); color: var(--text-on-warning-soft); }
.offer-head .chip--danger { background: var(--danger-soft); color: var(--text-on-danger-soft); }
.offer-head .chip--success { background: var(--success-soft); color: var(--text-on-success-soft); }
.offer-head a { color: var(--text-on-band); }
.offer-head__row { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-6); align-items: center; justify-content: space-between; }
.bigscore { display: flex; align-items: baseline; gap: var(--space-3); font-family: var(--font-display); }
.bigscore__n { font-size: var(--text-3xl); line-height: 1; font-weight: 700; letter-spacing: -0.03em; }
.bigscore__rank { font-size: var(--text-md); color: var(--text-on-band-muted); }
.bars { display: grid; gap: var(--space-2); }
.bar { display: grid; grid-template-columns: 5.5rem 1fr 2rem; gap: var(--space-3); align-items: center; font-size: var(--text-xs); }
.bar__val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.pipeline { display: grid; gap: var(--space-4); }
@media (min-width: 760px) { .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .pipeline { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.pipeline__col { display: grid; gap: var(--space-2); align-content: start; padding: var(--space-3); background: var(--surface-2); border-radius: var(--radius-lg); }
.pipeline__col h3 { display: flex; justify-content: space-between; align-items: center; font-size: var(--text-xs); letter-spacing: 0.07em; text-transform: uppercase; }
.pipe-card { display: grid; gap: var(--space-1); padding: var(--space-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); text-decoration: none; color: var(--text); font-size: var(--text-xs); }
.pipe-card:hover { border-color: var(--primary); color: var(--text); }
.pipe-card strong { font-size: var(--text-sm); }
.copy-field { display: grid; gap: var(--space-2); }
.pack-msg { white-space: pre-wrap; font: var(--text-sm) / 1.55 var(--font-ui); }
.dossier-sec { display: grid; gap: var(--space-3); }
.dossier-sec h3 { padding-bottom: var(--space-1); border-bottom: 2px solid var(--primary); width: fit-content; }
.req { display: grid; gap: var(--space-1); padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }

/* ------------------------------------------------------------------------------------------------ simulations */
.sim-card { display: grid; gap: var(--space-3); padding: var(--space-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); align-content: start; }
.sim-card__code { font: 700 var(--text-lg) / 1 var(--font-display); color: var(--primary); }
.outline { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.score-cell { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; font: 700 var(--text-sm) / 1 var(--font-display); background: var(--surface-2); }
.score-cell--0 { background: var(--danger-soft); color: var(--text-on-danger-soft); }
.score-cell--1 { background: var(--warning-soft); color: var(--text-on-warning-soft); }
.score-cell--2 { background: var(--success-soft); color: var(--text-on-success-soft); }
.fix { display: grid; gap: var(--space-1); padding: var(--space-3); border-radius: var(--radius-md); background: var(--surface-2); font-size: var(--text-xs); }
.fix__said { color: var(--text-on-danger-soft); text-decoration: line-through; text-decoration-color: var(--danger); }
.fix__better { color: var(--text-on-success-soft); font-weight: 600; }
.twocol { display: grid; gap: var(--space-4); }
@media (min-width: 760px) { .twocol { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }

/* ------------------------------------------------------------------------------------------------ misc */
.token-box { padding: var(--space-4); border-radius: var(--radius-md); background: var(--success-soft); border: 1px solid var(--success); color: var(--text-on-success-soft); display: grid; gap: var(--space-2); }
.token-box code { font-size: var(--text-sm); overflow-wrap: anywhere; user-select: all; }
.sev { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 3px; }
.sev--blocker { background: var(--danger); } .sev--high { background: var(--warning); } .sev--medium { background: var(--primary); } .sev--low { background: var(--border-strong); }
.footer-note { font-size: var(--text-2xs); color: var(--text-muted); text-align: center; padding-top: var(--space-4); }

/* link cards */
a.card { text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--primary); color: inherit; }

.list-rows a:not(.btn):not(.chip) { color: var(--text); text-decoration: none; }
.list-rows a:not(.btn):not(.chip):hover { color: var(--primary); text-decoration: underline; }
.list-rows .task-title { font-weight: 600; }

@media (max-width: 759px) {
  .main { padding: var(--space-4) var(--space-3) var(--space-8); gap: var(--space-4); }
  .card { padding: var(--space-4); }
  .hero { padding: var(--space-5); }
  .hero__day { font-size: 2.6rem; }
  .page-title { font-size: 1.6rem; }
}

.fact-card__value--long { font: 600 var(--text-md) / 1.3 var(--font-ui); }
.fact-card__label a { color: var(--text); text-decoration: none; }
.fact-card__label a:hover { color: var(--primary); text-decoration: underline; }
.conflict { padding: 0.4rem 0.65rem; gap: 0.25rem 0.65rem; }
.conflict__val { font-size: var(--text-sm); }
.table .rate-cell { max-width: 9rem; white-space: normal; }
@media (max-width: 759px) {
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
  .stat { padding: var(--space-2) var(--space-3); }
  .stat__n { font-size: 1.5rem; }
}

/* nothing may push the page wider than the screen */
.stack > *, .grid > *, .block > *, .twocol > *, .pipeline > *, .main > * { min-width: 0; }
.chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.table .chip, .when, .hero .chip, .nav-badge { white-space: nowrap; }
.card, .tile, .req, .dossier-sec, .prose, .exercise, .slot, .fact-card { overflow-wrap: anywhere; }
.block .cluster { min-width: 0; }

/* the ranking table becomes one compact card per offer on a phone */
@media (max-width: 759px) {
  .table--rank thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--rank, .table--rank tbody { display: block; }
  .table--rank tr { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
  .table--rank td { display: block; padding: 0; border: 0; text-align: left; }
  .table--rank td.rank { flex: 0 0 1.6rem; width: auto; font-size: var(--text-lg); align-self: flex-start; order: 1; }
  .table--rank td.title-cell { flex: 1 1 calc(100% - 7.6rem); min-width: 0; width: auto; order: 2; }
  .table--rank td.c-score { flex: 0 0 auto; margin-left: auto; text-align: right; align-self: flex-start; order: 3; }
  .table--rank td.c-score .small { display: none; }
  .table--rank td.c-track { margin-left: 2.2rem; order: 4; }
  .table--rank td.c-rate { order: 5; font-size: var(--text-xs); text-align: left; }
  .table--rank td.c-exp { order: 6; }
  .table--rank td.c-status { order: 7; margin-left: auto; text-align: right; }
  .table--rank td.c-status br, .table--rank .no-app { display: none; }
  .table--rank .chip { font-size: 0.72rem; padding: 0 0.5rem; }
}

/* facts: candidate values and fill-in questions */
.candidate { display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg); }
@media (min-width: 640px) { .candidate { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }
.candidate__value { font: 700 var(--text-md) / 1.3 var(--font-display); display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.candidate__src { font-size: var(--text-xs); color: var(--text-muted); }
.candidate form { margin: 0; }
.candidate .btn { width: 100%; }
.fact-card__question { font-weight: 600; }
.fact-card__used { padding-top: var(--space-1); }
.fact-card.is-done .fact-card__used { color: inherit; }
.fact-card.is-done .candidate, .fact-card.is-done .conflicts, .fact-card.is-done form, .fact-card.is-done details { display: none; }
