/* Monochrome full-black DNS & WebRTC checker matching the gateway panel. */
:root {
  color-scheme: dark;
  --bg: #000;
  --pane: #0a0a0a;
  --surface: #111;
  --surface-hi: #161616;
  --line: #1d1d1d;
  --line-2: #2a2a2a;
  --text: #ededed;
  --text-2: #a3a3a3;
  --muted: #7c7c7c;
  --faint: #4a4a4a;
  --white: #fff;
  --sans: "Golos Text", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;
  --out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/20px var(--sans);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
.mono { font-family: var(--mono); }

.prs { transition: transform .15s var(--out), background-color .15s, border-color .15s, opacity .15s; }
.prs:active:not(:disabled) { transform: scale(.97); }

.app { max-width: 1120px; margin: 0 auto; padding: 32px 36px 56px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; }
.mark { display: block; color: var(--white); }
.brand-name { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.top-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.chip {
  display: flex; align-items: center; gap: 9px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--pane); font-size: 13px; white-space: nowrap;
}
.chip-time { font-size: 12px; color: var(--muted); }
.chip-time:empty { display: none; }

.ind { position: relative; display: flex; align-items: center; justify-content: center; width: 12px; height: 12px; flex: none; }
.ind-spin {
  width: 10px; height: 10px; border-radius: 50%;
  border: 1.5px solid var(--line-2); border-top-color: var(--white);
  animation: spin .85s linear infinite;
}
.ind-ok { width: 8px; height: 8px; border-radius: 50%; background: var(--white); animation: brth 3.2s ease-in-out infinite; }
.ind-warn { width: 8px; height: 8px; background: var(--text-2); transform: rotate(45deg) scale(.86); }
.ind-fail { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--text); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes brth { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.btn { height: 36px; padding: 0 16px; border-radius: 10px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.sec { border: 1px solid var(--line-2); background: var(--surface); color: var(--text); }
.sec:hover:not(:disabled) { background: var(--surface-hi); }
.ghost { border: 1px solid var(--line); background: transparent; color: var(--text-2); font-weight: 500; }
.ghost:hover:not(:disabled) { color: var(--text); border-color: var(--line-2); }

.main { margin-top: 28px; }

.scores { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 12px; }
.score-card {
  padding: 20px 22px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--pane); animation: rise .35s var(--out) backwards;
}
.score-card.primary-card { border-color: var(--line-2); background: var(--surface); }
.score-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lbl { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .08em; color: var(--muted); }
.score-val { margin-top: 10px; font-size: 40px; line-height: 44px; font-weight: 600; letter-spacing: -.03em; color: var(--white); }
.score-card:not(.primary-card) .score-val { font-size: 32px; color: var(--text); }
.bar { height: 3px; margin-top: 14px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0%; background: var(--white); transition: width .55s var(--out); }
.score-card:not(.primary-card) .bar i { background: var(--text-2); }

.verdict-badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  border-radius: 11px; border: 1px solid var(--line-2);
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-2);
}
.verdict-badge.clean { border-color: var(--white); background: var(--white); color: #000; }
.verdict-badge.warn { border-color: var(--text-2); color: var(--text); }
.verdict-badge.fail { border-color: var(--line-2); background: var(--pane); color: var(--muted); text-decoration: line-through; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.gap { margin-top: 24px; }

.lbl-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.lbl-note { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.box { border: 1px solid var(--line); border-radius: 12px; background: var(--pane); overflow: hidden; }
.box.pad { padding: 16px 18px; }

.kvrow { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 42px; padding: 8px 16px; }
.kvrow + .kvrow { border-top: 1px solid var(--line); }
.kvrow .k { flex: none; font-size: 13px; color: var(--muted); }
.kvrow .v { min-width: 0; font-size: 13px; color: var(--text); text-align: right; overflow-wrap: anywhere; }

.fact-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 16px; }
.fact-row + .fact-row { border-top: 1px solid var(--line); }
.fact-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fact-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; flex: none; border-radius: 9px;
  border: 1px solid var(--line-2); font-size: 11px; color: var(--text-2);
}
.fact-mark.ok { border-color: var(--white); background: var(--white); color: #000; font-weight: 700; }
.fact-mark.warn { border-color: var(--text-2); color: var(--text); }
.fact-mark.fail { border-color: var(--muted); color: var(--muted); }
.fact-name { font-size: 13px; color: var(--text-2); }
.fact-right { text-align: right; min-width: 0; }
.fact-val { font-size: 13px; color: var(--text); font-weight: 500; }
.fact-det { font-size: 12px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }

.table-wrap { overflow-x: auto; max-height: 360px; overflow-y: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  position: sticky; top: 0; z-index: 2;
  text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line); background: var(--surface);
  white-space: nowrap;
}
.tbl td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: middle; color: var(--text); }
.tbl tbody tr:first-child td { border-top: 0; }
.tbl tbody tr:hover td { background: var(--surface); }
.empty-cell, .empty-row { padding: 18px 16px; color: var(--muted); font-size: 13px; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 9px;
  font-size: 11px; font-weight: 600; letter-spacing: .03em; white-space: nowrap;
  border: 1px solid var(--line-2); color: var(--text-2);
}
.tag.native { border-color: var(--white); background: var(--white); color: #000; }
.tag.self { border-color: var(--text-2); color: var(--text); }
.tag.public, .tag.foreign { border-color: var(--line-2); background: var(--surface); color: var(--muted); }

.reason-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.reason-list li { font-size: 13px; color: var(--text-2); padding-left: 14px; position: relative; }
.reason-list li::before { content: ""; position: absolute; left: 0; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--text-2); }
.reason-ok { font-size: 13px; color: var(--text); }
.muted-line { font-size: 13px; color: var(--muted); }

.rtt-bars { display: flex; align-items: flex-end; gap: 4px; height: 34px; margin-top: 14px; padding-top: 8px; border-top: 1px solid var(--line); }
.rtt-bar { flex: 1; min-width: 4px; background: var(--line-2); border-radius: 2px 2px 0 0; transition: height .3s var(--out); }
.rtt-bar.fast { background: var(--text-2); }

.terminal {
  margin: 0; padding: 14px 16px; min-height: 150px; max-height: 220px;
  overflow: auto; font-size: 12px; line-height: 18px; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
}

@media (max-width: 820px) {
  .app { padding: 20px 16px 40px; }
  .scores { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
