/* Spanish Learning App — dark, analytical. Palette validated with the dataviz validator (dark surface #1a1a19).
   Design system: Whoop/Strava data feel, Linear chrome. One accent (--s1). Hairlines, not boxes. 8-pt rhythm.
   Type scale (every screen): hero 56 · heading 20 · body 15 · caption 12. List-row numbers are always 20px tabular. */
:root {
  color-scheme: dark;
  --bg: #1a1a19;
  --surface: #222221;
  --surface-2: #2b2b29;
  --line: #3a3a37;
  --hair: #2e2e2c;            /* hairline divider, quieter than --line */
  --text: #f2f1ec;
  --text-2: #c3c2b7;
  --muted: #8a8980;
  --s1: #3987e5;  /* blue    */
  --s2: #d95926;  /* orange  */
  --s3: #199e70;  /* aqua    */
  --s4: #c98500;  /* yellow  */
  --s5: #d55181;  /* magenta */
  --s6: #008300;  /* green   */
  --good: #0ca30c; --warn: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --accent: var(--s1);
  --accent-soft: rgba(57, 135, 229, .14);
  --radius: 12px;
  --radius-sm: 8px;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --sans: -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
  --pad: 20px;                /* section/card padding (desktop) */
  --fs-hero: 56px; --fs-h: 20px; --fs-body: 15px; --fs-cap: 12px;
  --tab-h: 56px;              /* bottom tab bar height (excl. safe area) */
  --sab: env(safe-area-inset-bottom, 0px);
  --sat: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: var(--fs-body); line-height: 1.5; }
body { -webkit-font-smoothing: antialiased; padding-top: var(--sat); }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: var(--fs-h); margin: 0 0 var(--sp-4); font-weight: 700; letter-spacing: -.015em; line-height: 1.25; }
h2, .label { font-size: var(--fs-cap); margin: 0 0 var(--sp-3); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.label { display: inline-block; margin: 0; }
h3 { font-size: var(--fs-h); margin: 0 0 var(--sp-2); font-weight: 600; }
p { margin: 0 0 var(--sp-3); }
small, .muted { color: var(--muted); }
small, .caption { font-size: var(--fs-cap); }
code, .mono { font-family: var(--mono); font-size: var(--fs-cap); }
.num, .tabular { font-variant-numeric: tabular-nums; }
.ok { color: var(--good); } .err { color: var(--critical); } .part { color: var(--warn); }

/* ---------- desktop top nav (Linear-like: hairline, one accent) ---------- */
nav.top { display: flex; align-items: center; gap: 4px; height: 52px; padding: 0 var(--sp-5); border-bottom: 1px solid var(--hair); background: var(--bg); position: sticky; top: 0; z-index: 30; }
nav.top .brand { font-weight: 700; margin-right: var(--sp-4); color: var(--text); letter-spacing: -.01em; }
nav.top .brand b { color: var(--accent); font-weight: 800; margin-right: 6px; font-size: var(--fs-cap); letter-spacing: .04em; }
nav.top a.nl { color: var(--text-2); padding: 0 12px; height: 52px; display: inline-flex; align-items: center; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
nav.top a.nl:hover { color: var(--text); text-decoration: none; }
nav.top a.nl.active { color: var(--text); border-bottom-color: var(--accent); }
nav.top .right { margin-left: auto; display: flex; gap: var(--sp-4); align-items: center; font-size: var(--fs-cap); color: var(--muted); }
nav.top .right a { color: var(--muted); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.ok { background: var(--good); } .dot.bad { background: var(--critical); }
.streak { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- bottom tab bar (mobile only): opaque, top hairline, 5 × 44+ targets ---------- */
nav.tabs { display: none; }
@media (max-width: 700px) {
  nav.top { display: none; }
  nav.tabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--tab-h) + var(--sab)); padding-bottom: var(--sab); background: var(--bg); border-top: 1px solid var(--hair); }
  nav.tabs a, nav.tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--tab-h);
    color: var(--muted); font-size: var(--fs-cap); font-weight: 500; letter-spacing: .01em; background: none; border: 0; border-radius: 0; padding: 0; margin: 0; font-family: inherit; -webkit-tap-highlight-color: transparent; transition: none; }
  nav.tabs a:hover { text-decoration: none; }
  nav.tabs svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  nav.tabs .active { color: var(--accent); }
  nav.tabs .active svg { stroke-width: 2.2; }
  nav.tabs a:active, nav.tabs button:active { color: var(--text); transform: none; filter: none; }
}

/* ---------- layout: one <main>; mobile reserves the tab bar (+ safe area) at the bottom once, for every screen ---------- */
main { max-width: 1180px; margin: 0 auto; padding: var(--sp-5) var(--sp-5) var(--sp-7); }
@media (max-width: 700px) {
  :root { --pad: 16px; }
  main { padding: var(--sp-4) var(--sp-4) calc(var(--tab-h) + var(--sab) + var(--sp-5)); overflow-x: clip; }
  input[type=text], input[type=password], textarea, select { font-size: 16px; } /* prevents iOS zoom */
}
.card { background: var(--surface); border: 0; border-radius: var(--radius); padding: var(--pad); }
.row { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }

/* ---------- section header: caption label left, quiet "more" right ---------- */
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin: 0 0 var(--sp-2); }
.section-h h1, .section-h h2, .section-h h3 { margin: 0; }
.section-h .more, .more { font-size: var(--fs-cap); color: var(--muted); }
.sec { padding: var(--sp-4) 0 var(--sp-5); border-top: 1px solid var(--hair); }
.sec .note { margin-top: var(--sp-3); }
.note { color: var(--muted); font-size: var(--fs-cap); margin-top: var(--sp-2); line-height: 1.45; }

/* ---------- hero: the ONE dominant element (Today, Progress, Skill, Diagnostic) ---------- */
.hero { padding: var(--sp-3) 0 var(--sp-5); }
.hero .n { font-size: var(--fs-hero); font-weight: 700; line-height: 1; letter-spacing: -.035em; font-variant-numeric: tabular-nums; margin: var(--sp-2) 0 var(--sp-2); }
.hero .n small { font-size: var(--fs-h); font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.hero .n.none { color: var(--muted); }
.hero .sub { font-size: var(--fs-body); color: var(--text-2); }
.hero .sub .delta { font-size: var(--fs-body); }
.hero .sub.caption { font-size: var(--fs-cap); color: var(--muted); margin-top: 2px; }
.hero-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
@media (min-width: 901px) { .hero .n { font-size: 64px; } }

/* ---------- stat: label over number (Strava grid) ---------- */
.stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat .value { font-size: var(--fs-h); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: var(--fs-cap); color: var(--muted); font-weight: 500; margin-left: 3px; letter-spacing: 0; }
.stat .sub { font-size: var(--fs-cap); color: var(--muted); }
.stat.none .value { font-size: var(--fs-body); font-weight: 600; color: var(--muted); line-height: 1.5; padding-top: 4px; }
.stat-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) 0; border-top: 1px solid var(--hair); min-height: 48px; }
.stat-row .label-b { flex: 1; min-width: 0; font-size: var(--fs-body); color: var(--text); font-weight: 500; }
.stat-row .label-b small { display: block; font-size: var(--fs-cap); color: var(--muted); font-weight: 400; }
.stat-row .value { font-size: var(--fs-h); font-weight: 700; font-variant-numeric: tabular-nums; }
.kv3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); padding: var(--sp-1) 0 var(--sp-4); }

/* ---------- deltas, provenance, confidence ---------- */
.delta { font-size: var(--fs-cap); font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.delta.up { color: var(--good); } .delta.down { color: var(--serious); } .delta.flat { color: var(--muted); }
.delta.muted { font-weight: 500; }
.prov { font-size: var(--fs-cap); color: var(--muted); letter-spacing: .02em; font-weight: 400; text-transform: none; }
.prov::before { content: "· "; }
.chip.prov::before { content: none; }
.conf { display: inline-block; height: 3px; width: 56px; background: var(--surface-2); border-radius: 2px; vertical-align: middle; overflow: hidden; }
.conf > i { display: block; height: 100%; background: var(--accent); opacity: .7; }

/* ---------- bars & rings ---------- */
.bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bar.thin { height: 4px; }
.bar.dotted { background: repeating-linear-gradient(90deg, var(--line) 0 4px, transparent 4px 8px); opacity: .7; }
.bar.dotted > i { display: none; }
.ring { --size: 72px; --stroke: 7px; --pct: 0; --ring-color: var(--accent); width: var(--size); height: var(--size); border-radius: 50%; flex: 0 0 auto; position: relative; display: grid; place-items: center;
  background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), var(--surface-2) 0); }
.ring::before { content: ""; position: absolute; inset: var(--stroke); border-radius: 50%; background: var(--bg); }
.ring > * { position: relative; font-variant-numeric: tabular-nums; font-weight: 700; font-size: var(--fs-h); line-height: 1; letter-spacing: -.02em; text-align: center; }
.ring > * small { display: block; font-size: var(--fs-cap); font-weight: 500; color: var(--muted); }
.ring.good { --ring-color: var(--good); }

/* ---------- list rows with hairline dividers (shared) ---------- */
.list { margin: 0; padding: 0; list-style: none; }
.list > li, .li { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; border-top: 1px solid var(--hair); min-height: 48px; }
.list > li:first-child, .li:first-child { border-top: 0; }
.li .main { flex: 1; min-width: 0; }
.li .title { display: block; color: var(--text); font-weight: 500; }
.li .meta { display: block; font-size: var(--fs-cap); color: var(--muted); margin-top: 2px; }
.li .end { text-align: right; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.li .end .value { font-weight: 700; font-size: var(--fs-h); }
a.li, .li[href] { color: inherit; }
a.li:hover { text-decoration: none; }
a.li:active { background: var(--surface); margin: 0 calc(-1 * var(--sp-3)); padding-left: var(--sp-3); padding-right: var(--sp-3); border-radius: var(--radius-sm); }
.chev { color: var(--muted); flex: 0 0 auto; width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ddot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.ddot.grammar { background: var(--s1); } .ddot.discourse { background: var(--s2); } .ddot.listening { background: var(--s3); }
.ddot.vocab { background: var(--s4); } .ddot.pronunciation { background: var(--s5); } .ddot.pragmatics { background: var(--s6); }

/* domain row (Today · Progress): dot+name / caption+confidence · [90d sparkline] · number · delta */
.dom-row { display: grid; grid-template-columns: minmax(0, 1fr) 56px 48px 44px; gap: var(--sp-2); align-items: center; padding: var(--sp-3) 0; border-top: 1px solid var(--hair); min-height: 56px; color: inherit; -webkit-tap-highlight-color: transparent; }
.dom-row:first-child { border-top: 0; }
.dom-row:hover { text-decoration: none; }
.dom-row.nospark { grid-template-columns: minmax(0, 1fr) 48px 44px; }
.dom-row .name { min-width: 0; font-weight: 500; color: var(--text); display: flex; flex-direction: column; gap: 2px; }
.dom-row .name > b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.dom-row .name > b .ddot { width: 6px; height: 6px; margin-right: 8px; vertical-align: 2px; }
.dom-row .name small { display: block; color: var(--muted); font-size: var(--fs-cap); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dom-row .conf { display: block; width: 100%; max-width: 160px; margin-top: 4px; }
.dom-row .value { font-size: var(--fs-h); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; letter-spacing: -.02em; }
.dom-row .dlt { text-align: right; }
.dom-row.unmeasured .name > b { color: var(--text-2); }
.dspark { position: relative; display: block; height: 32px; width: 56px; }
.dspark canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.dspark.none { border-top: 1px dashed var(--line); height: 0; align-self: center; }
.dspark.none canvas { display: none; }

/* skill row (Today · Progress · Skills): name [/ caption] · 20px level right · full-width bar · muted meta line */
.skill-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name end" "bar end" "meta end"; column-gap: var(--sp-4); row-gap: 6px; align-items: center; padding: var(--sp-3) 0; border-top: 1px solid var(--hair); min-height: 64px; color: inherit; -webkit-tap-highlight-color: transparent; }
.skill-row:first-child { border-top: 0; }
.skill-row:hover { text-decoration: none; }
.skill-row:active { background: var(--surface); margin: 0 calc(-1 * var(--sp-3)); padding-left: var(--sp-3); padding-right: var(--sp-3); border-radius: var(--radius-sm); }
.skill-row .name { grid-area: name; color: var(--text); font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.skill-row .name small { display: block; -webkit-line-clamp: 1; color: var(--muted); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skill-row .bar { grid-area: bar; align-self: center; }
.skill-row .meta { grid-area: meta; font-size: var(--fs-cap); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.skill-row .meta .ddot { width: 6px; height: 6px; margin-right: 6px; vertical-align: 1px; }
.skill-row .end { grid-area: end; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 56px; }
.skill-row .lvl { font-size: var(--fs-h); font-weight: 700; line-height: 1.1; color: var(--text); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.skill-row.none .lvl, .lvl.none { color: var(--muted); font-weight: 500; }

/* ---------- chips ---------- */
.chip, .tag { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-cap); line-height: 20px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; vertical-align: middle; }
.tag { margin-right: 4px; }
.chip.prov { color: var(--muted); }
.chip.on { background: var(--accent-soft); color: var(--accent); }
.chips { display: flex; gap: var(--sp-2); overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chips a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-cap); font-weight: 500; min-height: 36px; line-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.chips a:hover { text-decoration: none; color: var(--text); }
.chips a.active { background: var(--accent); color: #fff; }
.chips a .ddot { width: 6px; height: 6px; }
.chips a.active .ddot { box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.chips-wrap { position: relative; min-width: 0; }
.chips-wrap::after { content: ""; position: absolute; top: 0; right: 0; bottom: 2px; width: 40px; pointer-events: none;
  background: linear-gradient(90deg, rgba(26,26,25,0), var(--bg) 85%); }
.chips { padding-right: 40px; }
.chips-wrap::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 48px; pointer-events: none; background: linear-gradient(90deg, rgba(26,26,25,0), var(--bg) 85%); }
.chips-wrap .chips { padding-right: 48px; }

/* ---------- empty state: a sentence, never an empty box ---------- */
.empty, .empty-line { color: var(--muted); font-size: var(--fs-cap); padding: var(--sp-3) 0; margin: 0; }
.chartbox { position: relative; height: 220px; }
.chartbox.short { height: 140px; }
.chartbox .empty[hidden] { display: none; }
.chartbox .empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 0; text-align: center; }

/* ---------- tables (desktop only) ---------- */
table { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--hair); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: var(--fs-cap); text-transform: uppercase; letter-spacing: .06em; border-bottom-color: var(--line); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

/* ---------- buttons & forms ---------- */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: #fff; border: 0; border-radius: 10px; min-height: 44px; padding: 0 18px; font-size: var(--fs-body); font-weight: 600; cursor: pointer; font-family: inherit; transition: transform .08s ease, filter .12s ease; -webkit-tap-highlight-color: transparent; }
button:hover, .btn:hover { filter: brightness(1.08); text-decoration: none; }
button:active, .btn:active { transform: scale(.96); filter: brightness(.9); }
button.secondary, .btn.secondary { background: var(--surface-2); color: var(--text); }
button.ghost, .btn.ghost { background: transparent; color: var(--accent); }
button.sm, .btn.sm { min-height: 36px; padding: 0 12px; font-size: var(--fs-cap); }
button:disabled { opacity: .5; cursor: default; transform: none; }
input[type=text], input[type=password], textarea, select { width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-family: inherit; font-size: var(--fs-body); min-height: 44px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { min-height: 120px; resize: vertical; }
label { display: block; color: var(--text-2); font-size: var(--fs-cap); margin: var(--sp-2) 0 var(--sp-1); }
.notice { border: 0; border-left: 3px solid var(--s4); background: rgba(201,133,0,.08); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 10px 12px; font-size: var(--fs-body); margin-bottom: var(--sp-4); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- segmented control: equal options, one active pill ---------- */
.seg { display: inline-flex; background: var(--surface-2); border: 0; border-radius: 10px; padding: 3px; gap: 2px; max-width: 100%; }
.seg a, .seg button { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 12px; border-radius: 8px; color: var(--text-2); font-size: var(--fs-body); font-weight: 500; background: transparent; white-space: nowrap; min-width: 0; -webkit-tap-highlight-color: transparent; }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a.active, .seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.4); font-weight: 600; }
.seg button:active { transform: none; filter: none; }
.seg.full { display: flex; }
.seg .cnt { font-size: var(--fs-cap); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); background: var(--surface); border-radius: 999px; padding: 0 7px; line-height: 18px; min-width: 18px; text-align: center; }
.seg .active .cnt { background: var(--accent-soft); color: var(--accent); }
.controls { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: var(--sp-2) 0 var(--sp-3); margin-bottom: var(--sp-2); border-bottom: 1px solid var(--hair); }
@media (min-width: 701px) { .controls { top: 52px; } }

/* ---------- fold: <details> with a caption-label summary; collapsed on mobile, open on desktop via data-desktop-open ---------- */
.fold { border-top: 1px solid var(--hair); }
.fold summary { display: flex; align-items: center; gap: var(--sp-3); min-height: 52px; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary .hint { margin-left: auto; font-size: var(--fs-cap); color: var(--muted); font-variant-numeric: tabular-nums; }
.fold summary .chev { transition: transform .15s ease; }
.fold[open] summary .chev { transform: rotate(180deg); }
.fold > .list, .fold > .empty-line { padding-bottom: var(--sp-3); }
.fold .dom-row:first-child, .fold .skill-row:first-child { border-top: 1px solid var(--hair); }
.fold .more-link { display: block; font-size: var(--fs-cap); color: var(--muted); padding: 0 0 var(--sp-4); }
.fold-title { font-size: var(--fs-body); font-weight: 600; color: var(--text); }

/* ---------- bottom sheet (mobile) / centered dialog (desktop) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--surface); border-radius: 16px 16px 0 0; padding: var(--sp-2) var(--sp-4) calc(var(--sp-4) + var(--sab)); max-height: 82vh; overflow-y: auto;
  transform: translateY(100%); visibility: hidden; transition: transform .22s cubic-bezier(.2,.8,.2,1), visibility 0s linear .22s; box-shadow: 0 -8px 40px rgba(0,0,0,.5); }
.sheet::before { content: ""; display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto var(--sp-3); }
.sheet.open { transform: none; visibility: visible; transition-delay: 0s; }
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet h3 { font-size: var(--fs-h); margin: 0 0 var(--sp-2); }
.sheet .li { min-height: 52px; }
.sheet .li svg { width: 22px; height: 22px; stroke: var(--muted); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.sheet .status { display: flex; gap: var(--sp-4); font-size: var(--fs-cap); color: var(--muted); padding: var(--sp-3) 0 0; }
@media (min-width: 701px) { .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 420px; border-radius: 16px; transform: translate(-50%, -46%); opacity: 0; pointer-events: none; padding-bottom: var(--sp-4); }
  .sheet.open { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; visibility: visible; } .sheet::before { display: none; } }
body.sheet-open { overflow: hidden; }

/* ---------- back link (detail screens) ---------- */
.back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; color: var(--muted); font-size: var(--fs-cap); font-weight: 500; margin-left: -6px; }
.back svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.back:hover { text-decoration: none; color: var(--text); }

/* ---------- screen header: h1 + one-line answer ---------- */
.head { padding: var(--sp-2) 0 var(--sp-3); }
.head h1 { margin: 0 0 var(--sp-1); }
.head h1 small { font-weight: 500; font-size: var(--fs-h); margin-left: 4px; color: var(--muted); }
.head .answer { margin: 0; color: var(--text-2); font-size: var(--fs-body); line-height: 1.45; }
.head .answer b { color: var(--text); font-weight: 700; }
.head .answer.cap { font-size: var(--fs-cap); color: var(--muted); }
.head .answer code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }
@media (min-width: 701px) { .head.inline { display: flex; align-items: baseline; gap: var(--sp-4); padding-top: var(--sp-3); } .head.inline h1 { margin: 0; } }

/* ============================================================================
   TODAY: hero → ring + streak → plan list → this-week sentence → folded secondary
   ============================================================================ */
.td-pulse { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-4); align-items: center; padding: var(--sp-4) 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.td-pulse .ring-cell { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.td-pulse .txt, .td-pulse .streak-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.td-pulse .line { font-size: var(--fs-cap); color: var(--muted); line-height: 1.35; white-space: nowrap; }
.td-pulse .line b { font-size: var(--fs-h); color: var(--text); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.td-pulse .streak-cell { align-items: flex-end; text-align: right; }
.td-pulse .days { display: inline-flex; gap: 5px; margin-top: 2px; }
.td-pulse .days i { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-2); display: block; }
.td-pulse .days i.on { background: var(--accent); }
.td-pulse .days i.is-today { box-shadow: 0 0 0 1.5px var(--text-2); }
.td-pulse .days i.is-today.on { box-shadow: 0 0 0 1.5px var(--accent); }
.td-plan-h { margin-top: var(--sp-5); margin-bottom: var(--sp-2); align-items: center; }
.td-plan-h h2 b { color: var(--text-2); font-weight: 600; }
.td-dur a { font-variant-numeric: tabular-nums; }
.plan-list { list-style: none; margin: 0; padding: 0; }
.plan-item { border-top: 1px solid var(--hair); }
.plan-item:first-child { border-top: 0; }
.plan-row { display: grid; grid-template-columns: 28px 1fr auto 16px; gap: var(--sp-3); align-items: center; padding: var(--sp-3) 0; min-height: 64px; color: inherit; -webkit-tap-highlight-color: transparent; }
.plan-row:hover { text-decoration: none; }
.plan-row:active { background: var(--surface); margin: 0 calc(-1 * var(--sp-2)); padding-left: var(--sp-2); padding-right: var(--sp-2); border-radius: var(--radius-sm); }
.step { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-cap); font-weight: 700; font-variant-numeric: tabular-nums; background: var(--accent-soft); color: var(--accent); flex: 0 0 auto; }
.plan-item.diagnostic .step { background: rgba(217,89,38,.16); color: var(--s2); }
.plan-item.drill .step { background: rgba(25,158,112,.16); color: var(--s3); }
.plan-item.probe .step { background: rgba(201,133,0,.16); color: var(--s4); }
.plan-item.review .step { background: rgba(213,81,129,.16); color: var(--s5); }
.plan-row .body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.plan-row .title { font-size: var(--fs-body); font-weight: 600; color: var(--text); line-height: 1.3; }
.plan-row .why { font-size: var(--fs-cap); color: var(--text-2); line-height: 1.4; }
.plan-row .skills { font-size: var(--fs-cap); color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.plan-row .skills .ddot { width: 6px; height: 6px; margin-right: 6px; vertical-align: 1px; }
.plan-row .mins { font-size: var(--fs-h); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; letter-spacing: -.02em; }
.plan-row .mins .unit { font-weight: 400; color: var(--muted); margin-left: 3px; font-size: var(--fs-cap); }
/* this week: one sentence + label-over-number pairs; provenance as a quiet chip */
.td-week { padding: var(--sp-1) 0 var(--sp-4); }
.td-week .sentence { margin: 0 0 var(--sp-3); color: var(--text); font-size: var(--fs-body); line-height: 1.45; }
.td-week .sentence b { font-weight: 700; }
.td-week .pairs { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
.td-week .vocab { margin-top: var(--sp-3); font-size: var(--fs-cap); color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.td-week .vocab b { color: var(--text); font-weight: 700; font-size: var(--fs-body); font-variant-numeric: tabular-nums; }
.td-side { margin-top: var(--sp-6); }
@media (min-width: 901px) {
  .td-main { display: grid; grid-template-columns: 3fr 2fr; gap: var(--sp-7); align-items: start; }
  .td-side { margin-top: var(--sp-5); }
  .td-pulse { grid-template-columns: auto auto; justify-content: start; gap: var(--sp-7); }
  .td-pulse .streak-cell { align-items: flex-start; text-align: left; border-left: 1px solid var(--hair); padding-left: var(--sp-7); }
  .td-dur a { padding: 0 16px; flex: 0 0 auto; }
}
@media (max-width: 700px) {
  .td-plan-h { flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); }
  .td-dur { display: flex; width: 100%; }
}

/* ============================================================================
   PROGRESS: hero + 90d sparkline (ghost = a week/month ago) → domain rows (+64px sparklines) → week vs last week
   → daily charts (this week accent, last week ghost) → vocabulary meter → PRs → weak/strong → errors
   ============================================================================ */
.pg-grid { display: grid; grid-template-columns: 1fr; grid-template-areas: "hero" "domains" "week" "charts"; }
.pg-hero { grid-area: hero; } .pg-domains { grid-area: domains; } .pg-week { grid-area: week; } .pg-charts { grid-area: charts; }
.pg-cefr { font-size: var(--fs-cap); font-weight: 700; color: var(--text-2); letter-spacing: .04em; }
.pg-spark { position: relative; height: 80px; margin-top: var(--sp-4); }
.pg-spark .empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 0; text-align: center; }
.pg-spark .empty[hidden] { display: none; }
.pg-spark-cap { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); font-size: var(--fs-cap); color: var(--muted); font-variant-numeric: tabular-nums; margin-top: var(--sp-1); }
.pg-spark-cap b { color: var(--text); font-weight: 700; }
.pg-spark-key { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pg-spark-key[hidden] { display: none; }
.pg-spark-key i { width: 16px; border-top: 1px dashed var(--muted); }
.pg-week .more { display: inline-flex; align-items: center; gap: 6px; }
.wk-key { width: 12px; height: 6px; border-radius: 3px; background: var(--line); }
.wk-row { display: grid; grid-template-columns: 80px 1fr 64px 56px; gap: var(--sp-2); align-items: center; min-height: 52px; padding: var(--sp-2) 0; border-top: 1px solid var(--hair); }
.wk-row:first-child { border-top: 0; }
.wk-label { font-size: var(--fs-body); color: var(--text); font-weight: 500; }
.wk-bars { position: relative; display: block; height: 10px; min-width: 0; }
.wk-bars i { position: absolute; left: 0; display: block; border-radius: 3px; min-width: 2px; }
.wk-bars i.prev { top: 0; height: 10px; background: var(--line); }
.wk-bars i.cur { top: 2px; height: 6px; background: var(--accent); }
.wk-val { display: flex; flex-direction: column; align-items: flex-end; font-size: var(--fs-h); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.wk-val small { font-size: var(--fs-cap); font-weight: 400; color: var(--muted); }
.wk-dlt { text-align: right; }
.pg-main { display: grid; grid-template-columns: 1fr; }
.chart-key { display: inline-flex; align-items: center; gap: 10px; }
.chart-key i { display: inline-block; width: 10px; height: 6px; border-radius: 2px; background: var(--accent); margin-right: 4px; vertical-align: 1px; }
.chart-key i.g { background: var(--line); }
/* vocabulary: one segmented meter (fill = p(known) per frequency band) + a sentence */
.vmeter { display: flex; gap: 4px; margin: var(--sp-2) 0 var(--sp-1); }
.vmeter > span { flex: 1 1 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vmeter > span i { display: block; height: 8px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.vmeter > span i b { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.vmeter > span em { font-style: normal; font-size: var(--fs-cap); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vmeter > span em b { color: var(--text); font-weight: 700; margin-right: 4px; }
.vsentence { font-size: var(--fs-body); color: var(--text-2); margin: var(--sp-2) 0 0; line-height: 1.45; }
.pr-badge { flex: 0 0 auto; font-size: var(--fs-cap); font-weight: 800; letter-spacing: .06em; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 3px 6px; line-height: 1; }
.errs .title { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-weight: 500; }
.said { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--serious); text-decoration-thickness: 1px; }
.arrow { color: var(--muted); }
.fix { color: var(--text); font-weight: 600; }
.xcount { display: inline-block; font-size: var(--fs-cap); font-weight: 700; color: var(--text-2); background: var(--surface-2); border-radius: 999px; padding: 2px 9px; line-height: 18px; }
@media (min-width: 901px) {
  .pg-grid, .pg-main { grid-template-columns: 1fr 1fr; column-gap: var(--sp-7); }
  .pg-grid { grid-template-areas: "hero week" "domains charts"; }
  .pg-spark { height: 96px; }
  .pg-week { border-top: 0; padding-top: var(--sp-3); }
  .wk-row { grid-template-columns: 88px 1fr 72px 64px; gap: var(--sp-3); }
  .dom-row { grid-template-columns: minmax(0, 1fr) 72px 56px 64px; gap: var(--sp-3); }
  .dom-row.nospark { grid-template-columns: minmax(0, 1fr) 56px 64px; }
  .dspark { width: 72px; }
}

/* ============================================================================
   READER: title + coverage chip → slim 5-step strip → "Barrier analysis" fold → the text (18-19px / 1.75) → steps
   The primary step action lives in a pinned bar above the tab bar (mobile) / sticky at the bottom of the column (desktop).
   ============================================================================ */
.rd-head { padding-bottom: var(--sp-3); }
.rd-title { margin: 0 0 var(--sp-2); }
.rd-meta { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.rd-meta .cap, .rd-cap { font-size: var(--fs-cap); color: var(--muted); }
.rd-cap { margin: 0 0 var(--sp-3); line-height: 1.45; }
.chip.cov { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.chip.cov .ck { color: var(--accent); font-weight: 600; margin-left: 2px; }
.chip.cov.none { color: var(--muted); font-weight: 500; }
.rd-steps { list-style: none; margin: var(--sp-4) 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.rd-steps li { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-cap); color: var(--muted); min-width: 0; }
.rd-steps li i { display: block; height: 3px; border-radius: 2px; background: var(--surface-2); }
.rd-steps li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-steps li.done i { background: var(--accent); opacity: .45; }
.rd-steps li.on i { background: var(--accent); }
.rd-steps li.on span { color: var(--text); font-weight: 600; }
.rd-analysis { border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.rd-analysis > summary { min-height: 48px; }
.rd-fold-body { padding-bottom: var(--sp-4); }
.rd-summary { font-size: var(--fs-body); color: var(--text-2); line-height: 1.5; margin: 0 0 var(--sp-3); }
.rd-summary .chip { margin-right: 4px; }
.rd-h3 { font-size: var(--fs-cap); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; margin: var(--sp-4) 0 var(--sp-1); }
.rd-h3 small { text-transform: none; letter-spacing: 0; color: var(--serious); font-weight: 600; margin-left: 6px; }
.rd-gloss { list-style: none; margin: 0; padding: 0; }
.rd-gloss li { display: grid; grid-template-columns: minmax(84px, 1fr) 2fr; gap: var(--sp-3); padding: var(--sp-2) 0; border-top: 1px solid var(--hair); font-size: var(--fs-body); line-height: 1.4; min-height: 40px; align-items: baseline; }
.rd-gloss li:first-child { border-top: 0; }
.rd-gloss li > b { font-weight: 600; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.rd-gloss li > span { color: var(--text-2); min-width: 0; overflow-wrap: anywhere; }
.rd-gloss li > span small { display: block; color: var(--muted); margin-top: 2px; }
.rd-gloss li > span i { font-style: normal; }
.rd-gloss li .ok, .rd-gloss li .part, .rd-gloss li .err { font-weight: 600; text-transform: capitalize; }
.rd-all { margin-top: var(--sp-4); }
.rd-all > summary { cursor: pointer; font-size: var(--fs-cap); color: var(--muted); min-height: 44px; display: flex; align-items: center; list-style: none; }
.rd-all > summary::-webkit-details-marker { display: none; }
.rd-all > summary::before { content: "\25B8"; margin-right: 6px; }
.rd-all[open] > summary::before { content: "\25BE"; }
.rd-text { padding: var(--sp-5) 0; }
.reader { font-size: 19px; line-height: 1.75; max-width: 640px; color: var(--text); letter-spacing: .002em; }
.reader .t { border-radius: 3px; padding: 0 1px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.reader .t.unknown { text-decoration: underline; text-decoration-color: rgba(217, 89, 38, .75); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.reader .t.probable { text-decoration: underline dotted var(--line); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.reader .t.looked { background: var(--accent-soft); text-decoration-color: var(--accent); }
.reader .t:active { background: var(--surface-2); }
.reader .t.punct, .reader .t.function { cursor: default; }
.rd-legend { margin: var(--sp-4) 0 0; font-size: var(--fs-cap); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-legend i { display: inline-block; width: 14px; border-bottom: 2px solid var(--s2); margin-right: 4px; opacity: .8; }
.rd-legend i.p { border-bottom: 1px dotted var(--line); opacity: 1; }
.rd-step { padding: var(--sp-4) 0 var(--sp-5); border-top: 1px solid var(--hair); }   /* divider only when a step follows the text */
.rd-step[hidden] { display: none; }
.rd-step-h { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.rd-step-h h3 { margin: 0; }
.rd-q { padding: var(--sp-2) 0 var(--sp-3); }
.rd-q .q { display: flex; gap: var(--sp-2); align-items: baseline; flex-wrap: wrap; font-size: var(--fs-body); color: var(--text); margin: 0 0 var(--sp-2); line-height: 1.45; }
.rd-q .qn { color: var(--muted); font-weight: 700; font-size: var(--fs-cap); }
.rd-act { margin-top: var(--sp-3); }
.rd-act .wide, .rd-form .wide { width: 100%; max-width: 420px; }
.rd-out { display: block; margin-top: var(--sp-3); font-size: var(--fs-body); color: var(--text-2); line-height: 1.45; }
.rd-out:empty { display: none; }
.rd-score { font-size: var(--fs-h); font-weight: 700; color: var(--text); }
.rd-grade { font-size: var(--fs-cap); color: var(--text-2); padding: 6px 0; border-top: 1px solid var(--hair); }
.rd-grade .ok, .rd-grade .part, .rd-grade .err { font-weight: 700; margin-right: 6px; text-transform: capitalize; }
.rd-res:empty { display: none; }
.rd-res { margin-top: var(--sp-3); }
.rd-finish .rd-cap { margin-bottom: 0; }
.rd-finish .rd-out { margin-top: var(--sp-4); }
.rd-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + var(--sab)); z-index: 39; padding: var(--sp-2) var(--sp-4) var(--sp-3); background: var(--bg); border-top: 1px solid var(--hair); }
.rd-bar-in { display: flex; gap: var(--sp-2); align-items: center; max-width: 640px; margin: 0 auto; }
.rd-bar button { flex: 1 1 auto; min-height: 48px; font-size: var(--fs-body); }
.rd-bar button.ghost { flex: 0 0 auto; padding: 0 12px; color: var(--text-2); font-weight: 500; }
.rd-bar [hidden] { display: none !important; }
.rd-bar .rd-out { margin: 0 auto var(--sp-2); font-size: var(--fs-cap); color: var(--muted); text-align: center; max-width: 640px; }
.rd-bar .rd-out .spinner { width: 12px; height: 12px; }
.rd-sheet .lemma { font-size: var(--fs-h); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-2); }
.rd-sheet .gloss { font-size: var(--fs-body); color: var(--text); line-height: 1.45; }
.rd-sheet .note { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--hair); font-size: var(--fs-body); color: var(--text-2); line-height: 1.45; }
.rd-sheet .note b { font-size: var(--fs-cap); letter-spacing: .08em; color: var(--accent); margin-right: 6px; vertical-align: 1px; }
.rd-sheet .prov { margin: var(--sp-3) 0 0; }
.rd-sheet .rd-cap.prov::before { content: none; }
@media (min-width: 901px) {
  .rd-steps { max-width: 520px; }
  .rd-head { border-bottom: 1px solid var(--hair); padding-bottom: var(--sp-4); }   /* the one shared divider under the step strip */
  .rd-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "main side"; gap: var(--sp-7); align-items: start; }
  .rd-main { grid-area: main; } .rd-side { grid-area: side; position: sticky; top: 68px; }
  .rd-analysis { border-top: 0; border-bottom: 0; }
  .rd-analysis > summary { cursor: default; min-height: 0; padding: var(--sp-5) 0 var(--sp-2); }   /* aligns with the text column's top padding */
  .rd-analysis > summary .chev { display: none; }
  .rd-act .wide { width: auto; min-width: 180px; }
  .rd-bar { position: sticky; bottom: 0; left: auto; right: auto; padding: var(--sp-3) 0; }
  .rd-bar-in { margin: 0; }
  .rd-bar button { flex: 0 0 auto; min-width: 200px; }
}
@media (max-width: 900px) { .rd-side { margin-top: var(--sp-2); } }
@media (max-width: 700px) {
  .rd { padding-bottom: 80px; } /* room for the pinned action bar (main already reserves the tab bar) */
  .reader { font-size: 18px; }
  .rd-act .wide, .rd-form .wide { max-width: none; }
  .rd-steps { gap: 4px; }
}

/* ---------- read index: library rows + add form (expanded when the queue is short) ---------- */
.rd-row { min-height: 64px; gap: var(--sp-3); }
.rd-row .title { font-weight: 600; }
.rd-row .chip.cov { flex: 0 0 auto; }
.rd-row.cont { margin: 0 calc(-1 * var(--sp-3)); padding-left: var(--sp-3); padding-right: var(--sp-3); background: var(--surface); border-radius: var(--radius); border-top: 0; }
.rd-row.cont + .li { border-top: 0; }
.rd-row .cont-cap { color: var(--accent); font-weight: 600; }
.rd-add { margin-top: var(--sp-5); border-bottom: 1px solid var(--hair); }
.rd-add > summary .plus { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: 0 0 auto; }
.rd-add > summary .plus svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; }
.rd-form { padding-bottom: var(--sp-4); }
.rd-form textarea { min-height: 160px; }
.rd-form-row { gap: var(--sp-3); align-items: stretch; flex-wrap: nowrap; }
.rd-form-row > div { flex: 1 1 0; min-width: 0; }
.rd-form .rd-cap { margin-top: var(--sp-3); }
@media (min-width: 901px) {
  .rd-index { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: var(--sp-7); align-items: start; }
  .rd-add { margin-top: var(--sp-6); border-bottom: 0; }
  .rd-add > summary { cursor: default; }
  .rd-add > summary .chev { display: none; }
}

/* ============================================================================
   SKILLS list: answer line → sort seg + domain chips (sticky, edge-fade) → rows (mobile) / dense table (desktop)
   ============================================================================ */
.sk-controls { display: flex; flex-direction: column; gap: var(--sp-3); }
.sk-controls .seg a { padding: 0 6px; font-size: var(--fs-cap); }
.sk-list { display: none; }
.sk-more { display: flex; align-items: center; gap: var(--sp-3); min-height: 52px; border-top: 1px solid var(--hair); color: inherit; margin-top: var(--sp-2); }
.sk-more:hover { text-decoration: none; }
.sk-more .hint { margin-left: auto; font-size: var(--fs-cap); color: var(--muted); font-variant-numeric: tabular-nums; }
.sk-table { display: block; }
.sk-table th, .sk-table td { padding: 10px 10px; vertical-align: middle; }
.sk-table th:first-child, .sk-table td:first-child { padding-left: 0; }
.sk-table td:first-child a { color: var(--text); font-weight: 500; }
.sk-table td.lvl { font-size: var(--fs-h); font-weight: 700; letter-spacing: -.02em; }
.sk-table tr.none td { color: var(--muted); }
.sk-table tr.none td a { color: var(--text-2); font-weight: 400; }
.sk-table tr:hover td:first-child a { text-decoration: underline; }
.sk-id { display: block; font-size: var(--fs-cap); color: var(--muted); opacity: 0; height: 0; overflow: hidden; transition: opacity .12s ease; }
.sk-table tr:hover .sk-id { opacity: 1; height: auto; }
.sk-dom { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); white-space: nowrap; font-size: var(--fs-cap); }
.sk-dom .ddot { width: 6px; height: 6px; }
.sk-table .conf { width: 48px; }
.sk-table .sk-more { border-top: 0; min-height: 44px; padding: var(--sp-2) 0; }
@media (max-width: 700px) {
  .sk-list { display: block; }
  .sk-table { display: none; }
  .sk-controls { margin: 0 calc(-1 * var(--sp-4)) var(--sp-2); padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .sk-controls .chips-wrap { margin-right: calc(-1 * var(--sp-4)); }
  .sk-controls .chips-wrap .chips { padding-right: var(--sp-7); }
}
@media (min-width: 701px) {
  .sk-controls { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3) var(--sp-4); }
  .sk-controls .chips-wrap { flex: 1 1 560px; order: 1; }
  .sk-controls .chips-wrap::after { display: none; }
  .sk-controls .chips-wrap .chips { flex-wrap: wrap; overflow: visible; padding-right: 0; }
  .sk-controls .seg { display: inline-flex; order: 2; }
  .sk-controls .seg a { flex: 0 0 auto; padding: 0 14px; font-size: var(--fs-body); }
}

/* ============================================================================
   SKILL detail: back + title → hero level + ✓/✗ split + confidence → 4 dimensions → history → folded ontology → evidence
   ============================================================================ */
.sd { max-width: 760px; }
.sd-head { padding-bottom: var(--sp-4); }
.sd-head h1 { margin: 0 0 var(--sp-2); }
.sd-desc { color: var(--text-2); margin: 0; }
.sd-note { color: var(--text-2); font-size: var(--fs-cap); margin: var(--sp-2) 0 0; display: flex; gap: 8px; align-items: baseline; }
.sd-note .ddot { width: 6px; height: 6px; flex: 0 0 auto; position: relative; top: -1px; }
.sd-hero { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-4); align-items: end; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); padding: var(--sp-4) 0 var(--sp-5); }
.sd-split { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-3); max-width: 320px; }
.sd-split .bar { flex: 1; display: flex; gap: 2px; background: transparent; }
.sd-split .bar i { display: block; height: 100%; border-radius: 2px; }
.sd-split .bar i.ok { background: var(--good); } .sd-split .bar i.err { background: var(--serious); } .sd-split .bar i.na { background: var(--surface-2); }
.sd-split .caption { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.sd-split .caption .ok, .sd-split .caption .err { font-weight: 600; }
.sd-conf { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 96px; }
.sd-conf .conf { width: 96px; height: 4px; }
.sd-conf-n { font-size: var(--fs-h); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.sd-dims { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4) var(--sp-5); padding: var(--sp-4) 0 var(--sp-3); }
.sd-dims .stat .label { letter-spacing: .06em; }
.sd-dims .stat:nth-child(even) { border-left: 1px solid var(--hair); padding-left: var(--sp-4); margin-left: calc(-1 * var(--sp-3)); }
.sd-more { width: 100%; margin-top: var(--sp-2); border-top: 1px solid var(--hair); border-radius: 0; color: var(--accent); font-weight: 600; }
.sd h2 { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--sp-2); }
.sd h2 .hint { text-transform: none; letter-spacing: 0; font-weight: 400; }
.sd-hist { padding: var(--sp-4) 0 var(--sp-5); border-top: 1px solid var(--hair); }
.sd-hist .chartbox { height: 200px; }
.sd-onto-body { padding: 0 0 var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: var(--sp-3); align-items: baseline; font-size: var(--fs-body); }
.kv .k { font-size: var(--fs-cap); color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
.kv .v { min-width: 0; color: var(--text); display: flex; flex-direction: column; gap: 4px; }
.kv .v.caption { color: var(--text-2); gap: 6px; }
.kv .v b { color: var(--text); font-weight: 600; }
.kv .ex { font-style: italic; color: var(--text); }
.kv .v.tags { flex-direction: row; flex-wrap: wrap; gap: 6px; }
.kv .v.tags .tag { margin: 0; }
.sd-ev { padding-top: var(--sp-4); border-top: 1px solid var(--hair); }
.ev-list { display: flex; flex-direction: column; }
.ev { padding: var(--sp-3) 0; border-top: 1px solid var(--hair); display: flex; flex-direction: column; gap: 6px; }
.ev:first-child { border-top: 0; }
.ev-top { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-cap); min-height: 24px; }
.ev-verdict { font-weight: 700; text-transform: capitalize; display: inline-flex; align-items: center; gap: 6px; }
.ev-verdict::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ev-verdict.ok { color: var(--good); } .ev-verdict.part { color: var(--warn); } .ev-verdict.err { color: var(--serious); } .ev-verdict.na { color: var(--muted); }
.ev-ctx { color: var(--muted); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-when { color: var(--muted); flex: 0 0 auto; }
.ev-line { display: grid; grid-template-columns: 64px 1fr; gap: var(--sp-2); align-items: baseline; font-size: var(--fs-body); line-height: 1.45; }
.ev-line .k { font-size: var(--fs-cap); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.ev-line .v { min-width: 0; overflow-wrap: anywhere; color: var(--text); }
.ev-prov { margin: 0; }
.ev-prov .prov::before { content: none; }
@media (max-width: 700px) {
  .sd-hero { grid-template-columns: 1fr; gap: var(--sp-3); align-items: start; }
  .sd-conf { flex-direction: row; align-items: center; gap: var(--sp-3); }
  .sd-conf .conf { flex: 1; width: auto; max-width: 160px; }
  .sd-conf-n { font-size: var(--fs-body); }
  .kv { grid-template-columns: 1fr; gap: 4px; }
}
@media (min-width: 701px) {
  .sd { max-width: 980px; }
  .sd-dims { grid-template-columns: repeat(4, 1fr); }
  .sd-dims .stat + .stat { border-left: 1px solid var(--hair); padding-left: var(--sp-4); margin-left: calc(-1 * var(--sp-3)); }
  .sd-hist .chartbox { height: 240px; }
  .ev-line { grid-template-columns: 88px 1fr; }
  .sd-onto summary { min-height: 48px; }
}

/* ============================================================================
   LIBRARY: answer line → sticky segmented control + queue strip → ONE hero card (28px Spanish line, ghost Skip,
   primary Add) + compact rows (44px ✓/✗, 2-line translation) → vocabulary rows → error rows. Width capped at 760px.
   ============================================================================ */
.lb { max-width: 760px; }
.lb-controls .seg button { min-height: 44px; gap: 6px; padding: 0 8px; }
.q-strip { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 0 0; }
.q-strip[hidden] { display: none; }
.q-strip-cap { font-size: var(--fs-cap); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 84px; }
.q-strip-bar { display: flex; gap: 3px; flex: 1; max-width: 360px; }
.q-strip-bar i { display: block; flex: 1 1 0; height: 4px; border-radius: 2px; background: var(--surface-2); transition: background .2s ease; }
.q-strip-bar i.cur { background: var(--accent); }
.q-strip-bar i.ok { background: var(--good); }
.q-strip-bar i.no { background: var(--line); }
.lb-foot { display: flex; gap: var(--sp-2); align-items: flex-start; font-size: var(--fs-cap); color: var(--muted); margin: var(--sp-4) 0 0; line-height: 1.45; }
.lb-i { flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 700; font-style: italic; display: grid; place-items: center; margin-top: 2px; font-family: Georgia, serif; }
.lb-sec[hidden] { display: none; }
.q-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.q-card { transition: opacity .2s ease; }
.q-card .q-front { font-weight: 600; line-height: 1.35; color: var(--text); }
.q-back { font-size: var(--fs-body); color: var(--text-2); line-height: 1.45; }
.q-arrow { color: var(--accent); font-weight: 700; margin-right: 6px; }
.q-meta { font-size: var(--fs-cap); color: var(--muted); line-height: 1.5; }
.q-meta .tag { margin-left: 4px; }
.q-actions button { border-radius: 10px; font-weight: 700; }
.q-actions .q-ic { font-size: var(--fs-h); line-height: 1; }
.q-actions .q-lbl { font-size: var(--fs-body); font-weight: 600; }
.q-no { background: var(--surface-2); color: var(--text-2); }
.q-yes { background: var(--accent); color: #fff; }
.q-done { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 44px; font-size: var(--fs-body); color: var(--text-2); }
.q-done[hidden] { display: none; }
.q-done .ghost { color: var(--accent); }
.q-card.approved .q-done-txt { color: var(--good); font-weight: 600; }
.q-card.decided .q-actions { display: none; }
.q-card.primary { background: var(--surface); border-radius: var(--radius); padding: var(--sp-5) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.q-card.primary .q-front { font-size: 28px; line-height: 1.2; letter-spacing: -.02em; }
.q-card.primary .q-back { margin-top: 4px; font-size: var(--fs-body); opacity: .8; }
.q-card.primary .q-meta { margin-top: 6px; }
.q-card.primary .q-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: var(--sp-2); margin-top: var(--sp-2); }
.q-card.primary .q-actions button { min-height: 52px; gap: 8px; }
.q-card.primary .q-actions .q-no { background: transparent; color: var(--text-2); }
.q-card.primary .q-actions .q-no:active { background: var(--surface-2); }
.q-card.primary.decided .q-actions { display: none; }
.q-card.compact { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center; padding: var(--sp-3) 0; border-top: 1px solid var(--hair); min-height: 64px; }
.q-card.compact .q-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.q-card.compact .q-front { font-size: var(--fs-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-card.compact .q-back { font-size: var(--fs-cap); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.q-card.compact .q-meta { display: none; }
.q-card.compact .q-actions { display: flex; gap: var(--sp-2); }
.q-card.compact .q-actions button { width: 44px; height: 44px; min-height: 44px; padding: 0; }
.q-card.compact .q-actions .q-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.q-card.compact .q-actions .q-ic { font-size: 18px; }
.q-card.compact .q-done { grid-column: 1 / -1; min-height: 0; font-size: var(--fs-cap); }
.q-card.compact.decided { opacity: .55; }
.q-card.primary + .q-card.compact { border-top: 0; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--sab) + var(--sp-4)); transform: translate(-50%, 8px); z-index: 45; background: var(--surface-2); color: var(--text); font-size: var(--fs-cap); font-weight: 600; padding: 10px 14px; border-radius: 999px; box-shadow: 0 6px 24px rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 701px) { .toast { bottom: var(--sp-5); } }
.v-list { list-style: none; margin: 0; padding: 0; }
.v-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-4); align-items: center; padding: var(--sp-3) 0; border-top: 1px solid var(--hair); min-height: 64px; }
.v-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.v-lemma { font-size: var(--fs-body); font-weight: 600; color: var(--text); line-height: 1.3; }
.v-lemma small { color: var(--muted); font-weight: 400; margin-left: 4px; font-variant-numeric: tabular-nums; }
.v-gloss { font-size: var(--fs-cap); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-bar { display: flex; gap: 3px; margin-top: 4px; max-width: 168px; }
.v-bar i { display: block; flex: 1 1 0; height: 4px; border-radius: 2px; background: var(--surface-2); }
.v-bar i.on { background: var(--accent); }
.v-bar i.half { background: linear-gradient(90deg, var(--accent) 50%, var(--surface-2) 50%); }
.v-end { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 64px; }
.v-stage { font-size: var(--fs-h); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; }
.v-sub { font-size: var(--fs-cap); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.e-list { list-style: none; margin: 0; padding: 0; }
.e-row { padding: var(--sp-3) 0; border-top: 1px solid var(--hair); display: flex; flex-direction: column; gap: 4px; min-height: 56px; }
.e-pair { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: var(--fs-body); line-height: 1.45; }
.e-note { font-size: var(--fs-cap); color: var(--text-2); line-height: 1.45; }
.e-meta { font-size: var(--fs-cap); color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }

/* ============================================================================
   DIAGNOSTIC: intro = title + caption → hero baseline % + verdict line → one block CTA → domain rows (Δ column) →
   assumed-known row → "What it measures" fold. taking = sticky progress strip + one card per item + pinned submit.
   results = hero % + domain tiles + verdict list.
   ============================================================================ */
.dg-hero-sub { display: flex; align-items: center; gap: 8px; font-size: var(--fs-cap); color: var(--muted); flex-wrap: wrap; }
.dg-verdict { font-size: var(--fs-body); color: var(--text-2); margin: var(--sp-2) 0 0; }
.dg-verdict b { color: var(--text); font-weight: 600; }
.dg-cta { margin: 0 0 var(--sp-5); }
.dg-cta.row { gap: var(--sp-2); }
.dg-primary { width: 100%; min-height: 52px; max-width: 480px; }
.dg-primary small { font-size: var(--fs-cap); font-weight: 500; opacity: .85; margin-left: 4px; font-variant-numeric: tabular-nums; color: inherit; }
.dg-cta form { margin: 0; }
.dg-grid { display: grid; grid-template-columns: 1fr; }
.dg-row { display: grid; grid-template-columns: 8px minmax(0, 1fr) 48px 56px; grid-template-rows: auto auto; column-gap: var(--sp-3); row-gap: 8px; align-items: center; padding: var(--sp-3) 0; border-top: 1px solid var(--hair); min-height: 60px; }
.dg-row:first-child { border-top: 0; }
.dg-row .ddot { grid-row: 1; grid-column: 1; }
.dg-row-name { grid-row: 1; grid-column: 2; min-width: 0; font-weight: 500; color: var(--text); font-size: var(--fs-body); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-row-n { grid-row: 2; grid-column: 4; font-size: var(--fs-cap); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1; }
.dg-row .delta { grid-row: 1; grid-column: 3; text-align: right; }
.dg-row-val { grid-row: 1; grid-column: 4; align-self: end; font-size: var(--fs-h); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; letter-spacing: -.02em; }
.dg-row-bar { grid-row: 2; grid-column: 1 / 4; display: block; height: 4px; }
.dg-what { list-style: none; margin: 0; padding: 0 0 var(--sp-2); }
.dg-what li { display: grid; grid-template-columns: 8px 1fr; gap: var(--sp-3); align-items: start; padding: var(--sp-3) 0; border-top: 1px solid var(--hair); }
.dg-what li:first-child { border-top: 0; }
.dg-what li .ddot { margin-top: 7px; }
.dg-what b { display: block; font-weight: 600; color: var(--text); line-height: 1.4; }
.dg-what small { display: block; color: var(--text-2); line-height: 1.45; margin-top: 2px; }
.dg-fold > .note { padding-bottom: var(--sp-3); }
@media (min-width: 901px) {
  .dg-grid { grid-template-columns: 1fr 1fr; column-gap: var(--sp-7); align-items: start; }
  .dg-fold { padding-top: var(--sp-2); }
}
.dg-prog { position: sticky; top: 0; z-index: 6; background: var(--bg); margin: 0 calc(-1 * var(--sp-4)); padding: var(--sp-2) var(--sp-4) var(--sp-2); border-bottom: 1px solid var(--hair); }
.dg-prog-in { display: grid; grid-template-columns: auto 1fr auto; gap: var(--sp-3); align-items: center; max-width: 1180px; margin: 0 auto; }
.dg-prog-n { font-size: var(--fs-body); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.dg-prog-n b { color: var(--text); font-size: var(--fs-h); letter-spacing: -.02em; }
.dg-prog .bar { display: block; height: 4px; }
.dg-prog-cap { font-size: var(--fs-cap); color: var(--muted); white-space: nowrap; }
@media (min-width: 701px) { .dg-prog { top: 52px; margin: 0 calc(-1 * var(--sp-5)); padding-left: var(--sp-5); padding-right: var(--sp-5); } }
.dg-form { max-width: 640px; }
.dg-dom { display: flex; align-items: center; gap: 8px; font-size: var(--fs-cap); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; margin: var(--sp-5) 0 var(--sp-2); }
.dg-dom:first-of-type { margin-top: 0; }
.dg-dom .ddot { width: 6px; height: 6px; }
.dg-item { background: var(--surface); border: 0; border-radius: var(--radius); padding: var(--sp-4); margin: 0 0 var(--sp-3); min-width: 0; }
.dg-item.answered { box-shadow: inset 3px 0 0 var(--accent); }
.dg-q { display: flex; gap: var(--sp-3); align-items: baseline; font-size: var(--fs-body); font-weight: 600; line-height: 1.4; color: var(--text); padding: 0; margin: 0 0 var(--sp-3); float: left; width: 100%; }
.dg-qn { flex: 0 0 auto; font-size: var(--fs-cap); font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 22px; }
.dg-qh { font-weight: 400; color: var(--muted); }
.dg-opts { clear: both; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.dg-opt { display: inline-flex; align-items: center; margin: 0; position: relative; min-height: 44px; }
.dg-opt input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.dg-opt span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: var(--fs-body); font-weight: 500; line-height: 1.3; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background .12s ease, color .12s ease; }
.dg-opt span:active { filter: brightness(.9); transform: scale(.98); }
.dg-opt input:checked + span, .dg-opt.on span { background: var(--accent); color: #fff; font-weight: 600; }
.dg-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.dg-item > input[type=text] { clear: both; display: block; min-height: 48px; background: var(--bg); border-color: var(--hair); }
.dg-item > input[type=text]:focus { border-color: transparent; }
.dg-submit { position: sticky; bottom: 0; z-index: 6; margin: var(--sp-4) calc(-1 * var(--sp-4)) 0; padding: var(--sp-2) var(--sp-4) var(--sp-3); background: var(--bg); border-top: 1px solid var(--hair); }
.dg-submit-in { max-width: 640px; display: flex; flex-direction: column; gap: 6px; }
.dg-submit-cap { font-size: var(--fs-cap); color: var(--muted); font-variant-numeric: tabular-nums; }
.dg-submit button { width: 100%; min-height: 48px; }
@media (max-width: 700px) { .dg-submit { bottom: calc(var(--tab-h) + var(--sab)); } }
@media (min-width: 701px) { .dg-submit { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; max-width: 640px; } }
.dg-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); padding-bottom: var(--sp-4); }
.dg-tile { background: var(--surface); border-radius: var(--radius); padding: var(--sp-4); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dg-tile .label { display: flex; align-items: center; gap: 6px; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-tile .label .ddot { width: 6px; height: 6px; }
.dg-tile .value { font-size: var(--fs-h); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dg-tile .bar { display: block; margin: 4px 0 2px; }
.dg-tile .sub { font-size: var(--fs-cap); color: var(--muted); line-height: 1.4; }
@media (min-width: 701px) { .dg-tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 901px) { .dg-tiles { grid-template-columns: repeat(6, 1fr); } }
.dg-res { list-style: none; margin: 0; padding: 0; }
.dg-r { display: grid; grid-template-columns: 24px 1fr; gap: var(--sp-3); padding: var(--sp-3) 0; border-top: 1px solid var(--hair); }
.dg-r:first-child { border-top: 0; }
.dg-r-v { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-cap); font-weight: 800; margin-top: 1px; }
.dg-r.ok .dg-r-v { background: rgba(12,163,12,.18); color: var(--good); }
.dg-r.part .dg-r-v { background: rgba(250,178,25,.18); color: var(--warn); }
.dg-r.err .dg-r-v { background: rgba(208,59,59,.18); color: var(--serious); }
.dg-r-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dg-r-q { font-size: var(--fs-body); color: var(--text-2); line-height: 1.45; }
.dg-r-a { font-size: var(--fs-body); color: var(--text); line-height: 1.45; overflow-wrap: anywhere; }
.dg-r-a s { color: var(--text-2); text-decoration-color: var(--serious); }
.dg-r-a b { font-weight: 600; }
.dg-r-arrow { color: var(--muted); }
.dg-r-note { font-size: var(--fs-cap); color: var(--text-2); line-height: 1.45; }
.dg-r-meta { font-size: var(--fs-cap); color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dg-r-meta .ddot { width: 6px; height: 6px; }
@media (min-width: 901px) { .dg-res { column-count: 2; column-gap: var(--sp-7); } .dg-r { break-inside: avoid; } }
.dg .dg-r.ok, .dg .dg-r.part, .dg .dg-r.err { color: inherit; }
