:root {
  --navy-950: #071928;
  --navy-900: #0b253b;
  --navy-800: #123b57;
  --teal-700: #06706f;
  --teal-600: #078a86;
  --teal-100: #dff6f3;
  --blue-700: #135e8a;
  --paper: #fff;
  --canvas: #f3f7f8;
  --ink: #172a38;
  --muted: #587080;
  --line: #d5e1e6;
  --green: #087553;
  --green-bg: #e8f7ef;
  --amber: #8a5900;
  --amber-bg: #fff5d8;
  --red: #ae342e;
  --red-bg: #fff0ed;
  --purple: #5e4a98;
  --purple-bg: #f0edfb;
  --shadow: 0 16px 42px rgba(7, 25, 40, .09);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.64;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue-700); }
:focus-visible { outline: 3px solid #f0b400; outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: -70px;
  left: 16px;
  padding: 10px 14px;
  border-radius: 9px;
  background: #fff;
  color: #111;
  font-weight: 850;
}
.skip-link:focus { top: 12px; }

.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 84% 25%, rgba(17, 186, 175, .34), transparent 28rem),
    radial-gradient(circle at 9% 100%, rgba(22, 106, 153, .32), transparent 26rem),
    linear-gradient(125deg, var(--navy-950), var(--navy-800) 65%, #075d66);
}
.hero::after {
  content: "";
  position: absolute;
  right: -140px;
  bottom: -200px;
  width: 470px;
  height: 470px;
  border: 76px solid rgba(255, 255, 255, .05);
  border-radius: 50%;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 38px 24px 58px;
}
.home-link {
  display: inline-block;
  margin-bottom: 40px;
  color: #d6edf2;
  font-weight: 750;
  text-decoration: none;
}
.home-link:hover { text-decoration: underline; }
.eyebrow, .kicker {
  margin: 0 0 8px;
  color: #78dfd6;
  font-size: .77rem;
  font-weight: 950;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hero h1 {
  max-width: 960px;
  margin: 0;
  font-size: clamp(2.65rem, 7vw, 5.65rem);
  line-height: .98;
  letter-spacing: -.055em;
}
.hero-lead {
  max-width: 830px;
  margin: 22px 0 0;
  color: #dcecf1;
  font-size: clamp(1.08rem, 2vw, 1.34rem);
}
.hero-meta, .hero-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.hero-meta { margin-top: 25px; }
.hero-actions { margin-top: 29px; }
.hero-meta span {
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #eff9fa;
  font-size: .84rem;
  font-weight: 750;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--blue-700);
  color: #fff;
  font-weight: 850;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}
.button:hover { filter: brightness(.96); transform: translateY(-1px); box-shadow: 0 7px 18px rgba(19,94,138,.2); }
.button:disabled { opacity: .48; cursor: not-allowed; transform: none; box-shadow: none; }
.button-light { background: #fff; color: var(--navy-900); }
.button-ghost { border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.08); }
.button-secondary { border-color: var(--line); background: #edf4f6; color: var(--navy-900); }
.button-danger { background: var(--red); }

.progress-shell {
  border-bottom: 1px solid rgba(11,37,59,.1);
  background: #fff;
}
.progress-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 9px 22px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 800;
}
.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: #e5edef; }
.progress-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal-600), #23aca4); transition: width .25s ease; }

.module-nav {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(11,37,59,.12);
  background: rgba(255,255,255,.96);
  box-shadow: 0 6px 24px rgba(11,37,59,.06);
  backdrop-filter: blur(12px);
}
.nav-inner {
  display: flex;
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 20px;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.tab {
  flex: 0 0 auto;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #405d6e;
  font-weight: 850;
  cursor: pointer;
}
.tab:hover { background: #eff5f6; color: var(--navy-900); }
.tab.is-active { background: var(--navy-900); color: #fff; }
.tab .done { color: #69ded3; }

.shell { max-width: 1180px; margin: 0 auto; padding: 42px 22px 72px; }
.panel { animation: appear .24s ease; }
@keyframes appear { from { opacity: .25; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.section-heading { max-width: 880px; margin: 0 0 28px; }
.section-heading .kicker, .card .kicker { color: var(--teal-700); }
.section-heading h2 {
  margin: 0;
  color: var(--navy-900);
  font-size: clamp(2rem, 5vw, 3.65rem);
  line-height: 1.03;
  letter-spacing: -.037em;
}
.section-heading > p:last-child { margin: 14px 0 0; color: var(--muted); font-size: 1.07rem; }

.card {
  margin-bottom: 20px;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid rgba(198,214,223,.85);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 12px; color: var(--navy-900); font-size: 1.35rem; line-height: 1.22; }
.card h4 { margin: 1.1rem 0 .4rem; color: var(--navy-900); }
.card p:first-child { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.opening-case { display: grid; grid-template-columns: 1.08fr .92fr; gap: 28px; border-top: 5px solid var(--teal-600); }
.decision-prompt { align-self: center; padding: 18px; border-radius: 14px; background: #f1f8f8; }
.feedback-box { margin-top: 14px; padding: 15px; border-left: 5px solid var(--green); border-radius: 10px; background: var(--green-bg); }
.cite { margin-left: 3px; font-size: .72em; font-weight: 950; vertical-align: super; text-decoration: none; }

.objective-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.objective-grid > div { padding: 14px; border-radius: 12px; background: #f1f7f8; }
.objective-grid span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: var(--teal-600); color: #fff; font-weight: 950; }
.objective-grid p { margin: 9px 0 0; color: #385667; font-size: .9rem; }

.evidence-grid, .lesson-grid, .condition-grid, .two-column, .trap-grid, .action-grid, .case-picker, .report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 18px;
}
.evidence-item, .mini-card, .trap-grid > div, .action-grid > div, .report-grid > div {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f9fbfc;
}
.evidence-item p, .mini-card p, .trap-grid p, .action-grid p, .report-grid p { margin: 5px 0 0; color: var(--muted); font-size: .92rem; }
.evidence-badge, .risk-badge, .domain-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 900;
  letter-spacing: .03em;
}
.evidence-badge.trial { background: var(--green-bg); color: var(--green); }
.evidence-badge.consensus { background: var(--amber-bg); color: var(--amber); }
.evidence-badge.extrapolated { background: var(--purple-bg); color: var(--purple); }

.lesson-grid { align-items: stretch; }
.lesson-card { position: relative; margin: 0; overflow: hidden; }
.lesson-number { position: absolute; right: 18px; top: 7px; color: #e9f0f2; font-size: 4.8rem; font-weight: 950; line-height: 1; letter-spacing: -.08em; pointer-events: none; }
.lesson-card h3 { position: relative; padding-right: 58px; }
.check-list { padding-left: 1.35rem; }
.check-list li { margin: .5rem 0; }
.check-list li::marker { color: var(--teal-600); }
.pearl, .formula, .resident-action { margin-top: 17px; padding: 14px 16px; border-radius: 12px; background: #eff7f8; color: #2b4a5b; }
.resident-action { border-left: 5px solid var(--teal-600); }
.danger-card { border-top: 5px solid var(--red); }
.alert { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--amber-bg); color: #644500; }
.alert.danger { background: var(--red-bg); color: #7c2623; }
.alert.update { background: var(--purple-bg); color: #49387d; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 650px; border-collapse: collapse; }
th, td { padding: 12px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #e9f3f4; color: var(--navy-900); font-size: .88rem; }
tbody tr:last-child td { border-bottom: 0; }
.note { color: var(--muted); font-size: .9rem; }
.nowrap { white-space: nowrap; }

details { margin-top: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; }
summary { padding: 13px 15px; color: var(--navy-900); font-weight: 850; cursor: pointer; }
details > :not(summary) { margin-right: 15px; margin-left: 15px; }
details > :last-child { margin-bottom: 15px; }

.flow-list { display: grid; gap: 11px; padding: 0; list-style: none; }
.flow-list li { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; }
.flow-list li > span { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: var(--teal-600); color: #fff; font-weight: 950; }
.flow-list strong { color: var(--navy-900); }
.flow-list p { margin: 2px 0 0; color: var(--muted); }

.pathway-selector, .condition-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.path-button, .filter-button, .case-button {
  min-height: 43px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--navy-900);
  font-weight: 850;
  cursor: pointer;
}
.path-button:hover, .filter-button:hover, .case-button:hover { background: #eff6f7; }
.path-button.is-active, .filter-button.is-active, .case-button.is-active { border-color: var(--navy-900); background: var(--navy-900); color: #fff; }
.pathway-stage { border-top: 5px solid var(--teal-600); }
.path-timeline { display: grid; grid-template-columns: repeat(4,1fr); gap: 9px; margin-top: 18px; }
.path-step { padding: 13px; border-radius: 11px; background: #f1f7f8; }
.path-step p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }

.condition-card { margin: 0; padding: 0; overflow: hidden; }
.condition-card summary { padding: 20px 22px; background: #fff; }
.condition-card[open] summary { border-bottom: 1px solid var(--line); background: #f7fbfb; }
.condition-body { padding: 0 7px 7px; }
.condition-card .gene { display: inline-block; margin-left: 7px; color: var(--teal-700); font-size: .82rem; }
.condition-grid .condition-card { min-width: 0; }
.condition-grid .condition-card.full { grid-column: 1 / -1; }
.condition-card[hidden] { display: none !important; }

.case-picker { grid-template-columns: repeat(5, 1fr); margin-bottom: 18px; }
.case-button { min-height: 74px; text-align: left; }
.case-button small { display: block; margin-top: 3px; color: inherit; opacity: .72; font-weight: 650; }
.case-stage { min-height: 340px; }
.case-header { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.case-vitals { display: flex; flex-wrap: wrap; gap: 7px; padding: 0; list-style: none; }
.case-vitals li { padding: 5px 9px; border-radius: 999px; background: #edf4f6; color: #3c596a; font-size: .8rem; font-weight: 800; }
.case-feedback { margin-top: 14px; padding: 14px 16px; border-radius: 11px; }
.case-feedback.correct { border-left: 5px solid var(--green); background: var(--green-bg); color: #205d47; }
.case-feedback.incorrect { border-left: 5px solid var(--red); background: var(--red-bg); color: #792722; }
.case-log { display: flex; gap: 6px; min-height: 20px; margin-top: 12px; }
.case-log span { width: 12px; height: 12px; border-radius: 50%; background: #d6e0e4; }
.case-log .correct { background: var(--green); }
.case-log .incorrect { background: var(--red); }

.quiz-shell { max-width: 850px; }
.quiz-topline { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: .9rem; font-weight: 850; }
.quiz-progress { height: 8px; margin: 11px 0 22px; overflow: hidden; border-radius: 999px; background: #e2eaed; }
.quiz-progress > div { height: 100%; width: 0; border-radius: inherit; background: var(--teal-600); transition: width .2s ease; }
.choice-list { display: grid; gap: 10px; margin-top: 17px; }
.choice-button {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.choice-button:hover:not(:disabled) { border-color: #89babb; background: #f5fbfa; }
.choice-button:disabled { cursor: default; opacity: .78; }
.choice-button.correct { border-color: var(--green); background: var(--green-bg); color: #175840; }
.choice-button.incorrect { border-color: var(--red); background: var(--red-bg); color: #7b2924; }
.quiz-explanation { margin-top: 16px; padding: 15px 17px; border-radius: 12px; background: #eff6f8; }
.quiz-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.score-ring {
  display: grid;
  width: 130px;
  height: 130px;
  place-items: center;
  margin: 0 auto 20px;
  border: 12px solid var(--teal-600);
  border-radius: 50%;
  color: var(--navy-900);
  font-size: 1.8rem;
  font-weight: 950;
}
.score-ring.fail { border-color: var(--red); }
.result-title { text-align: center; }
.domain-results { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-top: 18px; }
.domain-results > div { padding: 13px; border-radius: 11px; background: #f2f7f8; text-align: center; }
.domain-results strong { display: block; color: var(--navy-900); }

.pretest-intro { display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.pretest-result { margin-top: 16px; padding: 16px; border-radius: 12px; background: #f0f6f8; }

.quick-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; }
.emergency-strip { padding: 19px; border-radius: 15px; background: var(--red); color: #fff; }
.emergency-strip h3 { color: #fff; }
.source-list { padding-left: 1.25rem; }
.source-list li { margin: .8rem 0; }
.source-list a { word-break: break-word; }
.bottom-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.print-only { display: none; }
footer { max-width: 1180px; margin: 0 auto; padding: 0 22px 52px; color: var(--muted); font-size: .86rem; }

@media (max-width: 900px) {
  .objective-grid { grid-template-columns: repeat(2,1fr); }
  .path-timeline, .domain-results { grid-template-columns: repeat(2,1fr); }
  .case-picker { grid-template-columns: repeat(2,1fr); }
  .quick-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .hero-inner { padding-top: 25px; }
  .home-link { margin-bottom: 30px; }
  .hero h1 { font-size: clamp(2.5rem, 15vw, 4rem); }
  .opening-case, .lesson-grid, .condition-grid, .evidence-grid, .two-column, .trap-grid, .action-grid, .report-grid { grid-template-columns: 1fr; }
  .condition-grid .condition-card.full { grid-column: auto; }
  .objective-grid, .path-timeline, .domain-results { grid-template-columns: 1fr; }
  .progress-inner { grid-template-columns: auto 1fr; }
  .progress-inner #progress-percent { grid-column: 1 / -1; }
  .case-header { display: block; }
  .pretest-intro { display: block; }
  .shell { padding-right: 15px; padding-left: 15px; }
  .card { border-radius: 16px; }
}

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

@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .hero, .module-nav, .progress-shell, .no-print, footer { display: none !important; }
  .shell { max-width: none; padding: 0; }
  .panel { display: none !important; }
  #panel-quick { display: block !important; }
  .print-only { display: block; }
  .card { break-inside: avoid; box-shadow: none; border: 1px solid #aaa; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  a { color: #000; text-decoration: none; }
  .source-list a::after { content: " (" attr(href) ")"; font-size: 8pt; }
}
