/* Ostra developer docs. The Proof Sheet (DESIGN.md) in Read mode: tokens from
   brand/brand.css (dark) and the doc tokens (light), mapped role for role.
   The frame (rail, line card, code panels, route cards) carries the world;
   the reading column stays calm: Inter at 16px in about 70 characters. */

@font-face {
  font-family: 'Inter';
  src: url('fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/JetBrainsMono-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

:root {
  --bg: #0C0E11;
  --rail: #0F1115;
  --surface: #13161B;
  --surface-2: #1A1E24;
  --line: #242930;
  --line-2: #313741;
  --text: #E9EDF1;
  --text-2: #B3BBC5;
  --muted: #828C97;
  --signal: #3BD9F2;
  --signal-text: #3BD9F2;
  --signal-dim: rgba(59, 217, 242, .13);
  --signal-mark: rgba(59, 217, 242, .10);
  --warn: #F2B544;
  --warn-text: #F2B544;
  --warn-dim: rgba(242, 181, 68, .09);
  --sector: rgba(233, 237, 241, .28);
  --code-bg: #101317;
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--signal);
  --lift: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 32px -18px rgba(0, 0, 0, .8);
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --gutter: 16px;
  --top-h: 0px;
  --measure: 70ch;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #F3F5F7;
    --rail: #EBEEF2;
    --surface: #FFFFFF;
    --surface-2: #EEF1F4;
    --line: #DDE1E5;
    --line-2: #C9CFD6;
    --text: #0F1216;
    --text-2: #39414B;
    --muted: #5D6670;
    --signal: #0A8EA6;
    --signal-text: #08758A;
    --signal-dim: rgba(10, 142, 166, .12);
    --signal-mark: rgba(10, 142, 166, .09);
    --warn: #D9941A;
    --warn-text: #8A5A06;
    --warn-dim: rgba(217, 148, 26, .08);
    --sector: rgba(12, 14, 17, .28);
    --code-bg: #FFFFFF;
    --lift: 0 1px 2px rgba(15, 18, 22, .05), 0 12px 32px -20px rgba(15, 18, 22, .25);
    color-scheme: light;
  }
}

@media (min-width: 720px) { :root { --gutter: 28px; } }
@media (max-width: 1099px) { :root { --top-h: 53px; } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--line-2) var(--bg);
  scroll-padding-top: calc(var(--top-h) + 24px);
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--sans);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--signal-dim); color: var(--text); }
input { caret-color: var(--signal); }
/* Links are text with an underline: signal cyan is spent on the current page's tick and a sample's
   marked line, the One Signal Rule (DESIGN.md), as the iPhone app keeps its links quiet. */
a { color: var(--text); text-decoration-color: var(--muted); text-decoration-thickness: 1px; text-underline-offset: 3px; }
@media (hover: hover) { a:hover { text-decoration-color: var(--text); } }
a, button, input, summary { touch-action: manipulation; }
@media (hover: hover) { a:hover { text-decoration-thickness: 2px; } }
.doc p a, .doc li a, .doc dd a, .doc td a { font-weight: 500; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
h1, h2, h3 { font-variation-settings: 'opsz' 32; text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
code, kbd, pre { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 30;
  background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: 7px; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---------- Draft strip and pending values (removed before publishing) ---------- */
.draft {
  border-top: 3px solid var(--warn);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
  padding: 9px max(var(--gutter), env(safe-area-inset-left));
}
.draft strong { color: var(--warn-text); font-weight: 600; }
.pending {
  text-decoration: underline dashed var(--warn);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  text-decoration-skip-ink: none;
}
.pending::after {
  content: 'Pending ' attr(data-pending);
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border: 1px solid var(--warn);
  border-radius: 4px;
  font: 600 10.5px/1.3 var(--sans);
  letter-spacing: .01em;
  color: var(--warn-text);
  vertical-align: 2px;
  text-decoration: none;
  white-space: nowrap;
}
.pending-block {
  border: 1px dashed color-mix(in srgb, var(--warn) 75%, transparent);
  border-radius: 10px;
  padding: 14px 16px 4px;
  margin: 0 0 22px;
  background: var(--warn-dim);
}
.pending-block::before {
  content: 'Pending ' attr(data-pending) ': ' attr(data-say);
  display: block;
  font: 600 12px/1.4 var(--sans);
  letter-spacing: .01em;
  color: var(--warn-text);
  margin-bottom: 8px;
}

/* ---------- Wordmark ---------- */
.wordmark {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 21px; letter-spacing: -0.045em; line-height: 1;
  font-variation-settings: 'opsz' 32;
  color: var(--text); text-decoration: none;
  padding: 6px 2px;
}
.wordmark svg { width: 1.2em; height: 1.2em; flex: none; }
.sector { stroke: var(--sector); }
.lit { stroke: #3BD9F2; } /* the lit sector is never recoloured (BRAND.md), light scheme included */
.hub { fill: currentColor; }
.docs-tag {
  margin-left: 4px;
  padding: 3px 6px 3px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  font: 500 11.5px/1 var(--mono);
  letter-spacing: 0;
  color: var(--text-2);
}

/* ---------- Shell: rail, reading column, contents ---------- */
.shell { display: block; }
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: var(--top-h);
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.menu-link {
  display: inline-flex; align-items: center; min-height: 36px; padding: 6px 13px;
  border: 1px solid var(--line-2); border-radius: 7px;
  background: var(--surface); color: var(--text);
  font: 500 13.5px/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color 160ms var(--ease), transform 120ms var(--ease);
}
.menu-link:active { transform: scale(.97); }
@media (hover: hover) { .menu-link:hover { background: var(--surface-2); text-decoration: none; } }

.rail { background: var(--rail); border-top: 1px solid var(--line); }
.rail-inner { padding: 20px max(var(--gutter), env(safe-area-inset-left)) 28px; }
.rail-mark { display: none; }

.main { padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left)); }
.doc { max-width: var(--measure); margin: 0 auto; padding: 28px 0 56px; min-width: 0; }
.toc { display: none; }

/* Without JavaScript a phone reads the page, then the rail below it (Menu jumps there). */
@media (max-width: 1099px) {
  .shell { display: flex; flex-direction: column; }
  .top { order: 0; }
  .main { order: 1; }
  .rail { order: 2; }
  /* With JavaScript the rail opens under the top bar as a sheet. */
  .js .rail { display: none; }
  .js body.menu-open .rail {
    display: block;
    position: fixed; z-index: 19; inset: var(--sheet-top, var(--top-h)) 0 0 0;
    overflow-y: auto; overscroll-behavior: contain;
    border-top: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .js body.menu-open { overflow: hidden; }
}

@media (min-width: 1100px) {
  .top { display: none; }
  .shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100dvh; }
  .rail { border-top: 0; border-right: 1px solid var(--line); }
  .rail-inner { position: sticky; top: 0; max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; padding: 22px 20px 28px; scrollbar-width: thin; }
  .rail-mark { display: inline-flex; margin: 0 0 14px; }
  .main { display: grid; grid-template-columns: minmax(0, 1fr); padding: 0 48px; }
  .doc { padding: 44px 0 72px; margin: 0; max-width: var(--measure); }
}
@media (min-width: 1280px) {
  .main { grid-template-columns: minmax(0, var(--measure)) 200px; gap: 56px; justify-content: start; }
  .toc { display: block; }
}

/* ---------- Search ---------- */
.search { position: relative; margin: 0 0 22px; }
.search input {
  width: 100%;
  min-height: 38px;
  padding: 8px 34px 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: 400 16px/1.3 var(--sans); /* 16px: no zoom on focus in iOS Safari */
  appearance: none;
}
@media (min-width: 1100px) { .search input { font-size: 14px; } }
.search input::placeholder { color: var(--muted); }
.search input:focus-visible { box-shadow: var(--ring); border-color: transparent; border-radius: 8px; }
@media (max-width: 1099px) { .search kbd { display: none; } }
.search kbd {
  position: absolute; right: 8px; top: 9px;
  min-width: 20px; padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 4px;
  font-size: 11.5px; line-height: 17px; color: var(--muted); text-align: center; background: var(--surface-2);
}
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd { display: none; }
.results {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
.results a {
  display: block; padding: 9px 12px; text-decoration: none; color: var(--text);
  border-top: 1px solid var(--line);
}
.results a:first-child { border-top: 0; }
.results a small { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 1px; }
.results a span { display: block; font-size: 14px; font-weight: 500; line-height: 1.35; }
.results a em { display: block; font-style: normal; font-size: 12.5px; color: var(--text-2); line-height: 1.45; margin-top: 2px; overflow-wrap: anywhere; }
.results a[aria-selected='true'], .results a:focus-visible { background: var(--surface-2); box-shadow: none; border-radius: 0; }
.results-none { margin: 8px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 13.5px; color: var(--text-2); }

/* ---------- Navigation ---------- */
.nav-group + .nav-group { margin-top: 14px; }
.nav-head { margin: 0 0 6px; padding: 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .01em; color: var(--muted); }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block; padding: 5px 10px; border-radius: 6px;
  color: var(--text-2); text-decoration: none; font-size: 14.5px; line-height: 1.4;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}
@media (hover: hover) { .nav a:hover { background: var(--surface); color: var(--text); } }
.nav a[aria-current='page'] { position: relative; color: var(--text); font-weight: 500; }
.nav a[aria-current='page']::before { content: ''; position: absolute; left: 0; top: 50%; width: 2px; height: 14px; margin-top: -7px; border-radius: 1px; background: var(--signal); }

/* ---------- The line card (the sandbox line every account has) ---------- */
.line-card {
  margin: 22px 0 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 12px 14px 12px;
}
.lc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0; font-size: 12px; color: var(--muted); }
.lc-head a { font-size: 12px; }
.lc-id { margin: 4px 0 8px; }
.lc-id code { font-size: 15px; font-weight: 500; color: var(--text); }
.line-card dl { margin: 0; border-top: 1px solid var(--line); }
.line-card dl div { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.line-card dt { font-size: 12px; color: var(--muted); }
.line-card dd { margin: 0; font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.line-card dd code { font-size: 12px; }
.lc-note { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.rail-foot { margin: 18px 0 0; padding: 0 2px; font-size: 13px; }
.rail-foot a, .lc-head a { color: var(--text-2); text-decoration-color: var(--line-2); }

/* ---------- On this page ---------- */
.toc { position: sticky; top: 0; align-self: start; max-height: 100dvh; overflow-y: auto; padding: 48px 0 32px; scrollbar-width: thin; }
.toc-head { margin: 0 0 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a {
  display: block; margin-left: -1px; padding: 4px 0 4px 13px;
  border-left: 1px solid transparent;
  font-size: 13px; line-height: 1.45; color: var(--muted); text-decoration: none;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}
@media (hover: hover) { .toc a:hover { color: var(--text); } }
.toc a[aria-current='true'] { color: var(--text); border-left-color: var(--text); }

/* ---------- The reading column ---------- */
.doc h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 6.4vw, 42px); font-weight: 600; line-height: 1.08; letter-spacing: -0.035em;
}
.lede { margin: 0 0 30px; font-size: 18px; line-height: 1.6; color: var(--text-2); }
.doc h2 {
  margin: 60px 0 14px; padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 25px; font-weight: 600; line-height: 1.2; letter-spacing: -0.03em;
}
.doc h3 { margin: 34px 0 8px; font-size: 17.5px; font-weight: 600; line-height: 1.35; letter-spacing: -0.012em; }
.doc p, .doc ul, .doc ol { margin: 0 0 16px; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 0 0 6px; }
.doc li::marker { color: var(--muted); }
.doc strong { font-weight: 600; }
.doc :not(pre) > code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  font-size: .86em;
  overflow-wrap: anywhere;
}
.doc a code { color: inherit; }
.doc :not(pre) > code { -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.note {
  margin: 0 0 20px; padding: 12px 15px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); color: var(--text-2); font-size: 15px;
}
.note strong { color: var(--text); }
.note > :last-child { margin-bottom: 0; }

/* ---------- Code ---------- */
.code {
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--code-bg);
  overflow: hidden;
}
.code figcaption {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  min-height: 38px; padding: 6px 8px 6px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  font-size: 12.5px; color: var(--muted);
}
.code .lang { font-weight: 600; color: var(--text-2); }
.code .file { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.code .cap { flex: 1 1 14em; min-width: 0; }
.copy {
  margin-left: auto;
  min-height: 28px; padding: 3px 11px;
  border: 1px solid var(--line-2); border-radius: 6px;
  background: var(--bg); color: var(--text);
  font: 500 12.5px/1 var(--sans); cursor: pointer;
  transition: background-color 160ms var(--ease), transform 120ms var(--ease);
}
.copy:active { transform: scale(.97); }
@media (hover: hover) { .copy:hover { background: var(--surface-2); } }
.copy[data-done] { color: var(--signal-text); border-color: var(--signal); }
.code pre {
  margin: 0; padding: 14px 16px 16px;
  overflow-x: auto;
  font-size: 13px; line-height: 1.65; tab-size: 2;
  color: var(--text);
  scrollbar-width: thin;
}
.code pre:focus-visible { box-shadow: inset 0 0 0 2px var(--signal); border-radius: 0; }
.code code { white-space: pre; }
.code .c { color: var(--muted); }
.code .mark {
  display: inline-block; min-width: calc(100% + 32px);
  margin: 0 -16px; padding: 0 16px;
  background: var(--signal-mark);
  box-shadow: inset 1px 0 0 var(--signal);
}
.code-note {
  margin: 0 !important; padding: 9px 14px 10px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: 13.5px; line-height: 1.5; color: var(--text-2);
}

/* ---------- Tables (rows of labelled facts on a phone) ---------- */
.table-wrap { margin: 0 0 24px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.doc thead th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 0 12px 8px 0; border-bottom: 1px solid var(--line-2); }
.doc tbody th, .doc tbody td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
.doc tbody th { font-weight: 500; }
.doc tbody th code, .doc .num code { white-space: nowrap; }
.doc .num { width: 1%; white-space: nowrap; }
.doc .routes-cell { font-size: 13px; line-height: 1.7; }
.doc .routes-cell a { color: var(--text-2); text-decoration: none; }
.doc .routes-cell a code { border: 0; background: none; padding: 0; }
.doc table .opt { font-size: 12px; color: var(--muted); }
.doc tbody tr:target { background: var(--signal-mark); }
@media (max-width: 719px) {
  .doc table, .doc tbody, .doc tr, .doc tbody th, .doc tbody td { display: block; }
  .doc thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .doc tbody tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .doc tbody th, .doc tbody td { padding: 2px 0; border: 0; width: auto; }
  .doc .num { width: auto; }
  .doc tbody td[data-k]::before { content: attr(data-k); display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 6px; }
  .doc tbody tr > :first-child[data-k]::before { content: none; }
  .doc table.errors tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; }
  .doc table.errors tbody td:last-child { grid-column: 1 / -1; }
  .doc table.errors tbody th::before, .doc table.errors tbody td:last-child::before { content: none; }
}

/* ---------- Fact lists ---------- */
.facts { margin: 0 0 22px; border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-size: 13.5px; color: var(--muted); }
.facts dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
@media (max-width: 559px) {
  .facts > div { grid-template-columns: minmax(0, 1fr); gap: 1px; }
}

/* ---------- The line ID taken apart (Start here) ---------- */
.anatomy {
  margin: 0 0 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--lift);
  padding: 22px 22px 18px;
}
.anatomy-caption { margin: 0 0 16px; font-size: 13.5px; color: var(--muted); }
/* The ID is one run of mono characters; every position below is in ch of
   that same face and size, so the leader rules land under their segments:
   LAX is 0 to 3ch, V 4 to 5ch, 07 6 to 8ch. */
.id-diagram { font: 500 clamp(32px, 9vw, 60px)/1 var(--mono); font-variant-numeric: tabular-nums; margin: 0 0 6px; }
.id-run { margin: 0; letter-spacing: 0; color: var(--muted); white-space: nowrap; }
.id-run .s { color: var(--text); padding-bottom: .06em; border-bottom: 2px solid var(--line-2); }
.id-diagram .stem {
  height: 14px;
  background-image: linear-gradient(var(--line-2), var(--line-2)), linear-gradient(var(--line-2), var(--line-2)), linear-gradient(var(--line-2), var(--line-2));
  background-size: 1.5px 100%;
  background-repeat: no-repeat;
  background-position: 1.5ch 0, 4.5ch 0, 7ch 0;
}
/* Nearest the ID is the rightmost segment, so no rule crosses a label; the
   reading order stays metro, network, slot. */
.doc .leaders { display: flex; flex-direction: column-reverse; list-style: none; margin: 0; padding: 0; }
.doc .leaders li {
  position: relative; margin: 0;
  padding: 5px 0 7px calc(var(--x) + 1.2ch);
  background-image: linear-gradient(var(--line-2), var(--line-2)), linear-gradient(var(--line-2), var(--line-2));
  background-size: 1.5px 100%;
  background-repeat: no-repeat;
  background-position: var(--pass1, -9px) 0, var(--pass2, -9px) 0;
}
.doc .leaders li::before { content: ''; position: absolute; left: var(--x); top: 0; width: 1.5px; height: 16px; background: var(--line-2); }
.doc .leaders li::after { content: ''; position: absolute; left: var(--x); top: 15px; width: calc(1.2ch - 6px); height: 1.5px; background: var(--line-2); }
.leaders .l1 { --x: 1.5ch; }
.leaders .l2 { --x: 4.5ch; --pass1: 1.5ch; }
.leaders .l3 { --x: 7ch; --pass1: 1.5ch; --pass2: 4.5ch; }
.leaders .t { display: block; font: 400 13.5px/1.45 var(--sans); color: var(--text-2); max-width: 32em; }
.leaders .t a { color: var(--text); text-decoration-color: var(--line-2); margin-right: 4px; }
.leaders .t b { font-weight: 600; }
.doc .ports { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 18px 0 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.doc .ports li { margin: 0; padding: 12px 14px 2px; border-left: 1px solid var(--line); }
.doc .ports li:first-child { padding-left: 0; border-left: 0; }
.ports a { display: block; color: var(--text); text-decoration: none; }
@media (hover: hover) { .ports a:hover code { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; } }
.ports small { display: block; font-size: 12px; color: var(--muted); }
.anatomy-note { margin: 12px 0 0; font-size: 13.5px; color: var(--text-2); }
.doc .ports code { font-size: 18px; font-weight: 500; border: 0; background: none; padding: 0; }
.ports span { display: block; font-size: 12.5px; color: var(--text-2); line-height: 1.4; margin-top: 2px; }
@media (max-width: 559px) {
  .anatomy { padding: 18px 16px 14px; }
  .doc .ports { grid-template-columns: minmax(0, 1fr); }
  .doc .ports li, .doc .ports li:first-child { padding: 10px 0 8px; border-left: 0; border-top: 1px solid var(--line); }
  .doc .ports li:first-child { border-top: 0; }
}

/* ---------- Steps (Start here) ---------- */
.steps { list-style: none; margin: 0 0 24px; padding: 0; counter-reset: step; border-top: 1px solid var(--line); }
.steps > li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 0 12px; padding: 14px 0; margin: 0; border-bottom: 1px solid var(--line); counter-increment: step; }
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  font: 500 13px/1.9 var(--mono); color: var(--muted);
}
.steps h3 { margin: 0 0 4px; font-size: 16px; }
.steps p { margin: 0; color: var(--text-2); font-size: 15px; }
.steps .when { display: inline-block; margin-top: 6px; font-size: 12.5px; color: var(--muted); }

/* ---------- Route cards (one fixed field grammar) ---------- */
.group-intro { color: var(--text-2); }
.doc .index { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; }
.doc .index li { margin: 0; max-width: 100%; }
.index a {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 4px 9px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--text-2); text-decoration: none;
  font-size: 12.5px; max-width: 100%;
}
.index a .verb { min-width: 0; }
.index a code { font-size: 12px; border: 0 !important; background: none !important; padding: 0 !important; overflow-wrap: anywhere; }
@media (hover: hover) { .index a:hover { border-color: var(--line-2); color: var(--text); } }
.verb {
  display: inline-block; min-width: 3.4em;
  font: 500 11.5px/1.5 var(--mono); letter-spacing: .02em; color: var(--text-2);
}
.route { margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
.route h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 6px; }
.route h3 .verb {
  min-width: 0; padding: 1px 7px; border: 1px solid var(--line-2); border-radius: 4px;
  background: var(--surface-2); color: var(--text); font-size: 12px;
}
.route h3 code.path { font-size: 15.5px; font-weight: 500; border: 0 !important; background: none !important; padding: 0 !important; overflow-wrap: anywhere; }
.route .host { color: var(--muted); }
.route .host::after { content: ' '; }
.route > p { margin: 0 0 12px; color: var(--text-2); }
.route .facts > div { grid-template-columns: 130px minmax(0, 1fr); padding: 7px 0; }
.route .facts dd { font-size: 14px; }
.route .facts dd a { color: var(--text); text-decoration: none; }
.route:target h3 code.path { color: var(--signal-text); }
@media (max-width: 559px) { .route .facts > div { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Port cards (Proxy ports and IPs) ---------- */
.port-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 0 0 22px; }
.port-card { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 14px 18px 4px; }
.port-card h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 6px; font-size: 16px; }
.port-card .pn { font: 500 20px/1 var(--mono); letter-spacing: -0.01em; color: var(--text); }
.port-card .addr { margin: 0 0 10px; }
.doc .port-card .addr code { display: block; padding: 8px 10px; border-radius: 6px; background: var(--bg); font-size: 13px; overflow-wrap: anywhere; }
.port-card .facts { margin: 0; border-top: 0; }
.port-card .facts > div { grid-template-columns: 130px minmax(0, 1fr); }
.port-card .facts > div:last-child { border-bottom: 0; }
.port-card .facts dd { font-size: 14.5px; color: var(--text-2); }
@media (max-width: 559px) { .port-card .facts > div { grid-template-columns: minmax(0, 1fr); } }

/* ---------- CLI commands ---------- */
.commands { margin: 0 0 24px; border-top: 1px solid var(--line); }
.commands > div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.commands dt code { border: 0 !important; background: none !important; padding: 0 !important; font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; }
.commands dd { margin: 2px 0 0; color: var(--text-2); font-size: 15px; }

/* ---------- Two-up comparison (keys and OAuth, apps) ---------- */
.pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 0 0 24px; }
@media (min-width: 640px) { .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pair > section { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 16px 18px 6px; }
.pair h3 { margin: 0 0 6px; font-size: 16px; }
.pair p, .pair ul { font-size: 15px; color: var(--text-2); }
.pair ul { padding-left: 18px; }

/* ---------- Previous and next ---------- */
.prevnext { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 64px 0 0; padding-top: 22px; border-top: 1px solid var(--line); }
.prevnext a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--text); transition: border-color 160ms var(--ease); }
@media (hover: hover) { .prevnext a:hover { border-color: var(--line-2); } }
.prevnext .next { text-align: right; }
.prevnext small { display: block; font-size: 12px; color: var(--muted); }
.prevnext b { font-weight: 600; font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
