:root {
  --bg: #07090c;
  --panel: #0c1015;
  --panel-bar: #10151b;
  --border: #1c242d;
  --line: #141a21;
  --text: #c9d1d9;
  --muted: #6e7a87;
  --dim: #36404a;
  --accent: #3fb950;
  --accent-soft: rgba(63, 185, 80, 0.12);
  --amber: #d29922;
  --amber-soft: rgba(210, 153, 34, 0.12);
  --red: #f85149;
  --red-soft: rgba(248, 81, 73, 0.12);
  --blue: #58a6ff;
  --font: ui-monospace, "SFMono-Regular", "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--font);
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.accent { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.good { color: var(--accent); }
.warn { color: var(--amber); }
.bad { color: var(--red); }

.top {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
}
.brand { color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.tagline { color: var(--muted); }
.status { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.status.busy .dot { background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: pulse 1.2s ease-in-out infinite; }

main { max-width: 1120px; margin: 0 auto; padding: 0 16px 32px; }

.hero { padding: 36px 0 28px; }
.cmd { color: var(--muted); margin-bottom: 10px; }
.cursor::after { content: "_"; color: var(--accent); animation: blink 1s steps(1) infinite; }
.ip-line { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ip {
  font: 700 clamp(26px, 6.4vw, 54px)/1.15 var(--font);
  color: var(--accent);
  text-shadow: 0 0 18px rgba(63, 185, 80, 0.35);
  background: none;
  border: 0;
  padding: 0;
  cursor: copy;
  word-break: break-all;
  text-align: left;
}
.badge {
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 12px;
}
.badge:empty { display: none; }
.copied { color: var(--muted); font-size: 12px; }
.hero-meta { margin-top: 10px; color: var(--text); }
.hero-meta .sep { color: var(--dim); margin: 0 8px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: 1 / -1; }

.term {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  min-width: 0;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--panel-bar);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}
.term-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--dim); }
.term-bar i:nth-child(1) { background: #5a2b2b; }
.term-bar i:nth-child(2) { background: #5a4a22; }
.term-bar i:nth-child(3) { background: #24502c; }
.term-bar span { margin-left: 8px; }
.term-body { padding: 12px 16px 14px; }

.kv { margin: 0; }
.kv .row {
  display: grid;
  grid-template-columns: minmax(110px, 34%) minmax(0, 1fr);
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
}
.kv .row:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv dd .note { color: var(--muted); margin-left: 6px; }
.kv dd .note.good { color: var(--accent); }
.kv dd .note.bad { color: var(--red); }
.span-2 .kv .row { grid-template-columns: 180px minmax(0, 1fr); }

.verdict-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px; margin-bottom: 12px; }
.verdict { font-size: 22px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.verdict.good { color: var(--accent); }
.verdict.warn { color: var(--amber); }
.verdict.bad { color: var(--red); }

.flags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  border: 1px solid var(--dim);
  color: var(--dim);
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.chip.on { color: var(--amber); border-color: var(--amber); background: var(--amber-soft); }
.chip.on.bad { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.chip.on.good { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.chip.pending { border-style: dashed; }

.map { height: 340px; border-radius: 6px; border: 1px solid var(--border); background: #0b0f14; }
.map .map-empty { display: flex; height: 100%; align-items: center; justify-content: center; color: var(--muted); }

.dns-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.btn {
  font: inherit;
  font-size: 12px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 3px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--accent-soft); }
.btn:disabled { color: var(--dim); border-color: var(--dim); cursor: default; }

.table-wrap { overflow-x: auto; margin-bottom: 10px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 400; color: var(--muted); border-bottom: 1px solid var(--border); padding: 4px 12px 6px 0; }
.table td { padding: 5px 12px 5px 0; border-bottom: 1px dashed var(--line); vertical-align: top; }
.table .num { text-align: right; padding-right: 0; }
.table .empty td { color: var(--muted); }
.table .sub { display: block; color: var(--muted); font-size: 12px; }
.table .addr { display: block; white-space: nowrap; }
.table .narrow-only { display: none; }
.table details summary { cursor: pointer; color: var(--muted); }
.table details summary:hover { color: var(--text); }

.dnssec-grid { display: grid; grid-template-columns: repeat(5, auto); justify-content: start; gap: 4px 28px; margin: 10px 0; font-size: 12px; overflow-x: auto; }
.dnssec-grid:empty { display: none; }
.dnssec-grid .h { color: var(--muted); white-space: nowrap; }

.headers summary { cursor: pointer; color: var(--muted); margin-top: 10px; }
.headers summary:hover { color: var(--text); }
.headers pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12px/1.5 var(--font);
}

.loading { color: var(--muted); }
.loading::after { content: "..."; animation: blink 1.2s steps(1) infinite; }

footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 16px 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

#map.leaflet-container { background: #0b0f14; font-family: var(--font); }
#map .leaflet-control-attribution { background: rgba(7, 9, 12, 0.8); color: var(--muted); }
#map .leaflet-control-attribution a { color: var(--blue); }
#map .leaflet-bar a { background: var(--panel-bar); color: var(--text); border-bottom-color: var(--border); }
#map .leaflet-bar a:hover { background: var(--border); color: var(--text); }
#map .osm-dark { filter: invert(100%) hue-rotate(180deg) brightness(92%) contrast(88%) saturate(55%); }

@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 50% { opacity: 0.35; } }

@media (prefers-reduced-motion: reduce) {
  .cursor::after, .loading::after, .status.busy .dot { animation: none; }
}

@media (max-width: 820px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .tagline { display: none; }
  .hero { padding: 26px 0 20px; }
  .map { height: 260px; }
  .kv .row, .span-2 .kv .row { grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); }
  .wide-only { display: none; }
  .table .narrow-only { display: block; }
  .dnssec-grid { gap: 4px 10px; font-size: 11px; }
}
