:root {
  color-scheme: dark;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  background: #071018;
  color: #e8eef7;
  --canvas: #071018;
  --surface: rgb(13 23 35 / 82%);
  --surface-strong: #0e1b29;
  --line: #263a4e;
  --line-subtle: rgb(67 90 114 / 42%);
  --text-muted: #93a6bb;
  --text-faint: #63788e;
  --signal: #6ee7f2;
  --signal-strong: #25c9da;
  --signal-dim: #153f50;
  --blue: #4f8df7;
  --amber: #f1c66f;
  --danger: #ff8e88;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 88% -10%, rgb(25 105 131 / 26%), transparent 30rem),
    radial-gradient(circle at 0% 25%, rgb(36 64 103 / 18%), transparent 28rem),
    var(--canvas);
  min-width: 20rem;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: .24;
  background-image:
    linear-gradient(rgb(106 154 189 / 13%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(106 154 189 / 13%) 1px, transparent 1px);
  background-size: 2.5rem 2.5rem;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

header, main, footer {
  width: min(78rem, calc(100% - 2.5rem));
  margin: 0 auto;
}

.masthead { padding: 1.5rem 0 2.75rem; }
main { display: grid; gap: 1.15rem; }
footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 23rem);
  gap: 1.5rem 3rem;
  margin-top: 1rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line-subtle);
  color: var(--text-muted);
  font-size: .76rem;
  line-height: 1.65;
}
footer p { margin: 0; }
footer a { color: var(--signal); text-underline-offset: .2em; }

.masthead-topline,
.masthead-content,
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
}

.masthead-topline {
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line-subtle);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: #f5f9ff;
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: -.03em;
  text-decoration: none;
}

.wordmark-mark {
  width: .7rem;
  height: .7rem;
  border: 2px solid var(--signal);
  box-shadow: 0 0 0 .2rem rgb(110 231 242 / 12%);
  transform: rotate(45deg);
}

.wordmark-muted { color: var(--text-faint); font-weight: 400; }
.environment {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
  color: var(--text-muted);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.environment span {
  width: .42rem;
  height: .42rem;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 .7rem var(--signal);
}

.masthead-content { margin-top: clamp(2.5rem, 7vw, 5.5rem); }

h1 {
  max-width: 15ch;
  margin: .55rem 0 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(2.65rem, 6.2vw, 5.5rem);
  font-weight: 600;
  line-height: .94;
  letter-spacing: -.065em;
  text-wrap: balance;
}

h2 {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.02em;
}

.eyebrow,
.card-kicker {
  margin: 0;
  color: var(--signal);
  font-size: .67rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.notice {
  max-width: 30rem;
  margin: .35rem 0 0;
  color: var(--text-muted);
  font-size: .88rem;
  line-height: 1.7;
}
.status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .8rem;
  margin-top: 2.35rem;
  padding-top: .85rem;
  border-top: 1px solid var(--line-subtle);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .35rem .58rem;
  border: 1px solid rgb(110 231 242 / 45%);
  color: var(--signal);
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.badge::before {
  width: .38rem;
  height: .38rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 .55rem currentColor;
  content: "";
}
.badge.stale { border-color: rgb(241 198 111 / 55%); color: var(--amber); }
.badge.error { border-color: rgb(255 142 136 / 55%); color: var(--danger); }
.subtle, #updated { color: var(--text-faint); }
#updated { font-size: .72rem; }

.panel,
.metric-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgb(19 34 49 / 90%), var(--surface));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 3%), 0 1rem 2.5rem rgb(0 0 0 / 12%);
}
.panel::before,
.metric-card::before {
  position: absolute;
  top: 0;
  left: 1.1rem;
  width: 2.3rem;
  height: 1px;
  background: var(--signal);
  content: "";
}
.panel { padding: 1.3rem; }
.metric-card { min-height: 10.5rem; padding: 1.3rem; }

.summary, .tables {
  display: grid;
  gap: 1.15rem;
}
.summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tables { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.metric-card h2 { max-width: 21ch; margin-top: .95rem; color: var(--text-muted); font-family: inherit; font-size: .73rem; font-weight: 400; line-height: 1.45; }
.metric {
  margin: 1.35rem 0 0;
  color: #eefcff;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(2.15rem, 4.5vw, 3.75rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.055em;
}

.analysis-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(17rem, .9fr); gap: 1.15rem; }
.panel-heading { align-items: flex-start; }
.panel-tag {
  margin: .05rem 0 0;
  padding: .27rem .42rem;
  border: 1px solid var(--line);
  color: var(--text-faint);
  font-size: .62rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.metric-card .subtle { margin: .6rem 0 0; font-size: .75rem; }
.panel .subtle { margin: .55rem 0 0; font-size: .75rem; line-height: 1.5; }
.chart { min-height: 15rem; margin-top: 1.25rem; }
.chart svg { display: block; width: 100%; height: auto; }
.chart polygon { fill: url(#chart-fill); }
.chart polyline { fill: none; stroke: var(--signal); stroke-width: 2.25; vector-effect: non-scaling-stroke; }
.chart line { stroke: var(--line-subtle); stroke-dasharray: 2 5; }
.chart text { fill: var(--text-faint); font-size: 10px; }

.protocol-panel { display: flex; flex-direction: column; }
.ipver { margin-top: auto; padding-top: 2.25rem; }
.chart.is-empty,
.ipver.is-empty {
  min-height: 0;
  margin-top: 1.25rem;
  padding-top: 0;
}
.empty-state,
.empty-cell {
  color: var(--text-faint);
  font-size: .75rem;
  line-height: 1.5;
}
.empty-state { margin: 0; }
.ipver-bar {
  display: flex;
  height: .72rem;
  overflow: hidden;
  gap: 2px;
  border: 1px solid var(--line);
  background: #09131e;
}
.ipver-seg.ipv4 { background: var(--blue); box-shadow: 0 0 1.2rem rgb(79 141 247 / 30%); }
.ipver-seg.ipv6 { background: var(--signal); box-shadow: 0 0 1.2rem rgb(110 231 242 / 30%); }
.ipver-legend { display: grid; gap: .65rem; margin-top: 1.25rem; color: var(--text-muted); font-size: .73rem; line-height: 1.45; }
.ipver-key { display: flex; align-items: center; gap: .5rem; }
.ipver-key::before { width: .5rem; height: .5rem; background: currentColor; content: ""; }
.ipver-key.ipv4::before { color: var(--blue); }
.ipver-key.ipv6::before { color: var(--signal); }

.list-panel h2 { margin-top: .7rem; font-size: .95rem; }
ol { display: grid; gap: 0; margin: 1rem 0 0; padding: 0; list-style: none; counter-reset: entries; }
li {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) auto;
  gap: .3rem;
  align-items: baseline;
  min-width: 0;
  padding: .62rem 0;
  border-top: 1px solid var(--line-subtle);
  color: #cbd8e8;
  font-size: .75rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  counter-increment: entries;
}
li::before { color: var(--text-faint); content: counter(entries, decimal-leading-zero); font-size: .64rem; }
li span { color: var(--signal); white-space: nowrap; }
li.empty-row { display: block; color: var(--text-faint); }
li.empty-row::before { content: none; }

@media (max-width: 52rem) {
  .masthead-content { display: block; }
  .notice { margin-top: 1.5rem; }
  .analysis-grid, .tables { grid-template-columns: 1fr; }
  .protocol-panel { min-height: 18rem; }
  .ipver { margin-top: 1.75rem; padding-top: 0; }
}

@media (max-width: 36rem) {
  header, main, footer { width: min(100% - 1.5rem, 78rem); }
  .masthead { padding-top: 1rem; }
  .masthead-topline { gap: .8rem; }
  .environment { font-size: .57rem; }
  h1 { font-size: clamp(2.35rem, 13vw, 3.25rem); }
  .status { margin-top: 1.75rem; }
  .summary { grid-template-columns: 1fr; }
  .panel, .metric-card { padding: 1rem; }
  .panel::before, .metric-card::before { left: 1rem; }
  footer { grid-template-columns: 1fr; gap: .65rem; }
}
