/* ============================================================
   Scorevia · Soft UI · two themes: Colorful (beige + teal) and Black & White
   ============================================================ */

:root, [data-look="color"] {
  --bg: #F3EDE2; --card: #F3EDE2; --field: #F3EDE2;
  --ink: #1F2A2C; --soft: #3B3832; --muted: #5E5A52;
  --primary: #0F5C63; --primary-hover: #0B4B51; --on-primary: #FFFFFF;
  --tint: #DCEAE5; --tint-ink: #0B4A50;
  --accent: #3FB8AF; --track: #E3D9C9; --line: transparent; --rule: #DED4C3;
  --raise: 8px 8px 18px #DCD2C1, -8px -8px 18px #FFFFFF;
  --raise-sm: 4px 4px 10px #DCD2C1, -4px -4px 10px #FFFFFF;
  --press: inset 4px 4px 9px #DCD2C1, inset -4px -4px 9px #FFFFFF;
  --warn-bg: #F1E3C2; --warn-ink: #4A3509; --warn-chip: #E7CC8C;
  --good-bg: #D6E8DC; --good-ink: #1D5E4A; --good: #2E7D5B;
  --bad-bg: #F2D6D4; --bad-ink: #7D2327;
  --off-bg: #E3DCCF; --off-ink: #3B3832;
  --wa: #1E6F47; --wa-hover: #175A39;
  --hero: #0F5C63; --hero-sub: #CFE8E4; --hero-bar: #7FD6CC; --hero-btn: #F3EDE2;
  --logo-tile: #0F5C63; --logo-road: #F5EFE4; --logo-dot: #7FD6CC;
  --ukvi: #2E6F9E; --core: #2F8F74;
  --tabbar: #F7F2E9; --overlay: rgba(31, 42, 44, .38);
  --focus: 0 0 0 3px rgba(15, 92, 99, .35);
  /* chart series (Describe Image, reports) */
  --c1: #0F5C63; --c2: #3FB8AF; --c3: #C9873A; --c4: #8A6FB0; --c5: #D66A5E; --c6: #5B8DB8; --c7: #9AA36B;
  --chart-bg: #FBF8F2; --chart-grid: #E4DBCB;
  color-scheme: light;
}

[data-look="mono"] {
  --bg: #FFFFFF; --card: #FFFFFF; --field: #F4F4F4;
  --ink: #111111; --soft: #333333; --muted: #555555;
  --primary: #111111; --primary-hover: #000000; --on-primary: #FFFFFF;
  --tint: #EFEFEF; --tint-ink: #111111;
  --accent: #111111; --track: #E6E6E6; --line: #E6E6E6; --rule: #E6E6E6;
  --raise: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.06);
  --raise-sm: 0 1px 2px rgba(0,0,0,.05), 0 3px 10px rgba(0,0,0,.06);
  --press: inset 0 1px 3px rgba(0,0,0,.07);
  --warn-bg: #F2F2F2; --warn-ink: #111111; --warn-chip: #E2E2E2;
  --good-bg: #FFFFFF; --good-ink: #111111; --good: #111111;
  --bad-bg: #111111; --bad-ink: #FFFFFF;
  --off-bg: #E2E2E2; --off-ink: #333333;
  --wa: #111111; --wa-hover: #000000;
  --hero: #111111; --hero-sub: #CCCCCC; --hero-bar: #FFFFFF; --hero-btn: #FFFFFF;
  --logo-tile: #111111; --logo-road: #FFFFFF; --logo-dot: #FFFFFF;
  --ukvi: #111111; --core: #111111;
  --tabbar: #FFFFFF; --overlay: rgba(0, 0, 0, .35);
  --focus: 0 0 0 3px rgba(0, 0, 0, .25);
  --c1: #111111; --c2: #6E6E6E; --c3: #B0B0B0; --c4: #3D3D3D; --c5: #8C8C8C; --c6: #D4D4D4; --c7: #555555;
  --chart-bg: #FFFFFF; --chart-grid: #E6E6E6;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
body, .card, .inset, .btn, .input, .chip, .seg button, .nav a {
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, border-color .18s ease;
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

h1, h2, h3 { font-family: 'Poppins', 'DM Sans', sans-serif; margin: 0; line-height: 1.25; }
h1 { font-size: 26px; font-weight: 600; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus) !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 700; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.tight { gap: 8px; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.kpi { gap: 16px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.hidden { display: none !important; }

/* ---------- Surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--raise); padding: 22px; }
.card.sm { border-radius: 18px; box-shadow: var(--raise-sm); padding: 16px; }
.inset { background: var(--field); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--press); padding: 12px 14px; }
.hero { background: var(--hero); color: #fff; border-radius: 24px; box-shadow: var(--raise); padding: 22px; }
.hero .sub { color: var(--hero-sub); }
.tint { background: var(--tint); color: var(--tint-ink); border-radius: 16px; padding: 14px 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); color: var(--primary); box-shadow: var(--raise-sm);
  font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(.99); }
.btn:active { box-shadow: var(--press); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-wa { background: var(--wa); color: #fff; border-color: transparent; }
.btn-wa:hover { background: var(--wa-hover); }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--soft); }
.btn-danger { color: var(--bad-ink); }
[data-look="color"] .btn-danger { color: #8E2A2F; }
.btn-sm { min-height: 36px; padding: 0 12px; border-radius: 11px; font-size: 13px; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }
.btn-block { width: 100%; }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 700; color: var(--soft); }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 14px;
  background: var(--field); border: 1px solid var(--line); box-shadow: var(--press); outline: none;
}
textarea.input { resize: vertical; min-height: 96px; line-height: 1.5; }
.input::placeholder { color: var(--muted); opacity: .85; }
.input-group { display: flex; gap: 8px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.help { font-size: 12px; color: var(--muted); }
.error-text { color: var(--bad-ink); font-size: 13px; font-weight: 600; }
[data-look="color"] .error-text { color: #8E2A2F; }

/* segmented control */
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); box-shadow: var(--press); }
.seg button {
  border: 0; background: transparent; color: var(--soft); border-radius: 10px;
  padding: 8px 12px; font-weight: 600; font-size: 13px; cursor: pointer; min-height: 36px;
}
.seg button[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); box-shadow: var(--raise-sm); font-weight: 700; }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg.full { display: flex; }
.seg.full button { flex: 1; }
.seg button .lock { margin-left: 4px; opacity: .7; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--line); white-space: nowrap; }
.chip-warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip-good { background: var(--good-bg); color: var(--good-ink); }
.chip-bad { background: var(--bad-bg); color: var(--bad-ink); }
.chip-off { background: var(--off-bg); color: var(--off-ink); }
.chip-tint { background: var(--tint); color: var(--tint-ink); }

/* ---------- Boot ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-dot { width: 46px; height: 46px; border-radius: 14px; background: var(--primary); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .4; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }

/* ---------- App shell ---------- */
.shell { min-height: 100vh; display: flex; gap: 26px; padding: 24px; align-items: flex-start; }
.sidebar { width: 252px; flex: none; position: sticky; top: 24px; display: flex; flex-direction: column; gap: 20px; padding: 22px 16px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; text-decoration: none; color: var(--ink); }
.wordmark { font-family: 'Poppins', sans-serif; font-size: 21px; line-height: 1; }
.wordmark b { font-weight: 700; }
.wordmark span { font-weight: 500; color: var(--primary); }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px;
  color: var(--soft); text-decoration: none; font-size: 14px; font-weight: 500; border: 1px solid transparent;
}
.nav a:hover { background: var(--field); }
.nav a[aria-current="page"] { background: var(--field); box-shadow: var(--press); border-color: var(--line); color: var(--primary); font-weight: 700; }
.nav .badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.user-card { display: flex; align-items: center; gap: 12px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--tint); color: var(--tint-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: none; text-transform: uppercase; }
.avatar.sm { width: 34px; height: 34px; font-size: 12px; }
.avatar.lg { width: 52px; height: 52px; font-size: 16px; }
.avatar.solid { background: var(--primary); color: var(--on-primary); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 22px; padding-bottom: 40px; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding-top: 2px; }
.topbar .title-wrap { min-width: 0; }
.topbar .actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mobile-brand { display: none; }

.demo-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--tint); color: var(--tint-ink); font-size: 13px; }
.demo-banner button { margin-left: auto; }

.tabbar { display: none; }

@media (max-width: 860px) {
  .shell { padding: 14px 14px 96px; gap: 14px; flex-direction: column; align-items: stretch; }
  .main { width: 100%; }
  .sidebar { display: none; }
  .mobile-brand { display: flex; }
  .topbar .title-wrap h1 { font-size: 21px; }
  .card { padding: 18px; border-radius: 20px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--tabbar); border-top: 1px solid var(--line); box-shadow: 0 -6px 16px rgba(0,0,0,.05);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around;
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; min-height: 50px; }
  .tabbar a[aria-current="page"] { color: var(--primary); font-weight: 700; }
}

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 28px 16px; }
.login-grid { width: 100%; max-width: 1060px; display: flex; flex-wrap: wrap; gap: 28px; align-items: stretch; }
.login-brand { flex: 1 1 400px; display: flex; flex-direction: column; gap: 22px; padding: 40px; border-radius: 30px; }
.login-brand h1 { color: #fff; font-size: 36px; }
.login-brand .pill { padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.14); font-size: 13px; font-weight: 700; }
.login-form { flex: 1 1 360px; padding: 40px; border-radius: 30px; }
.demo-accounts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 560px) {
  .login-brand, .login-form { padding: 26px 22px; }
  .login-brand h1 { font-size: 27px; }
  .demo-accounts { grid-template-columns: 1fr; }
}

/* ---------- Lists & tables ---------- */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--field); border: 1px solid var(--line); box-shadow: var(--press); }
.list-item.link { text-decoration: none; color: inherit; }
.list-item.raised { background: var(--card); box-shadow: var(--raise-sm); }
.list-item.active { outline: 2px solid var(--primary); outline-offset: -2px; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); font-size: 14px; }

.table-wrap { overflow-x: auto; border-radius: 18px; background: var(--field); border: 1px solid var(--line); box-shadow: var(--press); padding: 6px; }
table.table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--muted); font-weight: 700; padding: 11px 12px; white-space: nowrap; }
.table td { padding: 11px 12px; border-top: 1px solid var(--rule); vertical-align: middle; }
.table td.actions { text-align: right; white-space: nowrap; }
.table .name { font-weight: 700; }
.only-cards { display: none; }
@media (max-width: 680px) {
  table.table.cards { min-width: 0; }
  .table.cards thead { display: none; }
  .table.cards tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding: 14px 10px; border-top: 1px solid var(--rule); }
  .table.cards tbody tr:first-child { border-top: 0; }
  .table.cards td { border: 0; padding: 0; }
  .table.cards td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
  .table.cards td.first, .table.cards td.actions, .table.cards td[colspan] { grid-column: 1 / -1; }
  .table.cards td.actions { display: flex; gap: 8px; text-align: left; }
  .table.cards td.actions .btn { flex: 1; }
  .table.cards .only-cards { display: inline-flex; }
  .table.cards .hide-cards { display: none; }
}

.kpi .num { font-family: 'Poppins', sans-serif; font-size: 30px; font-weight: 700; line-height: 1.1; }

/* ---------- Banners ---------- */
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px 20px; border-radius: 20px; border: 1px solid var(--line); }
.banner.warn { background: var(--warn-bg); color: var(--warn-ink); }
.banner .icon-box { width: 44px; height: 44px; border-radius: 14px; background: var(--warn-chip); display: flex; align-items: center; justify-content: center; flex: none; }

/* progress */
.bar { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }

/* ---------- Lock screen ---------- */
.lock-card { max-width: 720px; margin: 10px auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 40px 30px; }
.lock-icon { width: 88px; height: 88px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--field); box-shadow: var(--press); border: 1px solid var(--line); color: var(--bad-ink); }
[data-look="color"] .lock-icon { color: #8E2A2F; }

/* ---------- Comments ---------- */
.comment { display: flex; gap: 12px; padding: 14px; border-radius: 16px; background: var(--field); border: 1px solid var(--line); box-shadow: var(--press); }
.comment .meta { font-size: 12px; color: var(--muted); }
.comment p { font-size: 14px; margin-top: 4px; white-space: pre-wrap; word-break: break-word; }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 50; background: var(--overlay); display: flex; align-items: flex-start; justify-content: center; padding: 40px 14px; overflow-y: auto; }
.modal { width: 100%; max-width: 560px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 24px 60px rgba(0,0,0,.18); padding: 22px; display: flex; flex-direction: column; gap: 16px; }
[data-look="color"] .modal { background: #F6F1E8; }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.section-title { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
hr.rule { border: 0; border-top: 1px solid var(--rule); margin: 4px 0; width: 100%; }
@media (max-width: 560px) { .modal-back { padding: 0; align-items: stretch; } .modal { border-radius: 0; min-height: 100%; } }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); z-index: 60; opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.2); transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: #8E2A2F; color: #fff; }
@media (max-width: 860px) { .toast { bottom: 92px; } }

.copy-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; white-space: pre-wrap; }
.ring { position: relative; width: 120px; height: 120px; flex: none; }
.ring svg { position: absolute; inset: 0; }
.ring .val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .val b { font-family: 'Poppins', sans-serif; font-size: 26px; color: var(--primary); line-height: 1; }

/* ============================================================
   Phase 2 · practice, exam player, tests, reports
   ============================================================ */
.pill { display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.14); font-size: 13px; font-weight: 700; }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); box-shadow: var(--press); min-width: 110px; }
.stat b { font-family: 'Poppins', sans-serif; font-size: 20px; line-height: 1.1; color: var(--primary); font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.meter { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; display: block; }
.meter > span { display: block; height: 100%; width: 0; background: var(--primary); border-radius: inherit; transition: width .25s linear; }
.meter.thin { height: 5px; margin-top: 6px; }
.prewrap { white-space: pre-wrap; }
.tight-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.tight-list li { list-style: none; margin-left: -18px; display: flex; gap: 6px; align-items: flex-start; }
.warn-text { color: var(--bad-ink); font-weight: 700; }
[data-look="mono"] .warn-text { color: #000; text-decoration: underline; }

/* task cards */
.task-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.task-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--card); box-shadow: var(--raise-sm); border: 1px solid var(--line); text-decoration: none; color: inherit; min-width: 0; }
.task-card:hover { outline: 2px solid var(--primary); outline-offset: -2px; }
.task-code { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 34px; padding: 0 8px; border-radius: 10px; background: var(--primary); color: var(--on-primary); font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 13px; letter-spacing: .03em; }
.task-code.lg { min-width: 54px; height: 54px; border-radius: 16px; font-size: 16px; }
.task-code.sm { min-width: 40px; height: 28px; font-size: 11px; border-radius: 8px; }
.q-num { flex: none; width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--field); box-shadow: var(--press); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.test-card { justify-content: space-between; }

/* exam item */
.exam-card { gap: 16px; }
.exam-item { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.exam-instr { margin: 0; font-size: 14px; color: var(--soft); font-style: italic; }
.exam-text { padding: 16px 18px; border-radius: 16px; background: var(--chart-bg); border: 1px solid var(--rule); font-size: 16px; line-height: 1.75; max-width: 75ch; overflow-wrap: anywhere; }
.exam-text.passage { max-height: 360px; overflow: auto; font-size: 15px; }
.exam-q { margin: 0; font-size: 15px; }
.chart-box { border-radius: 16px; overflow: hidden; border: 1px solid var(--rule); background: var(--chart-bg); max-width: 760px; }
.chart-box svg { display: block; width: 100%; height: auto; }
.lecture-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--tint); color: var(--tint-ink); max-width: 520px; }
.audio-box, .rec-box { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 16px; background: var(--field); border: 1px solid var(--line); box-shadow: var(--press); max-width: 560px; }
.audio-box { flex-direction: row; align-items: center; gap: 12px; }
.audio-ico { color: var(--primary); flex: none; }
.rec-box .level { height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.rec-box .level > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .08s linear; }
textarea.notes { min-height: 70px; font-size: 14px; }
.editor { display: flex; flex-direction: column; gap: 8px; }
.editor-bar { gap: 8px; }
textarea.writing { min-height: 140px; font-size: 16px; line-height: 1.6; }
.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .exam-text.passage { max-height: none; } }

.opts { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; list-style: none; }
.opt { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--rule); cursor: pointer; font-size: 15px; line-height: 1.5; }
.opt input { margin-top: 4px; accent-color: var(--primary); width: 18px; height: 18px; flex: none; }
.opt:has(input:checked) { outline: 2px solid var(--primary); outline-offset: -2px; background: var(--tint); color: var(--tint-ink); }
.opt-letter { flex: none; width: 24px; height: 24px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--field); border: 1px solid var(--rule); }
.opts.review .opt { cursor: default; }
.opt.ok { outline: 2px solid var(--good); outline-offset: -2px; background: var(--good-bg); color: var(--good-ink); }
.opt.bad { outline: 2px dashed var(--bad-ink); outline-offset: -2px; background: var(--bad-bg); color: var(--bad-ink); }

.exam-text.fill { line-height: 2.3; }
.blank-select, .blank-input { font: inherit; font-size: 15px; padding: 3px 8px; margin: 0 3px; border-radius: 9px; border: 1.5px solid var(--primary); background: var(--card); color: var(--ink); min-height: 34px; vertical-align: baseline; max-width: 100%; }
.blank-input { width: auto; }
.slot { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; min-width: 110px; min-height: 34px; margin: 0 3px; padding: 2px 10px; border-radius: 10px; border: 1.5px dashed var(--primary); background: var(--card); color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
.slot:not(:empty) { border-style: solid; background: var(--tint); color: var(--tint-ink); font-weight: 700; }
.slot.over { outline: 3px solid var(--accent); }
.bank { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px; border-radius: 16px; background: var(--field); border: 1px solid var(--line); box-shadow: var(--press); }
.word { padding: 8px 14px; border-radius: 11px; border: 1px solid var(--rule); background: var(--card); box-shadow: var(--raise-sm); font: inherit; font-size: 15px; cursor: grab; color: var(--ink); }
.word.picked { outline: 3px solid var(--primary); }
.word.used { opacity: .35; }
.gap { display: inline-block; padding: 0 6px; border-radius: 7px; font-weight: 700; }
.gap.ok { background: var(--good-bg); color: var(--good-ink); }
.gap.bad { background: var(--bad-bg); color: var(--bad-ink); }

.exam-text.hiw { line-height: 2.1; }
.hiw-w { padding: 1px 2px; border-radius: 6px; cursor: pointer; }
.hiw-w:focus-visible { outline: 2px solid var(--primary); }
.locked .hiw-w { cursor: default; }
.hiw-w:hover { background: var(--track); }
.hiw-w[aria-pressed="true"] { background: var(--warn-chip); color: var(--warn-ink); }
[data-look="mono"] .hiw-w[aria-pressed="true"] { background: #111; color: #fff; }

.ro-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ro-item { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--rule); box-shadow: var(--raise-sm); font-size: 15px; line-height: 1.5; }
.ro-item.dragging { opacity: .6; outline: 2px dashed var(--primary); }
.ro-grip { cursor: grab; color: var(--muted); touch-action: none; padding: 6px 2px; }
.ro-letter { flex: none; width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: var(--on-primary); font-size: 12px; font-weight: 700; }
.ro-btns { display: flex; flex-direction: column; gap: 4px; flex: none; }
.ro-review { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; }
.ro-review li.ok::marker { color: var(--good); font-weight: 700; }

/* results */
.result { gap: 14px; }
.score-chip { font-size: 15px; padding: 6px 14px; }
.traits { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.traits li { padding: 10px 12px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); }
.w-ok { color: var(--good-ink); background: var(--good-bg); border-radius: 5px; padding: 0 3px; }
.w-bad { color: var(--bad-ink); background: var(--bad-bg); border-radius: 5px; padding: 0 3px; text-decoration: line-through; text-decoration-thickness: 1px; }
.w-miss { color: var(--warn-ink); background: var(--warn-bg); border-radius: 5px; padding: 0 3px; text-decoration: underline wavy; }
.w-extra { color: var(--muted); font-style: italic; }
[data-look="mono"] .w-bad { background: #111; color: #fff; }
.transcript p { margin: 0 0 8px; }
details > summary { cursor: pointer; padding: 6px 0; }
details[open] > summary { margin-bottom: 6px; }
.ans-toggle { width: 100%; background: transparent; border: 0; padding: 0; cursor: pointer; text-align: left; color: inherit; font: inherit; gap: 10px; }
.ans-body { padding-top: 12px; border-top: 1px solid var(--rule); margin-top: 10px; }

/* test runner */
body.exam-mode .sidebar, body.exam-mode .tabbar, body.exam-mode .topbar, body.exam-mode .demo-banner { display: none !important; }
body.exam-mode .shell { padding-bottom: 24px; }
.exam-shell { display: flex; flex-direction: column; gap: 14px; max-width: 1100px; width: 100%; margin: 0 auto; }
.exam-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
.exam-clock { font-family: 'Poppins', sans-serif; font-weight: 700; font-variant-numeric: tabular-nums; padding: 6px 12px; border-radius: 10px; background: var(--field); box-shadow: var(--press); }
.exam-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(transparent, var(--bg) 35%); }
.exam-foot .btn-primary { min-width: 150px; min-height: 50px; }

/* reports */
.big-score .ring { width: 140px; height: 140px; }
.big-score .ring .val b { font-size: 34px; }
.skill-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 40px; align-items: center; gap: 12px; }
.skill-bar { position: relative; height: 14px; border-radius: 999px; background: var(--track); overflow: visible; }
.skill-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.skill-bar > i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--muted); opacity: .45; }
.skill-num { font-family: 'Poppins', sans-serif; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .exam-text { font-size: 15px; padding: 14px; }
  .slot { min-width: 90px; }
  .skill-row { grid-template-columns: 76px minmax(0, 1fr) 34px; gap: 8px; }
  .exam-foot .btn-primary { min-width: 0; flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .meter > span, .rec-box .level > span { transition: none; } }
