:root {
  --bg: #050911;
  --surface: #0c131f;
  --surface-2: #111b2a;
  --surface-3: #172235;
  --border: #233147;
  --border-bright: #3a4b64;
  --text: #f5f7fa;
  --muted: #9aa8ba;
  --subtle: #6f7f94;
  --orange: #ff9900;
  --orange-light: #ffb84d;
  --orange-soft: rgba(255, 153, 0, .11);
  --blue: #42b4ff;
  --green: #41d6a3;
  --red: #fb7185;
  --yellow: #f8c555;
  --secure: #9b8cff;
  --resilient: #42b4ff;
  --performance: #41d6a3;
  --cost: #f8c555;
  --shadow: 0 20px 60px rgba(0, 0, 0, .32);
  --radius: 18px;
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: "Fira Sans", system-ui, -apple-system, sans-serif;
  line-height: 1.55;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: var(--blue); }
a:hover { color: #86d1ff; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.skip-link { position: fixed; z-index: 999; top: 8px; left: 8px; transform: translateY(-150%); padding: 10px 14px; color: #111; background: var(--orange); border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }
.ambient { position: fixed; z-index: -1; border-radius: 50%; filter: blur(100px); opacity: .13; pointer-events: none; }
.ambient-one { width: 460px; height: 460px; top: -170px; right: 4%; background: var(--orange); }
.ambient-two { width: 520px; height: 520px; bottom: -240px; left: -160px; background: #1b7fc0; }

.topbar {
  position: sticky; z-index: 100; top: 12px;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px;
  width: min(calc(100% - 24px), 1380px); margin: 12px auto 0; padding: 11px 14px;
  background: rgba(8, 14, 24, .9); border: 1px solid rgba(68, 85, 108, .62); border-radius: 16px;
  box-shadow: 0 12px 42px rgba(0,0,0,.3); backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 216px; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: #101722; background: var(--orange); border-radius: 11px; box-shadow: 0 7px 18px rgba(255,153,0,.2); }
.brand-mark svg { width: 25px; height: 25px; stroke-width: 2.1; }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: -.02em; }
.brand small { margin-top: -2px; color: var(--muted); font-size: .72rem; }
.primary-nav { display: flex; justify-content: center; gap: 5px; }
.nav-button, .icon-button { border: 0; cursor: pointer; transition: color .2s ease, background .2s ease, border-color .2s ease; }
.nav-button { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 10px; font-size: .9rem; }
.nav-button svg { width: 18px; height: 18px; }
.nav-button:hover { color: var(--text); background: rgba(255,255,255,.045); }
.nav-button.active { color: #1a1208; background: var(--orange); border-color: var(--orange-light); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.exam-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; color: #d9e2ed; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; font-family: "Fira Code", monospace; font-size: .73rem; }
.status-dot { width: 7px; height: 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 4px rgba(65,214,163,.11); }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; color: var(--muted); background: transparent; border: 1px solid var(--border); border-radius: 10px; }
.icon-button:hover { color: var(--text); border-color: var(--border-bright); background: var(--surface-2); }
.icon-button svg { width: 18px; height: 18px; }

main { width: min(calc(100% - 32px), var(--max)); margin: 42px auto 80px; }
.view { display: none; }
.view.active { display: block; animation: enter .28s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--orange-light); font-family: "Fira Code", monospace; font-size: .73rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 19px; height: 1px; background: currentColor; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 800px; margin-bottom: 14px; font-size: clamp(2.25rem, 6vw, 4.8rem); line-height: 1.02; letter-spacing: -.055em; }
h2 { letter-spacing: -.025em; }
h3 { letter-spacing: -.015em; }
.page-header { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.page-header h1 { margin-bottom: 8px; font-size: clamp(2rem, 5vw, 3.3rem); }
.page-header p, .hero-copy { max-width: 700px; color: var(--muted); font-size: 1.04rem; }
.hero { display: grid; grid-template-columns: 1.35fr .65fr; align-items: center; gap: 36px; padding: 38px 0 34px; }
.hero-title-accent { color: var(--orange); }
.hero-actions, .card-actions, .quiz-actions, .modal-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; cursor: pointer; color: #171008; background: var(--orange); border: 1px solid var(--orange-light); border-radius: 10px; font-weight: 600; text-decoration: none; transition: color .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease; }
.button:hover { color: #171008; background: #ffab2e; box-shadow: 0 8px 24px rgba(255,153,0,.15); }
.button.secondary { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.button.secondary:hover { color: var(--text); background: var(--surface-3); border-color: var(--border-bright); box-shadow: none; }
.button.ghost { color: var(--muted); background: transparent; border-color: transparent; }
.button.ghost:hover { color: var(--text); background: rgba(255,255,255,.04); box-shadow: none; }
.button.danger { color: #fff; background: #b4233a; border-color: #df4760; }
.button:disabled { cursor: not-allowed; opacity: .45; box-shadow: none; }
.button svg { width: 18px; height: 18px; }
.hero-visual { position: relative; display: grid; place-items: center; min-height: 300px; }
.blueprint-ring { position: absolute; width: 270px; height: 270px; border: 1px solid rgba(66,180,255,.22); border-radius: 50%; }
.blueprint-ring::before, .blueprint-ring::after { content: ""; position: absolute; inset: 26px; border: 1px dashed rgba(255,153,0,.27); border-radius: inherit; }
.blueprint-ring::after { inset: 64px; border-style: solid; border-color: rgba(65,214,163,.2); }
.score-orbit { position: relative; z-index: 1; display: grid; place-items: center; width: 184px; height: 184px; text-align: center; background: radial-gradient(circle, #172235 0, #0b1320 68%); border: 1px solid var(--border-bright); border-radius: 50%; box-shadow: 0 0 70px rgba(66,180,255,.09); }
.score-orbit strong { display: block; color: var(--orange); font-family: "Fira Code", monospace; font-size: 2.7rem; line-height: 1; }
.score-orbit span { display: block; margin-top: 7px; color: var(--muted); font-size: .82rem; }
.orbit-label { position: absolute; z-index: 2; padding: 7px 9px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font-family: "Fira Code", monospace; font-size: .65rem; }
.orbit-label.one { top: 24px; right: 6px; }
.orbit-label.two { bottom: 36px; left: 0; }

.grid { display: grid; gap: 16px; }
.stats-grid { grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; }
.two-column { grid-template-columns: 1.1fr .9fr; }
.three-column { grid-template-columns: repeat(3, 1fr); }
.card { background: linear-gradient(145deg, rgba(18,28,43,.96), rgba(10,17,28,.96)); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 14px 44px rgba(0,0,0,.16); }
.card-pad { padding: 22px; }
.stat-card { position: relative; overflow: hidden; min-height: 130px; padding: 19px; }
.stat-card::after { content: ""; position: absolute; width: 85px; height: 85px; right: -32px; bottom: -38px; background: var(--stat-color, var(--blue)); border-radius: 50%; filter: blur(24px); opacity: .15; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .8rem; }
.stat-icon { display: grid; place-items: center; width: 34px; height: 34px; color: var(--stat-color, var(--blue)); background: color-mix(in srgb, var(--stat-color, var(--blue)) 12%, transparent); border-radius: 9px; }
.stat-icon svg { width: 18px; height: 18px; }
.stat-value { display: block; margin-top: 18px; font-family: "Fira Code", monospace; font-size: 1.8rem; letter-spacing: -.04em; }
.stat-detail { display: block; margin-top: 3px; color: var(--subtle); font-size: .72rem; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.card-heading h2, .card-heading h3 { margin: 0; }
.card-heading a, .text-button { color: var(--orange-light); background: none; border: 0; cursor: pointer; font-size: .82rem; text-decoration: none; }
.card-heading a:hover, .text-button:hover { color: #ffd08a; text-decoration: underline; }
.domain-list { display: grid; gap: 18px; }
.domain-row { display: grid; grid-template-columns: minmax(150px, .75fr) 1.5fr auto; align-items: center; gap: 14px; }
.domain-label { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: .88rem; }
.domain-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--domain-color); box-shadow: 0 0 0 4px color-mix(in srgb, var(--domain-color) 12%, transparent); }
.progress-track { overflow: hidden; height: 7px; background: #07101c; border-radius: 999px; }
.progress-bar { height: 100%; background: var(--domain-color, var(--orange)); border-radius: inherit; transition: width .4s ease; }
.domain-score { min-width: 42px; color: var(--muted); font-family: "Fira Code", monospace; font-size: .73rem; text-align: right; }
.activity-list { display: grid; gap: 12px; }
.empty-state { display: grid; place-items: center; min-height: 220px; padding: 30px; color: var(--muted); text-align: center; border: 1px dashed var(--border); border-radius: 14px; }
.empty-state svg { width: 34px; height: 34px; margin-bottom: 10px; color: var(--subtle); }
.history-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px; background: rgba(255,255,255,.025); border: 1px solid transparent; border-radius: 10px; }
.history-score { display: grid; place-items: center; width: 46px; height: 46px; border: 2px solid var(--green); border-radius: 50%; font-family: "Fira Code", monospace; font-size: .72rem; }
.history-score.fail { border-color: var(--red); }
.history-copy strong, .history-copy small { display: block; }
.history-copy small, .history-time { color: var(--subtle); font-size: .72rem; }
.exam-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 18px; overflow: hidden; background: var(--border); border: 1px solid var(--border); border-radius: 14px; }
.exam-fact { padding: 17px; background: var(--surface); }
.exam-fact strong, .exam-fact span { display: block; }
.exam-fact strong { font-family: "Fira Code", monospace; font-size: 1.05rem; }
.exam-fact span { margin-top: 4px; color: var(--muted); font-size: .72rem; }

.study-layout { display: grid; grid-template-columns: 290px minmax(0,1fr); align-items: start; gap: 20px; }
.study-sidebar { position: sticky; top: 96px; max-height: calc(100vh - 116px); overflow: auto; padding: 13px; }
.study-sidebar-title { margin: 7px 8px 12px; color: var(--muted); font-family: "Fira Code", monospace; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.module-nav { display: grid; gap: 4px; }
.module-nav-button { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 9px; width: 100%; padding: 9px; cursor: pointer; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 10px; text-align: left; transition: color .2s, background .2s, border-color .2s; }
.module-nav-button:hover { color: var(--text); background: rgba(255,255,255,.035); }
.module-nav-button.active { color: var(--text); background: var(--orange-soft); border-color: rgba(255,153,0,.27); }
.module-num { display: grid; place-items: center; width: 28px; height: 28px; color: var(--domain-color); background: color-mix(in srgb, var(--domain-color) 10%, transparent); border-radius: 8px; font-family: "Fira Code", monospace; font-size: .65rem; }
.module-nav-button small { display: block; margin-top: 1px; color: var(--subtle); font-size: .66rem; }
.complete-check { color: var(--green); }
.complete-check svg { width: 16px; height: 16px; }
.module-article { overflow: hidden; }
.module-hero { padding: 28px; background: linear-gradient(130deg, color-mix(in srgb, var(--domain-color) 13%, var(--surface)), var(--surface)); border-bottom: 1px solid var(--border); }
.domain-tag, .tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; color: var(--domain-color, var(--muted)); background: color-mix(in srgb, var(--domain-color, var(--muted)) 9%, transparent); border: 1px solid color-mix(in srgb, var(--domain-color, var(--muted)) 22%, transparent); border-radius: 999px; font-family: "Fira Code", monospace; font-size: .65rem; }
.module-hero h2 { margin: 14px 0 8px; font-size: clamp(1.55rem, 4vw, 2.35rem); }
.module-hero p { max-width: 780px; margin: 0; color: var(--muted); }
.module-body { padding: 28px; }
.module-section + .module-section { margin-top: 29px; padding-top: 27px; border-top: 1px solid var(--border); }
.module-section h3 { margin-bottom: 13px; }
.concept-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.concept { padding: 15px; background: rgba(255,255,255,.025); border: 1px solid var(--border); border-radius: 11px; }
.concept strong { display: block; margin-bottom: 5px; color: #eaf1f8; }
.concept p { margin: 0; color: var(--muted); font-size: .88rem; }
.decision-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.decision-list li { position: relative; padding: 12px 14px 12px 38px; color: #c4ceda; background: rgba(255,255,255,.02); border-radius: 9px; }
.decision-list li::before { content: "→"; position: absolute; left: 14px; color: var(--orange); font-family: "Fira Code", monospace; }
.exam-tip { padding: 17px; color: #dce8f5; background: rgba(66,180,255,.07); border: 1px solid rgba(66,180,255,.25); border-left: 3px solid var(--blue); border-radius: 10px; }
.exam-tip strong { color: var(--blue); }
.source-list { display: flex; flex-wrap: wrap; gap: 8px; }
.source-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font-size: .77rem; text-decoration: none; }
.source-link:hover { color: var(--text); border-color: var(--border-bright); }
.source-link svg { width: 14px; height: 14px; }
.module-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 24px; margin-top: 30px; border-top: 1px solid var(--border); }

.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mode-card { position: relative; overflow: hidden; padding: 24px; }
.mode-card.recommended { border-color: rgba(255,153,0,.5); }
.ribbon { position: absolute; top: 14px; right: -31px; width: 120px; padding: 4px; color: #171008; background: var(--orange); font-size: .62rem; font-weight: 700; text-align: center; transform: rotate(38deg); }
.mode-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 22px; color: var(--mode-color, var(--orange)); background: color-mix(in srgb, var(--mode-color, var(--orange)) 10%, transparent); border: 1px solid color-mix(in srgb, var(--mode-color, var(--orange)) 25%, transparent); border-radius: 13px; }
.mode-card p { min-height: 68px; color: var(--muted); font-size: .88rem; }
.mode-meta { display: flex; gap: 18px; margin: 20px 0; color: var(--muted); font-family: "Fira Code", monospace; font-size: .7rem; }
.mode-meta span { display: flex; align-items: center; gap: 5px; }
.mode-meta svg { width: 15px; height: 15px; }
.quiz-shell { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 18px; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.quiz-progress { flex: 1; }
.quiz-progress-row { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-family: "Fira Code", monospace; font-size: .7rem; }
.timer { display: inline-flex; align-items: center; gap: 8px; min-width: 104px; padding: 9px 11px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 9px; font-family: "Fira Code", monospace; }
.timer.warning { color: var(--yellow); border-color: rgba(248,197,85,.45); }
.question-card { padding: 28px; }
.question-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.question-card h2 { margin-bottom: 24px; font-size: clamp(1.16rem, 3vw, 1.52rem); line-height: 1.45; }
.selection-hint { color: var(--muted); font-size: .78rem; }
.options { display: grid; gap: 10px; }
.option { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 12px; padding: 14px; cursor: pointer; color: #d9e1eb; background: rgba(255,255,255,.022); border: 1px solid var(--border); border-radius: 11px; transition: background .2s, border-color .2s; }
.option:hover { background: rgba(255,255,255,.04); border-color: var(--border-bright); }
.option.selected { background: var(--orange-soft); border-color: rgba(255,153,0,.55); }
.option.correct { background: rgba(65,214,163,.08); border-color: rgba(65,214,163,.55); }
.option.incorrect { background: rgba(251,113,133,.07); border-color: rgba(251,113,133,.5); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option-marker { display: grid; place-items: center; width: 27px; height: 27px; color: var(--muted); border: 1px solid var(--border-bright); border-radius: 7px; font-family: "Fira Code", monospace; font-size: .7rem; }
.option.selected .option-marker { color: #15100a; background: var(--orange); border-color: var(--orange); }
.option-text { padding-top: 2px; }
.question-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; }
.flag-button.active { color: var(--yellow); border-color: rgba(248,197,85,.4); }
.quiz-sidebar { position: sticky; top: 96px; padding: 17px; }
.quiz-sidebar h3 { margin-bottom: 12px; font-size: .88rem; }
.question-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-height: 405px; overflow: auto; }
.question-jump { position: relative; aspect-ratio: 1; cursor: pointer; color: var(--muted); background: rgba(255,255,255,.02); border: 1px solid var(--border); border-radius: 7px; font-family: "Fira Code", monospace; font-size: .66rem; }
.question-jump:hover { color: var(--text); border-color: var(--border-bright); }
.question-jump.current { color: #171008; background: var(--orange); border-color: var(--orange); }
.question-jump.answered:not(.current) { color: #b9f4df; background: rgba(65,214,163,.09); border-color: rgba(65,214,163,.4); }
.question-jump.flagged::after { content: ""; position: absolute; width: 6px; height: 6px; top: -2px; right: -2px; background: var(--yellow); border: 2px solid var(--surface); border-radius: 50%; }
.quiz-legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; color: var(--subtle); font-size: .64rem; }
.legend-key { display: flex; align-items: center; gap: 5px; }
.legend-swatch { width: 8px; height: 8px; border: 1px solid var(--border); border-radius: 2px; }
.explanation { margin-top: 16px; padding: 17px; background: rgba(66,180,255,.06); border: 1px solid rgba(66,180,255,.23); border-radius: 10px; }
.explanation h4 { margin: 0 0 6px; color: var(--blue); }
.explanation p { margin-bottom: 10px; color: var(--muted); }
.results-hero { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 28px; padding: 28px; }
.result-ring { --result: 0; display: grid; place-items: center; width: 150px; height: 150px; background: conic-gradient(var(--ring-color, var(--green)) calc(var(--result) * 1%), var(--surface-3) 0); border-radius: 50%; }
.result-ring::before { content: ""; grid-area: 1/1; width: 124px; height: 124px; background: var(--surface); border-radius: 50%; }
.result-ring span { z-index: 1; grid-area: 1/1; font-family: "Fira Code", monospace; font-size: 1.8rem; }
.result-summary p { color: var(--muted); }
.review-list { display: grid; gap: 12px; margin-top: 18px; }
.review-item { padding: 18px; border-left: 3px solid var(--review-color, var(--border)); }
.review-item summary { cursor: pointer; font-weight: 600; }
.review-item summary > span:first-child { margin-right: 12px; }
.review-item p { color: var(--muted); }
.review-answer { padding-top: 13px; }
.review-correct { --review-color: var(--green); }
.review-wrong { --review-color: var(--red); }
.review-unanswered { --review-color: var(--yellow); }
.review-status { float: right; padding: 4px 8px; border: 1px solid currentColor; border-radius: 999px; font-family: "Fira Code", monospace; font-size: .62rem; font-weight: 600; line-height: 1.2; }
.status-correct { color: var(--green); background: rgba(65,214,163,.08); }
.status-wrong { color: var(--red); background: rgba(251,113,133,.08); }
.status-unanswered { color: var(--yellow); background: rgba(248,197,85,.08); }
.review-filter-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 17px; }
.review-filter { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 8px 10px; cursor: pointer; color: var(--muted); background: rgba(255,255,255,.02); border: 1px solid var(--border); border-radius: 9px; font-size: .75rem; transition: color .2s, background .2s, border-color .2s; }
.review-filter:hover { color: var(--text); background: rgba(255,255,255,.04); border-color: var(--border-bright); }
.review-filter.active { color: #171008; background: var(--orange); border-color: var(--orange-light); font-weight: 600; }
.review-filter strong { display: grid; place-items: center; min-width: 23px; height: 23px; padding: 0 5px; color: var(--text); background: rgba(255,255,255,.08); border-radius: 999px; font-family: "Fira Code", monospace; font-size: .64rem; }
.review-filter.active strong { color: #171008; background: rgba(0,0,0,.12); }

.flash-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.filter-group { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-button { padding: 7px 10px; cursor: pointer; color: var(--muted); background: transparent; border: 1px solid var(--border); border-radius: 999px; font-size: .75rem; }
.filter-button:hover { color: var(--text); border-color: var(--border-bright); }
.filter-button.active { color: #171008; background: var(--orange); border-color: var(--orange); font-weight: 600; }
.flash-stage { display: grid; place-items: center; min-height: 480px; padding: 24px; }
.flashcard { width: min(100%, 690px); min-height: 360px; cursor: pointer; perspective: 1200px; }
.flashcard-inner { position: relative; width: 100%; min-height: 360px; transition: transform .55s cubic-bezier(.2,.7,.2,1); transform-style: preserve-3d; }
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flash-face { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 32px; background: linear-gradient(145deg, #142034, #0b1320); border: 1px solid var(--border-bright); border-radius: 20px; backface-visibility: hidden; box-shadow: var(--shadow); }
.flash-back { transform: rotateY(180deg); background: linear-gradient(145deg, #172337, #0d1725); }
.flash-index { display: flex; align-items: center; justify-content: space-between; color: var(--subtle); font-family: "Fira Code", monospace; font-size: .68rem; }
.flash-content { text-align: center; }
.flash-content h2 { margin-bottom: 10px; font-size: clamp(1.7rem, 5vw, 2.7rem); }
.flash-content p { max-width: 560px; margin: 0 auto; color: var(--muted); font-size: 1.04rem; }
.flash-detail { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 20px; text-align: left; }
.flash-detail div { padding: 12px; background: rgba(0,0,0,.14); border-radius: 9px; }
.flash-detail strong { display: block; margin-bottom: 3px; color: var(--orange-light); font-size: .73rem; }
.flash-detail span { color: #c2ccd8; font-size: .83rem; }
.flip-hint { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--subtle); font-size: .75rem; }
.flash-nav { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 18px; }
.mastered-button.active { color: #07120e; background: var(--green); border-color: #75e8c1; }

.resource-feature { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; padding: 26px; margin-bottom: 18px; background: linear-gradient(120deg, rgba(255,153,0,.1), rgba(66,180,255,.06)); border-color: rgba(255,153,0,.3); }
.resource-feature p { margin-bottom: 0; color: var(--muted); }
.resource-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.resource-card { display: flex; flex-direction: column; padding: 20px; }
.resource-card-head { display: flex; align-items: start; gap: 12px; }
.resource-card-icon { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; color: var(--resource-color, var(--blue)); background: color-mix(in srgb, var(--resource-color, var(--blue)) 10%, transparent); border-radius: 10px; }
.resource-card h3 { margin: 2px 0 6px; }
.resource-card p { flex: 1; color: var(--muted); font-size: .86rem; }
.resource-card a { align-self: flex-start; }
.disclaimer { margin-top: 22px; padding: 17px; color: var(--muted); background: rgba(248,197,85,.05); border: 1px solid rgba(248,197,85,.2); border-radius: 11px; font-size: .83rem; }

.toast { position: fixed; z-index: 300; right: 18px; bottom: 18px; max-width: min(360px, calc(100% - 36px)); padding: 12px 15px; color: var(--text); background: #172337; border: 1px solid var(--border-bright); border-radius: 10px; box-shadow: var(--shadow); opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: none; }
.modal-backdrop { position: fixed; z-index: 400; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(1,5,10,.78); backdrop-filter: blur(8px); }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(100%, 440px); padding: 28px; text-align: center; background: var(--surface); border: 1px solid var(--border-bright); border-radius: 18px; box-shadow: var(--shadow); }
.modal-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 17px; color: var(--yellow); background: rgba(248,197,85,.09); border-radius: 13px; }
.modal p { color: var(--muted); }
.modal-actions { justify-content: center; margin-top: 22px; }
.noscript { position: fixed; inset: auto 12px 12px; z-index: 500; padding: 14px; color: white; background: #9f1239; text-align: center; border-radius: 8px; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid rgba(66,180,255,.72); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

@media (max-width: 1000px) {
  .topbar { grid-template-columns: auto 1fr auto; gap: 10px; }
  .brand { min-width: auto; }
  .brand > span:last-child, .exam-chip { display: none; }
  .primary-nav { justify-content: center; }
  .nav-button { padding: 9px; }
  .nav-button span { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; }
  .hero-visual { min-height: 250px; }
  .two-column, .mode-grid { grid-template-columns: 1fr; }
  .study-layout { grid-template-columns: 240px minmax(0,1fr); }
  .quiz-shell { grid-template-columns: 1fr; }
  .quiz-sidebar { position: static; order: -1; }
  .question-grid { grid-template-columns: repeat(10, 1fr); max-height: 120px; }
}
@media (max-width: 720px) {
  .topbar { top: 6px; width: calc(100% - 12px); margin-top: 6px; padding: 8px; border-radius: 13px; }
  .primary-nav { gap: 2px; }
  .nav-button { padding: 8px; }
  .header-actions .icon-button { display: none; }
  main { width: min(calc(100% - 22px), var(--max)); margin-top: 28px; }
  .page-header, .flash-toolbar { align-items: stretch; flex-direction: column; }
  .hero { padding-top: 20px; }
  h1 { font-size: 2.45rem; }
  .stats-grid, .three-column, .concept-grid, .resource-grid { grid-template-columns: 1fr; }
  .exam-facts { grid-template-columns: repeat(2, 1fr); }
  .study-layout { display: block; }
  .study-sidebar { position: static; max-height: none; margin-bottom: 14px; overflow: hidden; }
  .module-nav { display: flex; overflow-x: auto; padding-bottom: 5px; }
  .module-nav-button { flex: 0 0 210px; }
  .module-body, .module-hero, .question-card { padding: 20px; }
  .domain-row { grid-template-columns: minmax(125px,.8fr) 1fr auto; }
  .question-grid { grid-template-columns: repeat(8, 1fr); }
  .quiz-sidebar { order: initial; }
  .question-footer { align-items: stretch; flex-direction: column; }
  .question-footer > div { display: flex; }
  .question-footer .button { flex: 1; }
  .results-hero { grid-template-columns: 1fr; text-align: center; }
  .result-ring { margin: auto; }
  .flash-stage { min-height: 430px; padding: 10px; }
  .flashcard, .flashcard-inner { min-height: 410px; }
  .flash-face { padding: 22px; }
  .flash-detail { grid-template-columns: 1fr; }
  .resource-feature { grid-template-columns: 1fr; }
  .review-filter-bar { grid-template-columns: repeat(2, 1fr); }
  .review-status { float: none; display: inline-flex; margin-top: 8px; }
}
@media (max-width: 420px) {
  .brand-mark { width: 34px; height: 34px; }
  .nav-button { padding: 7px; }
  .nav-button svg { width: 17px; height: 17px; }
  .stats-grid { gap: 10px; }
  .stat-card { min-height: 120px; }
  .exam-facts { grid-template-columns: 1fr 1fr; }
  .question-grid { grid-template-columns: repeat(6, 1fr); }
  .domain-row { grid-template-columns: 1fr auto; }
  .domain-row .progress-track { grid-column: 1 / -1; grid-row: 2; }
}
