:root {
  color-scheme: light;
  --ink: #43302b;
  --ink-soft: #5b443d;
  --muted: #8a7969;
  --faint: #b8a994;
  --line: #e6dcc4;
  --line-strong: #d2c2a4;
  --paper: #f5efe1;
  --paper-deep: #f0e9d8;
  --surface: #fdfbf7;
  --surface-cool: #ffffff;
  --teal: #14b8a6;
  --teal-deep: #0f8f82;
  --teal-dark: #064f49;
  --blue: #2f6f8f;
  --saffron: #c9822b;
  --red: #a04f42;
  --shadow-soft: 0 24px 60px rgba(67, 48, 43, 0.1);
  --shadow-crisp: 0 1px 0 rgba(67, 48, 43, 0.1);
  --radius: 8px;
  --max: 1180px;
  --font-display: "Source Han Sans SC", "Source Han Sans CN", "思源黑体", "Noto Sans CJK SC", "Noto Sans SC", "PingFang SC", sans-serif;
  --font-body: "Source Han Sans SC", "Source Han Sans CN", "思源黑体", "Noto Sans CJK SC", "Noto Sans SC", "PingFang SC", sans-serif;
  --font-serif: "Source Han Serif SC", "Source Han Serif CN", "思源宋体", "Noto Serif CJK SC", "Noto Serif SC", "Songti SC", "SimSun", "宋体", serif;
}

* {
  box-sizing: border-box;
}

html {
  background:
    linear-gradient(rgba(190, 175, 150, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(190, 175, 150, 0.18) 1px, transparent 1px),
    var(--paper);
  background-size: 40px 40px, 40px 40px, auto;
  color: var(--ink);
  font-family: var(--font-body);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(253, 251, 247, 0.72), rgba(245, 239, 225, 0.96));
  content: "";
}

a {
  color: var(--teal-deep);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--blue);
}

:focus-visible {
  outline: 3px solid rgba(11, 97, 87, 0.32);
  outline-offset: 3px;
}

.site-shell {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(230, 220, 196, 0.92);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 780;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 900;
  box-shadow: 5px 5px 0 rgba(20, 184, 166, 0.34);
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 560;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.nav a {
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  transform: translateY(-1px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(340px, 0.78fr);
  gap: clamp(32px, 5vw, 70px);
  align-items: center;
  min-height: min(760px, calc(100vh - 75px));
  padding: clamp(46px, 7vw, 88px) 0 54px;
}

.home-hero {
  grid-template-columns: minmax(0, 0.96fr) minmax(340px, 0.84fr);
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--teal-deep);
  font-size: 13px;
  font-weight: 780;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
.display {
  margin: 0;
  max-width: 850px;
  font-family: var(--font-display);
  font-size: clamp(50px, 8vw, 110px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: 0;
  text-wrap: balance;
  overflow-wrap: break-word;
}

h1 em {
  color: var(--teal);
  font-style: italic;
  font-weight: 860;
}

.slogan {
  margin: 20px 0 0;
  color: var(--teal-deep);
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.6vw, 38px);
  font-style: italic;
  font-weight: 700;
  line-height: 1.16;
}

.lead {
  max-width: 660px;
  margin: 26px 0 0;
  color: var(--ink-soft);
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.76;
  text-wrap: pretty;
  overflow-wrap: break-word;
}

.manifesto {
  max-width: 680px;
  color: var(--ink-soft);
  font-size: clamp(14px, 1.12vw, 16px);
  font-weight: 380;
  line-height: 1.92;
}

.manifesto p {
  margin: 0;
  position: relative;
  padding-left: 18px;
}

.manifesto p::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--teal-deep);
  font-weight: 700;
}

.manifesto p + p,
.manifesto p + ul,
.manifesto ul + p {
  margin-top: 12px;
}

.manifesto ul.dot-list {
  margin: 0;
  padding-left: 18px;
  list-style: none;
}

.manifesto ul.dot-list li {
  position: relative;
  margin: 0;
  padding-left: 16px;
}

.manifesto ul.dot-list li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--teal-deep);
  font-weight: 900;
  font-size: 18px;
  line-height: 1.2;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(67, 48, 43, 0.9);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  font-weight: 760;
  text-decoration: none;
  box-shadow: var(--shadow-crisp);
  transition: background 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  background: #ffffff;
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(8, 75, 68, 0.12);
}

.button.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #143a36;
}

.button.primary:hover {
  background: #20c7b6;
  color: #143a36;
}

.quiet-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.hero-board {
  position: relative;
  min-height: 420px;
}

.workflow-visual {
  margin: 0;
  min-width: 0;
}

.workflow-window,
.loop-window {
  position: relative;
  overflow: hidden;
  min-height: 456px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(190, 175, 150, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(190, 175, 150, 0.12) 1px, transparent 1px),
    rgba(255, 255, 255, 0.86);
  background-size: 32px 32px, 32px 32px, auto;
  box-shadow: var(--shadow-soft), 0 0 0 1px rgba(67, 48, 43, 0.04);
}

.workflow-window::after,
.loop-window::after {
  position: absolute;
  right: 28px;
  bottom: 24px;
  width: 112px;
  height: 5px;
  background: var(--teal);
  content: "";
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.window-bar span {
  width: 9px;
  height: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
}

.window-bar strong {
  margin-left: auto;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.loop-window {
  min-height: 520px;
}

.loop-stage {
  position: relative;
  min-height: 468px;
  padding: 24px;
}

.loop-ring {
  position: absolute;
  inset: 76px;
  border: 2px solid rgba(20, 184, 166, 0.18);
  border-radius: 50%;
}

.loop-ring::before {
  position: absolute;
  inset: 28px;
  border: 2px dashed rgba(20, 184, 166, 0.46);
  border-radius: 50%;
  content: "";
}

.loop-arrow {
  position: absolute;
  width: 42px;
  height: 42px;
  border-top: 4px solid var(--teal);
  border-right: 4px solid var(--teal);
}

.loop-arrow.top {
  top: -19px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
}

.loop-arrow.right {
  top: 50%;
  right: -19px;
  transform: translateY(-50%) rotate(135deg);
}

.loop-arrow.bottom {
  bottom: -19px;
  left: 50%;
  transform: translateX(-50%) rotate(225deg);
}

.loop-arrow.left {
  top: 50%;
  left: -19px;
  transform: translateY(-50%) rotate(315deg);
}

.loop-card {
  position: absolute;
  width: 148px;
  min-height: 112px;
  padding: 15px;
  border: 1px solid rgba(230, 220, 196, 0.9);
  border-radius: var(--radius);
  background: rgba(253, 251, 247, 0.94);
  box-shadow: var(--shadow-soft);
}

.loop-card span {
  color: var(--teal-deep);
  font-size: 12px;
  font-weight: 860;
}

.loop-card strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.loop-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.42;
}

.loop-card.ask {
  top: 38px;
  left: calc(50% - 74px);
}

.loop-card.draft {
  top: calc(50% - 56px);
  right: 24px;
}

.loop-card.verify {
  bottom: 34px;
  left: calc(50% - 74px);
}

.loop-card.reuse {
  top: calc(50% - 56px);
  left: 24px;
}

.loop-center {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 184px;
  height: 184px;
  place-items: center;
  padding: 22px;
  border: 1px solid rgba(20, 184, 166, 0.5);
  border-radius: 50%;
  background: var(--teal-dark);
  color: var(--surface);
  text-align: center;
  transform: translate(-50%, -50%);
  box-shadow: 0 18px 52px rgba(6, 63, 58, 0.24);
}

.loop-center strong {
  display: block;
  font-size: 23px;
  line-height: 1.06;
}

.loop-center span {
  display: block;
  margin-top: 8px;
  color: rgba(253, 251, 247, 0.76);
  font-family: var(--font-body);
  font-size: 15px;
  font-style: italic;
}

.workflow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 24px;
}

.workflow-node,
.workflow-output {
  min-height: 136px;
  padding: 18px;
  border: 1px solid rgba(230, 220, 196, 0.9);
  border-radius: var(--radius);
  background: rgba(253, 251, 247, 0.88);
  box-shadow: var(--shadow-crisp);
}

.workflow-node span,
.workflow-output span,
.lesson-date {
  display: block;
  color: var(--teal-deep);
  font-size: 12px;
  font-weight: 860;
  text-transform: uppercase;
}

.workflow-node strong,
.workflow-output strong {
  display: block;
  margin-top: 12px;
  color: var(--ink);
  font-size: clamp(19px, 2.2vw, 28px);
  line-height: 1.12;
}

.workflow-node.ai {
  border-color: rgba(20, 184, 166, 0.42);
  background: rgba(20, 184, 166, 0.1);
}

.workflow-node.lawyer {
  background: rgba(240, 233, 216, 0.9);
}

.workflow-output {
  grid-column: 1 / -1;
  min-height: 126px;
  background: var(--teal-dark);
  color: var(--surface);
}

.workflow-output span,
.workflow-output strong,
.workflow-output p {
  color: var(--surface);
}

.workflow-output p {
  margin: 12px 0 0;
  line-height: 1.6;
}

.sheet-stack {
  position: absolute;
  inset: 18px 0 auto auto;
  width: min(100%, 420px);
  min-height: 360px;
  padding: 26px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: rgba(253, 251, 247, 0.9);
  box-shadow: 18px 18px 0 var(--paper-deep), var(--shadow-soft);
}

.sheet-stack::before,
.sheet-stack::after {
  position: absolute;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.86);
  content: "";
}

.sheet-stack::before {
  inset: 18px -18px -18px 18px;
  z-index: -1;
}

.sheet-stack::after {
  inset: 38px -36px -36px 38px;
  z-index: -2;
}

.sheet-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.sheet-title {
  margin: 28px 0 18px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 34px;
  line-height: 1.1;
}

.check-list,
.status-list,
.link-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li,
.status-list li,
.link-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 50px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
}

.check-list li:first-child,
.status-list li:first-child,
.link-list li:first-child {
  border-top: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(181, 118, 34, 0.35);
  border-radius: 999px;
  background: rgba(181, 118, 34, 0.08);
  color: #7b511e;
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
}

.tag.ready {
  border-color: rgba(11, 97, 87, 0.28);
  background: rgba(11, 97, 87, 0.08);
  color: var(--teal-deep);
}

.tag.pending {
  border-color: rgba(36, 79, 135, 0.28);
  background: rgba(36, 79, 135, 0.08);
  color: var(--blue);
}

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

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

.section h2,
.doc h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: 0;
}

.section p {
  color: var(--muted);
  line-height: 1.72;
  text-wrap: pretty;
}

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

.course-tile {
  min-height: 172px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

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

.about-grid p {
  margin: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.64);
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.82;
}

.course-tile strong {
  display: block;
  font-size: 18px;
}

.course-tile p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.content-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 68px);
  align-items: start;
}

.content-grid > * {
  min-width: 0;
}

.toc {
  position: sticky;
  top: 18px;
  margin-top: 34px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow-crisp);
}

.toc strong {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
}

.toc .back-link {
  display: inline-flex;
  align-items: center;
  margin: 0 0 14px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.toc .back-link:hover {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}

.toc a {
  display: block;
  min-height: 38px;
  padding: 10px 8px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.toc a:hover {
  background: var(--surface);
  color: var(--ink);
}

.toc details {
  margin-bottom: 2px;
}

.toc summary {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 10px 8px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  list-style: none;
  transition: background 160ms ease, color 160ms ease;
}

.toc summary::-webkit-details-marker {
  display: none;
}

.toc summary::before {
  content: "▸";
  display: inline-block;
  width: 14px;
  margin-right: 6px;
  font-size: 11px;
  color: var(--faint);
  transition: transform 160ms ease;
}

.toc details[open] > summary::before {
  transform: rotate(90deg);
}

.toc summary:hover {
  background: var(--surface);
  color: var(--ink);
}

.toc details > a {
  min-height: 32px;
  padding: 6px 8px 6px 28px;
  font-size: 13px;
  color: var(--muted);
}

.toc details > a:hover {
  color: var(--ink);
}

.doc {
  width: 100%;
  min-width: 0;
  padding-bottom: 84px;
}

.doc-hero {
  padding: 58px 0 42px;
}

.doc h1 {
  font-size: clamp(42px, 7vw, 82px);
}

.compact-hero {
  /* spacing only — no min-height, so titles don't leave a blank gap below */
}

.doc .lead {
  max-width: 760px;
}

.profile-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
  padding: 56px 0 84px;
}

.profile-card {
  min-width: 0;
}

.profile-avatar {
  display: block;
  width: min(100%, 290px);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  object-fit: cover;
  box-shadow: var(--shadow-soft);
}

.profile-card h1 {
  margin-top: 24px;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1;
}

.profile-handle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 22px;
  font-weight: 360;
}

.profile-bio {
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.55;
}

.profile-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.social-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-crisp);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.social-logo:hover {
  border-color: rgba(20, 184, 166, 0.55);
  background: var(--surface);
  color: var(--ink);
  transform: translateY(-1px);
}

.social-logo svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.xhs-logo span {
  color: #c7352f;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.profile-readme {
  min-width: 0;
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-crisp);
}

.readme-path {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
}

.profile-readme h2 {
  margin: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.08;
}

.profile-readme h3 {
  margin: 32px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 25px;
}

.profile-readme p,
.profile-readme li {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.72;
}

.profile-readme ul {
  margin: 0;
  padding-left: 22px;
}

.prep-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.prep-step {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.64);
}

.prep-step span {
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.prep-step strong {
  display: block;
  margin-top: 10px;
  font-size: 17px;
}

.prep-step p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.62;
}

.doc section:not(.doc-hero) {
  padding: 46px 0;
  border-top: 1px solid var(--line);
}

.doc h3 {
  margin: 34px 0 14px;
  font-size: 21px;
  line-height: 1.28;
}

.doc h4 {
  margin: 24px 0 10px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-soft);
}

.doc h3 small {
  margin-left: 8px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.doc p {
  color: var(--ink-soft);
  line-height: 1.74;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.doc table {
  display: table;
  width: 100%;
  table-layout: fixed;
  margin: 16px 0 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-spacing: 0;
  background: var(--surface);
  box-shadow: var(--shadow-crisp);
}

.doc table-wrap {
  display: block;
  width: 100%;
  margin: 16px 0 32px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-crisp);
}

.doc table-wrap > table {
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.doc tbody,
.doc thead,
.doc tr {
  width: 100%;
}

.doc table table {
  display: table;
}

.doc th,
.doc td {
  min-width: 150px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.doc table th:first-child,
.doc table td:first-child {
  width: 130px;
  white-space: nowrap;
}

.doc th {
  background: rgba(20, 184, 166, 0.1);
  color: var(--teal-deep);
  font-size: 14px;
}

.doc td {
  background: rgba(255, 255, 255, 0.62);
}

.doc tr:last-child td {
  border-bottom: 0;
}

.doc code {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper-deep);
  color: var(--red);
  font-family: "SFMono-Regular", Consolas, monospace;
}

.doc pre {
  margin: 16px 0 28px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-deep);
  overflow-x: auto;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
  line-height: 1.65;
}

.doc pre code {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: inherit;
  font-family: inherit;
  white-space: pre;
}

/* Enhanced code block: dark terminal look with language label + copy button. */
.code-block {
  margin: 16px 0 28px;
  border: 1px solid #1f1d1a;
  border-radius: var(--radius);
  background: #1a1814;
  box-shadow: var(--shadow-crisp);
  overflow: hidden;
}

.code-block > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 8px 18px;
  border-bottom: 1px solid #2c2820;
  background: #221f1a;
}

.code-block .code-lang {
  font-family: "Courier New", "Courier", "Lucida Console", Monaco, monospace;
  font-size: 11px;
  font-weight: 700;
  color: #c9b88a;
  text-transform: lowercase;
  letter-spacing: 0.6px;
}

.code-block .code-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid #3a342a;
  border-radius: 5px;
  color: #b8a994;
  font-family: "Courier New", "Courier", "Lucida Console", Monaco, monospace;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.code-block .code-copy:hover {
  background: #2c2820;
  color: #fdfbf7;
  border-color: #5b443d;
}

.code-block .code-copy.copied {
  color: #14b8a6;
  border-color: #14b8a6;
}

.code-block pre {
  margin: 0;
  padding: 18px 20px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  font-family: "Courier New", "Courier", "Lucida Console", Monaco, monospace;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.7;
  color: #f0e6d2;
  letter-spacing: 0.2px;
  white-space: pre;
  overflow-x: auto;
}

.code-block pre code {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  white-space: pre;
}
  font-size: 0.92em;
}

.callout {
  margin: 26px 0 0;
  padding: 20px;
  border: 1px solid rgba(20, 184, 166, 0.28);
  border-radius: var(--radius);
  background: rgba(20, 184, 166, 0.1);
  color: #145d57;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.resource-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.44fr);
  gap: 18px;
  align-items: stretch;
  margin-top: 20px;
}

.resource-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.64);
}

.book-layout {
  grid-template-columns: 260px minmax(0, 1fr);
}

.course-book .doc-hero {
  padding-bottom: 16px;
}

.lesson-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.lesson-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 96px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.lesson-row:hover {
  border-color: rgba(20, 184, 166, 0.55);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  transform: translateY(-1px);
}

.lesson-main strong {
  display: block;
  font-size: 19px;
}

.lesson-main small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.5;
}

.lesson-link {
  color: var(--teal-deep);
  font-size: 14px;
  font-weight: 820;
}

.skill-table {
  display: grid;
  gap: 0;
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
}

.skill-row {
  display: grid;
  grid-template-columns: minmax(132px, 0.8fr) minmax(220px, 1.35fr) minmax(96px, 0.58fr) minmax(220px, 1.2fr);
  border-top: 1px solid var(--line);
}

.skill-row:first-child {
  border-top: 0;
}

.skill-row span {
  min-width: 0;
  padding: 16px;
  border-left: 1px solid var(--line);
  color: var(--ink-soft);
  line-height: 1.56;
  overflow-wrap: anywhere;
}

.skill-row span:first-child {
  border-left: 0;
}

.skill-row strong {
  color: var(--ink);
}

.skill-head {
  background: rgba(20, 184, 166, 0.1);
}

.skill-head span {
  color: var(--teal-deep);
  font-size: 13px;
  font-weight: 860;
}

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

.tool-card {
  display: grid;
  gap: 10px;
  min-height: 132px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-crisp);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.tool-card:hover {
  border-color: rgba(20, 184, 166, 0.5);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  transform: translateY(-1px);
}

.tool-card strong {
  font-size: 20px;
}

.tool-card span {
  color: var(--muted);
  line-height: 1.58;
}

.tool-card.is-link {
  gap: 8px;
  min-height: auto;
  padding: 18px 20px;
}

.tool-card.is-link strong {
  font-size: 16px;
}

.tool-card.is-link span {
  font-size: 13px;
  line-height: 1.5;
}

.tool-card.is-link code {
  font-size: 11px;
  color: var(--ink-soft);
  word-break: break-all;
}

.tool-grid.is-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.muted-placeholder {
  color: var(--muted);
  font-size: 14px;
  padding: 12px 4px;
}

.resource-panel h3 {
  margin-top: 0;
}

.agent-course .doc-hero {
  position: relative;
}

.agent-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 0.62fr);
  gap: clamp(28px, 5vw, 58px);
  align-items: center;
}

.agent-hero .eyebrow,
.agent-hero h1,
.agent-hero .lead {
  grid-column: 1;
}

.agent-hero-board {
  grid-column: 2;
  grid-row: 1 / span 3;
  display: grid;
  gap: 16px;
  min-height: 420px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(190, 175, 150, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(190, 175, 150, 0.12) 1px, transparent 1px),
    rgba(255, 255, 255, 0.82);
  background-size: 32px 32px, 32px 32px, auto;
  box-shadow: var(--shadow-soft);
}

.context-stack {
  display: grid;
  gap: 8px;
}

.context-stack span,
.answer-card,
.model-core {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(253, 251, 247, 0.92);
  box-shadow: var(--shadow-crisp);
}

.context-stack span {
  display: block;
  padding: 12px 14px;
  color: var(--ink-soft);
  font-weight: 760;
}

.model-core {
  display: grid;
  place-items: center;
  min-height: 132px;
  border-color: rgba(20, 184, 166, 0.46);
  background: var(--teal-dark);
  color: var(--surface);
}

.model-core strong {
  font-size: clamp(38px, 6vw, 70px);
  line-height: 0.9;
}

.model-core small {
  color: rgba(253, 251, 247, 0.74);
  font-family: var(--font-serif);
  font-size: 18px;
  font-style: italic;
}

.answer-card {
  padding: 18px;
  background: rgba(20, 184, 166, 0.1);
}

.answer-card span {
  color: var(--teal-deep);
  font-size: 12px;
  font-weight: 860;
  text-transform: uppercase;
}

.answer-card strong {
  display: block;
  margin-top: 10px;
  font-size: 26px;
}

.stage-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.stage-card {
  display: flex;
  flex-direction: column;
  min-height: 310px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow-crisp);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.stage-card:hover {
  border-color: rgba(20, 184, 166, 0.5);
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
}

.stage-card span {
  color: var(--teal-deep);
  font-size: 13px;
  font-weight: 900;
}

.stage-card h3 {
  margin-top: 18px;
  font-size: clamp(22px, 2.4vw, 30px);
}

.stage-card p {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.7;
}

.stage-card strong {
  display: block;
  margin-top: auto;
  padding-top: 18px;
  color: var(--teal-deep);
  font-size: 14px;
}

.flow-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(145px, 1fr));
  gap: 10px;
  margin-top: 24px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.flow-strip div {
  position: relative;
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(253, 251, 247, 0.88);
}

.flow-strip div:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: -10px;
  width: 10px;
  height: 2px;
  background: var(--teal);
  content: "";
}

.flow-strip span,
.formula-card span {
  display: block;
  color: var(--teal-deep);
  font-size: 12px;
  font-weight: 860;
  text-transform: uppercase;
}

.flow-strip strong {
  display: block;
  margin-top: 18px;
  font-size: 18px;
  line-height: 1.2;
}

.split-note {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.split-note > div,
.formula-card,
.skill-compare > div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow-crisp);
}

.split-note > div {
  padding: 22px;
}

.split-note h3 {
  margin-top: 0;
}

.skill-compare {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.skill-compare > div {
  min-height: 126px;
  padding: 18px;
}

.skill-compare strong,
.skill-compare span {
  display: block;
}

.skill-compare span {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.formula-card {
  margin-top: 24px;
  padding: 28px;
  background: var(--teal-dark);
  color: var(--surface);
}

.formula-card span,
.formula-card p {
  color: rgba(253, 251, 247, 0.76);
}

.formula-card strong {
  display: block;
  margin-top: 10px;
  color: var(--surface);
  font-size: clamp(34px, 6vw, 68px);
  line-height: 0.95;
}

.harness-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.harness-grid span {
  min-height: 72px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink-soft);
  font-weight: 760;
}

.essence-table {
  display: grid;
  overflow: hidden;
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
}

.essence-table div {
  display: grid;
  grid-template-columns: minmax(170px, 0.36fr) minmax(0, 1fr);
  border-top: 1px solid var(--line);
}

.essence-table div:first-child {
  border-top: 0;
}

.essence-table strong,
.essence-table span {
  padding: 16px;
  line-height: 1.6;
}

.essence-table strong {
  color: var(--ink);
}

.essence-table span {
  border-left: 1px solid var(--line);
  color: var(--ink-soft);
}

.source-hero {
  padding: 58px 0 30px;
}

.source-hero .lead {
  max-width: 760px;
}

.source-content {
  padding-bottom: 84px;
}

.source-content h2 {
  margin-top: 54px;
  padding-top: 46px;
  border-top: 1px solid var(--line);
}

.source-content h3 {
  margin-top: 34px;
}

.source-content blockquote {
  margin: 24px 0;
  padding: 22px;
  border: 1px solid rgba(20, 184, 166, 0.28);
  border-radius: var(--radius);
  background: rgba(20, 184, 166, 0.08);
  color: #145d57;
}

.source-content blockquote p {
  margin: 0;
  color: inherit;
}

.source-content ul,
.source-content ol {
  margin: 16px 0 26px;
  padding-left: 24px;
  color: var(--ink-soft);
  line-height: 1.75;
}

.source-content li + li {
  margin-top: 6px;
}

.screenshot-ref {
  margin: 16px 0 28px;
  padding: 16px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

.screenshot-ref strong {
  display: block;
  color: var(--teal-deep);
  font-size: 13px;
}

.screenshot-ref p {
  margin: 8px 0 0;
}

.screenshot-ref code {
  word-break: break-all;
}

.course-figure {
  margin: 16px 0 30px;
}

.course-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-crisp);
}

.source-content .wiki-ref {
  color: var(--muted);
}

.source-content a {
  overflow-wrap: anywhere;
}

.source-content .table-wrap {
  width: 100%;
  margin: 18px 0 30px;
  overflow-x: auto;
  overflow-y: hidden;
  contain: paint;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-crisp);
}

.source-content .table-wrap table {
  min-width: 760px;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.source-content .table-wrap th:first-child,
.source-content .table-wrap td:first-child {
  white-space: normal;
}

.sequence-expand,
.sequence-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 26px;
  font-weight: 360;
  cursor: pointer;
  box-shadow: none;
  opacity: 0.78;
  transition: color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.sequence-expand:hover,
.sequence-modal-close:hover {
  color: var(--teal-deep);
  opacity: 1;
  transform: translateY(-1px);
}

.sequence-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 18px 0 34px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 0 14px;
  border-bottom: 1px solid rgba(230, 220, 196, 0.9);
}

.sequence-expand {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
}

.sequence-expand {
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 6px 1.25px no-repeat,
    linear-gradient(currentColor, currentColor) 0 0 / 1.25px 6px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 0 / 6px 1.25px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 0 / 1.25px 6px no-repeat,
    linear-gradient(currentColor, currentColor) 0 100% / 6px 1.25px no-repeat,
    linear-gradient(currentColor, currentColor) 0 100% / 1.25px 6px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 100% / 6px 1.25px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 100% / 1.25px 6px no-repeat;
}

.sequence-expand::after {
  position: absolute;
  content: "";
}

.sequence-expand::before {
  width: 10px;
  height: 10px;
  border: 1.25px solid currentColor;
  border-radius: 3px;
  content: "";
}

.sequence-expand::after {
  display: none;
}

.sequence-wrap > div {
  width: max-content;
  max-width: none;
  min-width: 100%;
  margin-top: 0 !important;
  box-shadow: var(--shadow-soft);
  transform-origin: top left;
  zoom: 0.74;
}

.sequence-wrap svg[style*="right:-92px"] {
  right: -68px !important;
  width: 68px !important;
}

.sequence-wrap svg[style*="left:-92px"] {
  left: -68px !important;
  width: 68px !important;
}

.sequence-wrap span[style*="left:-42px"] {
  left: -24px !important;
  width: 24px !important;
}

.sequence-wrap span[style*="right:-42px"] {
  right: -24px !important;
  width: 24px !important;
}

.sequence-wrap h4 {
  font-size: 16px !important;
}

.sequence-wrap div[style*="font-size:18px"] {
  font-size: 15px !important;
}

.sequence-wrap div[style*="font-size:30px"] {
  width: 44px !important;
  height: 44px !important;
  font-size: 22px !important;
}

.sequence-wrap div[style*="padding:18px 22px"],
.sequence-wrap div[style*="padding:16px"] {
  padding: 14px 18px !important;
}

.sequence-modal[hidden] {
  display: none;
}

.sequence-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(67, 48, 43, 0.48);
}

.sequence-modal-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(96vw, 1540px);
  height: min(92vh, 980px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.sequence-modal-close {
  justify-self: end;
  margin: 12px 12px 0 0;
  font-size: 30px;
  line-height: 1;
}

.sequence-modal-stage {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 14px 18px 22px;
}

.sequence-modal-content {
  width: max-content;
  min-width: 100%;
  margin: 0 !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: var(--surface) !important;
  box-shadow: none !important;
}

.sequence-modal-content svg[style*="right:-92px"] {
  right: -68px !important;
  width: 68px !important;
}

.sequence-modal-content svg[style*="left:-92px"] {
  left: -68px !important;
  width: 68px !important;
}

.sequence-modal-content span[style*="left:-42px"] {
  left: -24px !important;
  width: 24px !important;
}

.sequence-modal-content span[style*="right:-42px"] {
  right: -24px !important;
  width: 24px !important;
}

body.has-sequence-modal {
  overflow: hidden;
}

.sequence-wrap::-webkit-scrollbar {
  height: 10px;
}

.sequence-wrap::-webkit-scrollbar-track {
  background: rgba(240, 233, 216, 0.9);
}

.sequence-wrap::-webkit-scrollbar-thumb {
  border: 2px solid rgba(240, 233, 216, 0.9);
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.72);
}

.footer {
  padding: 30px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

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

@media (max-width: 900px) {
  .hero,
  .content-grid,
  .book-layout,
  .profile-layout,
  .resource-band {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-board {
    min-height: 390px;
  }

  .sheet-stack {
    position: relative;
    inset: auto;
    width: calc(100% - 28px);
  }

  .course-strip,
  .prep-grid,
  .about-grid,
  .tool-grid,
  .tool-grid.is-3,
  .source-hero-grid,
  .agent-hero,
  .stage-map,
  .split-note,
  .skill-compare,
  .harness-grid {
    grid-template-columns: 1fr;
  }

  .agent-hero .eyebrow,
  .agent-hero h1,
  .agent-hero .lead,
  .agent-hero-board {
    grid-column: 1;
    grid-row: auto;
  }

  .toc {
    position: static;
    margin-top: 0;
  }

  .profile-layout {
    padding-top: 36px;
  }

  .profile-avatar {
    width: 220px;
  }

  .workflow-window {
    min-height: auto;
  }

  .loop-window {
    min-height: 640px;
  }

  .loop-stage {
    min-height: 588px;
  }

  .loop-ring {
    inset: 120px 52px;
  }

  .loop-card.ask,
  .loop-card.verify {
    left: calc(50% - 74px);
  }

  .loop-card.draft {
    right: 12px;
  }

  .loop-card.reuse {
    left: 12px;
  }

  .skill-table {
    border: 0;
    background: transparent;
    gap: 12px;
    overflow: visible;
  }

  .skill-row,
  .skill-head {
    display: grid;
    grid-template-columns: 1fr;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.68);
    overflow: hidden;
  }

  .skill-head {
    display: none;
  }

  .skill-row span {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .skill-row span:first-child {
    border-top: 0;
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: min(100% - 24px, var(--max));
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav a {
    white-space: nowrap;
  }

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

  .button,
  .quiet-link {
    width: 100%;
  }

  .sheet-stack {
    min-height: 330px;
    padding: 20px;
  }

  .sheet-title {
    font-size: 28px;
  }

  .doc-hero {
    min-height: auto;
    padding-top: 40px;
  }

  .content-grid,
  .doc,
  .doc section,
  .callout,
  .resource-band,
  .resource-panel,
  .prep-step {
    max-width: 100%;
  }

  .doc .lead,
  .doc p,
  .doc pre,
  .callout,
  .source-content,
  .source-content .table-wrap,
  .code-block,
  .code-block pre,
  .agent-hero-board,
  .stage-map,
  .stage-card,
  .flow-strip,
  .split-note,
  .skill-compare,
  .formula-card,
  .harness-grid,
  .essence-table,
  .prep-grid,
  .prep-step,
  .resource-band,
  .resource-panel,
  .about-grid,
  .about-grid p,
  .workflow-visual,
  .workflow-window,
  .loop-window,
  .lesson-list,
  .lesson-row,
  .skill-table,
  .skill-row,
  .tool-grid,
  .tool-card,
  .profile-layout,
  .profile-card,
  .profile-readme {
    width: min(100%, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
  }

  h1,
  .display,
  .doc h1 {
    font-size: 38px;
    line-height: 1.04;
    text-wrap: pretty;
  }

  .doc th,
  .doc td {
    min-width: 170px;
  }

  .source-content .table-wrap table {
    min-width: 100%;
    table-layout: fixed;
  }

  .source-content .table-wrap th,
  .source-content .table-wrap td {
    min-width: 0;
    white-space: normal;
  }

  .doc pre code,
  .code-block pre code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .workflow-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .workflow-output {
    grid-column: auto;
  }

  .window-bar strong {
    display: none;
  }

  .loop-stage {
    min-height: 620px;
    padding: 16px;
  }

  .loop-ring {
    inset: 132px 38px;
  }

  .loop-center {
    width: 154px;
    height: 154px;
  }

  .loop-center strong {
    font-size: 19px;
  }

  .loop-card {
    width: 128px;
    min-height: 108px;
    padding: 13px;
  }

  .loop-card strong {
    font-size: 21px;
  }

  .loop-card.draft {
    right: 8px;
  }

  .loop-card.reuse {
    left: 8px;
  }

  .profile-readme {
    padding: 22px 18px;
  }

  .lesson-row {
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: start;
  }

  .agent-hero-board {
    min-height: auto;
    padding: 18px;
  }

  .stage-card {
    min-height: auto;
  }

  .essence-table div {
    grid-template-columns: 1fr;
  }

  .essence-table span {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}
