/* pingnet — "terminal printout" design language (v2).
   Paper and ink, read like a network tool's output. One signal colour: green = fine, amber = look.

   Fonts: Geist (interface text) and JetBrains Mono (readouts), both SIL OFL 1.1, self-hosted,
   Latin only. Licences in /fonts/. No third-party font requests. */

@font-face { font-family: "Geist"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/geist-400.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/geist-500.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/geist-600.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/geist-700.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/jetbrains-mono-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/jetbrains-mono-500.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/jetbrains-mono-600.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/jetbrains-mono-700.woff2") format("woff2"); }

/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #f4f3ee;
  --grid: rgba(20, 22, 26, 0.045);
  --surface: #fbfbf8;
  --raised: #efeee8;
  --ink: #15171b;
  --ink-2: #4a4e57;
  --ink-3: #64686f;
  --rule: #dcdad2;
  --leader: #c9c7bf;
  --signal: #086c4c;
  --signal-soft: rgba(8, 108, 76, 0.10);
  --warn: #9a4706;
  --warn-soft: rgba(154, 71, 6, 0.10);
  --term: #15171b;
  --term-ink: #ebe9e3;
  --term-dim: #a9adb5;
  --term-signal: #3ddc97;
  --btn: #15171b;
  --btn-ink: #f4f3ee;
  --shadow: 0 1px 0 rgba(20, 22, 26, 0.03), 0 10px 28px -20px rgba(20, 22, 26, 0.22);
  --radius: 14px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f12; --grid: rgba(231, 229, 223, 0.04); --surface: #14171b; --raised: #1b1f24;
    --ink: #ebe9e3; --ink-2: #a9adb5; --ink-3: #868b94; --rule: #262a31; --leader: #3a3f47;
    --signal: #3ddc97; --signal-soft: rgba(61, 220, 151, 0.12); --warn: #f59e0b; --warn-soft: rgba(245, 158, 11, 0.12);
    --term: #050607; --btn: #ebe9e3; --btn-ink: #0d0f12;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 12px 32px -20px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0f12; --grid: rgba(231, 229, 223, 0.04); --surface: #14171b; --raised: #1b1f24;
  --ink: #ebe9e3; --ink-2: #a9adb5; --ink-3: #868b94; --rule: #262a31; --leader: #3a3f47;
  --signal: #3ddc97; --signal-soft: rgba(61, 220, 151, 0.12); --warn: #f59e0b; --warn-soft: rgba(245, 158, 11, 0.12);
  --term: #050607; --btn: #ebe9e3; --btn-ink: #0d0f12;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 12px 32px -20px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-synthesis-weight: none; scroll-padding-top: 16px; }
body {
  margin: 0; min-height: 100vh;
  background-color: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--leader); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--signal); }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-variant-ligatures: none; }
strong { font-weight: 600; }
.muted { color: var(--ink-3); }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding-left: clamp(16px, 4vw, 48px); padding-right: clamp(16px, 4vw, 48px); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.stack { display: flex; flex-direction: column; gap: 40px; padding-top: 28px; padding-bottom: 56px; }
.status-text { margin: 0; font: 13px var(--mono); color: var(--ink-2); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 4px; }

/* ------------------------------------------------------------------ header & tabs */
.site-head { display: flex; flex-direction: column; gap: 14px; padding-top: 20px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; text-decoration: none; }
.brand b { color: var(--signal); font-weight: 600; }
.brand-mark { width: 26px; height: 26px; fill: var(--signal); stroke: var(--signal); }
.top-actions { display: flex; align-items: center; gap: 6px; }
.ghost-link { font-family: var(--mono); font-size: 13px; color: var(--ink-2); text-decoration: none; padding: 8px 10px; border-radius: 8px; }
.ghost-link:hover { color: var(--ink); background: var(--raised); }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--rule); background: var(--surface); border-radius: 10px; transition: border-color .15s; }
.icon-btn:hover { border-color: var(--signal); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-btn .i-moon { fill: currentColor; stroke: none; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--rule); font-family: var(--mono); font-size: 13.5px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 9px 14px; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .15s, border-color .15s; }
.tabs a:hover { color: var(--ink); border-bottom-color: var(--leader); }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--signal); }
.tabs a[aria-current="page"]::before { content: "~/"; color: var(--signal); }

/* ------------------------------------------------------------------ type helpers */
.prompt { margin: 0; font-family: var(--mono); font-size: 13px; font-weight: 400; color: var(--ink-2); }
.prompt::before { content: "$ "; color: var(--signal); }
.label { margin: 0; font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.title { margin: 0; font-size: clamp(30px, 4.4vw, 44px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; text-wrap: balance; max-width: 22ch; }
.lede { margin: 0; max-width: 62ch; font-size: 16px; color: var(--ink-2); }
.lede strong { color: var(--ink); }

/* ------------------------------------------------------------------ buttons, tags, inputs */
.btn { border: 0; border-radius: 10px; padding: 0 22px; min-height: 46px; font-weight: 600; font-size: 15px; background: var(--btn); color: var(--btn-ink); transition: opacity .15s, transform .1s; }
.btn:hover { opacity: .9; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-ghost { border: 1px solid var(--rule); background: var(--surface); border-radius: 8px; padding: 7px 12px; font: 500 13px var(--mono); color: var(--ink); white-space: nowrap; transition: border-color .15s, background .15s, color .15s; }
.btn-ghost:hover { border-color: var(--signal); }
.btn-ghost.done { background: var(--signal); border-color: var(--signal); color: var(--bg); }
.btn-ghost.sm { padding: 4px 9px; font-size: 12px; }
.btn-dash { border: 1px dashed var(--ink-3); background: transparent; border-radius: 8px; padding: 9px 12px; font: 500 13px var(--mono); color: var(--ink); text-align: left; transition: border-color .15s, color .15s; }
.btn-dash:hover { border-style: solid; border-color: var(--signal); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; font: 500 11.5px/1.6 var(--mono); background: var(--raised); color: var(--ink-2); white-space: nowrap; vertical-align: 1px; }
.tag.ok { background: var(--signal-soft); color: var(--signal); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.query { display: flex; flex-wrap: wrap; gap: 10px; max-width: 760px; }
.query-box { flex: 1 1 300px; display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--ink); border-radius: 10px; padding: 0 14px; background: var(--surface); transition: box-shadow .15s; }
.query-box:focus-within { box-shadow: 0 0 0 3px var(--signal-soft); }
.query-box::before { content: ">"; font: 17px var(--mono); color: var(--signal); }
.query-box input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; padding: 12px 0; font: 17px var(--mono); }
.query-box input::placeholder { color: var(--ink-3); }
.radios { display: flex; flex-wrap: wrap; gap: 2px; font-family: var(--mono); font-size: 13px; }
.radios input, .seg input { position: absolute; opacity: 0; pointer-events: none; }
.radios span { display: inline-block; padding: 5px 9px; border-radius: 6px; color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s; }
.radios span:hover { color: var(--ink); background: var(--raised); }
.radios input:checked + span { background: var(--ink); color: var(--bg); }
.radios input:focus-visible + span, .seg input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: 2px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--signal); }
.form-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }

/* ------------------------------------------------------------------ cards & readouts */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); transition: border-color .2s; }
.card-pad { padding: 20px; }
.card:hover { border-color: color-mix(in srgb, var(--signal) 45%, var(--rule)); }
.kv { margin: 0; display: flex; flex-direction: column; gap: 7px; font-family: var(--mono); font-size: 13px; }
.kv > div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.kv dt { flex: 1 1 auto; display: flex; align-items: baseline; gap: 8px; color: var(--ink-2); white-space: nowrap; min-width: 0; }
.kv dt::after { content: ""; flex: 1; min-width: 12px; border-bottom: 1.5px dotted var(--leader); transform: translateY(-3px); }
.kv dd { margin: 0; text-align: right; max-width: 68%; overflow-wrap: anywhere; }
.kv.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px 48px; }
.v-ok { color: var(--signal); }
.v-warn { color: var(--warn); }

/* placeholder shimmer → value fade-in */
.ph { display: inline-block; width: 6em; max-width: 100%; height: .85em; border-radius: 4px; vertical-align: -1px;
  background: linear-gradient(90deg, var(--raised) 0%, var(--rule) 50%, var(--raised) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.ph.s { width: 3.5em; } .ph.l { width: 9em; }
.in { animation: fade-in .16s ease-out both; }

/* ------------------------------------------------------------------ home: hero */
.hero { display: flex; flex-wrap: wrap; gap: 32px 56px; align-items: flex-start; padding-top: 8px; }
.hero-main { flex: 999 1 540px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.ip-line { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.ip-big { font-family: var(--mono); font-weight: 500; font-size: clamp(38px, 7.2vw, 86px); line-height: 1; letter-spacing: -0.045em; overflow-wrap: anywhere; min-width: 0; font-variant-numeric: tabular-nums; }
.ip-big.v6 { font-size: clamp(22px, 3.9vw, 44px); letter-spacing: -0.03em; }
.cursor { display: inline-block; width: .42em; height: .82em; margin-left: .08em; background: var(--signal); transform: translateY(.08em); }
.cursor.blink { animation: blink 1s steps(1, end) 3; }
.v6-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 12px 14px; }
.v6-row .k { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--ink-3); }
.v6-row .v { flex: 1 1 260px; min-width: 0; font-family: var(--mono); font-size: clamp(14px, 1.8vw, 19px); overflow-wrap: anywhere; }

.path { flex: 1 1 320px; min-width: 0; padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.path ol { list-style: none; margin: 0; padding: 0; }
.path li { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 14px; }
.path .rail { display: flex; flex-direction: column; align-items: center; }
.path .node { width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; border: 2px solid var(--signal); background: var(--surface); }
.path li.end .node { background: var(--signal); }
.path .wire { flex: 1; min-height: 34px; border-left: 2px solid var(--signal); }
.path li:last-child .wire { display: none; }
.path .hop { display: flex; flex-direction: column; padding-bottom: 12px; min-width: 0; }
.path .hop-name { display: flex; align-items: baseline; gap: 8px; font-weight: 600; }
.path .hop-name small { font: 400 12.5px var(--mono); color: var(--ink-3); }
.path .hop-meta { font: 13px var(--mono); color: var(--ink-2); overflow-wrap: anywhere; }
.path .hop-edge { font: 12px var(--mono); color: var(--signal); margin-top: 6px; }
.path .hop-edge::before { content: "| "; opacity: .6; }

.statusline { display: flex; flex-wrap: wrap; overflow: hidden; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); font-family: var(--mono); font-size: 13px; }
.statusline > span { flex: 1 1 auto; padding: 9px 14px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: -1px; white-space: nowrap; transition: background .3s, color .3s; }
.statusline > span:last-child { border-right: 0; }
.statusline b { font-weight: 400; color: var(--ink-3); margin-right: .5ch; }
.statusline .ok { background: var(--signal-soft); color: var(--signal); }
.statusline .warn { background: var(--warn-soft); color: var(--warn); }

/* ------------------------------------------------------------------ home: tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; gap: 12px; padding: 20px; min-width: 0; }
.tile .big { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; }
.tile .sub { color: var(--ink-2); }
.tile .push { margin-top: auto; }
.verdict { display: flex; align-items: center; gap: 10px; }
.vdot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--ink-3); box-shadow: 0 0 0 5px var(--raised); transition: background .3s, box-shadow .3s; }
[data-level="ok"] .vdot { background: var(--signal); box-shadow: 0 0 0 5px var(--signal-soft); }
[data-level="warn"] .vdot, [data-level="bad"] .vdot, [data-level="maybe"] .vdot { background: var(--warn); box-shadow: 0 0 0 5px var(--warn-soft); }
[data-level="pending"] .vdot { animation: pulse 1.6s ease-in-out infinite; }
.leds { list-style: none; margin: 0; padding: 14px 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; border-top: 1px dotted var(--leader); }
.leds li { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.led { width: 12px; height: 12px; border-radius: 50%; background: var(--leader); box-shadow: 0 0 0 4px transparent; transition: background .25s, box-shadow .25s; }
.leds li > span:last-child { font: 11.5px var(--mono); color: var(--ink-2); }
.led[data-s="ok"] { background: var(--signal); box-shadow: 0 0 0 4px var(--signal-soft); animation: led-on .35s var(--ease); }
.led[data-s="warn"] { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); animation: led-on .35s var(--ease); }
.led[data-s="info"] { background: var(--ink-3); }
.led[data-s="pending"] { animation: pulse 1.6s ease-in-out infinite; }

.map { position: relative; height: 110px; border-radius: 10px; overflow: hidden; z-index: 0;
  background-color: var(--raised); background-image: radial-gradient(var(--leader) 1px, transparent 1.2px); background-size: 12px 12px; }
.map::before, .map::after { content: ""; position: absolute; border-color: var(--leader); border-style: dashed; border-width: 0; }
.map::before { left: 0; right: 0; top: 50%; border-top-width: 1px; }
.map::after { top: 0; bottom: 0; left: 50%; border-left-width: 1px; }
.map .pin { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: var(--signal-soft); border: 1px solid var(--signal); z-index: 1; }
.map .pin::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--signal); }
.map.live::before, .map.live::after, .map.live .pin { display: none; }
.map .leaflet-container { position: absolute; inset: 0; background: var(--raised); font-family: var(--font); }
.map .leaflet-control-attribution { font-size: 9px; }
.map .leaflet-control-zoom { display: none; }
.map-link { font: 12px var(--mono); color: var(--ink-2); }
.router { display: flex; flex-direction: column; gap: 8px; }
.router[hidden] { display: none; }
.router-row { display: flex; gap: 8px; }
.router-row input { flex: 1; min-width: 0; border: 1px solid var(--rule); border-radius: 8px; background: var(--bg); padding: 8px 10px; font: 13.5px var(--mono); }
.router-row input:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); }
.router p { margin: 0; font-size: 13px; color: var(--ink-2); }

/* ------------------------------------------------------------------ folds (details on a card) */
.folds { padding: 0 22px; }
.fold + .fold { border-top: 1px solid var(--rule); }
.fold > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 16px 0; cursor: pointer; list-style: none; font-family: var(--mono); font-size: 14px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: ""; flex: none; width: 7px; height: 7px; border-right: 2px solid var(--signal); border-bottom: 2px solid var(--signal); transform: translateY(-2px) rotate(-45deg); transition: transform .2s var(--ease); }
.fold[open] > summary::before { transform: translateY(-4px) rotate(45deg); }
.fold > summary .t { font-weight: 600; color: var(--ink); }
.fold > summary .lead { flex: 1; min-width: 20px; border-bottom: 1.5px dotted var(--leader); transform: translateY(-3px); }
.fold > summary .s { color: var(--ink-2); overflow-wrap: anywhere; }
.fold > summary:hover .t { color: var(--signal); }
.fold-body { padding: 0 0 18px 17px; display: flex; flex-direction: column; gap: 12px; animation: fade-in .2s ease-out; }
.fold-body p { margin: 0; color: var(--ink-2); max-width: 75ch; }
.fold-body .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.term { border-radius: 10px; background: var(--term); color: var(--term-ink); padding: 8px 8px 8px 16px; display: flex; flex-direction: column; gap: 2px; font-family: var(--mono); font-size: 14px; }
.term > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; }
.term code { overflow-wrap: anywhere; min-width: 0; }
.term code::before { content: "$ "; color: var(--term-signal); }
.term .out { color: var(--term-dim); padding: 0 0 6px; }
.term .btn-ghost { background: transparent; border-color: rgba(235, 233, 227, .25); color: var(--term-ink); }
.term .btn-ghost:hover { border-color: var(--term-signal); }
.term .btn-ghost.done { background: var(--term-signal); border-color: var(--term-signal); color: #050607; }

.dns-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dns-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-family: var(--mono); font-size: 13.5px; }
.dns-list .meta { color: var(--ink-2); font-family: var(--font); font-size: 14px; }
.ua { font: 12px/1.6 var(--mono); color: var(--ink-2); background: var(--raised); border-radius: 8px; padding: 10px 12px; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ DNS page */
.records { overflow-x: auto; position: relative; }
.records table { width: 100%; min-width: 680px; border-collapse: collapse; font-family: var(--mono); font-size: 13.5px; }
.records th { text-align: left; padding: 12px 10px; font-weight: 500; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.records th:first-child, .records td:first-child { padding-left: 18px; }
.records th:last-child, .records td:last-child { padding-right: 18px; text-align: right; }
.records td { padding: 11px 10px; border-top: 1px solid var(--rule); vertical-align: top; }
.records tr.diff td { background: var(--warn-soft); }
.records .ty { display: inline-block; min-width: 50px; text-align: center; padding: 2px 7px; border-radius: 6px; font-weight: 600; font-size: 12px; background: var(--ink); color: var(--bg); }
.records .val { overflow-wrap: anywhere; }
.records .val a { text-decoration-color: var(--leader); }
.records .ttl { color: var(--ink-3); white-space: nowrap; }
.records .g-ok { color: var(--signal); }
.records .g-diff { color: var(--warn); }
.records .alt { display: block; margin-top: 4px; color: var(--warn); }
.records tbody tr { animation: rise .24s var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms); }
.empties { display: flex; align-items: baseline; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--rule); font: 13px var(--mono); color: var(--ink-2); }
.empties .lead { flex: 1; min-width: 20px; border-bottom: 1.5px dotted var(--leader); transform: translateY(-3px); }
.notice { padding: 18px 20px; }
.notice p { margin: 0; color: var(--ink-2); }
.soa { display: flex; flex-direction: column; gap: 2px; }
.soa span { color: var(--ink-3); }
.soa b { font-weight: 400; color: var(--ink); }

/* ------------------------------------------------------------------ lookup page */
.lookup-results { display: flex; flex-direction: column; gap: 16px; }
.lk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 16px 20px; border-bottom: 1px solid var(--rule); }
.lk-head .ip { font: 600 18px var(--mono); overflow-wrap: anywhere; min-width: 0; }
.lk-head .btn-ghost { margin-left: auto; }
.lk-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 28px; padding: 20px; }
.lk-body .map { height: auto; min-height: 220px; }
@media (max-width: 760px) { .lk-body { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------------ speed page */
.speed-heads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) { .speed-heads { grid-template-columns: minmax(0, 1fr); } }
.speed-head { padding: 20px 22px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.speed-num { display: flex; align-items: baseline; gap: 10px; }
.speed-num output { font: 500 clamp(52px, 9vw, 96px)/1 var(--mono); letter-spacing: -0.05em; font-variant-numeric: tabular-nums; transition: color .3s; }
.speed-num small { font: 15px var(--mono); color: var(--ink-3); }
.speed-head.live output { color: var(--signal); }
.spark { width: 100%; height: 48px; display: block; }
.spark path { fill: none; stroke: var(--signal); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark path.area { fill: var(--signal-soft); stroke: none; }
.spark .base { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.progress { height: 3px; border-radius: 999px; background: var(--rule); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--signal); transition: width .4s var(--ease); }
.speed-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 12px; padding: 3px; background: var(--surface); }
.seg span { display: flex; flex-direction: column; padding: 6px 14px; border-radius: 9px; font: 500 13px var(--mono); cursor: pointer; color: var(--ink-2); transition: background .15s, color .15s; }
.seg em { font: normal 400 11.5px var(--font); color: var(--ink-3); }
.seg input:checked + span { background: var(--raised); color: var(--ink); }
body.testing .seg { opacity: .5; pointer-events: none; }
.quality { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.quality li { display: grid; grid-template-columns: minmax(0, 1fr) auto 56px; align-items: center; gap: 12px; padding: 10px 0; font-size: 14px; }
.quality li + li { border-top: 1px dotted var(--leader); }
.quality em { font: normal 13px var(--mono); text-align: right; color: var(--ink-2); }
.meter { display: inline-flex; gap: 3px; }
.meter i { width: 14px; height: 8px; border-radius: 2px; background: var(--raised); box-shadow: inset 0 0 0 1px var(--rule); transition: background .25s; }
.meter i.on { background: var(--signal); box-shadow: none; }
.quality li[data-level="0"] .meter i.on, .quality li[data-level="1"] .meter i.on { background: var(--warn); }
.tips { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
.tips li { margin: 6px 0; }
.tips b { color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------------ grids */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.grid-32 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 860px) { .grid-32 { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------------ 404 */
.nf-trace { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 13px var(--mono); color: var(--ink-2); }
.nf-trace span { padding: 6px 12px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); }
.nf-trace i { width: 34px; height: 0; border-top: 2px solid var(--signal); }
.nf-trace i.broken { border-top: 2px dashed var(--warn); }
.nf-trace .x { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); font-weight: 600; }
.nf-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.nf-links a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px; text-decoration: none; }
.nf-links b { font: 600 14px var(--mono); }
.nf-links b::before { content: "~/"; color: var(--signal); }
.nf-links span { font-size: 13.5px; color: var(--ink-2); }
.nf-links a.suggest { border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); }

/* ------------------------------------------------------------------ footer & toast */
.site-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-top: 8px; padding-bottom: 40px; font: 12.5px var(--mono); color: var(--ink-3); }
.site-foot a { color: var(--ink-2); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 9px 16px; border-radius: 999px; background: var(--ink); color: var(--bg); font: 13px var(--mono); transition: opacity .2s, transform .2s var(--ease); z-index: 1000; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------ motion */
.rise { animation: rise .24s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes led-on { from { opacity: .2; transform: scale(.6); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .ph { background: var(--raised); }
}
.map .map-canvas { position: absolute; inset: 0; }
.map:not(.live) .leaflet-container { background: transparent; }
.map:not(.live) .leaflet-tile-pane { opacity: 0; }
.map .leaflet-tile-pane { transition: opacity .3s; }
.map:not(.live) .leaflet-overlay-pane, .map:not(.live) .leaflet-control-container { opacity: 0; }
/* labels on tinted backgrounds need the darker grey to keep 4.5:1 */
.statusline .ok b, .statusline .warn b { color: var(--ink-2); }
.records tr.diff .ttl { color: var(--ink-2); }
.lk-body.one { grid-template-columns: minmax(0, 1fr); }
.lk-head [data-k="regFlag"]:empty { display: none; }
.kv dd .tag { margin-left: 2px; }

/* speed: share bar, shared banner, history */
.shared-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 16px; border-color: var(--signal); }
.shared-banner p { margin: 0; color: var(--ink-2); font-size: 14px; }
.shared-banner[hidden], .share-bar[hidden], .history[hidden] { display: none; }
.shared-banner a { text-decoration: none; }
.share-bar { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; animation: rise .24s var(--ease) both; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.share-row a { text-decoration: none; }
.share-note { margin: 0; font-size: 13px; }
.history { display: flex; flex-direction: column; gap: 12px; }
.history-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.history .records table { min-width: 560px; }
.history .records td, .history .records th { padding-top: 9px; padding-bottom: 9px; }

/* ------------------------------------------------------------------ home */
.home-hero { display: flex; flex-direction: column; gap: 16px; }
.home-hero .lede code { font-size: .92em; }
.you { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 4px 16px; padding: 14px 18px; max-width: 760px; text-decoration: none; }
.you-k { font: 12px var(--mono); letter-spacing: .06em; color: var(--ink-3); }
.you-ip { font-size: clamp(20px, 3.2vw, 28px); font-weight: 500; letter-spacing: -0.02em; overflow-wrap: anywhere; min-width: 0; font-variant-numeric: tabular-nums; }
.you-ip .v6, .you-ip.v6 { font-size: clamp(15px, 2.2vw, 20px); }
.you-meta { grid-column: 2 / 4; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; min-height: 1.4em; }
.you-meta:empty { display: none; }
.you-go { grid-row: 1; grid-column: 3; font-size: 13px; color: var(--signal); white-space: nowrap; }
.you:hover .you-go { text-decoration: underline; }
@media (max-width: 520px) { .you { grid-template-columns: minmax(0, 1fr); } .you-k, .you-ip, .you-meta, .you-go { grid-column: 1; grid-row: auto; } .you-go { margin-top: 4px; } }
.tool-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.tool { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 20px; text-decoration: none; position: relative; transition: border-color .2s, transform .2s var(--ease); }
.tool:hover { transform: translateY(-2px); }
.tool-path { font: 600 13px var(--mono); color: var(--signal); }
.tool-path::after { content: "→"; position: absolute; top: 18px; right: 20px; color: var(--ink-3); transition: transform .2s var(--ease), color .2s; }
.tool:hover .tool-path::after { transform: translateX(3px); color: var(--signal); }
.tool-name { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.tool-desc { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.tool-out { margin-top: auto; padding-top: 12px; border-top: 1px dotted var(--leader); font: 12.5px var(--mono); color: var(--ink-3); overflow-wrap: anywhere; }
.tool-out::before { content: "> "; color: var(--signal); }
.tool-out.live { color: var(--ink-2); animation: fade-in .3s ease-out both; }
