:root {
  color-scheme: light;
  --navy: #12304a;
  --navy-deep: #0a2237;
  --teal: #18a999;
  --teal-soft: #dff7f3;
  --paper: #ffffff;
  --canvas: #edf2f5;
  --line: #c8d2d9;
  --ink: #172633;
  --muted: #61717d;
  --amber: #f0a630;
  --danger: #be3f4c;
  --success: #14855d;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); font-size: 16px; }
button, input, select { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #7ad8cc; outline-offset: 2px; }

.app-header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--navy-deep);
  color: white;
  border-bottom: 4px solid var(--teal);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; color: #8ce5d8; font-size: .77rem; font-weight: 800; letter-spacing: .08em; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 1.06rem; }
.brand div > span { margin-top: 2px; color: #bfd0dc; font-size: .8rem; }
.header-status { display: flex; align-items: center; gap: 18px; font-variant-numeric: tabular-nums; }
.status-pill { padding: 7px 11px; border: 1px solid #4b697f; border-radius: 999px; color: #d3e2eb; font-size: .78rem; }
.header-button { border: 1px solid #8aa0af; border-radius: 5px; padding: 7px 11px; background: transparent; color: white; cursor: pointer; }

.start-screen { min-height: calc(100vh - 72px); display: grid; grid-template-columns: minmax(0, 900px) 250px; gap: 22px; justify-content: center; align-items: start; padding: 44px 24px 70px; }
.setup-card, .integrity-note, .results-card, .review-card { background: white; border: 1px solid #d1dbe1; box-shadow: 0 14px 34px rgba(24,44,58,.08); }
.setup-card { padding: clamp(26px, 4vw, 46px); border-top: 6px solid var(--navy); }
.setup-intro h1, .results-card h1 { margin: 4px 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.12; }
.setup-intro > p:last-child { margin: 0; color: var(--muted); line-height: 1.55; }
.eyebrow { margin: 0; color: var(--teal); font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.setup-section { margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line); }
.section-label { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.section-label h2 { margin: 0; font-size: 1rem; }
.selection-actions { display: flex; gap: 8px; }
.selection-actions button { border: 0; background: transparent; color: var(--navy); cursor: pointer; font-size: .82rem; text-decoration: underline; text-underline-offset: 3px; }
.source-options { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 16px; }
.source-option { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; min-height: 58px; padding: 10px 12px; border: 1px solid #c8d3da; border-radius: 7px; background: #fbfcfd; cursor: pointer; }
.source-option:has(input:checked) { border-color: #4fb9ab; background: #effaf8; box-shadow: inset 3px 0 0 var(--teal); }
.source-option input { width: 18px; height: 18px; accent-color: var(--teal); }
.source-option strong, .source-option small { display: block; }
.source-option strong { font-size: .86rem; }
.source-option small { margin-top: 2px; color: var(--muted); font-size: .74rem; }
.setup-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 26px; }
.control-card { min-width: 0; padding: 15px; border: 1px solid #c8d3da; border-radius: 7px; background: #f8fafb; }
.control-card > span, .control-card legend { display: block; margin-bottom: 9px; color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.control-card select { width: 100%; min-height: 40px; border: 1px solid #adbbc5; border-radius: 5px; background: white; color: var(--ink); padding: 0 10px; }
.mode-card { display: flex; align-items: center; gap: 18px; }
.mode-card legend { float: left; width: 100%; }
.mode-card label { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.setup-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.setup-footer p { margin: 0; color: var(--muted); font-size: .86rem; }
.start-button { min-width: 190px; }
.integrity-note { padding: 22px; border-top: 6px solid var(--teal); line-height: 1.5; }
.integrity-note strong { font-size: .95rem; }
.integrity-note p { margin: 8px 0 0; color: var(--muted); font-size: .84rem; }

.exam-shell { height: calc(100vh - 140px); display: grid; grid-template-columns: 250px minmax(0, 1fr); overflow: hidden; }
.question-nav { display: flex; min-height: 0; flex-direction: column; padding: 24px 20px; background: #f8fafb; border-right: 1px solid var(--line); }
.nav-heading { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; }
.nav-heading strong { color: var(--ink); }
.question-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 20px; overflow-y: auto; padding: 2px; }
.question-jump { aspect-ratio: 1; min-height: 34px; border: 1px solid #bdc9d0; border-radius: 5px; background: white; color: var(--ink); cursor: pointer; }
.question-jump.current { border-color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); font-weight: 700; }
.question-jump.answered { background: var(--teal-soft); border-color: #62cdbf; }
.question-jump.flagged { box-shadow: inset 0 -4px 0 var(--amber); }
.legend { display: grid; gap: 8px; margin-top: auto; padding-top: 18px; color: var(--muted); font-size: .78rem; }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 10px; height: 10px; border: 1px solid #aebac2; border-radius: 2px; background: white; }
.legend-dot.answered { background: var(--teal-soft); border-color: #62cdbf; }
.legend-dot.flagged { background: var(--amber); border-color: var(--amber); }
.legend-dot.current { border: 2px solid var(--navy); }
.exam-canvas { min-height: 0; overflow-y: auto; padding: 30px clamp(22px, 5vw, 72px) 70px; }
.question-meta { width: min(940px, 100%); margin: 0 auto 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.question-meta > span { color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.question-tools { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.quiet-button { border: 0; background: transparent; color: #455965; cursor: pointer; padding: 8px 9px; border-radius: 5px; font-size: .8rem; }
.quiet-button:hover { background: #e1e8ec; }
.flag-button { color: #6d5420; }
.flag-button[aria-pressed="true"] { background: #fff0d0; color: #6d4500; }
.question-card { width: min(940px, 100%); margin: 0 auto; padding: clamp(24px, 4vw, 44px); background: var(--paper); border: 1px solid #d3dde3; border-top: 5px solid var(--navy); box-shadow: 0 12px 30px rgba(25,45,60,.08); }
.question-card h1 { margin: 0 0 20px; font-size: 1rem; color: var(--muted); font-weight: 700; }
.question-stem { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.12rem, 2vw, 1.38rem); line-height: 1.58; white-space: pre-wrap; }
.question-stem mark { background: #fff19b; color: inherit; border-radius: 2px; padding: 0 1px; }
.question-figures { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(260px,100%),1fr)); gap: 14px; margin-top: 24px; padding: 14px; background: #f3f6f8; border: 1px solid #d1dbe1; }
.question-figures img { display: block; width: 100%; max-height: 480px; object-fit: contain; background: white; }
.choices { display: grid; gap: 12px; margin: 30px 0 0; padding: 0; border: 0; }
.choice-row { display: grid; grid-template-columns: minmax(0,1fr) 38px; gap: 8px; align-items: stretch; }
.choice { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; padding: 15px 16px; border: 1px solid #c5d0d7; border-radius: 6px; background: white; cursor: pointer; line-height: 1.45; }
.choice:hover { border-color: #708696; background: #f8fbfc; }
.choice.selected { border-color: var(--navy); box-shadow: inset 4px 0 0 var(--navy); }
.choice.correct { border-color: var(--success); background: #edf9f4; box-shadow: inset 4px 0 0 var(--success); }
.choice.incorrect { border-color: var(--danger); background: #fff2f3; box-shadow: inset 4px 0 0 var(--danger); }
.choice.struck .choice-copy { text-decoration: line-through 2px; color: #79868e; }
.choice-key { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #aebbc4; border-radius: 50%; font-weight: 700; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.strike-button { border: 1px solid #bdc8cf; border-radius: 5px; background: white; color: #65747e; cursor: pointer; font-size: 1.1rem; }
.strike-button[aria-pressed="true"] { background: #e9eef1; color: var(--danger); }
.feedback { margin-top: 28px; padding: 20px 22px; border-left: 4px solid var(--teal); background: #f1faf8; line-height: 1.55; }
.feedback h2 { margin: 0 0 8px; font-size: 1.05rem; }
.feedback p { margin: 8px 0 0; }
.feedback .source-line { color: var(--muted); font-size: .84rem; }
.exam-footer { height: 68px; display: grid; grid-template-columns: 150px minmax(180px,1fr) 150px; align-items: center; gap: 26px; padding: 0 28px; background: white; border-top: 1px solid var(--line); }
.primary-button, .secondary-button { min-height: 42px; border-radius: 5px; padding: 0 18px; font-weight: 700; cursor: pointer; }
.primary-button { border: 1px solid var(--navy); background: var(--navy); color: white; }
.primary-button:hover { background: #0b263b; }
.primary-button:disabled { opacity: .45; cursor: not-allowed; }
.secondary-button { border: 1px solid #adbac3; background: white; color: var(--ink); }
.progress-wrap { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; color: var(--muted); font-size: .78rem; }
.progress-track { height: 7px; overflow: hidden; background: #dce4e9; border-radius: 99px; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--teal); transition: width .2s ease; }

.results-screen { min-height: calc(100vh - 72px); padding: 44px 24px 80px; }
.results-card { width: min(820px,100%); margin: 0 auto; padding: 38px; text-align: center; border-top: 6px solid var(--teal); }
.score-ring { width: 150px; height: 150px; display: grid; place-content: center; margin: 26px auto; border: 12px solid var(--teal-soft); border-top-color: var(--teal); border-radius: 50%; }
.score-ring strong, .score-ring span { display: block; }
.score-ring strong { font-size: 2.2rem; }
.score-ring span { color: var(--muted); font-size: .8rem; }
.results-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.results-stats div { padding: 16px 8px; background: #f3f6f8; border: 1px solid #d4dde2; }
.results-stats strong, .results-stats span { display: block; }
.results-stats strong { font-size: 1.45rem; }
.results-stats span { margin-top: 4px; color: var(--muted); font-size: .78rem; }
.results-actions { display: flex; justify-content: center; gap: 12px; margin-top: 26px; }
.review-list { width: min(920px,100%); margin: 24px auto 0; display: grid; gap: 14px; }
.review-card { padding: 22px; }
.review-card h2 { margin: 0 0 8px; font-size: .86rem; color: var(--muted); }
.review-card > p { margin: 0 0 14px; font-family: Georgia,"Times New Roman",serif; line-height: 1.45; }
.review-answer { font-size: .88rem; line-height: 1.5; }
.review-answer strong { color: var(--success); }
.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: 980px) {
  .start-screen { grid-template-columns: 1fr; }
  .integrity-note { width: min(900px,100%); }
  .source-options { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .app-header { height: 64px; padding: 0 14px; }
  .status-pill { display: none; }
  .header-status { gap: 10px; }
  .start-screen { min-height: calc(100vh - 64px); padding: 20px 12px 40px; }
  .setup-card { padding: 24px 17px; }
  .source-options, .setup-grid { grid-template-columns: 1fr; }
  .setup-footer { align-items: stretch; flex-direction: column; }
  .exam-shell { height: auto; min-height: calc(100vh - 124px); grid-template-columns: 1fr; overflow: visible; }
  .question-nav { display: none; }
  .exam-canvas { overflow: visible; padding: 18px 12px 90px; }
  .question-meta { align-items: flex-start; flex-direction: column; }
  .question-tools { justify-content: flex-start; }
  .question-card { padding: 24px 16px; }
  .exam-footer { position: fixed; inset: auto 0 0; z-index: 10; height: 60px; grid-template-columns: 1fr 1fr; gap: 12px; padding: 8px 12px; }
  .progress-wrap { display: none; }
  .results-screen { padding: 20px 12px 70px; }
  .results-card { padding: 26px 16px; }
  .results-stats { grid-template-columns: repeat(2,1fr); }
  .results-actions { flex-direction: column; }
}

/* Examplify reference layout */
:root {
  --exam-blue: #1a73ad;
  --exam-blue-dark: #105f95;
  --exam-blue-soft: #dceffb;
  --exam-sidebar: #f1f3f4;
  --exam-border: #9aa1a6;
}

body[data-screen="exam"] { overflow: hidden; background: #fff; }
body[data-screen="exam"] .app-header { display: none; }

.exam-shell {
  height: calc(100vh - 72px);
  grid-template-columns: 88px minmax(0, 1fr);
  background: #fff;
}

.question-nav {
  padding: 0 10px 16px;
  background: var(--exam-sidebar);
  border-right: 1px solid #d9dcdf;
}

.filter-label {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -10px;
  padding: 0 10px;
  border-bottom: 1px solid #e0e2e4;
  color: #46525b;
  font-size: .78rem;
  font-weight: 700;
}

.filter-label span { color: #253845; font-size: 1.35rem; line-height: 1; }
.nav-heading, .legend { display: none; }
.question-grid {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 0 4px 20px;
  scrollbar-width: thin;
}

.question-jump {
  width: 48px;
  min-height: 48px;
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: #253845;
  font-size: .78rem;
}

.question-jump:hover { background: #e4edf3; }
.question-jump.answered { border-color: var(--exam-blue); background: var(--exam-blue); color: #fff; }
.question-jump.current,
.question-jump.current.answered {
  border: 3px solid var(--exam-blue);
  background: #fff;
  color: var(--exam-blue-dark);
  box-shadow: none;
}
.question-jump.flagged { box-shadow: inset 0 -5px 0 #f29d24; }

.exam-canvas {
  padding: 0 24px 112px;
  background: #fff;
}

.question-meta {
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px solid #eef0f1;
}

.question-topline { display: flex; align-items: center; gap: 12px; }
.question-topline h1 {
  margin: 0;
  color: #46525b;
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: .05em;
}
.question-chevron { color: #2e414e; font-size: 1.35rem; line-height: 1; }
.flag-button {
  min-height: 30px;
  padding: 0 16px;
  border: 2px solid var(--exam-blue);
  border-radius: 999px;
  background: #fff;
  color: var(--exam-blue-dark);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .02em;
  cursor: pointer;
}
.flag-button[aria-pressed="true"] { background: var(--exam-blue); color: #fff; }

.question-tools { align-items: center; gap: 12px; }
#clock { color: #56636b; font-size: .78rem; font-variant-numeric: tabular-nums; }
.question-menu { position: relative; }
.question-menu summary {
  width: 36px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eef1f2;
  color: #2f424e;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: .08em;
  list-style: none;
}
.question-menu summary::-webkit-details-marker { display: none; }
.question-menu-panel {
  position: absolute;
  z-index: 20;
  top: 32px;
  right: 0;
  width: 190px;
  padding: 7px;
  border: 1px solid #cbd1d5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(25, 43, 54, .15);
}
.question-menu-panel button { width: 100%; text-align: left; }
.question-menu-panel .end-button { color: #9b3140; }

.question-card {
  width: 100%;
  margin: 0;
  padding: 14px 2px 24px;
  border: 0;
  background: #fff;
  box-shadow: none;
}

.source-badge {
  display: block;
  margin-bottom: 12px;
  color: #7a858c;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.question-stem {
  max-width: 1520px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

.question-figures {
  width: min(900px, 100%);
  margin-top: 20px;
  padding: 10px;
  border: 1px solid #d9dde0;
  border-radius: 6px;
  background: #fafbfc;
}

.answer-range {
  margin: 30px 0 16px;
  color: #3f4c55;
  font-size: .88rem;
  font-weight: 700;
}

.choices { gap: 14px; margin-top: 0; }
.choice-row { position: relative; display: block; }
.choice {
  min-height: 56px;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 13px 62px 13px 20px;
  border: 2px solid var(--exam-border);
  border-radius: 999px;
  background: linear-gradient(90deg, #f7f8f9, #eef0f2);
  line-height: 1.35;
}
.choice:hover { border-color: #65747c; background: #f6f8f9; }
.choice.selected { border-color: var(--exam-blue); background: #edf7fd; box-shadow: none; }
.choice.correct { border-color: var(--success); background: #edf9f4; box-shadow: none; }
.choice.incorrect { border-color: var(--danger); background: #fff2f3; box-shadow: none; }
.choice-key {
  display: block;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  color: #10171c;
  font-size: .95rem;
  font-weight: 800;
}
.choice-copy { font-size: 1rem; }
.strike-button {
  position: absolute;
  top: 50%;
  right: 17px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #10171c;
  transform: translateY(-50%);
}
.strike-button::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 11px;
  left: 8px;
  top: 11px;
  border: 2px solid currentColor;
  border-radius: 70% 15% 70% 15%;
  transform: rotate(45deg);
}
.strike-button::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  left: 15px;
  top: 15px;
  border-radius: 50%;
  background: currentColor;
}
.strike-button[aria-pressed="true"] { background: transparent; color: #9aa2a7; }
.choice.struck { opacity: .58; }

.feedback {
  margin-top: 22px;
  border: 1px solid #b9d8cc;
  border-left: 5px solid var(--success);
  border-radius: 7px;
  background: #f4fbf8;
}

.feedback h3 {
  margin: 18px 0 6px;
  color: #244252;
  font-size: .78rem;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.option-review { margin-top: 18px; }
.option-review-list { display: grid; gap: 10px; }
.option-review-item {
  padding: 12px 14px;
  border: 1px solid #d2dde2;
  border-left: 4px solid #9aa8af;
  border-radius: 6px;
  background: #fff;
}
.option-review-item.correct { border-left-color: var(--success); background: #f7fcfa; }
.option-review-item.incorrect { border-left-color: #9aa8af; }
.option-review-option {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  align-items: start;
  margin: 0 !important;
  color: #18384c;
  font-weight: 700;
}
.option-review-option strong {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid #91a6b0;
  border-radius: 50%;
  font-size: .76rem;
}
.option-review-item.correct .option-review-option strong {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}
.option-review-reason {
  margin: 7px 0 0 34px !important;
  color: #465c67;
  font-size: .9rem;
}

.lecture-teaching {
  display: grid;
  gap: 14px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #cfe1da;
}

.lecture-meta span,
.objective-card > span {
  display: block;
  margin-bottom: 4px;
  color: #5a6b74;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.lecture-meta strong { color: #17384e; font-size: .96rem; }

.objective-card {
  padding: 13px 15px;
  border: 1px solid #bcd5e4;
  border-radius: 7px;
  background: #eef7fc;
}

.objective-card p { margin: 0; color: #284758; font-size: .9rem; }

.lecture-slide {
  margin: 0;
  overflow: hidden;
  border: 1px solid #c7d0d6;
  border-radius: 7px;
  background: #fff;
}

.lecture-slide img {
  display: block;
  width: 100%;
  max-height: 760px;
  object-fit: contain;
  background: #f7f9fa;
}

.lecture-slide figcaption {
  padding: 9px 12px;
  border-top: 1px solid #d9e0e4;
  color: #66757e;
  font-size: .75rem;
}

body[data-screen="start"] .source-options {
  max-height: 430px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
}

.exam-footer {
  position: fixed;
  z-index: 30;
  inset: auto 0 0;
  height: 72px;
  grid-template-columns: 1fr auto;
  gap: 20px;
  padding: 0 24px 0 38px;
  border-top: 0;
  background: var(--exam-blue-soft);
}
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #53616a;
  font-size: .68rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.progress-wrap strong { color: #34444e; font-size: .68rem; }
.progress-track, #progress-label { display: none; }
.footer-version { color: #74818a; }
.footer-actions { display: flex; gap: 12px; }
.exam-footer .primary-button,
.exam-footer .secondary-button {
  min-width: 128px;
  min-height: 44px;
  border-radius: 999px;
  font-size: .9rem;
}
.exam-footer .primary-button { border-color: var(--exam-blue); background: var(--exam-blue); }
.exam-footer .primary-button:hover { background: var(--exam-blue-dark); }
.exam-footer .secondary-button { border: 2px solid var(--exam-blue); color: var(--exam-blue-dark); }

@media (max-width: 760px) {
  body[data-screen="exam"] { overflow: auto; }
  .exam-shell {
    min-height: 100vh;
    grid-template-columns: 1fr;
    padding-top: 62px;
  }
  .question-nav {
    position: fixed;
    z-index: 25;
    inset: 0 0 auto;
    height: 62px;
    display: block;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid #d7dbde;
  }
  .filter-label, .nav-heading, .legend { display: none; }
  .question-grid {
    display: flex;
    gap: 7px;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .question-jump { flex: 0 0 44px; width: 44px; min-height: 44px; }
  .exam-canvas { padding: 0 12px 94px; }
  .question-meta { align-items: center; flex-direction: row; }
  .question-topline { gap: 8px; }
  .question-topline h1 { font-size: .78rem; }
  .flag-button { padding: 0 10px; font-size: .65rem; }
  #clock { display: none; }
  .question-card { padding-top: 12px; }
  .question-stem, .choice-copy { font-size: .95rem; }
  .choice { border-radius: 24px; padding-left: 15px; }
  .exam-footer {
    height: 64px;
    grid-template-columns: auto 1fr;
    padding: 7px 10px;
  }
  .footer-version { display: none; }
  .footer-actions { justify-content: flex-end; gap: 7px; }
  .exam-footer .primary-button,
  .exam-footer .secondary-button { min-width: 92px; min-height: 42px; padding: 0 14px; }
  body[data-screen="start"] .source-options { grid-template-columns: 1fr; max-height: 52vh; }
  .lecture-slide img { max-height: none; }
}

/* EverWonderWhy lecture dashboard */
.app-header {
  height: 112px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto minmax(280px, 1fr);
  gap: 28px;
  padding: 0 clamp(28px, 4vw, 58px);
  border-bottom: 0;
  background: #17344c;
}

.brand { gap: 18px; }
.brand-link { color: inherit; text-decoration: none; }
.header-status {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 18px;
}
.learner-button {
  min-height: 38px;
  max-width: 210px;
  overflow: hidden;
  padding: 0 15px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #f4fbff;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.learner-button:hover { background: rgba(255,255,255,.14); }
.brand-mark {
  width: 70px;
  height: 70px;
  border: 3px solid rgba(255,255,255,.58);
  border-radius: 17px;
  color: #78d6ef;
  font-size: 1.85rem;
  letter-spacing: 0;
}
.brand strong { font-size: 1.72rem; letter-spacing: -.035em; }
.brand div > span {
  margin-top: 3px;
  color: #b8d8e8;
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .16em;
}
.header-view-title {
  justify-self: center;
  color: #f7fbfd;
  font-size: 1.45rem;
  letter-spacing: -.025em;
}
.study-clock {
  justify-self: end;
  gap: 22px;
}
.study-clock > span {
  color: #b3c8d5;
  font-size: .87rem;
  font-weight: 800;
  letter-spacing: .19em;
}
.study-clock strong {
  color: #fff;
  font-size: 1.55rem;
  letter-spacing: .025em;
}

body[data-screen="start"] {
  background: linear-gradient(180deg, #f5faff 0, #ffffff 380px);
}
body[data-screen="start"] .start-screen {
  min-height: calc(100vh - 112px);
  display: block;
  padding: clamp(62px, 7vw, 92px) 24px 100px;
}

.home-hero {
  width: min(1120px, 100%);
  margin: 0 auto;
  text-align: center;
}
.home-eyebrow {
  margin: 0;
  color: #1779b5;
  font-size: .94rem;
  font-weight: 850;
  letter-spacing: .19em;
}
.home-hero h1 {
  margin: 24px 0 20px;
  color: #13334b;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(3.15rem, 6vw, 5rem);
  line-height: 1;
  letter-spacing: -.065em;
}
.home-intro {
  max-width: 980px;
  margin: 0 auto;
  color: #61798a;
  font-size: clamp(1.08rem, 1.8vw, 1.38rem);
  line-height: 1.65;
}
.learner-panel {
  max-width: 760px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 28px auto 0;
  padding: 17px 20px;
  border: 1px solid #b8dcec;
  border-radius: 16px;
  background: rgba(238,249,255,.92);
  color: #173c55;
  text-align: left;
}
.learner-panel > div:first-child { display: grid; gap: 3px; }
.learner-label,
.learner-code-wrap > span {
  color: #477087;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.learner-panel strong { font-size: 1.08rem; }
.learner-panel small { color: #5b7687; font-size: .8rem; }
#save-status[data-state="error"] { color: #a63442; }
#save-status[data-state="saved"] { color: #157455; }
.learner-code-wrap {
  display: grid;
  justify-items: end;
  gap: 5px;
}
.code-button {
  padding: 7px 11px;
  border: 1px solid #80bdd9;
  border-radius: 8px;
  background: #fff;
  color: #194b67;
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .86rem;
  font-weight: 800;
  letter-spacing: .06em;
}
.home-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}
.home-stats > span {
  padding: 10px 18px;
  border: 1px solid #c8dce9;
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  color: #526c7e;
  font-size: .95rem;
  font-weight: 650;
  box-shadow: 0 2px 5px rgba(28,71,98,.03);
}
.home-stats strong { color: #39566a; }

.lecture-dashboard {
  width: min(1360px, 100%);
  margin: 58px auto 0;
}
.lecture-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 22px;
}
.lecture-card-shell {
  position: relative;
  min-width: 0;
}
.lecture-card-shell > .lecture-card {
  height: 100%;
}
.lecture-card {
  width: 100%;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  padding: 34px 36px 30px;
  border: 1.5px solid #cbdde8;
  border-radius: 22px;
  background: rgba(255,255,255,.95);
  color: #17364d;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(36,75,98,.055);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.lecture-card.has-reset .lecture-card-title {
  max-width: calc(100% - 110px);
}
.lecture-reset-button {
  position: absolute;
  z-index: 2;
  top: 24px;
  right: 24px;
  padding: 8px 12px;
  border: 1px solid #b8cfdd;
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  color: #526f82;
  cursor: pointer;
  font: inherit;
  font-size: .76rem;
  font-weight: 800;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.lecture-reset-button:hover {
  border-color: #d37b83;
  background: #fff6f6;
  color: #a63442;
}
.lecture-reset-button:focus-visible {
  outline: 3px solid rgba(58,177,226,.32);
  outline-offset: 2px;
}
.lecture-card:hover {
  border-color: #64bbe5;
  box-shadow: 0 18px 42px rgba(39,102,138,.11);
  transform: translateY(-2px);
}
.lecture-card:focus-visible {
  outline: 4px solid rgba(58,177,226,.32);
  outline-offset: 3px;
}
.comprehensive-card {
  min-height: 265px;
  border-color: #78c9ed;
  background: linear-gradient(135deg, #eefaff 0%, #ffffff 72%);
}
.lecture-card-code {
  color: #147bb9;
  font-size: .92rem;
  font-weight: 850;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.lecture-card-title {
  display: block;
  max-width: 94%;
  margin-top: 15px;
  color: #14334b;
  font-size: clamp(1.35rem, 2vw, 1.72rem);
  line-height: 1.22;
  letter-spacing: -.035em;
}
.lecture-card-spacer { flex: 1 1 40px; }
.lecture-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #687f90;
  font-size: .96rem;
}
.lecture-card-meta strong { color: #24465d; }
.lecture-card-detail {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 9px;
  color: #7890a0;
  font-size: .78rem;
}
.lecture-card-detail strong { color: #365970; }
.lecture-progress {
  height: 10px;
  margin-top: 17px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5f0f5;
}
.lecture-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1b86bf, #4fc3e8);
  transition: width .25s ease;
}

.learner-dialog {
  width: min(620px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  box-shadow: 0 30px 90px rgba(4,25,40,.3);
}
.learner-dialog::backdrop {
  background: rgba(8,28,43,.62);
  backdrop-filter: blur(5px);
}
.learner-dialog-card {
  position: relative;
  padding: 34px;
  border: 1px solid #c2d9e6;
  border-radius: 22px;
  background: #fff;
  color: #17364d;
}
.learner-dialog h2 {
  margin: 10px 0 8px;
  font-size: 2rem;
  letter-spacing: -.035em;
}
.dialog-intro {
  margin: 0 0 24px;
  color: #5d7484;
  line-height: 1.55;
}
.dialog-close {
  position: absolute;
  top: 15px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #eef5f8;
  color: #31556b;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}
.learner-form { display: grid; gap: 9px; }
.learner-form label {
  color: #385b70;
  font-size: .82rem;
  font-weight: 800;
}
.learner-form-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 10px;
}
.learner-form input {
  min-height: 44px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid #9fb8c7;
  border-radius: 7px;
  color: #17364d;
  font-size: 1rem;
}
.dialog-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 25px 0;
  color: #78909f;
  font-size: .78rem;
}
.dialog-divider::before,
.dialog-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #d7e2e8;
}
.learner-form-message {
  min-height: 1.3em;
  margin: 16px 0 0;
  color: #a13240;
  font-size: .86rem;
}
.privacy-note {
  margin: 13px 0 0;
  color: #718795;
  font-size: .76rem;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .app-header {
    grid-template-columns: 1fr auto;
    height: 96px;
    padding: 0 24px;
  }
  .brand-mark { width: 58px; height: 58px; border-radius: 14px; font-size: 1.5rem; }
  .brand strong { font-size: 1.38rem; }
  .brand div > span { font-size: .78rem; }
  .learner-button { max-width: 170px; }
  .header-view-title { display: none; }
  body[data-screen="start"] .start-screen { min-height: calc(100vh - 96px); padding-top: 56px; }
  .lecture-card { min-height: 215px; padding: 28px; }
}

@media (max-width: 720px) {
  .app-header { height: 76px; padding: 0 15px; }
  .brand { gap: 10px; }
  .brand-mark { width: 46px; height: 46px; border-width: 2px; border-radius: 11px; font-size: 1.25rem; }
  .brand strong { font-size: 1.1rem; }
  .brand div > span { font-size: .65rem; letter-spacing: .12em; }
  .learner-button { display: none; }
  .study-clock { gap: 8px; }
  .study-clock > span { display: none; }
  .study-clock strong { font-size: 1rem; }
  body[data-screen="start"] .start-screen { min-height: calc(100vh - 76px); padding: 38px 14px 70px; }
  .home-eyebrow { font-size: .73rem; line-height: 1.6; letter-spacing: .13em; }
  .home-hero h1 { margin-top: 17px; font-size: clamp(2.65rem, 13vw, 3.6rem); }
  .home-intro { font-size: 1rem; line-height: 1.55; }
  .learner-panel { align-items: stretch; flex-direction: column; gap: 13px; }
  .learner-code-wrap { justify-items: start; }
  .home-stats { align-items: stretch; flex-direction: column; margin-top: 24px; }
  .home-stats > span { font-size: .86rem; }
  .lecture-dashboard { margin-top: 38px; }
  .lecture-card-grid { grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
  .lecture-card, .comprehensive-card { min-height: 200px; padding: 25px 22px 23px; border-radius: 17px; }
  .lecture-reset-button { top: 16px; right: 16px; padding: 7px 10px; }
  .lecture-card.has-reset .lecture-card-title { max-width: calc(100% - 92px); }
  .lecture-card-title { font-size: 1.35rem; }
  .lecture-card-meta { gap: 12px; font-size: .84rem; }
  .lecture-card-detail { align-items: flex-start; flex-direction: column; gap: 4px; }
  .learner-dialog-card { padding: 28px 20px 22px; }
  .learner-form-row { grid-template-columns: 1fr; }
}
