/* --- Internationalization Language Visibility --- */
html[data-lang="ru"] .i18n-en { display: none !important; }
html[data-lang="en"] .i18n-ru { display: none !important; }

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eaedf0;
  --ink: #1e252b;
  --ink-muted: #627079;
  --border: #d4d9de;
  --accent: #e95420; /* Canonical Ubuntu Orange */
  --accent-ink: #c23e0c;
  --accent-soft: rgba(233, 84, 32, 0.10);
  --accent-contrast: #ffffff;
  --canonical-aubergine: #77216f;
  --canonical-aubergine-soft: rgba(119, 33, 111, 0.12);
  --good: #248a53;
  --good-soft: rgba(36, 138, 83, 0.10);
  --bad: #cf332b;
  --bad-soft: rgba(207, 51, 43, 0.10);
  --warn: #c9820a;
  --warn-soft: rgba(201, 130, 10, 0.12);
  --code-bg: #14181c;
  --code-ink: #e5ecef;
  --shadow: 0 1px 3px rgba(18, 25, 30, 0.08);
  --shadow-lg: 0 4px 14px rgba(18, 25, 30, 0.12);
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111518;
    --surface: #191f24;
    --surface-2: #212930;
    --ink: #e6ebef;
    --ink-muted: #8d9ba3;
    --border: #2c363e;
    --accent: #ff6e3a;
    --accent-ink: #ffa480;
    --accent-soft: rgba(255, 110, 58, 0.15);
    --accent-contrast: #0f1315;
    --canonical-aubergine: #a5469b;
    --canonical-aubergine-soft: rgba(165, 70, 155, 0.2);
    --good: #49c57d;
    --good-soft: rgba(73, 197, 125, 0.14);
    --bad: #f05a50;
    --bad-soft: rgba(240, 90, 80, 0.14);
    --warn: #e5a42e;
    --warn-soft: rgba(229, 164, 46, 0.15);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 4px 18px rgba(0, 0, 0, 0.55);
  }
}

:root[data-theme="dark"] {
  --bg: #111518;
  --surface: #191f24;
  --surface-2: #212930;
  --ink: #e6ebef;
  --ink-muted: #8d9ba3;
  --border: #2c363e;
  --accent: #ff6e3a;
  --accent-ink: #ffa480;
  --accent-soft: rgba(255, 110, 58, 0.15);
  --accent-contrast: #0f1315;
  --canonical-aubergine: #a5469b;
  --canonical-aubergine-soft: rgba(165, 70, 155, 0.2);
  --good: #49c57d;
  --good-soft: rgba(73, 197, 125, 0.14);
  --bad: #f05a50;
  --bad-soft: rgba(240, 90, 80, 0.14);
  --warn: #e5a42e;
  --warn-soft: rgba(229, 164, 46, 0.15);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 4px 18px rgba(0, 0, 0, 0.55);
}

:root[data-theme="light"] {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eaedf0;
  --ink: #1e252b;
  --ink-muted: #627079;
  --border: #d4d9de;
  --accent: #e95420;
  --accent-ink: #c23e0c;
  --accent-soft: rgba(233, 84, 32, 0.10);
  --accent-contrast: #ffffff;
  --canonical-aubergine: #77216f;
  --canonical-aubergine-soft: rgba(119, 33, 111, 0.12);
  --good: #248a53;
  --good-soft: rgba(36, 138, 83, 0.10);
  --bad: #cf332b;
  --bad-soft: rgba(207, 51, 43, 0.10);
  --warn: #c9820a;
  --warn-soft: rgba(201, 130, 10, 0.12);
  --shadow: 0 1px 3px rgba(18, 25, 30, 0.08);
  --shadow-lg: 0 4px 14px rgba(18, 25, 30, 0.12);
}

* { box-sizing: border-box; }
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  zoom: 1.2;
}

.mono, code, pre, kbd {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Top Navigation Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
}

.topbar .crumb {
  font-family: ui-monospace, monospace;
  font-size: 13px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar .crumb a { color: var(--ink-muted); }
.topbar .crumb a:hover { color: var(--accent-ink); }
.topbar .crumb b { color: var(--ink); font-weight: 600; }
.topbar .spacer { flex: 1; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.navlink {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-muted);
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  white-space: nowrap;
  cursor: pointer;
  transition: all .15s ease;
}

.navlink:hover {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  text-decoration: none;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--ink-muted);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.theme-toggle:hover { color: var(--ink); background: var(--surface-2); }

/* Shell Layout */
.shell {
  display: flex;
  max-width: 1320px;
  margin: 0 auto;
  gap: 36px;
  padding: 28px 24px 90px;
  align-items: flex-start;
}

.side {
  flex: 0 0 285px;
  position: sticky;
  top: 72px;
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
}

.side .grp { margin-bottom: 20px; }
.side .grp-label {
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 10px;
  color: var(--ink-muted);
  margin-bottom: 8px;
  display: block;
  font-weight: 600;
}

.side a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  margin: 2px 0;
  border-radius: 4px;
  color: var(--ink-muted);
  border-left: 2px solid transparent;
  transition: all .15s ease;
  gap: 8px;
  white-space: nowrap;
}

.side a .nav-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side a:hover {
  color: var(--accent-ink);
  background: var(--accent-soft);
  text-decoration: none;
}

.side a.active {
  color: var(--accent-ink);
  border-left-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.side .badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink-muted);
}

main {
  flex: 1;
  min-width: 0;
}

@media (max-width: 920px) {
  .side { display: none; }
  .shell { padding-top: 16px; }
}

/* Headings */
h1.page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.page-sub {
  color: var(--ink-muted);
  font-size: 15px;
  margin: 0 0 24px;
}

h2 {
  font-family: ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 13px;
  color: var(--accent-ink);
  margin: 36px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

h2 .n {
  color: var(--ink-muted);
  font-weight: normal;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
}

.card p {
  margin: 6px 0 0;
  color: var(--ink-muted);
  font-size: 14.5px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
  .grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
}

/* Chips / Badges */
.chip {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-block;
  font-weight: 600;
}

.chip.canonical {
  background: var(--canonical-aubergine-soft);
  color: var(--canonical-aubergine);
  border: 1px solid color-mix(in srgb, var(--canonical-aubergine) 30%, transparent);
}

.chip.good {
  background: var(--good-soft);
  color: var(--good);
  border: 1px solid color-mix(in srgb, var(--good) 30%, transparent);
}

.chip.bad {
  background: var(--bad-soft);
  color: var(--bad);
  border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent);
}

.chip.warn {
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
}

.chip.neutral {
  background: var(--surface-2);
  color: var(--ink-muted);
  border: 1px solid var(--border);
}

/* Callout */
.callout {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 14.5px;
}

.callout.canonical {
  background: var(--canonical-aubergine-soft);
  border-left-color: var(--canonical-aubergine);
}

.callout-title {
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Test Arena / Practice Area */
.test-arena {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 20px;
  position: relative;
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

.test-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.test-stats-row {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
}

.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface-2);
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.stat-pill .label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--ink-muted);
  letter-spacing: .05em;
}

.stat-pill .val {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
}

.timer-box {
  font-family: ui-monospace, monospace;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--surface-2);
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  letter-spacing: 0.05em;
}

.timer-box.hurry {
  color: var(--bad);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width .2s linear;
}

/* Question Stage */
.stage-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 10px;
  min-height: 240px;
}

.statement-text {
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 24px;
  line-height: 1.4;
  max-width: 680px;
}

.question-text {
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 26px;
}

.helper-text {
  font-size: 14px;
  color: var(--ink-muted);
  margin-top: 16px;
  font-family: ui-monospace, monospace;
}

/* Button & Controls */
.btn {
  font-family: ui-monospace, monospace;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--ink-muted);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 85%, black);
  border-color: color-mix(in srgb, var(--accent) 85%, black);
  color: var(--accent-contrast);
}

.btn-large {
  font-size: 18px;
  padding: 14px 28px;
  border-radius: 8px;
}

.btn-choice {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  padding: 16px 32px;
  border-radius: 8px;
  border: 2px solid var(--border);
  min-width: 140px;
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
  transition: all .15s ease;
  box-shadow: var(--shadow);
}

.btn-choice:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.btn-choice:active {
  transform: translateY(0);
}

.btn-choice .key-hint {
  font-size: 11px;
  color: var(--ink-muted);
  display: block;
  font-weight: normal;
  margin-top: 4px;
}

.btn-choice.correct {
  background: var(--good-soft) !important;
  border-color: var(--good) !important;
  color: var(--good) !important;
}

.btn-choice.incorrect {
  background: var(--bad-soft) !important;
  border-color: var(--bad) !important;
  color: var(--bad) !important;
}

.choices-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Feedback alert below stage */
.feedback-box {
  padding: 12px 18px;
  border-radius: 6px;
  font-size: 14.5px;
  margin-top: 16px;
  animation: fadeIn .2s ease;
  text-align: left;
}

.feedback-box.good {
  background: var(--good-soft);
  border: 1px solid var(--good);
  color: var(--good);
}

.feedback-box.bad {
  background: var(--bad-soft);
  border: 1px solid var(--bad);
  color: var(--bad);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Specific Sub-Test Layouts */

/* 02. Perceptual Speed Letter Columns */
.pairs-matrix, .letter-matrix {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 20px 0 28px;
  flex-wrap: wrap;
}

.pair-column, .letter-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  padding: 18px 24px;
  border-radius: 10px;
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  min-width: 70px;
}

.pair-cell, .letter-char {
  font-size: 36px;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  line-height: 1.1;
  color: var(--ink);
  text-align: center;
}

.pair-cell.top {
  border-bottom: 2px solid var(--border);
  padding-bottom: 12px;
  width: 100%;
}

.pair-cell.bottom {
  padding-top: 4px;
  width: 100%;
}

/* Number Choice Buttons for Perceptual Speed (0-4) & Spatial (0-2) */
.btn-choice-num {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  padding: 12px 22px;
  border-radius: 8px;
  border: 2px solid var(--border);
  min-width: 72px;
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
  transition: all .15s ease;
  box-shadow: var(--shadow);
}

.btn-choice-num:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.btn-choice-num:active {
  transform: translateY(0);
}

.btn-choice-num .key-hint {
  font-size: 11px;
  color: var(--ink-muted);
  display: block;
  font-weight: normal;
  margin-top: 4px;
}

.btn-choice-num.correct {
  background: var(--good-soft) !important;
  border-color: var(--good) !important;
  color: var(--good) !important;
}

.btn-choice-num.incorrect {
  background: var(--bad-soft) !important;
  border-color: var(--bad) !important;
  color: var(--bad) !important;
}

/* 04. Word Meaning Cards */
.words-row {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 18px 0 26px;
  flex-wrap: wrap;
}

.word-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--ink);
  padding: 14px 26px;
  border-radius: 8px;
  border: 2px solid var(--border);
  min-width: 140px;
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: var(--shadow);
}

.word-card .word-text {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}

.word-card .word-key-hint {
  font-size: 11px;
  color: var(--ink-muted);
  display: block;
  font-weight: normal;
  margin-top: 5px;
  font-family: ui-monospace, monospace;
}

.word-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.word-card:active {
  transform: translateY(0);
}

.word-card.correct {
  background: var(--good-soft) !important;
  border-color: var(--good) !important;
  color: var(--good) !important;
}

.word-card.incorrect {
  background: var(--bad-soft) !important;
  border-color: var(--bad) !important;
  color: var(--bad) !important;
}

/* Number Speed Row */
.number-row, .numbers-row {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 14px 0 24px;
}

.number-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--ink);
  padding: 12px 22px;
  border-radius: 8px;
  border: 2px solid var(--border);
  min-width: 90px;
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: var(--shadow);
}

.number-card .number-val, .number-card .num-val {
  font-size: 26px;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  line-height: 1.1;
}

.number-card .number-key-hint, .number-card .key-hint {
  font-size: 11px;
  color: var(--ink-muted);
  display: block;
  font-weight: normal;
  margin-top: 4px;
  font-family: ui-monospace, monospace;
}

.number-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.number-card:active {
  transform: translateY(0);
}

.number-card.correct {
  background: var(--good-soft) !important;
  border-color: var(--good) !important;
  color: var(--good) !important;
}

.number-card.incorrect {
  background: var(--bad-soft) !important;
  border-color: var(--bad) !important;
  color: var(--bad) !important;
}

/* 05. Spatial Visualisation Pairs & Glyphs */
.spatial-pair-container, .spatial-boxes-container {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 20px 0 28px;
  flex-wrap: wrap;
}

.spatial-pair-card, .spatial-box {
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 18px 24px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow);
  min-width: 260px;
}

.spatial-pair-card .box-num, .spatial-box .box-num {
  font-family: ui-monospace, monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 14px;
}

.spatial-glyphs-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.spatial-glyph-wrapper {
  width: 105px;
  height: 105px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: 10px;
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  transition: all .15s ease;
}

.spatial-divider-v {
  width: 1px;
  height: 70px;
  background: var(--border);
  margin: 0 4px;
}

/* Toggle Pills */
.pill-selector {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px;
  gap: 2px;
}

.pill-option {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  font-weight: 500;
  transition: all .15s;
}

.pill-option:hover {
  color: var(--ink);
}

.pill-option.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Results Screen */
.results-modal {
  text-align: center;
  padding: 24px;
}

.results-score-big {
  font-size: 54px;
  font-weight: 800;
  font-family: ui-monospace, monospace;
  color: var(--accent-ink);
  line-height: 1;
  margin: 16px 0 8px;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14.5px;
}

.results-table th, .results-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.results-table th {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--ink-muted);
}

kbd {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 11px;
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}

/* --- Answer Review Breakdown (Results Screen) --- */
.review-section {
  margin-top: 32px;
  text-align: left;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.review-section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.review-filter-tabs {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px;
  gap: 4px;
}

.review-tab-btn {
  font-family: ui-monospace, monospace;
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  font-weight: 500;
  transition: all .15s;
}

.review-tab-btn:hover {
  color: var(--ink);
}

.review-tab-btn.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  transition: all .15s;
  box-shadow: var(--shadow);
}

.review-card.incorrect {
  border-left: 4px solid var(--bad);
  background: rgba(239, 68, 68, 0.03);
}

.review-card.correct {
  border-left: 4px solid var(--good);
  background: rgba(34, 197, 94, 0.02);
}

.review-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  font-family: ui-monospace, monospace;
}

.review-card-num {
  font-weight: 700;
  color: var(--ink-muted);
}

.review-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11.5px;
}

.review-badge.good {
  background: var(--good-soft);
  color: var(--good);
  border: 1px solid var(--good);
}

.review-badge.bad {
  background: var(--bad-soft);
  color: var(--bad);
  border: 1px solid var(--bad);
}

.review-latency {
  color: var(--ink-muted);
  font-size: 11.5px;
}

.review-prompt {
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 10px;
  line-height: 1.5;
}

.review-answers-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 13.5px;
}

.ans-tag {
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ans-tag.user.bad {
  background: var(--bad-soft);
  color: var(--bad);
  border: 1px solid var(--bad);
}

.ans-tag.user.good {
  background: var(--good-soft);
  color: var(--good);
  border: 1px solid var(--good);
}

.ans-tag.correct-val {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--border);
}

.review-explanation-box {
  background: var(--surface-2);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink);
  border-left: 3px solid var(--accent);
  line-height: 1.45;
}

.review-empty-state {
  text-align: center;
  padding: 24px;
  color: var(--ink-muted);
  font-style: italic;
  background: var(--surface-2);
  border-radius: 8px;
}

.statement-box {
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface-2);
  border: 2px dashed var(--accent);
  border-radius: 10px;
  padding: 26px 36px;
  margin: 18px auto;
  max-width: 680px;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.statement-box:hover {
  background: var(--accent-soft);
  border-style: solid;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Scale Stepper Control */
.scale-control {
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 4px;
  gap: 2px;
}

.scale-control .pill-option {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 4px;
  color: var(--ink-muted);
}

.scale-control .pill-option:hover {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.scale-control .pill-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  font-family: ui-monospace, monospace;
}

/* Sidebar Hidden Mode */
html[data-sidebar="hidden"] .side {
  display: none !important;
}

html[data-sidebar="hidden"] .shell {
  max-width: 1060px;
  justify-content: center;
}

html[data-sidebar="hidden"] main {
  flex: 1;
  width: 100%;
  max-width: 100%;
}
