:root {
  color-scheme: light;
  --ink: #17283d;
  --muted: #78889a;
  --line: #e8edf2;
  --paper: #ffffff;
  --canvas: #f5f7fb;
  --teal: #087f82;
  --teal-dark: #05676a;
  --teal-light: #e8f5f3;
  --coral: #df765d;
  --shadow: 0 18px 55px rgba(35, 57, 79, 0.075);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 82% 7%, rgba(198, 232, 226, 0.43), transparent 30rem),
    var(--canvas);
}

button,
input {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
.uncertainty-disclosure summary:focus-visible,
.option:has(input:focus-visible) {
  outline: 3px solid rgba(8, 127, 130, 0.35);
  outline-offset: 3px;
}

.app-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 22px;
}

.topbar,
.brand,
.progress-heading,
.progress-footer,
.question-meta,
.question-footer,
.footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar {
  min-height: 42px;
}

.brand {
  justify-content: flex-start;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--teal);
  background: #e5f2f0;
  border-radius: 12px;
}

.brand-mark svg {
  width: 26px;
  height: 26px;
}

.brand-name {
  font-size: 15px;
  font-weight: 760;
  letter-spacing: -0.04em;
}

.brand-name span {
  margin-left: 4px;
  color: var(--teal);
  font-weight: 520;
}

.topbar-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: #647789;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(224, 232, 237, 0.86);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #5da98b;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #e6f4ee;
}

.intro {
  max-width: 700px;
  margin: 65px auto 39px;
  text-align: center;
}

.eyebrow {
  margin: 0;
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

h1 {
  margin: 12px 0 11px;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 740;
  letter-spacing: -0.055em;
  line-height: 1.12;
}

h1 span {
  color: var(--teal);
}

.intro-copy {
  margin: 0;
  color: #758596;
  font-size: 15px;
  line-height: 1.6;
}

.quiz-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.78fr) minmax(0, 1.8fr);
  align-items: start;
  gap: 22px;
}

.progress-card,
.question-card {
  background: var(--paper);
  border: 1px solid rgba(225, 232, 238, 0.88);
  border-radius: 17px;
  box-shadow: var(--shadow);
}

.progress-card {
  padding: 23px 22px 18px;
}

.progress-heading {
  color: #8b9aaa;
}

.progress-heading .eyebrow {
  color: #8b9aaa;
  font-size: 9px;
}

.progress-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: var(--teal);
  background: #edf7f5;
  border-radius: 8px;
  font-size: 17px;
}

.progress-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 20px 0 0;
  color: var(--ink);
  font-size: 31px;
  font-weight: 720;
  letter-spacing: -0.06em;
}

.progress-divider,
.progress-count > span:last-child {
  color: #a4b0ba;
  font-size: 19px;
  font-weight: 500;
}

.progress-caption {
  margin: 1px 0 15px;
  color: var(--muted);
  font-size: 12px;
}

.progress-footer {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: #778798;
  font-size: 12px;
}

.progress-footer strong {
  color: var(--teal);
  font-size: 15px;
}

.score-total {
  color: #9aa8b4;
  font-size: 11px;
  font-weight: 500;
}

.tip-card {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  padding: 13px 12px;
  background: #f5f8fa;
  border-radius: 11px;
}

.tip-spark {
  flex: 0 0 auto;
  color: var(--coral);
  font-size: 16px;
}

.tip-card p {
  margin: 0;
  color: #7a8a99;
  font-size: 11px;
  line-height: 1.6;
}

.tip-card strong {
  color: #4a5e70;
  font-size: 11px;
}

.question-card {
  min-height: 432px;
  padding: 30px 34px 22px;
}

.question-meta {
  gap: 12px;
  justify-content: flex-start;
}

.question-index {
  color: #91a0ad;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.question-type {
  padding: 6px 9px;
  color: #397f79;
  background: #eef7f4;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
}

.question-card h2 {
  margin: 19px 0 7px;
  font-size: clamp(20px, 2.4vw, 25px);
  font-weight: 680;
  letter-spacing: -0.035em;
  line-height: 1.42;
}

.selection-hint {
  min-height: 18px;
  margin: 0 0 17px;
  color: #92a0ad;
  font-size: 12px;
}

.options-list {
  display: grid;
  gap: 9px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  color: #475b6d;
  background: #fff;
  border: 1px solid #e8edf1;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.option:hover {
  border-color: #9bc9c2;
  background: #fbfefd;
}

.option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.option-marker {
  display: grid;
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  place-items: center;
  margin-top: 1px;
  color: transparent;
  border: 1.5px solid #cbd5dc;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.option[data-multiple="true"] .option-marker {
  border-radius: 5px;
}

.option-content {
  font-size: 13px;
  line-height: 1.5;
}

.option:has(input:checked) {
  color: #176f70;
  background: #f0f8f6;
  border-color: #63aaa1;
}

.option input:checked + .option-marker {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.option:has(input:disabled) {
  cursor: default;
}

.option.is-correct {
  color: #236d52;
  background: #eff8f2;
  border-color: #83bca0;
}

.option.is-incorrect {
  color: #a7524c;
  background: #fff5f3;
  border-color: #e3a097;
}

.option.is-answer {
  border-color: #83bca0;
}

.feedback {
  display: flex;
  gap: 11px;
  margin-top: 15px;
  padding: 13px 14px;
  border-radius: 10px;
}

.feedback.is-correct {
  color: #28694e;
  background: #eff8f2;
}

.feedback.is-incorrect {
  color: #96534b;
  background: #fff4f1;
}

.feedback-icon {
  display: grid;
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  place-items: center;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.feedback strong {
  font-size: 12px;
}

.feedback p {
  margin: 4px 0 0;
  color: #6d7f89;
  font-size: 12px;
  line-height: 1.6;
}

.form-error {
  margin: 10px 0 0;
  color: #ad514b;
  font-size: 12px;
}

.question-footer {
  gap: 14px;
  margin-top: 24px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.footer-actions {
  justify-content: flex-end;
  gap: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-primary {
  color: #fff;
  background: var(--teal);
  box-shadow: 0 4px 10px rgba(8, 127, 130, 0.13);
}

.button-primary:hover:not(:disabled) {
  background: var(--teal-dark);
}

.button-quiet {
  padding-left: 2px;
  color: #82919d;
  background: transparent;
}

.button-quiet:hover:not(:disabled) {
  color: var(--teal);
}

.button-secondary {
  color: var(--teal);
  background: #eff8f6;
}

.message-state {
  display: grid;
  min-height: 370px;
  align-content: center;
  justify-items: center;
  color: #788999;
  text-align: center;
}

.message-state p {
  margin: 10px 0;
  font-size: 13px;
}

.loader {
  width: 28px;
  height: 28px;
  border: 3px solid #dcebe8;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 750ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-state h2 {
  margin: 12px 0 0;
  color: var(--ink);
  font-size: 20px;
}

.error-state p {
  max-width: 360px;
  line-height: 1.6;
}

.state-symbol {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #ae594f;
  background: #fff0ed;
  border-radius: 50%;
  font-weight: 800;
}

.result-state {
  display: grid;
  min-height: 385px;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.result-badge {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin-bottom: 20px;
  color: #bd8751;
  background: #fff6e8;
  border-radius: 19px;
  font-size: 26px;
}

.result-state h2 {
  margin: 10px 0 5px;
}

.result-summary {
  max-width: 390px;
  margin: 0;
  color: #788999;
  font-size: 13px;
  line-height: 1.6;
}

.result-score {
  margin: 22px 0;
  color: #82919d;
  font-size: 13px;
}

.result-score strong {
  color: var(--teal);
  font-size: 30px;
  letter-spacing: -0.05em;
}

.result-state .button {
  min-height: 43px;
}

.page-footer {
  padding: 23px 0 0;
  color: #9aa6b1;
  font-size: 11px;
  text-align: center;
}

.page-footer span {
  padding: 0 4px;
  color: #c1cbd2;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 30px, 570px);
    padding-top: 18px;
  }

  .intro {
    margin: 45px auto 26px;
  }

  .quiz-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .progress-card {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0 10px;
    padding: 15px 17px;
  }

  .progress-heading {
    grid-column: 1;
  }

  .progress-heading .eyebrow {
    font-size: 8px;
  }

  .progress-icon {
    display: none;
  }

  .progress-count {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin: 0;
    font-size: 25px;
  }

  .progress-caption {
    grid-column: 1;
    margin: 3px 0 12px;
    font-size: 11px;
  }

  .progress-footer,
  .tip-card {
    display: none;
  }

  .question-card {
    min-height: 0;
    padding: 23px 20px 16px;
  }

  .message-state {
    min-height: 330px;
  }

  .result-state {
    min-height: 345px;
  }
}

@media (max-width: 440px) {
  .app-shell {
    width: calc(100% - 24px);
    padding-top: 14px;
  }

  .brand-name {
    font-size: 14px;
  }

  .topbar-note {
    gap: 7px;
    padding: 7px 9px;
    font-size: 10px;
  }

  .intro {
    margin-top: 38px;
  }

  .eyebrow {
    font-size: 9px;
  }

  .intro-copy {
    max-width: 320px;
    margin: 0 auto;
    font-size: 13px;
  }

  .question-card {
    padding: 20px 16px 14px;
    border-radius: 14px;
  }

  .question-card h2 {
    font-size: 20px;
  }

  .option {
    gap: 10px;
    padding: 11px 10px;
  }

  .option-content {
    font-size: 12px;
  }

  .question-footer {
    gap: 6px;
    margin-top: 18px;
  }

  .button {
    min-height: 38px;
    padding: 0 11px;
    font-size: 11px;
  }

  .button-quiet {
    gap: 5px;
    padding-left: 0;
  }

  .footer-actions {
    gap: 5px;
  }

  .page-footer {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.switch {
  --width-of-switch: 3.5em;
  --height-of-switch: 2em;
  --size-of-icon: 1.4em;
  --slider-offset: 0.3em;
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: var(--width-of-switch);
  height: var(--height-of-switch);
  margin-left: auto;
  cursor: pointer;
}

.switch input {
  width: 0;
  height: 0;
  opacity: 0;
}

.switch .slider {
  position: absolute;
  inset: 0;
  background-color: #c7e2f8;
  border: 1px solid #8bbce3;
  border-radius: 30px;
  cursor: pointer;
  transition: 0.4s;
}

.switch .slider:before {
  position: absolute;
  content: "";
  width: var(--size-of-icon);
  height: var(--size-of-icon);
  left: var(--slider-offset);
  top: 50%;
  background: linear-gradient(40deg, #ff0080, #ff8c00 70%);
  border-radius: 20px;
  transform: translateY(-50%);
  transition: 0.4s;
}

.switch input:checked + .slider {
  background-color: #303136;
}

.switch input:checked + .slider:before {
  left: calc(100% - (var(--size-of-icon) + var(--slider-offset)));
  background: #303136;
  box-shadow: inset -3px -2px 5px -2px #8983f7, inset -10px -4px 0 0 #a3dafb;
}

.switch input:focus-visible + .slider {
  box-shadow: 0 0 0 3px rgba(163, 218, 251, 0.5);
}

.intro {
  margin-top: 42px;
  margin-bottom: 34px;
}

.intro h1 {
  margin: 0;
}

.mode-selector {
  max-width: 860px;
  margin: 0 auto;
  padding: 30px;
  background: var(--paper);
  border: 1px solid rgba(225, 232, 238, 0.88);
  border-radius: 17px;
  box-shadow: var(--shadow);
}

.mode-heading {
  margin-bottom: 22px;
  text-align: center;
}

.mode-heading h2 {
  margin: 9px 0 0;
  font-size: clamp(22px, 3vw, 28px);
  letter-spacing: -0.04em;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.subject-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.subject-grid .mode-card {
  min-height: 150px;
}

.final-exam-card {
  border-color: rgba(223, 118, 93, 0.45);
  background: linear-gradient(135deg, var(--paper), #fff8f5);
}

.mode-card {
  display: grid;
  min-height: 175px;
  align-content: start;
  justify-items: start;
  gap: 12px;
  padding: 22px;
  color: var(--ink);
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.mode-card:hover {
  transform: translateY(-2px);
  border-color: #83bdb5;
  background: #fbfefd;
}

.mode-card-kicker {
  color: var(--teal);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.mode-card strong {
  font-size: 19px;
  letter-spacing: -0.025em;
}

.mode-card-description {
  max-width: 280px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.mode-back-footer {
  display: flex;
  justify-content: flex-start;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.mode-note {
  margin: 19px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.timer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 13px;
  color: #536a7c;
  background: #f3f7fa;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 11px;
}

.timer-card strong {
  color: var(--teal);
  font-variant-numeric: tabular-nums;
  font-size: 18px;
}

.timer-card.is-urgent {
  color: #9c4c43;
  background: #fff2ef;
  border-color: #f0c7bf;
}

.timer-card.is-urgent strong {
  color: #b34e42;
}

.uncertainty-note {
  margin: 0 0 16px;
  padding: 12px 14px;
  color: #74540c;
  background: #fff5cf;
  border: 1px solid #f0d979;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.55;
}

.results-layout {
  max-width: 860px;
  margin: 0 auto;
}

.result-card {
  padding: 26px 30px;
}

.result-state {
  min-height: 0;
  padding: 12px 0 28px;
  border-bottom: 1px solid var(--line);
}

.result-state h2 {
  margin: 10px 0 7px;
}

.result-score {
  margin: 18px 0;
}

.result-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.result-stats span {
  padding: 8px 11px;
  color: var(--muted);
  background: var(--canvas);
  border-radius: 8px;
  font-size: 11px;
}

.result-stats strong {
  color: var(--ink);
}

.result-stat {
  min-width: 96px;
  font-weight: 650;
  border: 1px solid transparent;
}

.result-stat-correct {
  color: #237a52;
  background: #edf8f1;
  border-color: #cce7d7;
}

.result-stat-correct strong {
  color: #237a52;
}

.result-stat-incorrect {
  color: #b84f42;
  background: #fff0ed;
  border-color: #f2cfc7;
}

.result-stat-incorrect strong {
  color: #b84f42;
}

.result-stat-skipped {
  color: #5f6f80;
  background: #f1f4f7;
  border-color: #dde4ea;
}

.result-stat-skipped strong {
  color: #5f6f80;
}

.review-section {
  padding-top: 23px;
}

.review-section h3 {
  margin: 0 0 15px;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.review-list {
  display: grid;
  gap: 11px;
}

.review-item {
  padding: 15px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.review-item h4 {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.55;
}

.review-item p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.review-item .review-correct strong {
  color: #287252;
}

.review-item .review-answer strong {
  color: #a7524c;
}

.review-item .review-explanation {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.review-item .review-uncertainty {
  margin-top: 11px;
  color: #74540c;
  background: #fff5cf;
  border-color: #f0d979;
}

.review-empty {
  padding: 16px;
  color: #28694e;
  background: #eff8f2;
  border-radius: 9px;
  font-size: 13px;
}

.results-footer {
  display: flex;
  justify-content: center;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

body[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e5edf5;
  --muted: #9aaabd;
  --line: #2a3948;
  --paper: #192532;
  --canvas: #111a25;
  --teal: #55c2b9;
  --teal-dark: #36a49d;
  --teal-light: #203d41;
  --coral: #f09279;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.2);
  background:
    radial-gradient(ellipse at 82% 7%, rgba(32, 77, 75, 0.3), transparent 30rem),
    var(--canvas);
}

body[data-theme="dark"] .topbar-note {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line);
}

body[data-theme="dark"] .intro-copy,
body[data-theme="dark"] .question-card h2,
body[data-theme="dark"] .error-state h2 {
  color: var(--ink);
}

body[data-theme="dark"] .progress-icon,
body[data-theme="dark"] .question-type,
body[data-theme="dark"] .button-secondary {
  color: var(--teal);
  background: #203d41;
}

body[data-theme="dark"] .option {
  color: #c5d0dc;
  background: #1b2936;
  border-color: #30404e;
}

body[data-theme="dark"] .option:hover,
body[data-theme="dark"] .option:has(input:checked) {
  color: #a8e0d9;
  background: #203d41;
  border-color: #4b9991;
}

body[data-theme="dark"] .mode-card {
  color: var(--ink);
  background: #1b2936;
  border-color: #30404e;
}

body[data-theme="dark"] .mode-card:hover {
  background: #203d41;
  border-color: #4b9991;
}

body[data-theme="dark"] .mode-card-description,
body[data-theme="dark"] .mode-note,
body[data-theme="dark"] .selection-hint,
body[data-theme="dark"] .question-index,
body[data-theme="dark"] .progress-caption {
  color: #a4b3c2;
}

body[data-theme="dark"] .timer-card {
  color: #b9c9d8;
  background: #202e3b;
  border-color: #344656;
}

body[data-theme="dark"] .timer-card.is-urgent {
  color: #ffd0c5;
  background: #462e2d;
  border-color: #80504b;
}

body[data-theme="dark"] .timer-card.is-urgent strong {
  color: #ff9a89;
}

body[data-theme="dark"] .uncertainty-note,
body[data-theme="dark"] .review-item .review-uncertainty {
  color: #f3d87c;
  background: #453b20;
  border-color: #71612c;
}

body[data-theme="dark"] .result-stats span,
body[data-theme="dark"] .review-item {
  background: #202e3b;
}

body[data-theme="dark"] .result-stat-correct {
  color: #9bd3b2;
  background: #203b32;
  border-color: #345b4d;
}

body[data-theme="dark"] .result-stat-correct strong {
  color: #9bd3b2;
}

body[data-theme="dark"] .result-stat-incorrect {
  color: #ffb8aa;
  background: #462e2d;
  border-color: #70423d;
}

body[data-theme="dark"] .result-stat-incorrect strong {
  color: #ffb8aa;
}

body[data-theme="dark"] .result-stat-skipped {
  color: #c0cbd6;
  background: #202e3b;
  border-color: #40515f;
}

body[data-theme="dark"] .result-stat-skipped strong {
  color: #c0cbd6;
}

body[data-theme="dark"] .review-item .review-correct strong {
  color: #7ed4a6;
}

body[data-theme="dark"] .review-item .review-answer strong {
  color: #ff9a89;
}

body[data-theme="dark"] .review-empty {
  color: #a3e1bd;
  background: #203b32;
}

body[data-theme="dark"] .result-summary,
body[data-theme="dark"] .result-score,
body[data-theme="dark"] .result-stats span {
  color: #a4b3c2;
}

@media (max-width: 760px) {
  .mode-selector {
    padding: 23px 20px;
  }
  .subject-grid {
    grid-template-columns: 1fr;
  }

  .progress-card .timer-card {
    grid-column: 1 / -1;
    margin-top: 12px;
  }

  .result-card {
    padding: 22px 20px;
  }
}

@media (max-width: 520px) {
  .mode-grid {
    grid-template-columns: 1fr;
  }

  .mode-card {
    min-height: 0;
    padding: 18px;
  }

  .mode-heading h2 {
    font-size: 22px;
  }

  .result-stats {
    gap: 6px;
  }

  .result-stats span {
    padding: 7px 8px;
    font-size: 10px;
  }
}

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

.header-home {
  margin-right: auto;
}

.header-home {
  min-height: 39px;
  padding: 0 11px;
  color: var(--muted);
}

.question-map {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  max-height: 300px;
  margin-top: 17px;
  padding: 2px 3px 4px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.question-map-item {
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  place-items: center;
  padding: 0;
  color: #647789;
  background: var(--paper);
  border: 1px solid #dfe6eb;
  border-radius: 8px;
  cursor: pointer;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  transition: background 130ms ease, border-color 130ms ease, color 130ms ease, transform 130ms ease;
}

.question-map-item:hover {
  transform: translateY(-1px);
  border-color: var(--teal);
}

.question-map-item.is-unvisited {
  color: #8998a6;
  background: #edf1f4;
  border-color: #edf1f4;
}

.question-map-item.is-answered {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.question-map-item.is-current {
  outline: 2px solid var(--coral);
  outline-offset: 1px;
}

.uncertainty-disclosure {
  position: relative;
}

.uncertainty-disclosure summary {
  list-style: none;
  cursor: pointer;
}

.uncertainty-disclosure summary::-webkit-details-marker {
  display: none;
}

.uncertainty-disclosure summary::after {
  content: "＋";
  margin-left: 6px;
  font-size: 11px;
}

.uncertainty-disclosure[open] summary::after {
  content: "−";
}

.uncertainty-disclosure .uncertainty-note {
  position: absolute;
  z-index: 2;
  top: calc(100% + 7px);
  left: 0;
  width: min(320px, calc(100vw - 48px));
  margin: 0;
  box-shadow: 0 8px 22px rgba(35, 57, 79, 0.13);
}

body[data-theme="dark"] .question-map-item {
  color: #c5d0dc;
  background: #1b2936;
  border-color: #344656;
}

body[data-theme="dark"] .question-map-item.is-unvisited {
  color: #a4b3c2;
  background: #2b3946;
  border-color: #2b3946;
}

body[data-theme="dark"] .question-map-item.is-answered {
  color: #102928;
  background: var(--teal);
  border-color: var(--teal);
}

body[data-theme="dark"] .uncertainty-disclosure .uncertainty-note {
  color: #f3d87c;
  background: #453b20;
  border-color: #71612c;
}

@media (max-width: 760px) {
  .question-map {
    grid-column: 1 / -1;
    grid-row: 3;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    max-height: 220px;
    gap: 6px;
    margin-top: 14px;
  }
}

@media (max-width: 440px) {
  .topbar-actions {
    gap: 3px;
  }

  .header-home {
    min-height: 36px;
    padding: 0 7px;
    font-size: 10px;
  }

  .question-map {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 5px;
  }
}

.full-settings {
  max-width: 860px;
  margin: 0 auto;
  padding: 30px;
  background: var(--paper);
  border: 1px solid rgba(225, 232, 238, 0.88);
  border-radius: 17px;
  box-shadow: var(--shadow);
}

.settings-intro {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.correction-options {
  display: grid;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  border: 0;
}

.correction-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

.correction-option:has(input:checked) {
  background: var(--teal-light);
  border-color: var(--teal);
}

.correction-option input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--teal);
}

.correction-option-copy {
  display: grid;
  gap: 4px;
}

.correction-option-copy strong {
  font-size: 13px;
}

.correction-option-copy span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.settings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.answer-check {
  display: grid;
  justify-items: start;
  gap: 10px;
  margin-top: 15px;
}

.answer-check .feedback {
  margin-top: 0;
}

body[data-theme="dark"] .correction-option {
  color: var(--ink);
  background: #1b2936;
  border-color: #30404e;
}

body[data-theme="dark"] .correction-option:has(input:checked) {
  background: #203d41;
  border-color: #4b9991;
}

body[data-theme="dark"] .feedback.is-correct {
  color: #a3e1bd;
  background: #203b32;
}

body[data-theme="dark"] .feedback.is-incorrect {
  color: #ffb8aa;
  background: #462e2d;
}

body[data-theme="dark"] .feedback p {
  color: #c0cbd6;
}

@media (max-width: 760px) {
  .full-settings {
    padding: 23px 20px;
  }
}

@media (max-width: 440px) {
  .full-settings {
    padding: 20px 16px;
  }

  .settings-footer .button {
    font-size: 10px;
  }
}
