/* Imtihon — design tokens ------------------------------------------------- */
:root {
  color-scheme: light;
  --canvas: #f3f5fb; --surface: #ffffff; --surface-2: #eceffa; --text: #141a33; --muted: #566080;
  --line: #dde2f0; --control: #8b94b3;
  --primary: #4338ca; --primary-hover: #3730a3; --on-primary: #ffffff; --primary-soft: #e8e7fd; --focus: #4338ca;
  --success: #0b7a53; --success-soft: #dcf4e9; --warning: #8f5400; --warning-soft: #fff0cf;
  --danger: #b0213f; --danger-soft: #fde5ea;
  --scrim: #0e112199; --shadow: 0 1px 2px #141a330d, 0 4px 14px #141a3310;
  --hero: linear-gradient(135deg, #e8e7fd 0%, #f3f5fb 70%);
  --radius: 16px; --radius-sm: 12px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px;
  --gutter: var(--space-4);
  --top: max(env(safe-area-inset-top, 0px), var(--client-top, 0px));
  --bottom: max(env(safe-area-inset-bottom, 0px), var(--client-bottom, 0px));
  --left: max(env(safe-area-inset-left, 0px), var(--client-left, 0px));
  --right: max(env(safe-area-inset-right, 0px), var(--client-right, 0px));
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  scroll-padding-block: calc(var(--top) + 12px) calc(var(--bottom) + 96px);
  -webkit-text-size-adjust: 100%;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0e1121; --surface: #171b30; --surface-2: #20253f; --text: #eef0fa; --muted: #a6aecb;
  --line: #2b3151; --control: #6f7899;
  --primary: #8b87ff; --primary-hover: #a09dff; --on-primary: #14123a; --primary-soft: #2a2b5c; --focus: #b4b1ff;
  --success: #6fd6a6; --success-soft: #153a2d; --warning: #ffcf7a; --warning-soft: #3b2e17;
  --danger: #ff9db0; --danger-soft: #45202b;
  --scrim: #000000a6; --shadow: 0 1px 2px #0006, 0 4px 14px #0004;
  --hero: linear-gradient(135deg, #25275a 0%, #171b30 75%);
}

/* Base --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--text); font-size: 1rem; line-height: 1.5; }
main {
  display: flex; flex-direction: column; gap: var(--space-4); max-width: 34rem; margin-inline: auto;
  min-height: var(--settled-height, 100svh);
  padding: calc(var(--top) + 12px) calc(var(--right) + var(--gutter)) calc(var(--bottom) + 24px) calc(var(--left) + var(--gutter));
}
main:focus { outline: none; }
h1, h2, h3, p, dl, dd, ul, ol { margin: 0; overflow-wrap: anywhere; }
ul, ol { padding: 0; list-style: none; }
h1 { font-size: 1.5rem; line-height: 1.2; letter-spacing: -.015em; text-wrap: balance; }
h2 { font-size: 1.1875rem; line-height: 1.3; }
h3 { font-size: 1rem; }
a { color: var(--primary); }
small, .subject { color: var(--muted); font-size: .875rem; line-height: 1.45; }
.count, .timer, .score, .ring-label { font-variant-numeric: tabular-nums; }
.icon { flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.stack { display: grid; gap: var(--space-3); min-width: 0; align-content: start; }
.stack.tight { gap: var(--space-2); }
.split { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }

/* Shell -------------------------------------------------------------------- */
.masthead { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 44px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.125rem; letter-spacing: -.01em; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.chip-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text); text-decoration: none; font: inherit; font-size: .875rem; font-weight: 600;
}
.text-link { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 4px; font-weight: 600; }
.chip-link.back { align-self: flex-start; }
.wizard-masthead { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.wizard-masthead .masthead { flex: 1; }
.page-heading { display: grid; gap: var(--space-2); }

/* Surfaces ------------------------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4); box-shadow: var(--shadow); min-width: 0; }
.card.hero { background: var(--hero), var(--surface); border-color: transparent; padding: var(--space-5); display: grid; gap: var(--space-3); }
.card.hero h1 { font-size: 1.625rem; }
.eyebrow { justify-self: start; padding: 3px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.state-card { display: grid; justify-items: center; text-align: center; gap: var(--space-3); padding: var(--space-6) var(--space-4); }
.state-card > * { max-width: 100%; }
.state-card > button, .state-card > .button { width: 100%; }
.state-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--primary-soft); color: var(--primary); }
.state-icon.warn { background: var(--warning-soft); color: var(--warning); }
.state-icon.ok { background: var(--success-soft); color: var(--success); }
.check-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px 2px 8px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-weight: 600; }
.callout { display: flex; gap: var(--space-3); align-items: flex-start; }
.callout .stack { flex: 1; }
.card-list { display: grid; gap: var(--space-3); }
.notice { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--text); border: 1px solid transparent; }
.notice.error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); font-weight: 600; }
.save-banner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.save-banner span { display: inline-flex; align-items: center; gap: 8px; }
.save-banner button { min-height: 40px; }

/* Controls ------------------------------------------------------------------ */
button, select, input, .button {
  min-width: 0; min-height: 48px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 16px;
  color: var(--text); background: var(--surface); font: inherit; line-height: 1.4; overflow-wrap: anywhere;
}
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; text-align: center; text-decoration: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:not(:disabled), select:not(:disabled), summary { cursor: pointer; }
button, .button, .answer-cell, .tile-link { transition: background-color 120ms, border-color 120ms, transform 80ms, box-shadow 120ms; }
button:not(:disabled):active, .button:active, .tile-link:active { transform: scale(.98); }
@media (hover: hover) {
  button:not(:disabled):not(.primary):hover, .button:not(.primary):hover { background: var(--surface-2); }
  .primary:not(:disabled):hover { background: var(--primary-hover); }
}
:where(button, select, input, a, summary, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.primary.large { min-height: 56px; font-size: 1.0625rem; border-radius: 14px; }
button:disabled { color: var(--muted); background: var(--surface-2); border-color: var(--line); opacity: .75; }
.primary:disabled { background: var(--surface-2); color: var(--muted); }
.quiet { border-color: transparent; background: transparent; color: var(--primary); }
.full { width: 100%; }
input, select { width: 100%; background: var(--canvas); }
input:focus, select:focus { border-color: var(--primary); background: var(--surface); }
.form-field { display: grid; gap: 6px; min-width: 0; font-weight: 600; font-size: .9375rem; }
.form-field :is(input, select) { font-weight: 400; font-size: 1rem; }
[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-soft); }
.field-error { color: var(--danger); font-weight: 600; }
.field-stack { display: grid; gap: var(--space-4); min-width: 0; }
.field-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.variants, .actions { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.action-grid.sticky { margin-top: auto; position: sticky; bottom: calc(var(--bottom) + 8px); padding: var(--space-2); border-radius: 18px; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.segmented button { min-height: 40px; border: 0; background: transparent; padding-inline: 8px; font-size: .875rem; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.appearance { display: grid; gap: var(--space-2); }
.appearance-label { font-weight: 600; font-size: .875rem; color: var(--muted); }

/* Loading ------------------------------------------------------------------- */
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 48px 0; color: var(--muted); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--primary); animation: spin .8s linear infinite; }
.spinner.big { width: 44px; height: 44px; border-width: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }
main[data-boot] { align-content: center; justify-items: center; color: var(--muted); }

/* Home tiles ---------------------------------------------------------------- */
.tile-link {
  display: flex; align-items: center; gap: var(--space-3); min-height: 64px; padding: var(--space-3) var(--space-4); border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text); text-decoration: none;
}
.tile-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); }
.tile-copy { display: grid; flex: 1; min-width: 0; }
.tile-copy small { color: var(--muted); }
.tile-arrow { color: var(--muted); }
.tile-link.primary-tile { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.tile-link.primary-tile .tile-icon { background: #ffffff26; color: var(--on-primary); }
.tile-link.primary-tile .tile-arrow { color: var(--on-primary); }

/* Exam ---------------------------------------------------------------------- */
.exam-header { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); position: sticky; top: 0; z-index: 2; margin-inline: calc(var(--gutter) * -1); padding: calc(var(--top) * 0 + 4px) var(--gutter) var(--space-3); background: color-mix(in srgb, var(--canvas) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.exam-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.exam-title { min-width: 0; }
.exam-title h1 { font-size: 1.0625rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exam-title .subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; white-space: nowrap; }
.timer.warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.timer.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .65; } }
.progress-row { display: flex; align-items: center; gap: var(--space-3); }
.progress { flex: 1; display: block; appearance: none; height: 8px; border: 0; border-radius: 999px; overflow: hidden; background: var(--line); accent-color: var(--primary); }
.progress::-webkit-progress-bar { background: var(--line); }
.progress::-webkit-progress-value { background: var(--primary); border-radius: 999px; transition: width 200ms; }
.progress::-moz-progress-bar { background: var(--primary); border-radius: 999px; }
.progress-row .count { font-size: .8125rem; font-weight: 700; color: var(--muted); }
.question-sheet { display: grid; gap: var(--space-5); padding: var(--space-5) var(--space-4); }
.question-sheet h2 { font-size: 1.375rem; }
.question-sheet h2:focus { outline: none; }
.question-sheet .of { color: var(--muted); font-weight: 500; font-size: 1rem; }
.save-line { display: inline-flex; align-items: center; gap: 4px; min-height: 1.5rem; font-size: .8125rem; color: var(--muted); text-align: end; }
.save-line.saved { color: var(--success); font-weight: 600; }
.option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.option-grid.dense { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.answer-cell { min-height: 72px; border-radius: var(--radius); border-width: 2px; font-size: 1.5rem; font-weight: 700; padding: 0; }
.option-grid.dense .answer-cell { min-height: 60px; font-size: 1.25rem; }
.answer-cell[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 35%, transparent); }
.answer-cell[data-pending="true"] { opacity: .85; border-style: dashed; }
.answer-cell:disabled { opacity: .6; }
.action-bar {
  position: sticky; bottom: calc(var(--bottom) + 8px); z-index: 2; margin-top: auto; display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--space-2); padding: var(--space-2);
  border-radius: 20px; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); box-shadow: 0 8px 28px #141a3322; backdrop-filter: blur(12px);
}
.bar-button { min-height: 52px; border-radius: 14px; padding-inline: 8px; gap: 4px; white-space: nowrap; }
.bar-button.map { min-width: 76px; background: var(--surface-2); border-color: transparent; font-variant-numeric: tabular-nums; }
.countdown { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.countdown .timer { font-size: 1.25rem; border: 0; padding: 0; background: none; }
.facts { display: grid; gap: var(--space-2); }
.facts div { display: flex; justify-content: space-between; gap: var(--space-3); }
.facts dt { color: var(--muted); font-size: .875rem; }
.facts dd { font-weight: 600; text-align: end; }

/* Bottom sheet -------------------------------------------------------------- */
dialog.sheet {
  position: fixed; inset: auto 0 0 0; margin: 0 auto; width: min(100%, 34rem); max-width: 100%; max-height: calc(var(--visible-height, 100dvh) - var(--top) - 16px);
  padding: 8px var(--space-5) calc(var(--bottom) + var(--space-5)); border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0;
  color: var(--text); background: var(--surface); overflow: auto; overscroll-behavior: contain; box-shadow: 0 -12px 40px #0003; animation: sheet-up 180ms ease-out;
}
dialog.sheet[open] { display: grid; gap: var(--space-3); }
dialog.sheet::backdrop { background: var(--scrim); }
.sheet-grip { justify-self: center; width: 40px; height: 4px; border-radius: 999px; background: var(--line); margin-bottom: 4px; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: .6; } }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: var(--space-2); max-height: min(40vh, 320px); overflow: auto; overscroll-behavior: contain; padding: 4px; }
.map-cell { min-height: 48px; padding: 0; border-radius: 12px; font-variant-numeric: tabular-nums; }
.map-cell.saved { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.map-cell[aria-current] { border: 2px solid var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: .8125rem; color: var(--muted); }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); margin-inline-end: -6px; }
.dot.answered { background: var(--primary-soft); border-color: transparent; }
.dot.now { border: 2px solid var(--primary); }
.summary-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.tile { display: grid; gap: 2px; padding: var(--space-3); border-radius: var(--radius-sm); background: var(--surface-2); }
.tile strong { font-size: 1.75rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile span { font-size: .8125rem; color: var(--muted); }
.tile.good { background: var(--success-soft); }
.tile.good strong { color: var(--success); }
.tile.warn { background: var(--warning-soft); }
.tile.warn strong { color: var(--warning); }

/* Results & history --------------------------------------------------------- */
.tone-good { --tone: var(--success); --tone-soft: var(--success-soft); }
.tone-mid { --tone: var(--warning); --tone-soft: var(--warning-soft); }
.tone-low { --tone: var(--danger); --tone-soft: var(--danger-soft); }
.score-block { display: flex; align-items: center; gap: var(--space-5); }
.ring { position: relative; display: grid; place-items: center; width: 112px; height: 112px; flex: none; color: var(--tone, var(--primary)); }
.ring svg { position: absolute; inset: 0; }
.ring-track { fill: none; stroke: var(--line); stroke-width: 10; }
.ring-value { fill: none; stroke: currentColor; stroke-width: 10; stroke-linecap: round; }
.ring-label { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.score-copy { display: grid; gap: 2px; }
.score { font-size: 2rem; font-weight: 800; line-height: 1.1; color: var(--tone, var(--primary)); }
.history-items { display: grid; gap: var(--space-3); }
.history-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; color: var(--text); text-decoration: none; }
.history-entry .subject { grid-column: 1 / -1; }
.history-title { font-size: 1.0625rem; }
.history-score { padding: 2px 10px; border-radius: 999px; background: var(--tone-soft); color: var(--tone); font-weight: 800; font-variant-numeric: tabular-nums; }
.bar { grid-column: 1 / -1; display: block; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--tone); }
.bar i.w0 { width: 0%; }
.bar i.w1 { width: 5%; }
.bar i.w2 { width: 10%; }
.bar i.w3 { width: 15%; }
.bar i.w4 { width: 20%; }
.bar i.w5 { width: 25%; }
.bar i.w6 { width: 30%; }
.bar i.w7 { width: 35%; }
.bar i.w8 { width: 40%; }
.bar i.w9 { width: 45%; }
.bar i.w10 { width: 50%; }
.bar i.w11 { width: 55%; }
.bar i.w12 { width: 60%; }
.bar i.w13 { width: 65%; }
.bar i.w14 { width: 70%; }
.bar i.w15 { width: 75%; }
.bar i.w16 { width: 80%; }
.bar i.w17 { width: 85%; }
.bar i.w18 { width: 90%; }
.bar i.w19 { width: 95%; }
.bar i.w20 { width: 100%; }
.result-outcomes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.outcome { flex-direction: column; gap: 0; min-height: 64px; padding: 8px 4px; font-size: .8125rem; border-color: transparent; }
.outcome strong { font-size: 1.375rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.outcome.correct { color: var(--success); background: var(--success-soft); }
.outcome.wrong { color: var(--danger); background: var(--danger-soft); }
.outcome.unanswered { color: var(--muted); background: var(--surface-2); }
.outcome[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--primary); }
.outcome:disabled { opacity: .5; }
.answer-list { display: grid; gap: var(--space-2); }
.answer-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); padding: var(--space-3); border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--control); }
.answer-row.correct { border-inline-start-color: var(--success); }
.answer-row.wrong { border-inline-start-color: var(--danger); }
.answer-number { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); font-weight: 700; font-size: .875rem; font-variant-numeric: tabular-nums; }
.answer-detail { display: grid; gap: 2px; min-width: 0; font-size: .9375rem; }
.tag { display: inline-block; width: fit-content; border-radius: 999px; padding: 2px 10px; background: var(--surface-2); color: var(--muted); font-size: .75rem; font-weight: 700; }
.tag.correct { color: var(--success); background: var(--success-soft); }
.tag.wrong { color: var(--danger); background: var(--danger-soft); }
.tag.status-draft { color: var(--warning); background: var(--warning-soft); }
.tag.status-published { color: var(--primary); background: var(--primary-soft); }
.tag.live { color: var(--success); background: var(--success-soft); }
.pagination { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--space-2); align-items: center; }
.pagination > :last-child { justify-self: end; }
.exam-row-heading { align-items: flex-start; flex-wrap: wrap; }

/* Teacher ------------------------------------------------------------------- */
.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); }
.stepper li { display: grid; gap: 6px; min-width: 0; }
.step-bar { height: 5px; border-radius: 999px; background: var(--line); }
.stepper .done .step-bar, .stepper [aria-current] .step-bar { background: var(--primary); }
.step-name { font-size: .8125rem; color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepper [aria-current] .step-name { color: var(--primary); }
.teacher-question { padding-block: var(--space-3); border-top: 1px solid var(--line); }
.teacher-question:first-child { border-top: 0; }
.teacher-question h3:focus { outline: none; }
.summary-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: 8px 12px; }
.summary-grid dd { font-weight: 650; text-align: end; }
.key-review summary { min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--primary); }
.key-review ol { list-style: decimal; padding-inline-start: 28px; columns: 3; }
.invite { display: block; padding: var(--space-3); border-radius: var(--radius-sm); border: 1px dashed var(--control); background: var(--canvas); font-size: .875rem; overflow-wrap: anywhere; }
.success { border-color: color-mix(in srgb, var(--success) 40%, var(--line)); }

/* Accessibility ------------------------------------------------------------- */
.skip-link { position: fixed; inset-block-start: calc(var(--top) + 8px); inset-inline-start: calc(var(--left) + 12px); z-index: 5; padding: 12px; border-radius: 10px; background: var(--surface); clip-path: inset(50%); }
.skip-link:focus-visible { clip-path: none; }
.skip-link [lang] { display: none; }
html[lang="uz"] .skip-link [lang="uz"], html[lang="ru"] .skip-link [lang="ru"], html[lang="en"] .skip-link [lang="en"] { display: inline; }
@media (min-width: 420px) { .option-grid:not(.dense) { grid-template-columns: repeat(4, minmax(0, 1fr)); } .bar-text { display: inline; } }
@media (max-width: 359px) { .bar-text { display: none; } .score-block { flex-direction: column; align-items: flex-start; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media (forced-colors: active) { .answer-cell[aria-pressed="true"], .map-cell[aria-current] { outline: 3px solid Highlight; } }
