.question-toolbar { display: flex; align-items: center; gap: 10px; }
.question-toolbar .question-meta { flex: 1; min-width: 0; }
.theme-toggle, .focus-toggle { white-space: nowrap; }
.theme-toggle .icon, .focus-toggle .icon { width: 17px; height: 17px; }
.focus-toggle { min-height: 36px; padding: 6px 9px; font-size: 12px; }

[data-focus-mode] :is(.site-header, .hero, .progress-panel, .site-footer, .source-badge) { display: none; }
[data-focus-mode] main.frame { width: 100%; }
[data-focus-mode] .study-layout { display: block; margin: 0; }
[data-focus-mode] .quiz-panel {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(12px, 3vh, 32px) clamp(15px, 4.5vw, 64px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
[data-focus-mode] #question-view { width: min(100%, 1160px); }
[data-focus-mode] .question-toolbar {
  position: sticky;
  z-index: 1;
  top: 0;
  padding-block: 7px;
  background: var(--paper);
}
[data-focus-mode] .question-number { font-size: 12px; }
[data-focus-mode] .focus-toggle { min-height: 40px; }
[data-focus-mode] .question-prompt { font-size: clamp(22px, 3.2vw, 44px); }
[data-focus-mode] .choice { min-height: clamp(56px, 9vh, 83px); }
[data-focus-mode] .choice-text { font-size: clamp(16px, 1.7vw, 23px); }
[data-focus-mode] .feedback-title { scroll-margin-top: 58px; }

@media (max-width: 520px) {
  .header-actions, .question-toolbar { gap: 6px; }
  .theme-toggle, .focus-toggle { min-height: 40px; padding-inline: 10px; }
  .theme-toggle span, .focus-toggle span { display: none; }
  [data-focus-mode] .focus-toggle span { display: inline; }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --canvas: #0c1725;
  --paper: #132438;
  --ink: #ebf5fd;
  --subtle: #b4c9dc;
  --line: #3b556e;
  --frost: #1b3147;
  --cyan: #80d1e9;
  --focus: #9ae6f8;
  --good: #a1eacb;
  --good-fill: #183b37;
  --good-line: #64b396;
  --bad: #ffbec7;
  --bad-fill: #472938;
  --bad-line: #cb8290;
  --review: #f7cf93;
  --review-fill: #433523;
  --review-line: #bc975e;
}

:where([data-theme='dark']) ::selection { background: #315e77; }
:where([data-theme='dark']) .skip-link { color: var(--canvas); }
:where([data-theme='dark']) .site-header { background: #102033; border-color: var(--line); }
:where([data-theme='dark']) .week-label { background: var(--frost); }
:where([data-theme='dark']) .week-label > span { background: var(--cyan); box-shadow: 0 0 0 2px #2b4a61; }
:where([data-theme='dark']) :is(.restart-button, .button-quiet) { background: var(--frost); color: var(--ink); }
:where([data-theme='dark']) :is(.restart-button, .button-quiet):hover:not(:disabled) { background: #28445e; border-color: #749ab5; }
:where([data-theme='dark']) .button-quiet:disabled { color: #a5bdcf; background: #172c40; border-color: var(--line); }
:where([data-theme='dark']) .theme-toggle[aria-pressed='true'] { color: var(--cyan); border-color: #649cb2; }
:where([data-theme='dark']) .button-primary { color: #102839; background: #8bd6eb; border-color: #8bd6eb; box-shadow: inset 0 -2px #5aaac5; }
:where([data-theme='dark']) .button-primary:hover:not(:disabled) { background: #b1e8f7; border-color: #b1e8f7; box-shadow: inset 0 -2px #75bfd7; }
:where([data-theme='dark']) .button-primary:disabled { color: #b5ccde; background: #233c52; border-color: var(--line); }

:where([data-theme='dark']) .hero { background: #142a40; border-color: var(--line); box-shadow: 0 7px 22px #050d1899; }
:where([data-theme='dark']) .hero-art { filter: brightness(.54) saturate(.86); }
:where([data-theme='dark']) .eyebrow { color: var(--cyan); }
:where([data-theme='dark']) .eyebrow > span { background: var(--cyan); }
:where([data-theme='dark']) .edition { color: var(--ink); background: #142a40ee; border-color: #708ca6; }
:where([data-theme='dark']) .panel { box-shadow: 0 6px 20px #050d1840; }
:where([data-theme='dark'][data-focus-mode]) .quiz-panel { box-shadow: none; }
:where([data-theme='dark']) :is(.hero-copy > p:last-child, .question-number, .progress-stats dt, .results-stats dt, .progress-stats dd span, .legend, .saved-status, .site-footer, .results > p:not(.eyebrow)) { color: var(--subtle); }
:where([data-theme='dark']) .question-number strong { color: var(--ink); }
:where([data-theme='dark']) .question-led { border-color: var(--cyan); background: #55a9c6; box-shadow: 0 0 0 3px #214057; }
:where([data-theme='dark']) .source-badge[data-source='gpt'] { --badge-line: #4b829a; --badge-ink: #b4ebf8; --badge-fill: #214459; }
:where([data-theme='dark']) .source-badge[data-source='gemini'] { --badge-line: #7c66a7; --badge-ink: #e3d6ff; --badge-fill: #3b3157; }
:where([data-theme='dark']) .source-badge[data-source='claude'] { --badge-line: #9d754b; --badge-ink: #ffdfb7; --badge-fill: #4c3829; }

:where([data-theme='dark']) .choice { color: var(--ink); background: var(--frost); border-color: #516f87; }
:where([data-theme='dark']) .choice:hover:not(.locked) { background: #253f58; border-color: #79adc6; }
:where([data-theme='dark']) .choice-letter { color: #d7eafa; background: #264058; border-color: #4b6983; }
:where([data-theme='dark']) .choice-indicator { border-color: #8baac0; }
:where([data-theme='dark']) .choice.selected:not(.correct, .incorrect) { background: #23465b; border-color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan); }
:where([data-theme='dark']) .choice.selected:not(.correct, .incorrect) .choice-letter { color: #e2f7ff; background: #28536b; border-color: #6097ac; }
:where([data-theme='dark']) .choice.selected:not(.correct, .incorrect) .choice-indicator { background: var(--cyan); border-color: var(--cyan); box-shadow: inset 0 0 0 4px #23465b; }
:where([data-theme='dark']) .choice:is(.correct, .incorrect) .choice-letter { background: #0c172544; }
:where([data-theme='dark']) .choice:is(.correct, .incorrect) .choice-indicator { color: var(--canvas); }

:where([data-theme='dark']) :is(.feedback, .why, .question-actions, .question-nav, .saved-status, dialog) { border-color: var(--line); }
:where([data-theme='dark']) .why { background: #192e43; }
:where([data-theme='dark']) .why summary { color: #c5ecf8; }
:where([data-theme='dark']) .why summary:hover { background: #26445c; }
:where([data-theme='dark']) .why-content { color: var(--ink); }
:where([data-theme='dark']) :is(.progress-flake, .results-mark, .progress-stats div, .results-stats div) { background: var(--frost); border-color: var(--line); }
:where([data-theme='dark']) :is(.progress-flake, .results-mark, .question-nav h3 .icon, .saved-status .icon) { color: var(--cyan); }
:where([data-theme='dark']) progress { background: #30495f; }
:where([data-theme='dark']) progress::-webkit-progress-bar { background: #30495f; }
:where([data-theme='dark']) progress::-webkit-progress-value { background: var(--cyan); }
:where([data-theme='dark']) progress::-moz-progress-bar { background: var(--cyan); }
:where([data-theme='dark']) :is(.map-cell, .legend-dot) { color: var(--subtle); background: var(--frost); border-color: #53708a; }
:where([data-theme='dark']) .map-cell:hover { border-color: #9cc4db; }
:where([data-theme='dark']) .map-cell[aria-current='step'] { border-color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan); }
:where([data-theme='dark']) .map-cell.unanswered[aria-current='step'] { background: #254d62; color: var(--ink); }
:where([data-theme='dark']) dialog::backdrop { background: #060e1bd1; }
