.quiz-app {
  color-scheme: light;
  --bg: #f4fafb;
  --bg-2: #fffaf3;
  --panel: #fff;
  --panel-solid: #fff;
  --surface: #f0f8fa;
  --surface-2: #dff3f6;
  --line: #d5e3e6;
  --line-bright: #b6cdd2;
  --text: #4f5b60;
  --muted: #6c787d;
  --faint: #829095;
  --accent: #0095bd;
  --accent-2: #007ea5;
  --cyan: #0095bd;
  --warning: #b96b00;
  --danger: #c94343;
  --success: #217a52;
  --radius: 4px;
  --shadow: 0 1px 3px rgba(20, 32, 38, .08);
  color: var(--text);
  background: linear-gradient(120deg, #f2fbfd 0, #fbfdfc 58%, #fffaf3 100%);
}

.quiz-app .topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr);
  min-height: 82px;
  padding: 10px 28px;
  border: 0;
  border-top: 4px solid #3bb6bd;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .98);
  box-shadow: none;
  backdrop-filter: blur(12px);
}
.quiz-app .brand { gap: 14px; }
.quiz-app .brand-logo {
  width: 102px;
  height: 60px;
  padding: 5px 7px;
  border: 0;
  border-radius: 10px;
  background: #fff;
}
.quiz-app .brand-logo img { width: 88px; }
.quiz-app .brand-title { padding-left: 14px; border-color: var(--line); }
.quiz-app .brand-title strong { color: var(--text); font-size: 1.18rem; }
.quiz-app .brand-title small { margin-top: 5px; color: var(--muted); font-size: .66rem; }
.quiz-app .mode-navigation {
  justify-self: center;
  justify-content: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #eef6f7;
}
.quiz-app .mode-navigation a {
  min-width: 110px;
  padding: 8px 14px;
  border-radius: 2px;
  color: #56656a;
  text-align: center;
}
.quiz-app .mode-navigation a:hover,
.quiz-app .mode-navigation a:focus-visible { color: var(--accent-2); background: #fff; }
.quiz-app .mode-navigation a.active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  box-shadow: var(--shadow);
}
.quiz-app .theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line-bright);
  border-radius: 4px;
  color: #3f4548;
  background: #fff;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  justify-self: end;
}
.quiz-app .theme-toggle:hover { color: var(--accent-2); border-color: var(--accent); }

.quiz-page {
  display: grid;
  gap: 20px;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 36px clamp(18px, 4vw, 52px) 64px;
}
.quiz-hero,
.quiz-shell,
.result-panel,
.quiz-info {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-solid);
  box-shadow: none;
}
.quiz-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 42px;
  padding: 34px 38px;
  border-top: 3px solid var(--accent);
}
.quiz-hero h1 {
  max-width: 740px;
  margin: 0 0 12px;
  color: var(--text);
  font-size: clamp(1.8rem, 3vw, 2.65rem);
  line-height: 1.08;
}
.quiz-hero p:last-child { max-width: 760px; margin: 0; color: var(--muted); }
.eyebrow { color: var(--accent-2); }
.pool-badge {
  display: grid;
  place-items: center;
  width: 132px;
  min-height: 104px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.pool-badge strong { color: var(--accent-2); font: 700 2.4rem "JetBrains Mono", monospace; line-height: 1; }
.pool-badge span { color: var(--muted); font-size: .72rem; line-height: 1.25; }
.noscript-warning { padding: 14px 16px; border: 1px solid var(--danger); color: var(--danger); background: #fff1f0; }

.quiz-shell,
.result-panel { padding: clamp(24px, 4vw, 42px); }
.quiz-progress { margin-bottom: 34px; }
.quiz-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
  color: var(--faint);
  font: 600 .72rem "JetBrains Mono", monospace;
}
.progress-track { height: 5px; overflow: hidden; background: #e8ebe9; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .28s ease; }
.quiz-session-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; }
.quiz-session-tools p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.quiz-session-tools p[hidden] { display: none; }
.quiz-session-tools .btn { margin-left: auto; }
.question-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.question-number { color: var(--accent-2); font: 700 .9rem "JetBrains Mono", monospace; }
.category-badge {
  padding: 4px 9px;
  border: 1px solid #bcd7e1;
  border-radius: 99px;
  color: var(--accent-2);
  background: #eef8fb;
  font-size: .72rem;
}
#question-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
#question-heading {
  max-width: 880px;
  margin: 0 0 18px;
  color: var(--text);
  font-size: clamp(1.2rem, 2.5vw, 1.65rem);
  font-weight: 700;
  line-height: 1.35;
}
#question-heading:focus-visible,
#result-title:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; border-radius: 2px; }
.question-hint { width: fit-content; margin: 0 0 22px; color: var(--muted); font-size: .78rem; }
.question-hint summary { min-height: 36px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 3px; cursor: pointer; }
.question-hint p { max-width: 700px; margin: 10px 4px 0; color: var(--muted); }
.answer-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.answer-option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 68px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: #fff;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.answer-option:hover { border-color: #8ea9b3; background: #f8fbfc; }
.answer-option:has(input:focus-visible) { outline: 3px solid rgba(0, 136, 183, .45); outline-offset: 2px; }
.answer-option:has(input:checked) { border-color: var(--accent); background: #eef8fb; }
.answer-option.correct { border-color: var(--success); background: #edf8f2; }
.answer-option.wrong { border-color: var(--danger); background: #fff1f0; }
.answer-option input { flex: 0 0 auto; width: 19px; height: 19px; margin: 1px 0 0; accent-color: var(--accent); }
.answer-letter { color: var(--faint); font: 700 .78rem "JetBrains Mono", monospace; }
.answer-text { line-height: 1.45; }
.feedback {
  margin-top: 20px;
  padding: 15px 17px;
  border-left: 4px solid var(--success);
  color: var(--text);
  background: #edf8f2;
  line-height: 1.55;
}
.feedback.wrong { border-left-color: var(--danger); background: #fff1f0; }
.feedback strong { color: var(--text); }
.quiz-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.quiz-actions .btn { min-width: 180px; border-radius: var(--radius); }
.quiz-actions #previous-question { margin-right: auto; }
.quiz-actions [hidden] { display: none; }
.result-panel[hidden],
.quiz-shell[hidden] { display: none; }

.result-hero { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.result-hero p:last-child { max-width: 720px; margin: 8px 0 0; color: var(--muted); }
.result-ring {
  --ring-color: var(--accent);
  flex: 0 0 auto;
  display: grid;
  place-content: center;
  width: 126px;
  height: 126px;
  border-radius: 50%;
  background: radial-gradient(circle at center, #fff 55%, transparent 56%), conic-gradient(var(--ring-color) calc(var(--result-percent) * 1%), #e3e7e5 0);
  text-align: center;
}
.result-ring strong { color: var(--text); font: 700 2rem "JetBrains Mono", monospace; line-height: 1; }
.result-ring span { margin-top: 5px; color: var(--faint); font-size: .7rem; }
.result-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); gap: 28px; margin-top: 28px; }
.result-grid h3,
.review-section h3 { margin-bottom: 14px; }
.category-results { display: grid; gap: 10px; }
.category-result { display: grid; grid-template-columns: minmax(145px, 1fr) minmax(100px, 1.4fr) auto; align-items: center; gap: 12px; }
.category-result > span:first-child { color: var(--text); font-size: .76rem; }
.mini-track { height: 6px; overflow: hidden; background: #e3e7e5; }
.mini-track span { display: block; height: 100%; background: var(--accent); }
.category-result strong { color: var(--faint); font: 600 .7rem "JetBrains Mono", monospace; }
.recommendation { height: 100%; padding: 16px; border: 1px solid #e6c997; color: var(--text); background: #fff9ed; line-height: 1.55; }
.recommendation strong { color: var(--warning); }
.review-section { margin-top: 30px; padding-top: 28px; border-top: 1px solid var(--line); }
.review-section > p { margin: -6px 0 16px; color: var(--muted); font-size: .78rem; }
.review-list { display: grid; gap: 8px; }
.review-item { border: 1px solid var(--line); background: #fff; }
.review-item summary { min-height: 46px; padding: 12px 14px; cursor: pointer; line-height: 1.4; }
.review-state { display: inline-block; margin-right: 10px; color: var(--success); font: 700 .7rem "JetBrains Mono", monospace; }
.review-state.wrong { color: var(--danger); }
.review-content { padding: 0 14px 15px 38px; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.review-content p { margin: 5px 0; }
.review-content strong { color: var(--text); }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

.quiz-info { display: grid; grid-template-columns: minmax(210px, .55fr) minmax(0, 1.45fr); gap: 32px; padding: 28px 34px; }
.coverage-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 20px; margin: 0; padding: 0; list-style: none; }
.coverage-list li { position: relative; padding-left: 17px; color: var(--muted); font-size: .78rem; }
.coverage-list li::before { content: ""; position: absolute; top: .55em; left: 0; width: 6px; height: 6px; background: var(--accent); }
.quiz-app .site-footer { margin-top: 0; border-color: var(--line); background: var(--surface); box-shadow: none; }
.quiz-app .site-footer-content { width: min(1100px, calc(100% - 40px)); }
.quiz-app .ai-disclosure-mark { color: #fff; border-color: var(--accent); background: var(--accent); }
.quiz-app .ai-disclosure strong { color: var(--text); }
.quiz-app .ai-disclosure p { color: var(--muted); }

html[data-theme="dark"] .quiz-app {
  --bg: #0f171b;
  --bg-2: #141f24;
  --panel: #172329;
  --panel-solid: #172329;
  --surface: #1c2a30;
  --surface-2: #22343c;
  --line: #304047;
  --line-bright: #465a63;
  --text: #e3ecef;
  --muted: #a8b7bd;
  --faint: #84979f;
  --accent: #27a8cf;
  --accent-2: #65c5e5;
  --warning: #f0ad4e;
  --danger: #ed7a72;
  --success: #66c28e;
  color: var(--text);
  background: var(--bg);
}
html[data-theme="dark"] .quiz-app .topbar { border-color: var(--line); border-top-color: #3bb6bd; background: rgba(17, 27, 32, .98); }
html[data-theme="dark"] .quiz-app .brand-title { border-color: var(--line); }
html[data-theme="dark"] .quiz-app .brand-title strong { color: #edf4f6; }
html[data-theme="dark"] .quiz-app .brand-title small { color: #9babb2; }
html[data-theme="dark"] .quiz-app .mode-navigation { border-color: var(--line); background: #141f24; }
html[data-theme="dark"] .quiz-app .mode-navigation a { color: #aebcc1; }
html[data-theme="dark"] .quiz-app .mode-navigation a:hover,
html[data-theme="dark"] .quiz-app .mode-navigation a:focus-visible { color: #edf4f6; background: #1d2b31; }
html[data-theme="dark"] .quiz-app .mode-navigation a.active { border-color: #3b5059; color: #fff; background: #22343c; }
html[data-theme="dark"] .quiz-app .theme-toggle { color: #c5d1d5; border-color: var(--line-bright); background: #172329; }
html[data-theme="dark"] .quiz-app .quiz-hero,
html[data-theme="dark"] .quiz-app .quiz-shell,
html[data-theme="dark"] .quiz-app .result-panel,
html[data-theme="dark"] .quiz-app .quiz-info { border-color: var(--line); background: var(--panel-solid); }
html[data-theme="dark"] .quiz-app .pool-badge { border-color: var(--line); background: var(--surface); }
html[data-theme="dark"] .quiz-app .category-badge { border-color: #3f788c; color: #8bd7ef; background: #17313a; }
html[data-theme="dark"] .quiz-app .progress-track,
html[data-theme="dark"] .quiz-app .mini-track { background: #2a3a41; }
html[data-theme="dark"] .quiz-app .question-hint summary,
html[data-theme="dark"] .quiz-app .answer-option,
html[data-theme="dark"] .quiz-app .review-item { border-color: var(--line); color: var(--text); background: #121c21; }
html[data-theme="dark"] .quiz-app .answer-option:hover { border-color: #58717b; background: #1b2930; }
html[data-theme="dark"] .quiz-app .answer-option:has(input:checked) { border-color: var(--accent); background: #183642; }
html[data-theme="dark"] .quiz-app .answer-option.correct,
html[data-theme="dark"] .quiz-app .feedback { border-color: var(--success); background: #173128; }
html[data-theme="dark"] .quiz-app .answer-option.wrong,
html[data-theme="dark"] .quiz-app .feedback.wrong { border-color: var(--danger); background: #2b2021; }
html[data-theme="dark"] .quiz-app .result-ring { background: radial-gradient(circle at center, #172329 55%, transparent 56%), conic-gradient(var(--ring-color) calc(var(--result-percent) * 1%), #304047 0); }
html[data-theme="dark"] .quiz-app .recommendation { border-color: #695633; color: var(--text); background: #2b271d; }
html[data-theme="dark"] .quiz-app .site-footer { border-color: var(--line); background: #10181c; }
html[data-theme="dark"] .quiz-app .ai-disclosure strong { color: #dce7ea; }
html[data-theme="dark"] .quiz-app .ai-disclosure p { color: #8fa0a6; }

@media (max-width: 900px) {
  .quiz-app .topbar { grid-template-columns: 1fr auto; }
  .quiz-app .brand { grid-column: 1; }
  .quiz-app .theme-toggle { grid-column: 2; grid-row: 1; }
  .quiz-app .mode-navigation { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
  .quiz-app .mode-navigation a { flex: 1 1 0; min-width: 0; }
  .quiz-hero,
  .result-hero { align-items: flex-start; }
  .answer-list,
  .result-grid,
  .quiz-info { grid-template-columns: 1fr; }
}
@media (max-width: 580px) {
  .quiz-session-tools { align-items: flex-start; flex-direction: column; }
  .quiz-session-tools .btn { margin-left: 0; }
  .quiz-app .topbar { padding: 9px 14px; }
  .quiz-app .brand-title { display: none; }
  .quiz-app .mode-navigation a { padding-inline: 7px; font-size: .72rem; }
  .quiz-page { padding: 18px 12px 44px; }
  .quiz-hero { grid-template-columns: 1fr; gap: 22px; padding: 25px 21px; }
  .pool-badge { width: 100%; min-height: 0; grid-template-columns: auto auto; justify-content: start; gap: 10px; }
  .pool-badge strong { font-size: 1.8rem; }
  .pool-badge span { text-align: left; }
  .category-result { grid-template-columns: minmax(120px, 1fr) minmax(70px, 1fr) auto; }
}
@media (max-width: 430px) {
  .category-result { grid-template-columns: 1fr auto; }
  .category-result .mini-track { grid-column: 1 / -1; grid-row: 2; }
}
@media(prefers-reduced-motion:reduce) {
  .progress-track span,
  .answer-option { transition: none; }
}
@media(forced-colors:active) {
  .quiz-app .theme-toggle,
  .answer-option:has(input:checked),
  .answer-option.correct,
  .answer-option.wrong,
  .feedback,
  .recommendation { border: 2px solid CanvasText; }
  .progress-track span,
  .mini-track span,
  .coverage-list li::before { background: Highlight; }
}
@media print {
  .topbar,
  .quiz-hero,
  .quiz-shell,
  .quiz-info,
  .result-actions { display: none !important; }
  body { color: #000; background: #fff; }
  .result-panel { border: 0; box-shadow: none; background: #fff; }
  .review-item,
  .recommendation { break-inside: avoid; color: #000; background: #fff; }
}
