:root {
  color-scheme: light;
  --bg: #fafaf8; --panel: #ffffff; --subtle: #f4f3f0; --line: #e8e6e1; --line-strong: #d4d1ca;
  --ink: #18181a; --text: #2a2a2d; --secondary: #5c5c63; --muted: #8a8a91;
  --accent: #ff5e1f; --accent-hover: #f04f10; --accent-ink: #c2410c; --accent-tint: #fff1ea;
  --red: #b42318; --red-tint: #fef1f0; --red-solid: #e5484d;
  --green: #18794e; --green-tint: #eaf6ef; --green-solid: #2aa56d;
  --amber: #93540a; --amber-tint: #fdf3e0; --amber-solid: #e09a16;
  --blue: #0b5cad; --blue-tint: #ebf3fb; --blue-solid: #2f80d8;
  --str: #b3470b; --shadow: 0 1px 2px rgba(24, 24, 26, 0.04);
  --band: #18181a; --band-text: #f3f3f1; --band-muted: #a3a3a8; --band-line: #2e2e31;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --radius: 12px;
  --gutter: clamp(20px, 4vw, 56px);
  --nav-h: 64px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0e0f; --panel: #151516; --subtle: #1c1c1e; --line: #28282b; --line-strong: #3a3a3e;
  --ink: #f4f4f2; --text: #d8d8d5; --secondary: #a2a2a8; --muted: #74747a;
  --accent-ink: #ff8a57; --accent-tint: #2a170e;
  --red: #ff9189; --red-tint: #2b1513; --green: #73d6a4; --green-tint: #10261b;
  --amber: #f0b65c; --amber-tint: #2a2010; --blue: #84bcf7; --blue-tint: #12202f;
  --str: #f0a070; --shadow: none;
  --band: #151516; --band-text: #f4f4f2; --band-muted: #a2a2a8; --band-line: #28282b;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 40px); }
body { display: flex; flex-direction: column; min-height: 100vh; margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body > main, body > .docs { flex: 1 0 auto; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p, dl, dd, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, canvas { display: block; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: 0.5; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
svg.lucide { width: 16px; height: 16px; stroke-width: 1.75; flex: none; }
.mono, code, kbd { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code { padding: 1px 5px; border-radius: 4px; background: var(--subtle); border: 1px solid var(--line); color: var(--ink); white-space: nowrap; }
.wrap { width: 100%; max-width: 1480px; margin-inline: auto; padding-inline: var(--gutter); }
.dim { color: var(--muted); }

/* ---------- navigation ---------- */
/* The bar is a notch hanging from the top edge: rounded lower corners, and a small
   concave "ear" on each side where it meets the top of the window. */
.nav { --notch: var(--frame-r); --notch-r: var(--frame-r); --nav-extra: clamp(12px, 2.4vw, 36px); position: sticky; top: 0; z-index: 1100; pointer-events: none; }
/* The bar is wider than the content column on each side, so it reads as its own layer
   and does not line up with section edges while scrolling. It narrows with the window so
   that each ear always lands on the straight part of the frame's top edge, clear of the
   frame's rounded corner. */
.nav > .wrap { max-width: calc(1480px + 2 * var(--nav-extra)); padding-inline: max(calc(var(--gutter) - var(--nav-extra)), calc(var(--frame) + var(--frame-r) + var(--notch))); }
.nav-inner { position: relative; display: flex; align-items: center; height: var(--nav-h); gap: 40px; padding-inline: 20px; border: 1px solid var(--line); border-top-color: transparent; border-radius: 0 0 var(--notch-r) var(--notch-r); background: var(--bg); pointer-events: auto; transition: border-color 0.15s, border-radius 0.15s, box-shadow 0.15s; }
.nav-inner::before, .nav-inner::after { content: ""; position: absolute; top: -1px; width: var(--notch); height: var(--notch); border-top: 1px solid var(--line); pointer-events: none; }
.nav-inner::before { right: 100%; border-right: 1px solid var(--line); border-top-right-radius: var(--notch); box-shadow: 6px -6px 0 0 var(--bg); }
.nav-inner::after { left: 100%; border-left: 1px solid var(--line); border-top-left-radius: var(--notch); box-shadow: -6px -6px 0 0 var(--bg); }
.nav.scrolled .nav-inner { border-color: var(--line-strong); box-shadow: 0 8px 24px rgba(24, 24, 26, 0.08); }
:root[data-theme="dark"] .nav.scrolled .nav-inner { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
/* Every page opens with a framed block inset from the window edges, and the notch hangs
   from the top of that frame. Once the page scrolls the bar floats free. */
body { --frame: clamp(8px, 1vw, 14px); --frame-r: 16px; }
.nav { top: var(--frame); margin-top: var(--frame); }
.hero { margin: calc(-1 * var(--nav-h)) var(--frame) 0; padding-top: var(--nav-h); border: 1px solid var(--line); border-radius: var(--frame-r); }
.nav.scrolled .nav-inner { border-top: 1px solid var(--line-strong); border-radius: var(--notch-r); }
.nav.scrolled .nav-inner::before, .nav.scrolled .nav-inner::after { display: none; }

/* Inner pages: the frame holds the page title on a quiet tinted ground. */
.page-hero { background: var(--subtle); }
.page-hero .page-head { padding-block: clamp(28px, 4vw, 56px) clamp(28px, 3.5vw, 48px); }
/* A heading block centred over the content below it, like the hero. */
.section-head.centered { justify-content: center; text-align: center; }
.section-head.centered > div { flex: 0 1 auto; }
.section-head.centered .kicker { justify-content: center; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; }
/* The name is two words set as one. "IP" is quieter, so it does not read as "IPO". */
.brand i { color: var(--secondary); font-style: normal; font-weight: 500; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 8px; color: var(--secondary); font-weight: 500; }
.nav-links a:hover { color: var(--ink); background: var(--subtle); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--ink); background: var(--subtle); }
.nav-end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.my-ip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--secondary); font-size: 13px; white-space: nowrap; }
.my-ip:hover { border-color: var(--line-strong); text-decoration: none; }
.my-ip b { color: var(--ink); font: 500 13px var(--mono); max-width: 22ch; overflow: hidden; text-overflow: ellipsis; }
.theme-toggle { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--secondary); }
.theme-toggle:hover { color: var(--ink); border-color: var(--line-strong); }
:root[data-theme="dark"] .theme-toggle .moon, :root:not([data-theme="dark"]) .theme-toggle .sun { display: none; }
.badge-count { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent-tint); color: var(--accent-ink); font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; }
.nav-toggle { display: none; width: 40px; height: 40px; align-items: center; justify-content: center; margin-left: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.nav-toggle .when-open, .nav.open .nav-toggle .when-closed { display: none; }
.nav.open .nav-toggle .when-open { display: block; }
@media (max-width: 1060px) { .nav .my-ip { display: none !important; } }
@media (max-width: 850px) {
  /* The bar keeps its closed height in the page flow, so the open menu drops over the hero
     instead of pushing it down. */
  .nav { height: calc(var(--nav-h) + 1px); }
  .nav-inner { gap: 8px; }
  .nav-links { display: none; }
  /* The theme switch stays in the bar, left of the menu button; the rest of .nav-end only
     appears in the open menu. */
  .nav-end { display: contents; }
  .nav-end .btn { display: none; }
  .nav-end .theme-toggle { margin-left: auto; width: 40px; height: 40px; }
  .nav-toggle { display: inline-flex; margin-left: 0; }
  .nav.open .nav-inner { flex-wrap: wrap; height: auto; padding-bottom: 14px; border-color: var(--line-strong); box-shadow: 0 16px 40px rgba(24, 24, 26, 0.14); }
  :root[data-theme="dark"] .nav.open .nav-inner { box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6); }
  .nav.open .brand { height: var(--nav-h); }
  .nav.open .nav-links { order: 2; display: flex; flex-direction: column; align-items: stretch; gap: 2px; width: 100%; padding: 6px 0 12px; border-top: 1px solid var(--line); }
  .nav.open .nav-links a { height: 44px; padding: 0 12px; font-size: 16px; }
  .nav.open .nav-end .btn { order: 3; display: inline-flex; width: 100%; height: 42px; }
}
/* Phones: the hero runs edge to edge with no frame, and the bar is a rounded box floating
   over it with a small margin on each side, open or closed. */
@media (max-width: 640px) {
  .hero { margin-inline: 0; border-inline: 0; border-top: 0; border-radius: 0; }
  .nav > .wrap { padding-inline: 10px; }
  .nav-inner, .nav.scrolled .nav-inner { padding-inline: 14px; border: 1px solid var(--line-strong); border-radius: var(--notch-r); }
  .nav-inner::before, .nav-inner::after { display: none; }
}

/* ---------- buttons and inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--ink); font-size: 14px; font-weight: 500; white-space: nowrap; text-decoration: none; }
.btn:hover:not(:disabled) { background: var(--subtle); text-decoration: none; }
.btn.primary { border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover:not(:disabled) { border-color: var(--accent-hover); background: var(--accent-hover); }
.btn.dark { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.btn.dark:hover:not(:disabled) { background: var(--ink); opacity: 0.88; }
/* Busy state: a spinner replaces the label, in white, and the button keeps full strength. */
.btn .spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
.btn.loading { color: #fff; opacity: 1; cursor: progress; }
.btn.loading .spinner { display: block; }
/* The hero's submit button is a square with a white icon; the spinner takes the icon's place. */
.btn.go { width: 52px; padding: 0; flex: none; }
.btn.go svg.lucide { width: 20px; height: 20px; stroke-width: 2.25; }
.btn.go.loading svg.lucide { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.2s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.btn.lg { height: 52px; padding: 0 24px; border-radius: 10px; font-size: 16px; }
.btn.sm { height: 30px; padding: 0 10px; border-radius: 6px; font-size: 13px; }
.btn.icon { width: 32px; height: 32px; padding: 0; border-radius: 6px; color: var(--secondary); }
.btn.done, .btn.done:hover { border-color: var(--green-solid); color: var(--green); }
.band .term .btn.done { border-color: var(--green-solid); color: #73d6a4; }
.btn.busy svg.lucide { animation: spin 0.8s linear infinite; }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
input, select, textarea { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; }
textarea { height: auto; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.search { display: flex; gap: 10px; }
.search-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); color: var(--muted); }
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.search-field input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; box-shadow: none; background: none; font: 16px var(--mono); }
.search-field input::placeholder { font-family: var(--sans); color: var(--muted); }
.search-field svg.lucide { width: 18px; height: 18px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--subtle); }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--secondary); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.seg button .n { margin-left: 6px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; }
#bits { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: clamp(20px, 2.4vw, 32px); padding-block: clamp(24px, 3.5vw, 48px) clamp(28px, 4vw, 56px); }
.hero-copy { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 1000px; text-align: center; }
.hero h1 { color: var(--ink); font-size: clamp(38px, 5.4vw, 76px); font-weight: 600; line-height: 1.02; letter-spacing: -0.04em; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lede { margin-top: 10px; color: var(--secondary); font-size: clamp(16px, 1.3vw, 20px); line-height: 1.5; text-wrap: balance; }
/* One line wherever the sentence fits. */
@media (min-width: 860px) { .lede { white-space: nowrap; } }
.hero .search { width: 100%; max-width: 640px; margin-top: 12px; }
.tries { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 8px; margin-top: 20px; color: var(--muted); font-size: 13.5px; }
.tries button { padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--secondary); font: 13px var(--mono); }
.tries button:hover { border-color: var(--line-strong); color: var(--ink); }
.hero .error { width: 100%; max-width: 640px; text-align: left; }
.hero-map { position: relative; width: 100%; height: clamp(340px, 56vh, 620px); border: 1px solid var(--line-strong); border-radius: 16px; overflow: hidden; background: var(--subtle); box-shadow: 0 12px 32px rgba(24, 24, 26, 0.08); }
:root[data-theme="dark"] .hero-map { box-shadow: none; }
/* On a phone the map is a square. */
@media (max-width: 640px) { .hero-map { height: auto; aspect-ratio: 1 / 1; } }
#map { position: absolute; inset: 0; }
.map-card { position: absolute; left: 16px; bottom: 16px; z-index: 500; display: flex; align-items: center; gap: 12px; max-width: calc(100% - 32px); padding: 10px 14px 10px 10px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--panel); }
.map-card img { width: 32px; height: 24px; border-radius: 4px; object-fit: cover; border: 1px solid var(--line); }
.map-card .mono { display: block; color: var(--ink); font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.map-card span { color: var(--secondary); font-size: 13px; }

/* Map chrome, restyled to match the page. */
.maplibregl-map { font: 12px var(--sans); background: var(--subtle); }
/* Dark mode: flip the map's lightness and turn the hues back, so water stays blue and
   parks stay green on a dark ground. Only the canvas is filtered, never the controls. */
:root[data-theme="dark"] .maplibregl-canvas { filter: invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.9) saturate(0.8); }
.maplibregl-ctrl-group { border: 1px solid var(--line-strong); border-radius: 8px !important; background: var(--panel) !important; box-shadow: none !important; overflow: hidden; }
.maplibregl-ctrl-group button { width: 32px; height: 32px; background-color: var(--panel); }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line); }
.maplibregl-ctrl-group button.recenter { display: flex; align-items: center; justify-content: center; color: var(--ink); }
.maplibregl-ctrl-group button.recenter:disabled { color: var(--muted); cursor: default; }
:root[data-theme="dark"] .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-ctrl-scale { border-color: var(--line-strong); background: var(--panel); color: var(--secondary); opacity: 0.9; }
.maplibregl-ctrl-attrib { background: var(--panel) !important; color: var(--muted); opacity: 0.92; }
.maplibregl-ctrl-attrib a { color: var(--secondary); }
:root[data-theme="dark"] .maplibregl-ctrl-attrib-button { filter: invert(1); }
/* Map pin: small, with its tip on the coordinate. */
.pin { width: 22px; height: 28px; }
.pin svg { width: 22px; height: 28px; filter: drop-shadow(0 1px 2px rgba(24, 24, 26, 0.35)); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- sections ---------- */
.section { padding-block: clamp(48px, 6vw, 96px); }
.section.tinted { background: var(--subtle); border-block: 1px solid var(--line); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; margin-bottom: clamp(24px, 3vw, 44px); }
.kicker { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--accent-ink); font: 500 13px var(--mono); }
.kicker::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: var(--accent); }
.section-head > div { flex: 1 1 520px; min-width: 0; }
.section-head h2 { color: var(--ink); font-size: clamp(28px, 3vw, 44px); font-weight: 600; line-height: 1.08; letter-spacing: -0.03em; text-wrap: balance; }
.section-head p { margin-top: 14px; color: var(--secondary); font-size: 17px; }
.page-head { padding-block: clamp(28px, 3.5vw, 48px) clamp(20px, 2.5vw, 32px); }
.page-head h1 { color: var(--ink); font-size: clamp(28px, 3vw, 40px); font-weight: 600; line-height: 1.12; letter-spacing: -0.025em; }
/* The intro line of an inner page uses the full width: it wraps only when it has to. */
.page-head p { margin-top: 10px; color: var(--secondary); font-size: 16px; text-wrap: pretty; }

/* ---------- result ---------- */
.result { padding-block: clamp(28px, 3.5vw, 48px); }
.result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.result-head h2 { display: flex; align-items: center; gap: 14px; color: var(--ink); font: 500 clamp(26px, 3vw, 40px)/1.15 var(--mono); letter-spacing: -0.03em; overflow-wrap: anywhere; }
/* The address itself is a button: click to copy. */
.ip-copy { padding: 0 6px; margin: 0 -6px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-align: left; overflow-wrap: anywhere; cursor: copy; }
.ip-copy { transition: color 0.15s; }
.ip-copy:hover { background: var(--subtle); }
.ip-copy.copied { color: var(--green); }
.result-head h2 img { width: 40px; height: 30px; border-radius: 5px; object-fit: cover; border: 1px solid var(--line); flex: none; }
.result-head p { margin-top: 8px; color: var(--secondary); font-size: 16px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .result-head .actions { width: 100%; }
  .result-head .actions .btn { flex: 1; padding: 0 8px; }
  .result-head h2 img { width: 32px; height: 24px; }
}
.fade { animation: fade 0.25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); overflow: hidden; box-shadow: var(--shadow); }
.stat { min-width: 0; padding: 16px 20px 18px; background: var(--panel); }
.stat.red { background: var(--red-tint); } .stat.amber { background: var(--amber-tint); } .stat.blue { background: var(--blue-tint); } .stat.green { background: var(--green-tint); }
.stat-label { display: flex; align-items: center; gap: 8px; color: var(--secondary); font-size: 13px; }
.stat-label svg.lucide { width: 14px; height: 14px; }
.stat-value { display: flex; align-items: center; gap: 10px; margin-top: 8px; color: var(--ink); font-size: 22px; font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; }
.stat-value span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-sub { margin-top: 4px; color: var(--secondary); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); flex: none; }
.dot.red { background: var(--red-solid); } .dot.amber { background: var(--amber-solid); } .dot.green { background: var(--green-solid); } .dot.blue { background: var(--blue-solid); }
.meter { height: 6px; margin-top: 12px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width 0.4s ease-out; }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat:last-child { grid-column: 1 / -1; } }

.board { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; } .span-8 { grid-column: span 8; } .span-12 { grid-column: 1 / -1; }
/* Three panels side by side need about 420px each, or values start to be cut off. */
@media (max-width: 1380px) { .span-4 { grid-column: span 6; } .board .wide-md { grid-column: 1 / -1; } }
@media (max-width: 720px) { .board > * { grid-column: 1 / -1 !important; } }

.panel { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; min-height: 56px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.panel-head h3 { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-size: 15px; font-weight: 600; }
.glyph { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent-tint); color: var(--accent-ink); flex: none; }
.glyph.blue { background: var(--blue-tint); color: var(--blue); } .glyph.green { background: var(--green-tint); color: var(--green); }
.glyph.amber { background: var(--amber-tint); color: var(--amber); } .glyph.plain { background: var(--subtle); color: var(--secondary); }
.panel-head .hint { color: var(--muted); font-size: 13px; padding-right: 8px; }
.hint-link { display: inline-flex; align-items: center; gap: 4px; padding-right: 8px; color: var(--secondary); font-size: 13px; font-weight: 500; }
.hint-link:hover { color: var(--accent-ink); text-decoration: none; }
.hint-link svg.lucide { width: 14px; height: 14px; }
.panel-body { padding: 20px; }

/* Label/value lists. Every row is one line and exactly --row tall, in all three panels,
   so their hairlines line up across the board. */
.board { --row: 44px; --label: 128px; }
.kv { display: grid; grid-template-columns: var(--label) minmax(0, 1fr); }
.kv-row { display: contents; }
.kv dt, .kv dd { display: flex; align-items: center; height: var(--row); padding: 0 16px; border-bottom: 1px solid var(--line); white-space: nowrap; transition: background-color 0.1s; }
.kv-row:last-child > * { border-bottom: 0; }
.kv-row:hover > * { background: var(--subtle); }
.kv dt { padding-right: 0; color: var(--secondary); font-size: 13.5px; }
.kv dd { position: relative; gap: 8px; min-width: 0; padding-right: 44px; color: var(--ink); overflow: hidden; font-variant-numeric: tabular-nums; }
.kv dd > * { flex: none; }
.kv dd .val { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.kv dd .val.mono { font-size: 13.5px; }
.kv dd .note { flex: 0 1000 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 13px; }
.kv dd .none { color: var(--muted); }
.kv dd img.flag { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; border: 1px solid var(--line); }
/* Copy button for a row: hidden until the row is hovered or the button is focused. */
.row-copy { position: absolute; top: 50%; right: 8px; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-top: -14px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--panel); color: var(--secondary); opacity: 0; transition: opacity 0.1s; }
.row-copy svg.lucide { width: 14px; height: 14px; }
.kv-row:hover .row-copy, .row-copy:focus-visible, .row-copy.done { opacity: 1; }
.row-copy:hover { color: var(--ink); }
.row-copy.done { border-color: var(--green-solid); color: var(--green); }
@media (hover: none) { .row-copy { opacity: 1; } }
@media (max-width: 480px) { .board { --label: 108px; } .kv dd .note { display: none; } }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 1px 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--subtle); color: var(--secondary); font: 500 12px/1.6 var(--mono); white-space: nowrap; text-decoration: none; }
a.chip:hover { border-color: var(--line-strong); color: var(--ink); text-decoration: none; }
.chip.accent { border-color: transparent; background: var(--accent-tint); color: var(--accent-ink); }

/* Detection uses the same rhythm: the verdict is two rows tall, each score one row. */
.verdict { display: flex; align-items: center; gap: 12px; height: calc(var(--row) * 2); padding: 0 16px; border-bottom: 1px solid var(--line); }
.verdict.red { background: var(--red-tint); } .verdict.blue { background: var(--blue-tint); }
.verdict .glyph.red { background: var(--panel); color: var(--red); } .verdict .glyph.blue { background: var(--panel); }
.verdict > div { min-width: 0; }
.verdict b { display: block; color: var(--ink); font-size: 15px; font-weight: 600; }
.verdict div span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--secondary); font-size: 13px; line-height: 1.4; }
.score { display: grid; grid-template-columns: calc(var(--label) - 16px) minmax(0, 1fr) 40px; align-items: center; gap: 16px; height: var(--row); padding: 0 16px; border-bottom: 1px solid var(--line); }
.score:last-child { border-bottom: 0; }
.score-name { color: var(--secondary); font-size: 13.5px; white-space: nowrap; }
.score.on .score-name { color: var(--ink); font-weight: 500; }
.score-bar { position: relative; height: 6px; border-radius: 3px; background: var(--subtle); }
.score-bar::after { content: ""; position: absolute; left: 60%; top: -3px; bottom: -3px; width: 1px; background: var(--line-strong); }
.score-bar b { display: block; height: 100%; border-radius: 3px; background: var(--line-strong); transition: width 0.4s ease-out; }
.score.on .score-bar b { background: var(--c, var(--accent)); }
.score-val { color: var(--muted); font: 12.5px var(--mono); text-align: right; }
.score.on .score-val { color: var(--ink); }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--subtle); color: var(--muted); font-size: 12px; }
.search-field:focus-within kbd { display: none; }
@media (hover: none) { .search-field kbd { display: none; } }

.json-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.json-col { min-width: 0; background: var(--panel); }
.json-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 20px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.json-head b { margin-right: 10px; color: var(--ink); font-size: 14px; font-weight: 600; }
@media (max-width: 900px) { .json-pair { grid-template-columns: minmax(0, 1fr); } }

/* ---------- code ---------- */
pre.code { flex: 1; margin: 0; padding: 16px 20px; overflow: auto; background: var(--panel); }
pre.code.tall { max-height: 560px; }
pre.code.short { max-height: 380px; }
pre.code.wrap code { white-space: pre-wrap; overflow-wrap: anywhere; }
pre.code.tinted { background: var(--subtle); }
pre.code code { display: block; font: 400 13.5px/1.7 var(--mono); color: var(--ink); white-space: pre; tab-size: 2; }
.token.property { color: var(--ink); }
.token.string, .token.attr-value, .token.template-string { color: var(--str); }
.token.number, .token.boolean, .token.function, .token.keyword, .token.builtin { color: var(--blue); }
.token.null, .token.comment { color: var(--muted); }
.token.punctuation, .token.operator { color: var(--muted); }
.token.parameter, .token.variable { color: var(--ink); }
.tabs { display: flex; gap: 4px; }
.tabs button { height: 32px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--secondary); font-size: 14px; font-weight: 500; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--subtle); color: var(--ink); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--subtle); color: var(--secondary); font-size: 13px; font-weight: 500; text-align: left; white-space: nowrap; }
td { padding: 11px 16px; border-bottom: 1px solid var(--line); color: var(--text); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table tr:not(:first-child):hover td { background: color-mix(in srgb, var(--subtle) 55%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.nowrap { white-space: nowrap; }
td.strong { color: var(--ink); font-weight: 500; }
td.clip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.even { table-layout: auto; }
table.even td { height: 48px; padding-block: 0; white-space: nowrap; }
table.even td.fill { width: 100%; max-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cat { display: inline-flex; align-items: center; gap: 10px; }
@media (max-width: 900px) { .col-includes { display: none; } }
@media (max-width: 520px) {
  .col-refresh { display: none; }
  /* On a phone the category name gives way first, so the numbers always fit. */
  table.even th, table.even td { padding-inline: 12px; }
  table.even td:first-child { width: 100%; max-width: 0; overflow: hidden; text-overflow: ellipsis; }
  table.even .cat { display: inline; }
  table.even .cat .dot { display: inline-block; margin-right: 8px; }
}
td.empty { padding: 48px 20px; color: var(--muted); text-align: center; }
td.empty b { display: block; margin-bottom: 4px; color: var(--ink); font-size: 15px; font-weight: 600; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn { margin-left: 6px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 5px; background: var(--subtle); color: var(--secondary); font-size: 12.5px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.tag.red { background: var(--red-tint); color: var(--red); }
.tag.amber { background: var(--amber-tint); color: var(--amber); }
.tag.green { background: var(--green-tint); color: var(--green); }
.tag.blue { background: var(--blue-tint); color: var(--blue); }
.tag.type { background: none; padding: 0; color: var(--muted); font: 400 12.5px var(--mono); }
.weight { display: inline-flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }
.weight i { width: 64px; height: 6px; border-radius: 3px; background: var(--subtle); overflow: hidden; }
.weight i b { display: block; height: 100%; border-radius: 3px; background: var(--c, var(--ink)); }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search-field { height: 40px; max-width: 420px; border-radius: 8px; }
.toolbar .search-field input { font: 14px var(--sans); }
.toolbar select { width: auto; min-width: 160px; }
.toolbar .push { margin-left: auto; }
@media (max-width: 640px) {
  /* The text field takes its own row; the status filter scrolls sideways if it has to. */
  .toolbar .search-field { flex: 1 1 100%; max-width: none; }
  .toolbar select { flex: 1; min-width: 0; }
  .toolbar .push { margin-left: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
}
.error { margin-top: 16px; padding: 12px 16px; border: 1px solid var(--red-solid); border-radius: var(--radius); background: var(--red-tint); color: var(--red); }

/* ---------- landing ---------- */
/* Feature grid: one bordered block with hairline dividers and uneven columns. */
.features { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: 16px; background: var(--line); overflow: hidden; box-shadow: var(--shadow); }
.feature { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; min-width: 0; padding: clamp(24px, 2.6vw, 40px); background: var(--panel); }
.f-7 { grid-column: span 7; } .f-5 { grid-column: span 5; }
.feature-text h3 { color: var(--ink); font-size: clamp(19px, 1.6vw, 23px); font-weight: 600; letter-spacing: -0.015em; }
.feature-text p { max-width: 58ch; margin-top: 10px; color: var(--secondary); font-size: 16px; }
@media (max-width: 900px) { .f-7, .f-5 { grid-column: 1 / -1; } }
/* Product mock-ups drawn in HTML so they follow the theme. */
.mock { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 14px; overflow: hidden; }
.mock-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.mock-row:last-child { border-bottom: 0; }
.mock-row > span:first-child { display: inline-flex; align-items: center; gap: 10px; color: var(--secondary); min-width: 0; }
.mock-row > b { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; white-space: nowrap; }
.mock-row > b.dim { color: var(--muted); font-weight: 400; font-size: 13px; }
.mock-row .mono { font-size: 13px; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: 16px; background: var(--line); overflow: hidden; }
/* Number and title share the first row; the figure is pinned to the bottom so all three line up. */
.step { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr auto auto; column-gap: 14px; align-items: center; padding: 28px; background: var(--panel); }
.step > :not(.step-n, h3) { grid-column: 1 / -1; }
.step-n { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: var(--ink); color: var(--bg); font: 500 14px var(--mono); }
.step h3 { color: var(--ink); font-size: 19px; font-weight: 600; }
.step p { align-self: start; margin-top: 16px; color: var(--secondary); }
.step .big { display: block; margin-top: 24px; color: var(--ink); font-size: clamp(28px, 3vw, 40px); font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.step .big + span { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }
@media (max-width: 860px) { .steps { grid-template-columns: minmax(0, 1fr); } }

.split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
@media (max-width: 960px) { .split { grid-template-columns: minmax(0, 1fr); } }
/* In the narrow column each endpoint is two lines: verb and path, then what it does. */
.endpoint-list li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 2px 12px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); }
.endpoint-list li:first-child { border-top: 1px solid var(--line); }
.endpoint-list .path { color: var(--ink); font: 500 14px var(--mono); white-space: nowrap; }
.endpoint-list .desc { grid-column: 2; color: var(--secondary); font-size: 14px; }
.verb { color: var(--green); font: 500 12.5px var(--mono); }
.verb.post { color: var(--accent-ink); }

.uses { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.use { display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); }
.use h3 { margin-top: 18px; color: var(--ink); font-size: 17px; font-weight: 600; }
.use p { margin: 8px 0 20px; color: var(--secondary); }
.use code { display: block; margin-top: auto; padding: 8px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
@media (max-width: 1100px) { .uses { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .uses { grid-template-columns: minmax(0, 1fr); } }

.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); overflow: hidden; margin-bottom: 16px; box-shadow: var(--shadow); }
.figure { padding: 22px 24px; background: var(--panel); min-width: 0; }
.figure b { display: flex; align-items: center; gap: 12px; color: var(--ink); font-size: clamp(26px, 2.6vw, 40px); font-weight: 600; line-height: 1.05; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.figure span { display: block; margin-top: 8px; color: var(--secondary); }
@media (max-width: 760px) { .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 4px; color: var(--ink); font-size: 18px; font-weight: 500; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--accent-ink); }
.faq summary svg.lucide { width: 18px; height: 18px; color: var(--muted); transition: transform 0.15s; }
.faq details[open] summary svg.lucide { transform: rotate(45deg); }
.faq details p { max-width: 100ch; padding: 0 4px 22px; color: var(--secondary); font-size: 16px; }

.band { background: var(--band); color: var(--band-text); border-top: 1px solid var(--band-line); }
.band-inner { display: flex; flex-direction: column; gap: clamp(28px, 3.5vw, 44px); padding-block: clamp(48px, 6vw, 88px); }
.band-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px 40px; flex-wrap: wrap; }
.band h2 { color: var(--band-text); font-size: clamp(28px, 3.2vw, 46px); font-weight: 600; line-height: 1.06; letter-spacing: -0.03em; text-wrap: balance; }
.band p { max-width: 60ch; margin-top: 14px; color: var(--band-muted); font-size: 17px; }
.band .btn:not(.primary) { border-color: var(--band-line); background: transparent; color: var(--band-text); }
.band .btn:not(.primary):hover { background: var(--band-line); }
/* Interactive terminal. Two skins switched by data-style; colours are fixed because a
   terminal is dark in either theme. */
.term-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.band .seg { border-color: var(--band-line); background: #0b0b0c; }
.band .seg button { color: var(--band-muted); }
.band .seg button:hover { color: var(--band-text); }
.band .seg button[aria-selected="true"] { background: #2a2a2d; color: #fff; box-shadow: none; }
.term { width: 100%; border: 1px solid #2b2b2f; border-radius: 10px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); text-align: left; }
.term-head { display: flex; align-items: center; height: 40px; }
.term-title { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; white-space: nowrap; }
.term-ctl { display: inline-flex; align-items: center; margin-left: auto; height: 100%; }
.term-ctl svg.lucide { box-sizing: content-box; width: 14px; height: 14px; padding: 0 16px; stroke-width: 1.5; }
.term-dots { display: inline-flex; gap: 8px; }
.term-dots i { width: 12px; height: 12px; border-radius: 50%; }
.term-body { height: clamp(300px, 46vh, 460px); padding: 12px 14px 16px; overflow-y: auto; font-size: 14px; line-height: 1.5; cursor: text; scrollbar-width: thin; scrollbar-color: #4a4a4f transparent; }
.term-line { min-height: 1.5em; white-space: pre-wrap; overflow-wrap: anywhere; }
.term-line.err { color: #ff8f85; }
.term-input { display: flex; }
.term-prompt { white-space: pre; flex: none; }
#term-input { flex: 1; min-width: 0; width: auto; height: auto; padding: 0; border: 0; border-radius: 0; box-shadow: none; outline: none; background: none; color: inherit; font: inherit; caret-color: currentColor; }
#term-input:disabled { opacity: 1; }

/* Command Prompt */
.term[data-style="cmd"] { background: #0c0c0c; border-radius: 8px; }
.term[data-style="cmd"] .term-head { padding-left: 14px; background: #202020; color: #e6e6e6; }
.term[data-style="cmd"] .term-dots { display: none; }
.term[data-style="cmd"] .term-title { font-family: "Segoe UI", var(--sans); }
.term[data-style="cmd"] .term-ctl { color: #e6e6e6; }
.term[data-style="cmd"] .term-body { color: #cccccc; font-family: "Cascadia Mono", Consolas, "Lucida Console", var(--mono); }

/* Terminal (macOS) */
.term[data-style="mac"] { background: #1e1e1e; border-radius: 12px; }
.term[data-style="mac"] .term-head { position: relative; padding: 0 14px; background: #323234; border-bottom: 1px solid #111; color: #b9b9be; }
.term[data-style="mac"] .term-dots i:nth-child(1) { background: #ff5f57; }
.term[data-style="mac"] .term-dots i:nth-child(2) { background: #febc2e; }
.term[data-style="mac"] .term-dots i:nth-child(3) { background: #28c840; }
.term[data-style="mac"] .term-title { position: absolute; left: 50%; transform: translateX(-50%); font: 600 13px -apple-system, BlinkMacSystemFont, var(--sans); }
.term[data-style="mac"] .term-ctl, .term[data-style="mac"] .cmd-only { display: none; }
.term[data-style="mac"] .term-body { color: #e4e4e4; font-family: "SF Mono", Menlo, Monaco, var(--mono); font-size: 13.5px; }
.term[data-style="mac"] .term-prompt { color: #73d6a4; }
@media (max-width: 640px) {
  .term-body { height: 340px; padding: 10px; font-size: 12.5px; }
  /* 16px stops phones zooming the page when the command line is focused. */
  #term-input { font-size: 16px; }
  .term-ctl svg.lucide { padding: 0 11px; }
}

/* ---------- docs ---------- */
/* Three columns on a wide screen: section links, the explanation, and the code that goes
   with it. The code column stays in view while its explanation scrolls past. */
.docs { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: clamp(24px, 3vw, 56px); align-items: start; padding-bottom: 96px; }
.docs-nav { position: sticky; top: calc(var(--nav-h) + var(--frame) + 12px); max-height: calc(100vh - var(--nav-h) - var(--frame) - 24px); padding: 28px 0 24px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.docs-nav h4 { margin: 24px 0 8px; color: var(--ink); font-size: 13px; font-weight: 600; }
.docs-nav h4:first-child { margin-top: 0; }
/* The rail on the left is 2px wide in both states, so the text never shifts. */
.docs-nav a { display: flex; align-items: baseline; gap: 8px; margin-left: 1px; padding: 6px 12px 6px 14px; border-left: 1px solid var(--line); color: var(--secondary); font-size: 14px; line-height: 1.4; }
.docs-nav a:hover { border-left-color: var(--line-strong); color: var(--ink); text-decoration: none; }
.docs-nav a.active { margin-left: 0; border-left: 2px solid var(--accent); background: linear-gradient(90deg, var(--accent-tint), transparent); color: var(--accent-ink); font-weight: 500; }
.docs-nav .m { flex: none; width: 30px; color: var(--green); font: 600 10px/1 var(--mono); }
.docs-nav .m.post { color: var(--accent-ink); }

.docs-main { min-width: 0; }
.doc { padding-block: 44px; border-top: 1px solid var(--line); }
.doc:first-child { padding-top: 32px; border-top: 0; }
.doc.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 3vw, 48px); align-items: start; }
.doc-text { min-width: 0; }
.doc-side { position: sticky; top: calc(var(--nav-h) + var(--frame) + 24px); display: grid; gap: 14px; min-width: 0; }
.doc h2 { margin-bottom: 12px; color: var(--ink); font-size: 26px; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; }
.doc h3 { margin: 28px 0 10px; color: var(--ink); font-size: 15px; font-weight: 600; }
.doc p { margin-bottom: 14px; text-wrap: pretty; }
.doc > p { color: var(--secondary); font-size: 16px; }
.doc p.more { color: var(--secondary); font-size: 14px; }
.doc .list { margin: 0 0 14px; padding-left: 20px; list-style: disc; }
.doc .list.numbered { list-style: decimal; }
.doc .list li { margin-bottom: 8px; padding-left: 4px; }
.eyebrow { display: block; margin-bottom: 8px; color: var(--accent-ink); font: 500 12.5px var(--mono); }
.endpoint { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.endpoint code { padding: 0; border: 0; background: none; font-size: 14px; font-weight: 500; }

.facts { margin-top: 20px; border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--secondary); font-size: 14px; }
.facts dd { min-width: 0; color: var(--ink); }
.facts dd .btn.icon { width: 28px; height: 28px; margin-left: 8px; vertical-align: middle; }

.steps-list { counter-reset: step; }
.steps-list li { position: relative; padding: 0 0 20px 44px; counter-increment: step; }
.steps-list li::before { content: counter(step); position: absolute; top: 0; left: 0; width: 28px; height: 28px; border-radius: 8px; background: var(--ink); color: var(--bg); font: 500 13px/28px var(--mono); text-align: center; }
.steps-list h3 { margin: 0 0 4px; line-height: 28px; }
.steps-list p { margin: 0; color: var(--secondary); }
.callout { display: flex; gap: 12px; margin-bottom: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--subtle); color: var(--text); }
.callout svg.lucide { margin-top: 3px; color: var(--secondary); }
.callout p { margin: 0; }

/* Parameter lists: name, type and whether it is required on one line, the meaning below. */
.params { margin-bottom: 14px; border-top: 1px solid var(--line); }
.param { padding: 13px 0; border-bottom: 1px solid var(--line); }
.param dt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.param-name { color: var(--ink); font: 600 13.5px var(--mono); }
.param-name + .param-name::before { content: "\00b7"; margin-right: 10px; color: var(--muted); font-weight: 400; }
.param-type { color: var(--muted); font: 12.5px var(--mono); }
.param-req { color: var(--accent-ink); font-size: 12px; font-weight: 500; }
.param-opt { color: var(--muted); font-size: 12px; }
.param dd { margin-top: 6px; color: var(--secondary); font-size: 14.5px; }
.more-detail summary { margin-top: 10px; color: var(--accent-ink); font-size: 14px; font-weight: 500; cursor: pointer; }
.more-detail p { margin: 10px 0; }
.bits, .langs { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; color: var(--muted); font-size: 13px; }
.bits span, .langs span { display: inline-flex; align-items: baseline; gap: 6px; }
.bits { font-family: var(--mono); font-size: 12.5px; }
.table-wrap.bordered { margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.formula { padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--subtle); color: var(--ink); font: 14px var(--mono); }

/* Example panels are dark in both themes, like a terminal. The colour variables are
   redefined inside them, so buttons, selects and syntax colours follow. */
.ex { --bg: #0e0e0f; --panel: #151516; --subtle: #1c1c1e; --line: #28282b; --line-strong: #3a3a3e; --ink: #f4f4f2; --text: #d8d8d5; --secondary: #a2a2a8; --muted: #74747a; --accent-ink: #ff8a57; --accent-tint: #2a170e; --green: #73d6a4; --red: #ff9189; --blue: #84bcf7; --str: #f0a070;
  min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); overflow: hidden; color-scheme: dark; }
.ex-head { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 8px 6px 16px; border-bottom: 1px solid var(--line); background: var(--subtle); }
.ex-title { margin-right: auto; color: var(--secondary); font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-meta { color: var(--muted); font: 12.5px var(--mono); white-space: nowrap; }
.ex-status { padding: 1px 7px; border-radius: 5px; background: #10261b; color: var(--green); font: 500 12px/1.6 var(--mono); }
.ex-status.bad { background: #2b1513; color: var(--red); }
.ex select { width: auto; height: 30px; padding: 0 8px; border-radius: 6px; font-size: 13px; }
.ex .btn.icon { width: 30px; height: 30px; flex: none; }
.ex pre.code { max-height: 440px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.ex.tall pre.code { max-height: min(680px, calc(100vh - 200px)); }
.ex pre.code code { font-size: 13px; line-height: 1.65; }
.ex .url-line code { scrollbar-width: thin; }

/* Request builder */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 20px; }
.builder-form { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.b-block { padding: 16px 18px 18px; border-bottom: 1px solid var(--line); }
.b-block:last-child { border-bottom: 0; }
.b-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--ink); font-size: 14px; font-weight: 600; }
.b-label .dim { margin-left: 6px; font-weight: 400; }
.builder-form input[type="text"] { font: 14px var(--mono); }
.builder-form input[type="text"]::placeholder { font-family: var(--sans); }
.builder-form .tries { justify-content: flex-start; margin-top: 10px; }
.builder-form .seg { flex-wrap: wrap; }
.b-fields > p { margin: 14px 0 0; }
.field-group h4 { margin: 16px 0 8px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { position: relative; display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--secondary); font: 500 12.5px var(--mono); cursor: pointer; user-select: none; }
.fchip:hover { border-color: var(--line-strong); color: var(--ink); }
.fchip input { position: absolute; width: 0; height: 0; opacity: 0; }
.fchip:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-tint); color: var(--accent-ink); }
.fchip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.b-options { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.b-options .b-label { margin: 0; font-weight: 500; }
.b-options select { width: auto; height: 34px; }
.check { display: inline-flex; align-items: center; gap: 10px; color: var(--secondary); font-size: 14px; cursor: pointer; }
.check input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); box-shadow: none; }
.check b { margin-right: 4px; color: var(--ink); font-weight: 500; }
.builder-out { position: sticky; top: calc(var(--nav-h) + var(--frame) + 24px); display: grid; gap: 12px; min-width: 0; }
#b-response pre.code { min-height: 200px; max-height: 420px; }

/* The description takes whatever width the other columns leave, so it wraps as little as possible. */
.field-ref td:first-child { width: 1%; }
.field-ref td:nth-child(3) { width: 100%; min-width: 300px; }
.field-ref td.clip { max-width: 240px; color: var(--secondary); }
.tips, .resources { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.tip, .resource { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.tip h3 { margin: 14px 0 6px; }
.tip p { margin: 0; color: var(--secondary); font-size: 14.5px; }
.resource { display: flex; gap: 14px; color: var(--text); }
.resource:hover { border-color: var(--line-strong); text-decoration: none; }
.resource b { display: block; color: var(--ink); font-weight: 600; }
.resource div > span { display: block; margin: 4px 0 10px; color: var(--secondary); font-size: 14px; }

.url-line { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px 8px 20px; }
.url-line .verb { flex: none; }
.url-line code, .url-line input { flex: 1; min-width: 0; border: 0; padding: 0; background: none; color: var(--ink); font: 14px var(--mono); white-space: nowrap; overflow-x: auto; }
.url-line input { height: 36px; box-shadow: none; }

/* Narrower than this, two columns of text and code no longer fit beside the section links. */
@media (max-width: 1320px) {
  .doc.split, .builder { grid-template-columns: minmax(0, 1fr); }
  .doc-side, .builder-out { position: static; }
  .tips, .resources { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 0; }
  /* The section links become one scrolling row above the content. */
  .docs-nav { position: static; display: flex; gap: 4px; max-height: none; padding: 16px 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  .docs-nav h4 { display: none; }
  .docs-nav a, .docs-nav a.active { flex: none; margin: 0; padding: 6px 12px; border-left: 0; border-radius: 6px; white-space: nowrap; }
  .docs-nav a.active { background: var(--accent-tint); }
  .docs-nav .m { width: auto; }
  .doc { padding-block: 32px; }
}
@media (max-width: 640px) {
  .tips, .resources { grid-template-columns: minmax(0, 1fr); }
  .facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* ---------- reports ---------- */
.reports { padding-block: 24px 72px; }
/* Two panels of the same height: the form, and what happens to what it sends. */
.report-top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.report-top .panel-body { flex: 1; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: block; color: var(--ink); font-size: 14px; font-weight: 500; }
.form label > :is(input, select, textarea) { margin-top: 6px; font-weight: 400; }
.form .optional { color: var(--muted); font-weight: 400; }
/* The note takes whatever height is left, so the form always fills its panel. */
.form label.grow { display: flex; flex: 1; flex-direction: column; }
.form label.grow textarea { flex: 1; min-height: 76px; }
.form-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; }
.form-pair.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; min-height: 64px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--subtle); }
.panel-foot .btn { margin-left: auto; }
.notice { padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--subtle); color: var(--text); font-size: 14px; }
.notice.good { border-color: transparent; background: var(--green-tint); color: var(--green); }
.notice.info { border-color: transparent; background: var(--blue-tint); color: var(--blue); }
.notice.bad { border-color: transparent; background: var(--red-tint); color: var(--red); }
.notice a { color: inherit; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
/* The three stages share the panel's height equally, with a hairline between them. */
.flow { display: grid; flex: 1; grid-template-rows: repeat(3, minmax(0, 1fr)); }
.flow li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 16px; align-content: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.flow li:last-child { border-bottom: 0; }
.flow h4 { color: var(--ink); font-size: 15px; font-weight: 600; line-height: 32px; }
.flow p { color: var(--secondary); font-size: 14.5px; text-wrap: pretty; }
.section-bar { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin: 40px 0 16px; }
.section-bar h2 { color: var(--ink); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.section-bar .push { margin-left: auto; }
.section-bar .search-field { flex: 0 1 320px; height: 38px; padding: 0 12px; border-radius: 8px; }
.section-bar .search-field input { font: 14px var(--sans); }
/* Review queue: two lines per row, the claim and what deciding it would do. */
.queue td { padding-block: 14px; vertical-align: top; }
.queue .sub { display: block; max-width: 44ch; margin-top: 3px; color: var(--secondary); font-size: 13px; white-space: normal; }
.queue .sub.would { color: var(--muted); }
.queue .tags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.queue span.strong { color: var(--ink); font-weight: 500; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; color: var(--secondary); font-size: 14px; font-variant-numeric: tabular-nums; }
.unlock { margin-top: 40px; color: var(--secondary); font-size: 14px; }
.unlock summary { width: fit-content; cursor: pointer; }
.unlock form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.unlock input { max-width: 280px; }
@media (max-width: 960px) {
  .report-top { grid-template-columns: minmax(0, 1fr); }
  .flow { grid-template-rows: none; }
  .section-bar .search-field { flex: 1 1 100%; order: 3; }
}
@media (max-width: 480px) { .form-pair, .form-pair.even { grid-template-columns: minmax(0, 1fr); } }

/* ---------- statistics ---------- */
.chart-panel .panel-head { gap: 10px 16px; }
.chart-panel .panel-head .push { margin-left: auto; }
.chart-box { position: relative; padding: 16px 16px 8px; }
.chart-box svg { display: block; width: 100%; overflow: visible; }
.chart-box .grid { stroke: var(--line); stroke-width: 1; }
.chart-box .axis { fill: var(--muted); font: 12px var(--sans); font-variant-numeric: tabular-nums; }
.chart-tip { position: absolute; top: 8px; z-index: 2; min-width: 150px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); box-shadow: 0 8px 24px rgba(24, 24, 26, 0.12); color: var(--secondary); font-size: 13px; pointer-events: none; }
.chart-tip b { display: block; color: var(--ink); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-empty { padding: 72px 20px; color: var(--muted); text-align: center; }
.chart-empty b { display: block; margin-bottom: 4px; color: var(--ink); font-size: 15px; }
.chart-table { border-top: 1px solid var(--line); }
.chart-table summary { padding: 12px 16px; color: var(--secondary); font-size: 13.5px; font-weight: 500; cursor: pointer; }
.chart-table .table-wrap { max-height: 320px; overflow: auto; border-top: 1px solid var(--line); }

/* ---------- legal pages ---------- */
/* Terms and Privacy use the docs layout: section links on the left, one column of text. */
.legal .docs-main { max-width: 900px; }
.legal .doc { padding-block: 30px; }
.legal .doc h2 { font-size: 21px; }
.legal .doc p, .legal .doc li { color: var(--text); }

/* ---------- 404 ---------- */
.not-found { flex: 1 0 auto; display: flex; align-items: center; margin-bottom: var(--frame); background: var(--subtle); }
.not-found-inner { display: flex; flex-direction: column; align-items: center; padding-block: clamp(56px, 10vh, 120px); text-align: center; }
.not-found h1 { font-size: clamp(34px, 4.6vw, 60px); }
.not-found .lede { max-width: 640px; white-space: normal; text-wrap: balance; }
.not-found .lede code { white-space: normal; overflow-wrap: anywhere; }
.not-found .search { margin-top: 28px; }
.not-found .actions { justify-content: center; margin-top: 20px; }

/* ---------- placeholders ---------- */
/* Grey bars in the shape of content that is on its way. */
.skel { display: inline-block; height: 0.85em; max-width: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--subtle) 25%, var(--line) 50%, var(--subtle) 75%) 0 0 / 200% 100%; vertical-align: middle; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
pre.code .skel { display: block; margin: 9px 0; }

/* ---------- dialog ---------- */
dialog { width: min(460px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2); }
dialog::backdrop { background: rgba(14, 14, 15, 0.5); }
dialog h3 { margin-bottom: 18px; color: var(--ink); font-size: 18px; font-weight: 600; }
dialog label { display: block; margin-bottom: 14px; color: var(--ink); font-size: 14px; font-weight: 500; }
dialog label > :is(input, select, textarea) { margin-top: 6px; font-weight: 400; }
dialog .optional { color: var(--muted); font-weight: 400; }
dialog .actions { justify-content: flex-end; margin-top: 20px; }

/* ---------- footer ---------- */
.footer { margin-top: auto; border-top: 1px solid var(--line); background: var(--subtle); }
.band + .footer { border-top-color: var(--band-line); }
.footer-inner { display: grid; grid-template-columns: minmax(0, 2.4fr) repeat(4, minmax(0, 1fr)); gap: 32px clamp(20px, 3vw, 48px); padding-block: 56px 36px; }
.footer-about p { max-width: 44ch; }
.footer-mail { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; font-weight: 500; }
.footer .footer-mail { color: var(--ink); }
.footer-credits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px clamp(24px, 4vw, 64px); padding-block: 20px; border-top: 1px solid var(--line); }
.footer .footer-credits p { max-width: none; margin: 0; font-size: 13px; }
.footer p { max-width: 56ch; margin-top: 14px; color: var(--secondary); font-size: 13.5px; }
.footer a { color: var(--secondary); }
.footer a:hover { color: var(--ink); }
.footer p a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.footer h4 { margin-bottom: 12px; color: var(--ink); font-size: 14px; font-weight: 600; }
.footer li { margin-bottom: 8px; font-size: 14px; }
.footer-base { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 16px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-legal { display: inline-flex; gap: 20px; flex-wrap: wrap; }
@media (max-width: 1000px) { .footer-inner { grid-template-columns: repeat(4, minmax(0, 1fr)); } .footer-inner > :first-child { grid-column: 1 / -1; } }
@media (max-width: 760px) { .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-credits { grid-template-columns: minmax(0, 1fr); } }
#term-input::placeholder { color: #6b6b72; }
