/* ============================================================
   Mind — architecture site
   Clean + futuristic. Cyan accent. Sharp geometry. System fonts.
   Light + dark via prefers-color-scheme (and html.dark for preview).
   ============================================================ */

:root {
  /* Surfaces */
  --bg: #f7f8fa;
  --paper: #ffffff;

  /* Ink */
  --ink: #0a0a0a;
  --ink-soft: #404040;
  --muted: #737373;

  /* Lines */
  --line: #e5e7eb;
  --line-soft: #f1f3f5;

  /* Accent — electric cyan */
  --accent: #0891b2;
  --accent-bright: #06b6d4;
  --accent-tint: #ecfeff;
  --accent-glow: 0 0 0 0 rgba(6,182,212,0);

  /* Warn — amber */
  --warn: #b45309;
  --warn-tint: #fffbeb;
  --warn-border: #fde68a;

  /* Shadows — subtle and crisp */
  --shadow-sm: 0 1px 2px rgba(10,10,10,0.04);
  --shadow: 0 1px 2px rgba(10,10,10,0.05), 0 6px 18px rgba(10,10,10,0.05);
  --shadow-lg: 0 4px 8px rgba(10,10,10,0.05), 0 24px 48px rgba(10,10,10,0.08);

  /* Geometry — sharper than before */
  --r-xs: 3px;
  --r-sm: 5px;
  --r-md: 8px;
  --r-lg: 12px;

  /* Top nav */
  --topnav-bg: rgba(247,248,250,0.82);
  --active-pill-bg: var(--ink);
  --active-pill-ink: #ffffff;
  --hover-border: #cbd5e1;
  --footnav-hover-border: #94a3b8;

  /* SVG stencil tokens */
  --svg-person-fill: #18181b;
  --svg-person-stroke: #000000;
  --svg-person-label: #ffffff;
  --svg-system-fill: #0c2942;
  --svg-system-stroke: #061a2b;
  --svg-system-label: #ffffff;
  --svg-system-ext-fill: #71717a;
  --svg-system-ext-stroke: #52525b;
  --svg-container-fill: #1e293b;
  --svg-container-stroke: #0f172a;
  --svg-container-label: #ffffff;
  --svg-container-soft-fill: #cffafe;
  --svg-container-soft-stroke: #67e8f9;
  --svg-container-label-dark: #083344;
  --svg-boundary-stroke: #a8a29e;
  --svg-boundary-label: #78716c;
  --svg-arrow-stroke: #44403c;
  --svg-arrow-label: #44403c;
  --svg-chip-bg: rgba(255,255,255,0.10);
  --svg-chip-border: rgba(255,255,255,0.30);
  --svg-chip-ink: #ffffff;
  --svg-drop-shadow: drop-shadow(0 1px 1px rgba(10,10,10,0.10));
}

/* ------------------------------------------------------------
   Dark theme — system preference OR html.dark (preview)
   ------------------------------------------------------------ */
:root.dark, html.dark {
  --bg: #08090b;
  --paper: #111114;
  --ink: #f5f5f5;
  --ink-soft: #d4d4d4;
  --muted: #a3a3a3;
  --line: #1f1f23;
  --line-soft: #17171a;

  --accent: #22d3ee;
  --accent-bright: #67e8f9;
  --accent-tint: #0a2329;
  --accent-glow: 0 0 16px rgba(34,211,238,0.18);

  --warn: #fbbf24;
  --warn-tint: #1d1605;
  --warn-border: #45370f;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
  --shadow: 0 1px 2px rgba(0,0,0,0.45), 0 8px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 4px 8px rgba(0,0,0,0.5), 0 24px 56px rgba(0,0,0,0.6);

  --topnav-bg: rgba(8,9,11,0.85);
  --active-pill-bg: var(--accent-bright);
  --active-pill-ink: #08090b;
  --hover-border: #2a2a30;
  --footnav-hover-border: #3a3a42;

  --svg-person-fill: #0a0a0c;
  --svg-person-stroke: #000000;
  --svg-person-label: #ffffff;
  --svg-system-fill: #0d2a44;
  --svg-system-stroke: #051628;
  --svg-system-label: #ffffff;
  --svg-system-ext-fill: #3f3f46;
  --svg-system-ext-stroke: #18181b;
  --svg-container-fill: #1a2433;
  --svg-container-stroke: #0a1220;
  --svg-container-label: #ffffff;
  --svg-container-soft-fill: #0a2329;
  --svg-container-soft-stroke: #22d3ee;
  --svg-container-label-dark: #cffafe;
  --svg-boundary-stroke: #525252;
  --svg-boundary-label: #a3a3a3;
  --svg-arrow-stroke: #a3a3a3;
  --svg-arrow-label: #a3a3a3;
  --svg-chip-bg: rgba(255,255,255,0.06);
  --svg-chip-border: rgba(255,255,255,0.18);
  --svg-chip-ink: #fafafa;
  --svg-drop-shadow: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #08090b;
    --paper: #111114;
    --ink: #f5f5f5;
    --ink-soft: #d4d4d4;
    --muted: #a3a3a3;
    --line: #1f1f23;
    --line-soft: #17171a;

    --accent: #22d3ee;
    --accent-bright: #67e8f9;
    --accent-tint: #0a2329;
    --accent-glow: 0 0 16px rgba(34,211,238,0.18);

    --warn: #fbbf24;
    --warn-tint: #1d1605;
    --warn-border: #45370f;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
    --shadow: 0 1px 2px rgba(0,0,0,0.45), 0 8px 24px rgba(0,0,0,0.5);
    --shadow-lg: 0 4px 8px rgba(0,0,0,0.5), 0 24px 56px rgba(0,0,0,0.6);

    --topnav-bg: rgba(8,9,11,0.85);
    --active-pill-bg: var(--accent-bright);
    --active-pill-ink: #08090b;
    --hover-border: #2a2a30;
    --footnav-hover-border: #3a3a42;

    --svg-person-fill: #0a0a0c;
    --svg-person-stroke: #000000;
    --svg-person-label: #ffffff;
    --svg-system-fill: #0d2a44;
    --svg-system-stroke: #051628;
    --svg-system-label: #ffffff;
    --svg-system-ext-fill: #3f3f46;
    --svg-system-ext-stroke: #18181b;
    --svg-container-fill: #1a2433;
    --svg-container-stroke: #0a1220;
    --svg-container-label: #ffffff;
    --svg-container-soft-fill: #0a2329;
    --svg-container-soft-stroke: #22d3ee;
    --svg-container-label-dark: #cffafe;
    --svg-boundary-stroke: #525252;
    --svg-boundary-label: #a3a3a3;
    --svg-arrow-stroke: #a3a3a3;
    --svg-arrow-label: #a3a3a3;
    --svg-chip-bg: rgba(255,255,255,0.06);
    --svg-chip-border: rgba(255,255,255,0.18);
    --svg-chip-ink: #fafafa;
    --svg-drop-shadow: none;
  }
}

/* ------------------------------------------------------------
   Reset + base
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Display",
               "Segoe UI", system-ui, Roboto, sans-serif;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
}

code, .mono {
  font-family: ui-monospace, "JetBrains Mono", "IBM Plex Mono", "SF Mono",
               Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--line-soft);
  border: 1px solid var(--line);
  padding: 0.5px 5px;
  border-radius: var(--r-xs);
  color: var(--ink);
}

a { color: var(--accent-bright); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ------------------------------------------------------------
   Top nav
   ------------------------------------------------------------ */
.topnav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--topnav-bg);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.topnav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}
.brand-sub {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  margin-left: 8px;
}
.topnav nav {
  display: flex;
  gap: 2px;
  font-size: 13px;
}
.topnav nav a {
  color: var(--ink-soft);
  padding: 6px 12px;
  border-radius: var(--r-sm);
  transition: background 0.12s, color 0.12s;
  font-weight: 500;
  text-decoration: none;
}
.topnav nav a:hover {
  background: var(--line-soft);
  color: var(--ink);
  text-decoration: none;
}
.topnav nav a[aria-current="page"] {
  background: var(--active-pill-bg);
  color: var(--active-pill-ink);
  font-weight: 600;
}

/* ------------------------------------------------------------
   Layout shell
   ------------------------------------------------------------ */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 64px 28px 112px;
}

/* ------------------------------------------------------------
   Kicker — small mono badge above section titles
   ------------------------------------------------------------ */
.kicker {
  display: inline-block;
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 10.5px;
  color: var(--accent-bright);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 14px;
  padding: 4px 9px;
  background: var(--accent-tint);
  border: 1px solid color-mix(in srgb, var(--accent-bright) 25%, transparent);
  border-radius: var(--r-xs);
  box-shadow: var(--accent-glow);
}
.kicker.warn {
  color: var(--warn);
  background: var(--warn-tint);
  border-color: var(--warn-border);
  box-shadow: none;
}

/* ------------------------------------------------------------
   Hero (index)
   ------------------------------------------------------------ */
.hero { margin-bottom: 56px; }
.hero h1 {
  margin: 0 0 22px;
  font-size: 64px;
  letter-spacing: -0.04em;
  line-height: 0.95;
  font-weight: 700;
}
.hero .tagline {
  font-size: 20px;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 720px;
  margin: 0;
  letter-spacing: -0.005em;
}
.hero .meta {
  margin-top: 26px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0;
}
.hero .meta-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 10px var(--accent-bright);
}

/* ------------------------------------------------------------
   Article head (used on protocol.html)
   ------------------------------------------------------------ */
.article-head {
  margin-bottom: 48px;
  max-width: 760px;
}
.article-head h1 {
  margin: 0 0 16px;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.lead {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
}

/* ------------------------------------------------------------
   Sections
   ------------------------------------------------------------ */
main > section { margin-bottom: 56px; }
main > section > h2:not(.notes h2) {
  margin: 0 0 8px;
  font-size: 26px;
  letter-spacing: -0.02em;
  font-weight: 700;
}

/* ------------------------------------------------------------
   Diagram card
   ------------------------------------------------------------ */
.diagram-block {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 28px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}
.diagram {
  margin: 0 -4px;
  overflow-x: auto;
}
.diagram svg { width: 100%; height: auto; display: block; }
.caption {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 20px;
  padding: 0 4px;
  line-height: 1.55;
  max-width: 820px;
}
.caption a { color: var(--accent-bright); }
.legend {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  font-size: 12px;
  color: var(--muted);
}
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.swatch {
  width: 14px; height: 10px;
  border-radius: var(--r-xs);
  display: inline-block;
}

/* ------------------------------------------------------------
   Mind hero diagram — Layered architecture (HTML + CSS only)
   Stacked horizontal bands, one per layer. Big monospace
   layer number on the left. Cyan accent on the canonical
   Pod layer. Theme-stable cinematic dark look — intentional,
   sits as a deliberate panel inside the document.
   ------------------------------------------------------------ */
.diagram-layers {
  /* deep, near-black backdrop, cinematic */
  background:
    radial-gradient(ellipse 80% 60% at 50% 50%, rgba(34,211,238,0.06) 0%, transparent 70%),
    linear-gradient(180deg, #0b0d12 0%, #07080b 100%);
  border: 1px solid #1e2939;
  border-radius: var(--r-lg);
  padding: 0;                       /* override .diagram-block padding */
  margin: 16px 0 32px;
  overflow: hidden;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Inter", sans-serif;
  color: #e2e8f0;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 30px 60px -30px rgba(0,0,0,0.6);
  position: relative;
}

/* corner brackets — subtle ornamental ticks */
.diagram-layers::before,
.diagram-layers::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(34,211,238,0.45);
  pointer-events: none;
}
.diagram-layers::before {
  top: 8px; left: 8px;
  border-right: 0;
  border-bottom: 0;
}
.diagram-layers::after {
  bottom: 8px; right: 8px;
  border-left: 0;
  border-top: 0;
}

/* ---- Layer band ---- */
.diagram-layers .layer {
  position: relative;
  padding: 26px 36px 26px 28px;
  border-top: 1px solid rgba(148,163,184,0.08);
  background:
    linear-gradient(180deg, rgba(15,23,42,0.35) 0%, rgba(8,11,18,0.55) 100%);
}
.diagram-layers .layer:first-child { border-top: 0; }

/* left rail indicator — subtle, off by default */
.diagram-layers .layer::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: transparent;
  transition: background 0.3s;
}

/* tick mark between layers (subtle continuity) */
.diagram-layers .layer:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 76px;
  bottom: -1px;
  width: 10px;
  height: 2px;
  background: rgba(148,163,184,0.35);
  z-index: 1;
}

/* ---- Layer header (number + name + tagline) ---- */
.diagram-layers .layer-head {
  display: flex;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 16px;
}
.diagram-layers .layer-num {
  font-family: ui-monospace, "JetBrains Mono", "SF Mono", "Menlo", monospace;
  font-size: 40px;
  font-weight: 300;
  letter-spacing: -1.5px;
  line-height: 1;
  width: 56px;
  text-align: right;
  background: linear-gradient(180deg, rgba(148,163,184,0.85) 0%, rgba(71,85,105,0.4) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
}
.diagram-layers .layer-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.diagram-layers .layer-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3.5px;
  color: #e2e8f0;
}
.diagram-layers .layer-tag {
  font-size: 12px;
  font-weight: 400;
  color: rgba(148,163,184,0.75);
  letter-spacing: 0.2px;
}

/* ---- Layer body (chips) ---- */
.diagram-layers .layer-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 80px;       /* align with start of layer-name */
}
.diagram-layers .chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(71, 85, 105, 0.55);
  border-radius: 3px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #cbd5e1;
  letter-spacing: 0.2px;
  text-decoration: none;
  transition: border-color 0.18s, color 0.18s, background 0.18s, transform 0.18s;
}
/* Link chips get a subtle external-link arrow and cyan-tinted hover */
a.chip {
  cursor: pointer;
  color: #e2e8f0;
  position: relative;
  padding-right: 22px;
}
a.chip::after {
  content: "→";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-52%);
  font-size: 10px;
  color: rgba(34,211,238,0.55);
  transition: transform 0.18s, color 0.18s;
}
a.chip:hover {
  background: rgba(8, 32, 52, 0.7);
  border-color: rgba(34, 211, 238, 0.55);
  color: #cffafe;
}
a.chip:hover::after {
  color: #67e8f9;
  transform: translateY(-52%) translateX(2px);
}
.diagram-layers .chip:not(a):hover {
  border-color: rgba(148, 163, 184, 0.8);
}

/* ---- Canonical layer (Pod) — cyan accent ---- */
.diagram-layers .layer.is-canonical {
  background:
    linear-gradient(180deg, rgba(8,32,52,0.55) 0%, rgba(7,18,30,0.75) 100%);
  border-top-color: rgba(34,211,238,0.20);
}
.diagram-layers .layer.is-canonical + .layer { border-top-color: rgba(34,211,238,0.20); }
.diagram-layers .layer.is-canonical::before {
  background: linear-gradient(180deg, transparent 0%, #22d3ee 50%, transparent 100%);
  box-shadow: 0 0 14px rgba(34,211,238,0.5);
}
.diagram-layers .layer.is-canonical .layer-num {
  background: linear-gradient(180deg, #67e8f9 0%, #22d3ee 60%, rgba(34,211,238,0.4) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
}
.diagram-layers .layer.is-canonical .layer-name {
  color: #cffafe;
}
.diagram-layers .layer.is-canonical .layer-tag {
  color: rgba(103,232,249,0.7);
}
.diagram-layers .chip-pod {
  background: rgba(8, 41, 66, 0.7);
  border-color: rgba(34, 211, 238, 0.45);
  color: #cffafe;
  box-shadow: inset 0 0 14px rgba(34,211,238,0.10);
}

/* ---- External layer (WebID) — most recessive ---- */
.diagram-layers .layer.is-external {
  background:
    linear-gradient(180deg, rgba(10,10,12,0.6) 0%, rgba(5,5,7,0.85) 100%);
}
.diagram-layers .layer.is-external .layer-num {
  background: linear-gradient(180deg, rgba(100,116,139,0.7) 0%, rgba(51,65,85,0.3) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
}
.diagram-layers .layer.is-external .layer-name {
  color: rgba(203,213,225,0.8);
}
.diagram-layers .chip-id {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  background: rgba(5,5,7,0.7);
  border-color: rgba(51,65,85,0.6);
  color: rgba(148,163,184,0.85);
  font-size: 11.5px;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .diagram-layers .layer { padding: 22px 20px; }
  .diagram-layers .layer-head { gap: 16px; }
  .diagram-layers .layer-num { font-size: 32px; width: 42px; }
  .diagram-layers .layer-body { padding-left: 0; margin-top: 4px; }
  .diagram-layers .layer:not(:last-child)::after { left: 24px; }
}

/* ============================================================
   Solid primer graphics
   Shared base (.diagram-block.diagram-*) gives the dark
   cinematic panel; each graphic adds its own internal layout.
   ============================================================ */
.diagram-block[class*="diagram-shift"],
.diagram-block.diagram-many,
.diagram-block.diagram-pod-tree,
.diagram-block.diagram-webid,
.diagram-block.diagram-signin,
.diagram-block.diagram-hosts {
  background:
    radial-gradient(ellipse 80% 60% at 50% 50%, rgba(34,211,238,0.05) 0%, transparent 70%),
    linear-gradient(180deg, #0b0d12 0%, #07080b 100%);
  border: 1px solid #1e2939;
  color: #e2e8f0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Inter", sans-serif;
  margin: 16px 0 32px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.6);
}

/* ============================================================
   GRAPHIC 1 — Before vs After (silos vs hub)
   ============================================================ */
.diagram-shift {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.shift-pane {
  padding: 28px 24px 24px;
  position: relative;
}
.shift-before {
  border-right: 1px solid rgba(148,163,184,0.10);
}
.shift-after {
  background: linear-gradient(180deg, rgba(7,32,52,0.30) 0%, rgba(5,18,30,0.50) 100%);
}
.shift-after::before {
  content: "";
  position: absolute;
  left: 0; top: 14%; bottom: 14%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(34,211,238,0.4), transparent);
}
.shift-tag {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(148,163,184,0.5);
  margin-bottom: 4px;
}
.shift-after .shift-tag { color: rgba(103,232,249,0.65); }
.shift-headline {
  font-size: 14px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.3px;
  margin-bottom: 22px;
}
.shift-after .shift-headline { color: #cffafe; }

/* silos (left) */
.shift-viz {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 6px 0 16px;
  flex-wrap: wrap;
}
.silo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.silo-cell {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 3px;
  min-width: 70px;
  text-align: center;
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(71,85,105,0.5);
  color: #cbd5e1;
}
.silo-cell.user {
  background: transparent;
  border-style: dashed;
  color: rgba(203,213,225,0.65);
  font-style: italic;
}
.silo-cell.app {
  background: rgba(30,41,59,0.7);
  color: #e2e8f0;
}
.silo-cell.db {
  background: rgba(20,15,15,0.7);
  border-color: rgba(120,80,80,0.5);
  color: rgba(252,165,165,0.85);
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
}
.silo-arrow {
  font-size: 10px;
  color: rgba(148,163,184,0.45);
  line-height: 1;
}

/* hub (right) */
.hub {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.hub-cell {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 3px;
  text-align: center;
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(71,85,105,0.5);
  color: #cbd5e1;
}
.hub-cell.user {
  background: transparent;
  border-style: dashed;
  color: rgba(207,250,254,0.85);
  font-style: italic;
}
.hub-cell.pod {
  background: rgba(8,32,52,0.7);
  border-color: rgba(34,211,238,0.5);
  color: #cffafe;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 8px 20px;
  box-shadow: inset 0 0 14px rgba(34,211,238,0.10);
}
.hub-arrow, .hub-fan {
  font-size: 11px;
  color: rgba(103,232,249,0.45);
  letter-spacing: 4px;
  line-height: 1;
}
.hub-apps {
  display: flex;
  gap: 8px;
}
.hub-app {
  font-size: 11px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 3px;
  background: rgba(30,41,59,0.7);
  border: 1px solid rgba(71,85,105,0.5);
  color: #e2e8f0;
}
.shift-note {
  font-size: 11px;
  color: rgba(148,163,184,0.65);
  text-align: center;
  margin-top: 14px;
  font-style: italic;
}

/* ============================================================
   GRAPHIC 2 — One pod, many views
   ============================================================ */
.diagram-many {
  padding: 28px 24px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.many-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.many-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
  min-width: 130px;
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(71,85,105,0.5);
  border-radius: 4px;
}
.many-app-icon { font-size: 18px; line-height: 1; }
.many-app-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #cbd5e1;
  text-transform: uppercase;
}
.many-app-view {
  font-size: 11px;
  color: rgba(203,213,225,0.7);
  text-align: center;
  font-style: italic;
}
.many-fan {
  font-size: 11px;
  color: rgba(103,232,249,0.55);
  letter-spacing: 6px;
  line-height: 1;
}
.many-source {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 22px;
  background: rgba(8,32,52,0.7);
  border: 1px solid rgba(34,211,238,0.5);
  border-radius: 4px;
  box-shadow: inset 0 0 16px rgba(34,211,238,0.10);
}
.many-source-label {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 3px;
  color: #67e8f9;
  font-weight: 700;
}
.many-source-path {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 12px;
  color: #cffafe;
}
.many-note {
  font-size: 11px;
  color: rgba(148,163,184,0.65);
  font-style: italic;
  margin-top: 4px;
}

/* ============================================================
   GRAPHIC 3 — Pod folder tree
   ============================================================ */
.diagram-pod-tree {
  padding: 0;
}
.pod-tree-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(148,163,184,0.10);
  background: rgba(15,23,42,0.5);
}
.pod-tree-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 8px rgba(34,211,238,0.6);
}
.pod-tree-host {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 13px;
  color: #cffafe;
  font-weight: 600;
}
.pod-tree-chip {
  margin-left: auto;
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(103,232,249,0.7);
  padding: 3px 9px;
  border: 1px solid rgba(34,211,238,0.4);
  border-radius: 2px;
  text-transform: uppercase;
}
.pod-tree-body {
  padding: 16px 20px;
  font-family: ui-monospace, "JetBrains Mono", "SF Mono", "Menlo", monospace;
  font-size: 12.5px;
  line-height: 1.85;
  color: #cbd5e1;
}
.tree-line {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tree-line.indent { padding-left: 22px; }
.tree-prefix {
  color: rgba(100,116,139,0.6);
  user-select: none;
}
.tree-name {
  color: #e2e8f0;
  min-width: 140px;
}
.tree-name.shared {
  color: #67e8f9;
}
.tree-comment {
  color: rgba(100,116,139,0.7);
  font-style: italic;
  font-size: 11.5px;
}
.pod-tree-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 12px 20px;
  border-top: 1px solid rgba(148,163,184,0.10);
  background: rgba(7,8,11,0.5);
  font-size: 11px;
  color: rgba(148,163,184,0.75);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.legend-dot.legend-shared { background: #67e8f9; box-shadow: 0 0 6px rgba(34,211,238,0.5); }
.legend-dot.legend-private { background: #475569; }

/* ============================================================
   GRAPHIC 4 — WebID anatomy
   ============================================================ */
.diagram-webid {
  padding: 32px 24px 26px;
}
.webid-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 17px;
  margin-bottom: 6px;
}
.webid-part {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1px;
}
.webid-text {
  color: rgba(203,213,225,0.85);
  border-bottom: 2px solid rgba(71,85,105,0.5);
  padding: 4px 4px 8px;
  line-height: 1.2;
}
.webid-part.highlight .webid-text {
  color: #cffafe;
  border-bottom-color: #22d3ee;
  text-shadow: 0 0 12px rgba(34,211,238,0.35);
}
.webid-label {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 9.5px;
  letter-spacing: 1.5px;
  color: rgba(148,163,184,0.7);
  margin-top: 10px;
  text-transform: uppercase;
  white-space: nowrap;
}
.webid-part.highlight .webid-label { color: #67e8f9; }
.webid-caption {
  margin-top: 22px;
  text-align: center;
  font-size: 12px;
  color: rgba(148,163,184,0.75);
  font-style: italic;
}
.webid-caption code {
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  background: rgba(34,211,238,0.10);
  color: #67e8f9;
  padding: 1px 5px;
  border-radius: 3px;
  font-style: normal;
}

/* ============================================================
   GRAPHIC 5 — Sign-in flow (numbered sequence)
   ============================================================ */
.diagram-signin {
  padding: 24px 28px 28px;
}
.signin-title {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(103,232,249,0.55);
  margin-bottom: 18px;
  text-align: center;
}
.signin-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.signin-steps li {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px dashed rgba(148,163,184,0.10);
  margin: 0;
}
.signin-steps li:last-child { border-bottom: 0; }
.signin-num {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  width: 36px;
  text-align: right;
  flex-shrink: 0;
  background: linear-gradient(180deg, #67e8f9 0%, rgba(34,211,238,0.35) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  padding-top: 2px;
}
.signin-body { flex: 1; }
.signin-headline {
  font-size: 13px;
  color: #e2e8f0;
  line-height: 1.5;
}
.signin-headline b { color: #cffafe; font-weight: 700; }
.signin-detail {
  margin-top: 4px;
  font-size: 11.5px;
  color: rgba(148,163,184,0.75);
  line-height: 1.5;
  font-style: italic;
}
.signin-detail code {
  font-style: normal;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: #67e8f9;
  background: rgba(34,211,238,0.08);
  padding: 0 4px;
  border-radius: 2px;
}

/* ============================================================
   GRAPHIC 6 — Where pods can live
   ============================================================ */
.diagram-hosts {
  padding: 26px 24px 22px;
}
.hosts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.host-card {
  padding: 16px 16px 14px;
  background: rgba(15,23,42,0.5);
  border: 1px solid rgba(71,85,105,0.45);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s, background 0.2s;
}
.host-card:hover {
  border-color: rgba(34,211,238,0.5);
  background: rgba(8,32,52,0.55);
}
.host-icon {
  font-size: 18px;
  line-height: 1;
  color: #67e8f9;
  margin-bottom: 2px;
}
.host-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #e2e8f0;
  text-transform: uppercase;
}
.host-desc {
  font-size: 11.5px;
  color: rgba(148,163,184,0.75);
  line-height: 1.4;
}
.hosts-note {
  margin-top: 16px;
  font-size: 11.5px;
  color: rgba(148,163,184,0.6);
  text-align: center;
  font-style: italic;
}

/* ---- Responsive (primer graphics) ---- */
@media (max-width: 720px) {
  .diagram-shift { grid-template-columns: 1fr; }
  .shift-before { border-right: 0; border-bottom: 1px solid rgba(148,163,184,0.10); }
  .hosts-grid { grid-template-columns: 1fr 1fr; }
  .webid-line { font-size: 14px; }
}
@media (max-width: 480px) {
  .hosts-grid { grid-template-columns: 1fr; }
  .many-row { flex-direction: column; align-items: center; }
}

/* ============================================================
   GRAPHIC — Actor cards (The people involved)
   ============================================================ */
.diagram-block.diagram-people {
  background:
    radial-gradient(ellipse 80% 60% at 50% 50%, rgba(34,211,238,0.05) 0%, transparent 70%),
    linear-gradient(180deg, #0b0d12 0%, #07080b 100%);
  border: 1px solid #1e2939;
  color: #e2e8f0;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  padding: 28px 24px 22px;
  margin: 16px 0 32px;
}
.people-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.person-card {
  position: relative;
  padding: 18px 18px 16px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(71,85,105,0.5);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s, background 0.2s;
}
.person-card:hover { border-color: rgba(148,163,184,0.7); }
.person-card.primary {
  background: rgba(8,32,52,0.55);
  border-color: rgba(34,211,238,0.45);
  box-shadow: inset 0 0 18px rgba(34,211,238,0.07);
}
.person-card.primary:hover { border-color: rgba(34,211,238,0.7); }
.person-badge {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(148,163,184,0.55);
  text-transform: uppercase;
  margin-bottom: 2px;
}
.person-card.primary .person-badge { color: rgba(103,232,249,0.7); }
.person-role {
  font-size: 16px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.2px;
}
.person-card.primary .person-role { color: #cffafe; }
.person-name {
  font-size: 12px;
  font-weight: 500;
  color: rgba(148,163,184,0.85);
  font-style: italic;
}
.person-card.primary .person-name { color: rgba(103,232,249,0.85); }
.person-desc {
  font-size: 12.5px;
  color: rgba(203,213,225,0.8);
  line-height: 1.5;
  margin-top: 2px;
}
.people-note {
  margin-top: 18px;
  padding: 12px 14px;
  font-size: 12px;
  color: rgba(148,163,184,0.8);
  font-style: italic;
  line-height: 1.55;
  text-align: center;
  border-top: 1px dashed rgba(148,163,184,0.15);
  padding-top: 16px;
}
.people-note b {
  color: #cffafe;
  font-style: normal;
  font-weight: 700;
}

@media (max-width: 640px) {
  .people-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   APPS PAGE — shared base + per-graphic styles
   ============================================================ */
.diagram-block.diagram-app-shape,
.diagram-block.diagram-app-grid,
.diagram-block.diagram-app-detail {
  background:
    radial-gradient(ellipse 80% 60% at 50% 50%, rgba(34,211,238,0.05) 0%, transparent 70%),
    linear-gradient(180deg, #0b0d12 0%, #07080b 100%);
  border: 1px solid #1e2939;
  color: #e2e8f0;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  padding: 0;
  margin: 16px 0 32px;
  overflow: hidden;
}

/* ---- GRAPHIC: centralized vs decentralized app shape ---- */
.diagram-app-shape {
  padding: 28px 24px 24px;
}
.app-shape-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.app-shape-col {
  padding: 20px 18px;
  background: rgba(15,23,42,0.5);
  border: 1px solid rgba(71,85,105,0.5);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.app-shape-col.highlight {
  background: rgba(8,32,52,0.55);
  border-color: rgba(34,211,238,0.45);
  box-shadow: inset 0 0 18px rgba(34,211,238,0.08);
}
.app-shape-tag {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 2px;
  color: rgba(148,163,184,0.55);
  margin-bottom: 14px;
}
.app-shape-col.highlight .app-shape-tag { color: rgba(103,232,249,0.7); }
.app-shape-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.app-shape-cell {
  font-size: 12px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 3px;
  background: rgba(30,41,59,0.7);
  border: 1px solid rgba(71,85,105,0.5);
  color: #cbd5e1;
  text-align: center;
}
.app-shape-cell.user {
  background: transparent;
  border-style: dashed;
  font-style: italic;
  color: rgba(203,213,225,0.7);
}
.app-shape-cell.vendor {
  background: rgba(20,15,15,0.7);
  border-color: rgba(120,80,80,0.5);
  color: rgba(252,165,165,0.85);
  font-family: ui-monospace, monospace;
  font-size: 11px;
}
.app-shape-cell.pod {
  background: rgba(8,32,52,0.75);
  border-color: rgba(34,211,238,0.55);
  color: #cffafe;
  font-weight: 600;
  box-shadow: inset 0 0 12px rgba(34,211,238,0.10);
}
.app-shape-cell.pod code {
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  background: rgba(34,211,238,0.15);
  padding: 1px 5px;
  border-radius: 2px;
  margin-left: 4px;
  color: #67e8f9;
}
.app-shape-arrow {
  font-size: 10px;
  color: rgba(148,163,184,0.45);
  line-height: 1;
}
.app-shape-arrow.accent {
  color: rgba(103,232,249,0.6);
  font-size: 9.5px;
  letter-spacing: 1px;
}
.app-shape-note {
  margin-top: 16px;
  font-size: 11.5px;
  color: rgba(148,163,184,0.7);
  text-align: center;
  font-style: italic;
}

/* ---- GRAPHIC: 6-card overview grid ---- */
.diagram-app-grid {
  padding: 22px 22px 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.app-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 16px 16px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(71,85,105,0.5);
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  cursor: pointer;
}
.app-card::after {
  content: "→";
  position: absolute;
  top: 14px;
  right: 14px;
  color: rgba(34,211,238,0.5);
  font-size: 12px;
  transition: transform 0.18s, color 0.18s;
}
.app-card:hover {
  border-color: rgba(34,211,238,0.55);
  background: rgba(8,32,52,0.55);
  transform: translateY(-1px);
}
.app-card:hover::after { color: #67e8f9; transform: translateX(2px); }
.app-card-letter {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  background: linear-gradient(180deg, rgba(148,163,184,0.85) 0%, rgba(71,85,105,0.4) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  margin-bottom: 4px;
}
.app-card:hover .app-card-letter {
  background: linear-gradient(180deg, #67e8f9 0%, rgba(34,211,238,0.5) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
}
.app-card-name {
  font-size: 16px;
  font-weight: 700;
  color: #e2e8f0;
}
.app-card:hover .app-card-name { color: #cffafe; }
.app-card-shape {
  font-family: ui-monospace, monospace;
  font-size: 9.5px;
  letter-spacing: 1.5px;
  color: rgba(103,232,249,0.6);
  margin-top: 2px;
}
.app-card-tag {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(203,213,225,0.75);
  line-height: 1.45;
}
.app-card-tag code {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: #67e8f9;
}

/* ---- GRAPHIC: per-app detail header card ---- */
.diagram-app-detail {
  padding: 22px 22px 18px;
}
.app-detail-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
}
.app-detail-letter {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 40px;
  font-weight: 300;
  line-height: 1;
  background: linear-gradient(180deg, #67e8f9 0%, rgba(34,211,238,0.4) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  padding: 0 6px;
}
.app-detail-titles { display: flex; flex-direction: column; gap: 2px; }
.app-detail-name {
  font-size: 22px;
  font-weight: 700;
  color: #cffafe;
  letter-spacing: 0.2px;
}
.app-detail-tag {
  font-size: 13px;
  color: rgba(148,163,184,0.85);
  font-style: italic;
}
.app-detail-tag code {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  background: rgba(34,211,238,0.08);
  color: #67e8f9;
  padding: 1px 5px;
  border-radius: 2px;
  font-style: normal;
}
.app-detail-pills {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
}
.app-pill {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 1.5px;
  padding: 3px 8px;
  border-radius: 2px;
  white-space: nowrap;
  border: 1px solid;
}
.app-pill.shape {
  background: transparent;
  border-color: rgba(71,85,105,0.6);
  color: rgba(148,163,184,0.8);
}
.app-pill.status { font-weight: 700; }
.app-pill.status-building {
  background: rgba(8,32,52,0.7);
  border-color: rgba(34,211,238,0.5);
  color: #67e8f9;
  box-shadow: 0 0 8px rgba(34,211,238,0.18);
}
.app-pill.status-concept {
  background: rgba(30,30,35,0.7);
  border-color: rgba(148,163,184,0.4);
  color: rgba(203,213,225,0.7);
}
.app-pill.status-planned {
  background: rgba(40,35,20,0.7);
  border-color: rgba(180,140,80,0.4);
  color: rgba(252,211,77,0.85);
}

/* Protocol index — 4 cards summarizing §1-§4, used at the top of §1 */
.diagram-block.diagram-protocol-index {
  background: linear-gradient(180deg, rgba(11,13,18,0.98), rgba(7,8,11,0.98));
  border: 1px solid rgba(34,211,238,0.18);
  border-radius: var(--r-md);
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  color: #e2e8f0;
}
.proto-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  background: rgba(15,18,24,0.7);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: var(--r-sm);
  color: inherit;
  text-decoration: none;
  transition: border-color 120ms, transform 120ms, background 120ms;
  position: relative;
}
.md-content .proto-card { color: inherit; }
.proto-card:hover {
  border-color: rgba(34,211,238,0.55);
  background: rgba(20,24,32,0.85);
  transform: translateY(-1px);
}
.proto-card-current {
  border-color: rgba(34,211,238,0.55);
  background: linear-gradient(180deg, rgba(34,211,238,0.06), rgba(15,18,24,0.7));
}
.proto-card-num {
  font-family: ui-monospace, "JetBrains Mono", Menlo, monospace;
  font-size: 22px;
  font-weight: 800;
  color: #67e8f9;
  letter-spacing: -0.01em;
  line-height: 1;
}
.proto-card-name {
  font-size: 17px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}
.proto-card-tag {
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(203,213,225,0.78);
  flex: 1;
}
.proto-card-meta {
  font-family: ui-monospace, "JetBrains Mono", Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(148,163,184,0.85);
  border-top: 1px dashed rgba(148,163,184,0.18);
  padding-top: 8px;
  margin-top: 2px;
}
.proto-card-current .proto-card-meta {
  color: #67e8f9;
  border-top-color: rgba(34,211,238,0.35);
}
.md-content .proto-card-meta a {
  color: rgba(167,243,208,0.95);
  text-decoration: underline;
  text-decoration-color: rgba(167,243,208,0.4);
}

@media (max-width: 720px) {
  .diagram-block.diagram-protocol-index { grid-template-columns: 1fr; }
}

/* Mission hero — TBL pull-quote + Mind's framing, opens the overview page */
.diagram-block.diagram-hero {
  background: linear-gradient(180deg, rgba(11,13,18,0.98), rgba(7,8,11,0.98));
  background-image:
    radial-gradient(rgba(34,211,238,0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(11,13,18,0.98), rgba(7,8,11,0.98));
  background-size: 32px 32px, auto;
  border: 1px solid rgba(34,211,238,0.22);
  border-radius: var(--r-md);
  padding: 44px 48px 38px;
  color: #e2e8f0;
  position: relative;
  overflow: hidden;
}
.diagram-block.diagram-hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #22d3ee 25%, #67e8f9 50%, #22d3ee 75%, transparent);
  opacity: 0.7;
}
.hero-pretitle {
  font-family: ui-monospace, "JetBrains Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: #67e8f9;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.md-content blockquote.hero-quote,
.hero-quote {
  font-size: 46px;
  font-weight: 200;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: #f8fafc;
  margin: 0 0 14px 0;
  border-left: none;
  padding: 0;
  background: transparent;
  border-radius: 0;
}
.hero-quote-mark {
  color: rgba(34,211,238,0.55);
  font-weight: 300;
  margin: 0 2px;
}
.hero-attrib {
  font-family: ui-monospace, "JetBrains Mono", Menlo, monospace;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: rgba(148,163,184,0.85);
  margin-bottom: 30px;
}
.hero-body {
  font-size: 15.5px;
  line-height: 1.65;
  color: rgba(203,213,225,0.85);
  margin: 0 0 14px;
  max-width: 760px;
}
.hero-body:last-child { margin-bottom: 0; }
.hero-body-strong { color: #e2e8f0; }
.md-content .hero-body strong,
.hero-body strong {
  color: #67e8f9;
  font-weight: 700;
}
.hero-body a {
  color: #67e8f9;
  text-decoration: underline;
  text-decoration-color: rgba(34,211,238,0.35);
  text-underline-offset: 3px;
}
.hero-body a:hover { text-decoration-color: #67e8f9; }

@media (max-width: 720px) {
  .diagram-block.diagram-hero { padding: 28px 22px 26px; }
  .hero-quote { font-size: 32px; }
  .hero-attrib { margin-bottom: 22px; }
}

/* Roadmap ladder — phased vertical list with a connecting rail through the numbers */
.diagram-block.diagram-roadmap-ladder {
  background: linear-gradient(180deg, rgba(11,13,18,0.98), rgba(7,8,11,0.98));
  border: 1px solid rgba(34,211,238,0.18);
  border-radius: var(--r-md);
  padding: 0;
  color: #e2e8f0;
  overflow: hidden;
}

/* Phase header — full-width band with a label and goal */
.roadmap-phase-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 28px 14px 28px;
  background: linear-gradient(90deg, rgba(34,211,238,0.06), transparent 60%);
  border-bottom: 1px solid rgba(148,163,184,0.10);
}
.roadmap-phase-header + .roadmap-step,
.roadmap-step + .roadmap-step {
  border-top: 1px solid rgba(148,163,184,0.08);
}
.roadmap-phase-header:not(:first-child) {
  margin-top: 4px;
  border-top: 1px dashed rgba(148,163,184,0.20);
}
.roadmap-phase-num {
  font-family: ui-monospace, "JetBrains Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #67e8f9;
  padding: 4px 10px;
  border: 1px solid rgba(34,211,238,0.4);
  border-radius: 999px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.roadmap-phase-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.roadmap-phase-title {
  font-size: 20px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}
.roadmap-phase-sub {
  font-size: 13px;
  color: rgba(148,163,184,0.85);
}

/* Step row — circle number on a rail, body, status pill */
.roadmap-step {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 28px;
  position: relative;
}
.roadmap-step::before {
  /* the connecting rail behind the number circles */
  content: "";
  position: absolute;
  left: 50px; /* 28px padding + 22px (half of 44px circle) */
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(180deg, rgba(34,211,238,0.45), rgba(34,211,238,0.15));
  z-index: 0;
}
.roadmap-step-foundation::before {
  background: linear-gradient(180deg, rgba(251,191,36,0.55), rgba(251,191,36,0.25));
}
.roadmap-step-now::before {
  background: linear-gradient(180deg, rgba(34,211,238,0.55), rgba(34,211,238,0.35));
}
.roadmap-step-next::before {
  background: linear-gradient(180deg, rgba(34,211,238,0.30), rgba(148,163,184,0.20));
}
.roadmap-step-later::before {
  background: rgba(148,163,184,0.18);
}
/* Don't extend the rail past the last step in a phase — the phase header divider already separates them.
   This is handled by the phase-header's own background covering the rail above it. */

.roadmap-step-num {
  position: relative;
  z-index: 1;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, "JetBrains Mono", Menlo, monospace;
  font-size: 18px;
  font-weight: 800;
  background: #0b0d12;
  border: 2px solid rgba(148,163,184,0.45);
  color: rgba(226,232,240,0.95);
  letter-spacing: -0.02em;
}
.roadmap-step-foundation .roadmap-step-num {
  border-color: #fbbf24;
  color: #fbbf24;
  box-shadow: 0 0 0 4px rgba(11,13,18,1), 0 0 14px rgba(251,191,36,0.35);
}
.roadmap-step-now .roadmap-step-num {
  border-color: #22d3ee;
  color: #67e8f9;
  box-shadow: 0 0 0 4px rgba(11,13,18,1), 0 0 14px rgba(34,211,238,0.4);
}
.roadmap-step-next .roadmap-step-num {
  border-color: rgba(34,211,238,0.55);
  color: #a5f3fc;
  box-shadow: 0 0 0 4px rgba(11,13,18,1);
}
.roadmap-step-later .roadmap-step-num {
  border-color: rgba(148,163,184,0.35);
  color: rgba(148,163,184,0.85);
  box-shadow: 0 0 0 4px rgba(11,13,18,1);
}

.roadmap-step-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.roadmap-step-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #f1f5f9;
}
.roadmap-step-name-sub {
  font-weight: 500;
  color: rgba(148,163,184,0.85);
  font-size: 14px;
}
.roadmap-step-tag {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(203,213,225,0.78);
}
.roadmap-step-later .roadmap-step-name { color: rgba(226,232,240,0.78); }
.roadmap-step-later .roadmap-step-tag  { color: rgba(203,213,225,0.55); }

.roadmap-step-status {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

@media (max-width: 720px) {
  .roadmap-phase-header { padding: 18px 18px 10px 18px; gap: 12px; }
  .roadmap-phase-title { font-size: 17px; }
  .roadmap-step { padding: 12px 18px; gap: 14px; flex-wrap: wrap; }
  .roadmap-step::before { left: 40px; }
  .roadmap-step-num { flex-basis: 40px; width: 40px; height: 40px; font-size: 16px; }
  .roadmap-step-status { flex-basis: 100%; padding-left: 54px; }
}

/* Showcase callout — for OS and any future "wild but not a daily-driver" entries */
.diagram-block.diagram-app-showcase {
  background: linear-gradient(180deg, rgba(11,13,18,0.92), rgba(7,8,11,0.95));
  border: 1px dashed rgba(148,163,184,0.35);
  border-radius: var(--r-md);
  padding: 18px 22px;
  display: grid;
  gap: 10px;
  color: #cbd5e1;
}
.app-showcase-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.app-showcase-tag {
  font-family: ui-monospace, "JetBrains Mono", Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(148,163,184,0.85);
  border: 1px solid rgba(148,163,184,0.35);
  padding: 2px 8px;
  border-radius: 999px;
}
.app-showcase-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #e2e8f0;
}
.app-showcase-body {
  color: rgba(203,213,225,0.85);
  font-size: 14px;
  line-height: 1.55;
}

@media (max-width: 720px) {
  .app-shape-row { grid-template-columns: 1fr; }
  .diagram-app-grid { grid-template-columns: 1fr 1fr; }
  .app-detail-head { grid-template-columns: auto 1fr; }
  .app-detail-pills { grid-column: 1 / -1; flex-direction: row; align-items: flex-start; flex-wrap: wrap; }
  .app-detail-letter { font-size: 32px; }
  .app-detail-name { font-size: 18px; }
}
@media (max-width: 480px) {
  .diagram-app-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   C4 SHOWCASE — Context, Container, Component
   Restrained / formal look, matches the design system but
   slightly more "technical doc" than cinematic.
   ============================================================ */
.diagram-block.diagram-c4-context,
.diagram-block.diagram-c4-container,
.diagram-block.diagram-c4-component {
  background:
    linear-gradient(180deg, #0b0d12 0%, #07080b 100%);
  border: 1px solid #1e2939;
  color: #e2e8f0;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  padding: 0;
  margin: 16px 0 32px;
  overflow: hidden;
}

/* ---------- L1 Context ---------- */
.diagram-c4-context {
  padding: 24px 22px 18px;
}
.c4-context-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 14px;
  align-items: stretch;
}
.c4-actor, .c4-system {
  padding: 14px 16px 12px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.c4-actor {
  background: rgba(15,23,42,0.5);
  border: 1px solid rgba(71,85,105,0.5);
}
.c4-actor.person {
  background: rgba(8,8,12,0.7);
  border-color: rgba(100,116,139,0.55);
}
.c4-actor.external {
  background: rgba(20,20,24,0.6);
  border-color: rgba(100,116,139,0.45);
}
.c4-actor-type {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 1.8px;
  color: rgba(148,163,184,0.55);
}
.c4-actor-name {
  font-size: 14px;
  font-weight: 700;
  color: #e2e8f0;
  margin-top: 1px;
}
.c4-actor-desc {
  font-size: 11.5px;
  color: rgba(203,213,225,0.75);
  line-height: 1.45;
  margin-top: 3px;
}
.c4-system {
  background: rgba(8,32,52,0.6);
  border: 1.5px solid rgba(34,211,238,0.55);
  box-shadow: inset 0 0 18px rgba(34,211,238,0.08);
  grid-row: span 2;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.c4-system-tag {
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: #67e8f9;
}
.c4-system-name {
  font-size: 28px;
  font-weight: 700;
  color: #cffafe;
  letter-spacing: 1px;
  margin: 6px 0 4px;
}
.c4-system-desc {
  font-size: 12px;
  color: rgba(203,213,225,0.85);
  line-height: 1.5;
  max-width: 240px;
}
.c4-context-rels {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed rgba(148,163,184,0.15);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.c4-rel {
  font-size: 12px;
  color: rgba(203,213,225,0.85);
  font-family: ui-sans-serif, sans-serif;
}
.c4-rel-arrow {
  color: rgba(103,232,249,0.7);
  font-weight: 700;
  padding: 0 4px;
}
.c4-rel-detail {
  color: rgba(148,163,184,0.7);
  font-style: italic;
  margin-left: 6px;
  font-size: 11.5px;
}
.c4-rel-detail code {
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  color: #67e8f9;
  background: rgba(34,211,238,0.10);
  padding: 1px 4px;
  border-radius: 2px;
  font-style: normal;
}

/* ---------- L2 Container ---------- */
.diagram-c4-container { padding: 24px 22px 18px; }
.c4-boundary {
  position: relative;
  border: 1px dashed rgba(34,211,238,0.45);
  border-radius: 6px;
  padding: 28px 18px 20px;
  background: rgba(8,32,52,0.15);
}
.c4-boundary-label {
  position: absolute;
  top: -10px;
  left: 18px;
  background: #07080b;
  padding: 0 10px;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  color: #67e8f9;
}
.c4-boundary-sub {
  font-family: ui-sans-serif, sans-serif;
  font-weight: 400;
  color: rgba(148,163,184,0.7);
  font-size: 10.5px;
  letter-spacing: 0;
  font-style: italic;
}
.c4-container-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.c4-container {
  padding: 13px 15px 12px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(71,85,105,0.55);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.c4-container.canonical {
  grid-column: 1 / -1;
  background: rgba(8,32,52,0.65);
  border-color: rgba(34,211,238,0.5);
  box-shadow: inset 0 0 12px rgba(34,211,238,0.08);
}
.c4-container-type {
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 1.8px;
  color: rgba(148,163,184,0.55);
}
.c4-container.canonical .c4-container-type { color: rgba(103,232,249,0.7); }
.c4-container-name {
  font-size: 15px;
  font-weight: 700;
  color: #e2e8f0;
}
.c4-container.canonical .c4-container-name { color: #cffafe; }
.c4-container-tech {
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  color: rgba(148,163,184,0.85);
  margin-top: 1px;
}
.c4-container-desc {
  font-size: 11.5px;
  color: rgba(203,213,225,0.78);
  line-height: 1.5;
  margin-top: 4px;
}
.c4-container-rels {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed rgba(148,163,184,0.15);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* ---------- L3 Component ---------- */
.diagram-c4-component { padding: 22px 22px 20px; }
.c4-comp-title {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 2.5px;
  color: rgba(103,232,249,0.7);
  margin-bottom: 18px;
  text-align: center;
  font-weight: 700;
}
.c4-comp-grid {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.c4-comp-group {
  padding: 12px 14px 10px;
  border: 1px solid rgba(71,85,105,0.45);
  border-radius: 4px;
  background: rgba(15,23,42,0.45);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.c4-comp-group.highlight {
  background: rgba(8,32,52,0.45);
  border-color: rgba(34,211,238,0.45);
  grid-template-columns: 1fr;
}
.c4-comp-group-label {
  grid-column: 1 / -1;
  font-family: ui-monospace, monospace;
  font-size: 9.5px;
  letter-spacing: 1.8px;
  color: rgba(148,163,184,0.65);
  margin-bottom: 4px;
}
.c4-comp-group.highlight .c4-comp-group-label { color: rgba(103,232,249,0.75); }
.c4-comp-card {
  padding: 10px 12px;
  background: rgba(8,8,12,0.5);
  border: 1px solid rgba(71,85,105,0.4);
  border-radius: 3px;
}
.c4-comp-card.primary {
  background: rgba(8,32,52,0.7);
  border-color: rgba(34,211,238,0.5);
  text-align: center;
  padding: 14px 16px;
}
.c4-comp-card.canonical {
  background: rgba(8,32,52,0.55);
  border-color: rgba(34,211,238,0.45);
}
.c4-comp-name {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 3px;
}
.c4-comp-card.primary .c4-comp-name { color: #cffafe; font-size: 15px; }
.c4-comp-card.canonical .c4-comp-name { color: #cffafe; }
.c4-comp-desc {
  font-size: 11px;
  color: rgba(203,213,225,0.75);
  line-height: 1.45;
}
.c4-comp-card.primary .c4-comp-desc { color: rgba(207,250,254,0.85); font-size: 11.5px; }
.c4-comp-desc code {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  color: #67e8f9;
  background: rgba(34,211,238,0.08);
  padding: 0 3px;
  border-radius: 2px;
}
.c4-comp-flow {
  text-align: center;
  font-size: 14px;
  color: rgba(103,232,249,0.45);
  padding: 6px 0;
  line-height: 1;
}
.c4-comp-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(148,163,184,0.15);
  font-size: 11.5px;
  color: rgba(148,163,184,0.75);
  font-style: italic;
  text-align: center;
  line-height: 1.5;
}

@media (max-width: 720px) {
  .c4-context-grid { grid-template-columns: 1fr; }
  .c4-system { grid-row: auto; }
  .c4-container-grid { grid-template-columns: 1fr; }
  .c4-comp-group { grid-template-columns: 1fr; }
}

/* ============================================================
   Capability index — chip grid on the §3 companion page
   ============================================================ */
.diagram-block.diagram-cap-index {
  background:
    linear-gradient(180deg, #0b0d12 0%, #07080b 100%);
  border: 1px solid #1e2939;
  padding: 18px;
  margin: 16px 0 32px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.cap-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 14px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(71,85,105,0.5);
  border-radius: 3px;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  position: relative;
}
.cap-chip::after {
  content: "→";
  position: absolute;
  top: 12px;
  right: 12px;
  color: rgba(34,211,238,0.45);
  font-size: 11px;
  transition: transform 0.18s, color 0.18s;
}
.cap-chip:hover {
  border-color: rgba(34,211,238,0.5);
  background: rgba(8,32,52,0.55);
}
.cap-chip:hover::after { color: #67e8f9; transform: translateX(2px); }
.cap-iri {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  color: #67e8f9;
  font-size: 12px;
  font-weight: 600;
  padding-right: 18px;
}
.cap-summary {
  font-size: 11.5px;
  color: rgba(203,213,225,0.78);
  line-height: 1.4;
}
@media (max-width: 640px) {
  .diagram-cap-index { grid-template-columns: 1fr; }
}

/* ============================================================
   PROTOCOL PAGES — shared "TLDR card" intro panel
   Sits at the top of each protocol page. Same shape across
   all five pages so readers learn the pattern once.
   ============================================================ */
.diagram-block.protocol-intro {
  background:
    radial-gradient(ellipse 70% 50% at 50% 30%, rgba(34,211,238,0.06) 0%, transparent 70%),
    linear-gradient(180deg, #0b0d12 0%, #07080b 100%);
  border: 1px solid #1e2939;
  border-left: 3px solid #22d3ee;
  padding: 22px 26px 20px;
  margin: 16px 0 16px;
  color: #e2e8f0;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
}
.protocol-intro-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.protocol-intro-tag {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 2.5px;
  color: rgba(103,232,249,0.75);
  font-weight: 700;
}
.protocol-intro-title {
  font-size: 18px;
  font-weight: 700;
  color: #cffafe;
  margin: 0;
  letter-spacing: 0.1px;
}
.protocol-intro-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(203,213,225,0.9);
  margin: 0 0 16px;
}
.protocol-intro-body code {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  background: rgba(34,211,238,0.10);
  color: #67e8f9;
  padding: 1px 5px;
  border-radius: 2px;
}
.protocol-intro-key {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-top: 14px;
  border-top: 1px dashed rgba(148,163,184,0.18);
}
.key-item { display: flex; flex-direction: column; gap: 3px; }
.key-label {
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(148,163,184,0.6);
  font-weight: 700;
}
.key-value {
  font-size: 12px;
  color: rgba(203,213,225,0.85);
  line-height: 1.45;
}
.key-value code {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  background: rgba(34,211,238,0.10);
  color: #67e8f9;
  padding: 0 4px;
  border-radius: 2px;
}
.key-value a { color: #67e8f9; text-decoration: none; }
.key-value a:hover { text-decoration: underline; }
@media (max-width: 720px) {
  .protocol-intro-key { grid-template-columns: 1fr; gap: 10px; }
}

/* ============================================================
   §1 — Zone visual (Agent zone, Apps zone, Shared data)
   ============================================================ */
.diagram-block.diagram-zones {
  background:
    linear-gradient(180deg, #0b0d12 0%, #07080b 100%);
  border: 1px solid #1e2939;
  padding: 22px;
  margin: 0 0 28px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  color: #e2e8f0;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.zone {
  padding: 16px 18px 14px;
  background: rgba(15,23,42,0.5);
  border: 1px solid rgba(71,85,105,0.5);
  border-radius: 5px;
}
.zone-agent { border-left: 3px solid rgba(34,211,238,0.7); }
.zone-apps  { border-left: 3px solid rgba(165,180,252,0.6); }
.zone-shared { border-left: 3px solid rgba(252,211,77,0.55); }
.zone-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.zone-icon {
  font-family: ui-monospace, monospace;
  font-size: 16px;
  color: #67e8f9;
  line-height: 1;
}
.zone-apps .zone-icon  { color: #a5b4fc; }
.zone-shared .zone-icon { color: #fcd34d; }
.zone-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: #e2e8f0;
}
.zone-path {
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  color: rgba(148,163,184,0.7);
}
.zone-path code {
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  color: #67e8f9;
  background: rgba(34,211,238,0.08);
  padding: 0 4px;
  border-radius: 2px;
}
.zone-desc {
  font-size: 12.5px;
  color: rgba(203,213,225,0.8);
  line-height: 1.5;
  margin-bottom: 10px;
}
.zone-desc code {
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  background: rgba(34,211,238,0.08);
  color: #67e8f9;
  padding: 0 4px;
  border-radius: 2px;
}
.zone-paths {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.zone-path-chip {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 2px;
  background: rgba(8,8,12,0.6);
  color: rgba(203,213,225,0.85);
  border: 1px solid rgba(71,85,105,0.4);
}

/* ============================================================
   §2 — Coordination flow (Operator ↔ Pod ↔ Runtime)
   ============================================================ */
.diagram-block.diagram-coord-flow {
  background:
    linear-gradient(180deg, #0b0d12 0%, #07080b 100%);
  border: 1px solid #1e2939;
  padding: 22px;
  margin: 0 0 28px;
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  gap: 14px;
  align-items: center;
  color: #e2e8f0;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.coord-actor {
  padding: 16px 14px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(71,85,105,0.55);
  border-radius: 4px;
  text-align: center;
}
.coord-actor-tag {
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(148,163,184,0.6);
  margin-bottom: 4px;
}
.coord-actor-name {
  font-size: 14px;
  font-weight: 700;
  color: #e2e8f0;
}
.coord-actor-desc {
  font-size: 11.5px;
  color: rgba(148,163,184,0.85);
  margin-top: 4px;
  line-height: 1.4;
}
.coord-bus {
  background: rgba(8,32,52,0.5);
  border: 1.5px solid rgba(34,211,238,0.4);
  border-radius: 4px;
  padding: 12px 14px;
  box-shadow: inset 0 0 14px rgba(34,211,238,0.07);
}
.coord-bus-label {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: #67e8f9;
  text-align: center;
  margin-bottom: 10px;
}
.coord-bus-label code {
  font-family: ui-monospace, monospace;
  background: rgba(34,211,238,0.15);
  padding: 0 5px;
  border-radius: 2px;
}
.coord-bus-cells {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.coord-cell {
  padding: 7px 9px;
  background: rgba(8,8,12,0.6);
  border: 1px solid rgba(71,85,105,0.4);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.coord-cell.cmd { border-left: 2px solid rgba(252,211,77,0.55); }
.coord-cell.out { border-left: 2px solid rgba(34,211,238,0.55); }
.coord-cell.state { border-left: 2px solid rgba(165,180,252,0.55); }
.coord-cell-path {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: #cffafe;
  font-weight: 600;
}
.coord-cell-role {
  font-size: 10px;
  color: rgba(148,163,184,0.75);
  line-height: 1.3;
}
@media (max-width: 720px) {
  .diagram-coord-flow { grid-template-columns: 1fr; }
  .coord-bus-cells { grid-template-columns: 1fr; }
}

/* ============================================================
   §3 — Discovery flow (numbered sequence)
   ============================================================ */
.diagram-block.diagram-discovery {
  background:
    linear-gradient(180deg, #0b0d12 0%, #07080b 100%);
  border: 1px solid #1e2939;
  padding: 22px;
  margin: 0 0 28px;
  color: #e2e8f0;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.discovery-title {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(103,232,249,0.6);
  margin-bottom: 14px;
  text-align: center;
}
.discovery-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.discovery-steps li {
  display: flex;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px dashed rgba(148,163,184,0.12);
  margin: 0;
}
.discovery-steps li:last-child { border-bottom: 0; }
.discovery-num {
  font-family: ui-monospace, monospace;
  font-size: 20px;
  font-weight: 300;
  line-height: 1;
  width: 32px;
  text-align: right;
  flex-shrink: 0;
  background: linear-gradient(180deg, #67e8f9 0%, rgba(34,211,238,0.35) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  padding-top: 2px;
}
.discovery-body { flex: 1; }
.discovery-head {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 2px;
}
.discovery-detail {
  font-size: 11.5px;
  color: rgba(148,163,184,0.85);
  line-height: 1.45;
}
.discovery-detail code {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: #67e8f9;
  background: rgba(34,211,238,0.08);
  padding: 0 4px;
  border-radius: 2px;
}
.discovery-detail a { color: #67e8f9; text-decoration: none; }
.discovery-detail a:hover { text-decoration: underline; }

/* ============================================================
   §4 — Cross-pod message flow
   ============================================================ */
.diagram-block.diagram-msg-flow {
  background:
    linear-gradient(180deg, #0b0d12 0%, #07080b 100%);
  border: 1px solid #1e2939;
  padding: 22px;
  margin: 0 0 28px;
  color: #e2e8f0;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.msg-flow-title {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(103,232,249,0.6);
  margin-bottom: 14px;
  text-align: center;
}
.msg-flow-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
}
.msg-pod {
  padding: 14px 16px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(71,85,105,0.55);
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.msg-pod-recipient { border-left: 3px solid rgba(34,211,238,0.5); }
.msg-pod-label {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(103,232,249,0.7);
  margin-bottom: 4px;
}
.msg-pod-section {
  padding: 7px 10px;
  background: rgba(8,8,12,0.5);
  border: 1px solid rgba(71,85,105,0.35);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.msg-pod-section.accent {
  background: rgba(8,32,52,0.55);
  border-color: rgba(34,211,238,0.4);
}
.msg-pod-path {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: #cffafe;
  font-weight: 600;
}
.msg-pod-note {
  font-size: 10.5px;
  color: rgba(148,163,184,0.75);
  line-height: 1.4;
}
.msg-pod-note code {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  background: rgba(34,211,238,0.10);
  color: #67e8f9;
  padding: 0 3px;
  border-radius: 2px;
}
.msg-arrow {
  font-family: ui-monospace, monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 6px;
  min-width: 130px;
}
.msg-arrow-line {
  font-size: 10px;
  color: rgba(148,163,184,0.75);
}
.msg-arrow-line code {
  font-size: 9.5px;
  color: #67e8f9;
  background: rgba(34,211,238,0.10);
  padding: 0 3px;
  border-radius: 2px;
}
.msg-arrow-line-hr {
  font-size: 22px;
  color: rgba(34,211,238,0.7);
  line-height: 1;
  margin: 4px 0;
}
.msg-arrow-line-note {
  font-size: 9.5px;
  color: rgba(148,163,184,0.55);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.msg-flow-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(148,163,184,0.15);
  font-size: 11.5px;
  color: rgba(148,163,184,0.8);
  font-style: italic;
  line-height: 1.5;
  text-align: center;
}
.msg-flow-note code {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  background: rgba(34,211,238,0.08);
  color: #67e8f9;
  padding: 0 4px;
  border-radius: 2px;
  font-style: normal;
}
@media (max-width: 720px) {
  .msg-flow-grid { grid-template-columns: 1fr; }
  .msg-arrow { flex-direction: row; min-width: 0; }
  .msg-arrow-line-hr { transform: rotate(90deg); margin: 0 8px; }
}

/* ============================================================
   §2 — Trigger type cards (4 cards)
   ============================================================ */
.diagram-block.diagram-triggers {
  background:
    linear-gradient(180deg, #0b0d12 0%, #07080b 100%);
  border: 1px solid #1e2939;
  padding: 20px;
  margin: 0 0 20px;
  color: #e2e8f0;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.trigger-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.trigger-card {
  padding: 14px 16px 12px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(71,85,105,0.55);
  border-radius: 4px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  gap: 4px 12px;
  align-items: start;
}
.trigger-card.required {
  background: rgba(8,32,52,0.55);
  border-color: rgba(34,211,238,0.45);
  box-shadow: inset 0 0 12px rgba(34,211,238,0.07);
}
.trigger-icon {
  grid-row: 1 / span 3;
  font-family: ui-monospace, monospace;
  font-size: 22px;
  color: #67e8f9;
  line-height: 1;
  padding-top: 4px;
}
.trigger-iri {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  color: #cffafe;
}
.trigger-fires {
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 600;
  color: rgba(103,232,249,0.75);
  text-transform: uppercase;
}
.trigger-detail {
  font-size: 11.5px;
  color: rgba(203,213,225,0.78);
  line-height: 1.45;
  grid-column: 2;
}
.trigger-detail code {
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  color: #67e8f9;
  background: rgba(34,211,238,0.10);
  padding: 0 4px;
  border-radius: 2px;
}

/* ============================================================
   §2 — Executor type cards (3 cards)
   ============================================================ */
.diagram-block.diagram-executors {
  background:
    linear-gradient(180deg, #0b0d12 0%, #07080b 100%);
  border: 1px solid #1e2939;
  padding: 20px;
  margin: 0 0 20px;
  color: #e2e8f0;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.executor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.executor-card {
  padding: 16px 16px 14px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(71,85,105,0.55);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.executor-card.primary {
  background: rgba(8,32,52,0.55);
  border-color: rgba(34,211,238,0.45);
  box-shadow: inset 0 0 14px rgba(34,211,238,0.08);
}
.executor-iri {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: #67e8f9;
}
.executor-name {
  font-size: 16px;
  font-weight: 700;
  color: #e2e8f0;
}
.executor-card.primary .executor-name { color: #cffafe; }
.executor-desc {
  font-size: 12px;
  color: rgba(203,213,225,0.78);
  line-height: 1.45;
}
.executor-desc code {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: #67e8f9;
}
.executor-config {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 8px;
  border-top: 1px dashed rgba(148,163,184,0.15);
}
.executor-config .key {
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: rgba(148,163,184,0.6);
}
.executor-config .val {
  font-size: 11px;
  color: rgba(203,213,225,0.8);
  line-height: 1.4;
}
.executor-config .val code {
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  background: rgba(34,211,238,0.08);
  color: #67e8f9;
  padding: 0 3px;
  border-radius: 2px;
}
.executor-example {
  font-size: 11px;
  color: rgba(148,163,184,0.7);
  font-style: italic;
  margin-top: 4px;
}
@media (max-width: 720px) {
  .executor-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   §3 — Trust × DataPolicy matrix
   ============================================================ */
.diagram-block.diagram-trust-matrix {
  background:
    linear-gradient(180deg, #0b0d12 0%, #07080b 100%);
  border: 1px solid #1e2939;
  padding: 22px;
  margin: 0 0 24px;
  color: #e2e8f0;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.trust-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(4, 1fr);
  gap: 4px;
  border: 1px solid rgba(71,85,105,0.3);
  border-radius: 4px;
  padding: 4px;
  background: rgba(8,8,12,0.5);
}
.trust-corner { background: transparent; }
.trust-col-head, .trust-row-head {
  padding: 8px 10px;
  background: rgba(15,23,42,0.7);
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  color: rgba(203,213,225,0.85);
  letter-spacing: 0.5px;
  text-align: center;
  border-radius: 2px;
}
.trust-col-head.danger { color: rgba(252,165,165,0.9); }
.trust-row-head { text-align: left; }
.trust-row-head .trust-sub {
  display: block;
  font-family: ui-sans-serif, sans-serif;
  font-size: 10px;
  font-weight: 400;
  color: rgba(148,163,184,0.65);
  letter-spacing: 0;
  margin-top: 2px;
  font-style: italic;
}
.trust-cell {
  padding: 12px 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  border-radius: 2px;
  letter-spacing: 0.2px;
}
.trust-cell.ok {
  background: rgba(20,40,30,0.7);
  color: rgba(134,239,172,0.95);
  border: 1px solid rgba(74,222,128,0.3);
}
.trust-cell.warn {
  background: rgba(40,32,18,0.7);
  color: rgba(252,211,77,0.95);
  border: 1px solid rgba(252,211,77,0.3);
}
.trust-cell.bad {
  background: rgba(40,18,18,0.7);
  color: rgba(252,165,165,0.95);
  border: 1px solid rgba(248,113,113,0.4);
}
.trust-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
  font-size: 11.5px;
  color: rgba(148,163,184,0.8);
}
.trust-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.trust-dot {
  width: 10px; height: 10px;
  border-radius: 2px;
  display: inline-block;
}
.trust-dot.ok { background: rgba(74,222,128,0.7); border: 1px solid rgba(74,222,128,0.5); }
.trust-dot.warn { background: rgba(252,211,77,0.7); border: 1px solid rgba(252,211,77,0.5); }
.trust-dot.bad { background: rgba(248,113,113,0.7); border: 1px solid rgba(248,113,113,0.5); }
.trust-note {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed rgba(148,163,184,0.15);
  font-size: 11.5px;
  color: rgba(148,163,184,0.8);
  font-style: italic;
  text-align: center;
  line-height: 1.5;
}
@media (max-width: 720px) {
  .trust-grid { grid-template-columns: 1fr; }
  .trust-corner, .trust-col-head { display: none; }
  .trust-cell::before {
    content: attr(data-col) " · ";
    color: rgba(148,163,184,0.6);
    font-weight: 400;
    margin-right: 4px;
  }
}

/* ============================================================
   §3 capabilities — sync vs async call flow
   ============================================================ */
.diagram-block.diagram-call-flow {
  background:
    linear-gradient(180deg, #0b0d12 0%, #07080b 100%);
  border: 1px solid #1e2939;
  padding: 22px;
  margin: 0 0 24px;
  color: #e2e8f0;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.call-flow-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 14px;
}
.call-flow-col {
  padding: 16px 18px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(71,85,105,0.55);
  border-radius: 4px;
}
.call-flow-col.call-flow-async {
  background: rgba(8,32,52,0.55);
  border-color: rgba(34,211,238,0.45);
}
.call-flow-tag {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 2.5px;
  color: rgba(148,163,184,0.7);
  margin-bottom: 12px;
}
.call-flow-async .call-flow-tag { color: rgba(103,232,249,0.75); }
.call-flow-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.call-flow-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: rgba(203,213,225,0.85);
  line-height: 1.45;
  margin: 0;
}
.call-flow-steps .step-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(71,85,105,0.5);
  color: #e2e8f0;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.call-flow-async .step-num {
  background: rgba(34,211,238,0.25);
  color: #cffafe;
}
.call-flow-steps .step-text code {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: #67e8f9;
  background: rgba(34,211,238,0.10);
  padding: 0 4px;
  border-radius: 2px;
}
.call-flow-steps .step-text a { color: #67e8f9; text-decoration: none; }
.call-flow-steps .step-text a:hover { text-decoration: underline; }
.call-flow-note {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(148,163,184,0.15);
  font-size: 11px;
  color: rgba(148,163,184,0.75);
  font-style: italic;
  line-height: 1.45;
}
.call-flow-202 {
  margin-top: 14px;
  padding: 14px 16px;
  background: rgba(8,8,12,0.6);
  border: 1px solid rgba(71,85,105,0.35);
  border-radius: 4px;
}
.call-flow-202-label {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(103,232,249,0.7);
  margin-bottom: 8px;
}
.call-flow-202 pre {
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
.call-flow-202 pre code {
  background: transparent !important;
  padding: 0 !important;
  color: rgba(203,213,225,0.9) !important;
  font-size: 11.5px;
}
@media (max-width: 720px) {
  .call-flow-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   §4 — Message type cards (6 cards)
   ============================================================ */
.diagram-block.diagram-msg-types {
  background:
    linear-gradient(180deg, #0b0d12 0%, #07080b 100%);
  border: 1px solid #1e2939;
  padding: 20px;
  margin: 0 0 20px;
  color: #e2e8f0;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.msg-types-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.msg-type-card {
  padding: 14px 16px 12px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(71,85,105,0.5);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.msg-type-card.receipt {
  background: rgba(8,32,52,0.45);
  border-color: rgba(34,211,238,0.35);
}
.msg-type-iri {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  color: #67e8f9;
}
.msg-type-summary {
  font-size: 12.5px;
  color: rgba(203,213,225,0.85);
  font-style: italic;
  line-height: 1.45;
}
.msg-type-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 6px;
  border-top: 1px dashed rgba(148,163,184,0.15);
}
.meta-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 8px;
  align-items: baseline;
  font-size: 11px;
}
.meta-k {
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: rgba(148,163,184,0.55);
}
.meta-v {
  color: rgba(203,213,225,0.78);
  line-height: 1.4;
}
.meta-v code {
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  background: rgba(34,211,238,0.08);
  color: #67e8f9;
  padding: 0 3px;
  border-radius: 2px;
}
@media (max-width: 640px) {
  .msg-types-grid { grid-template-columns: 1fr; }
  .trigger-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------
   Notes sections (with h2 + h3 hierarchy)
   ------------------------------------------------------------ */
section.notes h2 {
  font-size: 24px;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
  font-weight: 700;
  position: relative;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
section.notes h3 {
  font-size: 15px;
  margin: 28px 0 6px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
}
section.notes h3:first-of-type { margin-top: 22px; }
section.notes h3.spec-hash {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  color: var(--accent);
  font-size: 14px;
  letter-spacing: 0;
}
section.notes p {
  margin: 0 0 12px;
  max-width: 740px;
  color: var(--ink-soft);
}
section.notes ul, section.notes ol {
  margin: 0 0 14px 22px;
  padding: 0;
  max-width: 740px;
  color: var(--ink-soft);
}
section.notes li { margin-bottom: 8px; }

/* ------------------------------------------------------------
   Aside prompt
   ------------------------------------------------------------ */
aside.prompt {
  margin-top: 40px;
  padding: 22px 24px;
  background: var(--warn-tint);
  border: 1px solid var(--warn-border);
  border-radius: var(--r-md);
}
aside.prompt h3 {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--warn);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: ui-monospace, "JetBrains Mono", monospace;
}
aside.prompt ul { margin: 0; padding-left: 20px; color: var(--ink); }
aside.prompt li { margin-bottom: 6px; font-size: 14.5px; }

/* ------------------------------------------------------------
   Page footer
   ------------------------------------------------------------ */
.page-foot {
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.footnav-link {
  text-decoration: none;
  color: var(--ink-soft);
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.12s;
}
.footnav-link:hover {
  border-color: var(--footnav-hover-border);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.footnav-link.disabled { opacity: 0.35; pointer-events: none; }

/* ------------------------------------------------------------
   Spec tables
   ------------------------------------------------------------ */
.spec-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 12px 0 24px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--paper);
}
.spec-table th, .spec-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink-soft);
}
.spec-table tr:last-child td { border-bottom: none; }
.spec-table th {
  font-weight: 600;
  color: var(--ink);
  background: var(--line-soft);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: ui-monospace, "JetBrains Mono", monospace;
}
.spec-table td code {
  font-size: 12.5px;
}

/* ------------------------------------------------------------
   Code blocks + tree
   ------------------------------------------------------------ */
pre.code, .tree {
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin: 12px 0 24px;
  color: var(--ink);
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
  overflow-x: auto;
}
.tree { white-space: pre; }
pre.code .dim, .tree .dim { color: var(--muted); }
.tree .accent { color: var(--accent-bright); font-weight: 600; }

/* ------------------------------------------------------------
   Nav divider
   ------------------------------------------------------------ */
.nav-divider {
  color: var(--line);
  user-select: none;
  margin: 0 6px;
  align-self: center;
  font-size: 14px;
  font-weight: 300;
}

/* ------------------------------------------------------------
   SVG stencil
   ------------------------------------------------------------ */
svg .person { fill: var(--svg-person-fill); stroke: var(--svg-person-stroke); stroke-width: 1; }
svg .person-label { fill: var(--svg-person-label); font-weight: 600; }
svg .system { fill: var(--svg-system-fill); stroke: var(--svg-system-stroke); stroke-width: 1; }
svg .system-label { fill: var(--svg-system-label); font-weight: 600; }
svg .system-ext { fill: var(--svg-system-ext-fill); stroke: var(--svg-system-ext-stroke); stroke-width: 1; }
svg .container { fill: var(--svg-container-fill); stroke: var(--svg-container-stroke); stroke-width: 1; }
svg .container-soft {
  fill: var(--svg-container-soft-fill);
  stroke: var(--svg-container-soft-stroke);
  stroke-width: 1;
}
svg .container-label { fill: var(--svg-container-label); font-weight: 600; }
svg .container-label-dark { fill: var(--svg-container-label-dark); font-weight: 600; }

svg .person, svg .system, svg .container { filter: var(--svg-drop-shadow); }

svg .boundary {
  fill: none;
  stroke: var(--svg-boundary-stroke);
  stroke-dasharray: 6 6;
  stroke-width: 1.5;
}
svg .boundary-label {
  fill: var(--svg-boundary-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
svg text {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  /* No text-anchor here — per-element `text-anchor` attribute controls alignment.
     CSS would override the SVG attribute due to specificity, so we leave it alone. */
}
svg .mono {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  background: none;
  border: none;
  padding: 0;
}
svg .arrow {
  stroke: var(--svg-arrow-stroke);
  stroke-width: 1.4;
  fill: none;
}
svg .arrow.dashed { stroke-dasharray: 5 4; }
svg .arrow-label {
  fill: var(--svg-arrow-label);
  font-size: 11px;
  font-weight: 500;
  font-family: ui-monospace, "JetBrains Mono", monospace;
}
svg marker > path { fill: var(--svg-arrow-stroke); }

/* Chips inside SVG layers */
svg .chip {
  fill: var(--svg-chip-bg);
  stroke: var(--svg-chip-border);
  stroke-width: 1;
}
svg .chip-ink {
  fill: var(--svg-chip-ink);
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 500;
}

/* ------------------------------------------------------------
   MD content (rendered from README.md / protocol/*.md)
   The HTML file is just a viewer; markdown is the source of truth.
   ------------------------------------------------------------ */
.md-content { max-width: 820px; margin: 0 auto; }
.md-content .md-loading { color: var(--muted); font-family: ui-monospace, "JetBrains Mono", monospace; font-size: 13px; }

.md-content h1 {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.0;
  margin: 0 0 22px;
}
.md-content > h1 + p {
  font-size: 20px;
  line-height: 1.45;
  color: var(--ink-soft);
  margin: 0 0 48px;
  max-width: 720px;
  letter-spacing: -0.005em;
}
.md-content h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 48px 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.md-content h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 26px 0 8px;
  color: var(--ink);
}
.md-content h3:first-of-type { margin-top: 20px; }
.md-content p, .md-content ul, .md-content ol {
  color: var(--ink-soft);
  margin: 0 0 14px;
}
.md-content ul, .md-content ol { padding-left: 22px; }
.md-content li { margin-bottom: 6px; }
.md-content a { color: var(--accent-bright); }
.md-content a:hover { text-decoration: underline; text-underline-offset: 3px; }
.md-content strong { color: var(--ink); font-weight: 600; }
.md-content em { font-style: italic; }
.md-content hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 36px 0;
}

/* Tables — match the look of .spec-table */
.md-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 14px 0 26px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--paper);
}
.md-content th, .md-content td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink-soft);
}
.md-content tbody tr:last-child td { border-bottom: none; }
.md-content thead th {
  font-weight: 600;
  color: var(--ink);
  background: var(--line-soft);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: ui-monospace, "JetBrains Mono", monospace;
}
.md-content td code { font-size: 12.5px; }

/* Inline code (already handled by base `code` rule, but override font-size for md context) */
.md-content :not(pre) > code {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 0.9em;
  background: var(--line-soft);
  border: 1px solid var(--line);
  padding: 0.5px 5px;
  border-radius: var(--r-xs);
  color: var(--ink);
}

/* Fenced code blocks (incl. turtle, bash, etc.) */
.md-content pre {
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin: 12px 0 24px;
  overflow-x: auto;
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
}
.md-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
  border-radius: 0;
}

/* Blockquotes */
.md-content blockquote {
  margin: 16px 0 22px;
  padding: 12px 18px;
  border-left: 3px solid var(--accent-bright);
  background: var(--accent-tint);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--ink-soft);
}
.md-content blockquote > :first-child { margin-top: 0; }
.md-content blockquote > :last-child { margin-bottom: 0; }

/* Mermaid containers */
.md-content .mermaid {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 40px 32px 32px;
  margin: 28px 0 36px;
  text-align: center;
  box-shadow: var(--shadow);
  overflow-x: auto;
  position: relative;
}
.md-content .mermaid::before {
  content: 'DIAGRAM';
  position: absolute;
  top: 14px;
  left: 18px;
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-bright);
  letter-spacing: 0.15em;
  opacity: 0.8;
}
.md-content .mermaid svg { max-width: 100%; height: auto; display: inline-block; }

/* Tighten mermaid subgraph cluster labels (Mermaid renders these as foreignObject) */
.md-content .mermaid .cluster rect {
  rx: 8px;
  ry: 8px;
}
.md-content .mermaid .cluster-label {
  font-family: ui-monospace, "JetBrains Mono", monospace !important;
  font-size: 11px !important;
  letter-spacing: 0.06em;
  text-transform: none;
}
.md-content .mermaid .nodeLabel {
  font-family: ui-monospace, "JetBrains Mono", monospace !important;
  font-size: 13px !important;
}
.md-content .mermaid .edgeLabel {
  font-family: ui-monospace, "JetBrains Mono", monospace !important;
  font-size: 11px !important;
  padding: 2px 6px !important;
  border-radius: 3px;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 760px) {
  main { padding: 32px 18px 80px; }
  .hero h1 { font-size: 44px; }
  .article-head h1 { font-size: 30px; }
  .topnav nav { font-size: 12px; gap: 0; flex-wrap: wrap; }
  .topnav nav a { padding: 6px 8px; }
  .nav-divider { display: none; }
  .topnav-inner { padding: 12px 16px; flex-wrap: wrap; }
  .diagram-block { padding: 18px 14px; }
  .page-foot { flex-direction: column; }
  .spec-table { font-size: 12.5px; }
  .spec-table th, .spec-table td { padding: 8px 10px; }
  pre.code, .tree { font-size: 12px; padding: 14px 16px; }
}

/* ============================================================
   Shared brand visuals — injected from shared/brand.css by build.py.
   This is the SINGLE SOURCE consumed by both the site and the Slidev
   decks. Do NOT edit between the markers by hand — edit shared/brand.css
   and run `python3 build.py`.
   ============================================================ */
/* BUILD:BRAND-START */
/* ============================================================
   shared/brand.css — SINGLE SOURCE for the Mind reusable visual blocks.

   This file is the one definition of the brand animated/diagram
   components. Both consumers pull from it:

     • Site   — build.py injects this file into site/styles.css
                between the BUILD:BRAND markers.
     • Slides — slides/styles/index.css @imports it (Vite).

   Edit the visuals HERE, run `python3 build.py`, and both the
   published site and the Slidev decks pick up the change.
   Keep everything class-scoped and self-contained (literal colors,
   no dependency on host stylesheet variables) so it renders
   identically in both toolchains.
   ============================================================ */

/* ---- .mind-mark — animated wordmark -------------------------------
   "Decentralized Network In Mind" → the four cyan initials fly
   straight into MIND. CSS-only (runs on render); cinematic dark panel.
   Markup: <div class="mind-mark"><div class="ln"> …spans… </div></div>
   each capital span carrying style="--dx:<n>ch".
   ------------------------------------------------------------------- */
.mind-mark{
  --hold:1.9s;            /* how long the sentence shows before collapsing */
  --move:1.05s;          /* duration of the fly-together */
  --scale:2.55;          /* how large the surviving letters grow */
  display:flex;align-items:center;justify-content:center;min-height:5.5em;
  font-family:ui-monospace,"JetBrains Mono","SF Mono",Menlo,Consolas,monospace;
}
/* add `.panel` for the boxed, cinematic dark-panel treatment (site hero);
   omit it to let the wordmark glow straight on the background (deck cover). */
.mind-mark.panel{
  margin:16px 0 32px;
  border:1px solid #1e2939;border-radius:12px;overflow:hidden;
  background:
    radial-gradient(ellipse 90% 70% at 50% 45%, rgba(34,211,238,.08) 0, transparent 60%),
    linear-gradient(180deg,#0b0d12,#07080b);
  box-shadow:0 30px 60px -30px rgba(0,0,0,.6);
}
.mind-mark .ln{ white-space:nowrap;font-size:clamp(20px,3.6vw,46px);line-height:1;font-weight:600; }
.mind-mark .ch{ display:inline-block;width:1ch;text-align:center; }
.mind-mark .ch .g{ display:inline-block;color:#7d8694;will-change:transform,opacity; }
.mind-mark .c .g{ color:#67e8f9;text-shadow:0 0 .5em rgba(34,211,238,.35); }
.mind-mark .c{ animation:mmMove var(--move) cubic-bezier(.6,0,.2,1) var(--hold) both; }
.mind-mark .c .g{ animation:mmGrow var(--move) cubic-bezier(.6,0,.2,1) var(--hold) both; }
.mind-mark .l .g{ animation:mmFade .55s ease var(--hold) both; }
@keyframes mmMove{ to{ transform:translateX(var(--dx)); } }
@keyframes mmGrow{ to{ transform:scale(var(--scale));
  text-shadow:0 0 .8em rgba(34,211,238,.65),0 0 1.6em rgba(34,211,238,.32); } }
@keyframes mmFade{ to{ opacity:0;transform:scale(.18) translateY(.1em); } }
@media print, (prefers-reduced-motion: reduce){
  .mind-mark .c,.mind-mark .c .g,.mind-mark .l .g{ animation:none; }
  .mind-mark .l .g{ opacity:0; }
  .mind-mark .c{ transform:translateX(var(--dx)); }
  .mind-mark .c .g{ transform:scale(var(--scale)); }
}
/* BUILD:BRAND-END */

/* Doc hero header — animated wordmark paired with a real h1 + tagline */
.doc-hero{ text-align:center; margin:4px 0 30px; }
.doc-hero .mind-mark{ margin:0 0 20px; }
.doc-hero-title{
  font-size:2.1rem; font-weight:800; letter-spacing:-0.02em; line-height:1.12;
  color:var(--ink); margin:0 0 8px; border:0; padding:0;
}
.doc-hero-sub{ font-size:1.05rem; color:var(--muted); margin:0 auto; max-width:54ch; }
