.viz-root {
  color-scheme: light;
  --page: #f4f3ef;
  --surface-1: #fcfcfb;
  --surface-2: #f0efea;
  --border: #e2e1dc;
  --grid: #ecebe6;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #77766f;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --none: #b9b8b1;
  --accent-text: #1c5cab;
  --glow: rgba(12, 163, 12, 0.10);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
}
@media (prefers-color-scheme: dark) {
  .viz-root {
    color-scheme: dark;
    --page: #111110;
    --surface-1: #1a1a19;
    --surface-2: #222220;
    --border: #2e2e2b;
    --grid: #262624;
    --text-primary: #f0efec;
    --text-secondary: #c3c2b7;
    --text-muted: #8f8e86;
    --series-1: #3987e5;
    --series-2: #d95926;
    --none: #4a4a46;
    --accent-text: #86b6ef;
    --glow: rgba(12, 163, 12, 0.16);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: #f4f3ef; }
@media (prefers-color-scheme: dark) { html, body { background: #111110; } }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body { font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
.viz-root { color: var(--text-primary); background: var(--page); min-height: 100vh;
  background-image: radial-gradient(900px 420px at 15% -10%, var(--glow), transparent 70%); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
a { color: var(--accent-text); }
code { font: 0.88em ui-monospace, SFMono-Regular, Menlo, monospace; }
h2 { font-size: 14px; font-weight: 600; margin: 0; letter-spacing: -0.005em; }

/* nav */
.nav { position: sticky; top: 0; z-index: 5; backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  background: color-mix(in srgb, var(--page) 78%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.navin { display: flex; justify-content: space-between; align-items: center; height: 56px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; color: var(--text-primary); text-decoration: none; }
.logo { width: 22px; height: 22px; fill: none; stroke: var(--text-primary); stroke-width: 2.2; stroke-linecap: round; }
.logo .lo2 { stroke: var(--good); }
.tag { font-weight: 500; font-size: 12px; color: var(--text-muted); border: 1px solid var(--border); border-radius: 99px; padding: 1px 8px; }
.nav nav a { margin-left: 20px; color: var(--text-secondary); text-decoration: none; font-size: 14px; }
.nav nav a:hover { color: var(--text-primary); }

/* hero */
.hero { display: grid; grid-template-columns: 1.25fr 1fr; gap: 28px; align-items: center; padding: 44px 0 28px; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.07em; margin: 0 0 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px var(--glow); }
h1 { font-size: clamp(30px, 4.2vw, 50px); line-height: 1.06; letter-spacing: -0.03em; margin: 0; font-weight: 700; }
h1 em { font-style: normal; color: var(--text-secondary); }
.big { color: var(--good); font-variant-numeric: tabular-nums; }
.sub { color: var(--text-secondary); font-size: 16px; max-width: 56ch; margin: 16px 0 22px; }
.sub b { color: var(--text-primary); }

.lookup { position: relative; display: flex; gap: 8px; max-width: 470px; }
.lookup input { flex: 1; font: inherit; font-size: 15px; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-primary); box-shadow: var(--shadow); }
.lookup input:focus { outline: 2px solid var(--series-1); outline-offset: 1px; }
.suggest { position: absolute; top: 48px; left: 0; right: 86px; list-style: none; margin: 0; padding: 4px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); z-index: 4; }
.suggest li { padding: 7px 10px; border-radius: 7px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.suggest li:hover, .suggest li.on { background: var(--surface-2); }
.result { margin-top: 12px; max-width: 470px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-1); box-shadow: var(--shadow); font-size: 14px; }
.result .r-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.result .r-dom { font-weight: 650; font-size: 16px; }
.result p { margin: 4px 0 0; color: var(--text-secondary); }

/* cards */
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.hint { font-size: 12px; color: var(--text-muted); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid > *, .hero > * { min-width: 0; }
#groups .bar { grid-template-columns: 150px minmax(0, 1fr) 44px; }
#groups .lbl { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; }

/* distribution */
.dist { display: flex; gap: 2px; height: 40px; }
.seg { height: 100%; min-width: 3px; }
.seg:first-child { border-radius: 6px 0 0 6px; }
.seg:last-child { border-radius: 0 6px 6px 0; }
.legend { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.legend li { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 13.5px; }
.legend b { margin-left: auto; color: var(--text-primary); font-variant-numeric: tabular-nums; font-weight: 600; }
.legend .pc { color: var(--text-muted); font-variant-numeric: tabular-nums; width: 44px; text-align: right; font-size: 12.5px; }
.sw { width: 10px; height: 10px; flex: none; overflow: visible; }

/* horizontal bars */
.bars { display: grid; gap: 12px; }
.bar { display: grid; grid-template-columns: 112px minmax(0, 1fr) 44px; align-items: center; gap: 10px; font-size: 13.5px; }
.bar .lbl { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .track { height: 10px; background: var(--surface-2); border-radius: 0 4px 4px 0; position: relative; }
.bar .fill { height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.bar .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.note { color: var(--text-muted); font-size: 12.5px; margin: 12px 0 0; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 10px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; cursor: pointer; color: var(--text-primary); font-family: inherit; }
.chip:hover { border-color: var(--text-muted); }
.chip .rk { color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: 11.5px; }

/* status pill */
.status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ic { width: 10px; height: 10px; flex: none; overflow: visible; }

/* trend */
.trend svg { width: 100%; height: auto; display: block; overflow: visible; }
.trend .axis text { fill: var(--text-muted); font-size: 11px; }
.trend .gridline { stroke: var(--grid); stroke-width: 1; }

/* table */
.tablebar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.tablebar h2 { margin-right: auto; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { font: inherit; font-size: 12.5px; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--border); background: transparent; color: var(--text-secondary); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.filters button[aria-pressed="true"] { background: var(--text-primary); color: var(--surface-1); border-color: var(--text-primary); }
.filters .n { font-variant-numeric: tabular-nums; opacity: 0.75; }
#q { font: inherit; font-size: 14px; padding: 7px 11px; border-radius: 9px; border: 1px solid var(--border); background: var(--page); color: var(--text-primary); width: 180px; }
.tablewrap { overflow-x: auto; border-top: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--text-muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 8px; border-bottom: 1px solid var(--border); }
td { padding: 7px 8px; border-bottom: 1px solid var(--grid); }
tr.hl td { background: color-mix(in srgb, var(--series-1) 10%, transparent); }
td.num { color: var(--text-muted); font-variant-numeric: tabular-nums; width: 48px; }
td.dim { color: var(--text-secondary); white-space: nowrap; }
td .host { color: var(--text-muted); font-size: 12px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.pager .note { margin: 0; }
.btn { font: inherit; font-size: 12.5px; padding: 5px 11px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-secondary); cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover:not(:disabled) { color: var(--text-primary); border-color: var(--text-muted); }
.btn:disabled { opacity: 0.4; cursor: default; }
.pager .btn + .btn { margin-left: 6px; }
.btn.primary { background: var(--text-primary); color: var(--surface-1); border-color: var(--text-primary); font-weight: 600; padding: 9px 16px; font-size: 14px; margin-top: 6px; }
.btn.primary:hover { color: var(--surface-1); opacity: 0.88; }
.lookup button { font: inherit; font-weight: 600; padding: 0 18px; border-radius: 10px; border: 0; background: var(--text-primary); color: var(--surface-1); cursor: pointer; }

/* method + cta */
#sites { margin-bottom: 16px; }
details summary { list-style: none; cursor: pointer; }
details summary::-webkit-details-marker { display: none; }
details summary h2::after { content: " ▾"; color: var(--text-muted); }
details:not([open]) summary h2::after { content: " ▸"; }
.prose p { color: var(--text-secondary); font-size: 14px; margin: 12px 0 0; }
.links { display: flex; gap: 16px; }
.cta p { color: var(--text-secondary); font-size: 14px; margin: 10px 0 14px; }
.cmd { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 8px 8px 8px 12px; margin-bottom: 8px; }
.cmd code { font-size: 13px; }
footer { color: var(--text-muted); font-size: 13px; padding: 10px 24px 48px; }

.tip { position: fixed; pointer-events: none; background: #0b0b0b; color: #fcfcfb; font-size: 12.5px; padding: 7px 10px; border-radius: 8px; z-index: 10; max-width: 260px; box-shadow: 0 6px 18px rgba(0,0,0,0.2); }
@media (prefers-color-scheme: dark) { .tip { background: #f0efec; color: #1a1a19; } }

@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 28px; }
  .grid, .grid.two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .nav nav a:not(.gh) { display: none; }
  .tag { display: none; }
  .hide-s { display: none; }
  #q { width: 100%; }
  .legend { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 100px minmax(0, 1fr) 44px; }
  h1 { font-size: 30px; }
  .lookup button { padding: 0 14px; }
}
@media (forced-colors: active) { .seg, .sw, .fill { border: 1px solid CanvasText; } }
