/* SpeedVerdict — design tokens */
:root {
  --bg: #080B1A;
  --bg-2: #0C1024;
  --surface: #11162E;
  --surface-2: #161C38;
  --surface-3: #1C2344;
  --line: #232B4D;
  --line-2: #323B63;
  --text: #EDF0F9;
  --muted: #A9B1CB;
  --faint: #838CA9;
  --brand: #8B5CF6;
  --brand-2: #7C4DEE;
  --cyan: #22D3EE;
  --indigo: #818CF8;
  --violet: #C084FC;
  --pink: #F472B6;
  --orange: #FB923C;
  --yellow: #FACC15;
  --lime: #A3E635;
  --green: #34D399;
  --red: #FB7185;
  --grad: linear-gradient(100deg, #22D3EE 0%, #818CF8 35%, #C084FC 60%, #F472B6 85%, #FB923C 100%);
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 50px rgba(2, 4, 14, .45);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: #A5B4FC; text-underline-offset: 3px; }
a:hover { color: #C7D2FE; }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -0.02em; margin: 0; font-weight: 600; }
h2 { font-size: clamp(26px, 3.2vw, 34px); line-height: 1.15; }
h3 { font-size: 18px; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ic-lg { width: 36px; height: 36px; stroke-width: 1.4; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--violet); margin-bottom: 10px; }
.accent { color: var(--violet); }
.label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.hint, .footnote { font-size: 13px; color: var(--faint); }
.status { font-size: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.panel-title { font-family: var(--display); font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; }

/* Background: one quiet glow behind the hero */
.bg { position: absolute; inset: 0 0 auto 0; height: 900px; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 50% at 75% 20%, rgba(139, 92, 246, .16), transparent 70%), radial-gradient(40% 40% at 15% 10%, rgba(34, 211, 238, .10), transparent 70%); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 1000; background: rgba(8, 11, 26, .82); backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.logo { width: 32px; height: 32px; flex: none; transition: transform .4s var(--spring); }
.brand:hover .logo { transform: rotate(-6deg) scale(1.06); }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.main-nav { display: flex; gap: 2px; font-size: 15px; }
.main-nav a { color: var(--muted); text-decoration: none; padding: 8px 14px; border-radius: 8px; transition: color .2s, background .2s; }
.main-nav a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: background .2s, border-color .2s, transform .2s var(--ease), box-shadow .2s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 20px rgba(139, 92, 246, .3); }
.btn-primary:hover { background: var(--brand-2); color: #fff; box-shadow: 0 8px 26px rgba(139, 92, 246, .42); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--line-2); }
.btn-secondary:hover { background: var(--surface-3); color: var(--text); border-color: #45507D; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; }
.link-arrow .ic { transition: transform .2s var(--ease); }
.link-arrow:hover .ic { transform: translateX(3px); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: all .2s var(--ease); }
.chip:hover:not(:disabled) { color: var(--text); border-color: #45507D; }
.chip[aria-pressed="true"] { background: rgba(139, 92, 246, .18); color: #fff; border-color: var(--brand); }
.chip:disabled { cursor: default; opacity: .7; }

/* Ad slots collapse until an ad unit is placed inside */
.ad-slot { margin: 8px auto 0; max-width: 728px; }
.ad-slot:empty { display: none; }

/* ---------- Hero + test ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr); gap: 48px; padding-top: 56px; padding-bottom: 64px; align-items: start; }
.hero-copy { display: flex; flex-direction: column; gap: 22px; padding-top: 12px; }
.hero h1 { font-size: clamp(34px, 4.6vw, 52px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 700; }
.lead { font-size: 18px; color: var(--muted); max-width: 520px; }
.trust { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.trust li { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 15px; }
.trust .ic { color: var(--green); width: 20px; height: 20px; }
.conn-panel { padding: 16px 18px; }
.kv { margin: 12px 0 0; display: grid; gap: 10px; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.kv dt { color: var(--faint); display: flex; align-items: center; gap: 8px; }
.kv dd { margin: 0; font-weight: 600; text-align: right; }
.metrics-panel { padding: 0 18px; }
.metrics-panel summary { list-style: none; display: flex; justify-content: space-between; align-items: center; cursor: pointer; min-height: 52px; }
.metrics-panel summary::-webkit-details-marker { display: none; }
.chev { transition: transform .25s var(--ease); color: var(--faint); }
details[open] > summary .chev { transform: rotate(180deg); }
.glossary { margin: 0 0 16px; display: grid; gap: 2px; font-size: 14px; }
.glossary dt { font-weight: 600; margin-top: 8px; }
.glossary dd { margin: 0; color: var(--muted); }

.test-card { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 24px 28px 28px; display: flex; flex-direction: column; align-items: center; gap: 18px; min-width: 0; }
.card-top { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.mode-tabs { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.mode-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 18px; border-radius: 9px; border: none; background: transparent; color: var(--muted); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: all .25s var(--ease); }
.mode-tab:hover:not(:disabled) { color: var(--text); }
.mode-tab[aria-selected="true"] { background: var(--surface-3); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 4px 14px rgba(0, 0, 0, .35); }
.mode-tab[aria-selected="true"] .ic { color: var(--violet); }
.mode-tab:disabled { cursor: not-allowed; }
.mode-tab:disabled:not([aria-selected="true"]) { opacity: .4; }
.mode-desc { text-align: center; max-width: 480px; font-size: 14px; color: var(--muted); min-height: 42px; }

/* Gauge: smooth gradient arc */
.gauge { --tier: #818CF8; position: relative; width: min(420px, 100%); }
.gauge::before { content: ""; position: absolute; left: 50%; top: 52.8%; width: 62%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, var(--tier) 0%, transparent 70%); opacity: .14; transition: background 1s var(--ease), opacity .8s var(--ease); pointer-events: none; }
.test-card[data-state="running"] .gauge::before { opacity: .26; }
.gauge svg { width: 100%; display: block; overflow: visible; position: relative; }
.g-track, .g-fill { fill: none; stroke-width: 18; stroke-linecap: round; }
.g-track { stroke: rgba(148, 163, 214, .1); }

.g-tick { stroke: rgba(169, 177, 203, .35); stroke-width: 1.6; stroke-linecap: round; }
.g-label { fill: var(--faint); font-family: var(--mono); font-size: 11.5px; }
/* bright tip with a soft coloured halo (a translucent stroke, no costly filters) */
.g-head { fill: #fff; stroke: var(--c); stroke-width: 10; stroke-opacity: .35; paint-order: stroke; opacity: 0; transition: opacity .4s var(--ease); }
/* live heartbeat graph inside the dial */
.g-trace { fill: none; stroke: #22D3EE; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: stroke .4s; }
.g-trace-area { fill: url(#traceGrad); }
.tg1 { stop-color: #22D3EE; stop-opacity: .32; }
.tg2 { stop-color: #22D3EE; stop-opacity: 0; }
.gauge[data-trace="up"] .g-trace { stroke: #C084FC; }
.gauge[data-trace="up"] .tg1, .gauge[data-trace="up"] .tg2 { stop-color: #C084FC; }
.g-readout { position: absolute; left: 50%; top: 52.8%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; transition: opacity .5s var(--ease), transform .6s var(--ease); }
.g-value { font-family: var(--display); font-weight: 700; font-size: clamp(54px, 10.5vw, 80px); line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: #fff; }
.g-unit { color: var(--muted); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; margin-top: 6px; }
.g-mood { position: absolute; left: 50%; bottom: 3%; transform: translateX(-50%); white-space: nowrap; padding: 6px 14px; border-radius: 999px; background: color-mix(in srgb, var(--tier) 12%, transparent); border: 1px solid color-mix(in srgb, var(--tier) 35%, transparent); font-weight: 600; font-size: 14px; color: color-mix(in srgb, var(--tier) 65%, #fff); transition: color .8s var(--ease), background .8s var(--ease), border-color .8s var(--ease); }
.go { position: absolute; left: 50%; top: 52.8%; transform: translate(-50%, -50%); width: 40%; aspect-ratio: 1; border-radius: 50%; border: none; cursor: pointer; background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .35), transparent 50%), linear-gradient(135deg, #22D3EE, #8B5CF6 55%, #F472B6); color: #fff; font-family: var(--display); font-weight: 700; font-size: clamp(28px, 5.5vw, 40px); letter-spacing: .06em; text-shadow: 0 2px 10px rgba(30, 10, 80, .35); box-shadow: 0 0 0 0 rgba(139, 92, 246, .5), 0 16px 40px rgba(91, 75, 214, .45); animation: pulse 2.6s ease-out infinite; transition: transform .35s var(--spring), opacity .3s var(--ease); }
.test-card[data-mode="stress"] .go { font-size: clamp(17px, 3.4vw, 24px); background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .35), transparent 50%), linear-gradient(135deg, #F472B6, #FB923C 60%, #FACC15); }
.go:hover { transform: translate(-50%, -50%) scale(1.05); }
.go:active { transform: translate(-50%, -50%) scale(.97); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, .45), 0 16px 40px rgba(91, 75, 214, .45); } 70% { box-shadow: 0 0 0 22px rgba(139, 92, 246, 0), 0 16px 40px rgba(91, 75, 214, .45); } 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0), 0 16px 40px rgba(91, 75, 214, .45); } }
.test-card[data-state="idle"] .g-readout { opacity: 0; transform: translate(-50%, -42%) scale(.92); }
.test-card:not([data-state="idle"]) .go { opacity: 0; transform: translate(-50%, -50%) scale(.4); pointer-events: none; }

/* Connection details under the dial (Speedtest-style rows) */
.mono { font-family: var(--mono); }
.cc { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; margin: 2px auto 0; }
.cc-item { display: flex; align-items: center; gap: 16px; min-width: 0; }
.cc-ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-2); color: var(--muted); flex: none; }
.cc-ic .ic { width: 22px; height: 22px; stroke-width: 1.6; }
.cc-text { min-width: 0; }
.cc-main { font-size: 18px; font-weight: 500; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-sub { font-size: 15px; color: var(--muted); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; counter-reset: step; }
.steps li { counter-increment: step; display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 5px 12px 5px 6px; border-radius: 999px; color: var(--faint); background: var(--bg); border: 1px solid var(--line); transition: all .35s var(--ease); }
.steps li::before { content: counter(step); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--muted); }
.steps li.active { color: var(--text); border-color: var(--brand); }
.steps li.active::before { background: var(--brand); color: #fff; animation: breathe 1.2s ease-in-out infinite; }
.steps li.done { color: var(--muted); }
.steps li.done::before { content: "✓"; background: rgba(52, 211, 153, .2); color: var(--green); }
@keyframes breathe { 50% { box-shadow: 0 0 0 5px rgba(139, 92, 246, .25); } }
.test-card[data-state="idle"] .steps { opacity: .7; }

/* Stats */
.stats { width: 100%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
#stats-stress { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { position: relative; overflow: hidden; background: var(--bg); border-radius: 12px; padding: 12px 14px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; transition: border-color .3s, background .3s; }
.stat .l { color: var(--faint); font-size: 12.5px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.stat .l .ic { width: 15px; height: 15px; }
.stat .val { font-family: var(--mono); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 5px; }
.stat .val small { font-size: 11px; color: var(--faint); font-weight: 500; }
.stat .sub { font-size: 12px; color: var(--muted); }
.stat.active { border-color: var(--brand); background: rgba(139, 92, 246, .07); }
.stat.active::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 40%; background: var(--grad); animation: scan 1.1s linear infinite; }
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.stat.good .v { color: var(--green); }
.stat.warn .v { color: var(--yellow); }
.stat.bad .v { color: var(--red); }
.stat.good { border-color: rgba(52, 211, 153, .35); }
.stat.warn { border-color: rgba(250, 204, 21, .35); }
.stat.bad { border-color: rgba(251, 113, 133, .4); }

/* Stress chart */
.chart-wrap { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
#chart { width: 100%; height: 160px; display: block; }
.chart-legend { list-style: none; margin: 6px 0 0; padding: 0; display: flex; gap: 16px; justify-content: center; font-size: 12.5px; color: var(--muted); }
.chart-legend li, .calc-legend li, .map-legend li { display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }

/* Result */
.result { width: 100%; display: flex; flex-direction: column; gap: 18px; padding-top: 6px; border-top: 1px solid var(--line); animation: rise .6s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.verdict { display: flex; align-items: center; gap: 14px; padding-top: 14px; }
.verdict-title { font-family: var(--display); font-weight: 700; font-size: 22px; }
.verdict-sub { color: var(--muted); font-size: 14px; }
.goodfor { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.gf { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; font-size: 14px; animation: rise .45s var(--ease) both; }
.gf.ok { background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .35); color: #C9F5E3; }
.gf.ok::before { content: "✓"; color: var(--green); font-weight: 700; }
.gf.no { color: var(--faint); border: 1px solid var(--line); }
.gf.no::before { content: "–"; }
/* Plan vs reality + diagnosis */
.plan-check { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.plan-check label { font-weight: 600; }
.plan-row { display: flex; align-items: center; gap: 10px; }
.plan-row input { width: 160px; min-height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: inherit; font-size: 16px; }
.plan-row input:focus { outline: none; border-color: var(--brand); }
.plan-row span { color: var(--muted); }
.plan-out { display: flex; flex-direction: column; gap: 6px; }
.plan-bar { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.plan-bar span { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .6s var(--ease); }
.plan-out.warn .plan-bar span { background: var(--yellow); }
.plan-out.bad .plan-bar span { background: var(--red); }
.plan-out p { font-size: 14px; }
.diag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.diag-item { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 12px 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); border-left: 3px solid var(--indigo); font-size: 14px; }
.diag-item strong { font-size: 14.5px; }
.diag-item span { color: var(--muted); }
.diag-item.ok { border-left-color: var(--green); }
.diag-item.warn { border-left-color: var(--yellow); }
.diag-item.bad { border-left-color: var(--red); }

.net-card { border-radius: 14px; padding: 16px 18px; background: var(--bg); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; transition: border-color .3s, background .3s; }
.net-card.saved { border-color: rgba(52, 211, 153, .45); }
.net-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: center; }
.consent { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; cursor: pointer; }
.consent input { width: 18px; height: 18px; accent-color: var(--brand); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.error { color: var(--red); text-align: center; }

/* ---------- Tools band ---------- */
.tools-band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-2); }
.tools { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tool { display: flex; flex-direction: column; gap: 6px; padding: 28px 24px; color: var(--text); text-decoration: none; border-right: 1px solid var(--line); transition: background .25s; }
.tool:last-child { border-right: none; }
.tool:hover { background: var(--surface); color: var(--text); }
.tool-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(139, 92, 246, .14); color: var(--violet); margin-bottom: 8px; }
.tool-ic .ic { width: 20px; height: 20px; }
.tool-name { font-family: var(--display); font-weight: 600; font-size: 17px; }
.tool-desc { color: var(--muted); font-size: 14px; }

/* ---------- Sections ---------- */
.section { padding-top: 88px; padding-bottom: 88px; display: flex; flex-direction: column; gap: 28px; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.section-head p { margin-top: 10px; max-width: 640px; color: var(--muted); }
.band { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* Tool pages */
.page-section { padding-top: 56px; }
.page-title { font-size: clamp(30px, 4.2vw, 46px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 700; }
.main-nav a[aria-current="page"] { color: var(--text); background: rgba(139, 92, 246, .16); }
.tool[aria-current="page"] { background: var(--surface); box-shadow: inset 0 -2px 0 var(--brand); }

/* Streaming */
.range-panel { padding: 20px 22px 14px; display: flex; flex-direction: column; gap: 12px; }
.range-label { font-size: 14px; color: var(--muted); }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 999px; background: var(--grad); cursor: pointer; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 4px solid var(--brand); box-shadow: 0 4px 12px rgba(0, 0, 0, .4); transition: transform .2s var(--spring); }
.range::-webkit-slider-thumb:hover { transform: scale(1.12); }
.range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid var(--brand); }
.range-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); font-family: var(--mono); }
.stream-headline { font-family: var(--display); font-size: clamp(19px, 2.3vw, 23px); font-weight: 600; min-height: 1.4em; }
.q-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.q-tile { border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); opacity: .55; transition: all .45s var(--ease); }
.q-tile.ok { opacity: 1; border-color: rgba(139, 92, 246, .5); background: linear-gradient(180deg, rgba(139, 92, 246, .12), var(--surface)); }
.q-badge { align-self: flex-start; font-family: var(--mono); font-weight: 700; font-size: 13px; padding: 4px 8px; border-radius: 6px; background: var(--surface-3); color: var(--muted); margin-bottom: 8px; transition: all .4s; }
.q-tile.ok .q-badge { background: var(--brand); color: #fff; }
.q-label { font-family: var(--display); font-weight: 600; font-size: 17px; }
.q-need { font-size: 13px; color: var(--faint); }
.q-count { font-size: 14px; font-weight: 600; margin-top: 8px; color: var(--faint); }
.q-tile.ok .q-count { color: var(--green); }

/* Streaming preview screen */
.stream-preview { width: 100%; max-width: 900px; margin: 0 auto; }
.pv-screen { position: relative; border-radius: 18px; overflow: hidden; background: #05070F; border: 1px solid var(--line-2); box-shadow: 0 0 0 6px var(--surface), 0 0 0 7px var(--line), 0 30px 80px rgba(2, 4, 14, .6), 0 0 60px rgba(139, 92, 246, .18); }
.pv-canvas { display: block; width: 100%; aspect-ratio: 16 / 9; }
.pv-badge { position: absolute; top: 14px; left: 14px; font-family: var(--mono); font-weight: 700; font-size: 14px; padding: 5px 10px; border-radius: 8px; background: rgba(8, 11, 26, .72); color: #fff; border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(6px); }
.pv-badge.hd { background: linear-gradient(135deg, rgba(139, 92, 246, .9), rgba(244, 114, 182, .9)); border-color: transparent; }
.pv-live { position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; background: rgba(8, 11, 26, .6); color: #fff; }
.pv-live i { width: 7px; height: 7px; border-radius: 50%; background: #FB7185; box-shadow: 0 0 8px #FB7185; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }
.pv-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 18px 14px; font-size: 14px; font-weight: 600; color: #fff; background: linear-gradient(180deg, transparent, rgba(5, 7, 15, .75)); }
.pv-buffer { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #fff; font-weight: 600; text-align: center; padding: 0 20px; }
.pv-spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .2); border-top-color: #fff; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.q-hint { text-align: center; margin-top: -8px; }
button.q-tile { font: inherit; color: inherit; text-align: left; cursor: pointer; }
.q-tile[aria-pressed="true"] { outline: 2px solid var(--violet); outline-offset: 2px; opacity: 1; }
.q-tile:not(.ok)[aria-pressed="true"] { outline-color: var(--red); }

/* Calculator */
.calc { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.calc-inputs { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.calc-output { padding: 24px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 88px; }
.people-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.calc-activities { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.activity { --c: var(--violet); display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); transition: border-color .25s, background .25s; }
.activity:has(.stepper.on) { border-color: color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 7%, var(--bg)); }
.act-emoji { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-size: 18px; background: color-mix(in srgb, var(--c) 14%, transparent); flex: none; }
.act-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.act-name { font-weight: 600; font-size: 14.5px; }
.act-note { font-size: 12px; color: var(--faint); }
.stepper { display: flex; align-items: center; gap: 2px; flex: none; }
.stepper button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font-size: 17px; line-height: 1; cursor: pointer; transition: all .15s; }
.stepper button:hover:not(:disabled) { background: var(--brand); border-color: var(--brand); }
.stepper button:disabled { opacity: .3; cursor: default; }
.stepper output { min-width: 28px; text-align: center; font-family: var(--mono); font-weight: 700; font-size: 16px; }
.stepper output.bump { animation: bump .3s var(--spring); }
@keyframes bump { 50% { transform: scale(1.35); color: var(--violet); } }
.calc-big { display: flex; align-items: center; gap: 16px; }
.calc-emoji { font-size: 44px; }
.calc-emoji.pop { animation: pop .6s var(--spring); }
.calc-big .label { margin-bottom: 2px; }
.calc-num { font-family: var(--mono); font-weight: 700; font-size: 44px; line-height: 1.05; }
.calc-num small { font-family: var(--body); font-size: 14px; color: var(--muted); font-weight: 500; }
.calc-num-sub { color: var(--muted); font-size: 14px; }
.calc-num-sub span { font-family: var(--mono); color: var(--text); font-weight: 700; }
.plan { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan > div { padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); display: flex; flex-direction: column; }
.plan .label { margin-bottom: 2px; }
.plan strong { font-family: var(--display); font-size: 21px; }
.calc-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--bg); }
.calc-bar span { flex-basis: 0; min-width: 4px; transition: flex-grow .6s var(--ease); }
.calc-legend, .calc-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.lg-name { flex: 1; }
.lg-val { font-family: var(--mono); color: var(--muted); font-size: 12.5px; }
.calc-notes { color: var(--muted); gap: 8px; }
.calc-notes li { padding-left: 16px; position: relative; }
.calc-notes li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--violet); }
.calc-compare { border-radius: 12px; padding: 14px 16px; background: var(--bg); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.calc-compare a { font-weight: 600; }
.calc-compare.good { border-color: rgba(52, 211, 153, .45); }
.calc-compare.warn { border-color: rgba(250, 204, 21, .45); }
.calc-compare.bad { border-color: rgba(251, 113, 133, .5); }

/* Map */
.map-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.select select { min-height: 38px; padding: 0 36px 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; max-width: 280px; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; }
.map-frame { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.map { height: 500px; width: 100%; background: #0B1024; }
.map-section.loading .map { opacity: .6; transition: opacity .3s; }
.leaflet-tile-pane { filter: invert(1) hue-rotate(200deg) brightness(.82) contrast(.92) saturate(.5); }
.leaflet-container { font-family: var(--body); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 12px; }
.leaflet-popup-content { margin: 14px 16px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-control-attribution { background: rgba(8, 11, 26, .78) !important; color: var(--faint); }
.leaflet-control-attribution a { color: var(--muted); }
.leaflet-bar a { background: var(--surface-2); color: var(--text); border-color: var(--line-2); }
.leaflet-tooltip { background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); }
.pm-title { font-family: var(--display); font-weight: 600; font-size: 16px; }
.pm-sub { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.pm ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pm li { display: grid; grid-template-columns: 22px 1fr; column-gap: 6px; font-size: 13px; }
.pm-rank { font-family: var(--mono); color: var(--faint); }
.pm-isp { font-weight: 600; color: var(--c); }
.pm-num { grid-column: 2; font-family: var(--mono); }
.pm-n { grid-column: 2; color: var(--faint); font-size: 12px; }
.map-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; background: rgba(8, 11, 26, .6); z-index: 500; pointer-events: none; color: var(--muted); font-size: 14px; }
.map-empty strong { color: var(--text); font-size: 16px; }
.map-legend { position: absolute; left: 12px; bottom: 26px; z-index: 600; list-style: none; margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(8, 11, 26, .86); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; font-size: 13px; max-width: 60%; }
.map-legend:empty { display: none; }
.map-side { display: flex; flex-direction: column; gap: 16px; }
.near, .board { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.near { font-size: 14px; color: var(--muted); }
.near strong { color: var(--text); font-size: 14px; display: flex; align-items: center; gap: 6px; }
.near-isp { font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--c); }
.board-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.board-list li { --c: var(--violet); display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); animation: rise .45s var(--ease) both; }
.b-rank { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--muted); grid-row: span 2; }
.board-list li:nth-child(1) .b-rank { background: #FACC15; color: #3B2F00; }
.board-list li:nth-child(2) .b-rank { background: #CBD5E1; color: #1E293B; }
.board-list li:nth-child(3) .b-rank { background: #F59E0B; color: #3B1D00; }
.b-isp { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.b-speed { font-family: var(--mono); font-weight: 700; color: var(--c); grid-row: span 2; text-align: right; }
.b-speed small { font-size: 11px; color: var(--faint); display: block; font-weight: 500; }
.b-meta { font-size: 12px; color: var(--faint); }
.board-list li.board-empty { display: block; color: var(--faint); font-size: 14px; }

/* Outages */
.outage-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.outage-summary strong { font-family: var(--display); font-size: 17px; display: inline-flex; align-items: center; gap: 10px; }
.outage-summary strong::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--faint); }
.outage-summary.all-ok strong::before { background: var(--green); box-shadow: 0 0 0 4px rgba(52, 211, 153, .18); }
.outage-summary.has-issues { border-color: rgba(251, 146, 60, .45); }
.outage-summary.has-issues strong::before { background: var(--orange); box-shadow: 0 0 0 4px rgba(251, 146, 60, .2); animation: blink 1.6s ease-in-out infinite; }
.outage-summary span { color: var(--faint); font-size: 13px; }
.outage-you { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 20px; align-items: center; padding: 22px; }
.outage-you h3 { font-size: 20px; margin-bottom: 8px; }
.outage-you p { color: var(--muted); margin-bottom: 14px; }
.outage-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.outage-search { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; max-width: 380px; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--faint); }
.outage-search:focus-within { border-color: var(--brand); }
.outage-search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 15px; }
.outage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.oc { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.oc[hidden] { display: none; }
.oc-head { display: flex; align-items: center; gap: 12px; }
.oc-badge { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 14px; color: #0A0D1F; background: var(--c); flex: none; }
.oc-title { min-width: 0; display: flex; flex-direction: column; }
.oc-title h3 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-status { font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; color: var(--green); }
.oc-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.oc-issues { border-color: rgba(251, 146, 60, .45); }
.oc-issues .oc-status { color: var(--orange); }
.oc-down { border-color: rgba(251, 113, 133, .55); background: linear-gradient(180deg, rgba(251, 113, 133, .07), var(--surface)); }
.oc-down .oc-status { color: var(--red); }
.spark { width: 100%; height: 46px; display: block; }
.spark-line { fill: none; stroke: #FACC15; stroke-width: 1.8; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark-area { fill: rgba(250, 204, 21, .1); }
.oc-down .spark-line { stroke: var(--red); }
.oc-down .spark-area { fill: rgba(251, 113, 133, .12); }
.oc-meta { font-size: 12.5px; color: var(--faint); line-height: 1.5; }
.oc-report { align-self: flex-start; }
.oc-problems { display: flex; flex-direction: column; gap: 8px; }
.oc-q { font-size: 13px; font-weight: 600; }
.oc-problems .chip { min-height: 34px; font-size: 13px; padding: 0 12px; }
.oc-thanks { font-size: 13px; color: var(--green); }
.outage-grid-compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.outage-grid-compact .oc { padding: 14px; }

.outages-home { padding-top: 8px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 18px; }
.outage-more { display: flex; justify-content: center; }
.outage-more [hidden] { display: none; }

/* Methodology / business */
.method-grid, .biz-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.biz-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.method, .biz { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.method p, .biz p { color: var(--muted); font-size: 14.5px; }
.biz .link-arrow { margin-top: auto; padding-top: 8px; }

/* FAQ */
.faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 20px; transition: border-color .2s; }
.faq details[open] { border-color: var(--line-2); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 60px; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { color: var(--muted); padding-bottom: 18px; font-size: 15px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; padding-top: 56px; padding-bottom: 40px; }
.footer-brand p { color: var(--muted); font-size: 14px; margin-top: 14px; max-width: 320px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: 4px; font-family: var(--body); }
.footer-col a { color: var(--muted); text-decoration: none; font-size: 14.5px; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 20px; padding-bottom: 28px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; }

.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 2000; }

/* Prose pages (privacy) */
.prose { max-width: 760px; padding-top: 56px; padding-bottom: 88px; }
.prose h1 { font-size: clamp(32px, 4vw, 44px); margin-bottom: 8px; }
.prose h2 { font-size: 22px; margin: 36px 0 10px; }
.prose p, .prose li { color: var(--muted); }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 20px; display: grid; gap: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tool { border-bottom: 1px solid var(--line); }
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 32px; }
  .hero-copy { padding-top: 0; }
  .test-card { order: -1; }
  .hero-copy h1 { font-size: clamp(30px, 6vw, 42px); }
  .method-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .q-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .calc { grid-template-columns: 1fr; }
  .calc-output { position: static; }
  .map-layout { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .main-nav { display: none; }
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool:nth-child(2n) { border-right: none; }
  .tool:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .tool:last-child { grid-column: 1 / -1; border-right: none; }
  .outage-you { grid-template-columns: 1fr; }
  .outage-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .biz-grid, .faq { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .test-card { padding: 18px 14px 22px; border-radius: 20px; }
  .stats, #stats-stress { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #stats-quick .stat:last-child { grid-column: 1 / -1; }
  .stat .val { font-size: 20px; }
  .calc-activities { grid-template-columns: 1fr; }
  .q-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .method-grid { grid-template-columns: 1fr; }
  .tools { grid-template-columns: 1fr; }
  .tool { border-right: none; border-bottom: 1px solid var(--line); }
  .tool:last-child { border-bottom: none; }
  .calc-num { font-size: 38px; }
  .map { height: 380px; }
  .section { padding-top: 60px; padding-bottom: 60px; }
  .mode-tab { padding: 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ======================================================================
   Speed test — focused, Speedtest-style layout (home page)
   ====================================================================== */
.st { padding: 40px 24px 56px; }
.st-inner { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 22px; }

/* Three headline numbers */
.st-metrics { width: 100%; max-width: 760px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; text-align: center; }
.st-metrics-stress { max-width: 980px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.st-metric { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; transition: opacity .3s; }
#test-card[data-state="running"] .st-metric:not(.active) { opacity: .55; }
.st-label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text); }
.st-label small { font-size: 12px; font-weight: 500; letter-spacing: .02em; text-transform: none; color: var(--faint); }
.st-label .ic { width: 17px; height: 17px; stroke-width: 2.2; }
.st-metric[data-stat="ping"] .st-label .ic { color: #FACC15; }
.st-metric[data-stat="down"] .st-label .ic { color: #22D3EE; }
.st-metric[data-stat="up"] .st-label .ic { color: #C084FC; }
.st-value { font-family: var(--display); font-weight: 500; font-size: clamp(30px, 4.2vw, 44px); line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: #fff; }
.st-metrics-stress .st-value { font-size: clamp(22px, 2.6vw, 30px); }
.st-sub { font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.st-sub b { font-weight: 600; color: var(--muted); }
.st-metric.good .st-value, .st-metric .good .v { color: #fff; }
.st-metric.warn .st-value { color: var(--yellow); }
.st-metric.bad .st-value { color: var(--red); }
.st-metric.active::after { display: none; }
.st-metric.active .st-label { color: #fff; }

/* Stage: provider | dial | server */
.st-stage { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px) minmax(0, 1fr); align-items: end; gap: 24px; }
.st-side { padding-bottom: 54px; min-width: 0; }
.st-side-left { justify-self: end; }
.st-side-right { justify-self: start; }
.st-side .cc-item { gap: 14px; }

/* Dial: only the GO ring before the test */
#test-card .gauge { width: 100%; }
#test-card .gauge::before { opacity: 0; }
#test-card[data-state="running"] .gauge::before { opacity: .22; }
#test-card[data-state="done"] .gauge::before { opacity: .12; }
#test-card .g-track, #test-card .g-ticks, #test-card .g-trace, #test-card .g-trace-area { transition: opacity .6s var(--ease); }
#test-card[data-state="idle"] .g-track, #test-card[data-state="idle"] .g-ticks { opacity: 0; }
#test-card .g-mood { background: none; border: none; padding: 0; bottom: 4%; font-size: 14px; font-weight: 500; letter-spacing: .02em; color: var(--muted); }

/* GO: a glowing gradient ring */
#test-card .go {
  width: 46%; background: radial-gradient(circle, #0E1124 62%, #141A38) padding-box, conic-gradient(from 200deg, #22D3EE, #818CF8, #C084FC, #F472B6, #22D3EE) border-box;
  border: 4px solid transparent; color: #fff; font-family: var(--display); font-weight: 500; font-size: clamp(34px, 6vw, 52px); letter-spacing: .08em; text-shadow: none;
  box-shadow: 0 0 40px rgba(129, 140, 248, .25), inset 0 0 30px rgba(129, 140, 248, .12); animation: none;
}
#test-card .go::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid rgba(129, 140, 248, .5); animation: ring 2.4s ease-out infinite; pointer-events: none; }
@keyframes ring { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.28); opacity: 0; } }
#test-card .go:hover { transform: translate(-50%, -50%) scale(1.04); box-shadow: 0 0 60px rgba(129, 140, 248, .4), inset 0 0 40px rgba(129, 140, 248, .2); }
#test-card[data-mode="stress"] .go { font-size: clamp(22px, 4vw, 34px); background: radial-gradient(circle, #0E1124 62%, #1C1630) padding-box, conic-gradient(from 200deg, #F472B6, #FB923C, #FACC15, #F472B6) border-box; }
#test-card[data-mode="stress"] .go::before { border-color: rgba(251, 146, 60, .5); }
#test-card[data-state="idle"] .g-readout { opacity: 0; transform: translate(-50%, -42%) scale(.92); }
#test-card:not([data-state="idle"]) .go { opacity: 0; transform: translate(-50%, -50%) scale(.4); pointer-events: none; }

/* Mode switch: quiet text toggle */
.st-modes { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.st-modes .mode-tab { min-height: 36px; padding: 0 18px; border-radius: 999px; border: none; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .2s, color .2s; }
.st-modes .mode-tab[aria-selected="true"] { background: rgba(255, 255, 255, .1); color: #fff; }
.st-modes .mode-tab:disabled { cursor: not-allowed; }
.st-desc { margin-top: -10px; font-size: 13.5px; color: var(--faint); text-align: center; max-width: 520px; }
#test-card .chart-wrap { max-width: 760px; }

/* Results */
.st-result { width: 100%; max-width: 980px; margin-top: 8px; padding-top: 28px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; animation: rise .6s var(--ease) both; }
.st-result-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.st-result .verdict-title { font-family: var(--display); font-size: clamp(20px, 2.4vw, 26px); font-weight: 600; letter-spacing: -0.02em; }
.st-result .verdict-sub { margin-top: 4px; color: var(--muted); font-size: 14px; }
.st-result .actions { justify-content: flex-end; }
.st-result-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.st-panel { display: flex; flex-direction: column; gap: 16px; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.st-panel .plan-check, .st-panel .net-card { background: none; border: none; padding: 0; }
.st-panel .net-card { gap: 12px; }
.st-panel .diag-item { background: var(--bg); }
.st-links { display: flex; flex-direction: column; border-top: 1px solid var(--line); padding-top: 6px; }
.st-links a { display: flex; align-items: center; gap: 10px; padding: 10px 2px; color: var(--text); text-decoration: none; font-size: 14.5px; border-bottom: 1px solid var(--line); }
.st-links a:last-child { border-bottom: none; }
.st-links a .ic { color: var(--violet); }
.st-links a:hover { color: #fff; }

/* Top outages card */
.outages-home { padding-top: 8px; padding-bottom: 64px; }
.ot-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.ot-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.ot-head h2 { font-size: 20px; display: inline-flex; align-items: center; gap: 10px; }
.ot-head h2 .ic { width: 22px; height: 22px; color: #FACC15; }
.ot-card .outage-summary { border: none; background: none; padding: 0; }
.ot-card .outage-summary strong { font-family: var(--body); font-size: 14px; font-weight: 600; }
.ot-top { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ot-top .oc { background: var(--bg); border-color: transparent; padding: 14px 14px 10px; }
.ot-top .oc-badge { display: none; }
.ot-top .oc-head { justify-content: center; text-align: center; }
.ot-top .oc-title { align-items: center; }
.ot-top .oc-title h3 { font-size: 16px; font-weight: 500; }
.ot-top .oc-meta { text-align: center; }
.ot-foot { display: flex; justify-content: center; }
.ot-you { font-size: 14px; color: var(--muted); }
.link-btn { background: none; border: none; padding: 0; font: inherit; font-weight: 600; color: #A5B4FC; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
#outage-browse { display: flex; flex-direction: column; gap: 14px; }
#outage-browse[hidden] { display: none; }

@media (max-width: 900px) {
  .st { padding-top: 24px; }
  .st-stage { grid-template-columns: 1fr 1fr; grid-template-areas: "dial dial" "left right"; align-items: start; gap: 16px; }
  .st-stage .gauge { grid-area: dial; max-width: 400px; justify-self: center; }
  .st-side { padding-bottom: 0; }
  .st-side-left { grid-area: left; justify-self: start; }
  .st-side-right { grid-area: right; justify-self: start; }
  .st-metrics-stress { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; }
  .st-result-grid { grid-template-columns: 1fr; }
  .ot-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .st { padding: 18px 16px 40px; }
  .st-metrics { gap: 4px; }
  .st-label { font-size: 11.5px; gap: 5px; }
  .st-label small { display: none; }
  .st-value { font-size: 28px; }
  .st-sub { font-size: 11px; }
  .st-stage { grid-template-columns: 1fr; grid-template-areas: "dial" "left" "right"; }
  .st-side .cc-main { font-size: 16px; }
  .st-side .cc-sub { font-size: 14px; }
  .st-side .cc-ic { width: 40px; height: 40px; }
  .ot-card { padding: 16px; }
}

/* plain numbers, no tiles (overrides the older .stat tile styles) */
#test-card .stat { background: none; border: none; border-radius: 0; padding: 6px 0; transform: none; overflow: visible; }
#test-card .st-sub .stat { display: inline; padding: 0; }
#test-card .stat.active { background: none; border: none; transform: none; }
#test-card .stat.active::after { display: none; }
#test-card .st-sub .stat .v { color: var(--muted); }
#test-card .stat.good .v, #test-card .stat.warn .v, #test-card .stat.bad .v { color: inherit; }
#test-card .stat.warn .st-value { color: var(--yellow); }
#test-card .stat.bad .st-value { color: var(--red); }
.bg { opacity: .55; }
#test-card #stats-quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#test-card #stats-quick .stat:last-child { grid-column: auto; }
@media (max-width: 520px) {
  #test-card .st-sub { display: flex; flex-direction: column; line-height: 1.4; }
  #test-card .st-sub .sep { display: none; }
}

.ot-none { text-align: center; color: var(--muted); font-size: 14.5px; padding: 6px 0 2px; }
.ot-none[hidden], .ot-top[hidden] { display: none; }
