:root {
  color-scheme: dark;
  --bg: #080e12;
  --surface: #101a20;
  --surface-raised: #142027;
  --line: #2a3b43;
  --text: #f2f6f7;
  --muted: #99aab2;
  --soft: #728792;
  --mint: #76dfb6;
  --mint-dim: rgba(93, 223, 167, .12);
  --amber: #f2bd6a;
  --red: #ed8e84;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  background: radial-gradient(ellipse 70% 35% at 80% 0, rgba(29, 82, 73, .17), transparent 75%), var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
[hidden] { display: none !important; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }
.shell { width: min(100% - 64px, 1268px); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 78px; display: flex; align-items: center; gap: 26px; }
.brand { font-size: 27px; font-weight: 750; letter-spacing: -.055em; text-decoration: none; white-space: nowrap; }
.brand span { color: var(--mint); }
.product { border-left: 1px solid var(--line); padding-left: 20px; font-size: 14px; font-weight: 700; letter-spacing: .045em; }
.header-nav { display: flex; align-items: center; gap: 55px; margin-left: auto; }
.header-nav a { color: var(--muted); font-size: 13px; text-decoration: none; }
.header-nav a:hover { color: var(--mint); }
.hero { padding: 72px 0 45px; }
.eyebrow, .section-label { margin: 0; color: var(--mint); text-transform: uppercase; letter-spacing: .035em; font-size: 11px; font-weight: 720; }
.hero h1 { margin: 11px 0 10px; font-size: clamp(39px, 4.1vw, 55px); line-height: 1.11; letter-spacing: -.05em; font-weight: 750; }
.hero-copy { margin: 0; max-width: 780px; color: #b7c4ca; font-size: 16px; }
.overview { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.42fr); gap: 21px; }
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.visitor-card, .points-card { min-height: 248px; padding: 25px; }
.visitor-card .section-label, .points-card .section-label, .comparison .section-label { color: var(--soft); }
.ip-address { display: block; margin-top: 17px; font-size: clamp(30px, 3vw, 37px); line-height: 1.15; font-weight: 650; letter-spacing: -.045em; overflow-wrap: anywhere; }
.egress-pill {
  display: table; max-width: 100%; margin: 21px 0 15px; padding: 7px 12px; border: 1px solid var(--line);
  border-radius: 999px; color: var(--muted); background: #19252b; font-size: 12px; line-height: 1.25;
}
.egress-pill[data-egress="node"], .egress-pill[data-egress="gateway"] { background: var(--mint-dim); border-color: transparent; color: var(--mint); }
.egress-pill[data-egress="node"]::before, .egress-pill[data-egress="gateway"]::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; vertical-align: 1px;
  border-radius: 50%; background: var(--mint);
}
.visitor-meta { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 0; }
.visitor-meta div { display: flex; gap: 7px; min-width: 0; }
.visitor-meta dt { color: var(--soft); font-size: 12px; }
.visitor-meta dd { min-width: 0; margin: 0; color: #cad6db; font-size: 12px; overflow-wrap: anywhere; }
.card-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 17px; }
.muted { color: var(--soft); font-size: 12px; }
.points-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.points-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; align-items: center;
  min-height: 59px; padding: 11px 15px 11px 49px; position: relative;
  background: var(--surface-raised); border: 1px solid var(--line); border-radius: 11px;
}
.points-list li::before {
  content: ""; position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border: 1px solid #647f84; border-radius: 50%; background: #283a40;
}
.points-list li[data-reachable="true"]::before { background: var(--mint); border-color: var(--mint); }
.points-list li[data-reachable="true"]::after {
  content: "✓"; position: absolute; left: 20px; top: 50%; transform: translateY(-54%);
  color: #071411; font-size: 13px; font-weight: 800;
}
.points-list li[data-reachable="false"]::before { background: rgba(237, 142, 132, .13); border-color: var(--red); }
.point-name { min-width: 0; font-weight: 660; font-size: 14px; overflow-wrap: anywhere; }
.point-host { grid-column: 1; color: var(--soft); font-size: 12px; overflow-wrap: anywhere; }
.point-rtt, .point-status { grid-column: 2; font-size: 12px; color: var(--muted); text-align: right; }
.point-rtt { grid-row: 1; }
.point-status { grid-row: 2; color: var(--soft); }
.points-list [data-nearest="1"] .point-status { color: var(--mint); }
.points-list [data-reachable="false"] .point-status { color: var(--red); }
.points-list .point-placeholder { display: block; padding-left: 15px; color: var(--muted); }
.points-list .point-placeholder::before { display: none; }
.points-footer { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-top: 13px; }
.points-footer p { margin: 0; color: var(--soft); font-size: 12px; }
.run-actions { display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-end; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 12px; min-height: 42px; padding: 9px 17px; border-radius: 9px; border: 1px solid var(--line); cursor: pointer; font-weight: 650; font-size: 13px; text-align: center; text-decoration: none; transition: background .16s, border-color .16s, transform .16s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button-primary { min-width: 195px; color: #071812; background: var(--mint); border-color: var(--mint); }
.button-primary:hover:not(:disabled) { background: #9aecce; }
.button-secondary { background: transparent; color: var(--text); }
.button-secondary:hover:not(:disabled) { background: #1b2b33; border-color: #49606a; }
.button:disabled { cursor: not-allowed; opacity: .48; }
.progress { margin-top: 16px; }
.progress-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
#progress-stage { min-width: 0; overflow-wrap: anywhere; }
progress { display: block; width: 100%; height: 5px; overflow: hidden; border: 0; border-radius: 99px; background: #203037; appearance: none; }
progress::-webkit-progress-bar { background: #203037; }
progress::-webkit-progress-value { background: var(--mint); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--mint); border-radius: 99px; }
.results-section { margin-top: 45px; padding-top: 28px; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 23px; }
.section-heading h2 { margin: 8px 0 0; font-size: clamp(25px, 2.7vw, 34px); line-height: 1.2; letter-spacing: -.035em; }
.empty-state {
  display: flex; align-items: center; gap: 20px; min-height: 166px;
  padding: 27px; border: 1px dashed #31454d; border-radius: 17px; background: rgba(16, 26, 32, .62);
}
.empty-mark { display: grid; place-items: center; flex: none; width: 66px; height: 66px; border: 1px solid #365047; border-radius: 16px; background: var(--mint-dim); color: var(--mint); font-size: 21px; letter-spacing: -5px; padding-right: 5px; }
.empty-state h3 { margin: 0 0 5px; font-size: 18px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; }
.verdict {
  position: relative; margin-bottom: 24px; padding: 24px 26px 24px 30px; border: 1px solid #435145;
  border-left: 4px solid var(--mint); border-radius: 14px; background: #17232a;
  font-size: 19px; font-weight: 580; line-height: 1.5;
}
.verdict::before { content: "Результат"; display: block; margin-bottom: 7px; color: var(--mint); font-size: 11px; font-weight: 730; text-transform: uppercase; letter-spacing: .04em; }
.verdict[data-code="freeze"], .verdict[data-code="cross_border"], .verdict[data-code="degraded"], .verdict[data-code="slow"] { border-left-color: var(--amber); }
.verdict[data-code="freeze"]::before, .verdict[data-code="cross_border"]::before, .verdict[data-code="degraded"]::before, .verdict[data-code="slow"]::before { color: var(--amber); content: "Возможная деградация маршрута"; }
.verdict[data-code="offline"] { border-left-color: var(--red); }
.verdict[data-code="offline"]::before { color: var(--red); content: "Точки недоступны"; }
.verdict[data-code="ok"]::before { content: "Соединение в норме"; }
.comparison { padding: 21px 25px 6px; }
.comparison .section-label { margin-bottom: 15px; }
.table-scroll { overflow-x: auto; scrollbar-color: #4f646a transparent; }
#results { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
#results th { padding: 14px 10px 15px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 520; white-space: nowrap; }
#results th small { display: block; font-size: 10px; font-weight: 400; }
#results td { padding: 17px 10px 17px 0; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
#results tr:last-child td { border-bottom: 0; }
#results .r-name { min-width: 155px; max-width: 260px; white-space: normal; font-size: 14px; font-weight: 650; }
#results .r-name small { display: block; margin-top: 2px; color: var(--soft); font-size: 11px; font-weight: 400; overflow-wrap: anywhere; }
#results .r-down, #results .r-up { font-weight: 700; }
#results .r-freeze { white-space: normal; min-width: 95px; }
#results [data-error] .r-name::after { content: " · частичный результат"; color: var(--amber); font-size: 11px; font-weight: 450; }
.report-details { margin-top: 21px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.report-details summary { cursor: pointer; padding: 13px 16px; font-size: 13px; font-weight: 650; list-style: none; }
.report-details summary::-webkit-details-marker { display: none; }
.report-details summary span { float: right; color: var(--mint); }
.report-details[open] summary span { transform: rotate(180deg); }
.report-details pre { max-height: 360px; overflow: auto; margin: 0 15px 15px; padding: 15px; background: #0b1318; color: #c9dad5; border: 1px solid var(--line); border-radius: 8px; font-size: 11px; line-height: 1.5; tab-size: 2; }
.report-actions { display: flex; gap: 9px; flex-wrap: wrap; padding: 0 15px 15px; }
.guide { display: grid; grid-template-columns: 280px 1fr; gap: 40px; margin-top: 50px; padding: 30px 0 42px; border-top: 1px solid var(--line); }
.guide h2 { margin: 8px 0; font-size: 23px; letter-spacing: -.03em; }
.guide-items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; }
.guide-items p { margin: 0; }
.guide-items strong, .guide-items span { display: block; }
.guide-items strong { margin-bottom: 5px; font-size: 13px; }
.guide-items span { color: var(--muted); font-size: 12px; }
.footer { display: flex; justify-content: space-between; gap: 20px; padding: 21px 0 35px; border-top: 1px solid var(--line); color: var(--soft); font-size: 11px; }
@media (max-width: 900px) {
  .overview { grid-template-columns: 1fr; }
  .visitor-card, .points-card { min-height: 0; }
  .guide { grid-template-columns: 1fr; gap: 15px; }
  .guide-items { gap: 18px; }
}
@media (max-width: 660px) {
  .shell { width: min(100% - 32px, 520px); }
  .header-inner { min-height: 64px; gap: 20px; }
  .brand { font-size: 23px; }
  .product { padding-left: 16px; font-size: 12px; }
  .header-nav { gap: 0; }
  .header-nav a:first-child { display: none; }
  .header-nav a { font-size: 12px; }
  .hero { padding: 27px 0 30px; }
  .hero h1 { max-width: 420px; font-size: clamp(37px, 9vw, 47px); }
  .hero-copy { font-size: 14px; line-height: 1.55; }
  .overview { gap: 15px; }
  .visitor-card, .points-card { padding: 18px; border-radius: 15px; }
  .ip-address { font-size: 31px; }
  .visitor-meta { gap: 4px 18px; }
  .card-heading .muted { font-size: 11px; }
  .points-footer { display: block; margin-top: 11px; }
  .points-footer p { margin-bottom: 16px; }
  .run-actions, .run-actions .button { width: 100%; }
  .run-actions .button { min-height: 48px; }
  .results-section { margin-top: 30px; padding-top: 25px; }
  .section-heading { align-items: start; margin-bottom: 18px; }
  .section-heading h2 { font-size: 28px; }
  #result-time { display: none; }
  .empty-state { align-items: start; padding: 20px; min-height: 140px; }
  .empty-mark { width: 48px; height: 48px; font-size: 17px; }
  .verdict { padding: 18px 19px; font-size: 16px; }
  .comparison { border: 0; padding: 0; background: transparent; }
  .comparison > .section-label { margin: 0 0 14px; color: var(--text); text-transform: none; letter-spacing: -.02em; font-size: 20px; }
  .table-scroll { overflow: visible; }
  #results, #results tbody, #results tr, #results td { display: block; }
  #results thead { display: none; }
  #results tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 6px; margin-bottom: 14px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
  #results td { border: 0; padding: 0; white-space: normal; }
  #results td::before { content: attr(data-label); display: block; margin-bottom: 3px; color: var(--soft); text-transform: uppercase; font-size: 10px; font-weight: 550; }
  #results .r-name { grid-column: 1 / -1; min-width: 0; max-width: none; padding-bottom: 14px; border-bottom: 1px solid var(--line); font-size: 17px; }
  #results .r-name::before { display: none; }
  #results .r-name small { margin-top: 3px; }
  #results .r-rtt, #results .r-jitter, #results .r-loss, #results .r-freeze { padding-top: 13px; padding-bottom: 14px; }
  #results .r-dns { display: none; }
  #results .r-down, #results .r-up { grid-column: span 2; padding-top: 13px; border-top: 1px solid var(--line); font-size: 14px; }
  #results .r-freeze { min-width: 0; }
  #results .r-down::before, #results .r-up::before { display: none; }
  #results .r-down::before { content: "↓ Скорость"; display: inline; margin-right: 5px; }
  #results .r-up::before { content: "↑ Отдача"; display: inline; margin-right: 5px; }
  .report-actions .button { flex: 1 1 160px; }
  .guide { margin-top: 33px; padding: 26px 0; }
  .guide-items { grid-template-columns: 1fr; gap: 14px; }
  .footer { flex-direction: column; gap: 4px; }
}
@media (max-width: 380px) {
  .header-nav a { display: none; }
  .visitor-meta { display: block; }
  #results tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #results .r-rtt, #results .r-jitter, #results .r-loss, #results .r-freeze { border-bottom: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
