/*!
 * Nabd — internet speed test (speed.doniaweb.com)
 * Copyright (c) 2026 Mahmoud Ali — doniaweb.com. All rights reserved.
 * Created: 2026-10-13
 */
:root {
  --c1: #22d3ee;
  --c2: #a855f7;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 20px;
  --font: 'Readex Pro', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  /* Skin tokens (overridden in skins.css) */
  --num-font: var(--font);
  --gauge-w: 22px;
  --btn-radius: 12px;
  --card-blur: 10px;
  --orb-a: var(--c2);
  --orb-b: var(--c1);
  --orb-opacity: .35;
  --bg-deco: none;
  --num-glow: none;
}
[data-theme="dark"] {
  --bg: #070b18;
  --bg2: #0b1124;
  --card: rgba(17, 26, 51, .72);
  --card-solid: #111a33;
  --line: rgba(120, 140, 200, .16);
  --text: #e8ecff;
  --muted: #8f9bc2;
  --track: rgba(140, 160, 220, .14);
  --shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
[data-theme="light"] {
  --bg: #f4f6fc;
  --bg2: #eaeef9;
  --card: rgba(255, 255, 255, .85);
  --card-solid: #ffffff;
  --line: rgba(30, 50, 110, .1);
  --text: #121a33;
  --muted: #5d6886;
  --track: rgba(30, 50, 110, .09);
  --shadow: 0 16px 40px rgba(30, 50, 110, .1);
  --c1: #0891b2;
  --c2: #7c3aed;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background-image: var(--bg-deco);
  background-attachment: fixed;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  transition: background .3s, color .3s;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

.bg-orb { position: fixed; border-radius: 50%; filter: blur(90px); opacity: var(--orb-opacity); pointer-events: none; z-index: 0; }
.orb-a { width: 520px; height: 520px; background: var(--orb-a); top: -200px; inset-inline-end: -160px; }
.orb-b { width: 460px; height: 460px; background: var(--orb-b); bottom: -220px; inset-inline-start: -180px; opacity: .18; }
[data-theme="light"] .bg-orb { opacity: .14; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 14px clamp(16px, 4vw, 48px);
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.3rem; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.brand-mark svg { width: 26px; height: 26px; stroke: #fff; stroke-width: 6; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav a { padding: 8px 14px; border-radius: 10px; color: var(--muted); font-size: .95rem; transition: .2s; }
.nav a:hover { color: var(--text); background: var(--track); }
.nav a.active { color: var(--text); background: var(--track); }
.actions { display: flex; gap: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; display: grid; place-items: center; font-weight: 600; font-size: .85rem; }
.icon-btn svg { width: 20px; height: 20px; }
[data-theme="dark"] .i-moon, [data-theme="light"] .i-sun { display: none; }

.announce { position: relative; z-index: 1; margin: 12px auto 0; max-width: 1100px; padding: 10px 16px; border-radius: 12px; background: color-mix(in srgb, var(--c1) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c1) 30%, transparent); text-align: center; font-size: .92rem; }
.ad-slot { position: relative; z-index: 1; max-width: 1100px; margin: 16px auto; text-align: center; overflow: hidden; }

main { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 0 16px 40px; }

/* ---------- Hero ---------- */
.hero { display: flex; flex-direction: column; align-items: center; padding-top: 28px; }
.tagline { font-size: clamp(1.3rem, 3.2vw, 2rem); font-weight: 600; text-align: center; background: linear-gradient(90deg, var(--c1), var(--c2)); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 22px; }

.metrics-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; width: 100%; max-width: 760px; }
.m { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; align-items: center; transition: border-color .3s, transform .3s; }
.m.active { border-color: color-mix(in srgb, var(--c1) 60%, transparent); transform: translateY(-2px); }
.m-label { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); }
.m-val { font-family: var(--num-font); text-shadow: var(--num-glow); font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3; }
.m small { color: var(--muted); font-size: .75rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.c { background: var(--c1); } .dot.v { background: var(--c2); } .dot.g { background: var(--ok); } .dot.y { background: var(--warn); }

.gauge-wrap { position: relative; width: min(420px, 88vw); aspect-ratio: 1; margin: 18px 0 0; }
.gauge { width: 100%; height: 100%; }
.g-track { stroke: var(--track); stroke-width: var(--gauge-w); fill: none; }
.g-value { stroke: url(#gGrad); stroke-width: var(--gauge-w); fill: none; transition: d .1s; }
.g-glow { stroke: url(#gGrad); stroke-width: var(--gauge-w); fill: none; opacity: .55; }
.g-tick { fill: var(--muted); stroke: none; font-size: 13px; font-family: var(--font); text-anchor: middle; dominant-baseline: middle; }
.g-needle { stroke: var(--text); stroke-width: 5; opacity: 0; transition: opacity .3s; transform-origin: 200px 200px; }
.g-hub { fill: var(--text); stroke: none; opacity: 0; transition: opacity .3s; }
.testing .g-needle, .testing .g-hub { opacity: .9; }

.go-btn {
  position: absolute; inset: 0; margin: auto; width: 46%; height: 46%; border-radius: 50%;
  border: none; cursor: pointer; background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--c1) 30%, var(--card-solid)), var(--card-solid));
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--c1) 70%, transparent), 0 0 60px color-mix(in srgb, var(--c1) 35%, transparent);
  transition: transform .25s;
}
.go-btn:hover { transform: scale(1.04); }
.go-btn:active { transform: scale(.97); }
.go-text { font-size: clamp(1.8rem, 6vw, 2.6rem); font-weight: 700; letter-spacing: .04em; }
.go-ring { position: absolute; inset: -10px; border-radius: 50%; border: 2px solid var(--c1); animation: pulse 2.2s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.92); opacity: .8; } 100% { transform: scale(1.25); opacity: 0; } }

.readout { position: absolute; left: 0; right: 0; top: 56%; text-align: center; transform: translateY(-20%); }
.readout-val { font-family: var(--num-font); text-shadow: var(--num-glow); font-size: clamp(2.6rem, 10vw, 3.8rem); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.readout-unit { color: var(--muted); font-size: .95rem; }
.readout-phase { margin-top: 6px; font-size: .9rem; font-weight: 500; color: var(--c1); }

.spark { width: 100%; max-width: 720px; height: 90px; margin-top: -10px; }

.conn-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; width: 100%; max-width: 900px; margin-top: 10px; }
.conn-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.conn-item svg { width: 22px; height: 22px; flex: none; color: var(--c1); }
.conn-item div { display: flex; flex-direction: column; min-width: 0; }
.conn-item small { color: var(--muted); font-size: .75rem; }
.conn-item b { font-weight: 500; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.test-error { margin-top: 16px; color: var(--bad); }

/* ---------- Cards ---------- */
.results { margin-top: 32px; display: flex; flex-direction: column; gap: 18px; animation: rise .5s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); backdrop-filter: blur(var(--card-blur)); }
.card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.grid-2 > *, .kpi-row > * { min-width: 0; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: var(--btn-radius); border: 1px solid var(--line); background: var(--card-solid); cursor: pointer; font-size: .9rem; font-weight: 500; transition: .2s; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; }
.btn:hover { border-color: color-mix(in srgb, var(--c1) 50%, transparent); }
.btn.primary { background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; border: none; }
.btn.primary:hover { filter: brightness(1.08); }

.res-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.res-head h2 { font-size: 1.35rem; }
.res-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.insight-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 18px; }
.insight { padding: 14px 16px; border-radius: 14px; background: var(--track); }
.insight b { font-size: 1.5rem; display: block; background: linear-gradient(90deg, var(--c1), var(--c2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.insight span { font-size: .88rem; color: var(--muted); }

.usage { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.u { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--track); }
.u-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--card-solid); flex: none; }
.u-ic svg { width: 20px; height: 20px; }
.u-body { flex: 1; min-width: 0; }
.u-body b { font-weight: 500; display: block; }
.u-body small { color: var(--muted); font-size: .8rem; }
.badge { padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge.great { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.badge.ok { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.badge.poor { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }

.bloat { display: flex; gap: 20px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.grade { width: 110px; height: 110px; border-radius: 28px; display: grid; place-items: center; font-size: 3rem; font-weight: 700; color: #fff; flex: none; }
.grade.A, .grade.Ap { background: linear-gradient(135deg, #10b981, #34d399); }
.grade.B { background: linear-gradient(135deg, #22c55e, #a3e635); }
.grade.C { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.grade.D { background: linear-gradient(135deg, #f97316, #fb923c); }
.grade.F { background: linear-gradient(135deg, #ef4444, #f87171); }
.lat-rows { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 10px; }
.lat-row { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; }
.lat-row .top { display: flex; justify-content: space-between; }
.bar { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--c1), var(--c2)); width: 0; transition: width 1s ease; }

.plan-form { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 12px; margin-top: 14px; align-items: end; }
.plan-form label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; color: var(--muted); }
.plan-form label.custom { grid-column: span 1; }
select, input[type=number], input[type=text], input[type=password], textarea {
  width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-solid); color: var(--text); outline: none;
}
select:focus, input:focus, textarea:focus { border-color: var(--c1); }
.plan-out { margin-top: 18px; display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.ring { width: 130px; height: 130px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .rt { stroke: var(--track); stroke-width: 12; }
.ring .rv { stroke: url(#ringGrad); stroke-width: 12; transition: stroke-dashoffset 1.2s ease; }
.ring-txt { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.7rem; font-weight: 700; }
.plan-detail { display: flex; flex-direction: column; gap: 10px; }
.plan-verdict { font-weight: 500; }

.tips { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.tips li { display: flex; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--track); font-size: .92rem; }
.tips li::before { content: ''; width: 8px; height: 8px; margin-top: 9px; border-radius: 50%; flex: none; background: var(--c1); }
.tips li.warn::before { background: var(--warn); }
.tips li.bad::before { background: var(--bad); }
.tips li.good::before { background: var(--ok); }

/* ---------- History ---------- */
.page-head { padding: 34px 0 18px; }
.page-head h1 { font-size: clamp(1.5rem, 4vw, 2rem); }
.legend { display: flex; gap: 16px; font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.hist-chart { width: 100%; height: 220px; }
.hist-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.h-item { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr) auto; gap: 12px; align-items: center; padding: 14px 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); transition: .2s; }
.h-item:hover { border-color: color-mix(in srgb, var(--c1) 50%, transparent); }
.h-item small { display: block; color: var(--muted); font-size: .75rem; }
.h-item b { font-weight: 600; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.about-grid .card p { color: var(--muted); font-size: .93rem; margin-top: 6px; }

.footer { position: relative; z-index: 1; text-align: center; padding: 26px 16px 34px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--card-solid); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 10px 18px; border-radius: 12px; z-index: 100; font-size: .9rem; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .conn-bar { grid-template-columns: repeat(2, 1fr); }
  .plan-form { grid-template-columns: 1fr 1fr; }
  .plan-form .btn { grid-column: 1 / -1; justify-content: center; }
}
@media (max-width: 600px) {
  .topbar { gap: 10px; flex-wrap: wrap; }
  .nav { order: 3; width: 100%; justify-content: space-around; margin: 0; }
  .actions { margin-inline-start: auto; }
  .metrics-strip { grid-template-columns: repeat(2, 1fr); }
  .m-val { font-size: 1.35rem; }
  .plan-form { grid-template-columns: 1fr; }
  .plan-out { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .h-item { grid-template-columns: 1fr 1fr 1fr; }
  .h-item .h-when { grid-column: 1 / -1; }
  .h-item .h-go { display: none; }
  .res-acts .btn { flex: 1 1 auto; justify-content: center; }
  .card { padding: 18px; }
}

/* ================= Phase 2 ================= */
.acct-btn { width: auto; padding: 0 12px; gap: 6px; display: inline-flex; align-items: center; }
.acct-btn svg { width: 18px; height: 18px; }
.acct-btn span { font-size: .85rem; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-btn.active { border-color: color-mix(in srgb, var(--c1) 55%, transparent); }
.srv { position: relative; }
.srv select { position: absolute; inset: -12px -14px; opacity: 0; cursor: pointer; width: auto; }
.srv:has(select:not([hidden])) b::after { content: ' ▾'; color: var(--muted); }

.note { padding: 10px 14px; border-radius: 12px; background: var(--track); font-size: .88rem; color: var(--muted); }
.note a { color: var(--c1); }
.link { color: var(--c1); cursor: pointer; font-size: .88rem; text-align: center; }
.btn.danger { color: var(--bad); }
.err.ok { color: var(--ok); }
.err { color: var(--bad); font-size: .9rem; }

/* map */
.map-card { padding: 14px; }
.map-wrap { position: relative; }
#worldMap { width: 100%; height: auto; display: block; }
#worldMap .sphere { fill: color-mix(in srgb, var(--c1) 4%, transparent); stroke: var(--line); }
#worldMap .cty { stroke: var(--bg); stroke-width: .5; transition: opacity .15s; cursor: pointer; }
#worldMap .cty:hover { opacity: .75; }
.cty.nodata, .lg i.nodata { fill: var(--track); background: var(--track); }
.cty.nodata { cursor: default; }
.cty.b0, .lg i.b0 { fill: #f87171; background: #f87171; }
.cty.b1, .lg i.b1 { fill: #fb923c; background: #fb923c; }
.cty.b2, .lg i.b2 { fill: #facc15; background: #facc15; }
.cty.b3, .lg i.b3 { fill: #4ade80; background: #4ade80; }
.cty.b4, .lg i.b4 { fill: #22d3ee; background: #22d3ee; }
.cty.b5, .lg i.b5 { fill: #a855f7; background: #a855f7; }
.map-tip { position: absolute; pointer-events: none; background: var(--card-solid); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 10px; padding: 8px 12px; font-size: .82rem; display: flex; flex-direction: column; gap: 2px; z-index: 5; white-space: nowrap; }
[dir=rtl] .map-tip { transform: translateX(-100%) translateX(-24px); }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .8rem; color: var(--muted); margin-top: 10px; padding: 0 6px; }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }

.card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.card-top select { width: auto; min-width: 200px; }
.tbl-scroll { overflow-x: auto; }
table.rank { width: 100%; border-collapse: collapse; font-size: .92rem; }
.rank th { text-align: start; color: var(--muted); font-weight: 500; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rank td { padding: 11px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rank tr:last-child td { border-bottom: none; }
.rank td.rk { color: var(--muted); width: 36px; }
.rank a:hover { color: var(--c1); }
.rank small { color: var(--muted); }
.rank .empty { padding: 30px; }

/* country page */
.country-head .back { color: var(--muted); font-size: .9rem; }
.country-head h1 { margin-top: 6px; }
#cBody { display: flex; flex-direction: column; gap: 18px; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
/* Phones: two boxes per row instead of one tall column. */
@media (max-width: 400px) { .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .kpi-c { padding: 12px 13px; } .kpi-c b { font-size: 1.5rem; } }
#cBody .kpi-row { margin-bottom: 0; }
.kpi-c { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; }
.kpi-c small { color: var(--muted); font-size: .8rem; }
.kpi-c b { font-size: 1.8rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3; }
.kpi-c span { color: var(--muted); font-size: .78rem; }
.kpi-c.c b { color: var(--c1); } .kpi-c.v b { color: var(--c2); } .kpi-c.g b { color: var(--ok); } .kpi-c.y b { color: var(--warn); }
.isp-rank { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.ir { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; background: var(--track); }
.ir-pos { width: 36px; text-align: center; font-size: 1.3rem; font-weight: 600; color: var(--muted); flex: none; }
.ir-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ir-top { display: flex; justify-content: space-between; gap: 10px; }
.ir-metrics { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .84rem; color: var(--muted); }
.ir-metrics b { color: var(--text); font-weight: 600; }
.pr { padding: 1px 8px; border-radius: 99px; font-size: .76rem; }
.pr.good { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.pr.mid { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.pr.low { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.dev-split { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .85rem; color: var(--muted); margin-top: 8px; }
.dev-split b { color: var(--text); }
.cta { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: linear-gradient(135deg, color-mix(in srgb, var(--c1) 14%, var(--card)), color-mix(in srgb, var(--c2) 14%, var(--card))); }
.empty .btn { margin-top: 14px; }

/* account */
#view-account { padding-top: 10px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; color: var(--muted); }
.form .two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.form .two > *, .form .two input { min-width: 0; }
.form input[type="date"] { width: 100%; box-sizing: border-box; }
.form .btn { justify-content: center; }
.col { display: flex; flex-direction: column; gap: 18px; }
input[type=email] { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-solid); color: var(--text); outline: none; }
input[type=email]:focus { border-color: var(--c1); }
.auth-wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: 40px 0; }
.auth-wrap.single { grid-template-columns: minmax(0, 420px); justify-content: center; }
.auth-side h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.3; background: linear-gradient(90deg, var(--c1), var(--c2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.perks { list-style: none; margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.perks li { display: flex; gap: 10px; align-items: center; }
.perks li::before { content: '✓'; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); font-weight: 700; font-size: .85rem; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--track); border-radius: 12px; padding: 4px; }
.seg button { border: none; background: none; padding: 8px; border-radius: 9px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--card-solid); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.12); }

@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; gap: 24px; padding: 20px 0; }
}
@media (max-width: 600px) {
  .acct-btn span { display: none; }
  .acct-btn { width: 40px; padding: 0; justify-content: center; }
  .nav a { padding: 8px 8px; font-size: .88rem; }
  .ir { padding: 12px 10px; gap: 10px; }
  .ir-pos { width: 26px; font-size: 1.1rem; }
  .kpi-c b { font-size: 1.4rem; }
}

/* ================= Phase 3 ================= */
.foot-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.foot-links a:hover { color: var(--c1); }
.mon-ctrl { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.mon-ctrl label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; color: var(--muted); }
.mon-ctrl select { width: auto; min-width: 140px; }
.mon-status { flex: 1 1 220px; color: var(--c1); font-weight: 500; font-variant-numeric: tabular-nums; }
#view-monitor .note { margin: 14px 0; }
#view-monitor #monChartCard { margin-bottom: 4px; }
.err-item { opacity: .7; }
.sub-h { margin-top: 10px; }
.form label.chk { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.rep-list { display: flex; flex-direction: column; gap: 6px; }
.rep { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--track); font-size: .88rem; }
.rep a { flex: 1; color: var(--c1); }
.rep .btn { padding: 2px 8px; }
input[type=date] { width: 100%; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-solid); color: var(--text); }
textarea { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-solid); color: var(--text); font-family: ui-monospace, monospace; font-size: .8rem; resize: vertical; }
.wg-prev { display: grid; place-items: center; min-height: 480px; background: repeating-linear-gradient(45deg, var(--track) 0 10px, transparent 10px 20px), var(--card); }
.wg-prev iframe { border: 0; border-radius: 16px; max-width: 100%; box-shadow: var(--shadow); }
.api-doc { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.ep { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--track); font-size: .9rem; }
.ep code { font-family: ui-monospace, monospace; color: var(--c1); direction: ltr; }
.api-doc pre { background: var(--card-solid); border: 1px solid var(--line); border-radius: 12px; padding: 14px; overflow-x: auto; font-size: .8rem; text-align: left; }
.u-note { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 6px; }
.chip { font-size: .72rem; padding: 3px 9px; border-radius: 9px; line-height: 1.5; background: var(--card-solid); color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.y { color: var(--ok); }
.chip.n { color: var(--bad); }
.chip em { font-style: normal; color: var(--muted); }
.readout-again { margin-top: 2px; padding: 7px 18px; border: 0; border-radius: var(--btn-radius); background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; box-shadow: 0 8px 24px color-mix(in srgb, var(--c1) 35%, transparent); }
.readout-again:hover { filter: brightness(1.08); }
.loss-row { padding-top: 8px; border-top: 1px dashed var(--line); }
.loss-row b.good { color: var(--ok); } .loss-row b.mid { color: var(--warn); } .loss-row b.bad { color: var(--bad); }
.lang-wrap { position: relative; }
.lang-menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 60; min-width: 170px; max-height: 60vh; overflow-y: auto; background: var(--card-solid); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; }
.lang-menu button { text-align: start; padding: 9px 12px; border: 0; background: none; border-radius: 9px; cursor: pointer; font-size: .92rem; color: var(--text); }
.lang-menu button:hover { background: var(--track); }
.lang-menu button.on { background: color-mix(in srgb, var(--c1) 14%, transparent); color: var(--c1); font-weight: 600; }

/* ---------- privacy / terms / contact / 404 ---------- */
.foot-legal { font-size: .8rem; opacity: .85; }
.doc { max-width: 820px; margin: 30px auto 10px; padding: 30px clamp(18px, 4vw, 40px); line-height: 1.85; }
.doc h1 { font-size: clamp(1.5rem, 4vw, 2rem); margin-bottom: 4px; }
.doc h2 { font-size: 1.15rem; margin: 26px 0 8px; }
.doc h3 { font-size: 1rem; margin: 18px 0 6px; }
.doc p { margin: 8px 0; }
.doc ul { margin: 8px 0; padding-inline-start: 22px; }
.doc li { margin: 4px 0; }
.doc a { color: var(--c1); text-decoration: underline; text-underline-offset: 3px; }
.contact-form { position: relative; max-width: 680px; display: grid; gap: 14px; margin-bottom: 20px; }
.contact-form label { display: grid; gap: 6px; font-size: .9rem; color: var(--muted); }
.contact-form input, .contact-form textarea { font: inherit; color: var(--text); background: var(--bg2, rgba(127,127,127,.06)); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; width: 100%; }
.contact-form textarea { resize: vertical; min-height: 130px; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--c1); outline-offset: 1px; }
.contact-form .ct-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-form .hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
.contact-form .btn { justify-self: start; }
.ct-msg { padding: 10px 14px; border-radius: 10px; font-size: .92rem; background: rgba(52, 211, 153, .12); color: #34d399; }
.ct-msg.err { background: rgba(248, 113, 113, .12); color: #f87171; }
.ct-direct a { color: var(--c1); }
.nf { text-align: center; padding: 70px 0 50px; display: grid; justify-items: center; gap: 12px; }
.nf-code { font-size: clamp(4rem, 14vw, 7rem); font-weight: 700; line-height: 1; background: linear-gradient(90deg, var(--c1), var(--c2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (max-width: 600px) { .contact-form .ct-row { grid-template-columns: 1fr; } }
.doc h1 + p { color: var(--muted); font-size: .85rem; margin: 0 0 18px; }

/* ---------- loading skeletons (templates #sk-* in index.html) ---------- */
.sk { display: block; height: 12px; border-radius: 8px; max-width: 100%; background: var(--track); position: relative; overflow: hidden; margin: 6px 0; }
.sk::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .14), transparent); animation: sk-shine 1.4s ease-in-out infinite; }
[data-theme="light"] .sk::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent); }
[dir="rtl"] .sk::after { animation-name: sk-shine-rtl; }
@keyframes sk-shine { to { transform: translateX(100%); } }
@keyframes sk-shine-rtl { from { transform: translateX(100%); } to { transform: translateX(-100%); } }
.sk-h1 { height: 30px; border-radius: 10px; margin: 4px 0 10px; }
.sk-p { height: 15px; }
.sk-t { height: 16px; }
.sk-x { height: 11px; }
.sk-n { height: 28px; margin: 8px 0; }
.sk-pill { height: 42px; border-radius: 14px; margin-top: 14px; }
.sk-field { height: 44px; border-radius: 12px; margin: 4px 0 10px; }
.sk-btn { height: 42px; border-radius: 12px; margin-top: 12px; }
.sk-bar { height: 8px; border-radius: 99px; }
.sk-chart { height: 150px; border-radius: 12px; margin-top: 14px; }
.sk-c { border-radius: 50%; aspect-ratio: 1; height: auto; margin: 0; }
.sk-sq { height: 26px; border-radius: 8px; flex: none; margin: 0; }
.sk-ic { flex: none; }
.sk-fill { flex: 1; width: 100%; min-width: 0; }
@media (max-width: 600px) { .sk-hero .sk-fill .sk { margin-inline: auto; } }
.sk-card { border-top-color: var(--track) !important; pointer-events: none; }
.sk-hero { background: var(--card) !important; border-color: var(--line) !important; }
.sk-rep { pointer-events: none; }
.sk-hitem { pointer-events: none; }
.sk-perks li::before { display: none; }
.st-tools .sk-field { margin: 0; }
#worldMap:empty { background: var(--track); border-radius: 14px; animation: sk-pulse 1.4s ease-in-out infinite; }
@keyframes sk-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .sk::after, #worldMap:empty { animation: none; } }

.rep-range { white-space: nowrap; }
.rep > :not(a) { white-space: nowrap; }
.rep a { min-width: 0; }

/* Send button under the gauge once a result is shown. Neutral class names: ad blockers hide "share" buttons. */
.res-send { display: flex; align-items: center; gap: 8px; margin: 10px auto 0; padding: 10px 22px; border-radius: 99px; font-weight: 600; }
.res-send[hidden] { display: none; }
.res-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Uploaded identity (Admin → Settings). */
.brand-mark.has-img { background: none; overflow: hidden; }
.brand-mark.has-img img { width: 100%; height: 100%; object-fit: contain; }
.brand-logo { height: 38px; width: auto; max-width: 200px; object-fit: contain; display: block; }

/* Headings of views the server sent hidden (only the open view keeps its <h1>). */
h2.vh1 { font-size: 2em; }
.page-head h2.vh1, .doc h2.vh1 { font-size: clamp(1.5rem, 4vw, 2rem); }
.country-head h2.vh1 { margin-top: 6px; }

/* Server-rendered content (before the page script redraws it). */
h2.h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.st-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.st-links a { color: var(--c1); }
/* Account: e-mail not confirmed yet */
.verify-note { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; margin-bottom: 18px; border-color: color-mix(in srgb, var(--warn, #f59e0b) 45%, var(--line)); background: color-mix(in srgb, var(--warn, #f59e0b) 10%, var(--card)); }
.verify-note p { flex: 1 1 260px; line-height: 1.7; }

/* NetSpeedCheck logo picture in the header: white text on the dark theme, dark text on the light one. */
.brand .brand-logo { height: 34px; width: auto; max-width: none; }
[data-theme="dark"] .brand .logo-on-light, [data-theme="light"] .brand .logo-on-dark { display: none; }
.brand .brand-icon { display: none; width: 38px; height: 38px; }
.topbar.compact .brand .brand-logo { display: none; }
.topbar.compact .brand .brand-icon { display: block; }
