:root {
  --bg: #f6f5f1;
  --card: #fbfaf7;
  --ink: #1d1d1b;
  --ink-2: #33322e;
  --muted: #6b6a64;
  --line: #dcd9d0;
  --line-2: #e6e3da;
  --red: oklch(0.58 0.17 30);
  --red-ink: oklch(0.5 0.17 30);
  --blue: oklch(0.5 0.13 250);
  --blue-ink: oklch(0.45 0.13 250);
  --faint: #a8a49a;
  --sans: 'IBM Plex Sans', Helvetica, sans-serif;
  --mono: 'IBM Plex Mono', monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); } a:hover { color: var(--ink); }

.page { max-width: 1240px; margin: 0 auto; padding: 40px 28px 64px; display: flex; flex-direction: column; gap: 28px; }

.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; border-bottom: 1px solid var(--ink); padding-bottom: 20px; }
.intro { display: flex; flex-direction: column; gap: 8px; max-width: 660px; }
.eyebrow { font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
h1 { margin: 0; font-size: 34px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.intro p { margin: 0; font-size: 16px; line-height: 1.5; color: #4a4943; text-wrap: pretty; }

.tabs { display: flex; flex-wrap: wrap; border: 1px solid var(--ink); border-radius: 6px; overflow: hidden; }
.tabs button { font: 500 14px var(--sans); padding: 10px 16px; border: none; cursor: pointer; background: var(--card); color: var(--ink); white-space: nowrap; }
.tabs button + button { border-left: 1px solid var(--ink); }
.tabs button.on { background: var(--ink); color: var(--card); }

.layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 28px; align-items: start; }
@media (max-width: 1100px) { .layout { grid-template-columns: 1fr; } }

.diagram-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; min-width: 0; }
.diagram { position: relative; width: 100%; aspect-ratio: 1000 / 600; container-type: inline-size; }
.diagram svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.diagram svg text { font-family: var(--sans); paint-order: stroke; stroke: var(--card); stroke-width: 6px; }

.group { position: absolute; border: 1.5px dashed #b5b1a6; border-radius: 12px; }
.group-label { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); font: 500 11px var(--mono); letter-spacing: .08em; color: var(--muted); background: var(--card); padding: 0 6px; white-space: nowrap; }

.node { position: absolute; background: #fff; border: 2px solid var(--ink); border-radius: 8px; padding: 1cqw 1.2cqw; display: flex; flex-direction: column; justify-content: center; gap: 2px; overflow: hidden; }
.node.dashed { border-style: dashed; }
.node.ghost { opacity: .3; }
.node-name { font-size: clamp(12px, 2cqw, 20px); font-weight: 600; }
.node-role { font-size: clamp(9px, 1.25cqw, 12px); line-height: 1.3; color: var(--muted); }
@container (max-width: 520px) { .node-role { display: none; } }

.badge { position: absolute; font: 500 clamp(9px, 1.2cqw, 12px) var(--mono); padding: 3px 8px; border-radius: 4px; white-space: nowrap; transform: translateY(-120%); }
.badge.dark { background: var(--ink); color: var(--card); }
.badge.red { background: var(--red); color: #fff; }
.badge.blue { background: var(--blue); color: #fff; }
.badge.outline { border: 1px solid var(--ink); background: var(--card); color: var(--ink); }

.marker { position: absolute; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--red); background: #fff; color: var(--red); font: 600 14px var(--mono); cursor: pointer; padding: 0; }
.marker.on { background: var(--red); color: #fff; }

.legend { display: flex; flex-wrap: wrap; gap: 20px; padding: 12px 4px 0; border-top: 1px solid var(--line-2); margin-top: 12px; font-size: 13px; color: #4a4943; }
.legend span { display: flex; align-items: center; gap: 8px; }
.ln { display: block; width: 28px; height: 0; }
.ln-known { border-top: 2px solid var(--ink); }
.ln-new { border-top: 3px solid var(--red); }
.ln-unknown { border-top: 2px dashed var(--red); }
.gate-icon { display: block; width: 12px; height: 12px; border: 2px solid var(--ink); transform: rotate(45deg); }

.side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.side-eyebrow { font: 500 12px var(--mono); letter-spacing: .08em; color: var(--muted); }
.side-eyebrow.red { color: var(--red-ink); }
.side-eyebrow.blue { color: var(--blue-ink); }
.side p { margin: 0; font-size: 16px; line-height: 1.55; text-wrap: pretty; }
.side p.muted { color: #4a4943; }
.points { display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }

.conflict { cursor: pointer; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: transparent; text-align: left; font: inherit; color: inherit; width: 100%; }
.conflict.on { border-color: var(--red); background: #fff; }
.conflict-head { display: flex; gap: 10px; align-items: baseline; }
.conflict-n { font: 600 13px var(--mono); color: var(--red-ink); }
.conflict-title { font-size: 15px; font-weight: 600; line-height: 1.3; }
.conflict-body { display: none; flex-direction: column; gap: 8px; padding-left: 22px; }
.conflict.on .conflict-body { display: flex; }
.conflict-text { font-size: 14px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.conflict-symptom { font-size: 13px; line-height: 1.45; color: var(--muted); }
.conflict-symptom b { font: 500 13px var(--mono); color: var(--ink); }

.bottom { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 28px; align-items: start; }
.bottom section { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
h2 { margin: 0; font-size: 20px; font-weight: 600; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
table { width: 100%; min-width: 580px; border-collapse: collapse; font-size: 14px; line-height: 1.4; }
th { text-align: left; padding: 10px 12px; font: 500 11px var(--mono); color: var(--muted); border-bottom: 1px solid var(--ink); text-transform: uppercase; }
th.now { color: var(--red-ink); } th.proposed { color: var(--blue-ink); }
td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td:first-child { font-weight: 600; }
td.warn { color: var(--red-ink); }

.questions { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); counter-reset: q; }
.questions li { counter-increment: q; display: grid; grid-template-columns: 32px 1fr; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line-2); font-size: 15px; line-height: 1.45; text-wrap: pretty; }
.questions li::before { content: counter(q, decimal-leading-zero); font: 500 13px var(--mono); color: var(--muted); padding-top: 2px; }
