:root {
  color-scheme: light;
  --ink: #14213d;
  --muted: #5d6472;
  --paper: #f8f5ed;
  --card: #fffef9;
  --line: #d7d2c5;
  --blue: #124b88;
  --blue-dark: #0a3565;
  --gold: #efb544;
  --green: #1d7652;
  --green-soft: #e6f4ec;
  --red: #a63e36;
  --red-soft: #f9e9e6;
  --shadow: 0 18px 50px rgba(20, 33, 61, .11);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
button { font: inherit; }
button:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 40px, 1040px);
  margin: 0 auto;
  padding: 24px 0;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: white; background: var(--blue); font-family: Georgia, serif; }
.header-label { color: var(--muted); font-size: .875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }

main { width: min(100% - 40px, 880px); margin: 32px auto 80px; }
.screen { animation: enter .3s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }

.start-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr); gap: 64px; align-items: center; min-height: 62vh; }
.eyebrow { color: var(--blue); font-size: .875rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
h1, h2 { font-family: Georgia, 'Times New Roman', serif; letter-spacing: -.035em; line-height: 1.05; }
h1 { max-width: 650px; margin: 14px 0 20px; font-size: clamp(3.2rem, 7vw, 5.8rem); font-weight: 500; }
.intro { max-width: 580px; color: var(--muted); font-size: 1.2rem; }
.primary-button {
  border: 0;
  border-radius: 10px;
  padding: 14px 22px;
  color: white;
  background: var(--blue);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(18, 75, 136, .18);
}
.primary-button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.start-card { border-top: 5px solid var(--gold); border-radius: 12px; padding: 28px; background: var(--card); box-shadow: var(--shadow); }
.start-card h2 { margin: 0 0 18px; font-size: 1.6rem; }
.session-facts { margin: 0 0 26px; padding: 0; list-style: none; }
.session-facts li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.fact-number { min-width: 36px; color: var(--blue); font-family: Georgia, serif; font-size: 1.35rem; font-weight: 700; }
.load-error { color: var(--red); font-weight: 700; }

.quiz-shell { max-width: 760px; margin: 0 auto; }
.progress-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; color: var(--muted); font-size: .9rem; font-weight: 750; }
.progress-track { overflow: hidden; height: 7px; border-radius: 10px; background: #ddd8cc; }
.progress-bar { height: 100%; width: 2%; border-radius: inherit; background: var(--gold); transition: width .25s ease; }
.question-card { margin-top: 26px; border: 1px solid var(--line); border-radius: 16px; padding: clamp(24px, 5vw, 50px); background: var(--card); box-shadow: var(--shadow); }
.prompt { margin: 0 0 30px; font-family: Georgia, serif; font-size: clamp(1.8rem, 4.5vw, 2.7rem); line-height: 1.25; }
.options { display: grid; gap: 12px; }
.answer-option { display: flex; align-items: center; gap: 16px; width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 14px 16px; color: var(--ink); background: white; text-align: left; cursor: pointer; transition: .15s ease; }
.answer-option:hover:not(:disabled) { border-color: var(--blue); background: #f3f7fb; transform: translateX(3px); }
.answer-option:disabled { color: var(--ink); cursor: default; }
.option-letter { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--blue); background: #edf2f8; font-weight: 850; }
.answer-option.correct { border-color: var(--green); background: var(--green-soft); }
.answer-option.correct .option-letter { color: white; background: var(--green); }
.answer-option.incorrect { border-color: var(--red); background: var(--red-soft); }
.answer-option.incorrect .option-letter { color: white; background: var(--red); }
.feedback { margin-top: 22px; border-left: 5px solid; border-radius: 6px 10px 10px 6px; padding: 20px 22px; }
.feedback-correct { border-color: var(--green); background: var(--green-soft); }
.feedback-incorrect { border-color: var(--red); background: var(--red-soft); }
.feedback p { margin: 9px 0; }
.feedback-heading { display: flex; gap: 9px; align-items: center; font-size: 1.15rem; font-weight: 850; }
.breakdown { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(20,33,61,.16); }
.breakdown h3 { margin: 0 0 7px; font-size: .82rem; text-transform: uppercase; letter-spacing: .11em; }
.breakdown ul { margin: 0 0 10px; padding-left: 20px; }
.tip { font-style: italic; }
.quiz-actions { display: flex; justify-content: flex-end; margin-top: 20px; }

.results-header { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 24px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.results-title { margin: 10px 0 0; font-size: clamp(2.7rem, 6vw, 4.6rem); font-weight: 500; }
.score-block { text-align: right; }
.score { font-family: Georgia, serif; font-size: clamp(3.2rem, 8vw, 5.8rem); line-height: 1; color: var(--blue); }
.score-note { color: var(--muted); font-weight: 750; }
.email-status { display: flex; align-items: center; gap: 9px; width: fit-content; margin-top: 22px; border-radius: 999px; padding: 8px 13px; font-size: .875rem; font-weight: 750; }
.email-sending { color: var(--muted); background: #ebe8df; }
.email-sent { color: var(--green); background: var(--green-soft); }
.email-failed { color: var(--red); background: var(--red-soft); }
.email-status button { border: 0; padding: 0; color: inherit; background: transparent; font-weight: 850; text-decoration: underline; cursor: pointer; }
.email-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .3; } }
.review-heading { margin: 34px 0 14px; font-size: 1rem; text-transform: uppercase; letter-spacing: .1em; }
.review-list { display: grid; gap: 9px; }
.review-item { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.review-item summary { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 15px 17px; cursor: pointer; list-style: none; }
.review-item summary::-webkit-details-marker { display: none; }
.review-item small { display: block; color: var(--muted); font-size: .82rem; font-weight: 500; }
.review-mark { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; color: white; font-weight: 900; }
.review-correct .review-mark { background: var(--green); }
.review-incorrect .review-mark { background: var(--red); }
.chevron { font-size: 1.4rem; transition: transform .15s; }
.review-item[open] .chevron { transform: rotate(180deg); }
.review-detail { padding: 0 60px 18px; color: var(--muted); }
.review-detail p { margin: 6px 0; }
.results-actions { margin-top: 28px; }

@media (max-width: 720px) {
  .site-header { width: min(100% - 28px, 1040px); padding: 17px 0; }
  .header-label { display: none; }
  main { width: min(100% - 28px, 880px); margin-top: 18px; }
  .start-layout { grid-template-columns: 1fr; gap: 30px; align-items: start; }
  h1 { font-size: clamp(3rem, 15vw, 4.5rem); }
  .question-card { padding: 24px 18px; }
  .answer-option { padding: 12px; }
  .results-header { grid-template-columns: 1fr; }
  .score-block { text-align: left; }
  .review-detail { padding-left: 61px; }
}

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