/* Rumi in South African languages — shared styles.
   Rumi product tokens: navy #001F3F, ONE warm accent coral #F06E42, paper #F9FAFB. Light theme only. */
:root {
  --navy: #001F3F;
  --navy-2: #0B2D52;
  --coral: #F06E42;
  --coral-soft: #FDEBE4;
  --paper: #F9FAFB;
  --white: #FFFFFF;
  --ink: #1D2025;
  --muted: #5B6573;
  --line: #E3E7EC;
  --seen: #1E8E4E;      --seen-bg: #E5F5EC;
  --partly: #9A6200;    --partly-bg: #FCF1DC;
  --notobs: #4D5866;    --notobs-bg: #EEF1F4;
  --ins-bg: #DDF3E5;    --del-bg: #FBE1E1;
  --wa-bg: #EFEAE2;     --wa-out: #D9FDD3;  --wa-in: #FFFFFF;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,31,63,.06), 0 4px 16px rgba(0,31,63,.06);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-h: 60px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--font); overflow-x: hidden; }
img { max-width: 100%; height: auto; }
a { color: var(--navy); text-decoration-color: rgba(0,31,63,.35); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--coral); }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); font-weight: 300; letter-spacing: -.02em; }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 1.15rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 1em; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--navy); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header + language switcher ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line); height: var(--header-h); }
.site-header .inner { max-width: 1240px; margin: 0 auto; height: 100%; display: flex; align-items: center; gap: 16px; padding: 0 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); font-weight: 600; white-space: nowrap; }
.brand img { height: 22px; width: auto; }
.brand span { font-size: .95rem; }
.lang-switch { margin-left: auto; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.lang-switch::-webkit-scrollbar { display: none; }
.lang-switch a { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--navy); font-size: .9rem; font-weight: 500; white-space: nowrap; }
.lang-switch a:hover { background: var(--paper); }
.lang-switch a[aria-current="page"] { background: var(--navy); color: #fff; }
@media (max-width: 600px) { .brand span { display: none; } .lang-switch a { padding: 6px 9px; font-size: .85rem; } }

/* ---------- layout: TOC sidebar + content ---------- */
.layout { max-width: 1240px; margin: 0 auto; padding: 0 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
@media (min-width: 1024px) { .layout { grid-template-columns: 220px minmax(0, 1fr); } }
main { min-width: 0; padding-bottom: 80px; }
section.block { padding: 40px 0 8px; border-top: 1px solid var(--line); }
section.block:first-of-type { border-top: 0; }
.lede { font-size: 1.15rem; color: var(--navy); font-weight: 500; max-width: 62ch; }
.prose { max-width: 68ch; }
.prose ul, ul.bullets { padding-left: 1.2em; margin: 0 0 1em; }
.prose li, ul.bullets li { margin: .3em 0; }
.note { font-size: .88rem; color: var(--muted); }
.kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 600; color: var(--coral); margin-bottom: .4em; }

.toc { font-size: .9rem; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: 6px 10px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--navy); }
.toc a.active { color: var(--navy); border-left-color: var(--coral); font-weight: 600; background: var(--white); }
.toc li.sub a { padding-left: 22px; font-size: .85rem; }
.toc-desktop { display: none; }
@media (min-width: 1024px) {
  .toc-desktop { display: block; position: sticky; top: calc(var(--header-h) + 24px); align-self: start; max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; padding-top: 32px; }
  .toc-mobile { display: none; }
}
.toc-title { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 8px 10px; }
.toc-mobile { position: sticky; top: var(--header-h); z-index: 40; margin: 0 -16px; background: var(--paper); border-bottom: 1px solid var(--line); }
.toc-mobile summary { padding: 10px 16px; cursor: pointer; font-weight: 600; color: var(--navy); font-size: .9rem; list-style: none; display: flex; justify-content: space-between; }
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary::after { content: "▾"; color: var(--coral); }
.toc-mobile[open] summary::after { content: "▴"; }
.toc-mobile .toc { padding: 0 8px 12px; max-height: 60vh; overflow-y: auto; }

/* ---------- cards, chips ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.grid-3 { display: grid; gap: 16px; grid-template-columns: minmax(0,1fr); }
@media (min-width: 760px) { .grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.grid-2 { display: grid; gap: 16px; grid-template-columns: minmax(0,1fr); }
@media (min-width: 760px) { .grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); } }

.chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); white-space: nowrap; font-size: .85rem; line-height: 1.3; }
.chip .v { font-weight: 700; color: var(--navy); font-size: 1rem; font-variant-numeric: tabular-nums; }
.chip .of { color: var(--muted); font-size: .75rem; }
.chip .l { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.chip.measured .l { color: var(--navy); }
.chip.ai .l { color: #8A4A00; }
.chip.ai { border-style: dashed; }
.chip.proxy .l { color: #5B4A8A; }
.chip.proxy { border-style: dotted; }
.chip.pending { background: var(--white); }
.chip.pending .v { color: var(--muted); font-weight: 500; font-size: .9rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.score-line { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0 0; }
.score-line .note { margin: 0; }

.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.status.seen { background: var(--seen-bg); color: var(--seen); }
.status.partly { background: var(--partly-bg); color: var(--partly); }
.status.not_observed { background: var(--notobs-bg); color: var(--notobs); }

.ph { background: #FFF6D6; border: 1px dashed #D9A400; color: #6B5200; padding: 0 4px; border-radius: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8em; }
.soon { border: 1px dashed var(--line); border-radius: var(--radius); padding: 20px; color: var(--muted); background: var(--white); text-align: center; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--navy); background: var(--white); color: var(--navy); font: 500 .9rem var(--font); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--paper); }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.small { padding: 4px 10px; font-size: .8rem; }
.btn[aria-pressed="true"] { background: var(--navy); color: #fff; }
.ts { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--coral); background: var(--coral-soft); color: #9A3A15; font: 600 .78rem var(--font); cursor: pointer; font-variant-numeric: tabular-nums; }
.ts:hover { background: var(--coral); color: #fff; }

/* ---------- hero + summary table ---------- */
.hero { padding: 48px 0 24px; }
.hero .answer { font-size: clamp(1.15rem, 2.4vw, 1.4rem); color: var(--navy); line-height: 1.45; max-width: 46ch; font-weight: 400; }
.conditions { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; max-width: 70ch; }
.conditions li { padding-left: 28px; position: relative; }
.conditions li::before { content: counter(c); counter-increment: c; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--coral); color: #fff; font-size: .72rem; font-weight: 700; display: grid; place-items: center; }
.conditions { counter-reset: c; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); border: 1px solid var(--line); background: var(--white); box-shadow: var(--shadow); }
table.summary { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.summary th, table.summary td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.summary thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--paper); }
table.summary tbody th a { font-weight: 600; text-decoration: none; }
table.summary td a.cell { text-decoration: none; display: inline-block; }
table.summary tr.group th { background: var(--paper); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
table.summary tr.also { font-size: .85rem; }
table.summary .verdict { font-weight: 600; color: var(--navy); }
/* phone: summary table becomes stacked cards */
@media (max-width: 700px) {
  .table-wrap.stack { border: 0; background: none; box-shadow: none; overflow: visible; }
  .stack table, .stack tbody, .stack tr, .stack th, .stack td { display: block; width: 100%; }
  .stack thead { display: none; }
  .stack tr { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; padding: 8px 4px; box-shadow: var(--shadow); }
  .stack tr.group { background: none; border: 0; box-shadow: none; padding: 8px 0 0; margin: 0; }
  .stack td, .stack th { border: 0; padding: 6px 12px; }
  .stack td[data-h] { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .stack td[data-h]::before { content: attr(data-h); font-size: .78rem; color: var(--muted); font-weight: 600; }
}

table.plain { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--white); }
table.plain th, table.plain td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.plain thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--paper); }

/* ---------- method diagram ---------- */
.pipeline { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; margin: 8px 0 16px; padding: 0; list-style: none; }
.pipeline li { flex: 1 1 120px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: .85rem; position: relative; }
.pipeline li b { display: block; color: var(--navy); font-size: .9rem; }
.pipeline li .n { color: var(--coral); font-weight: 700; font-size: .75rem; }
.labels-key { display: grid; gap: 8px; grid-template-columns: minmax(0,1fr); margin: 12px 0; }
@media (min-width: 760px) { .labels-key { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.labels-key > div { display: grid; gap: 4px; }

/* ---------- language cards ---------- */
.lang-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.lang-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,31,63,.12); }
.lang-card h3 { margin: 0; font-size: 1.35rem; }
.lang-card .go { color: var(--coral); font-weight: 600; font-size: .9rem; margin-top: auto; }

/* ---------- verdict strip ---------- */
.verdict-strip { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 20px; margin-top: 24px; }
.verdict-strip h1 { color: #fff; margin-bottom: 4px; }
.verdict-strip .vline { font-size: 1.05rem; opacity: .95; margin: 0 0 14px; }
.verdict-strip .chip { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.25); color: #fff; }
.verdict-strip .chip .v { color: #fff; }
.verdict-strip .chip .l, .verdict-strip .chip .of, .verdict-strip .chip .k { color: rgba(255,255,255,.75); }
.verdict-strip a.chip { text-decoration: none; }
.chip .k { font-size: .78rem; color: var(--muted); font-weight: 500; }
.verdict-strip .pending-ear { display: inline-block; margin-top: 12px; font-size: .85rem; color: #FFD9CB; }

/* ---------- SyncPlayer ---------- */
.sync { display: grid; gap: 16px; grid-template-columns: minmax(0,1fr); }
@media (min-width: 900px) { .sync { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.video-box { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0b1622; border-radius: 12px; overflow: hidden; }
.video-box iframe, .video-box > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-credit { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.transcript { background: var(--white); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; min-height: 260px; max-height: 420px; }
@media (min-width: 900px) { .transcript { max-height: none; height: 100%; min-height: 0; } .sync .tcol { position: relative; } .sync .tcol .transcript { position: absolute; inset: 0; } }
@media (max-width: 899px) { .transcript { height: 340px; } }
.transcript .bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; border-bottom: 1px solid var(--line); align-items: center; }
.transcript .bar .t { margin-right: auto; font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.turns { list-style: none; margin: 0; padding: 10px; overflow-y: auto; flex: 1; scroll-behavior: smooth; }
.turns .hint { color: var(--muted); font-size: .9rem; text-align: center; padding: 24px 12px; }
.turn { padding: 8px 10px; border-radius: 10px; margin-bottom: 6px; cursor: pointer; border: 1px solid transparent; }
.turn[hidden] { display: none; }
.turn:hover { background: var(--paper); }
.turn.now { background: var(--coral-soft); border-color: rgba(240,110,66,.35); }
.turn .who { display: flex; align-items: center; gap: 8px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--navy); margin-bottom: 2px; }
.turn .who .time { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.turn .who .en-t { margin-left: auto; }
.turn.spk-learners .who, .turn.spk-learner .who { color: #2F6B4F; }
.turn .txt { font-size: .98rem; }
.turn .txt .caret { display: inline-block; width: 2px; height: 1em; background: var(--coral); vertical-align: -2px; margin-left: 1px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.turn .en { font-size: .88rem; color: var(--muted); margin-top: 4px; font-style: italic; }
.turn.in-window { box-shadow: inset 3px 0 0 var(--navy); }
.baseline { margin: 0 10px 10px; padding: 10px 12px; border-radius: 10px; background: #F1F3F6; border: 1px dashed #9AA5B1; font-size: .9rem; }
.baseline .lab { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; display: block; margin-bottom: 4px; }

/* ---------- Karaoke ---------- */
.karaoke { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.k-controls { display: flex; align-items: center; gap: 10px; }
.k-play { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; cursor: pointer; display: grid; place-items: center; }
.k-play svg { width: 16px; height: 16px; fill: currentColor; }
.k-range { flex: 1; min-width: 0; accent-color: var(--coral); }
.k-time { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 78px; text-align: right; }
.k-text { margin-top: 12px; font-size: 1.08rem; line-height: 1.75; }
.k-word { cursor: pointer; border-radius: 4px; padding: 1px 1px; transition: background .08s, color .08s; }
.k-word:hover { text-decoration: underline; text-decoration-color: var(--coral); }
.k-word.done { color: var(--navy); }
.k-word.on { background: var(--coral); color: #fff; }
.k-text.idle .k-word { color: var(--ink); }
.k-en { margin-top: 8px; font-size: .9rem; color: var(--muted); font-style: italic; }

/* ---------- Chat ---------- */
.chat { background: var(--wa-bg); border-radius: 14px; padding: 16px 12px; display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.bubble { max-width: 88%; padding: 8px 10px 6px; border-radius: 10px; box-shadow: 0 1px 1px rgba(0,0,0,.08); position: relative; font-size: .95rem; }
.bubble.teacher { align-self: flex-end; background: var(--wa-out); border-top-right-radius: 2px; }
.bubble.rumi { align-self: flex-start; background: var(--wa-in); border-top-left-radius: 2px; width: 88%; }
.bubble .from { font-size: .75rem; font-weight: 700; color: var(--coral); margin-bottom: 2px; }
.bubble.teacher .from { color: #1E7A4C; }
.bubble .en { font-size: .82rem; color: var(--muted); font-style: italic; margin-top: 4px; border-top: 1px solid rgba(0,0,0,.06); padding-top: 4px; }
.bubble .karaoke { border: 0; padding: 4px 0 0; background: transparent; }
.bubble .k-text { font-size: .98rem; margin-top: 8px; }

/* ---------- Report ---------- */
.report .summary-en { font-size: 1.05rem; color: var(--navy); }
.report .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.report .meta span { font-size: .8rem; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .82rem; color: var(--muted); margin: 8px 0 16px; }
.step-group { margin-bottom: 18px; }
.step-group > h4 { display: flex; align-items: center; gap: 8px; }
.step { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: var(--white); }
.step.seen { border-left: 4px solid var(--seen); }
.step.partly { border-left: 4px solid #D99A1E; }
.step.not_observed { border-left: 4px solid #9AA5B1; }
.step .head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.step .name { font-weight: 600; color: var(--navy); }
.step .name-l { color: var(--muted); font-size: .88rem; }
.step .note-en { margin: 6px 0 0; font-size: .92rem; }
.evidence { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.evidence li { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 4px 10px; align-items: start; font-size: .92rem; }
.evidence q { quotes: "“" "”"; }
.evidence .qen { grid-column: 2; color: var(--muted); font-size: .85rem; font-style: italic; }
.pb-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.pb-list li { display: flex; gap: 10px; align-items: flex-start; }
.grow { display: grid; gap: 10px; grid-template-columns: minmax(0,1fr); }
@media (min-width: 760px) { .grow { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.grow > div { background: var(--paper); border-radius: 10px; padding: 12px; }
.grow .g { font-weight: 800; color: var(--coral); font-size: 1.2rem; margin-right: 4px; }
.bil .l { font-weight: 500; color: var(--navy); }
.bil .e { color: var(--muted); font-size: .88rem; font-style: italic; }
ol.plan { padding-left: 1.3em; margin: 0; display: grid; gap: 10px; }
.accuracy { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 18px 20px; }
.accuracy h4 { color: #fff; }
.accuracy .chip { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.25); color: #fff; }
.accuracy .chip .v { color: #fff; }
.accuracy .chip .l, .accuracy .chip .k, .accuracy .chip .of { color: rgba(255,255,255,.75); }
.accuracy p { color: rgba(255,255,255,.88); font-size: .9rem; margin: 10px 0 0; }
.subcard-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 0 0 10px; }

/* ---------- VisionDiff ---------- */
.vdiff { display: grid; gap: 16px; grid-template-columns: minmax(0,1fr); }
@media (min-width: 900px) { .vdiff { grid-template-columns: minmax(0,1fr) minmax(0,1fr); } }
.vdiff figure { margin: 0; }
.vdiff figure img { border: 1px solid var(--line); border-radius: 10px; background: #fff; display: block; width: 100%; cursor: zoom-in; }
.vdiff figcaption { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.difftext { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 14px; font-size: 1rem; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.difftext ins { background: var(--ins-bg); text-decoration: none; border-bottom: 2px solid var(--seen); }
.difftext del { background: var(--del-bg); color: #8A1C1C; }
.layer { font-size: .9rem; color: var(--muted); background: var(--paper); border-radius: 10px; padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 10px; }

/* ---------- LPViewer ---------- */
.thumbs { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); margin: 8px 0 14px; }
.thumbs button { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; cursor: zoom-in; aspect-ratio: 3 / 4; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
dialog.lightbox::backdrop { background: rgba(0,15,32,.85); }
dialog.lightbox img { max-width: 94vw; max-height: 86vh; display: block; margin: 0 auto; border-radius: 8px; background: #fff; }
dialog.lightbox .lb-bar { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
dialog.lightbox .lb-bar .btn { background: rgba(255,255,255,.95); }
.lb-count { color: #fff; align-self: center; font-size: .85rem; min-width: 50px; text-align: center; }

/* ---------- footnotes ---------- */
sup.fn { line-height: 0; font-size: .7em; margin-left: 1px; }
sup.fn a { text-decoration: none; color: var(--coral); font-weight: 700; padding: 0 1px; }
ol.footnotes { padding-left: 1.6em; font-size: .88rem; color: var(--ink); display: grid; gap: 8px; }
ol.footnotes li:target { background: var(--coral-soft); border-radius: 6px; }
ol.footnotes .back { text-decoration: none; margin-left: 4px; color: var(--coral); }
ol.footnotes .lic { color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); padding: 24px 16px 40px; color: var(--muted); font-size: .85rem; text-align: center; }
.site-footer img { height: 18px; width: auto; vertical-align: -3px; margin-right: 6px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .turns { scroll-behavior: auto; } .turn .txt .caret { animation: none; } }
.chip.verdict { background: var(--seen-bg); border-color: transparent; }
.chip.verdict .v { color: var(--seen); letter-spacing: .04em; font-size: .85rem; }
.chip.verdict.amber { background: var(--partly-bg); } .chip.verdict.amber .v { color: var(--partly); }
.chip.verdict.red { background: var(--del-bg); } .chip.verdict.red .v { color: #8A1C1C; }
.cell-note { display: block; font-size: .72rem; color: var(--muted); margin-top: 3px; line-height: 1.3; max-width: 22ch; }
section.block.sub { border-top: 0; padding-top: 24px; }
.verdict-strip .vmaterial { font-size: .85rem; color: rgba(255,255,255,.8); margin: 10px 0 0; }
.verdict-strip .vmaterial a, .verdict-strip sup.fn a { color: #FFB79D; }
.site-footer p { margin: 4px auto; max-width: 70ch; }
.acc-items { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; font-size: .92rem; }
.acc-items strong { color: #fff; }
.accuracy .acc-model { font-size: .78rem; color: rgba(255,255,255,.65); }
a.chip { text-decoration: none; }
a.chip:hover { border-color: var(--coral); }
.grid-2 > .card, .grid-3 > .card, .labels-key > .card { margin-top: 0; }
.labels-key > .card { align-content: start; }
.labels-key .chip { justify-self: start; align-self: start; }
.pipeline li .n { display: block; }
#scheme-host img { width: 100%; max-height: 560px; object-fit: cover; object-position: top left; }
.k-text.idle .k-word.on { background: none; color: inherit; }
.sync .tcol { min-height: 380px; }
.turn.interview { background: #F6F7F9; }
.turn.interview .txt { color: var(--muted); }
.turn .who .tag { font-size: .65rem; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; text-transform: none; letter-spacing: 0; }
.ts { white-space: nowrap; }
@media (max-width: 600px) {
  .card { padding: 16px; }
  .report.card { padding: 14px 12px; border-radius: 12px; }
  .report .card { padding: 12px; box-shadow: none; }
  .step { padding: 10px; }
  .site-header .inner { gap: 8px; padding: 0 12px; }
  .brand img { height: 18px; }
  .lang-switch { gap: 2px; }
  .lang-switch a { padding: 6px 8px; font-size: .82rem; }
}
.card .karaoke.compact { border: 0; padding: 0; }
.vchips { margin-top: 12px; }
.baseline { max-height: 42%; overflow-y: auto; flex: 0 0 auto; }
@media (max-width: 899px) { .baseline { max-height: 140px; } }
.chip { max-width: 100%; flex-wrap: wrap; white-space: normal; row-gap: 0; }
.chip .k { white-space: normal; }
.chip .v, .chip .of, .chip .l { white-space: nowrap; }

/* Page-truth reconstruction (Rumi's rebuild of the workbook page, beside the page image) */
.ptpage { background: var(--white, #fff); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(0,31,63,.05); }
.pt-top { display: flex; align-items: center; gap: 10px; background: #1EA3E0; color: #fff; border-radius: 8px 8px 0 0; margin: -16px -18px 12px; padding: 10px 14px; }
.pt-ws { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 50%; background: #fff; color: #1EA3E0; font-weight: 700; font-size: .95rem; }
.pt-title { font-weight: 700; font-size: 1.25rem; letter-spacing: .01em; }
.pt-week { font-size: .85rem; color: var(--muted); margin: -4px 0 10px; }
.pt-activity { border-left: 3px solid var(--coral); background: var(--coral-soft); border-radius: 0 8px 8px 0; padding: 8px 12px; margin-bottom: 12px; }
.pt-act-label { display: inline-block; font-weight: 700; color: var(--navy); font-size: .9rem; margin-bottom: 2px; }
.pt-instr { margin: 0; color: var(--ink); }
.pt-pic { border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.pt-pic-desc { font-size: .88rem; color: var(--muted); }
.pt-pic-tag { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--navy); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; margin-right: 4px; }
.pt-labels { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pt-label { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: .9rem; color: var(--ink); }
.pt-pageno { text-align: left; font-size: .8rem; color: var(--muted); margin-top: 6px; }
.pt-stamp { margin-top: 10px; padding-top: 8px; border-top: 1px dotted var(--line); font-size: .78rem; color: var(--muted); }
.pt-stamp code { font-size: .78rem; background: var(--paper); padding: 1px 4px; border-radius: 4px; overflow-wrap: anywhere; }
.pt-unsure { display: inline-block; margin-left: 6px; color: #9A5B00; background: #FFF4DE; border-radius: 999px; padding: 0 8px; }
.pt-meta { margin: 8px 0 0; }

/* voice trials (speaking section) */
.trials{margin-top:12px}
.trial-list{list-style:none;margin:0;padding:0;display:grid;gap:12px}
.trial-list li{display:grid;gap:4px}
.trial-label{font-weight:600}
.trial-list audio{width:100%;max-width:420px;height:36px}

/* ---------- Listening review (review.html) ---------- */
.review-main { max-width: 1240px; margin: 0 auto; padding: 0 16px 80px; min-width: 0; }
.review-intro { padding: 36px 0 8px; }
.review-intro .how { margin-top: 16px; max-width: 760px; }
.review-intro .how ol, .review-intro .how ul { margin: 0 0 8px; padding-left: 1.3em; }
.rv-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 8px; }
.rv-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--navy); font: 500 .9rem var(--font); cursor: pointer; }
.rv-tab .n { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.rv-tab[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.rv-tab[aria-pressed="true"] .n { color: rgba(255,255,255,.75); }
.rv-group { font-size: 1.2rem; margin: 24px 0 10px; }
.rv-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: minmax(0,1fr); }
@media (min-width: 640px) { .rv-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1024px) { .rv-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.rv-grid > li { min-width: 0; }
.rv-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; height: 100%; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.rv-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,31,63,.12); }
.rv-thumb { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #0b1622; color: rgba(255,255,255,.8); font-size: 1.6rem; }
.rv-thumb-mp3 { background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
.rv-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.rv-card h3 { font-size: 1rem; margin: 0; overflow-wrap: anywhere; }
.rv-sub { font-size: .85rem; color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.rv-facts { font-size: .82rem; color: var(--muted); margin: 0; }
.rv-card-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.rv-count { font-size: .8rem; color: var(--muted); }
.labels-help { margin-top: 24px; max-width: 760px; }
.labels-help summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.labels-help[open] summary { margin-bottom: 8px; }

.rv-rec { padding-top: 20px; outline: none; }
.rv-back { font-size: .9rem; font-weight: 500; text-decoration: none; }
.rv-back::before { content: "← "; }
.rv-banner { display: flex; align-items: flex-start; gap: 10px; background: var(--coral-soft); border: 1px solid rgba(240,110,66,.45); color: #6E2A10; border-radius: 10px; padding: 10px 12px; margin: 4px 0 14px; font-weight: 500; }
.rv-banner > span { flex: 1; min-width: 0; }
.rv-x { border: 0; background: none; font-size: 1.3rem; line-height: 1; color: inherit; cursor: pointer; padding: 0 4px; }
.rv-rec h2 { margin: 0 0 6px; overflow-wrap: anywhere; }
.rv-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.rv-meta span { font-size: .8rem; background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.rv-share { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rv-share-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.rv-share-row { margin-bottom: 14px; }
.rv-copied { font-size: .8rem; color: var(--seen); font-weight: 600; }
.rv-reviewer { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; padding: 14px 16px; margin-bottom: 16px; }
.rv-field { display: grid; gap: 4px; flex: 1 1 220px; min-width: 0; }
.rv-field label, .fb-form label { font-size: .8rem; font-weight: 600; color: var(--navy); }
.rv-reviewer input, .fb-form input, .fb-form textarea, .rv-comment textarea { width: 100%; font: 400 .95rem var(--font); padding: 8px 10px; border: 1px solid #C9D1DA; border-radius: 8px; background: #fff; color: var(--ink); }
.rv-reviewer input[aria-invalid="true"] { border-color: #B42318; box-shadow: 0 0 0 2px #FDE2E0; }
.rv-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rv-err { flex-basis: 100%; margin: 0; color: #B42318; font-size: .85rem; font-weight: 500; }
.rv-closed { flex-basis: 100%; margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--notobs-bg); color: var(--notobs); font-size: .88rem; }
.rv-queue { flex-basis: 100%; margin: 0; font-size: .85rem; color: var(--partly); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rv-sync .transcript { min-height: 0; }
@media (min-width: 900px) {
  .rv-sync { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
  .rv-sync > div:first-child { position: sticky; top: calc(var(--header-h) + 12px); }
  .rv-sync .tcol { min-height: 0; }
  .rv-sync .tcol .transcript { position: static; height: calc(100vh - var(--header-h) - 40px); max-height: 760px; min-height: 420px; }
}
@media (max-width: 899px) { .rv-sync .transcript { height: 70vh; max-height: 620px; } }
.video-box video, .video-box audio { position: absolute; inset: 0; width: 100%; height: 100%; background: #0b1622; }
.video-box.audio-box { aspect-ratio: auto; height: auto; min-height: 64px; background: var(--navy); padding: 12px; }
.video-box.audio-box img { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 8px; margin-bottom: 10px; }
.video-box.audio-box audio { position: static; height: 40px; background: transparent; }
.turn.linked { box-shadow: inset 4px 0 0 var(--coral); background: #FFF7F3; }
.turn.linked.now { background: var(--coral-soft); }
.fb-turn { margin-top: 6px; cursor: default; }
.fb-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fb-v[aria-pressed="true"].fb-right { background: var(--seen); border-color: var(--seen); color: #fff; }
.fb-v[aria-pressed="true"].fb-wrong { background: #B42318; border-color: #B42318; color: #fff; }
.fb-v[aria-pressed="true"].fb-unsure { background: var(--partly); border-color: var(--partly); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.fb-share { margin-left: auto; border-color: var(--line); color: var(--muted); }
.fb-low { font-size: .72rem; color: var(--partly); background: var(--partly-bg); border-radius: 999px; padding: 1px 8px; }
.fb-form { display: grid; gap: 6px; margin-top: 8px; padding: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.fb-turn .rv-share { margin-top: 8px; }
.rv-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.rv-status { font-size: .85rem; color: var(--muted); }
.rv-status.ok { color: var(--seen); font-weight: 600; }
.rv-status.wait { color: var(--partly); font-weight: 500; }
.rv-status.err { color: #B42318; font-weight: 500; display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fb-turn > .rv-status:empty { display: none; }
.rv-scores { margin: 4px 0 8px; }
.rv-bottom { display: grid; gap: 16px; grid-template-columns: minmax(0,1fr); margin-top: 16px; }
@media (min-width: 900px) { .rv-bottom { grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: start; } }
.rv-bottom > .card { margin-top: 0; }
.rv-comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.c-item { border-bottom: 1px solid var(--line); padding-bottom: 10px; overflow-wrap: anywhere; }
.c-item:last-child { border-bottom: 0; }
.c-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: .9rem; }
.c-head strong { color: var(--navy); }
.c-role { font-size: .78rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; }
.c-head time { font-size: .78rem; color: var(--muted); margin-left: auto; }
.c-bits { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 2px; }
.c-verdict { font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.c-verdict.fb-right { background: var(--seen-bg); color: var(--seen); }
.c-verdict.fb-wrong { background: var(--del-bg); color: #8A1C1C; }
.c-verdict.fb-unsure { background: var(--partly-bg); color: var(--partly); }
.c-item p { margin: 4px 0 0; font-size: .92rem; white-space: pre-wrap; }
.c-lab { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.review-link { margin: 12px 0 0; font-size: .95rem; color: var(--ink); }
.review-link a { font-weight: 600; }
.review-link a { color: var(--coral); text-decoration: none; }
.review-link a:hover { text-decoration: underline; }

.how-steps { margin: 0 0 8px; padding-left: 1.3em; display: grid; gap: 4px; }
.rv-tag { font-size: .78rem; font-weight: 600; color: var(--seen); margin: 0; }
.rv-why { display: block; flex-basis: 100%; font-size: .82rem; color: var(--muted); }
.c-item.pending { opacity: .75; }
.rv-banner .rv-x { flex: 0 0 auto; border-color: rgba(110,42,16,.4); color: #6E2A10; }
.rv-player-h { margin: 8px 0 10px; }
.rv-who { margin: 0; flex-basis: 100%; }
.rv-remember { flex-basis: 100%; margin: 0; }
.rv-soon { margin-top: 12px; }
.rv-v { font-size: .9rem; }

.nav-short { display: none; }
@media (max-width: 600px) { .lang-switch .nav-long { display: none; } .lang-switch .nav-short { display: inline; } }
@media (max-width: 420px) { .site-header .inner { gap: 6px; padding: 0 10px; } .lang-switch a { padding: 6px 7px; font-size: .8rem; } }

/* Listening review: label meanings, notes above a language's list, correction hint, split lines, silence line */
.rv-notes { display: grid; gap: 8px; max-width: 760px; margin: 4px 0 14px; }
.rv-notes:empty { display: none; }
.rv-note { margin: 0; font-size: .9rem; color: var(--ink); }
.rv-group + .rv-note { margin: -4px 0 10px; font-size: .85rem; color: var(--muted); max-width: 760px; }
.rv-mean { font-weight: 600; }
.rv-hint { margin: 0; font-size: .8rem; color: var(--muted); }
.rv-split { margin: 0 0 6px; font-size: .8rem; color: #8A4A00; }
.rv-silence { margin: 4px 0 0; }
.lang-partner { display: block; margin-top: 6px; max-width: none; }

/* Speaking review (speak.html) */
.sp-section { margin-top: 8px; }
.sp-sent { margin-top: 16px; scroll-margin-top: calc(var(--header-h) + 16px); outline: none; }
.sp-sent.linked { box-shadow: inset 4px 0 0 var(--coral), var(--shadow); }
.sp-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 8px; }
.sp-head h3 { margin: 0; }
.sp-src { font-size: .75rem; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; }
.sp-text { font-size: 1.1rem; line-height: 1.6; margin: 0 0 4px; color: var(--navy); overflow-wrap: anywhere; }
.sp-en { font-size: .9rem; color: var(--muted); font-style: italic; margin: 0 0 8px; }
.sp-voices { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; grid-template-columns: minmax(0,1fr); }
@media (min-width: 900px) { .sp-voices { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.sp-voice { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--paper); min-width: 0; }
.sp-voice .karaoke.compact { background: transparent; }
.sp-vhead { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 6px; color: var(--navy); }
.sp-flagged { font-size: .78rem; color: #8A1C1C; font-weight: 600; }
.k-word.flag { background: var(--del-bg); color: #8A1C1C; text-decoration: underline wavy #B42318; text-underline-offset: 3px; }
.k-word.flag.on { background: var(--coral); color: #fff; }
.sp-scales { display: grid; gap: 8px; margin-top: 10px; }
.sp-scale { display: grid; gap: 4px; }
.sp-scale-l { font-size: .8rem; font-weight: 600; color: var(--navy); }
.sp-scale-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.sp-end { font-size: .72rem; color: var(--muted); }
.sp-n, .sp-best { min-width: 34px; justify-content: center; }
.sp-bestrow { display: grid; gap: 4px; margin-top: 14px; }
.sp-better { margin-top: 12px; }
.sp-check { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; margin-top: 10px; cursor: pointer; }
.sp-check input { margin-top: 4px; flex: 0 0 auto; }
.sp-record { margin-top: 12px; border: 1px dashed #C9D1DA; border-radius: 10px; padding: 8px 12px; background: var(--white); }
.sp-record summary { cursor: pointer; font-weight: 600; color: var(--navy); font-size: .92rem; }
.sp-record .note { margin: 8px 0; }
.sp-rec-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sp-clock { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.btn.rec-on { background: #B42318; border-color: #B42318; color: #fff; }
.sp-preview { display: block; width: 100%; max-width: 360px; margin-top: 8px; height: 40px; }
.sp-results { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.sp-results .note { margin: 0; }
.sp-key ul { margin: 0; }
.sp-locked { margin: 4px 0 0; }
.sp-verdicts { margin-top: 10px; }
.k-text .k-word[role="button"]:focus-visible { outline: 2px solid var(--coral); }
.sp-ends { display: flex; justify-content: space-between; gap: 8px; max-width: 214px; }
.sp-reveal { display: inline-flex; flex-wrap: wrap; gap: 2px 8px; font-size: .8rem; color: var(--muted); }
.sp-reveal .sp-name { font-weight: 600; color: var(--seen); }
/* a long label (e.g. the Speaking chip's two-part label) wraps inside the chip instead of widening the page */
.chip { max-width: 100%; flex-wrap: wrap; }
.chip .l { white-space: normal; min-width: 0; }
.chip:has(.l) { border-radius: 14px; }
/* six nav links (with the Speaking review) fit a 390 px phone without hiding the last one */
@media (max-width: 420px) { .lang-switch { gap: 0; } .lang-switch a { padding: 6px 5px; font-size: .76rem; } .brand img { width: 26px; height: 26px; } }
