/* IELTS Dashboard - shared styles of the first version (D-045), after the Claude Design prototype (D6).
   System fonts only: the pages load nothing from other sites.

   Colours (D-08h (2), T-017): three sets of the same tokens; the rules below use only tokens, never a colour.
   - :root - the light theme: the teacher's pages, as they were;
   - .theme-dark (the <html> of the student's app) - the dark shell: a near-black background (~60 %), dark grey
     surfaces (~30 %), the mascot's lavender only as the accent (~10 %): the main button and the chosen item. Gold
     only for moments, red and green only for «wrong» and «right», so «done» is grey;
   - body.paper (the student's test and writing screens, examMode) - white, black text, grey bars on top and below,
     as in the computer-delivered IELTS. */
:root {
  --bg: #F3F4F6; --ink: #18202B; --muted: #566070; --line: #DDE1E7; --line-strong: #C9CFD8;
  --card: #FFFFFF; --blue: #1D4ED8; --blue-dark: #1E40AF; --blue-soft: #E8EEFC; --blue-ink: #1E3A8A;
  --warn-bg: #FFFBEB; --warn-line: #F2C96B; --warn-ink: #7C2D12; --bad-bg: #FEF2F2; --bad-line: #F5B5B5;
  --bad-ink: #991B1B; --ok-bg: #ECFDF5; --ok-ink: #065F46; --chip: #EEF1F5;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  /* the student's shell (D-08h (3)): the menu on the left and Today «один шаг» */
  --nav-bg: var(--card); --nav-line: var(--line); --nav-ink: #334155; --nav-muted: var(--muted);
  --nav-hover: var(--bg); --nav-on-bg: var(--blue-soft); --nav-on-ink: var(--blue);
  --accent: var(--blue); --accent-hover: var(--blue-dark); --accent-ink: #FFFFFF; --accent-soft: var(--blue-soft);
  --accent-text: var(--blue-ink); --accent-line: #C7D5F8; --accent-ink-2: #DCE5FB;
  --offer-bg: var(--blue-soft); --offer-line: var(--blue);
  --surface: var(--card); --surface-line: var(--line); --surface-quiet: #F8FAFC; --surface-dim: #FAFBFC;
  --mascot-bg: var(--blue-soft); --mascot-ring: #C7D5F8;
  /* text, links, focus, fields */
  --ink-2: #334155; --link: var(--blue); --link-hover: var(--blue-ink); --focus: var(--blue);
  --field-line: var(--line-strong); --gap-line: #94A3B8; --gap-ph: #64748B; --hover: #F8FAFC; --hover-2: #F1F5F9;
  --note-bg: #F5F8FF; --note-line: #C7D5F8; --btn-bg: var(--card); --btn-line: var(--line-strong); --btn-hover: var(--bg);
  /* states: right and wrong (with a solid fill and its text), partly, done, recommended, a moment */
  --ok-line: #A7F3D0; --ok-solid: var(--ok-ink); --bad-solid: var(--bad-ink); --on-solid: #FFFFFF;
  --bad-row: #FFF8F8; --warn-chip: #FFF7ED;
  --done-bg: var(--ok-bg); --done-ink: var(--ok-ink); --done-solid: var(--ok-ink); --on-done: #FFFFFF;
  --star-bg: #FEF3C7; --star-ink: #92400E; --rec-line: #F2D58B; --gold: #E8B33A;
  /* inverted: the pop-ups (+ Word Hub, the highlight menu) and a chosen pill */
  --inv-bg: var(--ink); --inv-ink: #FFFFFF; --inv-hover: #334155; --shade: 15, 23, 42;
  /* marks: the student's highlight, a flash; the criteria; «Improve language»; the AI version; the pair ✗ → ✓;
     the review of a Reading question (the quote and the paraphrase pairs) */
  --hl: #FDE68A; --hl-note: #B45309; --flash: #FEF9C3;
  --c-tr: #DBEAFE; --c-cc: #EDE9FE; --c-lr: #DCFCE7; --c-gra: #FFEDD5; --c-x: #F1F5F9;
  --lg-plain: var(--blue-soft); --lg-unclear: #F3E8FF;
  --av-ins: #DCFCE7; --av-del: #FEE2E2; --av-del-ink: #991B1B;
  --x-del: #FECACA; --x-del-line: #DC2626; --x-ins: #BBF7D0; --x-ins-line: #16A34A; --x-gap-bg: #FEF2F2;
  --ev: #BBF7D0; --ev-line: #16A34A; --pp1: #BFDBFE; --pp1-line: #3B82F6; --pp2: #E9D5FF; --pp2-line: #A855F7;
  --pp3: #FED7AA; --pp3-line: #EA580C;
  /* the test and writing screens: the page, the frames, the bars on top and below, the question panel */
  --exam-bg: #E9EBEF; --frame-line: #CDD3DC; --split-line: #E2E6EC; --sheet: #FFFFFF;
  --bar-bg: var(--ink); --bar-line: transparent; --bar-ink: #FFFFFF; --bar-sub: #C9D2DE; --bar-btn-line: #4B5563;
  --bar-btn-hover: #2A3442; --timer-low: #FCA5A5; --timer-blink: #FDE68A;
  --foot-bg: var(--card); --foot-line: var(--line-strong);
  --q-done: #334155; --on-q-done: #FFFFFF; --q-flag: #D97706;
  --live: #DC2626; --live-off: #94A3B8; --track: #E2E6EC;
}
.theme-dark {
  color-scheme: dark; accent-color: #C4B6F0;
  --bg: #111013; --ink: #EDEBF2; --muted: #A3A0AD; --line: #2B2A31; --line-strong: #403E47;
  --card: #1B1A1F; --warn-bg: rgba(245, 169, 127, .11); --warn-line: rgba(245, 169, 127, .42); --warn-ink: #F5A97F;
  --bad-bg: rgba(242, 154, 154, .13); --bad-line: rgba(242, 154, 154, .42); --bad-ink: #F29A9A;
  --ok-bg: rgba(127, 209, 168, .13); --ok-ink: #7FD1A8; --chip: #26252C;
  --nav-bg: #0B0A0D; --nav-line: #1E1D22; --nav-ink: #CFCCD8; --nav-muted: #8E8A99;
  --nav-hover: #1B1A1F; --nav-on-bg: rgba(196, 182, 240, .14); --nav-on-ink: #C4B6F0;
  --accent: #C4B6F0; --accent-hover: #D3C8F5; --accent-ink: #2B2540; --accent-soft: rgba(196, 182, 240, .14);
  --accent-text: #C4B6F0; --accent-line: rgba(196, 182, 240, .32); --accent-ink-2: #4A4170;
  --offer-bg: #1B1A1F; --offer-line: rgba(196, 182, 240, .55);
  --surface: #1B1A1F; --surface-line: #2B2A31; --surface-quiet: #17161B; --surface-dim: #17161B;
  --mascot-bg: #1B1A1F; --mascot-ring: rgba(196, 182, 240, .45);
  --ink-2: #D9D6E0; --link: #C4B6F0; --link-hover: #E0D7FA; --focus: #C4B6F0;
  --field-line: #6E6B78; --gap-line: #6E6B78; --gap-ph: #A3A0AD; --hover: #222127; --hover-2: #2A2930;
  --note-bg: #1F1E24; --note-line: #2F2E36; --btn-bg: #24232A; --btn-line: #3A3940; --btn-hover: #2E2D35;
  --ok-line: rgba(127, 209, 168, .40); --ok-solid: #7FD1A8; --bad-solid: #F29A9A; --on-solid: #141316;
  --bad-row: rgba(242, 154, 154, .06); --warn-chip: rgba(245, 169, 127, .14);
  --done-bg: #24232A; --done-ink: #A3A0AD; --done-solid: #A3A0AD; --on-done: #111013;
  --star-bg: rgba(196, 182, 240, .14); --star-ink: #C4B6F0; --rec-line: rgba(196, 182, 240, .32); --gold: #E8B33A;
  --inv-bg: #EDEBF2; --inv-ink: #111013; --inv-hover: #D6D3DE; --shade: 0, 0, 0;
  --hl: rgba(250, 204, 21, .30); --hl-note: #FACC15; --flash: rgba(250, 204, 21, .14);
  --c-tr: rgba(96, 165, 250, .24); --c-cc: rgba(167, 139, 250, .24); --c-lr: rgba(45, 212, 191, .20);
  --c-gra: rgba(251, 146, 60, .24); --c-x: rgba(255, 255, 255, .09);
  --lg-plain: rgba(96, 165, 250, .20); --lg-unclear: rgba(167, 139, 250, .22);
  --av-ins: rgba(74, 222, 128, .20); --av-del: rgba(248, 113, 113, .22); --av-del-ink: #F29A9A;
  --x-del: rgba(248, 113, 113, .26); --x-del-line: #F87171; --x-ins: rgba(74, 222, 128, .22); --x-ins-line: #4ADE80;
  --x-gap-bg: rgba(248, 113, 113, .14);
  --ev: rgba(74, 222, 128, .20); --ev-line: #4ADE80; --pp1: rgba(96, 165, 250, .26); --pp1-line: #60A5FA;
  --pp2: rgba(192, 132, 252, .26); --pp2-line: #C084FC; --pp3: rgba(251, 146, 60, .26); --pp3-line: #FB923C;
  --exam-bg: #111013; --frame-line: #2B2A31; --split-line: #2B2A31; --sheet: #FFFFFF;
  --bar-bg: #0B0A0D; --bar-line: #2B2A31; --bar-ink: #EDEBF2; --bar-sub: #A3A0AD; --bar-btn-line: #403E47;
  --bar-btn-hover: #1B1A1F; --timer-low: #F29A9A; --timer-blink: #FACC15;
  --foot-bg: #1B1A1F; --foot-line: #2B2A31;
  --q-done: #5A5764; --on-q-done: #FFFFFF; --q-flag: #F5A97F;
  --live: #F87171; --live-off: #6E6B78; --track: #2B2A31;
}
body.paper {
  color-scheme: light; accent-color: #262626;
  --bg: #FFFFFF; --ink: #111111; --muted: #555555; --line: #DADADA; --line-strong: #BDBDBD;
  --card: #FFFFFF; --warn-bg: #FFFBEB; --warn-line: #F2C96B; --warn-ink: #7C2D12;
  --bad-bg: #FEF2F2; --bad-line: #F5B5B5; --bad-ink: #991B1B; --ok-bg: #ECFDF5; --ok-ink: #065F46; --chip: #EDEDED;
  --accent: #262626; --accent-hover: #000000; --accent-ink: #FFFFFF; --accent-soft: #EDEDED;
  --accent-text: #111111; --accent-line: #BDBDBD; --accent-ink-2: #DDDDDD;
  --offer-bg: #F7F7F7; --offer-line: #8C8C8C;
  --surface: #FFFFFF; --surface-line: #DADADA; --surface-quiet: #F7F7F7; --surface-dim: #F7F7F7;
  --mascot-bg: #F3F0FC; --mascot-ring: #DCD4F5;
  --ink-2: #333333; --link: #111111; --link-hover: #000000; --focus: #111111;
  --field-line: #8C8C8C; --gap-line: #8C8C8C; --gap-ph: #666666; --hover: #F4F4F4; --hover-2: #EFEFEF;
  --note-bg: #F7F7F7; --note-line: #DADADA; --btn-bg: #FFFFFF; --btn-line: #9E9E9E; --btn-hover: #F0F0F0;
  --ok-line: #A7F3D0; --ok-solid: #065F46; --bad-solid: #991B1B; --on-solid: #FFFFFF;
  --bad-row: #FFF8F8; --warn-chip: #FFF7ED;
  --done-bg: #EDEDED; --done-ink: #555555; --done-solid: #555555; --on-done: #FFFFFF;
  --star-bg: #FEF3C7; --star-ink: #92400E; --rec-line: #F2D58B; --gold: #E8B33A;
  --inv-bg: #111111; --inv-ink: #FFFFFF; --inv-hover: #333333; --shade: 0, 0, 0;
  --hl: #FDE68A; --hl-note: #B45309; --flash: #FEF9C3;
  --c-tr: #DBEAFE; --c-cc: #EDE9FE; --c-lr: #DCFCE7; --c-gra: #FFEDD5; --c-x: #F1F5F9;
  --lg-plain: #E8EEFC; --lg-unclear: #F3E8FF;
  --av-ins: #DCFCE7; --av-del: #FEE2E2; --av-del-ink: #991B1B;
  --x-del: #FECACA; --x-del-line: #B91C1C; --x-ins: #BBF7D0; --x-ins-line: #16A34A; --x-gap-bg: #FEF2F2;
  --ev: #BBF7D0; --ev-line: #16A34A; --pp1: #BFDBFE; --pp1-line: #3B82F6; --pp2: #E9D5FF; --pp2-line: #A855F7;
  --pp3: #FED7AA; --pp3-line: #EA580C;
  --exam-bg: #FFFFFF; --frame-line: #D6D6D6; --split-line: #E6E6E6; --sheet: #FFFFFF;
  --bar-bg: #F2F2F2; --bar-line: #D6D6D6; --bar-ink: #111111; --bar-sub: #555555; --bar-btn-line: #8C8C8C;
  --bar-btn-hover: #E4E4E4; --timer-low: #B91C1C; --timer-blink: #B45309;
  --foot-bg: #F2F2F2; --foot-line: #D6D6D6;
  --q-done: #3A3A3A; --on-q-done: #FFFFFF; --q-flag: #D97706;
  --live: #DC2626; --live-off: #8C8C8C; --track: #E2E2E2;
}
/* the keyboard focus of the student's two themes: every control shows it (a rule of its own wins over this one) */
:where(.theme-dark) :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
h1 { margin: 0; font-size: 26px; font-weight: 600; }
h2 { margin: 0; font-size: 18px; font-weight: 600; }
h3 { margin: 0; font-size: 15px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* the student's shell (D-08h (3)): the menu on the left, in groups; folded - icons only (68 px); hidden on a test,
   a piece of writing and the login page; on a phone - a strip of icons on top */
.shell { display: flex; align-items: flex-start; min-height: 100vh; }
.shell > main { flex: 1 1 auto; min-width: 0; }
.snav { position: sticky; top: 0; flex: none; width: 232px; height: 100vh; overflow: hidden auto; display: flex;
  flex-direction: column; gap: 2px; padding: 16px 12px 14px; background: var(--nav-bg);
  border-right: 1px solid var(--nav-line); }
.snav-top { display: flex; align-items: center; gap: 10px; padding: 0 4px 10px; }
.mascot-slot { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--mascot-bg);
  box-shadow: inset 0 0 0 2px var(--mascot-ring); }
/* the menu's Супсо (T-004): its 32 px icon, a button to Supso's panel (mascot.js) */
button.mascot-slot { display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0;
  border-radius: 10px; background: none; box-shadow: none; cursor: pointer; }
button.mascot-slot:hover { background: var(--nav-hover); }
button.mascot-slot img { display: block; width: 32px; height: 32px; image-rendering: pixelated; }
.snav-brand { font-size: 19px; font-weight: 700; white-space: nowrap; }
.snav-fold { margin-left: auto; width: 30px; height: 30px; flex: none; border: 0; border-radius: 8px; background: none;
  color: var(--nav-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.snav-fold:hover { background: var(--nav-hover); color: var(--ink); }
.snav-days { margin: 0 4px 8px; padding: 8px 10px; border-radius: 10px; background: var(--nav-hover); display: flex;
  align-items: baseline; gap: 6px; white-space: nowrap; }
.snav-days b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.snav-days span { font-size: 12px; font-weight: 600; color: var(--nav-muted); }
.snav-chip { align-self: flex-start; margin: 0 4px 6px; }
.snav-list { display: flex; flex-direction: column; gap: 2px; }
.snav-group { padding: 12px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--nav-muted); white-space: nowrap; }
.si { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 38px; padding: 0 10px; border: 0;
  border-radius: 9px; background: none; color: var(--nav-ink); font: inherit; font-size: 14px; font-weight: 500;
  text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer; }
.si:hover { background: var(--nav-hover); color: var(--ink); }
.si.on { background: var(--nav-on-bg); color: var(--nav-on-ink); font-weight: 600; }
.si:focus-visible, .snav-fold:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.si-out { margin-top: auto; color: var(--nav-muted); }
.ico { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round;
  stroke-linejoin: round; }
.snav.folded { width: 68px; padding-left: 10px; padding-right: 10px; }
.snav.folded .snav-brand, .snav.folded .si-label, .snav.folded .snav-days span, .snav.folded .snav-group span {
  display: none; }
.snav.folded .snav-top { flex-direction: column; gap: 8px; padding: 0 0 10px; }
.snav.folded .snav-fold { margin: 0; }
.snav.folded .snav-days { justify-content: center; margin: 0 0 8px; padding: 8px 0; }
.snav.folded .snav-days b { font-size: 16px; }
.snav.folded .snav-group { height: 1px; margin: 8px 6px; padding: 0; background: var(--nav-line); }
.snav.folded .si { justify-content: center; padding: 0; }
.snav.folded .snav-chip { align-self: center; width: 10px; height: 10px; margin: 0 0 6px; padding: 0; font-size: 0;
  background: var(--warn-line); }
@media (max-width: 760px) {
  .shell { flex-direction: column; align-items: stretch; }
  .shell > main { width: 100%; }               /* auto margins would shrink it to its content (Today has none) */
  .snav, .snav.folded { z-index: 30; width: auto; height: auto; flex-direction: row; align-items: center; gap: 2px;
    padding: 6px 8px; overflow: auto hidden; scrollbar-width: none; border-right: 0;
    border-bottom: 1px solid var(--nav-line); }
  .snav-top, .snav-group, .snav.folded .snav-group, .si-label { display: none; }
  .snav-days, .snav.folded .snav-days { flex: none; margin: 0 4px 0 0; padding: 4px 8px; }
  .snav-days span { display: none; }
  .snav .snav-chip.chip { flex: none; align-self: center; width: 10px; height: 10px; margin: 0 4px;
    padding: 0; font-size: 0; background: var(--warn-line); }
  .snav-list { flex-direction: row; gap: 2px; }
  .si, .snav.folded .si { flex: none; width: auto; min-height: 40px; padding: 0 9px; }
  .si-out { margin: 0 0 0 auto; }
}

/* Today «один шаг» (D-08h (4)): the line at the mascot's place, the main card and «Then» on the left; the plan of the
   day, what waits for the teacher and the diagnostic card on the right (one column when the page is narrow) */
.td { display: flex; flex-direction: column; gap: 16px; container-type: inline-size; }
.td-head h1 { font-size: 28px; font-weight: 700; }
.td-head p { margin-top: 2px; font-size: 14px; }
.td-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@container (min-width: 820px) { .td-grid { grid-template-columns: minmax(0, 1fr) 320px; } }
.td-main, .td-rail { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.td-say { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.td-now { display: flex; flex-direction: column; gap: 10px; padding: 24px 26px; border: 1px solid var(--surface-line);
  border-radius: 16px; background: var(--surface); }
.td-now-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.td-step { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.td-dots { display: flex; gap: 6px; }
.td-dots i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--line-strong); }
.td-dots i.done { background: var(--line-strong); }
.td-dots i.cur { border-color: var(--accent); background: var(--accent); }
.td-now h2 { font-size: 26px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.td-sub { color: var(--muted); }
.td-now .btn.big { min-height: 50px; padding: 0 26px; font-weight: 600; }
.td-why summary { width: fit-content; cursor: pointer; color: var(--muted); font-size: 13px; }
.td-why ul { margin-top: 6px; font-size: 14px; }
.td-then { font-size: 14px; }
.td-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--surface-line);
  border-radius: 14px; background: var(--surface); }
.td-card h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.td-card h3 span { color: var(--muted); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums;
  white-space: nowrap; }
.td-plan { display: flex; flex-direction: column; }
.td-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%;
  padding: 8px 0; border: 0; border-top: 1px solid var(--surface-line); background: none; color: inherit; font: inherit;
  font-size: 14px; text-align: left; }
.td-row:first-child { border-top: 0; }
button.td-row { cursor: pointer; }
button.td-row:hover .td-label { color: var(--accent); }
button.td-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.td-label { min-width: 0; overflow-wrap: anywhere; }
.td-min { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.td-box { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px;
  border: 2px solid var(--line-strong); border-radius: 5px; }
.td-box .ico { width: 12px; height: 12px; stroke-width: 3; }
.td-row.cur { color: var(--accent-text); font-weight: 600; }
.td-row.cur .td-box { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); }
.td-row.done, .td-row.skipped, .td-row.dim { color: var(--muted); }
.td-row.done .td-box { border-color: var(--done-solid); background: var(--done-solid); color: var(--on-done); }
.td-row.skipped .td-label { text-decoration: line-through; }
/* D-08q (4): «From earlier days» and «If you have time» - quiet folded rows, never a warning colour */
.td-row.fold, .td-row.folded { color: var(--muted); }
.td-row.folded { padding-left: 14px; }
.td-fold { border: 0; }
.td-fold .ico { width: 14px; height: 14px; stroke-width: 2.4; transition: transform .15s; }
.td-row.fold[aria-expanded="true"] .td-fold .ico { transform: rotate(90deg); }
.td-now h2 .td-check { display: inline-flex; vertical-align: middle; margin-left: 10px; color: var(--accent); }
.td-now h2 .td-check .ico { width: 24px; height: 24px; stroke-width: 3; }
.td-score { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 6px 0;
  border-top: 1px solid var(--surface-line); }
.td-score:first-child { border-top: 0; }

/* layout */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1100px; margin: 0 auto; padding: 8px 20px; display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px 20px; }
.brand { font-weight: 700; font-size: 16px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 8px; color: var(--ink-2);
  text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--link); }
.page { max-width: 880px; margin: 0 auto; padding: 24px 20px 48px; display: flex; flex-direction: column; gap: 18px; }
.page.wide { max-width: 1100px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack.tight { gap: 4px; }

/* blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.card.main { border-color: var(--accent-line); padding: 22px 24px; }
.note { border: 1px solid var(--note-line); background: var(--note-bg); border-radius: 10px; padding: 12px 14px; }
.warn { border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px;
  padding: 12px 14px; }
.bad { border: 1px solid var(--bad-line); background: var(--bad-bg); color: var(--bad-ink); border-radius: 10px;
  padding: 12px 14px; }
.ok { background: var(--ok-bg); color: var(--ok-ink); border-radius: 10px; padding: 12px 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  background: var(--chip); color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.chip.blue { background: var(--accent-soft); color: var(--accent-text); }
/* a chip with a long name (a practice target «Детерминативы и квантификаторы (Determiners and quantifiers)») wraps
   inside the page instead of pushing it sideways on a phone */
.chip.wrap { white-space: normal; max-width: 100%; min-width: 0; overflow-wrap: anywhere; }
.chip.warn { background: var(--warn-chip); color: var(--warn-ink); border: 0; padding: 2px 10px; }
.chip.bad { background: var(--bad-bg); color: var(--bad-ink); border: 0; padding: 2px 10px; }
.chip.ok { background: var(--ok-bg); color: var(--ok-ink); padding: 2px 10px; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 6px;
  border-radius: 6px; background: var(--chip); font-weight: 600; font-size: 13px; color: var(--ink-2); }

/* lists */
.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  overflow: hidden; }
.item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 16px;
  border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item.link { cursor: pointer; }
.item.link:hover { background: var(--hover); }
.item.dim { color: var(--muted); }
.item .grow { flex: 1 1 220px; min-width: 0; }

/* buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px;
  border-radius: 8px; border: 1px solid var(--btn-line); background: var(--btn-bg); color: var(--ink); font: inherit;
  font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--btn-hover); color: var(--ink); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.big { min-height: 48px; padding: 0 24px; font-size: 16px; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.danger { color: var(--bad-ink); border-color: var(--bad-line); }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--ink); border: 1px solid var(--field-line); border-radius: 8px;
  padding: 8px 10px; background: var(--card); }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
textarea { min-height: 80px; resize: vertical; }

/* the task of Writing (as in the exam) */
.task { display: flex; flex-direction: column; gap: 12px; }
.task-title { font-size: 14px; font-weight: 700; letter-spacing: .06em; }
.task-box { border: 1px solid var(--ink); padding: 14px 16px; font-weight: 600; font-style: italic; line-height: 1.55;
  white-space: pre-line; }
.task img { max-width: 100%; height: auto; border: 1px solid var(--line); }

/* the writing screen */
body.exam { background: var(--exam-bg); }
.exambar { background: var(--bar-bg); color: var(--bar-ink); border-bottom: 1px solid var(--bar-line); }
.exambar-in { max-width: 1280px; margin: 0 auto; padding: 8px 20px; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 8px 20px; }
.exambar .sub { font-size: 13px; color: var(--bar-sub); }
.timer { font-family: var(--mono); font-size: 26px; font-weight: 500; }
.timer.low { color: var(--timer-low); }
.write-msgs { max-width: 1280px; margin: 10px auto 0; padding: 0 20px; display: flex; flex-direction: column;
  gap: 8px; }
.write-msgs:empty { display: none; }
.write { max-width: 1280px; margin: 0 auto; padding: 16px 20px 24px; display: flex; flex-wrap: wrap; gap: 16px; }
.write .left { flex: 1 1 340px; min-width: 0; background: var(--card); border: 1px solid var(--frame-line); border-radius: 6px;
  height: calc(100vh - 130px); min-height: 420px; overflow: auto; padding: 20px 22px; }
.write .right { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.editor { width: 100%; height: calc(100vh - 160px); min-height: 400px; border: 1px solid var(--frame-line); border-radius: 6px;
  padding: 18px 20px; font-family: var(--font); font-size: 16px; line-height: 1.7; resize: none; background: var(--card); }
.essay-text { white-space: pre-wrap; line-height: 1.7; font-size: 16px; }

/* the digital Reading test (D-058): the passage left, the questions right, the question panel below */
.rtest { --rfs: 16px; display: flex; flex-direction: column; height: 100vh; }
.btn.small.dark { background: transparent; border-color: var(--bar-btn-line); color: var(--bar-ink); }
.btn.small.dark:hover { background: var(--bar-btn-hover); }
.btn.small.dark:disabled { opacity: .4; }
.timer.blink { animation: rt-blink 1s steps(2, start) 10; }
@keyframes rt-blink { 50% { color: var(--timer-blink); opacity: .25; } }
.rt-msgs { padding: 8px 20px 0; display: flex; flex-direction: column; gap: 8px; }
.rt-msgs:has(> .hidden:first-child + .hidden:last-child) { display: none; }
.rt-strip { padding: 6px 20px; font-size: 14px; color: var(--muted); }
.rt-strip b { color: var(--ink); }
.rt-main { flex: 1 1 auto; min-height: 0; display: flex; gap: 0; margin: 0 20px; border: 1px solid var(--frame-line);
  border-radius: 6px; overflow: hidden; background: var(--card); }
.rt-left, .rt-right { flex: 1 1 50%; min-width: 0; overflow: auto; padding: 18px 24px 40px; font-size: var(--rfs);
  line-height: 1.6; }
.rt-left { border-right: 4px solid var(--split-line); }
.rt-left:focus-visible, .rt-right:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.rp-part { font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.rp-intro { font-style: italic; color: var(--muted); margin: 6px 0 12px; }
.rp-title { font-size: calc(var(--rfs) * 1.35); margin: 8px 0 4px; }
.rp-sub { font-style: italic; margin-bottom: 8px; }
.rp-para { margin: 0 0 .9em; }
.rp-para.lettered { position: relative; padding-left: 1.8em; }
.rp-letter { position: absolute; left: 0; top: 0; font-weight: 700; }
.rp-drop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.rp-drop select { min-width: 0; }
.rp-foot { border-top: 1px solid var(--line); padding-top: 8px; font-size: .88em; color: var(--muted); }
.rq-group { border-bottom: 1px solid var(--line); padding: 0 0 18px; margin: 0 0 18px; display: flex;
  flex-direction: column; gap: 8px; }
.rq-group:last-child { border-bottom: 0; }
.rq-head { font-size: calc(var(--rfs) * 1.05); }
.rq-instr { margin: 0; }
.rq-title { font-weight: 700; text-align: center; }
.rq-sub { font-weight: 700; margin-top: 4px; }
.rq-par { line-height: 2; }
.rq-bullets { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 4px; line-height: 1.9; }
.rq-table { border-collapse: collapse; width: 100%; }
.rq-table th, .rq-table td { border: 1px solid var(--line-strong); padding: 6px 8px; text-align: left; vertical-align: top;
  line-height: 1.8; }
.rq-table th { background: var(--surface-quiet); font-weight: 600; }
.rq-table.grid thead th { text-align: center; }
.rq-line.bullet::before { content: "• "; }
.rq-line.dash { padding-left: 1.2em; }
.rq-line.dash::before { content: "– "; }
.rq-flow { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rq-step { border: 1px solid var(--line-strong); border-radius: 4px; padding: 6px 12px; width: 100%; max-width: 560px;
  text-align: center; line-height: 1.9; }
.rq-arrow { color: var(--muted); line-height: 1; }
.rq-list { border: 1px solid var(--line-strong); border-radius: 4px; padding: 8px 12px; display: flex;
  flex-direction: column; gap: 2px; }
.rq-list-title { font-weight: 700; margin-bottom: 2px; }
.rq-opt { display: flex; gap: 10px; }
.rq-opt .key, .choice .key { font-weight: 700; min-width: 1.6em; }
.rq-item { display: flex; flex-direction: column; gap: 6px; padding: 4px 6px; border-radius: 6px; line-height: 1.9; }
.rq-item.inline { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.rq-item.inline > .rq-stem { flex: 1 1 14em; min-width: 0; }
.rq-item.sent { display: block; }
.rq-item > .qn { align-self: flex-start; }
.rq-item.flash { background: var(--flash); }
.rq-q { display: flex; gap: 8px; align-items: baseline; }
.qn { display: inline-flex; align-items: center; justify-content: center; min-width: 1.9em; height: 1.6em; padding: 0 4px;
  border: 1px solid var(--ink); border-radius: 3px; font-size: .85em; font-weight: 700; line-height: 1; flex: 0 0 auto;
  margin-right: 4px; }
.choices { display: flex; flex-direction: column; gap: 2px; padding-left: 2.2em; }
.choice { display: flex; align-items: baseline; gap: 8px; padding: 2px 6px; border-radius: 4px; cursor: pointer; }
.choice:hover { background: var(--hover-2); }
.choice input { margin: 0; flex: 0 0 auto; transform: translateY(1px); }
input.gap { width: 10em; max-width: 100%; padding: 1px 6px; border-radius: 3px; font-size: inherit; line-height: 1.5;
  border: 1px solid var(--gap-line); text-align: center; }
input.gap::placeholder { color: var(--gap-ph); font-weight: 700; }
select.gap-select, select.rq-pick { padding: 1px 4px; border-radius: 3px; font-size: inherit; border: 1px solid var(--gap-line);
  max-width: 100%; }
.rt-nav { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 20px;
  background: var(--foot-bg); border-top: 1px solid var(--foot-line); margin-top: 8px; }
.rt-nav-parts { display: flex; flex-wrap: wrap; gap: 6px 16px; flex: 1 1 auto; min-width: 0; }
.rt-nav-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.rt-nav-part { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.rt-part-btn { border: 0; background: none; font: inherit; font-weight: 600; cursor: pointer; padding: 2px 4px;
  color: var(--muted); }
.rt-nav-part.on .rt-part-btn { color: var(--ink); }
.rt-part-count { font-size: 12px; color: var(--muted); margin-right: 4px; }
.rt-nav-part:not(.on) .rt-nums { display: none; }
.rt-nums { display: flex; flex-wrap: wrap; gap: 3px; }
.qnum { min-width: 30px; height: 30px; padding: 0 4px; border: 1px solid var(--line-strong); border-radius: 4px;
  background: var(--card); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.qnum.answered { background: var(--q-done); border-color: var(--q-done); color: var(--on-q-done); }
.qnum.flag { border-radius: 999px; box-shadow: inset 0 0 0 2px var(--q-flag); }
.qnum.cur { outline: 2px solid var(--accent); outline-offset: 1px; }
.rt-review { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }
.rt-review-q { font-weight: 400; color: var(--muted); min-width: 1.5em; }
mark.hl { background: var(--hl); color: inherit; padding: 0; border-radius: 2px; cursor: pointer; }
mark.hl.has-note { border-bottom: 2px dotted var(--hl-note); }
.hl-menu { position: fixed; z-index: 40; display: flex; gap: 2px; padding: 4px; background: var(--inv-bg); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(var(--shade), .25); }
.hl-menu button { border: 0; background: none; color: var(--inv-ink); font: inherit; font-size: 13px; padding: 6px 10px;
  border-radius: 6px; cursor: pointer; }
.hl-menu button:hover, .hl-menu button:focus-visible { background: var(--inv-hover); }
.hl-note { position: fixed; z-index: 41; width: min(340px, calc(100vw - 16px)); display: flex; flex-direction: column;
  gap: 8px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: 0 6px 20px rgba(var(--shade), .2); }
.hl-note textarea { min-height: 70px; }

/* Word Hub: a typed answer beside the right one, letter by letter */
.sp-bad { color: var(--bad-ink); background: var(--bad-bg); border-radius: 2px; }
.sp-miss { color: var(--ok-ink); background: var(--ok-bg); border-radius: 2px; text-decoration: underline; }

/* D-07z: «+ Word Hub» of a selection on any page of the student and the note of what it did */
.wsel { position: fixed; z-index: 45; border: 0; background: var(--inv-bg); color: var(--inv-ink); font: inherit; font-size: 13px;
  padding: 6px 12px; border-radius: 999px; box-shadow: 0 4px 16px rgba(var(--shade), .25); cursor: pointer; }
.wsel:hover, .wsel:focus-visible { background: var(--inv-hover); }
.wsel-note { position: fixed; z-index: 46; left: 50%; bottom: 20px; transform: translateX(-50%); max-width: calc(100vw - 32px);
  padding: 8px 14px; border-radius: 8px; background: var(--inv-bg); color: var(--inv-ink); font-size: 14px;
  box-shadow: 0 6px 20px rgba(var(--shade), .25); }
.wsel-note.bad { background: var(--bad-solid); color: var(--on-solid); }

/* the result of a digital Reading test (L1-L3): the answers in their places and a table per group */
.rr { --rfs: 16px; display: flex; flex-direction: column; gap: 12px; }
.rr-main { margin: 0; height: calc(100vh - 300px); min-height: 440px; }
.ans { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border-radius: 4px; border: 1px solid;
  font-weight: 600; line-height: 1.5; }
.ans.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-line); }
.ans.bad { background: var(--bad-bg); color: var(--bad-ink); border-color: var(--bad-line); }
.ans .qn { font-size: .72em; height: 1.4em; min-width: 1.6em; margin-right: 2px; border-color: currentColor; }
.choices.result .choice { cursor: default; }
.choices.result .choice:hover { background: none; }
.choices.result .choice.right { background: var(--ok-bg); }
.choices.result .choice.chosen:not(.right) { background: var(--bad-bg); }
.pick-mark { display: inline-block; width: 1.1em; font-weight: 700; }
.choice .chip { margin-left: 6px; font-family: var(--font); font-size: 12px; }
.rr-table { width: 100%; border-collapse: collapse; font-family: var(--font); font-size: 14px; line-height: 1.45;
  margin-top: 4px; }
.rr-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 2px 6px; }
.rr-table td { border-top: 1px solid var(--line); padding: 5px 6px; vertical-align: top; }
.rr-q { font-weight: 700; width: 2.2em; }
.rr-mark { font-weight: 700; width: 1.4em; }
.rr-row.ok .rr-mark { color: var(--ok-ink); }
.rr-row.bad .rr-mark { color: var(--bad-ink); }
.rr-row.bad { background: var(--bad-row); }
.only-wrong .rr-row.ok { display: none; }
.rr-table td { overflow-wrap: anywhere; }
.rr mark.hl { cursor: default; }
.rr-notes { border-top: 1px solid var(--line); padding-top: 8px; font-family: var(--font); font-size: 14px; }
.item.link:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* the teacher's week */
.week { display: flex; flex-direction: column; gap: 12px; }
.day { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px; }
.day.today { border-color: var(--accent); }
.day.rest { background: var(--surface-quiet); }
.task-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 0;
  border-top: 1px dashed var(--line); }
.task-row:first-of-type { border-top: 0; }
.task-row .grow { flex: 1 1 260px; min-width: 0; }
.task-row.dim { color: var(--muted); }
.panel { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface-dim);
  display: flex; flex-direction: column; gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; }
.pick { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.pick .item { padding: 8px 12px; }
.pick .item.on { background: var(--accent-soft); }

/* the check of an essay */
.review { display: grid; grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); gap: 16px; align-items: start; }
.marked mark { padding: 0 1px; border-radius: 3px; cursor: pointer; color: inherit; }
.c-TR, .c-TA { background: var(--c-tr); }
.c-CC { background: var(--c-cc); }
.c-LR { background: var(--c-lr); }
.c-GRA { background: var(--c-gra); }
.c-X { background: var(--c-x); }
.err { border-top: 1px solid var(--line); padding: 8px 0; display: flex; flex-direction: column; gap: 4px; }
.err.dim { color: var(--muted); }
.err.flash { background: var(--flash); }

/* the student's review (S2 stages 3-8) */
.review .essay-col { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.marked { font-size: 16px; line-height: 1.9; }
.marked mark { padding: 1px 2px; }
.pno { font-size: 11px; font-weight: 700; margin-right: 2px; line-height: 0; }
.pmark { display: inline-block; padding: 0 8px; margin-right: 6px; border-radius: 6px; font-family: var(--font);
  font-size: 12px; font-weight: 600; line-height: 1.6; cursor: pointer; }
mark.flash, .pmark.flash, .place.flash { outline: 3px solid var(--accent); }
.place { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px; }
.place.open { border-color: var(--accent-line); }
.place.dim { background: var(--surface-dim); }
.ctx { font-size: 15px; line-height: 1.6; }
.frag { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 600; }
textarea.answer { min-height: 0; width: 100%; font-size: 15px; line-height: 1.5; }
textarea.answer.big { min-height: 150px; }
textarea.answer:disabled { background: var(--bg); color: var(--muted); }
.variant { font-style: italic; }
.linkish { border: 0; background: none; padding: 0; color: var(--link); font: inherit; cursor: pointer; text-align: left; }
.linkish:hover { text-decoration: underline; }
.fix-grid { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; align-items: baseline; }
.pre { white-space: pre-wrap; }
ul.plain { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
details.fold { border-top: 1px solid var(--line); padding: 8px 0; }
details.fold summary { cursor: pointer; font-weight: 600; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { min-height: 44px; padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: none;
  color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; }
.tabs button.on { color: var(--link); border-bottom-color: var(--accent); }
/* the steps of a Writing work (V2 Q2): done green, the open one blue, the rest quiet */
.path { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 6px; }
.path-step { display: flex; flex-direction: column; gap: 2px; min-height: 52px; padding: 7px 10px; text-align: left;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--muted); font: inherit; }
button.path-step { cursor: pointer; }
.path-step .path-name { font-weight: 600; font-size: 14px; }
.path-step .path-note { font-size: 12px; }
.path-step.done { background: var(--done-bg); color: var(--done-ink); border-color: var(--done-bg); }
.path-step.now, .path-step.open { color: var(--ink); border-color: var(--line-strong); }
.path-step.on { border: 2px solid var(--accent); padding: 6px 9px; background: var(--accent-soft); color: var(--accent-text); }
/* a report card folded under «Подробности разбора»: the fold's summary is its title, no card inside a card */
details.card > section.card { border: 0; padding: 0; margin-top: 10px; }
details.card > section.card > h2:first-child { display: none; }
/* «Улучши язык» (V2 Q3): one kind of sentence lit at a time, the rest pale; the colour always has its words */
.lg { border-radius: 4px; padding: 1px 0; }
.lg.dim { opacity: .55; }                  /* still AA on the dark shell (5:1) */
.lg-good:not(.dim) { background: var(--ok-bg); }
.lg-plain:not(.dim) { background: var(--lg-plain); cursor: pointer; }
.lg-unnatural:not(.dim) { background: var(--warn-bg); cursor: pointer; }
.lg-unclear:not(.dim), .lg-overdone:not(.dim) { background: var(--lg-unclear); cursor: pointer; }
.lg-error:not(.dim) { text-decoration: underline wavy var(--bad-line); }
.lg-item { border-top: 1px solid var(--line); padding-top: 10px; }
.lg-quote { font-style: italic; }
.lg-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--card); }
/* a criterion with its official band descriptors (V2 Q5) */
.crit-row { border-top: 1px solid var(--line); padding: 6px 0; }
.crit-row summary { cursor: pointer; }
.crit-row summary .chip { margin-left: 8px; }
.crit-row > div { margin-top: 6px; }
/* the ladder of a practice set (V2 Q4) */
.ladder { gap: 6px; flex-wrap: wrap; }
.side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.big-num { font-size: 22px; }

/* the teacher's «Ввод работ» and «Диагностика» */
.editor-small { width: 100%; min-height: 220px; font-size: 15px; line-height: 1.6; }
.strike { text-decoration: line-through; }
.item .wide-row { flex: 1 1 100%; }
.item .wide-row:empty { display: none; }
.band-in { width: 76px; }
.level-name { min-width: 90px; }

/* the teacher's «Обзор» */
.overview { display: grid; grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); gap: 18px; align-items: start; }
.why-label { min-width: 84px; }

/* writing home: the Writing tab of the student (home, library, start page, history, progress v0) */
.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 14px; border-bottom: 2px solid transparent;
  color: var(--muted); font-weight: 500; text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--link); border-bottom-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg button { min-height: 34px; padding: 0 12px; border: 0; border-left: 1px solid var(--line-strong); background: var(--card);
  color: var(--ink); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--accent-soft); color: var(--accent-text); }
.seg button:disabled { color: var(--muted); cursor: default; }
.chip.star { background: var(--star-bg); color: var(--star-ink); }
.lib-rec { border-color: var(--rec-line); }
.lib-book { padding: 12px 16px; }
.lib-book > summary { cursor: pointer; }
.lib-test { margin-top: 10px; }
.mode-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.mode-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
.mode-card:hover { border-color: var(--line-strong); }
.mode-card.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mode-card.off { background: var(--surface-dim); color: var(--muted); cursor: default; }
.mode-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.item.sub { padding-left: 32px; background: var(--surface-dim); }
.bad-text { color: var(--bad-ink); }
ol.plain { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }

/* the workspace of a free work and of a rewrite (§A.5, §A.10) */
.write .left.stack { gap: 14px; }
.write .left.stack > * { flex-shrink: 0; }
.supports .plan-line { font-weight: 500; line-height: 1.6; }
textarea.notes { width: 100%; min-height: 120px; margin-top: 8px; font-size: 14px; line-height: 1.5; }
.brief { border: 1px solid var(--note-line); background: var(--note-bg); border-radius: 8px; padding: 12px 14px; }

@media (max-width: 900px) {
  html:has(.rtest) { scroll-padding-top: 120px; scroll-padding-bottom: 140px; }
  .rtest { height: auto; min-height: 100vh; }
  .rt-top { position: sticky; top: 0; z-index: 30; background: var(--exam-bg); padding-bottom: 6px; }
  .rr-main { height: auto; }
  .rt-main { flex-direction: column; margin: 0 8px; overflow: visible; }
  .rt-left, .rt-right { overflow: visible; padding: 14px 14px 24px; }
  .rt-left { border-right: 0; border-bottom: 4px solid var(--split-line); }
  .rt-nav { position: sticky; bottom: 0; padding: 6px 8px; }
  .rt-msgs, .rt-strip { padding-left: 8px; padding-right: 8px; }
  .review { grid-template-columns: 1fr; }
  .review .essay-col { position: static; max-height: none; }
  .overview { grid-template-columns: 1fr; }
  .side { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .page { padding: 16px 12px 40px; }
  .card { padding: 14px 14px; }
  .write .left { height: auto; }
  .editor { height: 60vh; }
}

/* P4c */
/* report: «Обзор (AI)», «Разбор» of the Writing module (§A.7, §A.8) */
.ov-card { border-color: var(--accent-line); }
.ov-sub { padding-left: 18px; }
.warn-text { color: var(--warn-ink); }
.marked mark.lim { text-decoration: underline dotted; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.marked mark.maybe { outline: 1px dashed var(--line-strong); outline-offset: 1px; }
.mk-row { border-top: 1px solid var(--line); padding: 8px 0; }
.mk-row > summary { cursor: pointer; }
.mk-row > summary .row.mk-sum { display: inline-flex; vertical-align: middle; }
.mk-row .mk-body { padding: 6px 0 2px 36px; }
.mk-row.flash { background: var(--flash); }
ol.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 14px; }
label.tight-row { gap: 6px; cursor: pointer; }
/* revision: the result of a rewrite (§A.10) */
.rv-group { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.rv-group:first-child { border-top: 0; padding-top: 0; }
.rv-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.rv-item { display: flex; flex-direction: column; gap: 2px; padding-left: 12px; }
/* practice: a practice set (§A.9) */
.rule-card { border-color: var(--accent-line); background: var(--note-bg); }
.pitem.final { background: var(--surface-dim); }
.pitem:target, .pitem.flash { outline: 3px solid var(--accent); }
.ptext { font-size: 16px; line-height: 1.7; }
.ptext input.gap { margin: 0 4px; min-width: 120px; }
mark.pm { background: var(--hl); color: inherit; padding: 0 2px; border-radius: 3px; }
.key-box { border-left: 3px solid var(--ok-ink); padding: 4px 0 4px 12px; }
.choices.pchoices { padding-left: 0; gap: 4px; }
.choices.pchoices .choice { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
ol.order-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
ol.order-list li { display: flex; align-items: center; gap: 8px; }
ol.order-list li .grow { flex: 1 1 auto; min-width: 0; }
.ptable { border-collapse: collapse; font-size: 14px; }
.ptable th, .ptable td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; }
@media (max-width: 640px) {
  .mk-row .mk-body { padding-left: 0; }
  .ptext input.gap { min-width: 90px; }
}

/* Word Hub (ui/student/words.js; Writing V2 W, D-07t) */
.big-line { font-size: 17px; line-height: 1.7; }
span.wh-gap { display: inline-block; min-width: 5em; height: 1.1em; margin: 0 4px; vertical-align: baseline;
  border-bottom: 2px solid var(--muted); }
input.wh-answer { width: 100%; max-width: 420px; font-size: 16px; padding: 6px 10px; }
.row.wrap { flex-wrap: wrap; }
.item.wh-item { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
/* the portal's students (D-08u): a student a row, the one open now marked */
.item.st-item { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
.item.st-item.on { background: var(--accent-soft); }

/* The AI version beside the student's own (ui/student/review.js aiVersion; Writing V2 Q6, D-07u) */
.av-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; align-items: start; }
.av-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.av-cell { border-top: 1px solid var(--line); padding-top: 8px; }
.av-cell::before { content: attr(data-label); display: none; font-weight: 700; font-size: 13px; color: var(--muted); }
.av-no { display: block; width: fit-content; margin-bottom: 4px; }
mark.av-ins { background: var(--av-ins); color: inherit; border-radius: 3px; padding: 0 1px; }
del.av-del { background: var(--av-del); color: var(--av-del-ink); text-decoration-thickness: 1px; border-radius: 3px; padding: 0 1px; }
@media (max-width: 720px) {
  .av-grid, .av-grid.three { grid-template-columns: minmax(0, 1fr); }
  .av-head { display: none; }
  .av-cell::before { display: block; margin-bottom: 2px; }
}

/* Word Hub v2 (ui/student/words.js; D-07v): the practice buttons, the plain list, 🔊 */
.wh-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.wh-mode { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card); color: inherit; text-decoration: none; }
.wh-mode b { font-size: 18px; }
.wh-mode .small { color: var(--muted); }
a.wh-mode:hover { border-color: var(--accent); }
.wh-mode.primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.wh-mode.primary .small { color: var(--accent-ink-2); }
a.wh-mode.primary:hover { background: var(--accent-hover); }
.wh-mode.off { opacity: 0.55; }
.wh-list { display: flex; flex-direction: column; padding: 4px 0; }
.wh-row { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; padding: 10px 18px; color: inherit;
  text-decoration: none; border-top: 1px solid var(--line); }
.wh-row:first-child { border-top: 0; }
.wh-row:hover { background: var(--hover); }
.wh-head { margin: 0; }
button.say { border: 0; background: none; cursor: pointer; font-size: 16px; padding: 0 4px; line-height: 1; }
@media (max-width: 640px) {
  .wh-modes { grid-template-columns: minmax(0, 1fr); }
}
.row.nowrap { flex-wrap: nowrap; align-items: flex-start; }
details.wh-tr { font-size: 13px; color: var(--muted); }
details.wh-tr summary { cursor: pointer; width: fit-content; }
.wh-used { width: fit-content; }
/* Practice Lab (V2 Q7, D-07x): the offered topic in blue; a rule point - the right sentence green, the wrong red */
.lab-title { margin: 0; }
.lab-offer { border-color: var(--offer-line); background: var(--offer-bg); }
.lab-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.lab-step { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--muted); }
.lab-step.open { border: 2px solid var(--accent); padding: 3px 9px; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.lab-point + .lab-point { padding-top: 12px; border-top: 1px solid var(--line); }
.lab-right { color: var(--ok-ink); }
.lab-wrong { color: var(--bad-ink); }
.lab-was { color: var(--bad-ink); }
.lab-own { padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); }
.lab-step.done { border-color: var(--done-bg); background: var(--done-bg); color: var(--done-ink); }
.lab-step.skipped { text-decoration: line-through; }
.lab-check { border-color: var(--offer-line); }
.lab-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.lab-opts.whole { flex-direction: column; align-items: stretch; }
.lab-opts.whole .lab-opt { justify-content: flex-start; text-align: left; white-space: normal; min-height: 44px; padding: 8px 14px; }
.lab-opt { min-width: 64px; }
.lab-opt.right { border-color: var(--ok-ink); background: var(--ok-bg); color: var(--ok-ink); opacity: 1; }
.lab-opt.wrong { border-color: var(--bad-ink); background: var(--bad-bg); color: var(--bad-ink); opacity: 1; }
.lab-gap { display: inline-block; min-width: 3em; border-bottom: 2px solid var(--ink); }
.lab-cue { padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
.lab-point.missed { padding-left: 10px; border-left: 3px solid var(--warn-line); }
.lab-fold { padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.lab-fold > summary { cursor: pointer; font-weight: 600; }
.lab-fold > section.card { border: 0; padding: 0; margin-top: 16px; background: transparent; box-shadow: none; }
