/* The "Bold" look (docs/wireframes/admin-visual-directions.html, direction C), light and dark.
   Loaded after app.css on pages whose <html> has the class "ui-bold". Colours live in variables, so dark mode only swaps
   the variables (html[data-mode="dark"], set by js/mode.js). Printouts always use the light set. */

/* ---------- Fonts: Lexend and Source Serif 4 (SIL Open Font License), self-hosted ---------- */
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 300; font-display: swap; src: url("../fonts/lexend-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/lexend-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/lexend-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/lexend-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/lexend-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/source-serif-4-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); }

/* ---------- Colours ---------- */
html.ui-bold {
    color-scheme: light;
    --font: "Lexend", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
    --bg: #eef2f9; --surface: #fff; --surface2: #f5f8fd; --text: #0b1f4b; --muted: #5b6b8c; --line: #dbe3f2; --line2: #eef2f9;
    --field: #fff; --field-line: #c9d4e8;
    --accent: #0a6ff8; --accent-hover: #0857c4; --accent-ink: #fff; --accent-soft: #e3edff; --accent-text: #0748ad;
    --navy: #0b1f4b; --navy2: #16306b; --side-text: #c6d3f2; --side-muted: #7d91c2; --bar: #0b1f4b; --bar-line: #0b1f4b;
    --hl: #ffde59; --hl-hover: #f5d044; --hl-ink: #0b1f4b;
    --ok: #15803d; --ok-bg: #e9f7ef; --ok-line: #bde5c9;
    --warn: #8a5300; --warn-bg: #fff4dc; --warn-line: #f1d58a;
    --bad: #c2163b; --bad-bg: #ffecef; --bad-line: #ffc2cf; --bad-solid: #e11d48;
    --info: #0748ad; --info-bg: #e3edff;
    --ai: #5b21b6; --ai-bg: #f1ebff;
    --shadow: 0 2px 10px rgba(11, 31, 75, .07); --shadow-pop: 0 14px 34px rgba(11, 31, 75, .16);
    --s-listening: #0ea5e9; --s-reading: #16a34a; --s-uoe: #0d9488; --s-writing: #7c3aed; --s-speaking: #ea580c;
    /* The names app.css uses, mapped onto the theme. */
    --blue: var(--accent); --blue-dark: var(--accent-text); --ink: var(--text); --soft: var(--surface2); --soft-blue: var(--accent-soft);
    --paper: var(--field); --band: var(--surface); --red: var(--bad-solid); --danger: var(--bad);
}
@media screen {
    html.ui-bold[data-mode="dark"] {
        color-scheme: dark;
        --bg: #0a1226; --surface: #111b34; --surface2: #0e1730; --text: #e7ecf8; --muted: #94a3c4; --line: #243256; --line2: #18233f;
        --field: #0c1530; --field-line: #2e3f6b;
        --accent: #4f9dff; --accent-hover: #79b4ff; --accent-ink: #061430; --accent-soft: #16295a; --accent-text: #9cc6ff;
        --navy: #070e1f; --navy2: #16213d; --side-text: #b9c6e6; --side-muted: #6d7fa8; --bar: #050a18; --bar-line: #1d2a4b;
        --ok: #4ade80; --ok-bg: #0f2e1f; --ok-line: #1d5236;
        --warn: #fbbf24; --warn-bg: #33270b; --warn-line: #5c4710;
        --bad: #fb7185; --bad-bg: #3b1420; --bad-line: #6b2537; --bad-solid: #e11d48;
        --info: #9cc6ff; --info-bg: #16295a;
        --ai: #c4b5fd; --ai-bg: #2a1a52;
        --shadow: 0 2px 14px rgba(0, 0, 0, .35); --shadow-pop: 0 18px 40px rgba(0, 0, 0, .5);
        --s-listening: #38bdf8; --s-reading: #4ade80; --s-uoe: #2dd4bf; --s-writing: #a78bfa; --s-speaking: #fb923c;
    }
}

/* ---------- Base ---------- */
.ui-bold body { font-family: var(--font); color: var(--text); background: var(--bg); }
.ui-bold h1, .ui-bold h2, .ui-bold h3 { font-weight: 600; letter-spacing: -.005em; }
.ui-bold a { color: var(--accent-text); }
.ui-bold .muted, .ui-bold .hint, .ui-bold .empty, .ui-bold .empty-note { color: var(--muted); }
.ui-bold .btn:focus-visible, .ui-bold input:focus-visible, .ui-bold select:focus-visible, .ui-bold textarea:focus-visible,
.ui-bold a:focus-visible, .ui-bold button:focus-visible, .ui-bold summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.ui-bold .btn {
    border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text);
    font-weight: 500; text-transform: none; letter-spacing: 0; padding: .55rem 1.05rem;
}
.ui-bold .btn:hover { border-color: var(--accent); color: var(--accent-text); }
.ui-bold .btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ui-bold .btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.ui-bold .btn-accent { background: var(--hl); border-color: var(--hl); color: var(--hl-ink); font-weight: 600; }
.ui-bold .btn-accent:hover { background: var(--hl-hover); border-color: var(--hl-hover); color: var(--hl-ink); }
.ui-bold .btn-ghost { background: transparent; border-color: transparent; color: var(--accent-text); }
.ui-bold .btn-ghost:hover { background: var(--accent-soft); border-color: transparent; }
.ui-bold .btn-danger { background: transparent; border-color: var(--bad-line); color: var(--bad); }
.ui-bold .btn-danger:hover { background: var(--bad-solid); border-color: var(--bad-solid); color: #fff; }
.ui-bold .btn-small { padding: .3rem .8rem; font-size: .86rem; }

/* ---------- Forms ---------- */
.ui-bold label { font-weight: 500; }
.ui-bold label.check { font-weight: 400; }
.ui-bold input[type="text"], .ui-bold input[type="password"], .ui-bold input[type="email"], .ui-bold input[type="tel"],
.ui-bold input[type="url"], .ui-bold input[type="search"], .ui-bold input[type="number"], .ui-bold input[type="date"],
.ui-bold input[type="datetime-local"], .ui-bold input[type="time"], .ui-bold select, .ui-bold textarea {
    border: 1px solid var(--field-line); border-radius: 10px; background: var(--field); color: var(--text);
}
.ui-bold ::placeholder { color: var(--muted); font-style: normal; opacity: .8; }
.ui-bold input[type="checkbox"], .ui-bold input[type="radio"] { accent-color: var(--accent); }
.ui-bold input[type="file"] { color: var(--muted); }
.ui-bold .field-error { color: var(--bad); }
.ui-bold .toolbar input[type="search"], .ui-bold .toolbar select { border-radius: 10px; }

/* ---------- Alerts, badges, state chips ---------- */
.ui-bold .alert { border-radius: 12px; font-weight: 500; }
.ui-bold .alert-error { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.ui-bold .alert-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.ui-bold .alert-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.ui-bold .badge, .ui-bold .st { font-weight: 600; }
.ui-bold .badge { background: var(--accent-soft); color: var(--accent-text); }
.ui-bold .badge-ok, .ui-bold .badge-open, .ui-bold .st-ok { background: var(--ok-bg); color: var(--ok); }
.ui-bold .badge-off, .ui-bold .st { background: var(--line2); color: var(--muted); }
.ui-bold .badge-upcoming, .ui-bold .st-run, .ui-bold .st-info { background: var(--info-bg); color: var(--info); }
.ui-bold .badge-closed, .ui-bold .st-bad { background: var(--bad-bg); color: var(--bad); }
.ui-bold .st-warn { background: var(--warn-bg); color: var(--warn); }
.ui-bold .st-ai { background: var(--ai-bg); color: var(--ai); }
.ui-bold .code-sample { background: var(--surface2); border-color: var(--line); }

/* ---------- Cards ---------- */
.ui-bold .card { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.ui-bold .card-head {
    background: transparent; color: var(--text); text-align: left; text-transform: none; letter-spacing: 0;
    font-weight: 600; font-size: 1.05rem; padding: .95rem 1.25rem; border-bottom: 1px solid var(--line2);
}
.ui-bold .stat .card-body { background: var(--surface); text-align: left; }
.ui-bold .stat-number { color: var(--text); font-weight: 600; font-size: 2.6rem; }

/* ---------- Shell: navy menu, white top bar ---------- */
.ui-bold .app { grid-template-columns: clamp(240px, 15vw, 288px) 1fr; }
.ui-bold .side { background: var(--navy); border-right: 0; color: var(--side-text); }
.ui-bold .side-brand { background: var(--navy); height: 76px; padding: 0 1.2rem; }
.ui-bold .side-brand img { height: 44px; }
.ui-bold .side-profile { background: transparent; padding: .7rem 1.2rem .9rem; border-bottom: 1px solid var(--navy2); }
.ui-bold .avatar { width: 40px; height: 40px; }
.ui-bold .avatar svg circle:first-child { fill: var(--hl); }
.ui-bold .avatar svg circle + circle, .ui-bold .avatar svg path { fill: var(--hl-ink); }
.ui-bold .side-name { color: #fff; font-weight: 500; }
.ui-bold .side-sub { color: var(--side-muted); font-size: .8rem; }
.ui-bold .side-list { gap: 2px; padding: .4rem .8rem 1rem; }
.ui-bold .side-group { margin: 1.1rem .75rem .35rem; font-size: .7rem; font-weight: 600; letter-spacing: .09em; color: var(--side-muted); }
.ui-bold .side-group:first-child { margin-top: .6rem; }
.ui-bold .pill {
    gap: .75rem; min-height: 0; padding: .58rem .75rem; border: 0; border-radius: 10px; background: transparent;
    color: var(--side-text); font-size: .95rem;
}
.ui-bold .pill:hover { background: var(--navy2); color: #fff; }
.ui-bold .pill.active { background: var(--hl); color: var(--hl-ink); font-weight: 600; box-shadow: none; }
.ui-bold .pill-dot { width: 8px; height: 8px; background: var(--side-muted); }
.ui-bold .pill.active .pill-dot { background: var(--hl-ink); }
.ui-bold .side-count { background: var(--navy2); color: var(--side-text); font-weight: 600; }
.ui-bold .side-count-bad { background: #ef4444; color: #fff; }
.ui-bold .side-count-warn { background: var(--hl); color: var(--hl-ink); }
.ui-bold .pill.active .side-count { background: var(--hl-ink); color: #fff; }
.ui-bold .side-foot { background: var(--navy); border-top: 1px solid var(--navy2); padding: .9rem 1.2rem; }
.ui-bold .btn-logout {
    max-width: none; border: 1px solid var(--navy2); border-radius: 10px; background: transparent; color: var(--side-text);
    font-size: .95rem; font-weight: 500; text-transform: none; padding: .5rem 1rem;
}
.ui-bold .btn-logout:hover { background: var(--navy2); color: #fff; }

.ui-bold .app-main { background: var(--bg); }
.ui-bold .band {
    background: var(--surface); text-align: left; padding: 1rem 2rem 1.15rem; border-bottom: 1px solid var(--line);
}
.ui-bold .band h1 { font-size: clamp(1.55rem, 1.9vw, 2.1rem); font-weight: 600; text-transform: none; letter-spacing: -.01em; line-height: 1.15; }
.ui-bold .band p { margin-top: .25rem; font-size: 1rem; font-weight: 400; text-transform: none; color: var(--muted); }
.ui-bold .crumbs { color: var(--muted); font-weight: 400; margin-bottom: .3rem; }
.ui-bold .crumbs a { color: var(--accent-text); }
.ui-bold .band-tools { align-items: center; gap: .6rem; }
@media (min-width: 1500px) { .ui-bold .band-tools { top: 50%; right: 2rem; transform: translateY(-50%); } }
.ui-bold .app-content { padding: 1.75rem 2rem 2.5rem; }

/* Light / dark switch (js/mode.js) */
.mode-btn { display: inline-flex; flex: none; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; }
.mode-btn span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--muted); }
.mode-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
html:not([data-mode="dark"]) .mode-btn .mode-sun, html[data-mode="dark"] .mode-btn .mode-moon { background: var(--accent-soft); color: var(--accent-text); }

/* Search box */
.ui-bold .gsearch input { background: var(--bg); border-color: var(--line); }
.ui-bold .gsearch-kbd { background: var(--surface); border-color: var(--line); color: var(--muted); }
.ui-bold .gsearch-list { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-pop); }
.ui-bold .gsearch-list a { color: var(--text); }
.ui-bold .gsearch-list a.is-on, .ui-bold .gsearch-list a:hover { background: var(--accent-soft); }

/* ---------- Tables ---------- */
.ui-bold .table { background: var(--surface); }
.ui-bold .table th {
    background: var(--surface2); color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .07em;
    border-bottom: 1px solid var(--line);
}
.ui-bold .table td { border-bottom-color: var(--line2); }
.ui-bold .table tbody tr:hover td { background: var(--surface2); }
.ui-bold .table-wrap:not(.card .table-wrap) { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.ui-bold .grid-scroll { border-color: var(--line); }
.ui-bold tr.is-selected td { background: var(--accent-soft); }
.ui-bold .row-locked td, .ui-bold tr.row-suspect td { background: var(--bad-bg); }
.ui-bold .row-warn td, .ui-bold tr.row-near td { background: var(--warn-bg); }
.ui-bold .strike-dots, .ui-bold .seen-old { color: var(--bad); }

/* ---------- Banners, codes, filters, dots ---------- */
.ui-bold .pin-banner, .ui-bold .code-box { background: var(--hl); color: var(--hl-ink); }
.ui-bold .pin-banner .hint { color: #4a4a2a; }
.ui-bold .filter { background: var(--surface); border-color: var(--line); color: var(--text); font-weight: 500; border-radius: 10px; }
.ui-bold .filter.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ui-bold .filter-bad b { color: var(--bad); }
.ui-bold .filter-info b { color: var(--info); }
.ui-bold .filter-ok b { color: var(--ok); }
.ui-bold .filter-warn b { color: var(--warn); }
.ui-bold .filter.is-on b { color: var(--accent-ink); }
.ui-bold .dot { background: var(--line); }
.ui-bold .dot-on { background: #ef4444; }
.ui-bold .dot-ok { background: var(--ok); }
.ui-bold .meter, .ui-bold .timebar-track { background: var(--line2); }
.ui-bold .code-inline { color: var(--text); }
.ui-bold[data-mode="dark"] .glow { animation-name: glow-dark; }
@keyframes glow-dark { from { background: #4a3d0a; } }

/* ---------- Dashboard ---------- */
.ui-bold .dash-card { padding: 1.1rem 1.3rem; }
.ui-bold .dash-row { border-top-color: var(--line2); }
.ui-bold .dash-row-bad { background: var(--bad-bg); margin: 0 -1.3rem; padding: .6rem 1.3rem; }
.ui-bold .dash-details summary { color: var(--accent-text); }
.ui-bold .dash-stats strong { font-weight: 600; }
.ui-bold .live { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.ui-bold .live-bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- Sitting screen ---------- */
.ui-bold .needs { border-color: #ef4444; }
.ui-bold .needs-head { background: var(--bad-bg); color: var(--bad); }
.ui-bold .sitting-code-label { font-weight: 600; }
.ui-bold .projector { background: var(--navy); }
.ui-bold .projector-code { color: var(--hl); }
.ui-bold .timebar-fill { background: var(--accent); }

/* ---------- Drawer, tabs, segments, dialog, menus, toasts, bars ---------- */
.ui-bold .drawer { background: var(--surface); border-left-color: var(--line); box-shadow: -24px 0 50px rgba(0, 0, 0, .18); }
.ui-bold .dtabs { border-bottom-color: var(--line); }
.ui-bold .dtab { color: var(--muted); font-weight: 600; }
.ui-bold .dtab.is-on { color: var(--accent-text); border-color: var(--accent); }
.ui-bold .seg { border-color: var(--field-line); }
.ui-bold .seg-item { background: var(--surface); color: var(--text); border-right-color: var(--line2); font-weight: 600; }
.ui-bold .seg-item.is-on { background: var(--accent); color: var(--accent-ink); }
.ui-bold .seg-danger { color: var(--bad); }
.ui-bold .seg-danger.is-on { background: var(--bad-solid); color: #fff; }
.ui-bold .tab { background: var(--surface); border-color: var(--line); font-weight: 500; }
.ui-bold .tab.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ui-bold dialog.confirm { background: var(--surface); color: var(--text); }
.ui-bold dialog.confirm::backdrop { background: rgba(5, 10, 24, .55); }
.ui-bold .confirm-text { font-weight: 500; }
.ui-bold .menu-list { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-pop); }
.ui-bold .menu-list > a, .ui-bold .menu-list > form > button { color: var(--text); font-weight: 500; }
.ui-bold .menu-list > a:hover, .ui-bold .menu-list > form > button:hover { background: var(--surface2); }
.ui-bold .menu-list .void-form { border-top-color: var(--line); }
.ui-bold .toast { background: var(--bar); border: 1px solid var(--bar-line); font-weight: 500; }
.ui-bold .publish-bar, .ui-bold .savebar-sticky, .ui-bold .bulk-bar { background: var(--bar); border: 1px solid var(--bar-line); }
.ui-bold .sticky-save { background: var(--surface); border: 1px solid var(--line); }
.ui-bold .mark-reason { background: var(--warn-bg); }

/* ---------- Set builder ---------- */
.ui-bold .builder-box { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.ui-bold .set-tabs { background: var(--surface2); border-bottom: 1px solid var(--line); }
.ui-bold .set-tab { background: transparent; color: var(--muted); font-weight: 600; text-transform: none; letter-spacing: 0; border-radius: 10px; }
.ui-bold .set-tab:hover { background: var(--line2); color: var(--text); }
.ui-bold .set-tab.active { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.ui-bold .panel-title { color: var(--text); font-weight: 600; }
.ui-bold .part-block { background: var(--surface); border-color: var(--line); }
.ui-bold .part-head { background: var(--surface2); border-bottom-color: var(--line); }
.ui-bold .native-box { background: var(--accent-soft); border-color: var(--line); }
.ui-bold .json-import { background: var(--surface); border-color: var(--field-line); }
.ui-bold .json-import > summary, .ui-bold .hint-more summary { color: var(--accent-text); font-weight: 500; }
.ui-bold .doc-slot { background: var(--surface2); border-color: var(--field-line); }
.ui-bold .q-row, .ui-bold .audio-box { background: var(--surface2); border-color: var(--line); }
.ui-bold .part-range { color: var(--accent-text); font-weight: 600; }
.ui-bold .add-mode + .add-mode { border-left-color: var(--line); }
.ui-bold .mode-title { font-weight: 600; }
.ui-bold .builder-outline { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.ui-bold .ol-link { color: var(--text); }
.ui-bold .ol-link:hover, .ui-bold .ol-link:focus-visible { background: var(--accent-soft); }
.ui-bold .add-choice { background: var(--surface); border-bottom-color: var(--line); }
.ui-bold .readiness-bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.ui-bold .readiness-ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.ui-bold .checklist { border-color: var(--line); }
.ui-bold .brand-slot { border-top-color: var(--line); }
.ui-bold .brand-preview { border-color: var(--line); }
.ui-bold .brand-preview-dark { background: var(--navy); }
.ui-bold .template-notes { background: var(--surface); border-color: var(--line); border-left-color: var(--hl); }

/* ---------- Grading ---------- */
.ui-bold .side-card { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.ui-bold .side-title, .ui-bold .side-title label { font-weight: 600; }
.ui-bold .side-push { border-top-color: var(--line); }
.ui-bold .grade-score-box { background: var(--accent-soft); }
.ui-bold .grade-score-label { color: var(--accent-text); font-weight: 600; }
.ui-bold .student-row:hover { background: var(--surface2); }
.ui-bold .student-row.active { background: var(--accent); color: var(--accent-ink); }
.ui-bold .student-row.active .badge { background: var(--surface); }
.ui-bold .student-name { font-weight: 500; }
.ui-bold .paper { background: var(--surface); border-color: var(--line); }
.ui-bold .paper summary { color: var(--accent-text); font-weight: 600; }
.ui-bold .paper-pages img, .ui-bold .slot-preview, .ui-bold .native-read-img { background: #fff; }
.ui-bold .grade-part th { background: var(--accent-soft); color: var(--text); }
.ui-bold .grade-table tbody tr:nth-child(even):not(.grade-part) { background: var(--surface2); }
.ui-bold .grade-answer { font-weight: 600; }
.ui-bold .grade-answer.wrong, .ui-bold .grade-key.wrong, .ui-bold .review-wrong .review-answer, .ui-bold .review-wrong .review-key { color: var(--bad); }
.ui-bold .review-partial .review-answer { color: var(--warn); }
.ui-bold .review-correct .review-answer { color: var(--ok); }
.ui-bold .chip { background: var(--surface); border-color: var(--line); color: var(--muted); font-weight: 600; }
.ui-bold .chip-key { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.ui-bold .grade-key.wrong .chip-key { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.ui-bold .chip-chosen { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.ui-bold .essay {
    background: var(--surface2); border-color: var(--line); color: var(--text);
    font-family: var(--serif); font-size: 1.1rem; line-height: 1.75;
}
.ui-bold .rubric-table tfoot th { background: var(--surface2); }
.ui-bold .mark-input.invalid { border-color: var(--bad); background: var(--bad-bg); }
.ui-bold .feedback-list li, .ui-bold .push-row { border-bottom-color: var(--line); }
.ui-bold .push-name { font-weight: 600; }
.ui-bold .clip, .ui-bold .mic-check, .ui-bold .audio-check { background: var(--surface2); border-color: var(--line); }
.ui-bold .clip-text { font-weight: 600; }
.ui-bold .clip-missing, .ui-bold .void-box summary { color: var(--bad); }
.ui-bold .result-scaled { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.ui-bold .review-q { border-top-color: var(--line); }
.ui-bold .review-a { border-color: var(--line); }
.ui-bold .grade-cell:hover .st { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.ui-bold .grade-subtitle { font-weight: 600; }
.ui-bold .meta dt, .ui-bold .exam-facts dt { font-weight: 600; }

/* ---------- Certificate settings: the preview is a printout, so it stays light ---------- */
.ui-bold .cert-preview { border-color: var(--accent); }
.ui-bold .cert-preview.has-bg, .ui-bold .cert-bg-thumb { border-color: var(--line); }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
    .ui-bold .app { grid-template-columns: 1fr; }
    .ui-bold .band { padding: .9rem 1rem; }
    .ui-bold .app-content { padding: 1rem; }
}

/* =====================================================================================================
   Phase 2: student pages (docs/wireframes/student-bold.html)
   ===================================================================================================== */

/* Skill colours: a section, a bar or a banner carries skill-(kind) and uses var(--c). */
.skill-listening { --c: var(--s-listening); }
.skill-reading { --c: var(--s-reading); }
.skill-use_of_english { --c: var(--s-uoe); }
.skill-writing { --c: var(--s-writing); }
.skill-speaking { --c: var(--s-speaking); }

/* Student menu */
.ui-bold .state-dot { width: 9px; height: 9px; margin-left: 0; background: var(--side-muted); }
.ui-bold .state-open { background: #4ade80; }
.ui-bold .pill.active .state-dot { background: var(--hl-ink); }
.ui-bold .side-tag { background: var(--navy2); color: var(--side-text); font-weight: 600; }
.ui-bold .pill.active .side-tag { background: var(--hl-ink); color: #fff; }
.ui-bold .side-empty { padding: .2rem .75rem .4rem; color: var(--side-muted); font-size: .85rem; }

/* My exams: the open exam in a navy card */
.open-card {
    display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem 2rem; padding: 1.8rem 2rem; border-radius: 16px;
    background: linear-gradient(135deg, #0b1f4b, #123a8f); color: #fff; box-shadow: var(--shadow);
}
.ui-bold[data-mode="dark"] .open-card { background: linear-gradient(135deg, #123a8f, #0b1f4b); border: 1px solid #1d3a85; }
.open-main { flex: 1 1 32rem; min-width: 0; }
.open-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0; color: #c6d3f2; font-size: .92rem; }
.ui-bold .open-card .st-ok { background: #14532d; color: #86efac; }
.open-title { margin: .55rem 0 .9rem; color: #fff; font-size: clamp(1.4rem, 1.8vw, 1.9rem); font-weight: 600; line-height: 1.2; }
.open-path { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.open-step { padding: .28rem .8rem; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #c6d3f2; font-size: .88rem; font-weight: 500; }
.open-step.is-done { background: #0f3b2a; color: #86efac; }
.open-step.is-next { background: #ffde59; color: #0b1f4b; font-weight: 600; }
.open-go { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
.ui-bold .open-btn { padding: .85rem 1.6rem; font-size: 1.08rem; }
.open-hint { color: #c6d3f2; font-size: .85rem; text-align: right; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1.3rem; margin-top: 1.4rem; align-items: start; }
.home-wide { grid-column: 1 / -1; }
.home-rows { padding: .2rem 1.25rem .6rem; }
.home-rows .empty-note { padding: .8rem 0; }
.ui-bold .xrow { display: flex; align-items: center; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--line2); color: var(--text); text-decoration: none; }
.xrow:last-child { border-bottom: 0; }
.xrow:hover .xrow-text strong { color: var(--accent-text); }
.xrow-text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.xrow-text strong { font-weight: 500; }
.xrow-text .muted { font-size: .85rem; }
.date-tile {
    display: flex; flex: none; flex-direction: column; align-items: center; justify-content: center; width: 52px; height: 52px;
    border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); line-height: 1;
}
.date-tile small { margin-bottom: .2rem; font-size: .66rem; font-weight: 600; text-transform: uppercase; }
.date-tile b { font-size: 1.3rem; font-weight: 700; }

/* Exam overview: sections in order, results on the right */
.exam-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.ui-bold .checks-note { background: var(--accent-soft); color: var(--text); }
.ui-bold .checks-note span::before { color: var(--accent-text); }
.exam-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(19rem, 25rem); gap: 1.5rem; align-items: start; }
.srows { display: flex; flex-direction: column; gap: .8rem; min-width: 0; }
.srow {
    display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.1rem; padding: 1.1rem 1.3rem; border: 1px solid var(--line); border-left: 6px solid var(--c, var(--accent));
    border-radius: 14px; background: var(--surface); box-shadow: var(--shadow);
}
.srow.is-next { box-shadow: 0 0 0 3px var(--hl), var(--shadow); }
.srow-mark { display: grid; flex: none; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--line2); color: var(--text); font-size: 1.05rem; font-weight: 600; }
.srow.is-next .srow-mark { background: var(--hl); color: var(--hl-ink); }
.srow-graded .srow-mark, .srow-grading .srow-mark { background: var(--ok); color: var(--surface); }
.srow-locked .srow-mark { background: var(--bad-solid); color: #fff; }
.srow-text { flex: 1 1 14rem; min-width: 0; }
.srow-title { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; font-size: 1.15rem; font-weight: 600; }
.srow-facts { margin: .15rem 0 0; color: var(--muted); font-size: .9rem; }
.srow-note { margin: .35rem 0 0; font-size: .92rem; }
.srow-bad { color: var(--bad); }
.srow-result { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .35rem; }
.srow-go { display: flex; flex: 0 1 auto; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .5rem; margin-left: auto; }
.srow-go form { margin: 0; }
.srow-state { color: var(--muted); font-weight: 500; }
.exam-side { display: flex; flex-direction: column; gap: 1.2rem; min-width: 0; }
.result-card .card-body { display: flex; flex-direction: column; align-items: center; gap: .8rem; text-align: center; }
.result-card .hint { margin: 0; }
@media (max-width: 1100px) { .exam-layout { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .srow { flex-wrap: wrap; } .srow-go { width: 100%; justify-content: flex-start; } }

/* Score ring (circle bar): exam overview, report, review */
.ui-bold .ring-score { position: relative; flex: none; width: clamp(160px, 13vw, 220px); aspect-ratio: 1; }
.ui-bold .ring-score svg { display: block; width: 100%; height: 100%; }
.ui-bold .ring-bg, .ui-bold .ring-fg { fill: none; stroke-width: 10; }
.ui-bold .ring-bg { stroke: var(--line2); }
.ui-bold .ring-fg { stroke: var(--accent); stroke-linecap: round; }
.ui-bold .ring-score-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ui-bold .ring-score-text strong { color: var(--text); font-size: clamp(2rem, 3vw, 3.2rem); font-weight: 600; }
.ui-bold .ring-score-text span { color: var(--muted); font-size: .9rem; font-weight: 500; text-transform: none; }
.ui-bold .ring-score-text em { color: var(--muted); font-size: .9rem; }
.ui-bold .comment-text { font-family: var(--serif); font-size: 1.08rem; line-height: 1.65; }
.ui-bold .feedback-part { font-weight: 600; }

/* Report */
.ui-bold .rp-hero-text h2 { font-weight: 600; }
.ui-bold .rp-btn { border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 500; text-transform: none; }
.ui-bold .rp-btn:hover { background: var(--accent-hover); }
.ui-bold .rp-skills { padding: 0; background: transparent; }
.ui-bold .rp-skill { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.ui-bold .rp-skill-name { display: inline-flex; align-items: center; gap: .5rem; font-weight: 500; }
.ui-bold .rp-skill-name::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--accent)); }
.ui-bold .rp-skill-score strong { font-weight: 600; }
.ui-bold .rp-bar-bg { fill: var(--line2); }
.ui-bold .rp-bar-fill { fill: var(--c, var(--accent)); }
.ui-bold .rp-feedback h2 { font-size: 1.4rem; font-weight: 600; text-transform: none; }
.ui-bold .rp-tab { border-radius: 10px 10px 0 0; background: var(--surface2); color: var(--muted); font-weight: 500; text-transform: none; }
.ui-bold .rp-tab.on { background: var(--accent); color: var(--accent-ink); }
.ui-bold .rp-panel { border: 1px solid var(--line); border-radius: 0 14px 14px 14px; background: var(--surface); }

/* Review of answers */
.ui-bold .rv-body { background: var(--bg); }
.ui-bold .rv-head { border-radius: 10px; background: var(--navy); color: #fff; font-size: .95rem; font-weight: 500; text-transform: none; }
.ui-bold .rv-title { font-weight: 600; }
.ui-bold .rv-part { color: var(--muted); font-weight: 600; text-transform: none; }
.ui-bold .rv-cell, .ui-bold .rv-comment, .ui-bold .rv-card { border-color: var(--line); background: var(--surface); }
.ui-bold .rv-num { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.ui-bold .review-wrong .rv-num:not(.rv-num-key) { background: var(--bad-solid); color: #fff; }
.ui-bold .rv-val, .ui-bold .rv-score { font-weight: 600; }
.ui-bold .rv-chip { background: var(--accent-soft); color: var(--accent-text); }
.ui-bold .rv-box { border-color: var(--line); background: var(--surface); }
.ui-bold .rv-box.on { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.ui-bold .rv-clip { border-bottom-color: var(--line); }
.ui-bold .rv-player { background: var(--accent-soft); }
.ui-bold .rv-paper { background: var(--bg); }
.ui-bold .rv-side { background: var(--navy); border-left: 0; }
.ui-bold .rv-side-top { background: var(--navy); border-bottom: 1px solid var(--navy2); }
.ui-bold .rv-tab { border-top-color: var(--navy2); background: transparent; color: var(--side-text); font-size: 1.05rem; font-weight: 500; text-transform: none; }
.ui-bold a.rv-tab:hover { background: var(--navy2); color: #fff; }
.ui-bold .rv-tab.on { background: var(--hl); color: var(--hl-ink); }
.ui-bold .rv-rings { background: var(--navy); }
.ui-bold .rv-rings .ring-bg { stroke: var(--navy2); }
.ui-bold .rv-rings .ring-score-text strong { color: #fff; }
.ui-bold .rv-rings .ring-score-text span, .ui-bold .rv-rings .ring-score-text em, .ui-bold .rv-ring-name { color: var(--side-text); text-transform: none; }
.ui-bold .rv-paper-btn { background: var(--hl); color: var(--hl-ink); font-weight: 600; text-transform: none; }
.ui-bold .rv-return { background: var(--accent); color: var(--accent-ink); font-size: 1.05rem; font-weight: 600; text-transform: none; }
.ui-bold .rv-return:hover { background: var(--accent-hover); }

/* Before you start (start page; the loading screen of the test is phase 3) */
.ui-bold .start-body, .ui-bold .gate { background: var(--bg); color: var(--text); }
.ui-bold .gate-banner { position: relative; padding: 1.5rem 2rem; border-radius: 16px; border-bottom: 6px solid var(--c, var(--accent)); background: var(--navy); color: #fff; }
.ui-bold .gate-banner h1 { font-weight: 600; }
.ui-bold .gate-banner .mode-btn { float: right; margin-left: 1rem; }
.ui-bold .gate-test { color: var(--side-text); }
.ui-bold .gate-card { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.ui-bold .gate-card h2 { font-size: 1.4rem; font-weight: 600; }
.ui-bold .gate-list li::before { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.ui-bold .gate-list li:nth-child(2)::before { background: var(--bad-bg); color: var(--bad); }
.ui-bold .start-checks .audio-check, .ui-bold .start-checks .mic-check { background: var(--surface2); }
.ui-bold .gate-btn { border-radius: 12px; font-size: 1.1rem; font-weight: 600; }
.ui-bold .gate-btn-primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.ui-bold .gate-btn-primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.ui-bold .gate-btn:disabled, .ui-bold .gate-btn-primary:disabled { border-color: var(--line); background: var(--line2); color: var(--muted); }
.ui-bold .gate-btn-ghost { border-color: var(--line); background: transparent; color: var(--accent-text); }
.ui-bold .pill-btn { border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 500; }
.ui-bold .pill-btn:hover { background: var(--accent-hover); }
.ui-bold .pill-btn.is-on { background: var(--ok); color: var(--surface); }
.ui-bold .steps-left { color: var(--warn); font-weight: 600; }
.ui-bold .steps-left.is-ready { color: var(--ok); }
.ui-bold .start-checks #mic-level::-webkit-progress-bar { background: var(--line2); }
.ui-bold .start-checks #mic-level::-webkit-progress-value { background: var(--ok); }
.ui-bold .start-checks #mic-level::-moz-progress-bar { background: var(--ok); }

/* Sign in */
.ui-bold .login-body, .ui-bold .login-panel { background: var(--surface); color: var(--text); }
.login-mode { display: flex; justify-content: flex-end; margin-bottom: 1rem; }
.ui-bold .login-welcome { color: var(--muted); font-weight: 400; }
.ui-bold .login-title { font-weight: 600; }
.ui-bold .login-label { font-weight: 500; }
.ui-bold .input-lg { border: 1px solid var(--field-line); border-radius: 10px; background: var(--field); color: var(--text); }
.ui-bold .input-lg.input-error { border-color: var(--bad); }
.ui-bold .btn-login { border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-size: 1.15rem; font-weight: 600; }
.ui-bold .btn-login:hover { background: var(--accent-hover); }
.ui-bold .pin-toggle { color: var(--accent-text); font-weight: 500; }
.ui-bold .social a { background: var(--accent); color: var(--accent-ink); }
.ui-bold .social a:hover { background: var(--accent-hover); }

/* =====================================================================================================
   Phase 3: the test screen. The sidebar, bars and dialogs follow light / dark; the question papers, the
   answer box and the prompt stay light in both modes. Anti-cheating behaviour is untouched.
   ===================================================================================================== */
html.ui-bold { --stage: #dfe6f2; }
@media screen { html.ui-bold[data-mode="dark"] { --stage: #0a1226; } }

/* Inside the papers and the middle column every colour is the light set, whatever the mode. */
.ui-bold .exam .panes, .ui-bold .exam .center, .ui-bold .lightbox .lb-img {
    color-scheme: light; color: #1e2533;
    --paper: #fff; --soft: #f5f8fd; --soft-blue: #e3edff; --ink: #1e2533; --text: #1e2533; --muted: #5b6b8c; --band: #e3e8f1;
    --line: #dbe3f2; --line2: #eef2f9; --field: #fff; --field-line: #c9d4e8; --surface: #fff; --surface2: #f5f8fd;
    --accent: #0a6ff8; --accent-hover: #0857c4; --accent-ink: #fff; --accent-soft: #e3edff; --accent-text: #0748ad;
    --blue: #0a6ff8; --blue-dark: #0748ad; --yellow: #ffde59; --red: #e11d48;
    --ok: #15803d; --ok-bg: #e9f7ef; --bad: #c2163b; --bad-bg: #ffecef; --warn: #8a5300; --warn-bg: #fff4dc;
}
.ui-bold .exam-body, .ui-bold .exam .stage, .ui-bold .exam .panes, .ui-bold .exam .pane { background: var(--stage); }
.ui-bold .exam .pane + .pane { border-left-color: color-mix(in srgb, var(--stage) 70%, #000); }
.ui-bold .exam .native-scroll, .ui-bold .exam .n-page-left { background: #fff; }
.ui-bold .exam .n-page-right { background: #f7f9fc; }
.ui-bold .exam .page { box-shadow: 0 2px 10px rgba(0, 0, 0, .14); }

/* The page-wide form rules of the Bold look must not reach the answer fields of the test. */
.ui-bold .exam .write-box { border: 0; border-radius: 0; background: transparent; color: #1e2533; font-family: var(--serif); font-size: calc(1.12rem * var(--native-scale)); line-height: 1.75; }
.ui-bold .exam .write-frame { border-color: #0a6ff8; background: #fff; }
.ui-bold .exam .native .n-select, .ui-bold .exam .native .n-input { border: 1.5px solid #8b93a0; border-radius: 8px; background: #fff; color: #1e2533; }
.ui-bold .exam .native .n-select.done, .ui-bold .exam .native .n-input:focus, .ui-bold .exam .native .n-input:not(:placeholder-shown) { border-color: #0a6ff8; }
.ui-bold .exam .short { border: 0; border-left: 1px solid var(--side-muted); border-radius: 0; background: transparent; color: #fff; }
.ui-bold .exam .short::placeholder { color: var(--side-muted); }

/* Part bar above the papers */
.ui-bold .exam .partbar { background: var(--surface); border-bottom: 1px solid var(--line); color: var(--text); }
.ui-bold .exam .partbar-title { color: var(--muted); }
.ui-bold .exam .partbar-font button { border-color: var(--line); background: var(--surface); color: var(--text); font-weight: 600; }

/* Loading screen: navy all round, one card */
.ui-bold .exam .gate { display: grid; place-items: center; background: var(--navy); }
.gate-solo { display: flex; flex-direction: column; align-items: center; gap: 1rem; width: 100%; max-width: 640px; margin: auto; padding: 2.2rem 2.4rem; text-align: center; }
.ui-bold .gate-solo { border-top: 6px solid var(--c, var(--accent)); }
.gate-kind { margin: 0; color: var(--muted); font-size: .95rem; }
.gate-title { margin: 0; font-size: clamp(1.6rem, 2.2vw, 2.2rem); font-weight: 600; line-height: 1.15; }
.gate-remind { margin: 0; color: var(--muted); font-size: .88rem; }
.ui-bold .exam .ring { width: min(220px, 50vw); background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line2) 0); }
.ui-bold .exam .ring::before { inset: 14px; background: var(--surface); }
.ui-bold .exam .ring-text { color: var(--text); font-size: 1.1rem; font-weight: 600; text-transform: none; }
.ui-bold .exam .gate-message { font-weight: 500; }
.ui-bold .exam .gate-message.bad { color: var(--bad); }
.ui-bold .exam .gate-note { background: var(--hl); color: var(--hl-ink); font-weight: 500; }
.ui-bold .exam .gate-btn-primary { border-color: var(--hl); background: var(--hl); color: var(--hl-ink); }
.ui-bold .exam .gate-btn-primary:hover { border-color: var(--hl-hover); background: var(--hl-hover); }
.ui-bold .exam .gate-btn-primary:disabled { border-color: var(--line); background: var(--line2); color: var(--muted); }

/* The sidebar: navy in both modes */
.ui-bold .exam .sidebar { background: var(--navy); border-left: 0; color: var(--side-text); }
.ui-bold .exam .sb-top { background: var(--navy); border-bottom: 1px solid var(--navy2); }
.ui-bold .exam .timer { color: #fff; font-size: clamp(1.9rem, 2.7vw, 2.9rem); font-weight: 600; }
.ui-bold .exam .timer.low { background: var(--hl); color: var(--hl-ink); }
.ui-bold .exam .timer-note { color: var(--hl); font-weight: 600; }
.ui-bold .exam .sb-label { padding: .55rem .9rem; background: var(--hl); color: var(--hl-ink); font-weight: 600; text-align: left; text-transform: none; }
.ui-bold .exam .saved-note { color: #14532d; font-weight: 500; }
.ui-bold .exam .sb-warn { background: var(--navy); border-bottom: 1px solid var(--navy2); }
.ui-bold .exam .sb-warn-label { flex-basis: 5.6rem; color: var(--side-muted); font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.ui-bold .exam .sb-row.hit .sb-warn-label { color: #fb7185; }
.ui-bold .exam .strike-dot { background: var(--navy2); }
.ui-bold .exam .strike-dot.on { background: #ef4444; }
.ui-bold .exam .strikes-text { color: var(--side-text); font-weight: 500; }
.ui-bold .exam .font-slider { background: linear-gradient(to right, var(--accent) var(--fill, 25%), var(--navy2) var(--fill, 25%)); }
.ui-bold .exam .audio-bar { background: #0f2a5c; color: var(--side-text); }
.ui-bold[data-mode="dark"] .exam .audio-bar { background: #0c1a3d; }
.ui-bold .exam .audio-label { color: #9cc6ff; font-weight: 600; }
.ui-bold .exam .audio-bar progress { accent-color: var(--s-listening); }
.ui-bold .exam .audio-volume { font-weight: 600; }
.ui-bold .exam .answers-title { background: var(--navy); color: #fff; font-size: clamp(1.05rem, 1.4vw, 1.4rem); font-weight: 600; text-transform: none; }
.ui-bold .exam .part-nav, .ui-bold .exam .foot-nav { background: var(--navy2); color: #fff; }
.ui-bold .exam .flag-hint { color: var(--side-muted); }
.ui-bold .exam .answer-list { color: #fff; }
.ui-bold .exam .ans-group { color: var(--side-muted); font-weight: 600; }
.ui-bold .exam .ans-row { border-color: transparent; background: var(--navy2); }
.ui-bold .exam .ans-row.flagged { border-color: #fb923c; }
.ui-bold .exam .ans-row.flagged .ans-num::after, .ui-bold .exam .ql-num.flag::after { border-top-color: #fb923c; }
.ui-bold .exam .ans-num { border-color: var(--side-muted); background: var(--navy); color: var(--side-text); font-weight: 600; }
.ui-bold .exam .ans-row.done .ans-num { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.ui-bold .exam .letters { border-left-color: var(--side-muted); }
.ui-bold .exam .letter { border-color: var(--side-muted); background: transparent; color: #fff; font-weight: 600; }
.ui-bold .exam .letter:hover { border-color: var(--accent); }
.ui-bold .exam .letter.on { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.ui-bold .exam .qlist-title { background: var(--navy2); color: #fff; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.ui-bold .exam .qlist { background: var(--navy); }
.ui-bold .exam .ql-num { border: 0; background: var(--navy2); color: var(--side-text); font-weight: 600; border-radius: 7px; }
.ui-bold .exam .ql-num.done { background: var(--accent); color: var(--accent-ink); }
.ui-bold .exam .ql-num.in-part { box-shadow: 0 0 0 2px var(--hl); border: 0; }
.ui-bold .exam .ql-row { border-color: transparent; background: var(--navy2); }
.ui-bold .exam .ql-badge { border-color: var(--side-muted); background: var(--navy); color: var(--side-text); }
.ui-bold .exam .ql-row.done .ql-badge, .ui-bold .exam .ql-row.now .ql-badge { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.ui-bold .exam .ql-row .ql-part-title { color: #fff; }
.ui-bold .exam .ql-row:not(.done):not(.now) .ql-words { color: var(--side-muted); }
.ui-bold .exam .sp-live { background: var(--navy2); color: var(--side-text); }
.ui-bold .exam .side-label { color: var(--side-text); }
.ui-bold .exam .write-count { border-color: transparent; background: var(--navy2); color: #fff; }
.ui-bold .exam .write-count::before { background: var(--navy); }
.ui-bold .exam .write-count.ok::before { background: var(--accent); }
.ui-bold .exam .side-chip { background: var(--navy2); color: var(--side-text); }
.ui-bold .exam .side-chip.on { background: var(--accent); color: var(--accent-ink); }
.ui-bold .exam .sb-foot { background: var(--navy); border-top: 1px solid var(--navy2); }
.ui-bold .exam .sb-submit { border: 2px solid var(--hl); border-radius: 12px; background: transparent; color: var(--hl); font-weight: 600; }
.ui-bold .exam .sb-submit:hover { background: var(--hl); color: var(--hl-ink); }
.ui-bold .exam .grip:hover::after, .ui-bold .exam .grip.dragging::after { background: var(--accent); }

/* Middle column details (light in both modes) */
.ui-bold .exam .write-option { border-radius: 12px; font-weight: 600; }
.ui-bold .exam .sp-stepper li.now { background: #0a6ff8; color: #fff; }
.ui-bold .exam .sp-pill { background: var(--hl); color: var(--hl-ink); font-weight: 600; }
.ui-bold .exam .sp-btn { border-radius: 12px; font-weight: 600; text-transform: none; }
.ui-bold .exam .dlg-ask { border-radius: 12px; text-transform: none; font-weight: 600; }
.ui-bold .exam .n-nav-btn { border-radius: 12px; font-weight: 600; }

/* Dialogs over the test */
.ui-bold .exam .overlay { background: rgba(5, 10, 24, .72); }
.ui-bold .exam .overlay-yellow { background: rgba(120, 86, 0, .6); }
.ui-bold .exam .overlay-red { background: rgba(80, 10, 24, .72); }
.ui-bold .exam .overlay-blue { background: rgba(11, 31, 75, .66); }
.ui-bold .exam .overlay-card { border-top: 8px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.ui-bold .exam .overlay-yellow .overlay-card { border-top-color: var(--hl); }
.ui-bold .exam .overlay-red .overlay-card { border-top-color: #ef4444; }
.ui-bold .exam .overlay-blue .overlay-card { border-top-color: var(--accent); }
.ui-bold .exam .overlay-card h2 { font-weight: 600; }
.ui-bold .exam .overlay-card.warn h2 { color: var(--bad); }
.ui-bold .exam .overlay-icon { background: #ef4444; font-weight: 700; }
.ui-bold .exam .overlay-pill { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.ui-bold .exam .overlay-red .overlay-pill { background: var(--bad-bg); color: var(--bad); }
.ui-bold .exam .overlay-stat-green { background: var(--ok-bg); color: var(--ok); }
.ui-bold .exam .overlay-stat-amber { background: var(--warn-bg); color: var(--warn); }
.ui-bold .exam .overlay-stat-blue { background: var(--info-bg); color: var(--info); }
.ui-bold .exam .overlay-stat strong { font-weight: 600; }
.ui-bold .exam .overlay-stat span { color: var(--text); }
.ui-bold .exam .overlay-chip { background: var(--bad-bg); color: var(--bad); font-weight: 600; }
.ui-bold .exam .overlay-blue .overlay-chip { background: var(--info-bg); color: var(--info); }
.ui-bold .exam .ov-list-title { font-weight: 600; }
.ui-bold .exam .ov-num { border-color: var(--line); background: var(--surface); color: var(--text); font-weight: 600; }
.ui-bold .exam .ov-num:hover { border-color: var(--accent); color: var(--accent-text); }
.ui-bold .exam .ov-btn { border-radius: 12px; font-weight: 600; }
.ui-bold .exam .ov-primary { background: var(--accent); color: var(--accent-ink); }
.ui-bold .exam .ov-primary:hover { background: var(--accent-hover); }
.ui-bold .exam .overlay-yellow .ov-primary { background: var(--hl); color: var(--hl-ink); }
.ui-bold .exam .ov-danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 2px var(--bad); }
.ui-bold .exam .ov-danger:hover { background: var(--bad-solid); color: #fff; box-shadow: none; }
.ui-bold .exam .ov-ghost { background: transparent; color: var(--accent-text); box-shadow: inset 0 0 0 2px var(--line); }

/* =====================================================================================================
   Test screen, option B (docs/wireframes/test-sidebar-options.html): status in a top bar, the right column
   is only the answer sheet. --u is 1px on a desktop and .8px on a touch screen (the iPad is held closer);
   --tap keeps everything a finger presses at 44 px or more on touch screens.
   ===================================================================================================== */
.ui-bold .exam { --u: 1px; --tap: 40px; --tbar-h: calc(64 * var(--u)); }
@media (pointer: coarse) { .ui-bold .exam { --u: .8px; --tap: 44px; --tbar-h: 56px; } }

.ui-bold .exam .paper { grid-template-rows: auto minmax(0, 1fr); --side-w: clamp(330px, 18vw, 400px); }
.ui-bold .exam .stage, .ui-bold .exam .sidebar { grid-row: 2; }
.ui-bold .exam .grip-side { top: var(--tbar-h); }

/* Top bar */
.tbar {
    grid-column: 1 / -1; grid-row: 1; display: flex; align-items: center; gap: calc(18 * var(--u)); min-width: 0;
    height: var(--tbar-h); padding: 0 calc(18 * var(--u)); background: var(--navy); color: var(--side-text); border-bottom: 1px solid var(--navy2);
}
.tbar-logo { flex: none; height: calc(34 * var(--u)); width: auto; max-width: 120px; object-fit: contain; }
.tbar-clock { display: flex; flex: none; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.ui-bold .exam .tbar .timer { padding: 0 .35rem; border-radius: 8px; font-size: calc(30 * var(--u)); }
.ui-bold .exam .tbar .timer-note { flex: none; font-size: calc(12 * var(--u)); text-align: left; }
.tbar-what { display: flex; flex: 0 1 auto; flex-direction: column; min-width: 0; max-width: 24rem; line-height: 1.25; }
.tbar-what strong { overflow: hidden; color: #fff; font-size: calc(15 * var(--u)); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.ui-bold .exam .tbar .exam-part { overflow: hidden; color: var(--side-muted); font-size: calc(12.5 * var(--u)); text-overflow: ellipsis; white-space: nowrap; }
.ui-bold .exam .tbar .saved-note { color: #86efac; font-size: calc(12 * var(--u)); }
.tbar-what .preview-tag { align-self: flex-start; font-size: calc(11 * var(--u)); }
.tbar-warn { flex: none; gap: calc(8 * var(--u)); }
.ui-bold .exam .tbar-warn .sb-warn-label { flex: none; font-size: calc(11 * var(--u)); }
.ui-bold .exam .tbar .strikes { flex: none; gap: calc(5 * var(--u)); }
.ui-bold .exam .tbar .strike-dot { flex: none; width: calc(13 * var(--u)); height: calc(13 * var(--u)); border-radius: 50%; }
.ui-bold .exam .tbar .strikes-text { font-size: calc(12 * var(--u)); }
.tbar-parts { display: flex; flex: 1 1 auto; gap: calc(4 * var(--u)); min-width: 0; max-width: 640px; }
.tbar-parts[hidden] { display: none; }
.tp {
    display: flex; flex: 1 1 0; flex-direction: column; justify-content: center; gap: calc(3 * var(--u)); min-width: 0; min-height: var(--tap);
    padding: 0 2px; border: 0; border-radius: 8px; background: transparent; color: var(--side-text); font: inherit; font-size: calc(11.5 * var(--u)); font-weight: 600; cursor: pointer;
}
.tp i { display: block; height: calc(8 * var(--u)); overflow: hidden; border-radius: 999px; background: var(--navy2); }
.tp b { display: block; height: 100%; background: var(--accent); }
.tp.full b { background: #4ade80; }
.tp.cur { color: var(--hl); }
.tp.cur i { box-shadow: 0 0 0 2px var(--hl); }
.tp:hover { background: var(--navy2); }
.tbar-btn {
    flex: none; min-height: var(--tap); padding: 0 calc(12 * var(--u)); border: 1px solid var(--navy2); border-radius: 10px; background: transparent;
    color: var(--side-text); font: inherit; font-size: calc(13 * var(--u)); font-weight: 600; cursor: pointer;
}
.tbar-btn[hidden] { display: none; }
.tbar-btn:hover, .tbar-btn[aria-expanded="true"] { background: var(--navy2); color: #fff; }
.ui-bold .exam .tbar .sb-submit { flex: none; margin-left: auto; min-height: var(--tap); padding: 0 calc(18 * var(--u)); font-size: calc(15 * var(--u)); }
@media (max-width: 1300px) { .tbar-logo { display: none; } .ui-bold .exam .tbar .strikes-text { display: none; } }
@media (max-width: 1100px) { .tbar-warn .sb-warn-label { display: none; } }

/* The answer column */
.ui-bold .exam .font-row, .ui-bold .exam .flag-hint { display: none !important; }
.ui-bold .exam .answers-title { gap: calc(8 * var(--u)); padding: calc(10 * var(--u)) calc(12 * var(--u)); font-size: calc(17 * var(--u)); }
.ui-bold .exam .part-nav { width: var(--tap); height: var(--tap); font-size: calc(22 * var(--u)); }
.ui-bold .exam .answer-list { padding: calc(4 * var(--u)) calc(10 * var(--u)) calc(12 * var(--u)); }
.ui-bold .exam .ans-group { font-size: calc(12 * var(--u)); }
.ui-bold .exam .ans-row { gap: calc(8 * var(--u)); margin: calc(8 * var(--u)) 0; padding: calc(5 * var(--u)) calc(4 * var(--u)) calc(5 * var(--u)) calc(7 * var(--u)); border-radius: 14px; }
.ui-bold .exam .ans-num { width: calc(36 * var(--u)); height: calc(36 * var(--u)); font-size: calc(14 * var(--u)); }
.ui-bold .exam .letters { flex: 0 1 auto; min-width: 0; gap: calc(5 * var(--u)); padding-left: calc(7 * var(--u)); }
.ui-bold .exam .letter { width: var(--tap); height: var(--tap); font-size: calc(16 * var(--u)); }
.ui-bold .exam .short { min-height: var(--tap); font-size: calc(16 * var(--u)); }
.ans-flag {
    flex: none; display: grid; place-items: center; width: var(--tap); height: var(--tap); margin-left: auto; padding: 0; border: 0; border-radius: 10px;
    background: transparent; color: var(--side-muted); font: inherit; font-size: calc(18 * var(--u)); cursor: pointer;
}
.ans-flag:hover { background: var(--navy); color: #fb923c; }
.ans-row.flagged .ans-flag { color: #fb923c; }
.ui-bold .exam .ans-row.flagged .ans-num::after { display: none; }

/* Writing rows and Speaking prompts stay in the column; the number grid of the other papers opens from "All numbers". */
.ui-bold .exam:not(.is-speaking):is(:not(.is-writing), .is-mixed) .qlist-title,
.ui-bold .exam:not(.is-speaking):is(:not(.is-writing), .is-mixed) #qlist { display: none; }
.ui-bold .exam.show-all:not(.is-speaking):is(:not(.is-writing), .is-mixed) #qlist {
    display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: calc(8 * var(--u)); position: fixed; top: calc(var(--tbar-h) + 6px); right: 12px; z-index: 45;
    width: min(460px, 92vw); max-height: 70vh; overflow-y: auto; padding: 14px; border: 1px solid var(--navy2); border-radius: 14px;
    background: var(--navy); box-shadow: 0 18px 40px rgba(0, 0, 0, .4); transform-origin: top right; animation: menu-in 160ms var(--ease-out);
}
.ui-bold .exam.show-all #qlist .ql-num { width: 100%; max-width: none; height: var(--tap); aspect-ratio: auto; font-size: calc(13 * var(--u)); }
.ui-bold .exam .ql-row { min-height: var(--tap); }
@media (prefers-reduced-motion: reduce) { .ui-bold .exam.show-all #qlist { animation: fade-in 120ms ease; } }

/* Part bar above the paper: the A− / A+ buttons are finger size too */
.ui-bold .exam .partbar { font-size: calc(15 * var(--u)); }
.ui-bold .exam .partbar-font button { min-width: var(--tap); min-height: var(--tap); }

/* iPad width: a fixed answer column, the paper takes the rest */
@media (max-width: 1100px) { .ui-bold .exam .paper { grid-template-columns: minmax(0, 1fr) 320px; } }

/* =====================================================================================================
   Speaking, one prompt at a time (docs/wireframes/speaking-options.html, version 1): Ready -> Think -> Speak -> Done.
   It sits in the middle column, which keeps the light colours in both modes.
   ===================================================================================================== */
.spx { display: flex; flex-direction: column; gap: calc(20 * var(--u)); min-height: 100%; padding: calc(18 * var(--u)) calc(14 * var(--u)) calc(24 * var(--u)); }
.spx-ready { display: flex; flex-direction: column; align-items: center; gap: calc(14 * var(--u)); text-align: center; }
.spx[data-phase="ask"], .spx[data-phase="loading"], .spx[data-phase="done"] { justify-content: center; }
.spx-ready[hidden], .spx-stage[hidden] { display: none; }
.spx-chips { justify-content: center; }
.ui-bold .exam .spx .sp-chip { width: calc(40 * var(--u)); height: calc(40 * var(--u)); background: #e3e8f1; color: #5b6b8c; font-weight: 600; }
.ui-bold .exam .spx .sp-chip.done { background: #0a6ff8; color: #fff; }
.ui-bold .exam .spx .sp-chip.now { background: #ffde59; color: #0b1f4b; }
.spx-ready-title { margin: 0; font-size: calc(28 * var(--u)); font-weight: 600; }
.spx-ready-text { max-width: 36rem; margin: 0; color: #5b6b8c; font-size: calc(17 * var(--u)); }
.spx-stage { display: flex; flex-direction: column; gap: calc(20 * var(--u)); }

/* The examiner's card, with up to five pictures */
.spx-card { display: flex; align-items: flex-start; gap: calc(18 * var(--u)); padding: calc(22 * var(--u)) calc(26 * var(--u)); border: 1px solid #dbe3f2; border-radius: 18px; background: #fff; box-shadow: 0 2px 10px rgba(11, 31, 75, .06); }
.spx-avatar { display: grid; flex: none; place-items: center; width: calc(56 * var(--u)); height: calc(56 * var(--u)); border-radius: 50%; background: #ea580c; color: #fff; font-size: calc(22 * var(--u)); font-weight: 700; }
.spx-card-body { flex: 1; min-width: 0; }
.spx-head { margin: 0; color: #5b6b8c; font-size: calc(13 * var(--u)); font-weight: 600; }
.spx-text { margin: .15rem 0 0; color: #0b1f4b; font-size: calc(23 * var(--u) * var(--native-scale)); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.spx-fig { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: calc(10 * var(--u)); margin: calc(14 * var(--u)) 0 0; }
.spx-fig[hidden] { display: none; }
.spx-pic { position: relative; min-width: 0; justify-self: start; }
.spx-pic .wm { position: absolute; inset: 0; pointer-events: none; }
.spx-fig img { display: block; max-width: 100%; height: auto; max-height: 20rem; object-fit: contain; border-radius: 10px; background: #f5f8fd; -webkit-user-drag: none; user-select: none; }
.spx-fig[data-count="1"] img { max-height: min(30rem, 46vh); }
.spx-fig[data-count="3"] img, .spx-fig[data-count="4"] img, .spx-fig[data-count="5"] img { max-height: 13rem; }

/* Short screens (an iPad held sideways): pictures and ring give way, so the button stays on screen. Clicking enlarges a picture. */
@media (max-height: 820px) {
    .spx, .spx-stage { gap: calc(12 * var(--u)); }
    .spx-fig[data-count="1"] img { max-height: 30vh; }
    .spx-fig img { max-height: 22vh; }
    .spx-fig[data-count="3"] img, .spx-fig[data-count="4"] img, .spx-fig[data-count="5"] img { max-height: 15vh; }
    .spx-stage.has-pics .spx-ring { width: 18vh; }
    .spx-stage.has-pics .spx-clock { font-size: 6vh; }
    .spx-card { padding: calc(16 * var(--u)) calc(20 * var(--u)); }
}

/* No paper column (Speaking, and Writing or native parts without a picture): on iPad the answer area takes the whole height. */
@media (max-width: 1100px) {
    .ui-bold .exam .stage.no-paper { grid-template-rows: auto auto minmax(0, 1fr); }
    .ui-bold .exam .stage.no-paper .center { grid-row: 3; border-top: 0; }
}
.spx-zoomhint { margin: calc(6 * var(--u)) 0 0; color: #5b6b8c; font-size: calc(13 * var(--u)); }
.spx-zoomhint[hidden] { display: none; }

/* Steps and ring */
.spx-middle { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: calc(22 * var(--u)) calc(64 * var(--u)); }
.spx-steps { display: flex; flex-direction: column; gap: calc(18 * var(--u)); margin: 0; padding: 0; list-style: none; }
.spx-steps li { display: flex; align-items: center; gap: calc(14 * var(--u)); color: #94a3b8; font-size: calc(17 * var(--u)); }
.spx-dot { display: grid; flex: none; place-items: center; width: calc(40 * var(--u)); height: calc(40 * var(--u)); border-radius: 50%; background: #e3e8f1; color: #0b1f4b; font-weight: 600; }
.spx-step-text b { margin-right: .4rem; color: #0b1f4b; font-weight: 600; }
.spx-steps li.now { color: #5b6b8c; }
.spx-steps li.now .spx-dot { background: #0a6ff8; color: #fff; box-shadow: 0 0 0 5px #e3edff; }
.spx-steps li.done .spx-dot { background: #16a34a; color: transparent; position: relative; }
.spx-steps li.done .spx-dot::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.spx[data-phase="record"] .spx-steps li.now .spx-dot { background: #d0153e; box-shadow: 0 0 0 5px #ffe4ea; }
.spx-ring { position: relative; flex: none; width: clamp(170px, 30vh, 290px); aspect-ratio: 1; }
.spx-stage.has-pics .spx-ring { width: clamp(150px, 22vh, 220px); }
.spx-ring svg { display: block; width: 100%; height: 100%; }
.spx-track, .spx-arc { fill: none; stroke-width: 8; }
.spx-track { stroke: #e3e8f1; }
.spx-arc { stroke: #0a6ff8; stroke-linecap: round; }
.spx[data-phase="think"] .spx-arc { stroke: #f59e0b; }
.spx[data-phase="check"] .spx-arc { stroke: #16a34a; }
.spx-ring-in { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.05; }
.spx-clock { color: #0b1f4b; font-size: clamp(2.6rem, 9vh, 4.6rem); font-weight: 600; font-variant-numeric: tabular-nums; }
.spx-ring-label { margin-top: .3rem; color: #5b6b8c; font-size: calc(16 * var(--u)); font-weight: 600; }
.spx[data-phase="think"] .spx-ring-label { color: #a15c00; }
.spx[data-phase="record"] .spx-ring-label { color: #d0153e; }
.spx[data-phase="check"] .spx-ring-label { color: #15803d; }

/* Microphone, the saved answer, the buttons */
.spx-mic { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: calc(14 * var(--u)); }
.spx-mic[hidden] { display: none; }
.spx-mic b { font-weight: 600; }
.ui-bold .exam .spx-meter { width: min(28rem, 60%); height: calc(14 * var(--u)); appearance: none; border: 0; border-radius: 999px; background: #e3e8f1; overflow: hidden; }
.spx-meter::-webkit-progress-bar { border-radius: 999px; background: #e3e8f1; }
.spx-meter::-webkit-progress-value { border-radius: 999px; background: #16a34a; }
.spx-meter::-moz-progress-bar { border-radius: 999px; background: #16a34a; }
.spx-mic .mic-word { margin: 0; padding: .25rem .8rem; font-weight: 600; }
.spx-mic .mic-word[hidden], .spx-mic .mic-word:empty, .spx-mic-idle[hidden] { display: none; }
.spx-mic-idle { padding: .25rem .8rem; border-radius: 999px; background: #e3e8f1; color: #5b6b8c; font-size: .85rem; font-weight: 600; }
.ui-bold .exam .spx-wave { width: min(44rem, 100%); margin: 0 auto; padding: calc(8 * var(--u)) calc(14 * var(--u)); border-radius: 999px; background: #fff3c4; }
.spx-wave[hidden] { display: none !important; }
.ui-bold .exam .spx-wave .sp-play { width: var(--tap); height: var(--tap); background: #0a6ff8; }
.spx-msg { margin: 0; text-align: center; }
.spx-msg:empty { display: none; }
.ui-bold .exam .spx-actions { justify-content: center; margin: 0; }
.ui-bold .exam .spx-actions .sp-btn { min-height: max(var(--tap), calc(58 * var(--u))); padding: 0 calc(32 * var(--u)); border-radius: 14px; font-size: calc(19 * var(--u)); }
.ui-bold .exam .spx .sp-btn-blue { background: #0a6ff8; color: #fff; }
.ui-bold .exam .spx .sp-btn-blue:hover { background: #0857c4; }
.ui-bold .exam .spx .sp-btn-yellow { background: #ffde59; color: #0b1f4b; }
.spx-note { margin: calc(-8 * var(--u)) 0 0; color: #5b6b8c; font-size: calc(14 * var(--u)); text-align: center; }
.spx-note:empty { display: none; }
.stage.no-paper .center > .spx { max-width: 68rem; }
@media (prefers-reduced-motion: no-preference) { .spx-stage, .spx-ready { animation: fade-in 200ms ease-out; } }
