:root {
  color-scheme: light dark;
  --bg: #ecebe6;
  --ink: #0d0d0c;
  --muted: #74736d;
  --rule: #c8c7c0;
  --lime: #d4ff1a;
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --hatch: repeating-linear-gradient(135deg, var(--muted) 0 1px, transparent 1px 5px);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0c0c0b; --ink: #ecebe6; --muted: #8a8983; --rule: #2a2a27; }
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
.frame { max-width: 1000px; margin: 0 auto; padding: 18px 24px 64px; }

footer, .idx, label, .tabs button, th, .note, .lookup-out, .more, select, input {
  font-family: var(--mono);
}

.readout-line { font: 12px/1.6 var(--mono); color: var(--muted); margin: 8px 0 0; letter-spacing: 0.02em; }
.readout-line b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.readout-line i { font-style: normal; color: var(--rule); margin: 0 8px; }

.lookup { display: flex; align-items: baseline; gap: 10px; margin: -4px 0 8px; flex-wrap: wrap; }
.lookup label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.lookup input { background: transparent; color: inherit; border: 0; border-bottom: 1px solid var(--rule); font: 12px var(--mono); padding: 4px 0; width: 220px; outline: none; }
.lookup input:focus { border-bottom-color: var(--ink); }
.lookup-out { font: 12px var(--mono); color: var(--muted); }
.lookup-out b { color: var(--ink); font-weight: 500; }
.lookup-out .tag { background: var(--lime); color: #0d0d0c; padding: 0 4px; }

section { margin-top: 48px; }
.head { display: flex; align-items: baseline; gap: 14px; border-top: 1px solid var(--ink); padding-top: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.idx { font-size: 11px; color: var(--muted); letter-spacing: 0.06em; }
h2 { font: 700 30px/1 var(--display); text-transform: uppercase; margin: 0; letter-spacing: 0.01em; }
.tabs { margin-left: auto; display: flex; gap: 2px; }
.tabs button { border: 0; background: transparent; color: var(--muted); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 8px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.tabs button:focus-visible, .more:focus-visible, .fold:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

.mix { display: grid; grid-template-columns: 240px 44px 1fr; gap: 28px; align-items: start; }
figure { margin: 0; }
figcaption { font: 11px var(--mono); color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 8px; }
.pie svg { display: block; width: 240px; height: 240px; }
.column { display: flex; flex-direction: column; width: 44px; height: 240px; gap: 2px; }
.column span, .pie path { transition: opacity 160ms ease; }
.column span { display: block; min-height: 1px; }
.mix.focus .column span:not(.on), .mix.focus .pie path:not(.on) { opacity: 0.18; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 400; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 0 0 6px; border-bottom: 1px solid var(--rule); }
td { padding: 7px 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.num { padding-left: 18px; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 13px; }
.legend td:first-child { width: 20px; }
.legend tr { cursor: default; }
.legend tr.on td { background: color-mix(in srgb, var(--lime) 22%, transparent); }
.legend .dim { color: var(--muted); }
.sw { display: inline-block; width: 10px; height: 10px; vertical-align: -1px; }

.note { font-size: 11px; color: var(--muted); margin: -6px 0 10px; letter-spacing: 0.02em; }
.chart { position: relative; height: 320px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .axis { font: 10px var(--mono); fill: var(--muted); }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .cross { stroke: var(--ink); stroke-width: 1; }
.tip { position: fixed; z-index: 10; pointer-events: none; background: var(--ink); color: var(--bg); font: 11px/1.5 var(--mono); padding: 8px 10px; min-width: 160px; max-width: 280px; }
.tip .t { display: block; margin-bottom: 4px; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.7; }
.tip .r { display: flex; justify-content: space-between; gap: 14px; white-space: nowrap; }
.tip .r i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; vertical-align: 0; box-shadow: 0 0 0 1px color-mix(in srgb, var(--bg) 45%, transparent); }
.tip .r b { font-weight: 500; font-variant-numeric: tabular-nums; }
.tip .r.hi { background: color-mix(in srgb, var(--lime) 35%, transparent); margin: 0 -4px; padding: 0 4px; }

.filters { margin-left: auto; display: flex; gap: 8px; }
.filters input, .filters select { background: transparent; color: inherit; border: 0; border-bottom: 1px solid var(--rule); font-size: 12px; padding: 4px 0; min-width: 0; }
.filters input { width: 170px; outline: none; }
.filters input:focus { border-bottom-color: var(--ink); }
.hosts td:first-child { font: 13px var(--mono); word-break: break-all; padding-right: 16px; }
.hosts .ver { color: var(--muted); font: 11px var(--mono); margin-left: 6px; }
.hosts .down { color: var(--muted); }
.fold { display: block; margin: 14px 0 0; background: transparent; border: 0; color: var(--muted); font: 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; padding: 0; }
.fold:hover { color: var(--ink); }
.more { display: block; margin: 18px auto 0; background: transparent; color: var(--ink); border: 1px solid var(--ink); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; padding: 8px 18px; cursor: pointer; }

footer { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 72px; padding-top: 10px; border-top: 1px solid var(--ink); font-size: 11px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }

@media (max-width: 600px) {
  .frame { padding: 14px 16px 48px; }
  .lookup input { width: 100%; }
  .mix { grid-template-columns: 1fr 44px; gap: 20px; }
  .pie svg { width: 100%; height: auto; max-width: 240px; }
  .legend { grid-column: 1 / -1; }
  .hosts th:nth-child(2), .hosts td:nth-child(2) { display: none; }
  .filters { width: 100%; margin-left: 0; }
  .filters input { flex: 1; }
  .chart { height: 240px; }
}
@media (prefers-reduced-motion: reduce) { .column span, .pie path { transition: none; } }

.info { display: inline-grid; place-items: center; width: 14px; height: 14px; margin: 0 0 0 5px; padding: 0; border: 1px solid var(--muted); border-radius: 50%; background: transparent; color: var(--muted); font: 500 9px/1 var(--mono); vertical-align: 1px; cursor: help; }
.info:hover, .info:focus-visible { border-color: var(--ink); color: var(--ink); outline: none; }
.tip .p { display: block; white-space: normal; line-height: 1.55; }

.legend a.src { color: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.legend a.src:hover { text-decoration-color: var(--ink); }
.legend .short { color: var(--muted); font-size: 12px; margin-left: 8px; }

.nsfw { display: inline-block; margin-left: 8px; padding: 0 5px; font: 500 10px/16px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: #fff; background: #d2263f; vertical-align: 1px; }

.globe { position: relative; height: 520px; touch-action: none; cursor: grab; }
.globe:active { cursor: grabbing; }
.globe canvas { display: block; width: 100%; height: 100%; }
footer a { color: inherit; }
@media (max-width: 600px) { .globe { height: 360px; } }

.networks { margin-top: 18px; }
.networks .short { color: var(--muted); font-size: 12px; margin-left: 8px; }
