@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #f5f4f0;
  --paper: #ffffff;
  --ink: #1c292d;
  --muted: #667277;
  --line: #d8ddda;
  --line-soft: #e9ece9;
  --navy: #173e47;
  --navy-hover: #225562;
  --teal: #0e7777;
  --teal-wash: #e8f3f1;
  --amber: #a35d13;
  --amber-wash: #fff5e7;
  --rose: #a54045;
  --rose-wash: #faedef;
  --on-primary: #ffffff;
  --shadow: 0 3px 14px rgba(28, 41, 45, .035);
  font-family: 'DM Sans', Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #5ba8a3; outline-offset: 3px; }
button:active:not(:disabled) { transform: scale(.98); }
::selection { background: #b5d9d2; }
.mono { font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-header {
  min-height: 72px; padding: 0 max(28px, calc((100vw - 1180px) / 2));
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  border-bottom: 1px solid var(--line); background: rgba(255,255,255,.55);
}
.header-actions { display: flex; align-items: center; gap: 18px; }
.theme-toggle { flex: 0 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -.035em; font-size: 18px; }
.brand-mark { width: 29px; height: 29px; border: 2px solid var(--navy); border-radius: 7px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; padding: 5px; transform: rotate(-5deg); }
.brand-mark i { display: block; background: var(--navy); border-radius: 1px; }
.brand-mark i:nth-child(2) { background: var(--teal); }
.header-meta { display: flex; align-items: center; gap: 13px; color: var(--muted); font-size: 13px; }
.header-meta strong { color: var(--ink); font-weight: 600; }
.header-divider { height: 19px; width: 1px; background: var(--line); }
.main-wrap { width: min(100% - 48px, 1100px); margin: 0 auto; flex: 1; }

.home { padding: 44px 0 56px; }
.eyebrow { margin: 0 0 14px; color: var(--teal); text-transform: uppercase; font-size: 12px; font-weight: 700; letter-spacing: .14em; }
.home-title { margin: 0 0 30px; font-size: clamp(38px, 5vw, 56px); letter-spacing: -.055em; font-weight: 600; line-height: .99; }
.home-title span, .title-period { color: #8f9b99; }
.config { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.config-panel { padding: 23px; }
.section-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 14px; color: var(--ink); font-weight: 700; font-size: 14px; }
.section-label small { color: var(--muted); font-weight: 500; font-size: 12px; }
.topic-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.topic-button, .segment-button { color: var(--ink); background: #fff; border: 1px solid var(--line); }
.topic-button { min-height: 72px; border-radius: 11px; padding: 13px 15px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; gap: 5px; font-weight: 600; }
.topic-button span:last-child { color: var(--muted); font-size: 12px; font-weight: 500; }
.topic-button.active, .segment-button.active { border-color: var(--teal); background: var(--teal-wash); box-shadow: inset 0 0 0 1px var(--teal); }
.topic-button:hover:not(.active), .segment-button:hover:not(.active), .quiet-button:hover { border-color: #9baba8; background: #f9fbfa; }
.topic-button:first-child { grid-column: 1 / -1; min-height: 60px; flex-direction: row; align-items: center; }
.config-column { display: grid; gap: 16px; }
.segment-row { display: flex; gap: 8px; }
.segment-button { flex: 1; min-height: 51px; border-radius: 10px; padding: 8px 10px; font-weight: 700; font-size: 14px; }
.segment-button small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); margin-top: 3px; }
.start-panel { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding: 20px 23px; background: #e9efeb; border: 1px solid #d3dfd9; border-radius: 12px; }
.start-summary { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.start-detail { margin: 0; color: var(--muted); font-size: 13px; }
.primary-button { background: var(--navy); color: var(--on-primary); border: 1px solid var(--navy); border-radius: 10px; padding: 12px 18px; min-height: 48px; font-size: 14px; font-weight: 700; white-space: nowrap; transition: background 120ms ease, transform 120ms ease; }
.primary-button:hover:not(:disabled) { background: var(--navy-hover); }
.quiet-button, .ghost-button { background: #fff; border: 1px solid var(--line); color: var(--ink); border-radius: 9px; padding: 10px 13px; min-height: 40px; font-size: 13px; font-weight: 700; }
.ghost-button { background: transparent; }
.recent { margin-top: 38px; border-top: 1px solid var(--line); padding-top: 22px; }
.recent-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.recent h2 { margin: 0; font-size: 14px; }
.recent-list { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 13px; }
.recent-item { border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 10px 12px; color: var(--muted); font-size: 12px; }
.recent-item strong { color: var(--ink); font-weight: 700; }
.recent-review { text-align: left; }
.recent-review:hover { border-color: var(--teal); background: var(--teal-wash); }
.footer-note { margin: 31px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.footer-note a { color: inherit; }

.exam-header { height: 73px; padding: 0 max(26px, calc((100vw - 1180px) / 2)); background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.exam-header-left { display: flex; align-items: center; gap: 18px; min-width: 0; }
.exam-badge { color: var(--teal); background: var(--teal-wash); font-size: 10px; font-weight: 700; letter-spacing: .12em; border-radius: 5px; padding: 6px 8px; white-space: nowrap; }
.exam-title { font-weight: 700; letter-spacing: -.025em; font-size: 16px; white-space: nowrap; }
.exam-title-short { display: none; font-weight: 700; font-size: 14px; }
.exam-header-right { display: flex; align-items: center; gap: 8px; }
.timer { min-width: 97px; text-align: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafbf9; font-size: 15px; font-weight: 600; }
.timer.urgent { color: var(--rose); border-color: #eac3c6; background: var(--rose-wash); }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; font-size: 17px; }
.icon-button:hover { background: #f5f8f6; }
.exam-wrap { width: min(100% - 48px, 940px); margin: 30px auto 48px; }
.question-meta { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.question-count { font-size: 13px; font-weight: 700; }
.question-type { font-size: 12px; color: var(--muted); }
.progress-track { height: 4px; border-radius: 5px; background: #dfe5e2; overflow: hidden; margin-bottom: 22px; }
.progress-track > span { display: block; height: 100%; background: var(--teal); }
.question-card { padding: 38px 47px 44px; }
.question-prompt { font-size: 21px; line-height: 1.5; letter-spacing: -.02em; margin: 0 0 30px; max-width: 760px; }
.question-prompt strong { font-weight: 700; }
.question-stem { margin: 0 0 20px; font-size: 19px; line-height: 1.5; }
.quantity-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 27px; }
.quantity { border: 1px solid var(--line); border-radius: 10px; min-height: 106px; padding: 16px 20px; display: flex; flex-direction: column; justify-content: center; gap: 9px; }
.quantity small { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 700; letter-spacing: .1em; }
.quantity strong { font-size: 22px; font-weight: 600; }
.answer-list { display: grid; gap: 8px; }
.answer-option { min-height: 52px; border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; display: flex; align-items: center; gap: 14px; cursor: pointer; background: #fff; font-size: 15px; line-height: 1.4; }
.answer-option:hover { border-color: #96ada8; background: #fafcfb; }
.answer-option.selected { border-color: var(--teal); background: var(--teal-wash); box-shadow: inset 0 0 0 1px var(--teal); }
.answer-option:has(input:focus-visible) { outline: 3px solid #5ba8a3; outline-offset: 3px; }
.answer-option:has(input[type="radio"]) .option-key { border-radius: 50%; }
.answer-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option-key { width: 27px; height: 27px; flex: 0 0 27px; border: 1px solid #bdc8c4; border-radius: 6px; display: grid; place-items: center; color: var(--muted); font-size: 12px; font-weight: 700; background: #fff; }
.selected .option-key { background: var(--teal); border-color: var(--teal); color: var(--on-primary); }
.numeric-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 11px; }
.numeric-input { border: 1px solid #9dacaa; border-radius: 9px; padding: 15px 16px; width: min(100%, 240px); font-size: 23px; font-family: 'IBM Plex Mono', monospace; }
.numeric-hint { display: block; font-size: 12px; color: var(--muted); margin-top: 10px; }
.data-table { border-collapse: collapse; margin: 4px 0 25px; font-size: 14px; width: min(100%, 540px); max-width: 100%; overflow-wrap: anywhere; }
.data-table caption { text-align: left; color: var(--muted); font-size: 12px; font-weight: 700; padding-bottom: 8px; }
.data-table th, .data-table td { border: 1px solid var(--line); padding: 9px 13px; text-align: right; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table th { background: #f2f6f3; font-weight: 700; }
.exam-footer { margin-top: 14px; }
.exam-footer-inner { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.footer-nav { display: flex; align-items: center; gap: 8px; }
.mark-button.marked { color: var(--amber); border-color: #eccb9f; background: var(--amber-wash); }
.question-dots { color: var(--muted); font-size: 12px; }

.overlay { position: fixed; inset: 0; background: rgba(18, 32, 35, .37); z-index: 20; display: flex; justify-content: flex-end; }
.review-drawer { height: 100%; overflow-y: auto; overscroll-behavior: contain; width: min(100%, 420px); padding: 31px 28px; background: #fff; box-shadow: -15px 0 40px rgba(0,0,0,.12); display: flex; flex-direction: column; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.dialog-head h2 { margin: 0; font-size: 26px; letter-spacing: -.045em; }
.dialog-head p { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.review-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; margin: 29px 0 18px; }
.review-number { border: 1px solid var(--line); border-radius: 9px; background: #fff; aspect-ratio: 1; min-width: 0; font-family: 'IBM Plex Mono', monospace; font-weight: 600; position: relative; }
.review-number.answered { background: var(--teal-wash); border-color: #9bc6c1; }
.review-number.current { box-shadow: inset 0 0 0 2px var(--navy); }
.review-number.marked::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); position: absolute; top: 6px; right: 6px; }
.review-legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.legend-swatch { display: inline-block; width: 10px; height: 10px; border: 1px solid #9bc6c1; background: var(--teal-wash); border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; background: var(--amber); border-radius: 50%; margin-right: 5px; }
.drawer-actions { padding-top: 24px; margin-top: auto; display: flex; flex-direction: column; gap: 9px; }
.drawer-actions .primary-button, .drawer-actions .quiet-button { width: 100%; }
.confirm-overlay { justify-content: center; align-items: center; padding: 20px; }
.confirm-card { width: min(100%, 400px); background: #fff; border-radius: 17px; padding: 26px; box-shadow: 0 24px 70px rgba(0,0,0,.15); }
.confirm-card h2 { margin: 0 0 8px; font-size: 23px; letter-spacing: -.04em; }
.confirm-card p { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 9px; }
.calc { position: fixed; top: 78px; right: max(25px, calc((100vw - 1180px) / 2)); width: 254px; z-index: 25; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 17px 45px rgba(0,0,0,.16); padding: 14px; }
.calc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 12px; color: var(--muted); font-weight: 700; }
.calc-screen { height: 58px; border: 1px solid var(--line); background: #f6f8f6; border-radius: 7px; display: flex; align-items: center; justify-content: flex-end; padding: 9px 12px; overflow: hidden; white-space: nowrap; font: 22px 'IBM Plex Mono', monospace; }
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.calc-grid button { height: 42px; border: 1px solid var(--line); background: #fff; border-radius: 7px; font-size: 15px; }
.calc-grid button.operator { background: #edf3ef; }
.calc-grid button.equals { background: var(--navy); color: var(--on-primary); border-color: var(--navy); }

.results { padding: 55px 0 85px; }
.results-top { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 29px; }
.results-top h1 { margin: 0; font-size: clamp(36px, 5vw, 52px); letter-spacing: -.055em; line-height: 1; font-weight: 600; }
.results-meta { color: var(--muted); font-size: 13px; margin-top: 14px; }
.results-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.score-line { display: flex; align-items: baseline; gap: 8px; margin-bottom: 20px; }
.score-line strong { font-size: 51px; line-height: 1; font-weight: 600; letter-spacing: -.065em; }
.score-line span { color: var(--muted); font-size: 15px; }
.results-layout { display: grid; grid-template-columns: 330px 1fr; gap: 19px; align-items: start; }
.results-list { padding: 9px; min-width: 0; }
.result-row { width: 100%; text-align: left; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 12px 13px; display: flex; align-items: center; gap: 10px; }
.result-row:hover { background: #f6f8f6; }
.result-row.active { border-color: #a4c9c4; background: var(--teal-wash); }
.result-status { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.result-status.correct { color: var(--teal); background: var(--teal-wash); }
.result-status.wrong { color: var(--rose); background: var(--rose-wash); }
.result-status.skipped { color: var(--muted); background: #edf0ee; }
.result-row-text { display: flex; flex-direction: column; min-width: 0; }
.result-row-text strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-row-text small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.result-row-time { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }
.detail-panel { min-width: 0; padding: 29px 34px 34px; min-height: 440px; }
.detail-kicker { font-size: 11px; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: .13em; }
.detail-panel h2 { font-size: 22px; line-height: 1.4; letter-spacing: -.035em; margin: 14px 0 18px; font-weight: 600; }
.detail-panel .quantity-row { margin-top: 14px; }
.detail-answers { display: flex; flex-wrap: wrap; gap: 9px; margin: 23px 0 25px; }
.review-options { display: grid; gap: 7px; margin: 18px 0 20px; }
.review-option { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px 10px; font-size: 13px; line-height: 1.4; }
.review-option.right-choice { background: var(--teal-wash); border-color: #a4c9c4; }
.review-option.wrong-choice { background: var(--rose-wash); border-color: #e2babd; }
.review-option strong { margin-left: auto; font-size: 11px; white-space: nowrap; }
.answer-pill { border-radius: 7px; padding: 9px 11px; background: #f1f5f3; font-size: 13px; }
.answer-pill.bad { background: var(--rose-wash); }
.answer-pill strong { font-weight: 700; }
.explanation { border-top: 1px solid var(--line-soft); padding-top: 19px; font-size: 15px; line-height: 1.6; }
.explanation h3 { margin: 0 0 7px; font-size: 12px; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); }
.explanation p { margin: 0 0 16px; }
.explanation p:last-child { margin-bottom: 0; }
.faster { margin-top: 20px; background: #f3f7f4; border-left: 3px solid var(--teal); padding: 12px 15px; border-radius: 0 7px 7px 0; font-size: 14px; line-height: 1.5; }
.faster strong { display: block; margin-bottom: 3px; }

@media (max-width: 900px) {
  .config { grid-template-columns: 1fr; }
  .config-column { grid-template-columns: 1fr 1fr; }
  .start-panel { grid-column: 1 / -1; }
  .results-layout { grid-template-columns: 280px 1fr; }
}
@media (max-width: 650px) {
  .site-header, .exam-header { padding-left: 18px; padding-right: 18px; }
  .main-wrap, .exam-wrap { width: min(100% - 32px, 940px); }
  .home { padding-top: 30px; }
  .home-title { margin-bottom: 30px; }
  .config-column { grid-template-columns: 1fr; }
  .config { gap: 16px; }
  .config-panel { padding: 21px; }
  .start-panel { align-items: stretch; flex-direction: column; }
  .header-meta { display: none; }
  .exam-header-left { gap: 8px; }
  .exam-title { display: none; }
  .exam-title-short { display: inline; }
  .exam-badge { display: none; }
  .timer { min-width: 76px; font-size: 12px; padding: 10px 7px; }
  .exam-wrap { margin-top: 25px; margin-bottom: 40px; }
  .question-card { padding: 25px 21px 32px; }
  .question-prompt, .question-stem { font-size: 18px; }
  .quantity { padding: 13px; min-height: 96px; }
  .quantity strong { font-size: 17px; overflow-wrap: anywhere; }
  .quantity { min-width: 0; }
  .review-option { flex-wrap: wrap; }
  .review-option > span:nth-child(2) { flex: 1; min-width: 0; }
  .data-table th, .data-table td { padding: 8px; }
  .question-type { font-size: 11px; text-align: right; }
  .question-dots { display: none; }
  .footer-nav { gap: 5px; }
  .footer-nav .quiet-button { padding-left: 9px; padding-right: 9px; }
  .mark-button { font-size: 0; width: 41px; padding: 0; }
  .mark-button::before { content: '⚑'; font-size: 17px; }
  .results { padding-top: 35px; }
  .results-top { flex-direction: column; align-items: start; }
  .results-layout { grid-template-columns: 1fr; }
  .results-list { display: flex; overflow-x: auto; max-width: 100%; scroll-snap-type: x proximity; }
  .result-row { min-width: 190px; flex: 0 0 190px; scroll-snap-align: start; }
  .detail-panel { min-width: 0; padding: 22px; }
  .calc { right: 12px; top: 69px; }
}
@media (prefers-reduced-motion: reduce) {
  .primary-button, button { transition: none !important; }
  button:active:not(:disabled) { transform: none; }
}

/* Keep the primary exam action in a consistent place. */
.footer-nav [data-action="review"] { background: #fff; color: var(--ink); border-color: var(--line); }
.footer-nav [data-action="review"]:hover { background: #f2f6f3; }
.footer-nav [data-action="next"]:not(:disabled) { background: var(--navy); color: var(--on-primary); border-color: var(--navy); }
.footer-nav [data-action="next"]:hover:not(:disabled) { background: var(--navy-hover); }
.footer-nav:has([data-action="next"]:disabled) [data-action="review"] { background: var(--navy); color: var(--on-primary); border-color: var(--navy); }
@media (max-width: 420px) {
  .exam-footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
  .footer-nav { grid-column: 1 / -1; grid-row: 1; }
  .footer-nav > button { flex: 1; }
  .mark-button { grid-column: 1; grid-row: 2; font-size: 12px; width: max-content; padding: 8px 10px; }
  .mark-button::before { content: none; }
  .question-dots { display: block; grid-column: 2; grid-row: 2; }
}
@media (max-width: 380px) {
  .exam-header { gap: 8px; padding-inline: 12px; }
  .exam-header-right { gap: 5px; }
  .icon-button { width: 36px; flex-shrink: 0; }
  .footer-nav .quiet-button { padding-inline: 7px; }
  .footer-nav .primary-button { padding-inline: 12px; }
  .question-card { padding-inline: 17px; }
  .question-meta { align-items: flex-start; }
  .question-count { white-space: nowrap; }
}
@media (min-width: 651px) {
  .results-list { max-height: min(70vh, 720px); overflow-y: auto; overscroll-behavior: contain; }
  .detail-panel { position: sticky; top: 24px; }
}
@media (max-width: 650px) {
  .home { padding-top: 24px; }
  .home .eyebrow { margin-bottom: 10px; }
  .home-title { margin-bottom: 24px; }
  .config-panel { padding: 18px; }
  .config-column .config-panel { padding: 16px 18px; }
  .topic-button { min-height: 63px; padding: 10px 12px; }
  .topic-button:first-child { min-height: 50px; }
  .section-label { margin-bottom: 12px; }
  .start-panel { padding: 18px; gap: 14px; }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101719;
  --paper: #1b272a;
  --ink: #e9f1ef;
  --muted: #afbfbd;
  --line: #394b4e;
  --line-soft: #304145;
  --navy: #84d8ce;
  --navy-hover: #a0e9df;
  --teal: #87d7cd;
  --teal-wash: #25413f;
  --amber: #efc187;
  --amber-wash: #403329;
  --rose: #f0a5ae;
  --rose-wash: #422e33;
  --on-primary: #102427;
  --shadow: 0 5px 22px rgba(0, 0, 0, .12);
}
html[data-theme="dark"] a:focus-visible,
html[data-theme="dark"] button:focus-visible,
html[data-theme="dark"] input:focus-visible,
html[data-theme="dark"] .answer-option:has(input:focus-visible) { outline-color: #9be5dc; }
html[data-theme="dark"] ::selection { background: #35645f; }
html[data-theme="dark"] .site-header,
html[data-theme="dark"] .exam-header { background: #172124; }
html[data-theme="dark"] .topic-button,
html[data-theme="dark"] .segment-button,
html[data-theme="dark"] .quiet-button,
html[data-theme="dark"] .recent-item,
html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .timer,
html[data-theme="dark"] .answer-option,
html[data-theme="dark"] .option-key,
html[data-theme="dark"] .numeric-input,
html[data-theme="dark"] .review-drawer,
html[data-theme="dark"] .review-number,
html[data-theme="dark"] .confirm-card,
html[data-theme="dark"] .calc,
html[data-theme="dark"] .calc-grid button,
html[data-theme="dark"] .footer-nav [data-action="review"] { background: var(--paper); color: var(--ink); }
html[data-theme="dark"] .topic-button.active,
html[data-theme="dark"] .segment-button.active,
html[data-theme="dark"] .answer-option.selected,
html[data-theme="dark"] .review-number.answered,
html[data-theme="dark"] .result-row.active,
html[data-theme="dark"] .review-option.right-choice { background: var(--teal-wash); border-color: #5d918a; }
html[data-theme="dark"] .selected .option-key { background: var(--teal); color: var(--on-primary); border-color: var(--teal); }
html[data-theme="dark"] .topic-button:hover:not(.active),
html[data-theme="dark"] .segment-button:hover:not(.active),
html[data-theme="dark"] .quiet-button:hover,
html[data-theme="dark"] .icon-button:hover,
html[data-theme="dark"] .answer-option:hover:not(.selected),
html[data-theme="dark"] .result-row:hover,
html[data-theme="dark"] .recent-review:hover,
html[data-theme="dark"] .footer-nav [data-action="review"]:hover { background: #29393c; border-color: #6e928e; }
html[data-theme="dark"] .start-panel { background: #203233; border-color: #3d5959; }
html[data-theme="dark"] .timer.urgent { color: var(--rose); background: var(--rose-wash); border-color: #96616b; }
html[data-theme="dark"] .progress-track { background: #344548; }
html[data-theme="dark"] .option-key { border-color: #66817f; }
html[data-theme="dark"] .numeric-input { border-color: #7c9996; }
html[data-theme="dark"] .data-table th { background: #26373a; }
html[data-theme="dark"] .mark-button.marked { color: var(--amber); background: var(--amber-wash); border-color: #916e47; }
html[data-theme="dark"] .overlay { background: rgba(0, 0, 0, .62); }
html[data-theme="dark"] .review-number.answered,
html[data-theme="dark"] .legend-swatch { border-color: #5d918a; }
html[data-theme="dark"] .calc-screen { background: #132023; }
html[data-theme="dark"] .calc-grid button.operator { background: #2a3c3e; }
html[data-theme="dark"] .calc-grid button.equals { background: var(--navy); color: var(--on-primary); border-color: var(--navy); }
html[data-theme="dark"] .result-status.skipped { background: #2a393c; }
html[data-theme="dark"] .review-option.wrong-choice { border-color: #97626a; }
html[data-theme="dark"] .answer-pill { background: #293b3d; }
html[data-theme="dark"] .answer-pill.bad { background: var(--rose-wash); }
html[data-theme="dark"] .faster { background: #213638; }
html[data-theme="dark"] .home-title span,
html[data-theme="dark"] .title-period { color: #78918f; }
html[data-theme="dark"] .footer-nav [data-action="next"]:not(:disabled),
html[data-theme="dark"] .footer-nav:has([data-action="next"]:disabled) [data-action="review"] { background: var(--navy); color: var(--on-primary); border-color: var(--navy); }
