.aws-app {
  --surface: var(--ac-surface);
  --surface-2: var(--ac-surface-raised);
  --border: var(--ac-border);
  --muted: var(--ac-muted);
  --primary: var(--ac-accent);
  --primary-dark: var(--ac-on-accent);
  --green: var(--ac-accent);
  --red: var(--ac-danger);
  --blue: var(--ac-info);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 0; min-height: 100vh; }
button, input { font: inherit; }
button { border: 1px solid var(--border); border-radius: var(--ac-radius); background: var(--surface-2); color: inherit; min-height: 44px; padding: .72rem 1rem; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--blue); transform: translateY(-1px); }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .55; }
button.primary { background: var(--primary); color: var(--primary-dark); border-color: transparent; font-weight: 700; }
.aws-app main a { color: var(--blue); }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.45rem, 3vw, 2.15rem); }
h2 { line-height: 1.3; }
.site-header { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; padding: 1.2rem var(--ac-gutter); border-bottom: 1px solid var(--ac-rule); background: var(--ac-bg); position: sticky; top: 0; z-index: 20; }
.eyebrow { color: var(--primary); font-family: var(--ac-mono); font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .35rem; }
.header-progress { color: var(--muted); text-align: right; }
main { width: min(1320px, 100%); margin: 0 auto; padding: clamp(1rem, 3vw, 2rem); }
.card { background: var(--surface); border: 1px solid var(--ac-rule); border-radius: var(--ac-radius); padding: clamp(1rem, 3vw, 1.6rem); }
.loading-card, .report-card { max-width: 840px; margin: 2rem auto; }
.start-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr); gap: 1.25rem; }
.start-card p:not(.eyebrow) { max-width: 72ch; color: var(--ac-muted); line-height: 1.65; }
.start-actions, .report-actions, .learning-actions, .question-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.start-actions { margin: 1.5rem 0; }
.muted { color: var(--muted); }
.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.history-list li { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.history-list span { color: var(--muted); text-align: right; font-size: .85rem; }
.exam-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.navigator { position: sticky; top: 7.2rem; }
.navigator-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.navigator-heading h2 { font-size: 1rem; margin-bottom: .7rem; }
.navigator-heading span, .mastery-note { color: var(--muted); font-size: .82rem; }
.question-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .42rem; margin: 1rem 0; }
.nav-question { padding: .5rem 0; min-width: 0; }
.nav-question.current { border-color: var(--blue); box-shadow: inset 0 0 0 2px var(--blue); }
.nav-question.correct { background: rgba(67, 209, 158, .16); border-color: var(--green); }
.nav-question.wrong { background: rgba(255, 123, 136, .15); border-color: var(--red); }
.nav-question.flagged::after { content: "•"; color: var(--primary); margin-left: .15rem; }
.full-width { width: 100%; margin-top: .65rem; }
.question-card { min-width: 0; }
.question-card > h2 { font-size: clamp(1.18rem, 2.4vw, 1.6rem); max-width: 52ch; }
.question-meta { color: var(--muted); font-size: .84rem; }
.learning-actions { margin: 1rem 0; }
.hint { padding: .85rem 1rem; background: rgba(105, 169, 255, .1); border-left: 4px solid var(--blue); line-height: 1.5; }
.choices { border: 0; padding: 0; margin: 1.2rem 0; display: grid; gap: .7rem; }
.choice { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: .65rem; align-items: start; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: var(--ac-radius); background: var(--ac-bg); line-height: 1.5; cursor: pointer; }
.choice:hover { border-color: var(--primary); }
.choice input { margin-top: .25rem; accent-color: var(--primary); }
.choice-correct { border-color: var(--green); background: rgba(67, 209, 158, .1); }
.choice-wrong { border-color: var(--red); background: rgba(255, 123, 136, .1); }
.feedback { margin-top: 1.2rem; padding: 1rem 1.1rem; border-radius: 12px; line-height: 1.6; }
.feedback h3, .feedback h4 { margin-bottom: .55rem; }
.feedback-correct { border: 1px solid var(--green); background: rgba(67, 209, 158, .08); }
.feedback-wrong { border: 1px solid var(--red); background: rgba(255, 123, 136, .08); }
.study-breakdown { margin-top: 1.25rem; }
.study-intro { color: var(--ac-text); }
.prompt-evidence { margin: .8rem 0 1.25rem; padding: 1rem 1.1rem; border-left: 4px solid var(--primary); background: rgba(21, 193, 128, .08); }
.prompt-evidence mark { background: var(--primary); color: var(--primary-dark); border-radius: 3px; padding: 0 .12rem; }
.prompt-evidence cite { display: block; color: var(--muted); font-size: .8rem; font-style: normal; margin-top: .55rem; }
.selected-correction { margin: 1rem 0 1.3rem; padding: 1rem; border: 1px solid var(--red); border-radius: 12px; background: rgba(255, 123, 136, .08); }
.selected-correction article > strong { display: block; margin-bottom: .45rem; }
.selected-correction ul, .option-study-points { display: grid; gap: .45rem; margin: .55rem 0 0; padding-left: 1.25rem; }
.selected-correction .correct-instead { margin-top: .45rem; }
.option-study-list { list-style: none; display: grid; gap: .85rem; margin: .75rem 0 1.2rem; padding: 0; }
.option-study { border: 1px solid var(--ac-rule); border-left-width: 5px; border-radius: var(--ac-radius); background: var(--ac-bg); padding: .9rem 1rem; }
.option-study.correct { border-left-color: var(--green); }
.option-study.incorrect { border-left-color: var(--border); }
.option-study.incorrect.selected { border-left-color: var(--red); }
.option-study-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; }
.option-study-heading span { flex: 0 0 auto; border: 1px solid currentColor; border-radius: 999px; color: var(--muted); font-size: .69rem; font-weight: 800; padding: .2rem .48rem; text-transform: uppercase; }
.option-study.correct .option-study-heading span { color: var(--green); }
.option-study.selected .option-study-heading span { color: var(--red); }
.option-study-points li::marker, .selected-correction li::marker { color: var(--primary); }
.original-explanation { margin-top: 1.25rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.reference-list { margin-bottom: 0; }
.question-actions { justify-content: space-between; margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.floating-next { position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 40; display: inline-flex; align-items: center; gap: .55rem; border: 0; border-radius: 999px; background: var(--primary); color: var(--primary-dark); box-shadow: 0 12px 34px rgba(0, 0, 0, .42); font-weight: 800; padding: .82rem 1.08rem; animation: floating-next-in .18s ease-out; }
.floating-next:hover:not(:disabled) { border-color: transparent; box-shadow: 0 15px 38px rgba(0, 0, 0, .5); }
.floating-next span { font-size: 1.15em; line-height: 1; }
.floating-next[hidden] { display: none; }
@keyframes floating-next-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.score { display: flex; gap: 1rem; align-items: baseline; margin: 1rem 0 .7rem; }
.score strong { font-size: clamp(2rem, 6vw, 4rem); }
.score span { color: var(--muted); font-size: 1.25rem; }
.progress-track { height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-2); margin-bottom: 1.3rem; }
.progress-track > div { height: 100%; background: var(--green); }
details { margin: 1rem 0; }
summary { cursor: pointer; color: var(--blue); min-height: 44px; }
.missed-list { display: grid; gap: .65rem; padding-left: 1.4rem; }
.error { max-width: 720px; margin: 2rem auto; border-color: var(--red); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 860px) {
  .start-grid, .exam-layout { grid-template-columns: 1fr; }
  .question-card { grid-row: 1; }
  .navigator { grid-row: 2; position: static; }
  .question-grid { grid-template-columns: repeat(10, 1fr); }
}

@media (max-width: 560px) {
  .site-header { align-items: flex-start; }
  .site-header { position: static; }
  .header-progress { text-align: left; }
  .question-grid { grid-template-columns: repeat(5, 1fr); }
  .question-actions button { flex: 1 1 30%; }
  .history-list li { flex-direction: column; }
  .history-list span { text-align: left; }
  .option-study-heading { flex-direction: column; }
}
