@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&family=DM+Mono:wght@400;500&display=swap');

:root {
  --burgundy: #542b35;
  --burgundy-dark: #3b2028;
  --burgundy-soft: #7a4b50;
  --amber: #e7a83e;
  --amber-light: #f6d28a;
  --paper: #fffaf1;
  --paper-deep: #f4ead9;
  --sand: #eadbc4;
  --ink: #2d2225;
  --muted: #75676a;
  --green: #54785c;
  --red: #ae5a4e;
  --shadow: 0 18px 45px rgba(84, 43, 53, 0.12);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper-deep); }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 5%, rgba(231,168,62,.15), transparent 28%),
    linear-gradient(115deg, rgba(84,43,53,.025) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--paper-deep);
  font-family: 'Atkinson Hyperlegible', 'Trebuchet MS', sans-serif;
}
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  width: 265px; flex: 0 0 265px; min-height: 100vh; padding: 28px 20px 22px;
  color: #fff7e9; background: var(--burgundy);
  border-right: 5px solid var(--amber); position: sticky; top: 0; align-self: flex-start;
  display: flex; flex-direction: column; gap: 28px;
}
.brand { display: flex; gap: 12px; align-items: center; color: #fff7e9; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: var(--amber); color: var(--burgundy-dark); font-family: 'DM Mono', monospace; font-weight: 500; font-size: 14px;
  box-shadow: 4px 4px 0 rgba(0,0,0,.16);
}
.brand-copy { line-height: 1.05; }
.brand-copy strong { display: block; font-size: 17px; letter-spacing: .03em; }
.brand-copy span { color: var(--amber-light); font-size: 12px; }
.rail-label { margin: 0 0 8px; color: #dcb8a2; font: 11px 'DM Mono', monospace; text-transform: uppercase; letter-spacing: .1em; }
.nav-list { display: grid; gap: 7px; }
.nav-button {
  width: 100%; border: 0; border-radius: 12px; padding: 12px 13px; cursor: pointer; text-align: left;
  background: transparent; color: #f6e9dc; display: flex; align-items: center; gap: 10px; transition: .2s ease;
}
.nav-button:hover { background: rgba(255,255,255,.1); transform: translateX(2px); }
.nav-button.active { background: #fff7e9; color: var(--burgundy); box-shadow: 4px 4px 0 rgba(0,0,0,.1); }
.nav-number { font: 12px 'DM Mono', monospace; opacity: .72; min-width: 20px; }
.nav-name { flex: 1; font-weight: 700; font-size: 14px; }
.nav-check { width: 8px; height: 8px; background: var(--amber); border-radius: 50%; opacity: 0; }
.nav-button.done .nav-check { opacity: 1; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.16); padding-top: 18px; }
.reset-button { width: 100%; border: 1px solid rgba(255,255,255,.22); border-radius: 10px; background: transparent; color: #f6e9dc; padding: 10px 12px; cursor: pointer; font-size: 13px; }
.reset-button:hover { background: rgba(255,255,255,.1); }
.small-note { color: #dcb8a2; font-size: 12px; line-height: 1.45; margin: 12px 3px 0; }

.main { width: 100%; min-width: 0; padding: 30px clamp(20px, 5vw, 70px) 65px; }
.topline { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 30px; }
.breadcrumb { color: var(--muted); font: 12px 'DM Mono', monospace; text-transform: uppercase; letter-spacing: .08em; }
.breadcrumb b { color: var(--burgundy); }
.top-progress { display: flex; align-items: center; gap: 11px; min-width: 205px; }
.progress-track { height: 8px; width: 120px; border-radius: 10px; background: #dbcbb7; overflow: hidden; }
.progress-fill { height: 100%; background: var(--amber); border-radius: inherit; transition: width .4s ease; }
.progress-label { font: 12px 'DM Mono', monospace; color: var(--muted); white-space: nowrap; }

.eyebrow { color: var(--burgundy-soft); font: 12px 'DM Mono', monospace; text-transform: uppercase; letter-spacing: .13em; margin: 0 0 12px; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 780px; margin-bottom: 16px; font-size: clamp(38px, 6vw, 72px); letter-spacing: -.055em; line-height: .96; color: var(--burgundy-dark); }
h2 { color: var(--burgundy-dark); font-size: 28px; letter-spacing: -.03em; }
h3 { color: var(--burgundy-dark); font-size: 18px; }
.lede { max-width: 660px; color: var(--muted); font-size: 18px; line-height: 1.5; margin-bottom: 26px; }
.hero { max-width: 900px; padding: 15px 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.primary-button, .secondary-button {
  border: 0; border-radius: 11px; padding: 13px 17px; cursor: pointer; font-weight: 700; transition: .2s ease;
}
.primary-button { color: var(--burgundy-dark); background: var(--amber); box-shadow: 4px 4px 0 var(--burgundy); }
.primary-button:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--burgundy); }
.secondary-button { color: var(--burgundy); background: transparent; border: 1px solid #cdb5a6; }
.secondary-button:hover { background: var(--paper); border-color: var(--burgundy-soft); }

.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 24px 0 36px; max-width: 900px; }
.stat-card { padding: 19px; background: var(--paper); border: 1px solid #e2d1bc; border-radius: var(--radius); box-shadow: 0 5px 0 #dfccb3; }
.stat-label { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.stat-value { color: var(--burgundy); font: 500 31px 'DM Mono', monospace; }
.stat-sub { color: var(--muted); font-size: 12px; margin-top: 5px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading span { color: var(--muted); font-size: 13px; }

.quiz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 1000px; }
.quiz-card { background: var(--paper); border: 1px solid #e2d1bc; border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden; cursor: pointer; transition: .2s ease; }
.quiz-card::before { content: ''; position: absolute; width: 80px; height: 80px; right: -26px; top: -30px; border-radius: 50%; background: var(--amber-light); opacity: .55; }
.quiz-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #cba88b; }
.quiz-card-top { display: flex; justify-content: space-between; gap: 10px; position: relative; }
.quiz-index { color: var(--burgundy-soft); font: 12px 'DM Mono', monospace; }
.status-pill { border-radius: 100px; padding: 5px 9px; color: var(--muted); background: #eee2d2; font-size: 11px; font-weight: 700; }
.status-pill.done { color: #35613c; background: #dcead7; }
.status-pill.partial { color: #8d5b18; background: #f7e5b7; }
.quiz-card h3 { margin: 16px 0 7px; }
.quiz-card p { color: var(--muted); line-height: 1.42; min-height: 40px; margin-bottom: 16px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.card-score { font: 12px 'DM Mono', monospace; color: var(--burgundy); }
.topic-strip { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.topic-tag { padding: 4px 7px; border-radius: 5px; background: #f1e2cd; color: var(--burgundy-soft); font: 10px 'DM Mono', monospace; }

.coverage-panel { max-width: 1000px; margin-top: 38px; padding: 22px; background: var(--burgundy); border-radius: var(--radius); color: #fff7e9; box-shadow: var(--shadow); }
.coverage-panel h2 { color: #fff7e9; margin-bottom: 4px; }
.coverage-panel > p { color: #dfc7b8; margin-bottom: 20px; }
.coverage-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.coverage-item { padding: 12px; border-radius: 12px; background: rgba(255,255,255,.08); }
.coverage-name { display: flex; justify-content: space-between; gap: 8px; color: #fff7e9; font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.coverage-status { color: var(--amber-light); font: 10px 'DM Mono', monospace; text-transform: uppercase; }
.coverage-bar { height: 6px; background: rgba(255,255,255,.15); border-radius: 10px; overflow: hidden; }
.coverage-bar span { display: block; height: 100%; border-radius: inherit; background: var(--amber); }

.quiz-header { max-width: 900px; margin-bottom: 22px; }
.quiz-header h1 { font-size: clamp(34px, 5vw, 58px); max-width: 700px; }
.quiz-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; color: var(--muted); font-size: 14px; }
.meta-dot { color: var(--amber); }
.question-progress { display: flex; gap: 6px; margin: 24px 0 13px; }
.question-dot { height: 5px; flex: 1; max-width: 100px; background: #d9c6ae; border-radius: 10px; }
.question-dot.current { background: var(--burgundy); }
.question-dot.done { background: var(--amber); }
.question-card { max-width: 900px; background: var(--paper); border: 1px solid #e2d1bc; border-radius: 20px; padding: clamp(20px, 4vw, 38px); box-shadow: var(--shadow); }
.question-kicker { color: var(--burgundy-soft); font: 12px 'DM Mono', monospace; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 17px; }
.question-card h2 { font-size: clamp(21px, 3vw, 29px); line-height: 1.25; margin-bottom: 17px; }
.code-block { background: var(--burgundy-dark); color: #f8db9d; padding: 17px; border-radius: 12px; overflow-x: auto; font: 13px/1.6 'DM Mono', monospace; margin: 0 0 21px; white-space: pre-wrap; }
.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: flex-start; gap: 11px; width: 100%; text-align: left; padding: 14px 15px; border: 1px solid #decbb6; border-radius: 12px; color: var(--ink); background: #fffdf7; cursor: pointer; transition: .15s ease;
}
.option:hover:not(:disabled) { border-color: var(--burgundy-soft); background: #fff5e6; transform: translateX(2px); }
.option:disabled { cursor: default; }
.option.correct { border-color: var(--green); background: #edf5e8; }
.option.incorrect { border-color: var(--red); background: #fbece7; }
.option-letter { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; color: var(--burgundy); background: #f0ddc2; border-radius: 50%; font: 12px 'DM Mono', monospace; }
.option.correct .option-letter { color: #fff; background: var(--green); }
.option.incorrect .option-letter { color: #fff; background: var(--red); }
.option-copy { line-height: 1.4; }
.feedback { margin-top: 18px; padding: 15px 16px; border-left: 4px solid var(--amber); border-radius: 0 10px 10px 0; background: #f8edd8; color: var(--ink); line-height: 1.5; }
.feedback strong { color: var(--burgundy); display: block; margin-bottom: 4px; }
.question-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.result-card { max-width: 900px; padding: 30px; background: var(--burgundy); border-radius: 20px; color: #fff7e9; box-shadow: var(--shadow); }
.result-card h2 { color: #fff7e9; margin-bottom: 8px; }
.result-score { display: flex; align-items: center; gap: 18px; margin: 25px 0; }
.score-ring { width: 82px; height: 82px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--amber) var(--score), rgba(255,255,255,.17) 0); position: relative; }
.score-ring::after { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: var(--burgundy); }
.score-ring span { position: relative; z-index: 1; font: 15px 'DM Mono', monospace; color: #fff7e9; }
.result-copy { color: #dfc7b8; line-height: 1.45; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.result-actions .primary-button { box-shadow: 4px 4px 0 var(--burgundy-dark); }

.empty-state { max-width: 700px; padding: 30px; background: var(--paper); border: 1px dashed #cdb5a6; border-radius: var(--radius); color: var(--muted); }

@media (max-width: 850px) {
  .app-shell { display: block; }
  .sidebar { width: 100%; min-height: auto; position: static; border-right: 0; border-bottom: 5px solid var(--amber); padding: 15px 16px 13px; gap: 13px; }
  .brand { margin-bottom: 2px; }
  .nav-wrap { overflow-x: auto; padding-bottom: 2px; }
  .nav-list { display: flex; min-width: max-content; }
  .nav-button { width: auto; padding: 9px 11px; }
  .nav-name { font-size: 12px; }
  .nav-number { min-width: auto; }
  .sidebar-footer { display: flex; align-items: center; gap: 12px; margin-top: 0; padding-top: 12px; }
  .reset-button { width: auto; white-space: nowrap; }
  .small-note { margin: 0; }
  .main { padding: 24px 18px 45px; }
  .topline { margin-bottom: 20px; }
}
@media (max-width: 620px) {
  .topline { align-items: flex-start; flex-direction: column; gap: 10px; }
  .top-progress { width: 100%; }
  .progress-track { flex: 1; }
  h1 { font-size: 44px; }
  .stat-grid, .quiz-grid, .coverage-list { grid-template-columns: 1fr; }
  .stat-grid { gap: 10px; }
  .quiz-card p { min-height: 0; }
  .question-card { padding: 20px 16px; }
}

/* Written-response Exam 3 practice. */
.exam-format-switch { padding: 8px 12px; font-size: 12px; white-space: nowrap; }
.exam-outline { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 32px; max-width: 1000px; padding: 18px; background: var(--paper); border: 1px solid var(--sand); border-radius: 14px; }
.exam-outline > div { flex: 1 1 170px; }
.exam-outline b { display: block; color: var(--burgundy); font: 500 22px 'DM Mono', monospace; }
.exam-outline span { display: block; color: var(--muted); font-size: 13px; margin-top: 5px; }
.hero-actions { margin-top: 22px; }
.compact { padding: 9px 12px; font-size: 12px; }
.question-navigation { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 20px; }
.question-nav { min-width: 36px; min-height: 36px; border: 1px solid #cdb5a6; border-radius: 7px; color: var(--burgundy); background: var(--paper); font: 12px 'DM Mono', monospace; cursor: pointer; }
.question-nav.selected { outline: 2px solid var(--burgundy); outline-offset: 2px; }
.question-nav.scored { background: var(--amber-light); }
.answer-label, .points-label { display: block; font-weight: 700; margin-bottom: 10px; }
#paper-response { width: 100%; resize: vertical; min-height: 135px; border: 1px solid #bca493; border-radius: 10px; padding: 15px; background: #fffdf7; color: var(--ink); font: 14px/1.6 'DM Mono', monospace; tab-size: 4; }
#paper-response:focus { outline: 3px solid var(--amber); outline-offset: 2px; }
#paper-response[readonly] { background: var(--paper-deep); }
#paper-award { padding: 12px; margin: 0 10px 10px 0; border-radius: 9px; border: 1px solid #bca493; font: inherit; background: var(--paper); }
.model-code { margin-top: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.rubric { padding-left: 21px; line-height: 1.6; font-size: 14px; }
.grading-note { margin: 16px 0; max-width: 900px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.score-caption { color: var(--burgundy); font-weight: 700; }
.paper-bottom { max-width: 900px; margin: 20px 0; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.review-list { margin-top: 30px; max-width: 900px; }
.review-question { padding: 16px; margin-bottom: 10px; border-radius: 12px; border: 1px solid var(--sand); background: var(--paper); }
.review-question summary { cursor: pointer; font-weight: 700; color: var(--burgundy); }
.review-question > p:first-of-type { margin-top: 20px; }
.response-review { padding: 14px; background: var(--paper-deep); border-radius: 10px; font: 13px/1.6 'DM Mono', monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.result-actions .secondary-button { color: #fff7e9; border-color: #b98a8f; }
.result-actions .secondary-button:hover { background: var(--burgundy-soft); }
@media (max-width: 850px) {
  .topline { flex-wrap: wrap; }
  .exam-format-switch { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
