:root {
  color-scheme: light;
  --bg: #f4efe4;
  --bg-strong: #e7ddca;
  --paper: rgba(255, 251, 245, 0.84);
  --paper-strong: rgba(255, 248, 239, 0.95);
  --ink: #172126;
  --muted: #52606a;
  --line: rgba(23, 33, 38, 0.14);
  --line-strong: rgba(23, 33, 38, 0.24);
  --accent: #0c6b63;
  --accent-strong: #094f49;
  --accent-soft: rgba(12, 107, 99, 0.12);
  --highlight: #bc5d1f;
  --shadow: 0 18px 60px rgba(23, 33, 38, 0.12);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --radius-control: 8px;
  --radius-panel: 10px;
  --page-width: 1180px;
  --body-font: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  --display-font: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --mono-font: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body-font);
  background:
    radial-gradient(circle at top left, rgba(12, 107, 99, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(188, 93, 31, 0.14), transparent 24%),
    linear-gradient(180deg, #f7f1e7 0%, #efe7d8 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(23, 33, 38, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 33, 38, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 85%);
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

code,
pre {
  font-family: var(--mono-font);
}

.site-shell {
  width: min(var(--page-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
  position: relative;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-header {
  margin-bottom: 32px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 243, 0.62);
  backdrop-filter: blur(12px);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  text-decoration: none;
}

.brand-mark {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(12, 107, 99, 0.9), rgba(188, 93, 31, 0.85));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-copy strong,
.brand-copy span {
  display: block;
}

.brand-copy strong {
  font-size: 0.95rem;
}

.brand-copy span {
  font-size: 0.78rem;
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.94rem;
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 999px;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
  transform: translateY(-1px);
}

.hero,
.page-hero,
.status-panel,
.section-card,
.topic-card,
.path-card,
.entry-card,
.status-card,
.resource-card,
.term-card,
.formula-card,
.timeline-card,
.trap-card,
.metric-card,
.chapter-nav,
.spotlight-card {
  border: 1px solid var(--line);
  background: var(--paper);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.hero,
.page-hero {
  border-radius: var(--radius-lg);
  padding: 34px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  font-weight: 700;
}

.hero-grid,
.page-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.9fr);
  gap: 26px;
  align-items: start;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display-font);
  line-height: 0.98;
  font-weight: 700;
}

h1 {
  font-size: clamp(3rem, 7vw, 5.8rem);
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: -0.03em;
}

h3 {
  font-size: 1.28rem;
  line-height: 1.15;
}

.lede,
.section-intro,
.page-hero-copy p,
.hero-copy p,
.section-card p,
.topic-card p,
.entry-card p,
.status-card p,
.resource-card p,
.trap-card p,
.spotlight-card p {
  color: var(--muted);
  line-height: 1.75;
}

.hero-actions,
.section-actions,
.page-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
}

.button {
  background: var(--accent);
  color: #fff;
}

.button:hover {
  background: var(--accent-strong);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.55);
  border-color: var(--line);
  color: var(--ink);
}

button.button,
button.ghost-button {
  cursor: pointer;
  font: inherit;
}

button.button:disabled,
button.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.hero-rail,
.chapter-nav,
.status-panel,
.formula-card,
.timeline-card {
  border-radius: var(--radius-md);
  padding: 24px;
}

.hero-rail ol,
.chapter-nav ol,
.checklist,
.mini-list,
.topic-points,
.resource-list,
.link-list {
  margin: 0;
  padding-left: 18px;
}

.hero-rail li,
.chapter-nav li,
.checklist li,
.mini-list li,
.topic-points li,
.resource-list li,
.link-list li {
  color: var(--muted);
  line-height: 1.7;
  margin-top: 8px;
}

.hero-rail li:first-child,
.chapter-nav li:first-child,
.checklist li:first-child,
.mini-list li:first-child,
.topic-points li:first-child,
.resource-list li:first-child,
.link-list li:first-child {
  margin-top: 0;
}

.strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.entry-card,
.topic-card,
.path-card,
.status-card,
.resource-card,
.term-card,
.spotlight-card,
.trap-card,
.metric-card,
.section-card {
  border-radius: var(--radius-md);
  padding: 22px;
}

.entry-card strong,
.metric-card strong {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--highlight);
  margin-bottom: 10px;
}

.section {
  margin-top: 28px;
}

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

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

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

.topic-card {
  position: relative;
  overflow: hidden;
}

.topic-card::after {
  content: "";
  position: absolute;
  inset: auto -30px -30px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(12, 107, 99, 0.16), transparent 70%);
}

.topic-topline,
.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.module-id,
.badge,
.difficulty {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.module-id,
.badge {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.difficulty {
  background: rgba(188, 93, 31, 0.12);
  color: #964815;
}

.chip-row,
.term-grid,
.metric-grid,
.resource-grid {
  display: grid;
  gap: 14px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  font-size: 0.9rem;
}

.term-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.term-card h3,
.metric-card h3,
.resource-card h3,
.trap-card h3,
.spotlight-card h3 {
  margin-bottom: 10px;
}

.term-card p,
.metric-card p {
  margin: 0;
}

.page-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.chapter-nav {
  position: sticky;
  top: 24px;
  align-self: start;
}

.chapter-nav p {
  margin: 0 0 14px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.content-stack {
  display: grid;
  gap: 18px;
}

body.playbook-page {
  --playbook-bg: #ffffff;
  --playbook-ink: #111111;
  --playbook-ink-soft: rgba(23, 33, 38, 0.78);
  --playbook-ink-muted: rgba(23, 33, 38, 0.62);
  --playbook-line: rgba(23, 33, 38, 0.12);
  --playbook-line-soft: rgba(23, 33, 38, 0.1);
  --playbook-line-faint: rgba(23, 33, 38, 0.08);
  --playbook-surface: #ffffff;
  --playbook-surface-soft: #fafafa;
  --playbook-chip-bg: #ffffff;
  --playbook-chip-ink: rgba(23, 33, 38, 0.68);
  --playbook-status: #111111;
  --playbook-status-ring: rgba(17, 17, 17, 0.08);
  --playbook-danger-bg: #fff3ef;
  --playbook-danger-line: rgba(188, 93, 31, 0.24);
  --playbook-danger-ink: #8e3d1c;
  --playbook-control-radius: var(--radius-control);
  --playbook-panel-radius: var(--radius-panel);
  height: 100vh;
  overflow: hidden;
  background: var(--playbook-bg);
  color: var(--playbook-ink);
}

body.playbook-page[data-theme="dark"] {
  --playbook-bg: #0e1013;
  --playbook-ink: #f4f1ea;
  --playbook-ink-soft: rgba(244, 241, 234, 0.8);
  --playbook-ink-muted: rgba(244, 241, 234, 0.62);
  --playbook-line: rgba(244, 241, 234, 0.14);
  --playbook-line-soft: rgba(244, 241, 234, 0.12);
  --playbook-line-faint: rgba(244, 241, 234, 0.09);
  --playbook-surface: #14171b;
  --playbook-surface-soft: #101317;
  --playbook-chip-bg: #161a1f;
  --playbook-chip-ink: rgba(244, 241, 234, 0.72);
  --playbook-status: #f4f1ea;
  --playbook-status-ring: rgba(244, 241, 234, 0.12);
  --playbook-danger-bg: rgba(188, 93, 31, 0.12);
  --playbook-danger-line: rgba(188, 93, 31, 0.26);
  --playbook-danger-ink: #ffb28b;
}

body.playbook-page::before {
  display: none;
}

.playbook-frame {
  width: min(1340px, calc(100% - 40px));
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 10px 0 12px;
  overflow: hidden;
}

.playbook-header {
  margin-bottom: 10px;
  padding: 0 0 10px;
  border: 0;
  border-bottom: 1px solid var(--playbook-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.page-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
  min-width: 0;
  color: var(--playbook-ink-muted);
  font-family: var(--mono-font);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-link-group,
.page-utility-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-link-group a,
.page-link-group button,
.page-utility-group a,
.page-utility-group button {
  text-decoration: none;
  color: inherit;
}

.page-link-group .ghost-button,
.page-utility-group .ghost-button {
  min-width: 92px;
}

.page-link-group .ghost-button[aria-current="page"] {
  background: color-mix(in srgb, var(--playbook-ink) 8%, transparent);
  border-color: var(--playbook-line);
}

.playbook-page .playbook-header .page-link-group .button,
.playbook-page .playbook-header .page-link-group .ghost-button,
.playbook-page .playbook-header .page-utility-group .button,
.playbook-page .playbook-header .page-utility-group .ghost-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.74rem;
}

.playbook-brand-label {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
}

.playbook-shell {
  --outline-width: 280px;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--outline-width) 24px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.playbook-sidebar,
.playbook-reader {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(23, 33, 38, 0.18) transparent;
}

.playbook-sidebar {
  padding-right: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

.playbook-sidebar-inner {
  display: grid;
  gap: 22px;
  padding: 6px 24px 56px 0;
}

.playbook-sidebar-label {
  margin-bottom: 0;
}

.playbook-summary,
.playbook-section p,
.playbook-note {
  margin: 0;
  color: var(--playbook-ink-soft);
  line-height: 1.82;
}

.playbook-outline p {
  margin: 0 0 12px;
  font-family: var(--mono-font);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--playbook-ink-muted);
}

.playbook-outline ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.playbook-outline li {
  margin: 0;
}

.playbook-outline .outline-folder {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.playbook-outline .outline-folder-label {
  display: block;
  padding-left: 0;
  color: var(--playbook-ink);
  font-family: var(--mono-font);
  font-size: 0.72rem;
  line-height: 1.35;
  letter-spacing: 0.04em;
}

.playbook-outline .outline-folder-list {
  display: grid;
  gap: 6px;
  padding-left: 10px;
}

.playbook-outline a {
  display: block;
  padding: 2px 0 2px 14px;
  border-left: 2px solid transparent;
  color: var(--playbook-ink-muted);
  text-decoration: none;
  line-height: 1.55;
  transition: color 140ms ease, border-color 140ms ease;
}

.playbook-outline a:hover,
.playbook-outline a.active {
  color: var(--playbook-ink);
  border-left-color: var(--playbook-ink);
}

.playbook-reader {
  padding-left: 4px;
  scroll-padding-top: 84px;
}

.playbook-divider-toggle {
  position: relative;
  width: 24px;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.playbook-divider-rail {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: var(--playbook-line-soft);
  transition: background-color 160ms ease, width 160ms ease;
}

.playbook-divider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 64px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--playbook-surface) 88%, transparent);
  border: 1px solid transparent;
  color: var(--playbook-ink-muted);
  font-family: var(--mono-font);
  font-size: 0.82rem;
  line-height: 1;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.playbook-divider-toggle:hover .playbook-divider-rail,
.playbook-divider-toggle:focus-visible .playbook-divider-rail {
  width: 2px;
  background: var(--playbook-ink-muted);
}

.playbook-divider-toggle:hover .playbook-divider-handle,
.playbook-divider-toggle:focus-visible .playbook-divider-handle {
  color: var(--playbook-ink);
  border-color: var(--playbook-line);
  background: var(--playbook-surface);
  transform: translate(-50%, -50%) scale(1.03);
}

.playbook-divider-toggle:focus-visible {
  outline: none;
}

body.outline-collapsed .playbook-shell {
  --outline-width: 0px;
  gap: 4px;
}

body.outline-collapsed .playbook-sidebar {
  transform: translateX(calc(-100% - 24px));
  opacity: 0;
  pointer-events: none;
  padding-right: 0;
}

body.outline-collapsed .playbook-divider-toggle {
  cursor: pointer;
}

body.outline-collapsed .playbook-divider-handle {
  color: var(--playbook-ink);
}

.playbook-content {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 6px 0 120px;
}

.playbook-section {
  padding: 26px 0 34px;
  border-top: 1px solid var(--playbook-line-soft);
  scroll-margin-top: 84px;
}

.playbook-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.playbook-section p + p,
.playbook-section p + .playbook-points {
  margin-top: 14px;
}

.essay-page {
  --playbook-bg: #fbfaf6;
  --playbook-ink: #161616;
  --playbook-ink-soft: rgba(22, 22, 22, 0.78);
  --playbook-ink-muted: rgba(22, 22, 22, 0.54);
  --playbook-line: rgba(22, 22, 22, 0.14);
  --playbook-line-soft: rgba(22, 22, 22, 0.08);
  --playbook-line-faint: rgba(22, 22, 22, 0.06);
  --playbook-surface: transparent;
  --playbook-surface-soft: transparent;
  background: var(--playbook-bg);
  color: var(--playbook-ink);
}

body.playbook-page.essay-page[data-theme="dark"] {
  --playbook-bg: #0f1113;
  --playbook-ink: #f1ede4;
  --playbook-ink-soft: rgba(241, 237, 228, 0.8);
  --playbook-ink-muted: rgba(241, 237, 228, 0.56);
  --playbook-line: rgba(241, 237, 228, 0.14);
  --playbook-line-soft: rgba(241, 237, 228, 0.1);
  --playbook-line-faint: rgba(241, 237, 228, 0.08);
  --playbook-surface: transparent;
  --playbook-surface-soft: transparent;
}

body.essay-page::before {
  display: none;
}

.essay-frame {
  width: min(1340px, calc(100% - 40px));
}


.essay-header {
  margin-bottom: 10px;
  padding: 0 0 10px;
  border: 0;
  border-bottom: 1px solid var(--playbook-line);
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}


.essay-page .ghost-button {
  border-color: transparent;
  padding: 0 10px;
}

.essay-page .ghost-button:hover {
  background: transparent;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lang-switch-floating {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 40;
  padding: 6px;
  border: 1px solid var(--playbook-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--playbook-bg) 88%, transparent);
  backdrop-filter: blur(10px);
}

.lang-switch-floating .ghost-button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
}

.lang-switch-floating .ghost-button[aria-current="true"] {
  background: color-mix(in srgb, var(--playbook-ink) 10%, transparent);
  border-color: var(--playbook-line);
}

.essay-sidebar .playbook-sidebar-inner {
  padding: 8px 20px 48px 0;
}

.essay-page .playbook-outline p {
  margin-bottom: 10px;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
}

.essay-page .playbook-outline a {
  padding: 2px 0 2px 12px;
  border-left-width: 1px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.essay-reader {
  padding-left: 0;
}

.essay-content {
  width: min(760px, 100%);
  padding: 4px 0 88px;
}

.essay-page .playbook-section {
  padding: 14px 0 22px;
}

.essay-page .playbook-section:first-child {
  padding-top: 2px;
}

.essay-page .eyebrow {
  margin-bottom: 10px;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--playbook-ink-muted);
}

.essay-title,
.essay-page h2,
.essay-page h3 {
  font-family: var(--display-font);
  font-weight: 600;
  color: var(--playbook-ink);
}

.essay-title {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1.18;
  letter-spacing: -0.018em;
}

.essay-page h2 {
  font-size: 1.16rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.essay-page h3 {
  margin-top: 1.6rem;
  font-size: 0.98rem;
  line-height: 1.45;
  letter-spacing: 0;
}

.essay-page h4 {
  margin: 1.4rem 0 0;
  font-family: var(--display-font);
  font-size: 0.92rem;
  line-height: 1.5;
  font-weight: 600;
  color: var(--playbook-ink);
}

.essay-page p,
.essay-page li,
.essay-page blockquote {
  font-size: 0.96rem;
  line-height: 1.74;
  color: var(--playbook-ink-soft);
}

.essay-page p + p,
.essay-page p + .essay-list,
.essay-page p + .essay-math,
.essay-page .essay-math + p {
  margin-top: 0.78rem;
}

.essay-lede {
  max-width: 62ch;
}

.essay-meta {
  color: var(--playbook-ink-muted);
}

.essay-list {
  margin: 0.95rem 0 0;
  padding-left: 1.4rem;
}

.essay-list li + li {
  margin-top: 0.4rem;
}

.onepage-source-content > h2:first-child,
.onepage-source-content > h1:first-child {
  margin-top: 0;
}

.onepage-source-content h1 {
  font-family: var(--display-font);
  font-size: 1.24rem;
  line-height: 1.32;
  letter-spacing: -0.012em;
  font-weight: 600;
  color: var(--playbook-ink);
}

.onepage-source-content h2 {
  margin-top: 1.6rem;
  font-family: var(--display-font);
  font-size: 1.16rem;
  line-height: 1.42;
  font-weight: 600;
  color: var(--playbook-ink);
}

.onepage-source-content h3 {
  margin-top: 1.25rem;
  font-family: var(--display-font);
  font-size: 1.05rem;
  line-height: 1.46;
  font-weight: 600;
  color: var(--playbook-ink);
}

.onepage-source-content h4 {
  margin-top: 1.2rem;
  font-family: var(--display-font);
  font-size: 1rem;
  line-height: 1.48;
  font-weight: 600;
  color: var(--playbook-ink);
}

.onepage-source-content p + ul,
.onepage-source-content p + ol,
.onepage-source-content p + blockquote,
.onepage-source-content p + pre,
.onepage-source-content p + hr,
.onepage-source-content blockquote + p,
.onepage-source-content pre + p,
.onepage-source-content ul + p,
.onepage-source-content ol + p {
  margin-top: 0.78rem;
}

.onepage-source-content ul,
.onepage-source-content ol {
  padding-left: 1.45rem;
}

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

.onepage-source-content ul ul,
.onepage-source-content ol ul,
.onepage-source-content ul ol,
.onepage-source-content ol ol {
  margin-top: 0.45rem;
}

.onepage-source-content hr {
  margin: 1.18rem 0;
  border: 0;
  border-top: 1px solid var(--playbook-line);
}

.onepage-source-content img {
  display: block;
  width: 100%;
  margin: 1rem 0;
  border-radius: 6px;
}

.links-page .playbook-content,
.links-page .essay-content {
  width: min(1040px, 100%);
}

.links-pdf-actions {
  display: flex;
  justify-content: flex-end;
  margin: 0.9rem 0 0.8rem;
}

.links-source-content table {
  display: block;
  width: 100%;
  margin-top: 0.9rem;
  overflow-x: auto;
  border-collapse: collapse;
  -webkit-overflow-scrolling: touch;
}

.links-source-content th,
.links-source-content td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--playbook-line);
  color: var(--playbook-ink);
  font-size: 0.94rem;
  line-height: 1.48;
  text-align: left;
  vertical-align: top;
}

.links-source-content th {
  color: var(--playbook-muted);
  font-family: var(--mono-font);
  font-size: 0.78rem;
  font-weight: 600;
}

.links-source-content .links-pdf-button {
  display: inline-flex;
  margin-top: 0.35rem;
}

body.links-pdf-modal-open {
  overflow: hidden;
}

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

.links-pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  padding: 0;
  background: var(--playbook-bg);
}

.links-pdf-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: color-mix(in srgb, #000000 52%, transparent);
  cursor: pointer;
}

.links-pdf-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--playbook-bg);
  box-shadow: none;
}

.links-pdf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--playbook-line);
}

.links-pdf-modal-header h2 {
  margin: 0;
  color: var(--playbook-ink);
  font-family: var(--display-font);
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 700;
}

.links-pdf-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.links-pdf-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.onepage-pdf-viewer {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: color-mix(in srgb, var(--playbook-ink) 4%, transparent);
}

.links-mobile-pdf-reader {
  display: none;
}

.links-pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.9rem 0 0.65rem;
}

.links-pdf-status {
  color: var(--playbook-muted);
  font-family: var(--mono-font);
  font-size: 0.88rem;
  text-align: center;
  white-space: nowrap;
}

.links-pdf-page-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.links-pdf-page {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 68vh;
  overflow: auto;
  border: 1px solid var(--playbook-line-soft);
  border-radius: 6px;
  background: color-mix(in srgb, var(--playbook-ink) 4%, transparent);
  -webkit-overflow-scrolling: touch;
}

.links-pdf-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  background: #ffffff;
}

.links-pdf-page-label {
  position: absolute;
  top: 10px;
  left: 10px;
  border: 1px solid var(--playbook-line);
  border-radius: 999px;
  padding: 0.24rem 0.58rem;
  background: color-mix(in srgb, var(--playbook-bg) 90%, transparent);
  color: var(--playbook-muted);
  font-family: var(--mono-font);
  font-size: 0.72rem;
  line-height: 1;
}

.links-pdf-error {
  margin-top: 0.8rem;
}

.onepage-source-content code {
  font-family: var(--mono-font);
  font-size: 0.92em;
}

.onepage-source-content p code,
.onepage-source-content li code,
.onepage-source-content blockquote code {
  padding: 0.08em 0.34em;
  border-radius: 6px;
  background: color-mix(in srgb, var(--playbook-ink) 7%, transparent);
}

.onepage-source-content pre {
  margin: 1rem 0;
  padding: 0.95rem 1rem;
  overflow-x: auto;
  border-radius: 8px;
  background: color-mix(in srgb, var(--playbook-ink) 6%, transparent);
  border: 1px solid var(--playbook-line-soft);
}

.onepage-source-content pre code {
  display: block;
  padding: 0;
  background: transparent;
}

.onepage-mermaid {
  width: 100%;
  margin: 1rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--playbook-line-soft);
  border-radius: 6px;
  background: color-mix(in srgb, var(--playbook-ink) 3%, transparent);
  -webkit-overflow-scrolling: touch;
}

.onepage-mermaid svg {
  display: block;
  width: max-content;
  max-width: none;
  min-width: 100%;
  height: auto;
  margin: 0 auto;
}

.onepage-mermaid-error {
  border-color: color-mix(in srgb, #d15b2f 42%, var(--playbook-line-soft));
}

.essay-math {
  margin: 1rem 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.onepage-source-content .essay-math {
  margin: 1.05rem 0;
}

.essay-page mjx-container[jax="CHTML"][display="true"] {
  display: block;
  margin: 0.4rem 0;
  font-size: 1.02em;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.onepage-source-content mjx-container[jax="CHTML"][display="true"] {
  margin: 0.7rem 0;
}

.essay-page mjx-container {
  color: var(--playbook-ink);
  max-width: 100%;
}

.essay-page mjx-assistive-mml {
  width: 1px !important;
  min-width: 1px !important;
  max-width: 1px !important;
  overflow: hidden !important;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  white-space: nowrap;
}

.essay-page blockquote {
  margin: 1rem 0;
  padding: 0 0 0 1rem;
  border-left: 2px solid var(--playbook-line);
}

.essay-page blockquote p {
  margin: 0;
  color: var(--playbook-ink);
}

.onepage-load-error {
  margin: 0;
  color: var(--playbook-danger-ink, #8e3d1c);
}

.playbook-page .button,
.playbook-page .ghost-button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
}

.playbook-page .button {
  background: var(--playbook-ink);
  color: var(--playbook-bg);
}

.playbook-page .button:hover {
  opacity: 0.92;
}

.playbook-page .ghost-button,
.theme-toggle,
.playbook-intro-toggle {
  background: transparent;
  border-color: var(--playbook-line);
  color: var(--playbook-ink);
}

.playbook-page .ghost-button:hover,
.theme-toggle:hover,
.playbook-intro-toggle:hover {
  background: color-mix(in srgb, var(--playbook-ink) 5%, transparent);
}

.playground-frame {
  width: min(1340px, calc(100% - 40px));
}

.playground-logout {
  font: inherit;
  cursor: pointer;
}

.playground-main {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 20px;
}

.playground-intro-block {
  max-width: 760px;
}

.playground-title {
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(1.55rem, 2.2vw, 2.3rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.playground-intro-copy {
  margin: 14px 0 0;
  max-width: 64ch;
  color: var(--playbook-ink-soft);
  line-height: 1.8;
}

.playground-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 18px;
}

.playground-surface {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--playbook-line);
  background: var(--playbook-surface);
}

.playground-surface-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--playbook-line-soft);
}

.playground-surface-head h2 {
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.playground-editor-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.playground-label {
  margin: 0 0 6px;
  font-family: var(--mono-font);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--playbook-ink-muted);
}

.playground-inline-note {
  margin: 0;
  padding: 12px 18px 0;
  color: var(--playbook-ink-muted);
  font-size: 0.92rem;
}

.playground-editor-shell {
  margin-top: 12px;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  border-top: 1px solid var(--playbook-line-faint);
}

.playground-page .editor-gutter {
  border-right: 1px solid var(--playbook-line-faint);
  background: var(--playbook-surface-soft);
  color: var(--playbook-ink-muted);
}

.playground-page .playground-code {
  min-height: 520px;
  background: var(--playbook-surface);
  color: var(--playbook-ink);
  padding: 18px;
  font-size: 0.93rem;
  line-height: 1.7;
}

.playground-page .run-summary {
  padding: 14px 18px 0;
}

.playground-page .run-chip {
  border-radius: 999px;
  border: 1px solid var(--playbook-line);
  background: var(--playbook-chip-bg);
  color: var(--playbook-chip-ink);
}

.playground-page .run-chip-alert {
  background: var(--playbook-danger-bg);
  border-color: var(--playbook-danger-line);
  color: var(--playbook-danger-ink);
}

.playground-page .playground-meta {
  margin: 12px 0 0;
  padding: 0 18px;
  color: var(--playbook-ink-muted);
}

.playground-page .playground-meta .status-dot {
  background: var(--playbook-status);
  box-shadow: 0 0 0 4px var(--playbook-status-ring);
}

.playground-page .playground-meta .status-error {
  color: var(--playbook-danger-ink);
}

.playground-page .playground-output {
  margin: 12px 18px 18px;
  flex: 1;
  min-height: 0;
  max-height: none;
  border-radius: 0;
  border: 1px solid var(--playbook-line-soft);
  background: var(--playbook-surface-soft);
  color: var(--playbook-ink);
  padding: 16px;
  line-height: 1.6;
}

.chat-console-frame {
  width: min(1240px, calc(100% - 40px));
  height: auto;
  min-height: 100vh;
  overflow: visible;
}

body.chat-console-page {
  height: auto;
  min-height: 100vh;
  overflow: auto;
}

.chat-console-page .playground-main {
  display: block;
  min-height: auto;
  overflow: visible;
}

.chat-console-page .playground-intro-block {
  margin-bottom: 20px;
}

.chat-console-page .playground-surface {
  min-width: 0;
}

.chat-console-stack {
  display: grid;
  gap: 18px;
}

.chat-console-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}

.chat-console-section {
  border-radius: 22px;
}

.chat-console-connection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--playbook-line);
  border-radius: 22px;
  background: var(--playbook-surface);
}

.chat-console-body {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px 18px 18px;
}

.chat-console-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.chat-console-field .text-input {
  min-width: 0;
}

.chat-console-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.chat-console-endpoint {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--playbook-ink-muted);
  font-family: var(--mono-font);
  font-size: 0.8rem;
  line-height: 1.35;
  text-align: right;
}

.chat-console-note {
  margin: 0;
  color: var(--playbook-ink-muted);
  font-size: 0.88rem;
}

.chat-console-status {
  margin: 0;
  min-height: 20px;
  color: var(--playbook-ink-soft);
  font-size: 0.9rem;
}

.chat-console-status.is-error {
  color: #8e3d1c;
}

.chat-console-status.is-good,
.chat-console-health-line.is-good {
  color: var(--accent);
}

.chat-console-health-line {
  margin: 0;
  color: var(--playbook-ink-soft);
  font-size: 0.98rem;
  font-weight: 800;
}

.chat-console-health-line.is-error {
  color: var(--playbook-danger-ink);
}

.chat-console-table {
  min-width: 980px;
}

.chat-console-users-table {
  min-width: 1040px;
}

.chat-console-empty {
  color: var(--playbook-ink-muted);
}

.chat-console-code {
  font-family: var(--mono-font);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.chat-console-table-action {
  min-height: 30px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.chat-console-invite-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--playbook-line-soft);
  background: var(--playbook-surface-soft);
}

.chat-console-invite-details[hidden] {
  display: none;
}

.chat-console-invite-details div {
  min-width: 0;
}

.chat-console-invite-details dt {
  margin: 0 0 4px;
  color: var(--playbook-ink-muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.chat-console-invite-details dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--playbook-ink);
  font-size: 0.9rem;
  line-height: 1.4;
}

.chat-console-invite-details .chat-console-code {
  font-family: var(--mono-font);
  font-size: 0.82rem;
}

.chat-console-invite-details .is-active {
  color: var(--accent);
  font-weight: 700;
}

.chat-console-invite-details .is-expired {
  color: var(--playbook-danger-ink);
  font-weight: 700;
}

.chat-console-result {
  margin: 0;
  min-height: 180px;
  max-height: 380px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--playbook-line-soft);
  background: var(--playbook-surface-soft);
  color: var(--playbook-ink);
  font-family: var(--mono-font);
  font-size: 0.82rem;
  line-height: 1.5;
}

.chat-console-users-result {
  min-height: 260px;
}

@media (max-width: 720px) {
  .chat-console-connection {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-console-endpoint {
    text-align: left;
  }

  .chat-console-controls {
    grid-template-columns: 1fr;
  }
}

.news-frame {
  width: min(1340px, calc(100% - 40px));
}

.news-main {
  min-height: 0;
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
}

.news-topbar {
  display: flex;
  min-width: 0;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 0 10px;
  border-bottom: 1px solid var(--playbook-line-soft);
}

.news-title {
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1.18;
  letter-spacing: -0.018em;
}

.news-meta-panel {
  min-width: min(260px, 100%);
  text-align: right;
  color: var(--playbook-ink-muted);
}

.news-status,
.news-refresh {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.news-status {
  color: var(--playbook-ink);
  font-weight: 700;
}

.news-tabs {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--playbook-line);
  border-radius: var(--playbook-control-radius);
  background: color-mix(in srgb, var(--playbook-surface-soft) 84%, transparent);
  overflow-x: auto;
  scrollbar-width: none;
}

.news-tabs::-webkit-scrollbar {
  display: none;
}

.news-tab {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: calc(var(--playbook-control-radius) - 2px);
  background: transparent;
  color: var(--playbook-ink-muted);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
}

.news-tab[aria-selected="true"] {
  background: var(--playbook-surface);
  color: var(--playbook-ink);
  box-shadow: 0 1px 2px rgba(23, 33, 38, 0.08);
}

.news-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.news-source-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  min-height: 32px;
  overflow-x: auto;
  padding-bottom: 1px;
  scrollbar-width: thin;
  scrollbar-color: rgba(23, 33, 38, 0.18) transparent;
}

.news-source-chip,
.news-category,
.news-comments {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid var(--playbook-line);
  background: var(--playbook-chip-bg);
  color: var(--playbook-chip-ink);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-source-chip {
  padding: 0 10px;
  font-family: var(--mono-font);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.news-source-chip[data-state="error"] {
  color: var(--playbook-danger-ink);
  border-color: var(--playbook-danger-line);
  background: var(--playbook-danger-bg);
}

.news-source-chip[data-state="pending"] {
  color: var(--playbook-ink-muted);
  border-style: dashed;
  background: color-mix(in srgb, var(--playbook-surface-strong) 72%, transparent);
}

.news-list {
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 0;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(23, 33, 38, 0.18) transparent;
}

.news-item {
  display: flex;
  min-width: 0;
  align-items: stretch;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--playbook-line-soft);
}

.news-item-media {
  display: flex;
  flex-direction: column;
  flex: 0 0 120px;
  min-height: 96px;
  overflow: hidden;
  border: 1px solid var(--playbook-line-soft);
  background: var(--playbook-surface-soft);
  border-radius: var(--playbook-panel-radius);
}

.news-item-media[hidden] {
  display: none;
}

.news-item-media img {
  display: block;
  width: 100%;
  flex: 1;
  min-height: 0;
  object-fit: cover;
}

.news-item-media-fallback {
  position: relative;
  justify-content: center;
  align-items: center;
  gap: 5px;
  isolation: isolate;
  color: var(--playbook-ink);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--playbook-surface) 88%, transparent), var(--playbook-surface-soft));
}

.news-item-media-fallback::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 28% 18%, var(--news-source-accent, rgba(12, 107, 99, 0.36)), transparent 52%),
    linear-gradient(135deg, transparent, color-mix(in srgb, var(--playbook-ink) 6%, transparent));
  opacity: 0.72;
}

.news-item-media-fallback[data-source-id="hacker-news"] {
  --news-source-accent: rgba(245, 115, 22, 0.5);
}

.news-item-media-fallback[data-source-id="lobsters"] {
  --news-source-accent: rgba(180, 56, 48, 0.46);
}

.news-item-media-initials,
.news-item-media-source {
  position: relative;
}

.news-item-media-initials {
  font-family: var(--mono-font);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.news-item-media-source {
  max-width: 86%;
  overflow: hidden;
  color: var(--playbook-ink-muted);
  font-family: var(--mono-font);
  font-size: 0.58rem;
  line-height: 1.2;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.news-item-text-only .news-item-media {
  display: none;
}

.news-item-body {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.news-item-meta,
.news-item-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--playbook-ink-muted);
}

.news-item-meta {
  margin-bottom: 4px;
  font-size: 0.72rem;
  line-height: 1.35;
}

.news-source-name {
  color: var(--playbook-ink);
  font-family: var(--mono-font);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.news-dot {
  color: var(--playbook-ink-muted);
}

.news-item-title {
  margin: 0;
  font-family: var(--body-font);
  font-size: 1rem;
  line-height: 1.34;
  letter-spacing: 0;
  font-weight: 700;
}

.news-item-title a {
  color: var(--playbook-ink);
  text-decoration: none;
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.news-item-title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.news-item-excerpt {
  margin: 6px 0 0;
  max-width: 66ch;
  color: var(--playbook-ink-soft);
  line-height: 1.5;
  font-size: 0.92rem;
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.news-item-footer {
  margin-top: 8px;
  gap: 6px;
}

.news-category,
.news-comments {
  min-height: 22px;
  padding: 0 8px;
  font-size: 0.72rem;
  border-color: var(--playbook-line-soft);
  background: color-mix(in srgb, var(--playbook-surface-soft) 86%, transparent);
  color: var(--playbook-ink-muted);
}

.news-comments {
  color: var(--playbook-ink);
}

.news-empty {
  margin: 18px 0 0;
  color: var(--playbook-ink-muted);
}

.news-empty[data-state="pending"] {
  color: var(--playbook-ink);
}

.news-load-more {
  width: 100%;
  min-height: 36px;
  margin: 10px 0 0;
  border: 1px solid var(--playbook-line-soft);
  border-radius: var(--playbook-control-radius);
  background: color-mix(in srgb, var(--playbook-surface-soft) 86%, transparent);
  color: var(--playbook-ink-muted);
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0;
  cursor: pointer;
}

.news-load-more:not(:disabled):hover {
  color: var(--playbook-ink);
  border-color: var(--playbook-line);
}

.news-load-more:disabled {
  cursor: default;
}

.news-load-more[data-state="error"] {
  color: var(--playbook-danger-ink);
  border-color: var(--playbook-danger-line);
  background: var(--playbook-danger-bg);
}

.playbook-points {
  margin: 0;
  padding-left: 20px;
  color: var(--playbook-ink-soft);
}

.playbook-points li {
  margin-top: 10px;
  line-height: 1.72;
}

.playbook-points li:first-child {
  margin-top: 0;
}

.playbook-sidebar::-webkit-scrollbar,
.playbook-reader::-webkit-scrollbar {
  width: 10px;
}

.playbook-sidebar::-webkit-scrollbar-thumb,
.playbook-reader::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(23, 33, 38, 0.14);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.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;
}

body.article-page {
  overflow: hidden;
}

.article-shell {
  width: min(1400px, calc(100% - 36px));
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding-bottom: 24px;
}

.article-main {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 24px;
}

.article-sidebar,
.article-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(23, 33, 38, 0.28) transparent;
}

.article-sidebar {
  padding-right: 10px;
}

.article-sidebar-inner {
  display: grid;
  gap: 18px;
  padding: 10px 0 18px;
}

.article-sidebar-title {
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(2.6rem, 4vw, 4.8rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.article-sidebar-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.article-sidebar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.article-outline {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 243, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  padding: 20px;
}

.article-outline p {
  margin: 0 0 14px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.article-outline ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: article-outline;
  display: grid;
  gap: 10px;
}

.article-outline li {
  margin: 0;
}

.article-outline a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  text-decoration: none;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.article-outline a::before {
  counter-increment: article-outline;
  content: counter(article-outline, decimal-leading-zero);
  font-family: var(--mono-font);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--highlight);
  padding-top: 3px;
}

.article-outline a:hover,
.article-outline a.active {
  border-color: rgba(12, 107, 99, 0.22);
  background: linear-gradient(135deg, rgba(12, 107, 99, 0.12), rgba(255, 255, 255, 0.86));
  color: var(--ink);
  transform: translateY(-1px);
}

.article-outline-muted ol {
  list-style: decimal;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.article-outline-muted li {
  color: var(--muted);
  line-height: 1.6;
}

.article-scroll {
  padding: 10px 8px 18px 22px;
}

.article-scroll .content-stack,
.article-scroll .article-footer {
  width: min(920px, 100%);
  margin-inline: auto;
}

.article-scroll .content-stack {
  gap: 22px;
}

.article-scroll .section-card {
  scroll-margin-top: 24px;
}

.article-footer {
  margin-top: 18px;
}

.article-sidebar::-webkit-scrollbar,
.article-scroll::-webkit-scrollbar {
  width: 10px;
}

.article-sidebar::-webkit-scrollbar-thumb,
.article-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(23, 33, 38, 0.2);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.note-grid,
.metric-grid,
.resource-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.formula-card pre,
.section-card pre {
  margin: 16px 0 0;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(20, 31, 36, 0.94);
  color: #f2efe8;
  overflow: auto;
  line-height: 1.6;
}

.math-inline,
.formula-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(12, 107, 99, 0.14);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(248, 241, 230, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-family: var(--mono-font);
  font-size: 0.92rem;
  max-width: 100%;
  vertical-align: middle;
}

.math-display {
  margin-top: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(12, 107, 99, 0.16);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(12, 107, 99, 0.1), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(249, 243, 234, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  color: var(--ink);
  overflow-x: auto;
}

.math-inline.math-ready,
.math-display.math-ready {
  font-family: var(--body-font);
}

.math-inline .katex {
  font-size: 1.02em;
}

.math-display .katex-display {
  margin: 0;
}

.math-display .katex {
  font-size: 1.08em;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-card {
  position: relative;
  padding-left: 56px;
}

.timeline-card::before {
  content: attr(data-step);
  position: absolute;
  left: 20px;
  top: 22px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-panel {
  margin-top: 28px;
}

.status-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.status-card dt {
  margin: 0 0 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.status-card dd {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.status-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  flex-wrap: wrap;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(12, 107, 99, 0.14);
}

.status-error {
  color: #8e3d1c;
}

.site-footer {
  margin-top: 34px;
  padding: 18px 0 0;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent-strong);
}

.flow-diagram,
.sequence-diagram {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.flow-row,
.sequence-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.flow-step,
.sequence-step,
.equation-card,
.table-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(250, 245, 237, 0.82));
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.equation-card {
  position: relative;
  overflow: hidden;
}

.equation-card::after {
  content: "";
  position: absolute;
  inset: auto -36px -42px auto;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(12, 107, 99, 0.14), transparent 70%);
  pointer-events: none;
}

.flow-step,
.sequence-step {
  min-width: 160px;
  flex: 1 1 160px;
}

.flow-step strong,
.sequence-step strong,
.equation-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-strong);
}

.flow-arrow {
  color: var(--highlight);
  font-weight: 700;
  font-size: 1.1rem;
}

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

.equation-card p,
.table-card p,
.flow-step p,
.sequence-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.equation-card .formula-inline,
.equation-card .math-inline,
.equation-card .math-display {
  margin-top: 10px;
}

.table-card table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 0.95rem;
}

.table-card th,
.table-card td {
  border-top: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
  color: var(--muted);
}

.table-card th {
  color: var(--ink);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

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

.summary-card {
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--paper);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.summary-card h3,
.summary-card p {
  margin: 0;
}

.summary-card p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.7;
}

.summary-card .badge {
  margin-bottom: 12px;
}

.chapter-index {
  display: grid;
  gap: 18px;
}

.chapter-index-card {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  border-radius: var(--radius-md);
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.chapter-index-card .module-id {
  justify-content: center;
  min-height: 42px;
  font-size: 0.9rem;
}

.chapter-index-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.visual-grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.visual-grid-double {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.visual-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(250, 245, 237, 0.82));
  box-shadow: var(--shadow);
}

.visual-card img {
  display: block;
  width: 100%;
  height: auto;
}

.visual-card figcaption {
  padding: 14px 16px 16px;
  color: var(--muted);
  line-height: 1.65;
}

.chapter-index-card .link-list {
  margin-top: 12px;
}

.diagram-caption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-shell {
  max-width: 760px;
  margin: 0 auto;
}

.auth-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 250, 243, 0.7);
  padding: 24px;
}

.auth-form {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.auth-actions {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.auth-google-button {
  display: inline-flex;
  justify-content: center;
  text-decoration: none;
}

.auth-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

body.auth-page {
  min-height: 100vh;
  height: auto;
  overflow: auto;
}

.auth-frame {
  min-height: 100vh;
  height: auto;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 24px;
  overflow: visible;
}

.auth-main {
  display: grid;
  align-items: center;
  padding: 8px 0 32px;
}

.auth-page .auth-shell {
  width: min(640px, 100%);
  margin: 0 auto;
  border-color: var(--playbook-line);
  background: var(--playbook-surface);
  box-shadow: none;
  backdrop-filter: none;
}

.auth-page .auth-card {
  border: 0;
  background: transparent;
  padding: 0;
}

.auth-title {
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  line-height: 0.98;
}

.auth-page .lede,
.auth-page .auth-note,
.auth-page .form-error {
  color: var(--playbook-ink-soft);
}

.auth-page .eyebrow {
  color: var(--highlight);
}

.auth-page .auth-google-button {
  min-width: 220px;
}

.auth-footer {
  margin-top: 0;
  padding-top: 0;
  color: var(--playbook-ink-muted);
}

.admin-shell {
  display: grid;
  gap: 18px;
}

.dashboard-page {
  min-height: 100vh;
  height: auto;
  overflow: auto;
}

body.playbook-page.dashboard-page {
  height: auto;
  overflow: auto;
}

.dashboard-frame {
  min-height: 100vh;
  height: auto;
  display: block;
  overflow: visible;
  padding-bottom: 56px;
}

.dashboard-header {
  margin-bottom: 28px;
}

.dashboard-page .badge {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}

.dashboard-page .chip {
  background: var(--playbook-chip-bg);
  border-color: var(--playbook-line);
  color: var(--playbook-chip-ink);
  text-decoration: none;
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.admin-hero {
  display: grid;
  gap: 16px;
  padding: 24px 28px;
  border-radius: var(--radius-md);
  border: 1px solid var(--playbook-line);
  background: var(--playbook-surface);
  box-shadow: none;
  backdrop-filter: none;
}

.admin-hero-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-hero-copy {
  margin: 0;
  max-width: 76ch;
  color: var(--playbook-ink-soft);
  line-height: 1.8;
}

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

.admin-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--playbook-ink-muted);
}

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

.admin-grid-wide {
  grid-template-columns: 1fr;
}

.admin-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--playbook-line);
  background: var(--playbook-surface);
  padding: 22px;
  display: grid;
  gap: 14px;
}

.admin-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.admin-summary-grid .admin-card {
  align-content: start;
}

.admin-summary-grid .admin-card-header {
  min-height: 128px;
}

.admin-summary-grid .admin-card-header > div {
  min-width: 0;
}

.admin-summary-grid .admin-stat-grid,
.admin-summary-grid .admin-link-grid {
  align-self: start;
}

.admin-quick-card {
  align-content: start;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.admin-quick-card .admin-card-header {
  min-height: 0;
}

.admin-card-copy {
  color: var(--playbook-ink-soft);
  line-height: 1.6;
  font-size: 0.94rem;
}

.admin-quick-card .admin-link-grid {
  grid-template-columns: 1fr 1fr;
}

.admin-card p {
  margin: 0;
}

.admin-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-card-actions .button,
.admin-card-actions .ghost-button {
  min-height: 36px;
  padding: 0 16px;
  font-size: 0.88rem;
}

.admin-note {
  margin: 0;
  color: var(--playbook-ink-muted);
}

.admin-note-good {
  color: var(--accent);
}

.admin-note-warn {
  color: var(--highlight);
}

.admin-note-bad {
  color: var(--playbook-danger-ink, #8e3d1c);
}

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

.admin-stat {
  border-radius: var(--radius-sm);
  border: 1px solid var(--playbook-line-soft);
  background: var(--playbook-surface-soft);
  padding: 14px;
}

.admin-stat dt {
  margin: 0 0 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--playbook-ink-muted);
}

.admin-stat dd {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--playbook-ink);
}

.admin-kv-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.admin-kv-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--playbook-line-soft);
}

.admin-kv-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.admin-kv-row dt {
  margin: 0;
  color: var(--playbook-ink-muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.admin-kv-row dd {
  margin: 0;
  color: var(--playbook-ink);
}

.admin-table-wrap {
  overflow: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.admin-table-docker {
  min-width: 1240px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--playbook-line-soft);
  vertical-align: top;
}

.admin-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--playbook-ink-muted);
}

.admin-cell-meta {
  display: block;
  margin-top: 6px;
  color: var(--playbook-ink-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.admin-cell-metric {
  font-family: var(--mono-font);
  font-size: 0.84rem;
  color: var(--playbook-ink);
}

.admin-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--playbook-line);
  background: var(--playbook-chip-bg, rgba(255, 255, 255, 0.62));
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-pill-good {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--accent) 24%, transparent);
  color: var(--accent);
}

.admin-pill-warn {
  background: color-mix(in srgb, var(--highlight) 14%, transparent);
  border-color: color-mix(in srgb, var(--highlight) 24%, transparent);
  color: var(--highlight);
}

.admin-pill-bad {
  background: var(--playbook-danger-bg, rgba(142, 61, 28, 0.12));
  border-color: var(--playbook-danger-line, rgba(142, 61, 28, 0.24));
  color: var(--playbook-danger-ink, #8e3d1c);
}

.admin-pill-neutral {
  color: var(--playbook-ink);
}

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

.admin-link-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--playbook-line-soft);
  background: var(--playbook-surface-soft);
  text-decoration: none;
}

.admin-link-card strong {
  font-size: 0.96rem;
}

.admin-link-card span {
  color: var(--playbook-ink-muted);
  font-size: 0.86rem;
}

.admin-link-card:hover {
  border-color: var(--playbook-line);
  transform: translateY(-1px);
}

.admin-link-card-compact {
  gap: 2px;
  padding: 12px 14px;
}

.admin-link-card-compact strong {
  font-size: 0.92rem;
}

.admin-link-card-compact span {
  font-size: 0.82rem;
}

.admin-action-section {
  display: grid;
  gap: 10px;
}

.admin-action-section h4 {
  margin: 0;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--playbook-ink-muted);
}

.admin-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-log {
  margin: 0;
  min-height: 380px;
  max-height: 620px;
  overflow: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--playbook-line-soft);
  background: var(--playbook-surface-soft);
  color: var(--playbook-ink);
  padding: 16px;
  line-height: 1.55;
}

.dashboard-footer {
  color: var(--playbook-ink-muted);
}

.form-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}

.text-input,
.playground-code {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  font: inherit;
}

.text-input {
  min-height: 44px;
  padding: 10px 12px;
}

.form-error {
  margin: 2px 0 0;
  color: #8e3d1c;
  min-height: 20px;
  font-size: 0.9rem;
}

.assessment-shell {
  border-radius: 22px;
  border: 1px solid rgba(16, 22, 31, 0.35);
  background: linear-gradient(180deg, #202632 0%, #171c26 100%);
  box-shadow: 0 28px 70px rgba(16, 22, 31, 0.35);
  padding: 18px;
  color: #d8e0ea;
}

.assessment-shell h2,
.assessment-shell h3,
.assessment-shell p {
  color: inherit;
}

.assessment-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.assessment-topbar .eyebrow {
  color: #83b7f8;
  margin-bottom: 8px;
}

.assessment-runtime-note {
  margin: 10px 0 0;
  color: #98abc3;
  font-family: var(--mono-font);
  font-size: 0.85rem;
}

.assessment-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.assessment-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(138, 155, 178, 0.28);
  background: rgba(31, 42, 56, 0.75);
  color: #a8bbd1;
  font-family: var(--mono-font);
  font-size: 0.77rem;
}

.playground-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 1fr);
  gap: 12px;
  align-items: stretch;
}

.playground-panel {
  min-width: 0;
  border: 1px solid rgba(138, 155, 178, 0.24);
  border-radius: 14px;
  background: #121822;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.playground-panel-editor {
  grid-column: 1;
  order: 1;
}

.playground-panel-output {
  grid-column: 2;
  order: 2;
}

.playground-note {
  margin: 0;
  padding: 10px 12px 0;
  color: #98abc3;
  font-family: var(--mono-font);
  font-size: 0.9rem;
}

.ide-shell {
  margin-top: 10px;
  border-radius: 22px;
  border: 1px solid rgba(16, 22, 31, 0.35);
  background: linear-gradient(180deg, #202632 0%, #171c26 100%);
  box-shadow: 0 28px 70px rgba(16, 22, 31, 0.35);
  padding: 18px;
  color: #d8e0ea;
}

.ide-shell h2,
.ide-shell h3,
.ide-shell p {
  color: inherit;
}

.ide-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ide-branding .eyebrow {
  color: #83b7f8;
  margin-bottom: 8px;
}

.ide-branding h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.03em;
}

.ide-runbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.ide-shell .button,
.assessment-shell .button {
  background: #7bcd7a;
  color: #0f1a11;
}

.ide-shell .button:hover,
.assessment-shell .button:hover {
  background: #69bd68;
}

.ide-shell .ghost-button,
.assessment-shell .ghost-button {
  border-color: rgba(216, 224, 234, 0.2);
  color: #d8e0ea;
  background: rgba(37, 46, 60, 0.65);
}

.ide-status {
  margin: 14px 0 0;
  font-size: 0.95rem;
  color: #9db0c7;
}

.ide-status::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 10px;
  background: #5ed39b;
  box-shadow: 0 0 0 5px rgba(94, 211, 155, 0.18);
}

.ide-status.status-error {
  color: #e7a28e;
}

.ide-status.status-error::before {
  background: #d07053;
  box-shadow: 0 0 0 5px rgba(208, 112, 83, 0.2);
}

.ide-workspace {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  border: 1px solid rgba(138, 155, 178, 0.24);
  border-radius: 14px;
  overflow: hidden;
}

.ide-sidebar {
  background: linear-gradient(180deg, #2a3040 0%, #222838 100%);
  border-right: 1px solid rgba(138, 155, 178, 0.22);
  padding: 14px 12px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.ide-sidebar-title {
  margin: 0 0 8px;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9cb0c9;
}

.ide-badge-list,
.ide-files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.ide-badge-list li {
  font-size: 0.85rem;
  color: #d8e0ea;
  border: 1px solid rgba(138, 155, 178, 0.26);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(58, 74, 96, 0.45);
}

.ide-files li {
  font-size: 0.9rem;
  color: #c6d2e1;
  border-radius: 8px;
  padding: 6px 8px;
}

.ide-files li:first-child {
  background: rgba(123, 205, 122, 0.14);
  color: #d7f2d6;
}

.ide-editor-pane {
  background: #131a24;
  padding: 0;
}

.ide-editor-head,
.editor-head,
.playground-output-head {
  min-height: 52px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(138, 155, 178, 0.2);
}

.editor-head h3,
.playground-output-head h3 {
  color: #d8e0ea;
}

.ide-editor-head p {
  margin: 0;
  color: #98abc3;
  font-family: var(--mono-font);
  font-size: 0.9rem;
}

.playground-output-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.editor-frame {
  background: linear-gradient(180deg, #111823 0%, #0d141e 100%);
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  min-height: 430px;
}

.editor-gutter {
  border-right: 1px solid rgba(138, 155, 178, 0.2);
  color: #7e92ae;
  font-family: var(--mono-font);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 14px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

.playground-code {
  margin: 0;
  min-height: 430px;
  resize: vertical;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #dbe3ee;
  padding: 14px;
  font-family: var(--mono-font);
  line-height: 1.6;
  font-size: 0.95rem;
}

.playground-code:focus {
  outline: none;
}

.ide-output-pane {
  margin-top: 12px;
  border: 1px solid rgba(138, 155, 178, 0.22);
  border-radius: 14px;
  background: #121822;
  overflow: hidden;
}

.run-summary {
  padding: 10px 12px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.playground-meta {
  margin: 10px 0 0;
  padding: 0 12px;
  color: #9db0c7;
}

.playground-meta .status-dot {
  background: #5ed39b;
  box-shadow: 0 0 0 5px rgba(94, 211, 155, 0.18);
}

.playground-meta .status-error {
  color: #efb8a8;
}

.run-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(138, 155, 178, 0.28);
  background: rgba(31, 42, 56, 0.75);
  color: #a8bbd1;
  font-family: var(--mono-font);
  font-size: 0.77rem;
}

.run-chip-alert {
  background: rgba(208, 112, 83, 0.2);
  border-color: rgba(208, 112, 83, 0.48);
  color: #efb8a8;
}

.playground-output {
  margin: 10px 12px 12px;
  min-height: 240px;
  max-height: 420px;
  overflow: auto;
  border-radius: 10px;
  border: 1px solid rgba(138, 155, 178, 0.26);
  background: #0b1119;
  color: #d0d9e4;
  padding: 12px;
  line-height: 1.6;
}

@media (max-width: 980px) {
  body.playbook-page {
    overflow: auto;
    height: auto;
  }

  .playbook-frame {
    height: auto;
    display: block;
    overflow: visible;
  }

  .essay-page .playbook-header {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
  }

  .essay-page .playbook-header > * {
    min-width: 0;
  }

  .essay-page .brand {
    flex: 0 1 auto;
  }

  .essay-page .page-header-actions {
    flex: 1 1 100%;
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: 0;
  }

  .essay-page .page-link-group,
  .essay-page .page-utility-group {
    min-width: 0;
    flex-wrap: wrap;
  }

  .essay-page .page-link-group .ghost-button,
  .essay-page .page-utility-group .ghost-button {
    min-width: 0;
  }

  body.article-page {
    overflow: auto;
  }

  .article-shell {
    min-height: auto;
    display: block;
  }

  .hero-grid,
  .page-hero-grid,
  .page-layout,
  .article-main,
  .playbook-shell,
  .admin-summary-grid,
  .topic-grid,
  .section-grid,
  .term-grid,
  .note-grid,
  .metric-grid,
  .resource-grid,
  .status-summary,
  .strip,
  .summary-grid,
  .equation-grid,
  .compare-grid,
  .concept-grid {
    grid-template-columns: 1fr;
  }

  .admin-overview-grid {
    grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr);
    align-items: stretch;
  }

  .chapter-nav {
    position: static;
  }

  .article-sidebar,
  .article-scroll {
    overflow: visible;
    padding: 0;
  }

  .playbook-sidebar,
  .playbook-reader {
    overflow: visible;
    padding: 0;
    height: auto;
  }

  .essay-page .playbook-shell {
    gap: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .essay-page .playbook-sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-bottom: 18px;
    padding-bottom: 10px;
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--playbook-bg) 96%, transparent) 0%,
      color-mix(in srgb, var(--playbook-bg) 82%, transparent) 78%,
      transparent 100%
    );
    backdrop-filter: blur(12px);
  }

  .essay-sidebar .playbook-sidebar-inner {
    gap: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .essay-page .playbook-outline {
    padding: 0 0 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .essay-page .playbook-outline p {
    margin: 0 0 8px;
  }

  .essay-page .playbook-outline > ol {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 2px 0 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  .essay-page .playbook-outline > ol::-webkit-scrollbar {
    display: none;
  }

  .essay-page .playbook-outline > ol > li {
    flex: 0 0 auto;
    scroll-snap-align: start;
    max-width: min(78vw, 18rem);
  }

  .essay-page .playbook-outline .outline-folder {
    gap: 8px;
    margin-top: 0;
  }

  .essay-page .playbook-outline .outline-folder-label {
    padding: 0 2px;
    color: var(--playbook-ink-muted);
    font-size: 0.68rem;
    white-space: nowrap;
  }

  .essay-page .playbook-outline .outline-folder-list {
    display: grid;
    gap: 8px;
    padding-left: 0;
  }

  .essay-page .playbook-outline a {
    padding: 9px 14px;
    border: 1px solid var(--playbook-line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--playbook-bg) 92%, transparent);
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.3;
  }

  .essay-page .playbook-outline a:hover,
  .essay-page .playbook-outline a.active {
    border-left-color: var(--playbook-line);
    border-color: var(--playbook-line);
    background: color-mix(in srgb, var(--playbook-ink) 8%, transparent);
  }

  .playbook-divider-toggle {
    display: none;
  }

  body.outline-collapsed .playbook-sidebar {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  .playground-workspace {
    grid-template-columns: 1fr;
  }

  .essay-page .playbook-reader,
  .essay-page .playbook-content,
  .essay-page .essay-content,
  .essay-page .onepage-source-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .essay-page .onepage-source-content {
    overflow-x: hidden;
  }

  .links-pdf-actions {
    justify-content: flex-start;
  }

  .links-pdf-modal {
    align-items: stretch;
    padding: 0;
  }

  .links-pdf-panel {
    width: 100%;
    max-height: none;
    height: 100dvh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .links-pdf-modal-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .links-pdf-modal-actions {
    width: 100%;
    justify-content: space-between;
  }

  .links-pdf-modal-body {
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
  }

  .onepage-pdf-viewer {
    display: none;
  }

  .links-mobile-pdf-reader {
    display: block;
  }

  .links-pdf-toolbar {
    position: sticky;
    top: 0;
    z-index: 8;
    padding: 8px 14px;
    background: color-mix(in srgb, var(--playbook-bg) 94%, transparent);
    backdrop-filter: blur(10px);
  }

  .links-pdf-page {
    align-items: flex-start;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .essay-page .onepage-source-content mjx-container {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

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

  .news-main {
    height: auto;
    overflow: visible;
  }

  .news-list {
    overflow: visible;
    padding-right: 0;
  }

  .news-meta-panel {
    min-width: 0;
    text-align: left;
  }

  .news-item-media {
    flex-basis: 110px;
  }

  .chapter-index-card {
    grid-template-columns: 1fr;
  }

  .visual-grid-double {
    grid-template-columns: 1fr;
  }

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

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

  .ide-workspace {
    grid-template-columns: 1fr;
  }

  .ide-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(138, 155, 178, 0.22);
  }
}

@media (max-width: 720px) {
  .site-shell {
    width: min(100% - 20px, var(--page-width));
    padding-top: 18px;
  }

  .essay-page .site-shell,
  .news-page .site-shell {
    padding-top: 12px;
  }

  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header {
    border-radius: 28px;
  }

  .essay-page .playbook-header,
  .essay-page .page-header-actions,
  .essay-page .page-link-group,
  .essay-page .page-utility-group {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .essay-page .page-header-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .essay-page .page-link-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .essay-page .page-utility-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .essay-page .page-link-group .ghost-button,
  .essay-page .page-utility-group .ghost-button {
    width: 100%;
    min-width: 0;
    padding: 0 8px;
  }

  .page-header-actions,
  .page-link-group,
  .page-utility-group {
    width: 100%;
  }

  .page-header-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .page-link-group,
  .page-utility-group {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .page-link-group .ghost-button,
  .page-utility-group .ghost-button {
    min-width: 0;
    flex: 1 1 160px;
  }

  .essay-page .page-link-group .ghost-button,
  .essay-page .page-utility-group .ghost-button,
  .news-page .page-link-group .ghost-button,
  .news-page .page-utility-group .ghost-button {
    flex: 1 1 120px;
  }

  .essay-page .page-link-group .ghost-button,
  .essay-page .page-utility-group .ghost-button {
    flex: 1 1 auto;
  }

  .hero,
  .page-hero {
    padding: 26px 22px;
  }

  .playbook-section,
  .playbook-intro,
  .playbook-outline {
    padding: 0;
  }

  .essay-page .playbook-sidebar {
    margin-bottom: 16px;
    padding-bottom: 8px;
  }

  .essay-page .playbook-outline p {
    margin-bottom: 6px;
    font-size: 0.66rem;
    letter-spacing: 0.16em;
  }

  .essay-page .playbook-outline a {
    padding: 8px 12px;
    font-size: 0.84rem;
  }

  .lang-switch-floating {
    left: auto;
    right: 10px;
    bottom: 10px;
  }

  .playground-page .playground-code,
  .playground-page .playground-output {
    min-height: 280px;
  }

  .playground-surface-head {
    flex-direction: column;
    align-items: stretch;
  }

  .news-frame {
    width: min(100% - 20px, var(--page-width));
  }

  .news-item {
    flex-wrap: wrap;
    gap: 12px;
  }

  .news-item-media {
    flex: 0 0 100%;
    max-width: 100%;
    aspect-ratio: 16 / 7;
    min-height: unset;
  }

  .playground-editor-actions {
    justify-content: flex-start;
  }

  .article-outline {
    padding: 18px;
  }

  .article-scroll {
    padding-top: 0;
  }

  .section-card,
  .topic-card,
  .entry-card,
  .status-card,
  .resource-card,
  .term-card,
  .spotlight-card,
  .trap-card,
  .metric-card,
  .summary-card {
    padding: 18px;
  }

  .ide-shell {
    padding: 14px;
  }

  .flow-row,
  .sequence-row {
    align-items: stretch;
  }

  .flow-arrow {
    display: none;
  }

  .assessment-shell {
    padding: 14px;
  }

  .playground-grid {
    grid-template-columns: 1fr;
  }

  .admin-overview-grid {
    grid-template-columns: 1fr;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-kv-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .admin-stat-grid,
  .admin-link-grid {
    grid-template-columns: 1fr;
  }

  .playground-panel-editor,
  .playground-panel-output {
    grid-column: auto;
  }

  .editor-frame,
  .playground-code,
  .playground-output {
    min-height: 300px;
  }

  .ide-runbar {
    width: 100%;
  }

  .ide-runbar .button,
  .ide-runbar .ghost-button {
    flex: 1;
  }

  .playground-output-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .playground-output-actions {
    width: 100%;
  }

  .playground-output-actions .button,
  .playground-output-actions .ghost-button {
    flex: 1;
  }
}

@media (max-width: 720px) {
  .playbook-page .playbook-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 8px;
    padding-bottom: 8px;
  }

  .playbook-page .brand {
    gap: 8px;
    min-height: 30px;
  }

  .playbook-page .brand-mark {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
  }

  .playbook-page .playbook-brand-label {
    min-height: 30px;
    font-size: 0.84rem;
  }

  .playbook-page .page-header-actions {
    display: contents;
  }

  .playbook-page .page-link-group {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .playbook-page .page-link-group::-webkit-scrollbar {
    display: none;
  }

  .playbook-page .page-utility-group {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    min-width: 0;
    max-width: max-content;
    justify-content: flex-end;
    justify-self: end;
  }

  .playbook-page .playbook-header .page-link-group .ghost-button {
    flex: 0 0 auto;
    width: auto;
    max-width: max-content;
    min-width: 0;
    min-height: 30px;
    padding: 0 9px;
  }

  .playbook-page .playbook-header .page-utility-group .theme-toggle {
    flex: 0 0 30px;
    width: 30px;
    max-width: 30px;
    min-width: 30px;
    min-height: 30px;
    padding: 0;
    font-size: 0;
  }

  .playbook-page .playbook-header .page-utility-group .theme-toggle::before {
    content: "";
    width: 13px;
    height: 13px;
    border: 2px solid currentColor;
    border-radius: 50%;
    box-shadow: inset -4px -4px 0 currentColor;
  }

  body.playbook-page[data-theme="dark"] .playbook-header .page-utility-group .theme-toggle::before {
    background: currentColor;
    box-shadow: none;
  }

  .news-page {
    overflow-x: hidden;
  }

  .news-frame,
  .news-main,
  .news-topbar,
  .news-source-strip,
  .news-list,
  .news-item {
    min-width: 0;
    max-width: 100%;
  }

  .news-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .news-item-media {
    width: 100%;
    max-width: 100%;
    flex: none;
  }

  .news-source-chip,
  .news-category,
  .news-comments {
    max-width: 100%;
  }
}
