@import url('../shared/harness.css');

:root {
  --ink: #14213a;
  --ink-2: #33415c;
  --muted: #65718a;
  --paper: #f2f5fa;
  --surface: #ffffff;
  --navy: #101d38;
  --blue: #315bd7;
  --amber: #efb84d;
  --coral: #dc644f;
  --green: #147a67;
  --line: #d8e0eb;
  --line-dark: #b7c3d2;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --body: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --shadow: 0 24px 65px rgba(18, 35, 67, .11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--body); line-height: 1.68; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, textarea { font: inherit; }
:focus-visible { outline: 3px solid rgba(49, 91, 215, .45); outline-offset: 4px; }
::selection { color: var(--navy); background: var(--amber); }
.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 100; padding: .65rem .9rem; color: white; background: var(--navy); border-radius: 8px; }
.skip-link:focus { top: 1rem; }
.utility-label, .kicker, .section-label, .eyebrow, .spine-label, .case-label, .artifact-label { font-family: var(--mono); font-size: .69rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

.course-masthead { padding: 30px clamp(22px, 6vw, 88px) 96px; color: white; background: radial-gradient(circle at 84% 15%, rgba(49, 91, 215, .44), transparent 29rem), linear-gradient(135deg, #0c1730, #182b51 74%); border-bottom: 7px solid var(--coral); }
.course-topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 1240px; margin: 0 auto 94px; }
.wordmark { font-size: .78rem; font-weight: 800; text-decoration: none; }
.wordmark span { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 8px; color: var(--navy); background: var(--amber); border-radius: 50%; }
.utility-label { color: #adbbd8; }
.course-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: clamp(44px, 8vw, 110px); align-items: end; max-width: 1240px; margin: auto; }
.kicker { margin: 0 0 20px; color: #b9c9ee; }
.course-hero h1 { margin: 0; font-family: var(--display); font-size: clamp(52px, 7.6vw, 108px); line-height: .91; letter-spacing: -.06em; }
.course-hero h1 em { color: var(--amber); font-weight: 500; }
.hero-brief { padding-left: 24px; border-left: 3px solid var(--amber); }
.hero-brief > p { margin: 0; color: #e0e7f4; font-family: var(--display); font-size: clamp(19px, 2vw, 25px); line-height: 1.43; }
.release-note { display: grid; gap: 3px; margin-top: 28px; color: #b8c4dc; font-size: .77rem; }
.release-note strong { color: white; }
.course-main { max-width: 1240px; margin: -48px auto 0; padding: 0 clamp(20px, 4vw, 44px) 90px; }
.standard { display: grid; grid-template-columns: minmax(250px, .7fr) minmax(0, 1.3fr); gap: clamp(35px, 6vw, 90px); padding: clamp(28px, 4vw, 48px); background: white; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.section-label { margin: 0 0 14px; color: var(--blue); }
.standard h2 { margin: 0; font-family: var(--display); font-size: clamp(32px, 4vw, 52px); line-height: 1.03; letter-spacing: -.035em; }
.standard-steps { margin: 0; padding: 0; list-style: none; counter-reset: standard; }
.standard-steps li { display: grid; grid-template-columns: 34px 120px 1fr; gap: 14px; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--line); counter-increment: standard; }
.standard-steps li::before { content: counter(standard, decimal-leading-zero); color: var(--coral); font-family: var(--mono); font-size: .69rem; font-weight: 900; }
.standard-steps strong { font-size: .83rem; }
.standard-steps span { color: var(--muted); font-size: .83rem; }
.course-progress { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; margin: 40px 0 0; padding: 20px 24px; background: #e7ecf5; border: 1px solid var(--line); border-radius: 16px; }
.course-progress > div:first-child { display: flex; align-items: baseline; gap: 8px; font-size: .75rem; }
.progress-number { font-family: var(--display); font-size: 2rem; line-height: 1; }
.progress-track { height: 8px; overflow: hidden; background: #ced7e5; border-radius: 99px; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--blue); transition: width .25s ease; }
.course-progress p { margin: 0; color: var(--muted); font-size: .72rem; }
.course-map { display: grid; gap: 24px; margin-top: 34px; }
.phase-block { padding: clamp(25px, 4vw, 42px); background: white; border: 1px solid var(--line); border-radius: 20px; }
.phase-head { display: flex; justify-content: space-between; gap: 20px; align-items: baseline; margin-bottom: 18px; }
.phase-head h2 { margin: 0; font-family: var(--display); font-size: clamp(27px, 3vw, 38px); }
.phase-head span { color: var(--muted); font-family: var(--mono); font-size: .68rem; }
.day-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 15px; align-items: center; padding: 15px 0; border-top: 1px solid var(--line); }
.day-row .day-number { color: var(--muted); font-family: var(--mono); font-size: .7rem; }
.day-row a { font-weight: 800; text-decoration: none; }
.day-row a:hover { color: var(--blue); }
.day-row .source-tag { padding: 4px 8px; color: var(--ink-2); background: #eef2f8; border-radius: 99px; font-size: .64rem; font-weight: 800; white-space: nowrap; }
.day-row.locked { color: #8993a7; }
.day-row.locked .source-tag { opacity: .65; }
.day-row.completed a::after { content: " · completed"; color: var(--green); font-size: .67rem; font-weight: 700; }
.notice { padding: 18px; background: #fff4dd; border-left: 4px solid var(--amber); }

.lesson-page { background: linear-gradient(90deg, transparent calc(50% - 1px), rgba(20,33,58,.026) 50%, transparent calc(50% + 1px)) 0 0 / 78px 78px, var(--paper); }
.lesson-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 62px; padding: 0 clamp(18px, 4vw, 52px); background: rgba(242,245,250,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.lesson-topbar a { font-size: .76rem; font-weight: 800; text-decoration: none; }
.lesson-topbar .day-context { color: var(--muted); font-family: var(--mono); font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; }
.lesson-layout { display: grid; grid-template-columns: 230px minmax(0, 840px); gap: clamp(38px, 6vw, 86px); max-width: 1160px; margin: 0 auto; padding: 58px 28px 100px; }
.decision-spine { position: sticky; top: 96px; align-self: start; }
.spine-label { margin: 0 0 14px; color: var(--coral); }
.decision-spine ol { margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.decision-spine li { border-bottom: 1px solid var(--line-dark); }
.decision-spine a { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 11px 0; color: var(--ink-2); font-size: .72rem; font-weight: 700; text-decoration: none; }
.decision-spine a span { color: var(--muted); font-family: var(--mono); font-size: .62rem; }
.spine-thesis { margin-top: 22px; padding: 16px; color: white; background: var(--navy); font-family: var(--display); font-size: 1.02rem; line-height: 1.4; }
.lesson-main { min-width: 0; }
.lesson-hero { padding-bottom: 50px; border-bottom: 3px solid var(--ink); }
.eyebrow { margin: 0 0 18px; color: var(--blue); }
.lesson-hero h1 { max-width: 800px; margin: 0; font-family: var(--display); font-size: clamp(47px, 7vw, 82px); line-height: .94; letter-spacing: -.055em; }
.lesson-hero .deck { max-width: 720px; margin: 24px 0 0; color: var(--ink-2); font-family: var(--display); font-size: clamp(20px, 2.4vw, 28px); line-height: 1.4; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 25px; }
.lesson-meta span { padding: 6px 9px; color: var(--muted); border: 1px solid var(--line-dark); border-radius: 99px; font-size: .66rem; font-weight: 800; }
.lesson-section { scroll-margin-top: 90px; padding: 52px 0; border-bottom: 1px solid var(--line-dark); }
.lesson-section > :first-child { margin-top: 0; }
.lesson-section > :last-child { margin-bottom: 0; }
.lesson-section h2 { margin: 0 0 20px; font-family: var(--display); font-size: clamp(30px, 4vw, 45px); line-height: 1.06; letter-spacing: -.035em; }
.lesson-section h3 { margin: 32px 0 10px; font-family: var(--display); font-size: 1.55rem; line-height: 1.15; }
.lesson-section p, .lesson-section li { font-size: 1rem; }
.lesson-section p { max-width: 760px; }
.lesson-section li + li { margin-top: 8px; }
.lead { color: var(--ink-2); font-family: var(--display); font-size: 1.26rem !important; line-height: 1.52; }
.definition { margin: 25px 0; padding: 22px 24px; background: white; border: 1px solid var(--line); border-left: 5px solid var(--blue); }
.definition strong { display: block; margin-bottom: 5px; color: var(--blue); font-family: var(--mono); font-size: .68rem; letter-spacing: .11em; text-transform: uppercase; }
.model { margin: 28px 0; padding: clamp(22px, 4vw, 34px); color: white; background: var(--navy); box-shadow: var(--shadow); }
.model .model-title { color: var(--amber); font-family: var(--mono); font-size: .7rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.model .equation { margin: 16px 0 0; font-family: var(--display); font-size: clamp(24px, 4vw, 38px); line-height: 1.2; }
.model p { color: #d6dfef; }
.concept-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 25px 0; }
.concept { padding: 20px; background: white; border: 1px solid var(--line); }
.concept b { display: block; margin-bottom: 6px; }
.concept p { margin: 0; color: var(--muted); font-size: .82rem; }
.worked-case { margin: 28px 0; padding: clamp(22px, 4vw, 34px); background: #e8eefc; border-top: 5px solid var(--blue); }
.case-label { color: var(--blue); }
.worked-case h3 { margin-top: 8px; }
.case-steps { margin: 22px 0 0; padding: 0; list-style: none; counter-reset: case-step; }
.case-steps li { position: relative; padding: 0 0 18px 38px; counter-increment: case-step; }
.case-steps li::before { content: counter(case-step); position: absolute; left: 0; top: 2px; display: grid; place-items: center; width: 24px; height: 24px; color: white; background: var(--blue); border-radius: 50%; font: 800 .67rem/1 var(--mono); }
.misconception { margin: 24px 0; padding: 18px 20px; background: #fff0ed; border-left: 5px solid var(--coral); }
.misconception strong { color: #a7392c; }
.table-wrap { max-width: 100%; margin: 25px 0; overflow-x: auto; }
table { width: 100%; min-width: 620px; border-collapse: collapse; background: white; }
th, td { padding: 12px 14px; text-align: left; vertical-align: top; border: 1px solid var(--line); font-size: .82rem; }
th { color: var(--ink-2); background: #e9eef5; }
.decision-lab { margin: 40px 0; padding: clamp(24px, 4vw, 36px); color: white; background: linear-gradient(145deg, #14213a, #263f73); }
.decision-lab h2 { color: white; }
.decision-lab p, .decision-lab li { color: #e0e7f3; }
.decision-lab .scenario { padding: 18px; color: var(--ink); background: white; }
.decision-lab textarea, .artifact textarea { width: 100%; min-height: 180px; margin-top: 14px; padding: 15px; color: var(--ink); background: white; border: 1px solid var(--line-dark); border-radius: 0; resize: vertical; }
.save-line { min-height: 1.4em; margin-top: 6px; color: #b9c7df; font-size: .68rem; }
details.expert, details.answer { margin-top: 18px; background: white; border: 1px solid var(--line); }
details.expert summary, details.answer summary { padding: 14px 16px; color: var(--ink); cursor: pointer; font-weight: 800; }
details.expert > div, details.answer > div { padding: 0 18px 18px; color: var(--ink); }
.artifact { margin: 30px 0; padding: clamp(22px, 4vw, 34px); background: #f9e8bd; border-top: 5px solid var(--amber); }
.artifact-label { color: #815300; }
.artifact h3 { margin-top: 8px; }
.rubric { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 18px; }
.rubric div { padding: 13px; background: rgba(255,255,255,.62); font-size: .78rem; }
.retrieval { margin: 0; padding: 0; list-style: none; }
.retrieval li { margin: 0 0 10px; }
.retrieval details { background: white; border: 1px solid var(--line); }
.retrieval summary { padding: 15px 17px; cursor: pointer; font-weight: 800; }
.retrieval details div { padding: 0 18px 17px; color: var(--ink-2); }
.lesson-footer { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding-top: 38px; }
.lesson-footer a, .complete-button { padding: 11px 15px; text-decoration: none; border: 1px solid var(--ink); font-size: .75rem; font-weight: 800; }
.complete-button { color: white; background: var(--blue); border-color: var(--blue); cursor: pointer; }
.complete-button[aria-pressed="true"] { color: var(--green); background: #e5f4ef; border-color: var(--green); }

@media (max-width: 850px) {
  .course-hero, .standard { grid-template-columns: 1fr; }
  .course-main { padding-inline: 20px; }
  .course-progress { grid-template-columns: 1fr; }
  .lesson-layout { grid-template-columns: 1fr; padding-top: 34px; }
  .decision-spine { position: static; }
  .decision-spine ol { display: grid; grid-template-columns: repeat(3, 1fr); }
  .decision-spine li { border-right: 1px solid var(--line-dark); }
  .spine-thesis { display: none; }
}

@media (max-width: 600px) {
  .course-masthead { padding-bottom: 78px; }
  .course-topbar { margin-bottom: 60px; }
  .utility-label { display: none; }
  .course-hero h1 { font-size: clamp(48px, 15vw, 70px); }
  .standard-steps li { grid-template-columns: 28px 92px 1fr; gap: 8px; }
  .phase-head { display: block; }
  .phase-head span { display: block; margin-top: 5px; }
  .day-row { grid-template-columns: 36px 1fr; }
  .day-row .source-tag { grid-column: 2; justify-self: start; }
  .lesson-topbar { min-height: 58px; padding-inline: 14px; }
  .lesson-topbar .day-context { display: block; font-size: .58rem; letter-spacing: .04em; text-align: right; }
  .lesson-layout { padding: 28px 16px calc(76px + env(safe-area-inset-bottom)); }
  .decision-spine { padding: 14px 16px; background: white; border: 1px solid var(--line); border-left: 5px solid var(--coral); }
  .decision-spine ol { display: flex; gap: 6px; padding-bottom: 5px; overflow-x: auto; border-top: 0; scrollbar-width: none; }
  .decision-spine ol::-webkit-scrollbar { display: none; }
  .decision-spine li { flex: 0 0 auto; border: 0; }
  .decision-spine a { display: block; min-height: 42px; padding: 10px 12px; background: #eef2f8; border-radius: 8px; white-space: nowrap; }
  .decision-spine a span { margin-right: 5px; }
  .lesson-hero { padding-bottom: 36px; }
  .lesson-hero h1 { font-size: clamp(2.55rem, 13vw, 4rem); line-height: .98; }
  .lesson-hero .deck { margin-top: 18px; font-size: 1.15rem; line-height: 1.5; }
  .lesson-section { padding: 38px 0; }
  .lesson-section h2 { font-size: clamp(1.8rem, 9vw, 2.65rem); }
  .lesson-section p, .lesson-section li { font-size: 1rem; line-height: 1.72; }
  .model, .worked-case, .decision-lab, .artifact { margin-inline: -2px; padding: 20px 18px; }
  pre { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
  .table-wrap { margin-inline: -2px; -webkit-overflow-scrolling: touch; }
  .concept-grid, .rubric { grid-template-columns: 1fr; }
  .lesson-footer { align-items: stretch; flex-direction: column; }
  .lesson-footer a, .complete-button { min-height: 48px; display: grid; place-items: center; text-align: center; }
}

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

/* ---------- Shared Elite PM chrome (shared/harness.css + mastery.js buildShell) ---------- */
:root:not([data-theme="light"]) {
  --ink: var(--hx-text);
  --ink-2: var(--hx-soft);
  --muted: var(--hx-muted);
  --paper: var(--hx-bg);
  --surface: var(--hx-surface);
  --navy: var(--hx-surface);
  --blue: #8fb3e6;
  --coral: var(--hx-accent);
  --green: #92c7a3;
  --line: var(--hx-line);
  --line-dark: var(--hx-line-strong);
  --shadow: none;
}
body,
.lesson-page,
.course-home { color: var(--hx-text); background: var(--hx-bg); font-family: var(--hx-sans); }
::selection { color: var(--hx-bg); background: var(--hx-accent); }

.mastery-layout { display: grid; grid-template-columns: var(--hx-rail) minmax(0, 1fr); min-height: calc(100vh - var(--hx-top)); }
.mastery-workspace { min-width: 0; }
.mastery-rail {
  position: sticky;
  top: var(--hx-top);
  align-self: start;
  height: calc(100vh - var(--hx-top));
  padding: 24px 14px;
  overflow-y: auto;
  background: var(--hx-bg);
  border-right: 1px solid var(--hx-line);
  scrollbar-width: thin;
}
.mastery-rail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mastery-rail-head .hx-rail-title { margin: 0; }
.mastery-rail-close,
.mastery-scrim { display: none; }
.mastery-phase-label { margin: 18px 16px 6px; color: var(--hx-muted); font: 650 .72rem/1.3 var(--hx-sans); letter-spacing: .08em; text-transform: uppercase; }

/* The page's own bars give way to the shared top bar. */
.lesson-topbar,
.course-topbar { display: none; }

/* Lessons: article left, decision spine becomes the right-hand "On this page". */
.lesson-layout,
.lesson-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 56px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 48px 72px;
}
.lesson-masthead { max-width: 1240px; margin: 0 auto; padding: 0 48px; }
.lesson-masthead .lesson-hero { max-width: calc(100% - 286px); }
.decision-spine {
  order: 2;
  position: sticky;
  top: calc(var(--hx-top) + 24px);
  align-self: start;
  max-height: calc(100vh - var(--hx-top) - 48px);
  padding: 40px 0 24px 20px;
  overflow-y: auto;
  border-left: 1px solid var(--hx-line);
}
.decision-spine .spine-label { margin: 0 0 12px; color: var(--hx-text); font: 650 1rem/1.3 var(--hx-sans); letter-spacing: 0; text-transform: none; }
.decision-spine ol { display: grid; gap: 2px; border: 0; }
.decision-spine li { border: 0; }
.decision-spine a { display: block; padding: 7px 0; color: var(--hx-muted); font: 500 .92rem/1.4 var(--hx-sans); }
.decision-spine a:hover { color: var(--hx-accent); }
.decision-spine a span { display: none; }
.spine-thesis { margin-top: 20px; padding: 16px; color: var(--hx-soft); background: var(--hx-surface); border: 1px solid var(--hx-line); border-radius: 12px; font: 400 .95rem/1.5 var(--hx-serif); }
.lesson-main,
.lesson-content { min-width: 0; max-width: 760px; }

.lesson-hero { padding: 72px 0 36px; border-bottom: 1px solid var(--hx-line); }
.lesson-hero .eyebrow,
.lesson-hero .kicker,
.eyebrow { color: var(--hx-accent); font-family: var(--hx-sans); letter-spacing: .06em; }
.lesson-hero h1 { color: var(--hx-title); font: 500 clamp(2.6rem, 4.6vw, 4.2rem)/1.08 var(--hx-serif); letter-spacing: -.02em; }
.lesson-hero .deck,
.lesson-hero .dek { color: var(--hx-soft); font: 400 1.15rem/1.7 var(--hx-sans); }
.lesson-meta span { color: var(--hx-muted); background: var(--hx-surface); border-color: var(--hx-line); }
.lesson-section { padding: 40px 0; border-color: var(--hx-line); }
.lesson-section h2,
.lesson-section h3 { color: var(--hx-text); font-family: var(--hx-serif); font-weight: 500; letter-spacing: -.01em; }
.lesson-section p,
.lesson-section li { color: var(--hx-soft); }
.lesson-section strong,
.lesson-section b { color: var(--hx-text); }
.lead { color: var(--hx-soft); }

.definition,
.concept,
.misconception,
.worked-case,
.artifact,
.model,
.decision-lab,
.decision-lab .scenario,
details.expert,
details.answer,
.retrieval details,
.quote {
  color: var(--hx-text);
  background: var(--hx-surface);
  border-color: var(--hx-line);
  box-shadow: none;
}
.definition,
.worked-case,
.artifact,
.misconception,
.model,
.decision-lab { border: 1px solid var(--hx-line); border-left: 3px solid var(--hx-accent); border-radius: 12px; }
.model p,
.decision-lab p,
.decision-lab li,
.concept p,
.retrieval details div { color: var(--hx-soft); }
.model .model-title,
.definition strong,
.case-label,
.artifact-label,
.misconception strong { color: var(--hx-accent); }
.decision-lab h2 { color: var(--hx-text); }
.case-steps li::before { color: var(--hx-bg); background: var(--hx-accent); }
.rubric div { color: var(--hx-soft); background: var(--hx-raised); }
table { background: var(--hx-surface); }
th { color: var(--hx-text); background: var(--hx-raised); }
th, td { color: var(--hx-soft); border-color: var(--hx-line); }
details.expert summary,
details.answer summary,
details.expert > div,
details.answer > div { color: var(--hx-text); }
.decision-lab textarea,
.artifact textarea { color: var(--hx-text); background: var(--hx-bg); border-color: var(--hx-line); border-radius: 10px; }
.save-line { color: var(--hx-muted); }
.lesson-footer { max-width: 1240px; margin: 0 auto; padding: 32px 48px 72px; }
.lesson-footer a { color: var(--hx-text); border: 1px solid var(--hx-line); border-radius: 12px; }
.lesson-footer a:hover { border-color: var(--hx-muted); }
.hx-top .hx-slot-end > .complete-button[aria-pressed="true"] { color: var(--hx-text); background: transparent; border-color: var(--hx-line); }

/* Course map (mastery/index.html). */
.course-masthead { padding: 72px 48px 40px; color: var(--hx-text); background: none; border-bottom: 1px solid var(--hx-line); }
.course-hero { max-width: 1060px; margin: 0; }
.course-hero .kicker { color: var(--hx-accent); }
.course-hero h1 { color: var(--hx-title); font: 500 clamp(2.6rem, 4.6vw, 4.2rem)/1.08 var(--hx-serif); letter-spacing: -.02em; }
.course-hero h1 em { color: var(--hx-accent); }
.course-hero { display: block; }
.hero-brief { max-width: 760px; margin-top: 28px; padding-left: 0; border: 0; }
.hero-brief > p { color: var(--hx-soft); font: 400 1.15rem/1.7 var(--hx-sans); }
.release-note { display: inline-flex; gap: 10px; padding: 8px 14px; border: 1px solid var(--hx-line); border-radius: 999px; font-size: .82rem; }
.course-main { padding-top: 40px; }
.standard { grid-template-columns: minmax(0, 1fr); gap: 20px; border-radius: 14px; }
.standard h2 { font-size: clamp(1.9rem, 3vw, 2.4rem); line-height: 1.15; }
.section-label { color: var(--hx-accent); }
.course-progress,
.phase-block { border-radius: 14px; }
.release-note { color: var(--hx-text); background: var(--hx-surface); border-color: var(--hx-line); }
.course-main { max-width: 1060px; margin: 0; padding-left: 48px; padding-right: 48px; }
.standard,
.course-progress,
.phase-block { color: var(--hx-text); background: var(--hx-surface); border-color: var(--hx-line); box-shadow: none; }
.standard h2,
.phase-head h2 { color: var(--hx-text); font-family: var(--hx-serif); font-weight: 500; }
.standard-steps li,
.day-row { border-color: var(--hx-line); }
.standard-steps span,
.phase-head span,
.course-progress p,
.day-row .source-tag { color: var(--hx-muted); }
.progress-track { background: var(--hx-line); }
.progress-track span { background: var(--hx-accent); }
.day-row a:hover { color: var(--hx-accent); }
.day-row .day-number { color: var(--hx-muted); }

@media (max-width: 1180px) {
  .lesson-layout,
  .lesson-shell { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 36px 72px; }
  .lesson-masthead { padding: 0 36px; }
  .lesson-masthead .lesson-hero { max-width: none; }
  .decision-spine { order: -1; position: static; max-height: none; padding: 20px 0 0; border: 0; }
  .decision-spine .spine-label,
  .spine-thesis { display: none; }
  .decision-spine { background: none; }
  .decision-spine ol { display: flex; grid-template-columns: none; gap: 6px; padding: 0; overflow-x: auto; scrollbar-width: none; }
  .decision-spine li { flex: 0 0 auto; border: 0; }
  .decision-spine a { flex: 0 0 auto; min-height: 0; background: none; padding: 6px 12px; white-space: nowrap; border: 1px solid var(--hx-line); border-radius: 999px; font-size: .82rem; }
  .lesson-hero { padding-top: 40px; }
}

@media (max-width: 900px) {
  .mastery-layout { display: block; }
  .mastery-rail {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 150;
    width: min(340px, 88vw);
    height: 100dvh;
    transform: translateX(-102%);
    transition: transform .2s ease;
  }
  .mastery-menu-open .mastery-rail { transform: none; }
  .mastery-rail-close { display: grid; place-items: center; width: 40px; height: 40px; color: var(--hx-text); background: var(--hx-surface); border: 1px solid var(--hx-line); border-radius: 8px; }
  .mastery-scrim { position: fixed; inset: 0; z-index: 140; display: block; padding: 0; background: rgb(0 0 0 / .45); border: 0; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .mastery-menu-open .mastery-scrim { opacity: 1; pointer-events: auto; }
  .lesson-layout,
  .lesson-shell { padding: 0 18px 56px; }
  .lesson-masthead,
  .course-masthead,
  .course-main { padding-left: 18px; padding-right: 18px; }
  .lesson-footer { padding: 24px 18px 56px; }
  .lesson-hero { padding: 28px 0 24px; }
  .lesson-hero h1,
  .course-hero h1 { font-size: clamp(2.3rem, 10vw, 3.2rem); }
  .lesson-section h2 { font-size: clamp(1.7rem, 6.5vw, 2.2rem); line-height: 1.15; }
}

@media (prefers-reduced-motion: reduce) {
  .mastery-rail,
  .mastery-scrim { transition: none; }
}
