:root {
  --ink: #18211d;
  --ink-soft: #4f5b55;
  --ink-faint: #7a847f;
  --paper: #f5f3ed;
  --paper-deep: #ece9e0;
  --surface: #fffefb;
  --line: #d9d6cc;
  --line-strong: #c7c3b8;
  --forest: #173b32;
  --forest-deep: #102c25;
  --forest-muted: #a9beb6;
  --white: #fffef9;
  --accent: #2c715e;
  --accent-soft: #e1eee8;
  --accent-deep: #1b5142;
  --shadow: 0 18px 55px rgba(29, 40, 35, 0.1);
  --sidebar-width: 256px;
  --topbar-height: 58px;
  --font-ui: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
}

[data-accent="amber"] {
  --accent: #af641d;
  --accent-soft: #f3e7d4;
  --accent-deep: #82450f;
}

[data-accent="blue"] {
  --accent: #2e638b;
  --accent-soft: #e1ebf2;
  --accent-deep: #214b6a;
}

[data-accent="violet"] {
  --accent: #67528a;
  --accent-soft: #ebe6f1;
  --accent-deep: #4d3a6e;
}

[data-accent="teal"] {
  --accent: #277164;
  --accent-soft: #dfeee9;
  --accent-deep: #1d554a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
}

svg {
  display: block;
}

button svg,
a svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
  flex: 0 0 auto;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 48%, transparent);
  outline-offset: 3px;
}

.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;
  z-index: 1000;
  top: 10px;
  left: 10px;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 7px;
  background: var(--white);
  color: var(--forest);
  font-weight: 700;
  box-shadow: var(--shadow);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--forest);
  color: var(--white);
  border-right: 1px solid rgba(255, 255, 255, 0.09);
}

.sidebar-top {
  padding: 22px 18px 15px;
}

.brand,
.mobile-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-glyph {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-copy strong {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.brand-copy small {
  margin-top: 2px;
  color: var(--forest-muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-search {
  width: 100%;
  height: 40px;
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--forest-muted);
  cursor: pointer;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.sidebar-search:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.11);
  color: var(--white);
}

.sidebar-search span {
  flex: 1;
  font-size: 12px;
}

kbd {
  min-width: 22px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  opacity: 0.62;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.sidebar-label {
  margin: 24px 10px 8px;
  color: var(--forest-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-home,
.sidebar-domain {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 7px;
  color: #d7e2dd;
  font-size: 13px;
  font-weight: 590;
  transition: background 150ms ease, color 150ms ease;
}

.sidebar-home:hover,
.sidebar-domain:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--white);
}

.sidebar-home.is-active,
.sidebar-domain.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.sidebar-domain.is-active::before {
  content: "";
  position: absolute;
  left: -12px;
  width: 3px;
  height: 24px;
  border-radius: 0 3px 3px 0;
  background: #d9a86d;
}

.nav-mark,
.domain-index {
  width: 22px;
  color: var(--forest-muted);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
}

.sidebar-progress {
  margin: 14px 18px 12px;
  padding: 13px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-progress-copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--forest-muted);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.sidebar-progress-copy strong {
  color: var(--white);
  font-weight: 650;
}

.sidebar-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px 16px;
  color: rgba(214, 226, 220, 0.52);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.main-column {
  min-width: 0;
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 243, 237, 0.94);
  backdrop-filter: blur(12px);
}

.breadcrumbs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 12px;
  white-space: nowrap;
}

.breadcrumbs a {
  transition: color 140ms ease;
}

.breadcrumbs a:hover {
  color: var(--ink);
}

.breadcrumb-current {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 650;
  text-overflow: ellipsis;
}

.breadcrumb-separator {
  color: var(--line-strong);
}

.topbar-search {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 7px 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 11px;
  cursor: pointer;
}

.topbar-search svg {
  width: 15px;
  height: 15px;
}

.mobile-bar,
.sidebar-close,
.menu-backdrop {
  display: none;
}

.main-content {
  min-width: 0;
}

.page {
  width: min(1180px, calc(100% - 72px));
  margin: 0 auto;
  padding: 62px 0 80px;
}

.eyebrow,
.section-kicker,
.course-code,
.lesson-row-code {
  margin: 0;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
}

.home-intro {
  min-height: 270px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  align-items: end;
  gap: clamp(40px, 7vw, 100px);
  padding: 12px 0 52px;
  border-bottom: 1px solid var(--line-strong);
}

.home-intro h1,
.page-hero h1,
.course-hero h1,
.not-found h1 {
  max-width: 820px;
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: clamp(46px, 6vw, 76px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.home-intro .lede,
.page-hero .lede,
.course-hero .lede {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.7;
}

.search-launch {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  min-height: 76px;
  padding: 14px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(30, 39, 35, 0.05);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.search-launch:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 12px 35px rgba(30, 39, 35, 0.09);
}

.search-launch > span:first-child {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: var(--white);
}

.search-launch-copy {
  display: flex;
  flex-direction: column;
}

.search-launch-copy strong {
  font-family: var(--font-display);
  font-size: 17px;
}

.search-launch-copy small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 11px;
}

.continue-strip {
  margin: 28px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 22px 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
}

.continue-strip h2 {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 24px;
}

.continue-strip p:last-child {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 720;
  line-height: 1.2;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.button-solid {
  background: var(--forest);
  color: var(--white);
}

.button-solid:hover {
  background: var(--forest-deep);
}

.button-quiet {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}

.button-quiet:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.curriculum-section,
.course-ledger-section {
  padding-top: 58px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 20px;
}

.section-heading h2,
.principle-card h2,
.recent-card h2 {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.15;
}

.section-heading > p {
  max-width: 430px;
  margin: 0;
  color: var(--ink-faint);
  font-size: 11px;
  text-align: right;
}

.domain-ledger {
  border-top: 1px solid var(--line-strong);
}

.domain-ledger-row {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(360px, 1.2fr);
  border-bottom: 1px solid var(--line-strong);
}

.domain-ledger-main {
  display: grid;
  grid-template-columns: 45px 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 96px;
  padding: 16px 22px 16px 4px;
  transition: background 150ms ease;
}

.domain-ledger-main:hover {
  background: var(--accent-soft);
}

.ledger-index {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
}

.ledger-title {
  display: flex;
  flex-direction: column;
}

.ledger-title strong {
  font-family: var(--font-display);
  font-size: 26px;
}

.ledger-title small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ledger-arrow {
  color: var(--accent);
  transition: transform 150ms ease;
}

.domain-ledger-main:hover .ledger-arrow {
  transform: translateX(3px);
}

.ledger-courses {
  display: flex;
  align-items: center;
  align-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px 0 18px 30px;
  border-left: 1px solid var(--line);
}

.ledger-courses a {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.44);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 620;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.ledger-courses a:hover {
  border-color: var(--accent);
  background: var(--surface);
  color: var(--accent-deep);
}

.home-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding-top: 56px;
}

.principle-card,
.recent-card {
  min-height: 220px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.principle-card {
  background: var(--forest);
  color: var(--white);
}

.principle-card .section-kicker {
  color: #b9cfc6;
}

.principle-card p:last-child {
  max-width: 600px;
  margin: 18px 0 0;
  color: #c7d7d1;
  font-size: 13px;
  line-height: 1.7;
}

.mini-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.mini-heading h2 {
  margin: 0;
  font-size: 22px;
}

.mini-heading span {
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.recent-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.recent-list li + li {
  border-top: 1px solid var(--line);
}

.recent-list a {
  display: grid;
  grid-template-columns: 68px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 51px;
  color: var(--ink-soft);
}

.recent-list a:hover strong {
  color: var(--accent);
}

.recent-list span {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.recent-list strong {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-list svg {
  width: 15px;
  height: 15px;
}

.page-hero {
  position: relative;
  min-height: 300px;
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
  padding: 14px 0 58px;
  border-bottom: 1px solid var(--line-strong);
}

.page-hero-index {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 80px;
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.9;
  opacity: 0.23;
}

.page-hero h1,
.course-hero h1 {
  font-size: clamp(48px, 6vw, 72px);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 22px;
  margin-top: 28px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.hero-meta span {
  position: relative;
}

.hero-meta span + span::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -12px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 680;
  cursor: pointer;
}

.text-button:hover {
  color: var(--accent);
}

.text-button svg {
  width: 14px;
  height: 14px;
}

.course-ledger {
  border-top: 1px solid var(--line-strong);
}

.course-ledger-row {
  border-bottom: 1px solid var(--line-strong);
}

.course-ledger-row > a {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 110px;
  gap: 22px;
  align-items: center;
  min-height: 150px;
  padding: 22px 8px;
  transition: background 150ms ease;
}

.course-ledger-row > a:hover {
  background: var(--accent-soft);
}

.course-order {
  align-self: start;
  padding-top: 8px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 28px;
}

.course-ledger-copy h3 {
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.15;
}

.course-ledger-copy > p {
  max-width: 780px;
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.course-meta,
.lesson-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
  margin-top: 12px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.course-ledger-status {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: end;
  color: var(--ink-faint);
}

.course-ledger-status span {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 19px;
}

.course-ledger-status small {
  grid-column: 1;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.course-ledger-status svg {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin-left: 16px;
  color: var(--accent);
}

.course-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: end;
  gap: 70px;
  padding: 15px 0 56px;
  border-bottom: 1px solid var(--line-strong);
}

.course-hero .lede {
  font-size: 15px;
}

.course-progress-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.progress-block {
  width: 100%;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 680;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.progress-copy strong {
  color: var(--ink);
}

.progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--paper-deep);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 220ms ease;
}

.progress-track-dark {
  background: rgba(255, 255, 255, 0.12);
}

.progress-track-dark span {
  background: #d3ae73;
}

.reference-note {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.course-groups {
  display: grid;
  gap: 54px;
  padding-top: 54px;
}

.lesson-group-header {
  display: grid;
  grid-template-columns: minmax(250px, 0.65fr) minmax(300px, 1.35fr);
  align-items: end;
  gap: 40px;
  margin-bottom: 16px;
}

.lesson-group-header h2 {
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: 27px;
  line-height: 1.15;
}

.lesson-group-header > p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.6;
}

.lesson-list {
  border-top: 1px solid var(--line-strong);
}

.lesson-row {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition: background 140ms ease, opacity 140ms ease;
}

.lesson-row:hover {
  background: var(--surface);
}

.lesson-row.is-complete .lesson-row-copy h3 {
  color: var(--ink-soft);
}

.completion-toggle,
.material-mark {
  align-self: start;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  margin: 24px 0 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--white);
}

.completion-toggle {
  cursor: pointer;
}

.completion-toggle:hover {
  border-color: var(--accent);
}

.completion-toggle.is-complete,
.lesson-row.is-complete .completion-toggle {
  border-color: var(--accent);
  background: var(--accent);
}

.completion-toggle svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

.material-mark {
  width: 32px;
  border: 0;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.lesson-row-link {
  min-width: 0;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  min-height: 105px;
  padding: 17px 8px 17px 0;
}

.lesson-row-code {
  color: var(--accent);
}

.lesson-row-copy h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 650;
  line-height: 1.25;
  transition: color 140ms ease;
}

.lesson-row-copy > p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.lesson-row-arrow {
  padding-right: 8px;
  color: var(--accent);
  transition: transform 140ms ease;
}

.lesson-row:hover .lesson-row-arrow {
  transform: translateX(3px);
}

.lesson-group.is-support {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.33);
}

.lesson-group.is-support .lesson-row:last-child {
  border-bottom: 0;
}

.course-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 58px;
  padding-top: 26px;
  border-top: 1px solid var(--line-strong);
}

.app-shell[data-view="lesson"] .main-column {
  height: 100dvh;
  overflow: hidden;
}

.app-shell[data-view="lesson"] .main-content {
  height: calc(100dvh - var(--topbar-height));
}

.lesson-workspace {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--paper-deep);
}

.lesson-toolbar {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--paper);
}

.lesson-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 15px;
}

.lesson-course-link {
  flex: 0 0 auto;
  padding-right: 15px;
  border-right: 1px solid var(--line-strong);
  color: var(--accent);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.lesson-course-link:hover {
  color: var(--accent-deep);
}

.lesson-identity > div {
  min-width: 0;
}

.lesson-identity span {
  display: block;
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lesson-identity h1 {
  max-width: 720px;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
}

.progress-action svg {
  opacity: 0.45;
}

.progress-action.is-complete {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.progress-action.is-complete svg {
  opacity: 1;
}

.toc-mobile-button,
.toc-close {
  display: none;
}

.protocol-note {
  padding: 8px 18px;
  border-bottom: 1px solid #e0c99d;
  background: #fff2d6;
  color: #735116;
  font-size: 10px;
  text-align: center;
}

.lesson-stage {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  background: var(--line-strong);
}

.lesson-stage.has-toc {
  grid-template-columns: minmax(0, 1fr) 292px;
}

.frame-panel {
  min-width: 0;
  min-height: 0;
  background: #fff;
}

.lesson-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #fff;
}

.toc-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
}

.toc-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  padding: 17px 16px 13px;
  border-bottom: 1px solid var(--line);
}

.toc-header h2 {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 17px;
}

.toc-filter {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 10px 10px 2px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink-faint);
}

.toc-filter svg {
  width: 14px;
  height: 14px;
}

.toc-filter input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
}

.toc-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.toc-link {
  width: 100%;
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 7px;
  align-items: start;
  padding: 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
}

.toc-link:hover {
  background: var(--paper);
  color: var(--ink);
}

.toc-link.is-active {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.toc-link > span {
  padding-top: 1px;
  color: var(--ink-faint);
  font-family: var(--font-display);
  font-size: 10px;
}

.toc-link strong {
  font-size: 10px;
  font-weight: 630;
  line-height: 1.45;
}

.lesson-sequence-nav {
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border-top: 1px solid var(--line-strong);
  background: var(--paper);
}

.sequence-link {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
}

.sequence-link.next {
  justify-content: flex-end;
  text-align: right;
}

.sequence-link > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sequence-link small {
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 740;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sequence-link strong {
  max-width: 330px;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sequence-link:hover {
  color: var(--accent);
}

.back-to-course {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.back-to-course:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.search-dialog {
  width: min(700px, calc(100% - 32px));
  max-height: min(680px, calc(100dvh - 40px));
  margin: max(7vh, 30px) auto auto;
  padding: 0;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: transparent;
  box-shadow: var(--shadow);
}

.search-dialog::backdrop {
  background: rgba(13, 27, 22, 0.72);
  backdrop-filter: blur(5px);
}

.search-panel {
  overflow: hidden;
  border-radius: inherit;
  background: var(--surface);
}

.search-box {
  height: 66px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.search-box > svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: var(--ink-faint);
  stroke-linecap: round;
  stroke-width: 1.5;
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 19px;
}

.search-box input::placeholder {
  color: #9aa19d;
}

.search-close {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
}

.search-meta {
  padding: 11px 16px 6px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 730;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-results {
  max-height: min(500px, calc(100dvh - 220px));
  overflow-y: auto;
  padding: 6px 8px 10px;
}

.search-result {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 9px 10px;
  border-radius: 7px;
}

.search-result:hover,
.search-result.is-selected {
  background: var(--accent-soft);
}

.search-result-kind {
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.search-result-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.search-result-copy strong {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-copy small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 9px;
}

.search-result > svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.search-hints {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-faint);
  font-size: 9px;
}

.search-hints span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.empty-state {
  min-height: 160px;
  display: grid;
  place-content: center;
  padding: 30px;
  color: var(--ink-faint);
  text-align: center;
}

.empty-state p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
}

.empty-state small {
  margin-top: 5px;
  font-size: 10px;
}

.empty-state.compact {
  min-height: 120px;
  padding: 20px;
}

.empty-state.compact p {
  font-size: 14px;
}

.not-found {
  max-width: 720px;
  padding: 80px 0;
}

.not-found p:not(.eyebrow) {
  margin: 22px 0 28px;
  color: var(--ink-soft);
}

.toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 20px);
  padding: 10px 14px;
  border-radius: 7px;
  background: var(--forest-deep);
  color: var(--white);
  box-shadow: var(--shadow);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}

.sidebar-close.icon-button,
.toc-close.icon-button {
  display: none;
}

.noscript {
  position: fixed;
  z-index: 500;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  background: var(--paper);
  color: var(--ink);
  text-align: center;
}

@media (max-width: 1180px) {
  .page {
    width: min(100% - 46px, 1060px);
  }

  .home-intro {
    grid-template-columns: 1fr 330px;
    gap: 45px;
  }

  .lesson-stage.has-toc {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
}

@media (max-width: 1020px) {
  :root {
    --mobile-bar-height: 54px;
    --mobile-crumb-height: 42px;
  }

  .app-shell {
    display: block;
  }

  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 35;
    height: var(--mobile-bar-height);
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    padding: 0 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--forest);
    color: var(--white);
  }

  .mobile-bar .icon-button {
    color: var(--white);
  }

  .mobile-brand {
    justify-self: center;
    gap: 8px;
    min-width: 0;
  }

  .mobile-brand .brand-glyph {
    width: 28px;
    height: 28px;
    font-size: 9px;
  }

  .mobile-brand strong {
    max-width: 220px;
    overflow: hidden;
    font-family: var(--font-display);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(var(--sidebar-width), calc(100vw - 44px));
    transform: translateX(-105%);
    transition: transform 190ms ease;
  }

  .nav-open .sidebar {
    transform: translateX(0);
    box-shadow: 24px 0 70px rgba(0, 0, 0, 0.26);
  }

  .sidebar-close.icon-button {
    position: absolute;
    top: 21px;
    right: 13px;
    display: grid;
    color: var(--forest-muted);
  }

  .menu-backdrop {
    position: fixed;
    z-index: 38;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(9, 22, 18, 0.58);
  }

  .nav-open .menu-backdrop {
    display: block;
  }

  .topbar {
    top: var(--mobile-bar-height);
    height: var(--mobile-crumb-height);
    padding: 0 18px;
    background: rgba(245, 243, 237, 0.97);
  }

  .topbar-search {
    display: none;
  }

  .breadcrumbs {
    width: 100%;
    font-size: 10px;
  }

  .main-column {
    min-height: calc(100dvh - var(--mobile-bar-height));
  }

  .app-shell[data-view="lesson"] .main-column {
    height: calc(100dvh - var(--mobile-bar-height));
  }

  .app-shell[data-view="lesson"] .main-content {
    height: calc(100dvh - var(--mobile-bar-height) - var(--mobile-crumb-height));
  }

  .home-intro {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .search-launch {
    width: min(420px, 100%);
  }

  .page-hero {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .page-hero-index {
    font-size: 58px;
  }

  .course-hero {
    grid-template-columns: minmax(0, 1fr) 245px;
    gap: 35px;
  }

  .lesson-stage.has-toc {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc-mobile-button {
    display: inline-flex;
  }

  .toc-panel {
    position: fixed;
    z-index: 90;
    inset: var(--mobile-bar-height) 0 0 auto;
    width: min(380px, 92vw);
    transform: translateX(105%);
    border-left: 1px solid var(--line-strong);
    box-shadow: -20px 0 60px rgba(22, 32, 28, 0.15);
    transition: transform 190ms ease;
  }

  .toc-open .toc-panel {
    transform: translateX(0);
  }

  .toc-close.icon-button {
    display: grid;
  }
}

@media (max-width: 760px) {
  .page {
    width: calc(100% - 32px);
    padding: 38px 0 58px;
  }

  .home-intro {
    gap: 30px;
    padding: 5px 0 38px;
  }

  .home-intro h1,
  .page-hero h1,
  .course-hero h1,
  .not-found h1 {
    font-size: clamp(38px, 12vw, 54px);
    line-height: 1;
  }

  .home-intro .lede,
  .page-hero .lede,
  .course-hero .lede {
    font-size: 14px;
    line-height: 1.65;
  }

  .continue-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .continue-strip .button {
    align-self: flex-start;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }

  .section-heading > p {
    text-align: left;
  }

  .domain-ledger-row {
    display: block;
  }

  .domain-ledger-main {
    min-height: 84px;
    padding-right: 8px;
  }

  .ledger-courses {
    padding: 12px 4px 18px 49px;
    border-left: 0;
  }

  .ledger-title strong {
    font-size: 22px;
  }

  .home-bottom-grid {
    grid-template-columns: 1fr;
  }

  .principle-card,
  .recent-card {
    min-height: 0;
    padding: 22px;
  }

  .page-hero {
    display: block;
    min-height: 0;
    padding: 5px 0 42px;
  }

  .page-hero-index {
    margin-bottom: 22px;
    font-size: 48px;
  }

  .course-ledger-row > a {
    grid-template-columns: 42px minmax(0, 1fr) 32px;
    gap: 10px;
    min-height: 138px;
  }

  .course-ledger-copy h3 {
    font-size: 21px;
  }

  .course-ledger-copy > p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .course-ledger-status span,
  .course-ledger-status small {
    display: none;
  }

  .course-ledger-status svg {
    margin: 0;
  }

  .course-hero {
    display: block;
    padding-top: 4px;
  }

  .course-progress-card {
    margin-top: 28px;
  }

  .course-groups {
    gap: 42px;
    padding-top: 42px;
  }

  .lesson-group-header {
    display: block;
  }

  .lesson-group-header > p {
    margin-top: 10px;
  }

  .lesson-group.is-support {
    padding: 18px;
  }

  .lesson-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .completion-toggle,
  .material-mark {
    margin-left: 2px;
  }

  .lesson-row-link {
    grid-template-columns: 1fr auto;
    gap: 10px;
    min-height: 116px;
  }

  .lesson-row-code {
    grid-column: 1;
    margin-bottom: -3px;
  }

  .lesson-row-copy {
    grid-column: 1;
  }

  .lesson-row-arrow {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .lesson-row-copy h3 {
    font-size: 18px;
  }

  .course-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .lesson-toolbar {
    min-height: 70px;
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    padding: 10px 12px;
  }

  .lesson-course-link {
    display: none;
  }

  .lesson-identity h1 {
    max-width: calc(100vw - 40px);
    font-size: 17px;
  }

  .lesson-actions {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 1px;
  }

  .lesson-actions .button {
    min-height: 32px;
    flex: 0 0 auto;
    padding: 6px 9px;
    font-size: 9px;
  }

  .lesson-sequence-nav {
    min-height: 58px;
    grid-template-columns: 1fr auto 1fr;
    gap: 6px;
    padding: 7px 9px;
  }

  .sequence-link strong {
    max-width: 130px;
  }

  .back-to-course {
    padding: 6px;
    font-size: 0;
  }

  .back-to-course::after {
    content: "Course";
    font-size: 8px;
  }

  .search-dialog {
    width: calc(100% - 18px);
    margin-top: 10px;
  }

  .search-result {
    grid-template-columns: 55px minmax(0, 1fr) auto;
  }

  .search-hints {
    display: none;
  }
}

@media (max-width: 430px) {
  .lesson-actions .progress-action span {
    display: none;
  }

  .lesson-actions .button:last-child span {
    display: none;
  }

  .sequence-link strong {
    max-width: 95px;
  }
}

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