:root {
  color-scheme: light;
  --ink: #07111f;
  --ink-2: #122238;
  --paper: #f4f7f2;
  --paper-2: #e9eee8;
  --white: #ffffff;
  --muted: #647183;
  --line: #d8dfda;
  --lime: #c8ff4d;
  --lime-deep: #7fae14;
  --blue: #2e6bff;
  --cyan: #5ee6ff;
  --orange: #ff8e42;
  --red: #df4e5d;
  --shadow: 0 18px 54px rgba(7, 17, 31, .12);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-underline-offset: 3px; }
button { color: inherit; }
svg { display: block; }

.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;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 999;
  transform: translateY(-160%);
  background: var(--lime);
  color: var(--ink);
  padding: 9px 14px;
  border-radius: 8px;
  font-weight: 800;
}
.skip-link:focus { transform: translateY(0); }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 318px;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(rgba(94,230,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94,230,255,.035) 1px, transparent 1px),
    var(--ink);
  background-size: 28px 28px;
  color: #dce6ef;
  border-right: 1px solid rgba(255,255,255,.08);
}
.brand {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand strong {
  display: block;
  color: #fff;
  font-size: 1rem;
  letter-spacing: .03em;
}
.brand small {
  display: block;
  margin-top: 1px;
  color: #8fa2b7;
  font-size: .68rem;
  letter-spacing: .14em;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  grid-template-columns: 1fr 3px 1fr;
  place-items: center;
  background: var(--lime);
  color: var(--ink);
  border-radius: 11px;
  font-weight: 950;
  line-height: 1;
}
.brand-mark i { width: 2px; height: 22px; background: var(--ink); transform: rotate(18deg); }

.progress-card {
  margin: 18px 16px 12px;
  padding: 15px;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 13px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 15px;
  background: rgba(255,255,255,.055);
}
.progress-ring {
  width: 58px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--lime) calc(var(--progress) * 1%), rgba(255,255,255,.10) 0);
  position: relative;
}
.progress-ring::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  background: #0b1727;
}
.progress-ring span { position: relative; font-size: .74rem; font-weight: 900; color: white; }
.progress-card p { margin: 0; color: #94a6b8; font-size: .75rem; }
.progress-card strong { display: block; color: white; font-size: .92rem; }
.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cyan);
  font-size: .76rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-button:hover { color: white; }

.search-box {
  margin: 0 16px 11px;
  height: 42px;
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 0 11px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.14);
  border-radius: 11px;
}
.search-box:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(94,230,255,.10); }
.search-box svg { width: 17px; fill: none; stroke: #8799ac; stroke-width: 2; }
.search-box input { min-width: 0; border: 0; outline: 0; background: transparent; color: white; font-size: .84rem; }
.search-box input::placeholder { color: #718398; }
.search-box kbd {
  padding: 1px 6px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 5px;
  color: #8194a7;
  font: 700 .68rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.module-nav {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 2px 10px 20px;
  scrollbar-width: thin;
  scrollbar-color: #33445a transparent;
}
.module-group { margin-bottom: 4px; }
.module-button {
  width: 100%;
  min-height: 50px;
  display: grid;
  grid-template-columns: 32px 1fr 18px;
  gap: 9px;
  align-items: center;
  padding: 8px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #c9d4df;
  text-align: left;
  cursor: pointer;
}
.module-button:hover { background: rgba(255,255,255,.05); }
.module-button.active { background: rgba(200,255,77,.10); color: white; }
.module-num {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 9px;
  font: 800 .66rem/1 ui-monospace, monospace;
  color: #8ea2b5;
}
.module-button.active .module-num { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.module-name { display: block; font-size: .79rem; line-height: 1.25; font-weight: 720; }
.module-meta { display: block; color: #76899d; font-size: .67rem; margin-top: 2px; }
.chevron { transition: transform .2s; color: #6f8295; }
.module-group.open .chevron { transform: rotate(90deg); }
.lesson-list { display: none; padding: 2px 5px 8px 40px; }
.module-group.open .lesson-list { display: grid; }
.lesson-nav-item {
  position: relative;
  padding: 7px 8px 7px 15px;
  border: 0;
  border-left: 1px solid #27384c;
  background: transparent;
  color: #8194a7;
  text-align: left;
  line-height: 1.35;
  font-size: .75rem;
  cursor: pointer;
}
.lesson-nav-item::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 14px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #27384c;
}
.lesson-nav-item:hover, .lesson-nav-item.active { color: white; }
.lesson-nav-item.active { border-left-color: var(--lime); }
.lesson-nav-item.active::before { background: var(--lime); box-shadow: 0 0 0 3px rgba(200,255,77,.14); }
.lesson-nav-item.complete::after { content: "✓"; float: right; color: var(--lime); font-weight: 900; }
.search-empty { padding: 18px; color: #8597aa; font-size: .8rem; }
.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: #6f8295;
  font-size: .66rem;
}

.page { margin-left: 318px; min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(7,17,31,.10);
  background: rgba(244,247,242,.92);
  backdrop-filter: blur(16px);
}
.view-tabs { display: flex; gap: 5px; }
.view-tab {
  height: 39px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #657185;
  font-weight: 760;
  font-size: .82rem;
  cursor: pointer;
}
.view-tab span {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 99px;
  background: #dde4df;
  font-size: .65rem;
}
.view-tab:hover { background: rgba(7,17,31,.05); color: var(--ink); }
.view-tab.active { background: var(--ink); color: white; box-shadow: 0 6px 18px rgba(7,17,31,.14); }
.view-tab.active span { background: var(--lime); color: var(--ink); }
.button {
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 820;
  font-size: .82rem;
  cursor: pointer;
  text-decoration: none;
}
.button-primary { background: var(--ink); color: white; }
.button-primary:hover { background: #172941; }
.button-accent { background: var(--lime); color: var(--ink); }
.button-accent:hover { background: #d7ff79; }
.button-ghost { border-color: #cdd5d0; background: rgba(255,255,255,.5); }
.button-ghost:hover { background: white; }
.button-small { min-height: 36px; padding: 0 12px; font-size: .76rem; }
.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #d1d8d3;
  border-radius: 10px;
  background: white;
  cursor: pointer;
}
.menu-button { display: none; gap: 4px; align-content: center; }
.menu-button span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; }

main { min-height: calc(100vh - 76px); }
.view { display: none; }
.view.active { display: block; }
.lesson-layout {
  width: min(1180px, calc(100% - 56px));
  margin: 0 auto;
  padding: 42px 0 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 34px;
  align-items: start;
}
.lesson { min-width: 0; }
.lesson-header {
  padding: 0 0 30px;
  border-bottom: 1px solid var(--line);
}
.lesson-kicker { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 9px;
  border: 1px solid #ccd5cf;
  border-radius: 99px;
  color: #516073;
  background: rgba(255,255,255,.55);
  font-size: .69rem;
  font-weight: 850;
  letter-spacing: .04em;
}
.tag-accent { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.lesson-header h1 {
  max-width: 820px;
  margin: 15px 0 13px;
  font-size: clamp(2.05rem, 4.2vw, 3.75rem);
  line-height: 1.04;
  letter-spacing: -.045em;
}
.lesson-lead { max-width: 780px; margin: 0; color: #536174; font-size: 1.06rem; line-height: 1.75; }
.outcome-strip {
  margin-top: 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 17px 19px;
  border-radius: 13px;
  border: 1px solid #b9c7ff;
  background: #edf2ff;
}
.outcome-strip strong { color: var(--blue); font-size: .74rem; letter-spacing: .06em; }
.outcome-strip ul { margin: 0; padding-left: 18px; color: #31415a; font-size: .88rem; }
.lesson-block { padding: 34px 0 4px; }
.lesson-block + .lesson-block { border-top: 1px solid var(--line); margin-top: 28px; }
.lesson-block h2 {
  margin: 0 0 13px;
  font-size: clamp(1.3rem, 2.5vw, 1.72rem);
  letter-spacing: -.025em;
  line-height: 1.2;
}
.lesson-block h3 { margin: 25px 0 8px; font-size: 1.05rem; }
.lesson-block p { margin: 0 0 14px; color: #354356; }
.lesson-block ul, .lesson-block ol { color: #354356; padding-left: 22px; }
.lesson-block li { margin-bottom: 8px; }
.lesson-block strong { color: var(--ink); }
.eyebrow {
  margin: 0 0 6px;
  color: #617084;
  font-size: .68rem;
  line-height: 1.3;
  font-weight: 900;
  letter-spacing: .13em;
}
.key-idea, .callout {
  margin: 19px 0;
  padding: 19px 21px;
  border-radius: 14px;
  border: 1px solid #d4dcd7;
  background: white;
  box-shadow: 0 8px 30px rgba(7,17,31,.05);
}
.key-idea { border-left: 5px solid var(--lime-deep); }
.key-idea .eyebrow { color: var(--lime-deep); }
.key-idea p:last-child, .callout p:last-child { margin-bottom: 0; }
.callout.warning { background: #fff5ec; border-color: #f3c59e; }
.callout.warning .eyebrow { color: #b85a18; }
.callout.evidence { background: #edf4ff; border-color: #b7ccff; }
.callout.evidence .eyebrow { color: var(--blue); }
.callout.myth { background: #fff0f2; border-color: #efbdc4; }
.callout.myth .eyebrow { color: var(--red); }
.source-link { display: inline-flex; gap: 5px; align-items: center; font-size: .76rem; font-weight: 800; }

.process-list { display: grid; gap: 10px; margin: 18px 0; counter-reset: process; }
.process-step {
  counter-increment: process;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.58);
}
.process-step::before {
  content: counter(process, decimal-leading-zero);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--ink);
  color: var(--lime);
  font: 850 .72rem/1 ui-monospace, monospace;
}
.process-step strong { display: block; margin-bottom: 3px; }
.process-step p { margin: 0; font-size: .88rem; }

.data-table-wrap { margin: 19px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; background: white; }
.data-table { width: 100%; border-collapse: collapse; min-width: 620px; font-size: .84rem; }
.data-table th { padding: 12px 14px; background: var(--ink); color: white; text-align: left; font-size: .72rem; letter-spacing: .05em; }
.data-table td { padding: 13px 14px; border-top: 1px solid #e4e9e5; vertical-align: top; color: #3b495c; }
.data-table tbody tr:hover { background: #f6f8f5; }
.compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; margin: 18px 0; }
.compare-card { padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.compare-card.good { border-top: 4px solid var(--lime-deep); }
.compare-card.bad { border-top: 4px solid var(--red); }
.compare-card h3 { margin: 0 0 9px; }
.compare-card p { font-size: .86rem; }

.code-block {
  position: relative;
  margin: 18px 0;
  padding: 48px 19px 19px;
  overflow-x: auto;
  border-radius: 14px;
  background: #081522;
  color: #cfe5ee;
  border: 1px solid #1b344a;
  font: .8rem/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}
.copy-code {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid #35516a;
  border-radius: 7px;
  background: #10243a;
  color: #cfe5ee;
  font: 750 .68rem/1 sans-serif;
  cursor: pointer;
}
.copy-code:hover { background: #17324e; }
.checklist { display: grid; gap: 8px; margin: 18px 0; }
.check-item { display: flex; gap: 11px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.62); }
.check-item::before { content: "✓"; flex: 0 0 24px; width: 24px; height: 24px; display: grid; place-items: center; background: #e6f6bd; color: #4d7000; border-radius: 7px; font-weight: 950; }
.check-item span { color: #354356; font-size: .87rem; }
.practice-card {
  margin: 32px 0 5px;
  padding: 23px;
  border: 1px solid #1d3550;
  border-radius: 16px;
  color: white;
  background:
    radial-gradient(circle at 95% 5%, rgba(94,230,255,.16), transparent 34%),
    var(--ink);
}
.practice-card .eyebrow { color: var(--cyan); }
.practice-card h3 { margin: 5px 0 9px; color: white; font-size: 1.18rem; }
.practice-card p, .practice-card li { color: #c4d0dc; }
.practice-card .button { margin-top: 10px; }

.quiz-card {
  margin: 36px 0 0;
  padding: 24px;
  border: 1px solid #c9d1cc;
  border-radius: 16px;
  background: white;
  box-shadow: 0 12px 34px rgba(7,17,31,.06);
}
.quiz-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.quiz-head h3 { margin: 3px 0 15px; }
.quiz-status { padding: 4px 9px; border-radius: 99px; background: #eef1ee; color: #687587; font-size: .7rem; font-weight: 850; }
.quiz-options { display: grid; gap: 9px; }
.quiz-option {
  width: 100%;
  display: grid;
  grid-template-columns: 29px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 13px;
  border: 1px solid #d8ded9;
  border-radius: 10px;
  background: #fbfcfb;
  text-align: left;
  cursor: pointer;
}
.quiz-option:hover { border-color: #8ea4c8; background: #f4f7ff; }
.quiz-option .letter { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; background: #e9eeeb; font-size: .73rem; font-weight: 900; }
.quiz-option.selected { border-color: var(--blue); background: #eef3ff; }
.quiz-option.correct { border-color: #75a61b; background: #f2fadf; }
.quiz-option.wrong { border-color: var(--red); background: #fff0f2; }
.quiz-feedback { display: none; margin-top: 13px; padding: 12px 14px; border-radius: 10px; font-size: .86rem; }
.quiz-feedback.show { display: block; }
.quiz-feedback.correct { background: #eff8da; color: #405d00; }
.quiz-feedback.wrong { background: #fff0f2; color: #8f2633; }

.lesson-footer {
  margin-top: 42px;
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
}
.lesson-footer-actions { display: flex; gap: 9px; }
.complete-button.done { background: #e6f6bd; border-color: #b8d66e; color: #3c5900; }

.lesson-rail { position: sticky; top: 104px; display: grid; gap: 14px; }
.rail-card { padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.72); }
.rail-card-head { display: flex; justify-content: space-between; gap: 8px; }
.rail-card-head span { color: #8a96a3; font-size: .64rem; }
.map-list { display: grid; gap: 8px; margin-top: 12px; }
.map-item { display: grid; grid-template-columns: 22px 1fr; gap: 8px; color: #617084; font-size: .76rem; line-height: 1.4; }
.map-item span:first-child { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #d4dbd6; border-radius: 6px; color: #768397; font: 800 .62rem/1 ui-monospace, monospace; }
.notes-card textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  margin-top: 9px;
  padding: 11px;
  border: 1px solid #d4dbd6;
  border-radius: 10px;
  outline: 0;
  background: #fbfcfa;
  color: var(--ink);
  font-size: .8rem;
  line-height: 1.6;
}
.notes-card textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,107,255,.09); }

.workspace-header {
  width: min(1180px, calc(100% - 56px));
  margin: 0 auto;
  padding: 45px 0 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.workspace-header h1 { margin: 0 0 9px; font-size: clamp(2rem,4vw,3.5rem); line-height: 1.04; letter-spacing: -.045em; }
.workspace-header > div:first-child > p:last-child { max-width: 730px; margin: 0; color: #5b687a; }
.workspace-stat, .audit-score {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 13px 17px;
  border: 1px solid #ccd4cf;
  border-radius: 13px;
  background: white;
}
.workspace-stat strong, .audit-score strong { font-size: 2.1rem; letter-spacing: -.05em; line-height: 1; }
.workspace-stat span, .audit-score span { color: #6a7687; font-size: .76rem; }
.lab-grid {
  width: min(1180px, calc(100% - 56px));
  margin: 0 auto;
  padding: 28px 0 80px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 17px;
}
.lab-card {
  min-height: 224px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 10px 32px rgba(7,17,31,.05);
}
.lab-card:first-child { grid-column: span 2; background: var(--ink); color: white; border-color: var(--ink); }
.lab-card:first-child p { color: #bdcad7; }
.lab-card-head { display: flex; justify-content: space-between; gap: 14px; }
.lab-index { font: 900 .72rem/1 ui-monospace, monospace; color: var(--blue); }
.lab-card:first-child .lab-index { color: var(--lime); }
.lab-card h2 { margin: 14px 0 7px; font-size: 1.35rem; letter-spacing: -.025em; }
.lab-card p { margin: 0 0 20px; color: #586678; font-size: .87rem; }
.lab-card .button { margin-top: auto; align-self: flex-start; }
.lab-card:first-child .button { background: var(--lime); color: var(--ink); }

.lab-panel {
  width: min(1180px, calc(100% - 56px));
  margin: 0 auto;
  padding: 28px 0 80px;
}
.back-button { margin-bottom: 18px; }
.tool-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.tool-input, .tool-output { padding: 23px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.tool-input h2, .tool-output h2 { margin: 0 0 7px; font-size: 1.3rem; }
.tool-intro { margin: 0 0 20px; color: #657184; font-size: .86rem; }
.form-grid { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.field label, .field-label { font-size: .75rem; color: #4f5e71; font-weight: 800; }
.field input, .field textarea, .field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cfd7d1;
  border-radius: 10px;
  outline: none;
  background: #fbfcfb;
  color: var(--ink);
}
.field textarea { min-height: 108px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,107,255,.09); }
.toggle-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e2e7e3; }
.toggle-copy strong { display: block; font-size: .84rem; }
.toggle-copy span { display: block; color: #6c7888; font-size: .72rem; }
.switch { position: relative; flex: 0 0 auto; width: 43px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #cbd3cd; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: white; transition: .2s; box-shadow: 0 2px 5px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::before { transform: translateX(19px); }
.output-empty { min-height: 280px; display: grid; place-items: center; text-align: center; color: #7a8795; border: 1px dashed #ccd5cf; border-radius: 12px; }
.output-empty strong { display: block; color: #465568; margin-bottom: 4px; }
.prompt-cluster { margin-bottom: 17px; }
.prompt-cluster h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: .93rem; }
.prompt-cluster h3 span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: #e8edff; color: var(--blue); font-size: .65rem; }
.prompt-list { margin: 0; padding-left: 19px; color: #435164; font-size: .82rem; }
.score-gauge { display: grid; grid-template-columns: 90px 1fr; gap: 17px; align-items: center; margin: 15px 0 20px; }
.gauge-number { width: 86px; height: 86px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--lime); font-size: 1.65rem; font-weight: 950; }
.score-bars { display: grid; gap: 8px; }
.score-row { display: grid; grid-template-columns: 115px 1fr 26px; align-items: center; gap: 8px; font-size: .72rem; }
.score-track { height: 7px; background: #e3e8e4; border-radius: 99px; overflow: hidden; }
.score-fill { height: 100%; border-radius: inherit; background: var(--blue); }
.result-list { padding-left: 20px; color: #48566a; font-size: .84rem; }
.result-list li { margin-bottom: 7px; }

.audit-layout {
  width: min(1180px, calc(100% - 56px));
  margin: 0 auto;
  padding: 28px 0 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 22px;
  align-items: start;
}
.audit-category { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 15px; background: white; overflow: hidden; }
.audit-category-head { padding: 17px 19px; display: flex; justify-content: space-between; gap: 15px; background: #f8faf7; border-bottom: 1px solid var(--line); }
.audit-category-head h2 { margin: 0; font-size: 1.04rem; }
.audit-category-head p { margin: 3px 0 0; color: #6c7888; font-size: .75rem; }
.category-score { color: var(--blue); font-weight: 900; white-space: nowrap; }
.audit-item { padding: 15px 19px; display: grid; grid-template-columns: 1fr auto; gap: 17px; align-items: center; border-bottom: 1px solid #e6ebe7; }
.audit-item:last-child { border-bottom: 0; }
.audit-item strong { display: block; font-size: .84rem; }
.audit-item span { display: block; margin-top: 3px; color: #728091; font-size: .72rem; }
.score-choice { display: flex; gap: 5px; }
.score-choice label { cursor: pointer; }
.score-choice input { position: absolute; opacity: 0; }
.score-choice i { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #d0d8d2; border-radius: 8px; background: #fbfcfb; font: normal 850 .72rem/1 ui-monospace, monospace; }
.score-choice input:checked + i { background: var(--ink); color: var(--lime); border-color: var(--ink); }
.audit-summary { position: sticky; top: 104px; padding: 20px; border-radius: 16px; background: var(--ink); color: white; }
.audit-summary .eyebrow { color: var(--cyan); }
.audit-summary h2 { margin: 5px 0 8px; font-size: 1.3rem; }
.audit-summary p { color: #b9c6d2; font-size: .82rem; }
.maturity-track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 17px 0; }
.maturity-track span { height: 8px; background: #26384c; border-radius: 99px; }
.maturity-track span.on { background: var(--lime); }
.priority-list { display: grid; gap: 8px; margin: 17px 0; }
.priority-item { padding: 10px 11px; border: 1px solid rgba(255,255,255,.11); border-radius: 9px; background: rgba(255,255,255,.05); color: #d5dee7; font-size: .76rem; }
.audit-summary .button { width: 100%; margin-top: 7px; }

#resources-content {
  width: min(1180px, calc(100% - 56px));
  margin: 0 auto;
  padding: 28px 0 80px;
}
.resource-section { margin-bottom: 34px; }
.resource-section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.resource-section h2 { margin: 0; font-size: 1.35rem; }
.glossary-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.glossary-card { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.glossary-card dt { font-weight: 900; font-size: .82rem; }
.glossary-card dd { margin: 5px 0 0; color: #5c697a; font-size: .76rem; line-height: 1.55; }
.template-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.template-card { padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.template-card h3 { margin: 0 0 7px; font-size: .98rem; }
.template-card p { color: #617083; font-size: .8rem; }
.template-card pre { max-height: 210px; overflow: auto; padding: 12px; border-radius: 9px; background: #edf1ee; white-space: pre-wrap; font: .72rem/1.6 ui-monospace, monospace; }
.sources-list { display: grid; gap: 9px; }
.source-card { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: white; text-decoration: none; }
.source-card:hover { border-color: #aebbd0; box-shadow: 0 7px 20px rgba(7,17,31,.05); }
.source-code { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 9px; background: var(--ink); color: var(--lime); font: 900 .66rem/1 ui-monospace, monospace; }
.source-card strong { display: block; color: var(--ink); font-size: .83rem; }
.source-card span { display: block; color: #748191; font-size: .71rem; }
.source-card b { color: var(--blue); font-size: .75rem; }

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; gap: 8px; }
.toast { max-width: 340px; padding: 12px 14px; border-radius: 10px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: .8rem; animation: toast-in .25s ease-out; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

dialog { width: min(720px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 18px; background: white; box-shadow: 0 30px 90px rgba(0,0,0,.28); }
dialog::backdrop { background: rgba(2,8,16,.72); backdrop-filter: blur(5px); }
.dialog-panel { padding: 24px; }
.dialog-head { display: flex; justify-content: space-between; gap: 18px; align-items: start; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; line-height: 1.2; }
#source-dialog-content { padding-top: 17px; color: #49576a; font-size: .86rem; }
#source-dialog-content li { margin-bottom: 8px; }

@media (max-width: 1120px) {
  .sidebar { width: 288px; }
  .page { margin-left: 288px; }
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-rail { position: static; grid-template-columns: 1fr 1fr; }
  .audit-layout { grid-template-columns: 1fr; }
  .audit-summary { position: static; }
  .glossary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 860px) {
  .sidebar { transform: translateX(-102%); width: min(330px, 88vw); transition: transform .25s ease; box-shadow: 18px 0 60px rgba(0,0,0,.28); }
  .sidebar.open { transform: translateX(0); }
  .page { margin-left: 0; }
  .topbar { height: auto; min-height: 68px; padding: 10px 16px; }
  .menu-button { display: grid; flex: 0 0 auto; }
  .view-tabs { min-width: 0; overflow-x: auto; }
  .view-tab { white-space: nowrap; }
  .top-actions { display: none; }
  .lesson-layout, .workspace-header, .lab-grid, .lab-panel, .audit-layout, #resources-content { width: min(100% - 32px, 740px); }
  .lesson-layout { padding-top: 28px; }
  .lesson-header h1 { font-size: clamp(2rem, 9vw, 3.3rem); }
  .tool-shell { grid-template-columns: 1fr; }
  .workspace-header { align-items: flex-start; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .topbar { align-items: flex-start; }
  .view-tabs { padding-bottom: 2px; }
  .view-tab { height: 40px; padding: 0 10px; font-size: .76rem; }
  .view-tab span { display: none; }
  .lesson-layout, .workspace-header, .lab-grid, .lab-panel, .audit-layout, #resources-content { width: calc(100% - 24px); }
  .lesson-layout { padding-bottom: 50px; }
  .lesson-header h1 { margin-top: 13px; }
  .outcome-strip { grid-template-columns: 1fr; }
  .compare-grid, .lab-grid, .template-grid, .glossary-grid { grid-template-columns: 1fr; }
  .lab-card:first-child { grid-column: auto; }
  .lesson-rail { grid-template-columns: 1fr; }
  .lesson-footer { align-items: stretch; flex-direction: column-reverse; }
  .lesson-footer-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .lesson-footer .button { width: 100%; }
  .workspace-header { padding-top: 30px; flex-direction: column; align-items: stretch; }
  .workspace-stat, .audit-score { align-self: flex-start; }
  .field-row { grid-template-columns: 1fr; }
  .audit-item { grid-template-columns: 1fr; }
  .score-choice i { width: 38px; height: 38px; }
  .source-card { grid-template-columns: 38px 1fr; }
  .source-card b { display: none; }
  .quiz-card, .practice-card { padding: 18px; }
  .quiz-head { display: block; }
  .quiz-status { display: inline-flex; margin-bottom: 8px; }
}

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