/* ============================================================
   SpeedSense — Professional UI v4
   ODEaling · info@odealing.com · +92 344 6440033
   ============================================================ */

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Palette */
  --bg:        #060d16;
  --bg-card:   #0c1825;
  --bg-input:  #0f2035;
  --bg-sub:    #081422;
  --acc:       #00c8f0;
  --acc-glow:  rgba(0,200,240,.18);
  --acc-dim:   rgba(0,200,240,.08);
  --green:     #00e07a;
  --amber:     #f5a623;
  --red:       #f0464a;
  --purple:    #b57bee;
  --text:      #c8dff0;
  --text-soft: #5a80a0;
  --text-muted:#253a50;
  --border:    rgba(0,200,240,.14);
  --border-sub:rgba(0,200,240,.07);
  /* Typography */
  --font-ui:   'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --font-disp: 'Barlow Condensed', sans-serif;
  /* Geometry */
  --radius:    14px;
  --radius-sm: 9px;
  --radius-xs: 6px;
  /* Layout */
  --max-w:     960px;    /* strict content max-width */
  --col-pad:   clamp(1rem, 4vw, 2rem);
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }

/* ══════════════════════════════════════════
   LAYOUT WRAPPER — everything constrained
   ══════════════════════════════════════════ */
.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--col-pad);
  padding-right: var(--col-pad);
}

/* ══════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════ */
.header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(6,13,22,.95);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  height: 60px;
}
/* Brand */
.brand { display: flex; align-items: center; gap: .65rem; flex-shrink: 0; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-icon { width: 34px; height: 34px; flex-shrink: 0; }
.brand-name { font-family: var(--font-disp); font-size: 1.3rem; font-weight: 700; letter-spacing: .04em; color: #fff; line-height: 1; }
.brand-dot  { color: var(--acc); }
.brand-tag  { font-size: .6rem; color: var(--text-muted); letter-spacing: .1em; text-transform: uppercase; margin-top: 1px; }

/* Desktop nav */
.header-nav { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.header-nav a {
  font-size: .82rem; font-weight: 500; color: var(--text-soft);
  padding: .38rem .75rem; border-radius: var(--radius-xs);
  transition: color .15s, background .15s;
}
.header-nav a:hover { color: var(--acc); background: var(--acc-dim); text-decoration: none; }

/* CTA pill */
.header-cta {
  display: flex; align-items: center; gap: .4rem;
  padding: .38rem .9rem; border: 1px solid var(--border);
  border-radius: 20px; font-size: .75rem; font-weight: 600;
  color: var(--acc); font-family: var(--font-mono);
  white-space: nowrap; transition: all .2s; flex-shrink: 0;
}
.header-cta svg { width: 13px; height: 13px; }
.header-cta:hover { background: var(--acc-dim); text-decoration: none; }

/* Hamburger */
.ham-btn {
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 4.5px; width: 36px; height: 36px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-xs); cursor: pointer; flex-shrink: 0;
}
.ham-btn span { display: block; width: 16px; height: 1.5px; background: var(--text-soft); border-radius: 1px; transition: all .22s; }
.ham-btn.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.ham-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.ham-btn.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile drawer */
.mobile-nav {
  display: none; position: fixed;
  top: 61px; left: 0; right: 0; z-index: 190;
  background: rgba(6,13,22,.98);
  border-bottom: 1px solid var(--border);
  padding: .75rem var(--col-pad) 1.25rem;
  flex-direction: column; gap: 2px;
}
.mobile-nav.open { display: flex; animation: slideDown .2s ease; }
@keyframes slideDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }
.mobile-nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .72rem .85rem; border-radius: var(--radius-sm);
  color: var(--text-soft); font-size: .9rem; font-weight: 500;
  transition: all .15s;
}
.mobile-nav a:hover { background: var(--acc-dim); color: var(--acc); text-decoration: none; }
.mobile-nav .mn-divider { height: 1px; background: var(--border); margin: .5rem 0; }

/* ══════════════════════════════════════════
   AD SLOTS
   ══════════════════════════════════════════ */
.ad-bar { text-align: center; padding: .5rem var(--col-pad); }
.ad-placeholder {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px dashed var(--border-sub);
  border-radius: var(--radius-xs); color: var(--text-muted);
  font-size: .65rem; font-family: var(--font-mono);
  padding: .5rem 1.5rem; min-height: 50px; min-width: 200px;
  letter-spacing: .08em; text-transform: uppercase;
}
.ad-slot { text-align: center; }

/* ══════════════════════════════════════════
   PAGE STRUCTURE — center column + sidebars
   ══════════════════════════════════════════ */
.page-outer {
  display: flex;
  gap: 1.25rem;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1rem;
  align-items: flex-start;
}
.page-sidebar {
  width: 160px;
  flex-shrink: 0;
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 1.5rem;
}
.page-sidebar .ad-placeholder {
  min-height: 240px; flex-direction: column; gap: .35rem;
  width: 160px; min-width: unset; display: flex;
}
.page-main {
  flex: 1;
  min-width: 0;
  max-width: var(--max-w);
}

/* ══════════════════════════════════════════
   HERO / TEST SECTION
   ══════════════════════════════════════════ */
.test-hero {
  position: relative; overflow: hidden;
  padding: 3.5rem var(--col-pad) 3rem;
  text-align: center;
}

/* Subtle grid backdrop */
.test-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,200,240,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,200,240,.03) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse 75% 75% at 50% 40%, black 10%, transparent 100%);
  pointer-events: none;
}
/* Radial glow */
.test-hero::after {
  content: '';
  position: absolute; top: 55%; left: 50%;
  transform: translate(-50%, -50%);
  width: 600px; height: 400px;
  background: radial-gradient(ellipse, rgba(0,200,240,.06) 0%, transparent 70%);
  pointer-events: none;
}

.test-inner {
  position: relative; z-index: 1;
  max-width: 640px;
  margin: 0 auto;
}

/* ── Connection info bar ── */
.conn-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.conn-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  padding: .7rem .5rem;
  border-right: 1px solid var(--border);
}
.conn-item:last-child { border-right: none; }
.conn-lbl { font-size: .58rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.conn-val { font-size: .8rem; font-family: var(--font-mono); color: var(--acc); font-weight: 500; text-align: center; word-break: break-all; max-width: 110px; line-height: 1.3; }

/* ── Plan row ── */
.plan-row {
  display: flex; align-items: center; justify-content: center;
  gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.plan-lbl  { font-size: .78rem; color: var(--text-soft); }
.plan-input {
  width: 78px; padding: .4rem .6rem; text-align: center;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--text);
  font-family: var(--font-mono); font-size: .82rem; outline: none;
}
.plan-input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-dim); }
.plan-unit { font-size: .72rem; color: var(--text-muted); }
.plan-set {
  padding: .38rem .8rem; background: var(--acc-dim);
  border: 1px solid rgba(0,200,240,.3); border-radius: var(--radius-xs);
  color: var(--acc); font-size: .75rem; font-weight: 600;
  cursor: pointer; transition: all .15s; font-family: var(--font-ui);
}
.plan-set:hover { background: var(--acc); color: var(--bg); }
.plan-msg { font-size: .72rem; color: var(--green); font-weight: 500; }

/* ══════════════════════════════════════════
   GAUGE
   ══════════════════════════════════════════ */
.gauge-wrap { position: relative; width: 320px; height: 210px; margin: 0 auto; }
.gauge-svg  { width: 100%; height: 100%; }
#gaugeArc    { transition: stroke-dashoffset .3s ease, stroke .3s; }
#gaugeNeedle { transition: transform .4s cubic-bezier(.34,1.3,.64,1); }

.gauge-center {
  position: absolute; bottom: 10px; left: 50%;
  transform: translateX(-50%);
  text-align: center; width: 220px; pointer-events: none;
}
.gauge-speed {
  font-family: var(--font-disp); font-size: 4.5rem; font-weight: 900;
  color: #fff; line-height: 1; letter-spacing: -.03em;
}
.gauge-unit  { font-size: .8rem; color: var(--text-soft); font-family: var(--font-mono); margin-top: -.1rem; }
.gauge-phase { font-size: .68rem; color: var(--text-muted); margin-top: .18rem; font-family: var(--font-mono); letter-spacing: .04em; }

/* ══════════════════════════════════════════
   LIVE STATS STRIP
   ══════════════════════════════════════════ */
.live-stats {
  display: grid; grid-template-columns: repeat(6,1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1rem 0;
}
.ls-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: .75rem .25rem;
  background: var(--bg-card);
  transition: background .15s;
}
.ls-item:hover { background: var(--bg-input); }
.ls-icon { font-size: .85rem; font-weight: 700; font-family: var(--font-mono); line-height: 1; }
.ls-down   { color: var(--acc);    }
.ls-up     { color: var(--green);  }
.ls-ping   { color: var(--amber);  }
.ls-jitter { color: var(--purple); }
.ls-loss   { color: var(--red);    }
.ls-bloat  { color: #fb923c; font-size: .6rem; letter-spacing: .02em; }
.ls-val    { font-family: var(--font-mono); font-size: .92rem; font-weight: 600; color: #fff; line-height: 1; }
.ls-lbl    { font-size: .55rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; text-align: center; }

/* ══════════════════════════════════════════
   PROGRESS STEPS
   ══════════════════════════════════════════ */
.test-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin: .75rem 0;
}
.step-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; opacity: .25; transition: opacity .3s; flex-shrink: 0;
}
.step-item.active { opacity: 1; }
.step-item.done   { opacity: .5; }
.step-dot {
  width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid var(--text-muted); transition: all .3s;
}
.step-item.active .step-dot { border-color: var(--acc); background: var(--acc); box-shadow: 0 0 8px rgba(0,200,240,.7); }
.step-item.done   .step-dot { border-color: var(--green); background: var(--green); }
.step-item span   { font-size: .6rem; color: var(--text-soft); white-space: nowrap; font-weight: 500; }
.step-line        { width: 28px; height: 1px; background: var(--border); flex-shrink: 0; margin-top: -13px; }

/* ══════════════════════════════════════════
   ★ GO BUTTON — SPECTACULAR ★
   ══════════════════════════════════════════ */
.go-wrap {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 220px; height: 220px;
  margin: 1.5rem auto 0;
}

/* Layered pulse rings */
.go-ring {
  position: absolute; border-radius: 50%;
  border: 1.5px solid rgba(0,200,240,.35);
  pointer-events: none;
  animation: ring-breathe 3s ease-in-out infinite;
}
.go-ring:nth-child(1) { inset: -8px;  animation-delay: 0s;   opacity: .55; }
.go-ring:nth-child(2) { inset: -20px; animation-delay: .9s;  opacity: .3;  }
.go-ring:nth-child(3) { inset: -34px; animation-delay: 1.8s; opacity: .15; }
@keyframes ring-breathe {
  0%,100% { transform: scale(.94); }
  50%     { transform: scale(1.04); }
}

/* Spinning arc */
.go-orbit {
  position: absolute; inset: -4px; border-radius: 50%; pointer-events: none;
  border: 1.5px solid transparent;
  border-top-color: var(--acc);
  border-right-color: rgba(0,200,240,.25);
  animation: spin-slow 5s linear infinite;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }

/* Particle dots */
.go-particles {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  animation: spin-slow 8s linear infinite reverse;
}
.go-particle {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: var(--acc); box-shadow: 0 0 7px 2px rgba(0,200,240,.6);
  top: 0; left: calc(50% - 2.5px);
}
.go-particle:nth-child(1) { animation: p-fade 2.8s ease-in-out infinite 0s; }
.go-particle:nth-child(2) { animation: p-fade 2.8s ease-in-out infinite .93s; transform: rotate(120deg) translateY(-110px); }
.go-particle:nth-child(3) { animation: p-fade 2.8s ease-in-out infinite 1.86s; transform: rotate(240deg) translateY(-110px); }
/* Position particle 1 at top */
.go-particle:nth-child(1) { transform: rotate(0deg) translateY(-110px); }
@keyframes p-fade { 0%,100%{opacity:.15} 50%{opacity:.9} }

/* The button itself */
.btn-go {
  position: relative; z-index: 2;
  width: 158px; height: 158px; border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--acc);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  transition: all .28s cubic-bezier(.34,1.2,.64,1);
  box-shadow:
    0 0 0 0px rgba(0,200,240,0),
    0 0 30px rgba(0,200,240,.1),
    inset 0 0 40px rgba(0,200,240,.04);
  overflow: hidden;
}
/* Inner shimmer sweep */
.btn-go::before {
  content: '';
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    rgba(0,200,240,.12) 18%,
    transparent 36%
  );
  animation: btn-shimmer 3.5s linear infinite;
}
@keyframes btn-shimmer { to { transform: rotate(360deg); } }
/* Centre glow pulse */
.btn-go::after {
  content: '';
  position: absolute;
  width: 70px; height: 70px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,200,240,.2) 0%, transparent 70%);
  animation: glow-pulse 2s ease-in-out infinite;
}
@keyframes glow-pulse { 0%,100%{transform:scale(.75);opacity:.5} 50%{transform:scale(1.3);opacity:1} }

.btn-go-text {
  position: relative; z-index: 3;
  font-family: var(--font-disp); font-size: 2.8rem; font-weight: 900;
  letter-spacing: .18em; color: var(--acc); line-height: 1;
  text-shadow: 0 0 20px rgba(0,200,240,.65), 0 0 45px rgba(0,200,240,.25);
  transition: all .25s;
}
.btn-go-sub {
  position: relative; z-index: 3;
  font-size: .55rem; font-weight: 700;
  letter-spacing: .2em; color: rgba(0,200,240,.5);
  text-transform: uppercase; transition: all .25s;
}

/* Hover */
.btn-go:hover {
  border-color: #00f0ff;
  box-shadow:
    0 0 0 6px rgba(0,200,240,.12),
    0 0 50px rgba(0,200,240,.35),
    0 0 100px rgba(0,200,240,.1),
    inset 0 0 50px rgba(0,200,240,.08);
  transform: scale(1.05);
}
.btn-go:hover .btn-go-text { color: #fff; text-shadow: 0 0 30px rgba(0,200,240,1), 0 0 70px rgba(0,200,240,.5); }
.btn-go:hover .btn-go-sub  { color: rgba(255,255,255,.65); }
.btn-go:active { transform: scale(.98); }

/* Running — red */
.btn-go.running {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(240,70,74,.12), 0 0 30px rgba(240,70,74,.25);
  animation: run-pulse 1.1s ease-in-out infinite;
}
@keyframes run-pulse {
  0%,100% { box-shadow: 0 0 0 2px rgba(240,70,74,.1), 0 0 20px rgba(240,70,74,.2); }
  50%     { box-shadow: 0 0 0 6px rgba(240,70,74,.08), 0 0 40px rgba(240,70,74,.35); }
}
.btn-go.running::before { background: conic-gradient(from 0deg, transparent 0%, rgba(240,70,74,.14) 18%, transparent 36%); animation-duration: 1.2s; }
.btn-go.running::after  { background: radial-gradient(circle, rgba(240,70,74,.18) 0%, transparent 70%); }
.btn-go.running .btn-go-text { color: var(--red); text-shadow: 0 0 20px rgba(240,70,74,.7); }
.btn-go.running .btn-go-sub  { color: rgba(240,70,74,.55); }
.btn-go.running ~ .go-ring,
.go-wrap.running .go-ring    { border-color: rgba(240,70,74,.35); animation-duration: 1.1s; }
.go-wrap.running .go-orbit   { border-top-color: var(--red); border-right-color: rgba(240,70,74,.2); }
.go-wrap.running .go-particle{ background: var(--red); box-shadow: 0 0 7px 2px rgba(240,70,74,.6); }

.test-note { font-size: .68rem; color: var(--text-muted); margin-top: 1.1rem; letter-spacing: .02em; }
.test-note a { color: var(--text-muted); }

/* ══════════════════════════════════════════
   CARDS / PANELS
   ══════════════════════════════════════════ */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1rem;
}
.panel-hdr   { margin-bottom: 1.1rem; }
.panel-title {
  font-family: var(--font-disp); font-size: 1.35rem; font-weight: 700;
  color: #fff; margin-bottom: .2rem; letter-spacing: .01em;
}
.panel-sub   { font-size: .78rem; color: var(--text-soft); }

/* Section divider */
.section-wrap { padding: 0 var(--col-pad); }

/* ── Plan banner ── */
.plan-banner {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1.1rem 1.5rem; border-radius: var(--radius);
  margin-bottom: 1rem; flex-wrap: wrap;
}
.plan-banner.good { background: rgba(0,224,122,.07); border: 1px solid rgba(0,224,122,.25); }
.plan-banner.warn { background: rgba(245,166,35,.07); border: 1px solid rgba(245,166,35,.25); }
.plan-banner.bad  { background: rgba(240,70,74,.07);  border: 1px solid rgba(240,70,74,.25); }
.pb-emoji { font-size: 1.6rem; flex-shrink: 0; }
.pb-body  { flex: 1; min-width: 150px; }
.pb-title { font-size: .92rem; font-weight: 600; color: #fff; margin-bottom: .15rem; }
.pb-desc  { font-size: .78rem; color: var(--text-soft); }
.pb-nums  { text-align: right; flex-shrink: 0; }
.pb-nums span { display: block; font-family: var(--font-mono); font-size: .75rem; color: var(--text-soft); }

/* ── Score grid ── */
.scores-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .65rem;
}
.score-card {
  background: var(--bg-sub); border: 1px solid var(--border-sub);
  border-radius: var(--radius-sm); padding: 1rem .65rem; text-align: center;
  position: relative; overflow: hidden;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  cursor: default;
}
.score-card:hover { transform: translateY(-2px); border-color: var(--border); box-shadow: 0 4px 20px rgba(0,0,0,.25); }
.score-card::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2.5px;
}
.score-card.excellent::after { background: var(--green); }
.score-card.good::after      { background: #5fd9a0; }
.score-card.fair::after      { background: var(--amber); }
.score-card.poor::after      { background: var(--red); }
.sc-icon  { font-size: 1.3rem; margin-bottom: .3rem; }
.sc-name  { font-size: .62rem; color: var(--text-soft); font-weight: 500; margin-bottom: .3rem; line-height: 1.35; }
.sc-score { font-family: var(--font-disp); font-size: 2rem; font-weight: 900; line-height: 1; margin-bottom: .15rem; }
.score-card.excellent .sc-score { color: var(--green); }
.score-card.good .sc-score      { color: #5fd9a0; }
.score-card.fair .sc-score      { color: var(--amber); }
.score-card.poor .sc-score      { color: var(--red); }
.sc-label { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.score-card.excellent .sc-label { color: var(--green); }
.score-card.good .sc-label      { color: #5fd9a0; }
.score-card.fair .sc-label      { color: var(--amber); }
.score-card.poor .sc-label      { color: var(--red); }
.sc-note  { font-size: .6rem; color: var(--text-muted); margin-top: .28rem; line-height: 1.4; }

/* ── Metrics ── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .65rem;
}
.metric-item {
  background: var(--bg-sub); border: 1px solid var(--border-sub);
  border-radius: var(--radius-sm); padding: 1rem 1.1rem;
  position: relative; overflow: hidden;
}
.metric-item::before {
  content: ''; position: absolute; top: 0; left: 0; bottom: 0;
  width: 3px; border-radius: 2px 0 0 2px;
}
.metric-lbl  { font-size: .62rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .09em; font-weight: 600; margin-bottom: .45rem; }
.metric-val  { font-family: var(--font-mono); font-size: 1.55rem; font-weight: 600; color: var(--acc); line-height: 1; }
.metric-sub  { font-size: .68rem; color: var(--text-soft); margin-top: .18rem; }
.metric-bar  { height: 3px; background: var(--bg-input); border-radius: 2px; margin-top: .55rem; overflow: hidden; }
.metric-bar-fill { height: 100%; border-radius: 2px; transition: width 1.2s ease; }

/* ── Bufferbloat ── */
.bloat-grade {
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-disp); font-size: 1.65rem; font-weight: 900;
  border: 2.5px solid; flex-shrink: 0;
}
.bloat-grade.A,.bloat-grade.B { border-color: var(--green); color: var(--green); background: rgba(0,224,122,.08); }
.bloat-grade.C { border-color: var(--amber); color: var(--amber); background: rgba(245,166,35,.08); }
.bloat-grade.D,.bloat-grade.F { border-color: var(--red);   color: var(--red);   background: rgba(240,70,74,.08); }
.bloat-bars     { display: flex; flex-direction: column; gap: .55rem; margin: .85rem 0; }
.bloat-row      { display: flex; align-items: center; gap: .75rem; }
.bloat-lbl      { font-size: .72rem; color: var(--text-soft); width: 110px; flex-shrink: 0; }
.bloat-bar-wrap { flex: 1; height: 7px; background: var(--bg-input); border-radius: 4px; overflow: hidden; }
.bloat-bar-fill { height: 100%; border-radius: 4px; transition: width 1s ease; }
.bloat-num      { font-family: var(--font-mono); font-size: .72rem; color: var(--text-soft); width: 50px; text-align: right; flex-shrink: 0; }
.bloat-explain  {
  font-size: .79rem; color: var(--text-soft); line-height: 1.65;
  padding: .7rem .95rem; background: var(--bg-sub); border-radius: var(--radius-sm);
  border-left: 3px solid var(--acc);
}

/* ── Wi-Fi ── */
.wifi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .65rem; margin-top: .75rem;
}
.wifi-item { background: var(--bg-sub); border: 1px solid var(--border-sub); border-radius: var(--radius-sm); padding: .9rem 1rem; }
.wifi-item-lbl { font-size: .6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .09em; font-weight: 600; margin-bottom: .35rem; }
.wifi-item-val { font-size: .88rem; color: #fff; font-weight: 500; }
.wifi-item-sub { font-size: .68rem; color: var(--text-soft); margin-top: .15rem; }
.signal-bars   { display: flex; align-items: flex-end; gap: 2.5px; height: 16px; margin-top: .35rem; }
.signal-bar    { width: 5px; border-radius: 1px; background: var(--bg-input); }
.signal-bar.on { background: var(--green); }
.wifi-alert {
  display: flex; align-items: flex-start; gap: .65rem;
  padding: .75rem 1rem; background: rgba(245,166,35,.06);
  border: 1px solid rgba(245,166,35,.22); border-radius: var(--radius-sm);
  margin-top: .75rem; font-size: .78rem; color: var(--text-soft);
  grid-column: 1 / -1;
}
.wifi-alert-icon { color: var(--amber); flex-shrink: 0; margin-top: 1px; font-size: .9rem; }

/* ── Device ── */
.device-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .65rem; margin-top: .75rem;
}
.device-item {
  background: var(--bg-sub); border: 1px solid var(--border-sub);
  border-radius: var(--radius-sm); padding: .9rem 1rem;
  display: flex; align-items: flex-start; gap: .65rem;
}
.di-icon  { width: 30px; height: 30px; border-radius: var(--radius-xs); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1rem; }
.di-lbl   { font-size: .6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; margin-bottom: .15rem; }
.di-val   { font-size: .85rem; color: #fff; font-weight: 500; }
.di-note  { font-size: .68rem; color: var(--text-soft); margin-top: 1px; line-height: 1.4; }

/* ── Recommendations ── */
.recs-list { display: flex; flex-direction: column; gap: .6rem; margin-top: .75rem; }
.rec-item  {
  display: flex; align-items: flex-start; gap: .9rem; padding: .9rem 1rem;
  background: var(--bg-sub); border: 1px solid var(--border-sub);
  border-radius: var(--radius-sm); transition: border-color .2s;
}
.rec-item:hover { border-color: var(--border); }
.rec-emoji { font-size: 1.25rem; flex-shrink: 0; margin-top: 1px; }
.rec-title { font-size: .85rem; font-weight: 600; color: #fff; margin-bottom: .18rem; }
.rec-desc  { font-size: .76rem; color: var(--text-soft); line-height: 1.55; }
.rec-tag   { display: inline-block; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: .14rem .5rem; border-radius: 3px; margin-top: .3rem; }
.rec-tag.urgent { background: rgba(240,70,74,.14);  color: var(--red); }
.rec-tag.warn   { background: rgba(245,166,35,.14); color: var(--amber); }
.rec-tag.info   { background: rgba(0,200,240,.1);   color: var(--acc); }
.rec-tag.good   { background: rgba(0,224,122,.1);   color: var(--green); }

/* ── Chart ── */
.chart-wrap { position: relative; height: 165px; }

/* ── Result actions ── */
.result-actions {
  display: flex; gap: .65rem; justify-content: flex-end;
  flex-wrap: wrap; padding: .5rem 0 1rem;
}
.btn-primary {
  padding: .65rem 1.35rem; background: var(--acc); color: var(--bg);
  border: none; border-radius: var(--radius-sm); font-weight: 600;
  font-size: .855rem; cursor: pointer; transition: all .2s; font-family: var(--font-ui);
}
.btn-primary:hover { background: #00e8ff; transform: translateY(-1px); }
.btn-secondary {
  padding: .65rem 1.35rem; background: transparent; color: var(--text-soft);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .855rem; cursor: pointer; transition: all .2s; font-family: var(--font-ui);
}
.btn-secondary:hover { border-color: var(--acc); color: var(--acc); }

/* ── History ── */
.hist-entry {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  align-items: center; gap: 1rem;
  padding: .75rem 1rem;
  background: var(--bg-sub); border: 1px solid var(--border-sub);
  border-radius: var(--radius-sm); margin-bottom: .45rem;
  transition: border-color .2s;
}
.hist-entry:hover { border-color: var(--border); }
.he-date   { font-family: var(--font-mono); font-size: .66rem; color: var(--text-muted); line-height: 1.5; }
.he-speeds { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center; }
.he-metric { text-align: center; }
.he-metric .v { font-family: var(--font-mono); font-size: .88rem; font-weight: 600; color: var(--acc); }
.he-metric .l { font-size: .56rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.he-meta  { display: flex; align-items: center; gap: .5rem; }
.he-isp   { font-size: .72rem; color: var(--text-soft); }
.he-conn  { font-size: .65rem; color: var(--text-muted); background: var(--bg-input); padding: .12rem .45rem; border-radius: 3px; white-space: nowrap; }
.he-del   { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 13px; padding: 3px; line-height: 1; transition: color .2s; }
.he-del:hover { color: var(--red); }
.hist-empty { text-align: center; padding: 2.5rem; color: var(--text-muted); border: 1px dashed var(--border-sub); border-radius: var(--radius-sm); }
.btn-sm {
  padding: .42rem .85rem; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-soft); font-size: .75rem;
  cursor: pointer; transition: all .15s; font-family: var(--font-ui);
}
.btn-sm:hover     { border-color: var(--acc); color: var(--acc); }
.btn-sm-red:hover { border-color: var(--red); color: var(--red); }

/* ── Info cards ── */
.info-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: .65rem; margin-bottom: 1rem;
}
.info-card {
  background: var(--bg-card); border: 1px solid var(--border-sub);
  border-radius: var(--radius-sm); padding: 1rem 1.1rem;
  transition: border-color .2s;
}
.info-card:hover { border-color: var(--border); }
.ic-badge {
  width: 32px; height: 32px; border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: .72rem; margin-bottom: .65rem;
}
.ic-a   { background: rgba(0,200,240,.12); color: var(--acc); }
.ic-mx  { background: rgba(96,165,250,.12); color: #60a5fa; }
.ic-ns  { background: rgba(245,166,35,.12); color: var(--amber); }
.ic-txt { background: rgba(181,123,238,.12); color: var(--purple); }
.info-card h3 { font-size: .82rem; font-weight: 600; color: #fff; margin-bottom: .3rem; }
.info-card p  { font-size: .74rem; color: var(--text-soft); line-height: 1.6; }

/* ══════════════════════════════════════════
   CONTACT STRIP
   ══════════════════════════════════════════ */
.contact-strip {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem var(--col-pad);
  margin-top: .5rem;
}
.cs-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
}
.cs-title { font-family: var(--font-disp); font-size: 1.25rem; color: #fff; margin-bottom: .3rem; font-weight: 700; }
.cs-sub   { font-size: .8rem; color: var(--text-soft); }
.cs-btns  { display: flex; gap: .65rem; flex-wrap: wrap; }
.cs-btn   {
  padding: .65rem 1.15rem; border-radius: var(--radius-sm);
  font-size: .82rem; font-weight: 600; background: var(--acc-dim);
  color: var(--acc); border: 1px solid rgba(0,200,240,.25); transition: all .2s;
}
.cs-btn:hover      { background: var(--acc); color: var(--bg); text-decoration: none; }
.cs-btn-alt        { background: transparent; }

/* ══════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════ */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border-sub);
  padding: 1.35rem var(--col-pad);
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .65rem;
  font-size: .76rem; color: var(--text-soft);
}
.footer-inner strong { color: var(--text); }
.footer-links { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.footer-links a { color: var(--text-soft); transition: color .2s; }
.footer-links a:hover { color: var(--acc); text-decoration: none; }

/* ══════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════════ */

/* ─ 1260px: sidebars shrink ─ */
@media (max-width: 1260px) {
  .page-sidebar { width: 140px; }
  .page-sidebar .ad-placeholder { width: 140px; }
}

/* ─ 1060px: hide sidebars ─ */
@media (max-width: 1060px) {
  .page-outer  { padding: 0; gap: 0; }
  .page-sidebar { display: none; }
  .page-main   { max-width: 100%; }
  .section-wrap { padding: 0 var(--col-pad); }
  .panel { padding: 1.25rem var(--col-pad); }
}

/* ─ 900px: score grid 4-col ─ */
@media (max-width: 900px) {
  .scores-grid  { grid-template-columns: repeat(4,1fr); }
  .wifi-grid    { grid-template-columns: repeat(2,1fr); }
  .device-grid  { grid-template-columns: repeat(2,1fr); }
  .info-grid    { grid-template-columns: repeat(2,1fr); }
  .metrics-grid { grid-template-columns: repeat(2,1fr); }
}

/* ─ 768px: tablet ─ */
@media (max-width: 768px) {
  .header-nav { display: none; }
  .header-cta { display: none; }
  .ham-btn    { display: flex; }

  .test-hero  { padding: 2.5rem var(--col-pad) 2rem; }
  .gauge-wrap { width: 290px; height: 195px; }
  .gauge-speed { font-size: 4rem; }

  .go-wrap { width: 200px; height: 200px; }
  .btn-go  { width: 144px; height: 144px; }
  .btn-go-text { font-size: 2.4rem; }

  .conn-bar { grid-template-columns: repeat(2,1fr); }
  .conn-item { border-right: none; border-bottom: 1px solid var(--border); }
  .conn-item:nth-child(odd)  { border-right: 1px solid var(--border); }
  .conn-item:nth-child(3),
  .conn-item:nth-child(4)    { border-bottom: none; }

  .scores-grid { grid-template-columns: repeat(3,1fr); gap: .5rem; }
  .metrics-grid { grid-template-columns: repeat(2,1fr); }
  .hist-entry { grid-template-columns: 1fr; gap: .5rem; }

  .cs-inner { flex-direction: column; text-align: center; }
  .cs-btns  { justify-content: center; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }

  .panel { border-radius: 0; border-left: none; border-right: none; margin-bottom: .5rem; }
  .plan-banner { border-radius: 0; margin-bottom: .5rem; }
}

/* ─ 560px: large phone ─ */
@media (max-width: 560px) {
  .gauge-wrap  { width: 255px; height: 172px; }
  .gauge-speed { font-size: 3.4rem; }
  .gauge-unit  { font-size: .75rem; }

  .live-stats  { grid-template-columns: repeat(3,1fr); }
  .ls-val      { font-size: .85rem; }

  .scores-grid  { grid-template-columns: repeat(2,1fr); }
  .metrics-grid { grid-template-columns: 1fr; }
  .wifi-grid    { grid-template-columns: repeat(2,1fr); }
  .device-grid  { grid-template-columns: repeat(2,1fr); }
  .info-grid    { grid-template-columns: repeat(2,1fr); }

  .go-wrap { width: 180px; height: 180px; }
  .btn-go  { width: 130px; height: 130px; }
  .btn-go-text { font-size: 2.1rem; }
  .btn-go-sub  { font-size: .52rem; }

  .test-steps .step-line { width: 16px; }
  .step-item span { font-size: .55rem; }

  .result-actions { justify-content: stretch; }
  .result-actions button { flex: 1; }
}

/* ─ 400px: small phone ─ */
@media (max-width: 400px) {
  .gauge-wrap  { width: 220px; height: 150px; }
  .gauge-speed { font-size: 2.9rem; }

  .go-wrap { width: 158px; height: 158px; }
  .btn-go  { width: 114px; height: 114px; }
  .btn-go-text { font-size: 1.85rem; }

  .conn-bar { grid-template-columns: 1fr 1fr; }
  .scores-grid { grid-template-columns: repeat(2,1fr); gap: .4rem; }
  .sc-score    { font-size: 1.75rem; }

  .panel { padding: 1rem; }
}

/* Print */
@media print {
  .header, .go-wrap, .contact-strip, .footer,
  .result-actions, .test-note, .plan-row,
  .page-sidebar, .ham-btn, .mobile-nav { display: none !important; }
  .panel { border: 1px solid #ccc; border-radius: 4px; break-inside: avoid; }
  body { background: #fff; color: #000; }
}
