html:has(.lecture-page) {
  scroll-padding-top: 76px;
  scroll-padding-bottom: 120px;
}

.lecture-page .nav-links a[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 0 -1px 0 var(--ink);
}

.lx-chapter {
  min-height: calc(100svh - 76px);
  scroll-margin-top: 76px;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  padding: clamp(28px, 4vh, 64px) 0 140px;
  border-top: 1px solid var(--line);
}
.lx-chapter:first-child { border-top: 0; }
.lx-chapter.is-well { background: var(--well); border-top-color: transparent; }
.contact.lx-chapter { border-top: 0; justify-content: flex-start; }

.lx-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: clamp(28px, 4vw, 72px);
  align-items: center;
}
.lx-hero .eyebrow.eyebrow-serif { font-family: var(--logo); font-weight: 400; }
.lx-hero .lede {
  font-family: var(--serif);
  line-height: 1.8;
  letter-spacing: -0.02em;
}

.lx-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}
.lx-tags li {
  padding: 8px 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
}
.lx-keys { white-space: nowrap; }

.lx-agenda { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.lx-agenda a {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 4px 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.lx-agenda a span { color: var(--muted); font-size: 13px; font-weight: 500; }
.lx-agenda a strong {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.03em;
}
.lx-agenda a small { grid-column: 2; color: var(--muted); font-size: 14px; line-height: 1.5; }
.lx-agenda a:hover strong { text-decoration: underline; text-underline-offset: 4px; }

.lx-note { margin: 18px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.lx-note strong { color: var(--ink); font-weight: 600; }

.lx-rows { border-top: 1px solid var(--ink); }
.lx-rows article {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.lx-rows .lx-idx { color: var(--muted); font-size: 13px; font-weight: 500; }
.lx-rows h3 { margin: 0 0 4px; font-size: 22px; line-height: 1.4; }
.lx-rows p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.6; }

.lx-steps, .lx-tri {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--ink);
}
.lx-steps article, .lx-tri article { padding: 22px 28px 8px 0; }
.lx-steps article + article, .lx-tri article + article {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}
.lx-steps small, .lx-kicker {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.lx-kicker {
  font-family: var(--logo);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink);
}
.lx-steps h3, .lx-tri h3 { margin: 0 0 8px; font-size: 28px; line-height: 1.35; }
.lx-steps p, .lx-tri p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.6; }

.lx-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 40px);
}
.lx-pair > article { border-top: 1px solid var(--ink); padding-top: 20px; }
.lx-pair h3 { margin: 0 0 12px; font-size: 28px; line-height: 1.35; }
.lx-pair > article > p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.7; }

.lx-bubbles { display: grid; gap: 12px; }
.lx-bubble {
  margin: 0;
  padding: 22px 24px;
  background: var(--well);
  font-family: var(--serif);
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.45;
  letter-spacing: -0.03em;
}
.is-well .lx-bubble { background: var(--paper); }

.lx-browser { background: var(--paper); border: 1px solid var(--line); }
.lx-browser-bar {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px 8px 46px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  background:
    radial-gradient(circle at 16px 50%, var(--line) 3px, transparent 3.5px),
    radial-gradient(circle at 28px 50%, var(--line) 3px, transparent 3.5px),
    radial-gradient(circle at 40px 50%, var(--line) 3px, transparent 3.5px);
}
.lx-browser-body { padding: 22px 20px 8px; }
.lx-browser-body h3 { margin: 0 0 8px; font-size: 28px; line-height: 1.35; }
.lx-browser-body p { margin: 0 0 12px; color: var(--muted); }
.lx-poster {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 180px;
  margin-bottom: 16px;
  padding: 28px;
  text-align: center;
  background: var(--well);
}
.lx-poster b {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.03em;
}
.lx-poster span { color: var(--muted); font-size: 14px; }
.lx-code {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.lx-code code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--forest);
}
.lx-code small { display: block; margin-top: 2px; color: var(--muted); font-family: var(--sans); font-size: 13px; }
.lx-point { padding: 14px 0; border-top: 1px solid var(--line); }
.lx-point strong { display: block; font-weight: 600; }
.lx-point small { color: var(--muted); font-size: 13px; }
.lx-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lx-query { padding: 12px 14px; background: var(--well); font-size: 15px; }
.lx-result { padding-top: 14px; }
.lx-result b { font-family: var(--serif); font-size: 22px; font-weight: 400; }
.lx-tag {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.lx-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.lx-pill {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}
.lx-pill[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }

.lx-trust {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 28px;
  align-items: center;
}
.lx-trust-mark {
  display: grid;
  place-items: center;
  width: 160px;
  height: 160px;
  margin: 0;
  border: 1px solid var(--ink);
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: -0.03em;
}
.lx-trust ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink);
}
.lx-trust li {
  padding: 18px 16px 18px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.4;
}

.lx-table-wrap { overflow-x: auto; border-top: 1px solid var(--ink); }
.lx-table { width: 100%; min-width: 640px; border-collapse: collapse; }
.lx-table th, .lx-table td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
}
.lx-table th { color: var(--muted); font-size: 13px; font-weight: 500; }
.lx-status { color: var(--forest); font-weight: 600; }
.lx-status.is-pending { color: #8a5a2a; }

.lx-meta { margin: 0 0 12px; color: var(--muted); font-size: 13px; font-weight: 500; }
.lx-question {
  margin: 0;
  max-width: 18em;
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.4;
  letter-spacing: -0.03em;
}
.lx-choices { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.lx-choice {
  min-width: 112px;
  min-height: 88px;
  border: 1px solid var(--ink);
  background: transparent;
  font-family: var(--serif);
  font-size: 36px;
}
.lx-choice[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.lx-quiz-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.lx-quiz-actions .btn:not(.btn-secondary)::after { content: "→"; font-weight: 400; }
.lx-meter { height: 2px; margin-top: 22px; background: var(--line); }
.lx-meter span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--ink);
  transform: scaleX(var(--lx-meter, 0));
  transform-origin: left;
}
.lx-answer { padding: 18px 0 18px 16px; border-bottom: 1px solid var(--line); }
.lx-answer.is-right { box-shadow: inset 3px 0 0 var(--forest); }
.lx-answer.is-wrong { box-shadow: inset 3px 0 0 #8a5a2a; }
.lx-answer h3 { margin: 0 0 8px; font-size: 20px; line-height: 1.45; }
.lx-answer p { margin: 0 0 6px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.lx-answer .lx-answer-result { color: var(--ink); font-weight: 600; }

.lx-audit { border-top: 1px solid var(--ink); }
.lx-audit article { padding: 20px 0; border-bottom: 1px solid var(--line); }
.lx-audit h3 { margin: 0 0 6px; font-size: 22px; line-height: 1.4; }
.lx-audit p { margin: 0 0 12px; color: var(--muted); }
.lx-audit-options { display: flex; flex-wrap: wrap; gap: 8px; }
.lx-audit-options button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: transparent;
}
.lx-audit-options button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.lx-result-line { margin-top: 18px; font-weight: 600; }

.lx-plan {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr 0.7fr;
  gap: 18px;
}
.lx-plan label { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 500; }
.lx-plan input {
  width: 100%;
  min-height: 48px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
}
.lx-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
button:disabled { opacity: 0.38; cursor: not-allowed; }

.lx-sources { margin: 28px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.lx-sources a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.lx-sources a::after { content: "↗"; color: var(--muted); }

.lx-bridge { margin-top: 8px; }
.lx-stat {
  margin: 8px 0 4px;
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.lx-brief {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
}
.lecture-page .plan-index { margin-top: 28px; }
.lecture-page .site-footer { padding-bottom: 108px; }

.lx-dock {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 45;
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.lx-dock-progress { height: 2px; background: var(--line); }
.lx-dock-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--ink);
  transform: scaleX(var(--lx-progress, 0));
  transform-origin: left;
}
.lx-dock-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
}
.lx-dock button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  background: transparent;
}
.lx-dock .is-primary { background: var(--ink); color: var(--paper); }
.lx-dock-status {
  display: flex;
  flex: 1;
  gap: 12px;
  align-items: baseline;
  min-width: 0;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.lx-dock-status strong { font-weight: 500; }
.lx-dock-title {
  overflow: hidden;
  color: var(--muted);
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lx-toc {
  position: fixed;
  top: 76px;
  right: 0;
  bottom: 66px;
  left: 0;
  z-index: 44;
  overflow: auto;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--line);
}
.lx-toc a {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  width: min(var(--max), calc(100% - clamp(32px, 6vw, 96px)));
  margin: 0 auto;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.lx-toc a.is-current { color: var(--ink); font-weight: 700; }

.lx-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html:has(.lecture-page) { scroll-behavior: auto; scroll-snap-type: none; }
  .lx-dock-progress span, .lx-meter span { transition: none; }
}

@media (max-width: 980px) {
  .lx-hero, .lx-split, .lx-pair, .lx-trust, .lx-plan { grid-template-columns: 1fr; }
  .lx-steps, .lx-tri { grid-template-columns: 1fr; }
  .lx-steps article + article, .lx-tri article + article {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .lx-compare { grid-template-columns: 1fr; }
  .lx-trust-mark { width: 96px; height: 96px; font-size: 22px; }
}

@media (max-width: 760px) {
  html:has(.lecture-page) { scroll-padding-top: 64px; }
  .lecture-page .nav-links a[aria-current="page"] { box-shadow: none; border-bottom-color: var(--ink); }
  .lx-chapter { justify-content: flex-start; }
  .lx-chapter { scroll-margin-top: 64px; min-height: calc(100svh - 64px); }
  .lx-toc { top: 64px; }
  .lx-fullscreen, .lx-dock-title { display: none; }
  .lx-trust ul, .lx-rows article { grid-template-columns: 1fr; }
  .lx-rows .lx-idx { grid-column: 1; }
  .lecture-page .site-footer { padding-bottom: 108px; }
}

@media print {
  .lx-dock, .lx-toc, .site-header, .menu-toggle { display: none !important; }
  .lx-chapter { min-height: 0; padding-bottom: 24px; break-inside: avoid; }
  .lecture-page .site-footer { padding-bottom: 0; }
}
