:root {
  color-scheme: light;
  --paper: #f3f0e8;
  --paper-raised: #faf8f2;
  --ink: #171913;
  --muted: #6f7068;
  --faint: #9c9b92;
  --line: rgba(23, 25, 19, 0.14);
  --line-strong: rgba(23, 25, 19, 0.28);
  --accent: #d7632f;
  --accent-dark: #a9401d;
  --green: #2f7455;
  --blue: #3e668b;
  --purple: #705690;
  --red: #a4463e;
  --shadow: 0 24px 70px rgba(42, 35, 23, 0.12);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(30, 31, 25, 0.026) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 32px;
}

button, textarea, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
a:focus-visible, button:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: 3px solid rgba(215, 99, 47, 0.3);
  outline-offset: 3px;
}

.shell {
  width: min(1220px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 34px 72px;
}

.masthead {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-style: italic;
}

.header-meta, .badge-row, .lesson-meta, .button-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.save-state, .pill, .duration, .difficulty {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(250, 248, 242, 0.68);
  font-size: 12px;
  font-weight: 700;
}

.save-state::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(47, 116, 85, 0.1);
  content: "";
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-items: end;
  gap: 54px;
  padding: 58px 0 46px;
}

.lesson-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.4fr);
  gap: 44px;
  padding: 54px 0 38px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1, h2, .serif {
  font-family: Georgia, "Times New Roman", serif;
}

h1 {
  max-width: 820px;
  margin-bottom: 15px;
  font-size: clamp(40px, 6vw, 74px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.96;
}

.lesson-hero h1 { font-size: clamp(38px, 5vw, 64px); }

h2 {
  margin-bottom: 18px;
  font-size: clamp(29px, 3.2vw, 43px);
  font-weight: 500;
  letter-spacing: -0.038em;
  line-height: 1.03;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.25;
}

.lede {
  max-width: 690px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.progress-card {
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--line-strong);
  background: var(--paper-raised);
  box-shadow: var(--shadow);
}

.next-action h2 {
  margin-bottom: 10px;
  font-family: Inter, ui-sans-serif, -apple-system, sans-serif;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.next-day {
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.next-copy {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.next-button { width: 100%; }

.compact-progress {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.compact-progress strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 500;
}

.progress-value {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 52px;
  letter-spacing: -0.06em;
  line-height: 1;
}

.progress-track {
  height: 8px;
  margin: 20px 0 13px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(23, 25, 19, 0.09);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 280ms ease;
}

.small, .caption {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.section {
  padding: 44px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.6fr) minmax(0, 1.4fr);
  gap: 28px;
  margin-bottom: 28px;
}

.section-heading p { color: var(--muted); line-height: 1.6; }

.role-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.role-node {
  min-width: 0;
  min-height: 132px;
  padding: 20px;
  border: 1px solid var(--line);
  background: rgba(250, 248, 242, 0.65);
}

.role-node strong { display: block; margin-bottom: 7px; }
.role-node p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.role-node.is-focus { border-color: var(--accent); background: #fff5eb; }

.action-board {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.45fr);
  gap: 16px;
}

.action-main, .evidence-card, .action-plan {
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--line-strong);
  background: var(--paper-raised);
}

.action-main { border-top: 4px solid var(--accent); }

.action-main > h3 {
  max-width: 700px;
  margin-bottom: 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 500;
  letter-spacing: -0.025em;
}

.action-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 12px;
}

.action-kicker span {
  padding: 6px 9px;
  color: #fffdf7;
  background: var(--accent-dark);
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.action-steps, .lesson-steps {
  margin: 0 0 24px;
  padding-left: 24px;
}

.action-steps li, .lesson-steps li {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.action-steps li::marker, .lesson-steps li::marker {
  color: var(--accent-dark);
  font-weight: 900;
}

.action-steps strong, .lesson-steps strong { display: block; margin-bottom: 3px; font-size: 14px; }
.action-steps span, .lesson-steps span { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; }

.evidence-card {
  border-color: rgba(47, 116, 85, 0.45);
  background: rgba(47, 116, 85, 0.06);
}

.evidence-card ul {
  margin: 18px 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.evidence-card li + li { margin-top: 9px; }

.roadmap-details {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(250, 248, 242, 0.55);
}

.roadmap-details summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.roadmap-details > p { margin: 10px 0 16px; }
.roadmap-details .framework-diagram { margin-top: 16px; }

.action-plan {
  border-top: 4px solid var(--accent);
}

.action-plan h2 { max-width: 720px; }

.setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.setup-item {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(243, 240, 232, 0.56);
}

.setup-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.setup-item strong { font-size: 14px; }

.code-details {
  margin-top: 16px;
  border: 1px solid var(--line);
  background: #1f211c;
}

.code-details summary {
  padding: 13px 16px;
  color: #fffdf7;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.code-details pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  color: #f4eee2;
  font: 12px/1.6 "SFMono-Regular", Consolas, monospace;
  white-space: pre;
}

.code-details code {
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.day-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  min-width: 0;
  min-height: 212px;
  overflow: hidden;
  border: 1px solid var(--line);
  color: inherit;
  background: var(--paper-raised);
  text-decoration: none;
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}

.day-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 42px rgba(42, 35, 23, 0.09);
}

.day-number {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 23px;
  color: var(--accent-dark);
  background: rgba(215, 99, 47, 0.08);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 31px;
}

.day-body { min-width: 0; padding: 22px; }
.day-body h3 { font-size: 20px; }
.day-body p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.day-status { margin-top: 19px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }

.callout, .concept-card, .exercise, .quiz, .reflection, .source-card {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--paper-raised);
}

.callout { border-left: 4px solid var(--accent); }
.callout p:last-child, .concept-card p:last-child, .source-card p:last-child { margin-bottom: 0; }

.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.36fr);
  gap: 34px;
  align-items: start;
}

.lesson-main, .lesson-aside { min-width: 0; }
.lesson-main > * + * { margin-top: 22px; }
.lesson-aside { position: sticky; top: 24px; }
.lesson-aside > * + * { margin-top: 14px; }

.concept-grid, .two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.deep-dive-grid { display: grid; gap: 12px; }
.deep-dive { border-top: 1px solid var(--line-strong); padding: 0 0 18px; }
.deep-dive summary { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 17px 0; cursor: pointer; list-style: none; }
.deep-dive summary::-webkit-details-marker { display: none; }
.deep-dive summary span { color: var(--accent-dark); font-size: 12px; font-weight: 850; letter-spacing: .1em; }
.deep-dive summary strong { font-size: 18px; }
.deep-dive summary em { color: var(--muted); font-size: 12px; font-style: normal; }
.deep-dive summary::after { content: '+'; color: var(--accent); font-size: 22px; font-weight: 500; }
.deep-dive[open] summary::after { content: '−'; }
.os-picture { width: 100%; height: auto; display: block; margin: 2px 0 16px; background: var(--paper-raised); border: 1px solid var(--line); }
.deep-dive-copy { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; color: var(--muted); }
.deep-dive-copy p { margin: 0; line-height: 1.55; }
.deep-dive-copy strong { color: var(--ink); }
@media (max-width: 760px) { .deep-dive summary { grid-template-columns: 34px minmax(0, 1fr) 20px; } .deep-dive summary em { grid-column: 2 / -1; } .deep-dive-copy { grid-template-columns: 1fr; gap: 12px; } }

.lab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.lab-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  background: var(--paper-raised);
}

.lab-card h3 { margin-bottom: 7px; font-size: 18px; }

.lab-label {
  display: inline-flex;
  margin-bottom: 13px;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lab-steps {
  margin: 16px 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.lab-steps li + li { margin-top: 7px; }

.lab-evidence {
  margin: 16px 0 0;
  padding: 12px 13px;
  border-left: 3px solid var(--green);
  color: var(--ink);
  background: rgba(47, 116, 85, 0.07);
  font-size: 12px;
  line-height: 1.5;
}

.concept-card p, .exercise p, .reflection p { color: var(--muted); line-height: 1.58; }

.flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 22px;
  border: 1px solid var(--line);
  background: rgba(250, 248, 242, 0.6);
}

.flow-step {
  position: relative;
  min-width: 0;
  padding: 16px 13px;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  text-align: center;
  font-size: 13px;
  font-weight: 750;
}

.flow-step:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: -9px;
  z-index: 2;
  color: var(--accent);
  content: "→";
  transform: translateY(-52%);
}

.checklist { display: grid; gap: 10px; }

.check-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.check-item input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--green);
}

.check-item span { font-size: 14px; line-height: 1.45; }

.timebox {
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.quiz-question { margin-top: 22px; }
.quiz-question:first-of-type { margin-top: 14px; }
.quiz-question > p { margin-bottom: 11px; font-weight: 750; line-height: 1.45; }
.quiz-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.quiz-option {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-size: 13px;
}

.quiz-option:hover { border-color: var(--ink); }
.quiz-option.is-correct { border-color: var(--green); color: var(--green); background: rgba(47, 116, 85, 0.08); }
.quiz-option.is-wrong { border-color: var(--red); color: var(--red); background: rgba(164, 70, 62, 0.08); }
.quiz-feedback { min-height: 20px; margin: 9px 0 0; color: var(--muted); font-size: 12px; }

.notes-area {
  width: 100%;
  min-height: 144px;
  resize: vertical;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  color: var(--ink);
  background: #fffdf8;
  line-height: 1.5;
}

.source-link, .primary-button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 39px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 760;
}

.primary-button, .source-link { color: #fffdf7; background: var(--ink); }
.secondary-button { color: var(--ink); background: transparent; }
.primary-button:hover, .source-link:hover { background: #2c2e26; }

.lesson-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 46px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.framework-diagram {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  background: var(--paper-raised);
}

.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; min-width: 720px; border-collapse: collapse; background: var(--paper-raised); }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 13px; line-height: 1.45; }
th { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }

.reset-button {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

code {
  padding: 0.1em 0.34em;
  color: var(--accent-dark);
  background: rgba(215, 99, 47, 0.09);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.workbench-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.56fr);
  gap: 58px;
  align-items: end;
  padding: 58px 0 44px;
}

.workbench-intro .button-row { margin-top: 24px; }

.workbench-status {
  min-width: 0;
  padding: 22px;
  color: #f7f2e7;
  background: #171913;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow);
}

.workbench-status strong {
  display: block;
  margin: 24px 0 13px;
  font: 500 28px/1.1 Georgia, "Times New Roman", serif;
}

.workbench-status .progress-track { background: rgba(255, 255, 255, 0.12); }
.workbench-status .small { margin: 12px 0 18px; color: #b9b9b0; }
.workbench-status code { display: block; padding: 11px 12px; color: #f5c3a8; background: rgba(255, 255, 255, 0.06); font-size: 11px; }

.terminal-dot { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 50%; }
.terminal-dot-red { background: #ec6a5f; }
.terminal-dot-amber { background: #f4bf4f; }
.terminal-dot-green { background: #61c554; }
.terminal-label { margin: 16px 0 0; color: #85877d; font: 700 10px/1.4 "SFMono-Regular", Consolas, monospace; letter-spacing: 0.12em; }

.command-console { overflow: hidden; border: 1px solid #2b2d27; background: #171913; }
.command-console-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 15px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); color: #999b92; font-size: 11px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.command-console-bar button { padding: 6px 9px; border: 1px solid rgba(255, 255, 255, 0.18); color: #f7f2e7; background: transparent; font-size: 10px; font-weight: 750; }
.command-console-bar button:hover { border-color: var(--accent); color: #f5c3a8; }
.command-console pre { margin: 0; padding: 22px; overflow-x: auto; color: #f7f2e7; font: 12px/1.85 "SFMono-Regular", Consolas, monospace; }
.command-console code { padding: 0; color: inherit; background: transparent; white-space: pre; }
.command-console .prompt { color: var(--accent); }
.workbench-note { padding: 15px 18px; border: 1px solid var(--line); border-top: 0; color: var(--muted); background: var(--paper-raised); font-size: 13px; line-height: 1.55; }
.workbench-note strong { color: var(--ink); }

.workbench-list { border-top: 1px solid var(--line-strong); }
.workbench-module {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) minmax(220px, 0.38fr);
  gap: 22px;
  align-items: start;
  padding: 25px 0;
  border-bottom: 1px solid var(--line-strong);
  transition: padding 170ms ease, background 170ms ease;
}
.workbench-module:hover { padding-right: 14px; padding-left: 14px; background: rgba(250, 248, 242, 0.7); }
.workbench-module.is-observed { background: rgba(47, 116, 85, 0.055); }
.workbench-module-native { border-bottom-color: var(--accent); }
.module-index { color: var(--accent-dark); font: 500 30px/1 Georgia, "Times New Roman", serif; }
.module-copy { min-width: 0; }
.module-copy h3 { margin-bottom: 7px; font-size: 20px; }
.module-copy > p:not(.module-kicker) { max-width: 660px; margin-bottom: 13px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.module-kicker { margin-bottom: 7px; color: var(--accent-dark); font-size: 10px; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; }
.module-prompts { display: flex; flex-wrap: wrap; gap: 7px 18px; color: var(--blue); font-size: 11px; font-weight: 700; }
.module-action { display: grid; min-width: 0; gap: 11px; justify-items: start; }
.module-action code { width: 100%; padding: 10px 11px; color: #f5c3a8; background: #20221d; font-size: 10px; white-space: nowrap; }
.module-action a { color: var(--accent-dark); font-size: 11px; font-weight: 800; text-underline-offset: 3px; }
.module-action label { display: flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 750; }
.module-action input { width: 17px; height: 17px; accent-color: var(--green); }

.code-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line-strong); }
.code-comparison article { min-width: 0; padding: 25px; background: var(--paper-raised); }
.code-comparison article + article { border-left: 1px solid var(--line-strong); }
.code-comparison article > span { color: var(--accent-dark); font-size: 10px; font-weight: 850; letter-spacing: 0.12em; text-transform: uppercase; }
.code-comparison h3 { margin-top: 8px; font-size: 19px; }
.code-comparison pre { margin: 18px 0; padding: 18px; overflow-x: auto; color: #f7f2e7; background: #171913; font: 12px/1.65 "SFMono-Regular", Consolas, monospace; }
.code-comparison code { padding: 0; color: inherit; background: transparent; white-space: pre; }
.code-comparison p { margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

.second-mate-panel { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1fr); gap: 36px 52px; padding: 34px; color: #f7f2e7; background: #171913; }
.second-mate-panel h2 { max-width: 520px; }
.second-mate-panel .lede { color: #b9b9b0; font-size: 15px; }
.second-mate-panel .button-row { grid-column: 1 / -1; }
.second-mate-panel .secondary-button { color: #f7f2e7; border-color: rgba(255, 255, 255, 0.22); }
.mate-loop { margin: 0; padding: 0; list-style: none; border-top: 1px solid rgba(255, 255, 255, 0.16); }
.mate-loop li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 15px; padding: 13px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.16); }
.mate-loop strong { color: #f5c3a8; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.mate-loop span { color: #c8c8be; font-size: 13px; }

@media (max-width: 860px) {
  .hero, .lesson-hero, .workbench-hero, .lesson-layout, .section-heading, .second-mate-panel { grid-template-columns: 1fr; }
  .week-grid, .role-map, .action-board { grid-template-columns: 1fr; }
  .lesson-aside { position: static; }
  .progress-card { box-shadow: none; }
  .second-mate-panel .button-row { grid-column: 1; }
}

@media (max-width: 620px) {
  .shell { padding: 0 18px 48px; }
  .masthead { align-items: flex-start; padding: 18px 0; }
  .header-meta .pill { display: none; }
  .hero, .lesson-hero, .workbench-hero { padding: 40px 0 32px; }
  h1 { font-size: 43px; }
  .concept-grid, .two-col, .lab-grid, .quiz-options, .flow, .setup-grid, .code-comparison { grid-template-columns: 1fr; }
  .workbench-module { grid-template-columns: 42px minmax(0, 1fr); gap: 16px; }
  .module-action { grid-column: 2; width: 100%; }
  .module-action code { overflow-x: auto; }
  .code-comparison article + article { border-top: 1px solid var(--line-strong); border-left: 0; }
  .second-mate-panel { padding: 24px 20px; }
  .action-kicker { align-items: flex-start; flex-direction: column; }
  .flow-step:not(:last-child)::after { top: auto; right: 50%; bottom: -17px; transform: rotate(90deg); }
  .lesson-nav, footer { align-items: stretch; flex-direction: column; }
  .lesson-nav a { width: 100%; }
}

@media print {
  body { background: #fff; }
  .shell { width: 100%; padding: 0; }
  .masthead, .lesson-nav, footer, .notes-area, .reset-button { display: none; }
  .lesson-aside { position: static; }
  .lesson-layout { grid-template-columns: 1fr; }
  .callout, .concept-card, .lab-card, .exercise, .quiz, .reflection, .source-card { break-inside: avoid; }
}
