:root {
  --bg: #0a0a0b;
  --surface: #121214;
  --surface-2: #19191c;
  --border: #29292e;
  --text: #f1f1f3;
  --muted: #a3a3ad;
  --accent: #f5002d;
  --accent-text: #ff5f7c;
  --good: #4ade80;
  --good-bg: #0f2a1a;
  --warn: #fbbf24;
  --warn-bg: #2d2208;
  --bad: #ff6b81;
  --bad-bg: #300f17;
  --info-bg: #1c1c21;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans); }
a { color: var(--accent-text); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .875em; overflow-wrap: anywhere; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 20; }
.skip:focus { left: 12px; }

.top { position: sticky; top: 0; z-index: 10; background: rgba(10, 10, 11, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.125rem; text-decoration: none; white-space: nowrap; }
.brand svg { color: var(--accent); flex: none; }
.brand em { color: var(--muted); font-style: normal; font-weight: 500; }
.top nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.top nav a { color: var(--muted); text-decoration: none; font-size: .875rem; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.top nav a:hover { color: var(--text); background: var(--surface-2); }

.intro { display: grid; grid-template-columns: 1fr auto; gap: 20px 24px; align-items: end; padding: 44px 0 20px; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.15; letter-spacing: -.02em; }
.lead { color: var(--muted); margin-top: 8px; max-width: 62ch; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { font: 600 .9375rem/1 var(--sans); min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.btn:hover:not(:disabled) { border-color: #4a4a52; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #d80028; border-color: #d80028; }
.progress { grid-column: 1 / -1; height: 4px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }
.progress.done { visibility: hidden; }
.notice { background: var(--warn-bg); color: var(--warn); padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; }

.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 10px; margin-bottom: 28px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; min-width: 0; color: inherit; text-decoration: none; display: block; }
a.card:hover { border-color: #4a4a52; }
.card .label { color: var(--muted); font-size: .8125rem; }
.card .value { font-weight: 650; margin-top: 2px; overflow-wrap: anywhere; line-height: 1.3; }
.card .pill { margin-top: 10px; }

.pill { display: inline-block; font-size: .75rem; font-weight: 650; line-height: 1; padding: 5px 8px; border-radius: 999px; background: var(--info-bg); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }

.panel { border-top: 1px solid var(--border); padding: 28px 0; }
.panel > header { margin-bottom: 16px; }
h2 { font-size: 1.25rem; letter-spacing: -.01em; }
.panel > header p { color: var(--muted); margin-top: 2px; font-size: .9375rem; max-width: 72ch; }
h3 { font-size: .9375rem; margin-bottom: 8px; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.kv > div { padding: 11px 14px; min-width: 0; box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border); }
.kv dt { color: var(--muted); font-size: .8125rem; }
.kv dd { margin: 1px 0 0; overflow-wrap: anywhere; }
dl { margin: 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .9375rem; }
caption { text-align: left; color: var(--muted); padding: 10px 14px; font-size: .8125rem; border-bottom: 1px solid var(--border); }
th, td { padding: 10px 14px; text-align: left; border-top: 1px solid var(--border); vertical-align: top; }
thead th { border-top: 0; color: var(--muted); font-size: .8125rem; font-weight: 600; white-space: nowrap; }
tbody th { font-weight: 600; white-space: nowrap; }
td .pill + .pill { margin-left: 4px; }
td.nowrap { white-space: nowrap; overflow-wrap: normal; }
.flags { display: flex; flex-wrap: wrap; gap: 4px; }
.matrix td, .matrix thead th { text-align: center; }
.matrix td { min-width: 84px; }
.footnote { color: var(--muted); font-size: .8125rem; margin-top: 8px; }
.section-note { margin-bottom: 12px; }

.score { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.score strong { font-size: 2.25rem; line-height: 1; letter-spacing: -.02em; }
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 10px; align-items: start; }
.cat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.cat summary { cursor: pointer; display: flex; justify-content: space-between; gap: 10px; font-weight: 600; font-size: .9375rem; list-style: none; }
.cat summary::-webkit-details-marker { display: none; }
.cat summary span:last-child { color: var(--muted); font-weight: 500; white-space: nowrap; }
.meter { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.meter span { display: block; height: 100%; width: 0; background: var(--good); }
.meter.mid span { background: var(--warn); }
.meter.low span { background: var(--bad); }
.hostlist { list-style: none; margin: 10px 0 0; padding: 0; font: .8125rem/1.7 var(--mono); max-height: 240px; overflow: auto; overflow-wrap: anywhere; }
.hostlist .open { color: var(--bad); }
.hostlist .closed { color: var(--muted); }

.headers td:first-child { color: var(--muted); white-space: nowrap; }
.headers td { font: .8125rem/1.5 var(--mono); overflow-wrap: anywhere; }
.subgrid { display: grid; gap: 18px; }

.foot { border-top: 1px solid var(--border); padding: 24px 0 40px; color: var(--muted); font-size: .875rem; }
.foot p + p { margin-top: 6px; }

@media (max-width: 720px) {
  .top nav { display: none; }
  .intro { grid-template-columns: 1fr; padding-top: 28px; }
  .actions .btn { flex: 1 1 auto; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  th, td { padding: 9px 11px; }
  .matrix th, .matrix td { padding: 9px 3px; min-width: 0; white-space: normal; }
  .matrix thead th { font-size: .6875rem; }
  .matrix tbody th { padding-left: 11px; font-size: .875rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .progress span { transition: none; }
}
