:root {
  --ink: #152238;
  --ink-soft: #526071;
  --paper: #f7f3ea;
  --paper-deep: #eee8dc;
  --white: #fffdf8;
  --navy: #183153;
  --navy-light: #284d77;
  --red: #b94235;
  --red-dark: #913127;
  --gold: #d6a73d;
  --green: #27765d;
  --line: #d8d1c4;
  --shadow: 0 18px 50px rgba(20, 34, 55, 0.11);
  --radius: 5px;
  --shell: min(1180px, calc(100% - 48px));
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, textarea, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.shell { width: var(--shell); margin-inline: auto; }
.screen { min-height: 100vh; }

.noscript {
  padding: 12px 20px;
  color: white;
  background: var(--red);
  text-align: center;
  font-weight: 700;
}

.site-header,
.result-header {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--navy);
  border-radius: 2px;
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  box-shadow: 4px 4px 0 var(--gold);
}

.brand strong,
.brand small { display: block; }
.brand strong { font-size: 13px; letter-spacing: 0.13em; }
.brand small { margin-top: 2px; color: var(--ink-soft); font-size: 11px; }

.text-button,
.icon-button,
.compact-brand {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.text-button {
  padding-bottom: 3px;
  border-bottom: 1px solid currentColor;
  font-size: 13px;
  font-weight: 700;
}

.hero {
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(350px, 0.78fr);
  align-items: center;
  gap: clamp(50px, 8vw, 110px);
  padding-block: 74px 92px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.19em;
}

.hero h1,
.section-heading h2,
.method h2,
.confirm-dialog h2,
.history-dialog h2,
.result-title,
.result-score strong {
  font-family: Georgia, "Times New Roman", serif;
}

.hero h1 {
  margin: 0;
  font-size: clamp(48px, 6.2vw, 82px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.hero h1 span { color: var(--red); font-style: italic; }

.hero-lead {
  max-width: 630px;
  margin: 30px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.primary-button,
.secondary-button,
.danger-button,
.submit-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 21px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.primary-button { color: white; border: 1px solid var(--navy); background: var(--navy); }
.primary-button:hover { background: var(--navy-light); transform: translateY(-1px); }
.secondary-button { color: var(--navy); border: 1px solid #a9b0b8; background: transparent; }
.secondary-button:hover { border-color: var(--navy); background: rgba(255,255,255,.45); }
.danger-button { color: white; border: 1px solid var(--red); background: var(--red); }
.danger-button:hover { background: var(--red-dark); }
.primary-button:disabled,
.secondary-button:disabled { opacity: .42; cursor: not-allowed; transform: none; }

.exam-ticket {
  position: relative;
  padding: 34px 34px 30px;
  overflow: hidden;
  color: var(--white);
  background: var(--navy);
  box-shadow: 14px 14px 0 #ded5c3, var(--shadow);
}

.exam-ticket::before,
.exam-ticket::after {
  position: absolute;
  left: -8px;
  width: 16px;
  height: 16px;
  content: "";
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 28px 0 var(--paper), 0 56px 0 var(--paper), 0 84px 0 var(--paper), 0 112px 0 var(--paper), 0 140px 0 var(--paper), 0 168px 0 var(--paper), 0 196px 0 var(--paper), 0 224px 0 var(--paper), 0 252px 0 var(--paper), 0 280px 0 var(--paper), 0 308px 0 var(--paper), 0 336px 0 var(--paper), 0 364px 0 var(--paper), 0 392px 0 var(--paper);
}

.exam-ticket::before { top: 8px; }
.exam-ticket::after { left: auto; right: -8px; top: 8px; }

.ticket-stamp {
  position: absolute;
  top: 28px;
  right: 30px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 11px;
  line-height: 1.1;
  text-align: center;
  transform: rotate(8deg);
}

.ticket-label { margin: 0; color: #aebbd0; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.ticket-time { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
.ticket-time strong { font-family: Georgia, serif; font-size: 78px; font-weight: 400; line-height: 1; }
.ticket-time span { color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .17em; }
.ticket-rule { height: 1px; margin: 22px 0; background: rgba(255,255,255,.22); }
.ticket-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; }
.ticket-stats div { padding: 0 14px; border-right: 1px solid rgba(255,255,255,.18); }
.ticket-stats div:first-child { padding-left: 0; }
.ticket-stats div:last-child { border: 0; }
.ticket-stats dt { color: var(--gold); font-family: Georgia, serif; font-size: 29px; }
.ticket-stats dd { margin: 2px 0 0; color: #c7d0dc; font-size: 10px; line-height: 1.35; }

.ticket-split { margin-top: 28px; }
.ticket-split span { display: block; width: var(--width, 100%); padding: 7px 9px; color: var(--navy); background: var(--gold); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.ticket-split span + span { color: #cbd5e0; background: rgba(255,255,255,.12); }
.ticket-note { margin: 22px 0 0; color: #9dabc0; font-size: 10px; text-align: center; }

.exam-section {
  padding-block: 78px 90px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 35px;
}

.section-heading h2,
.method h2 {
  margin: 0;
  font-size: clamp(36px, 4vw, 53px);
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1.05;
}

.section-heading > p { max-width: 370px; margin: 0; color: var(--ink-soft); font-size: 14px; }
.exam-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.chapter-group { grid-column: 1 / -1; padding-top: 22px; }
.chapter-group + .chapter-group { margin-top: 30px; padding-top: 48px; border-top: 1px solid var(--line); }
.chapter-heading { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 20px; }
.chapter-heading span { color: var(--red); font-size: 9px; font-weight: 900; letter-spacing: .15em; }
.chapter-heading h3 { margin: 6px 0 2px; font-family: Georgia, serif; font-size: 28px; font-weight: 500; }
.chapter-heading p { margin: 0; color: var(--ink-soft); font-size: 10px; }
.chapter-heading > strong { color: var(--green); font-size: 11px; white-space: nowrap; }
.chapter-exam-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.exam-card {
  position: relative;
  min-height: 285px;
  display: flex;
  flex-direction: column;
  padding: 26px;
  border: 1px solid var(--line);
  background: rgba(255,253,248,.67);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.exam-card:hover { border-color: #9da5ae; transform: translateY(-4px); box-shadow: var(--shadow); }
.exam-card.completed::after { position: absolute; top: 17px; right: 17px; padding: 4px 8px; content: "ĐÃ LÀM"; color: var(--green); border: 1px solid currentColor; font-size: 8px; font-weight: 900; letter-spacing: .12em; transform: rotate(3deg); }
.exam-card-code { color: var(--red); font-size: 10px; font-weight: 900; letter-spacing: .17em; }
.exam-card h3,
.exam-card h4 { margin: 19px 0 9px; font-family: Georgia, serif; font-size: 26px; font-weight: 500; }
.exam-card p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.exam-card-meta { display: flex; gap: 14px; margin-top: 17px; color: var(--ink-soft); font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.exam-card button { width: 100%; margin-top: auto; }
.exam-card-best { margin-top: 13px !important; color: var(--green) !important; font-weight: 700; }

.method {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 80px;
  padding-block: 90px;
  border-top: 1px solid var(--line);
}

.method-list { margin: 0; padding: 0; list-style: none; }
.method-list li { display: grid; grid-template-columns: 46px 1fr; gap: 20px; padding: 24px 0; border-top: 1px solid var(--line); }
.method-list li:last-child { border-bottom: 1px solid var(--line); }
.method-list > li > span { color: var(--red); font-family: Georgia, serif; font-size: 22px; }
.method-list strong { font-size: 15px; }
.method-list p { margin: 5px 0 0; color: var(--ink-soft); font-size: 13px; }

.site-footer { min-height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 10px; letter-spacing: .08em; }

/* Exam */
.exam-header {
  position: sticky;
  z-index: 20;
  top: 0;
  color: white;
  background: var(--navy);
  box-shadow: 0 3px 15px rgba(0,0,0,.12);
}

.exam-header-inner { height: 72px; display: grid; grid-template-columns: 230px 1fr auto; align-items: center; }
.compact-brand { height: 100%; display: flex; align-items: center; gap: 10px; padding-inline: 24px; color: white; border-right: 1px solid rgba(255,255,255,.14); }
.compact-brand span { width: 31px; height: 31px; display: grid; place-items: center; color: var(--navy); background: var(--gold); border-radius: 2px; font-family: Georgia, serif; font-size: 18px; }
.compact-brand strong { font-size: 10px; letter-spacing: .14em; }
.exam-identity { min-width: 0; padding-inline: 26px; }
.exam-identity span, .exam-identity strong { display: block; }
.exam-identity span { color: var(--gold); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.exam-identity strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.exam-header-actions { height: 100%; display: flex; align-items: center; }
.timer { height: 100%; min-width: 126px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-inline: 1px solid rgba(255,255,255,.14); }
.timer span { color: #9facbd; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.timer strong { margin-top: 1px; color: white; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 21px; letter-spacing: .04em; }
.timer.warning strong { color: #ffd56e; }
.timer.danger strong { color: #ff9388; animation: pulse 1s infinite; }
.submit-button { height: 100%; min-width: 125px; color: white; border: 0; border-radius: 0; background: var(--red); }
.submit-button:hover { background: var(--red-dark); }
.palette-toggle { display: none; width: 54px; height: 100%; place-items: center; color: white; }
.palette-toggle svg { width: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.time-progress { height: 3px; background: rgba(255,255,255,.12); }
.time-progress span { height: 100%; display: block; width: 100%; background: var(--gold); transition: width 1s linear, background 200ms ease; }

.exam-layout { min-height: calc(100vh - 75px); display: grid; grid-template-columns: 230px 1fr; }
.question-sidebar { position: sticky; top: 75px; height: calc(100vh - 75px); padding: 26px 22px; overflow-y: auto; border-right: 1px solid var(--line); background: #f0ebe0; }
.sidebar-head { display: flex; align-items: end; justify-content: space-between; }
.sidebar-head p { margin: 0; color: var(--ink-soft); font-size: 8px; font-weight: 900; letter-spacing: .15em; }
.sidebar-head strong { display: block; margin-top: 2px; font-size: 13px; }
.sidebar-head > span { color: var(--red); font-family: Georgia, serif; font-size: 23px; }
.answer-progress { height: 3px; margin: 13px 0 26px; overflow: hidden; background: #d9d1c2; }
.answer-progress span { height: 100%; display: block; width: 0; background: var(--green); transition: width 200ms ease; }
.palette-section + .palette-section { margin-top: 24px; }
.palette-label { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.palette-label small { color: var(--ink-soft); font-size: 9px; letter-spacing: 0; }
.question-palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.question-palette button { position: relative; aspect-ratio: 1; padding: 0; color: var(--ink-soft); border: 1px solid #cec6b7; border-radius: 2px; background: rgba(255,255,255,.48); cursor: pointer; font-size: 10px; font-weight: 800; }
.question-palette button:hover { border-color: var(--navy); }
.question-palette button.answered { color: white; border-color: var(--green); background: var(--green); }
.question-palette button.current { color: white; border-color: var(--navy); background: var(--navy); box-shadow: 0 0 0 2px var(--paper-deep), 0 0 0 3px var(--navy); }
.question-palette button.flagged::after { position: absolute; top: -4px; right: -4px; width: 8px; height: 8px; content: ""; border: 2px solid var(--paper-deep); border-radius: 50%; background: var(--gold); }
.palette-legend { display: grid; gap: 7px; margin-top: 27px; color: var(--ink-soft); font-size: 9px; }
.palette-legend span { display: flex; align-items: center; gap: 7px; }
.palette-legend i { width: 10px; height: 10px; display: block; border: 1px solid var(--line); border-radius: 2px; }
.legend-current { background: var(--navy); }
.legend-answered { background: var(--green); }
.legend-flagged { background: var(--gold); }
.save-status { margin: 25px 0 0; padding-top: 15px; color: var(--ink-soft); border-top: 1px solid var(--line); font-size: 9px; text-align: center; }
.save-status.saving { color: var(--red); }

.question-area { width: min(870px, calc(100% - 64px)); margin: 0 auto; padding: 52px 0 70px; scroll-margin-top: 75px; }
.question-content { min-height: 500px; }
.question-meta { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.question-kicker { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.question-number { color: var(--red); font-size: 10px; font-weight: 900; letter-spacing: .15em; }
.topic-badge { padding: 5px 9px; color: var(--navy); border: 1px solid #aeb8c4; border-radius: 99px; font-size: 9px; font-weight: 800; }
.point-badge { color: var(--ink-soft); font-size: 10px; }
.flag-button { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; color: var(--ink-soft); border: 0; background: transparent; cursor: pointer; font-size: 10px; font-weight: 800; }
.flag-button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.flag-button.active { color: #8b6711; }
.flag-button.active svg { fill: var(--gold); }
.question-title { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(25px, 3vw, 34px); font-weight: 500; line-height: 1.35; }
.question-title code, .inline-code { padding: 1px 5px; color: #7f312a; border: 1px solid #ddd2c3; border-radius: 2px; background: #efe8dc; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78em; }
.code-block { margin: 25px 0 0; padding: 19px 21px; overflow-x: auto; color: #dae5ef; border-left: 4px solid var(--gold); border-radius: 2px; background: #17273c; font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; tab-size: 2; white-space: pre-wrap; }
.options { display: grid; gap: 12px; margin-top: 34px; }
.option { position: relative; display: grid; grid-template-columns: 35px 1fr; align-items: center; gap: 14px; min-height: 58px; padding: 11px 17px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,253,248,.73); cursor: pointer; transition: border-color 130ms ease, background 130ms ease, transform 130ms ease; }
.option:hover { border-color: #939eaa; transform: translateX(2px); }
.option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.option-letter { width: 33px; height: 33px; display: grid; place-items: center; color: var(--ink-soft); border: 1px solid #bbb5aa; border-radius: 50%; font-family: Georgia, serif; font-size: 13px; }
.option-text { font-size: 14px; }
.option:not(.correct):not(.incorrect):has(input:checked) { border-color: var(--navy); background: #e8edf2; box-shadow: inset 3px 0 0 var(--navy); }
.option:not(.correct):not(.incorrect):has(input:checked) .option-letter { color: white; border-color: var(--navy); background: var(--navy); }
.option:has(input:focus-visible) { outline: 3px solid rgba(214,167,61,.75); outline-offset: 3px; }
.option.correct { border-color: var(--green); background: #e4f0e9; box-shadow: inset 3px 0 0 var(--green); }
.option.correct .option-letter { color: white; border-color: var(--green); background: var(--green); }
.option.incorrect { border-color: var(--red); background: #f5e5e1; box-shadow: inset 3px 0 0 var(--red); }
.option.incorrect .option-letter { color: white; border-color: var(--red); background: var(--red); }
.explanation { margin-top: 24px; padding: 18px 20px; border-left: 3px solid var(--green); background: #e6eee8; }
.explanation strong { display: block; margin-bottom: 4px; color: var(--green); font-size: 10px; letter-spacing: .11em; }
.explanation p { margin: 0; font-size: 13px; }
.explanation .correct-answer-text { margin: 7px 0 11px; color: var(--green); font-weight: 800; }
.explanation .distractor-feedback { margin-top: 13px; padding: 11px 13px; color: #762e28; background: #f3e2df; }
.explanation .memory-note { margin-top: 13px; padding-top: 12px; border-top: 1px solid #c4d4c9; color: #405a4d; }
.explanation .memory-note b { text-transform: uppercase; font-size: 10px; letter-spacing: .08em; }
.question-clue { margin-top: 22px; padding: 17px 20px; color: var(--navy); border-left: 3px solid var(--gold); background: #eee7d9; font-size: 15px; font-weight: 650; }
.source-note { display: block; margin-top: 13px; color: var(--ink-soft); font-size: 9px; }


.question-nav { display: flex; justify-content: space-between; gap: 20px; margin-top: 42px; padding-top: 24px; border-top: 1px solid var(--line); }
.sidebar-scrim { position: fixed; z-index: 24; inset: 75px 0 0; width: 100%; border: 0; background: rgba(13,25,42,.54); }

/* Results */
#result-screen { background: var(--paper); }
.result-hero { padding-block: 65px 52px; color: white; background: var(--navy); }
.result-hero-inner { width: var(--shell); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 50px; margin-inline: auto; }
.result-hero .eyebrow { color: var(--gold); }
.result-title { max-width: 700px; margin: 0; font-size: clamp(38px, 5vw, 64px); font-weight: 500; letter-spacing: -.035em; line-height: 1.05; }
.result-subtitle { margin: 18px 0 0; color: #bcc8d5; }
.result-score { width: 185px; height: 185px; display: grid; place-content: center; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; text-align: center; box-shadow: 0 0 0 10px rgba(255,255,255,.04); }
.result-score strong { color: var(--gold); font-size: 62px; font-weight: 400; line-height: 1; }
.result-score span { color: #bdc8d4; font-size: 10px; font-weight: 800; letter-spacing: .11em; }
.result-main { width: var(--shell); display: grid; grid-template-columns: 1fr 380px; gap: 28px; padding-block: 43px 80px; }
.theory-result-main { grid-template-columns: 1fr 340px; }
.review-guide > p:not(.eyebrow) { color: var(--ink-soft); font-size: 13px; }
.review-legend { display: flex; gap: 18px; margin-top: 24px; color: var(--ink-soft); font-size: 10px; }
.review-legend span { display: flex; align-items: center; gap: 7px; }
.review-legend i { width: 10px; height: 10px; display: block; }
.legend-wrong { background: var(--red); }
.result-card { padding: 27px; border: 1px solid var(--line); background: rgba(255,253,248,.8); }
.result-card h2 { margin: 0; font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.result-card-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.result-card-head p { margin: 5px 0 0; color: var(--ink-soft); font-size: 12px; }
.score-breakdown { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); }
.score-breakdown div { padding: 19px 15px; border-right: 1px solid var(--line); }
.score-breakdown div:last-child { border: 0; }
.score-breakdown span, .score-breakdown strong { display: block; }
.score-breakdown span { color: var(--ink-soft); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.score-breakdown strong { margin-top: 5px; font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.topic-results { display: grid; gap: 15px; margin-top: 25px; }
.topic-row-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 6px; font-size: 11px; }
.topic-row-head span:last-child { color: var(--ink-soft); }
.topic-bar { height: 5px; overflow: hidden; background: #ded8cc; }
.topic-bar span { height: 100%; display: block; background: var(--navy); }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.timeout-notice { margin-top: 18px; padding: 11px 13px; color: #772a23; border: 1px solid #e0b4ae; background: #f4e3e0; font-size: 11px; }

dialog { color: var(--ink); }
dialog::backdrop { background: rgba(16,29,47,.62); backdrop-filter: blur(2px); }
.confirm-dialog, .history-dialog { width: min(510px, calc(100% - 30px)); padding: 0; border: 0; border-radius: 4px; background: var(--paper); box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.confirm-dialog form, .history-dialog > div { position: relative; padding: 34px; }
.confirm-dialog h2, .history-dialog h2 { margin: 0; font-size: 31px; font-weight: 500; }
.confirm-dialog form > p:not(.eyebrow) { color: var(--ink-soft); font-size: 13px; }
.dialog-close { position: absolute; top: 14px; right: 16px; width: 34px; height: 34px; padding: 0; color: var(--ink-soft); border: 0; background: transparent; cursor: pointer; font-size: 25px; line-height: 1; }
.dialog-stat { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; padding: 15px; border-block: 1px solid var(--line); }
.dialog-stat span { color: var(--ink-soft); font-size: 11px; }
.dialog-stat strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 27px; }
.history-list { display: grid; gap: 10px; max-height: 430px; margin-top: 24px; overflow: auto; }
.history-entry { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 13px 0; border-top: 1px solid var(--line); }
.history-entry strong, .history-entry small { display: block; }
.history-entry strong { font-size: 12px; }
.history-entry small { margin-top: 3px; color: var(--ink-soft); font-size: 9px; }
.history-entry > span { color: var(--green); font-family: Georgia, serif; font-size: 23px; }
.empty-history { padding: 30px 0; color: var(--ink-soft); text-align: center; font-size: 13px; }
.toast { position: fixed; z-index: 50; right: 20px; bottom: 20px; max-width: 340px; padding: 11px 16px; color: white; border-radius: 3px; background: var(--navy); box-shadow: var(--shadow); font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity 180ms ease, transform 180ms ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@keyframes pulse { 50% { opacity: .55; } }

:focus-visible { outline: 3px solid rgba(214,167,61,.75); outline-offset: 3px; }

@media (max-width: 900px) {
  :root { --shell: min(100% - 32px, 720px); }
  .hero { grid-template-columns: 1fr; }
  .exam-ticket { width: min(500px, 100%); }
  .exam-grid { grid-template-columns: repeat(2, 1fr); }
  .chapter-exam-grid { grid-template-columns: repeat(2, 1fr); }
  .method { grid-template-columns: 1fr; gap: 42px; }
  .exam-header-inner { grid-template-columns: auto 1fr auto; }
  .compact-brand { width: 61px; padding-inline: 15px; }
  .compact-brand strong { display: none; }
  .palette-toggle { display: grid; }
  .question-sidebar { position: fixed; z-index: 25; top: 75px; left: 0; width: 250px; transform: translateX(-105%); transition: transform 180ms ease; box-shadow: 10px 0 30px rgba(0,0,0,.15); }
  .question-sidebar.open { transform: translateX(0); }
  .exam-layout { grid-template-columns: 1fr; }
  .result-main { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  :root { --shell: calc(100% - 28px); }
  .site-header { min-height: 76px; }
  .text-button { font-size: 11px; }
  .brand small { display: none; }
  .hero { min-height: 0; gap: 56px; padding-block: 54px 72px; }
  .hero h1 { font-size: clamp(46px, 14vw, 67px); }
  .hero-lead { font-size: 15px; }
  .ticket-stats dd { font-size: 9px; }
  .exam-section { padding-block: 58px; }
  .section-heading { align-items: start; flex-direction: column; }
  .exam-grid { grid-template-columns: 1fr; }
  .chapter-heading { align-items: start; flex-direction: column; }
  .chapter-exam-grid { grid-template-columns: 1fr; }
  .method { padding-block: 62px; }
  .site-footer { align-items: start; flex-direction: column; justify-content: center; }
  .exam-header-inner { height: 65px; }
  .compact-brand { width: 54px; padding-inline: 12px; }
  .compact-brand span { width: 29px; height: 29px; }
  .exam-identity { padding-inline: 12px; }
  .exam-identity strong { max-width: 100px; font-size: 11px; }
  .palette-toggle { width: 44px; }
  .timer { min-width: 75px; }
  .timer span { display: none; }
  .timer strong { font-size: 16px; }
  .submit-button { min-width: 76px; padding: 0 12px; font-size: 11px; }
  .question-sidebar { top: 68px; height: calc(100vh - 68px); }
  .sidebar-scrim { inset-block-start: 68px; }
  .question-area { width: calc(100% - 28px); padding-block: 34px 48px; scroll-margin-top: 68px; }
  .question-meta { align-items: start; }
  .question-title { font-size: 25px; }
  .option { grid-template-columns: 31px 1fr; gap: 10px; padding-inline: 12px; }
  .option-letter { width: 30px; height: 30px; }
  .question-nav .primary-button,
  .question-nav .secondary-button { min-width: 0; padding-inline: 14px; }
  .result-header { min-height: 75px; }
  .result-header .secondary-button { min-height: 39px; padding-inline: 11px; font-size: 10px; }
  .result-hero { padding-block: 44px; }
  .result-hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .result-score { width: 145px; height: 145px; }
  .result-score strong { font-size: 50px; }
  .result-main { padding-block: 25px 55px; }
  .result-card { padding: 20px; }
  .score-breakdown { grid-template-columns: 1fr; }
  .score-breakdown div { border-right: 0; border-bottom: 1px solid var(--line); }
  .dialog-actions { align-items: stretch; flex-direction: column-reverse; }
}

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