/* ============================================================
   internet-speed-test.online - Design System
   Skeleton from Speedtest.now · look & structure from Sudoku.by
   "Signal / speed" palette: sky-blue primary + amber accent,
   dark navy hero so the glowing GO gauge pops.
   ============================================================ */

:root {
  /* Brand - Signal blue */
  --blue: #0ea5e9;
  --blue-dark: #0369a1;
  --blue-deep: #075985;
  --blue-light: #e0f2fe;
  --blue-border: #bae6fd;

  /* Accent - Amber (honours the original site's yellow) */
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --accent-light: #fffbeb;

  /* Ink & surfaces */
  --text: #0f172a;
  --text-muted: #475569;
  --text-light: #94a3b8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: #e2e8f0;
  --border-focus: #7dd3fc;

  /* Quality scale */
  --q-excellent: #10b981;
  --q-good: #0ea5e9;
  --q-fair: #f59e0b;
  --q-poor: #ef4444;

  /* Dark hero surfaces */
  --hero-bg: #0b1220;
  --hero-surface: #131c2e;
  --hero-raised: #1b263c;
  --hero-border: rgba(255, 255, 255, .09);
  --hero-text: #f1f5f9;
  --hero-muted: #94a3b8;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .08);
  --shadow: 0 4px 14px rgba(15, 23, 42, .10);
  --shadow-lg: 0 12px 34px rgba(15, 23, 42, .14);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --nav-height: 64px;
  --font: 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', 'Menlo', 'Consolas', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--surface-2);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-dark); text-decoration: none; }
a:hover { color: var(--blue-deep); }
img, video, iframe, svg { max-width: 100%; }
svg { display: block; }

/* ---- TYPOGRAPHY ---- */
h1, h2, h3, h4, h5, h6 { font-weight: 800; line-height: 1.2; color: var(--text); letter-spacing: -0.02em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
p { margin-bottom: 1rem; color: var(--text-muted); }
p:last-child { margin-bottom: 0; }

/* ---- LAYOUT ---- */
.container { max-width: 1160px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 760px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 3.25rem 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 2.25rem; }
.section-head p { font-size: 1.05rem; }
.eyebrow {
  display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--blue-dark); background: var(--blue-light);
  padding: .3rem .7rem; border-radius: 999px; margin-bottom: .85rem;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: inherit; font-weight: 600; font-size: .92rem; line-height: 1;
  padding: .7rem 1.25rem; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  cursor: pointer; transition: all .15s ease; white-space: nowrap;
}
.btn-sm { padding: .5rem .9rem; font-size: .84rem; }
.btn-lg { padding: .9rem 1.6rem; font-size: 1rem; }
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #3a2400; border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); color: #fff; border-color: var(--accent-dark); }
.btn-outline { background: transparent; color: var(--blue-dark); border-color: var(--blue-border); }
.btn-outline:hover { background: var(--blue-light); color: var(--blue-deep); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-full { width: 100%; }

/* ---- NAVIGATION ---- */
.site-nav {
  background: var(--surface); border-bottom: 1px solid var(--border);
  height: var(--nav-height); position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm);
}
.nav-inner { display: flex; align-items: center; height: 100%; gap: 0; }
.nav-logo {
  display: flex; align-items: center; gap: .5rem; font-size: 1.18rem; font-weight: 800;
  color: var(--text); letter-spacing: -0.02em; margin-right: 1.75rem; white-space: nowrap; flex-shrink: 0;
}
.nav-logo:hover { color: var(--text); }
.nav-logo .logo-mark {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-deep) 100%);
  display: grid; place-items: center; color: #fff;
}
.nav-logo b { color: var(--blue-dark); }
.nav-links { display: flex; align-items: center; gap: .1rem; flex: 1; list-style: none; }
.nav-links a, .nav-dropdown-trigger {
  display: flex; align-items: center; gap: .3rem; padding: .45rem .7rem; border-radius: var(--radius-sm);
  font-size: .89rem; font-weight: 500; color: var(--text); white-space: nowrap; cursor: pointer;
  transition: background .15s, color .15s; user-select: none;
}
.nav-links a:hover, .nav-links a.active,
.nav-dropdown-trigger:hover, .nav-has-dropdown:hover .nav-dropdown-trigger { background: var(--blue-light); color: var(--blue-dark); }

.nav-has-dropdown { position: relative; }
.nav-dropdown-trigger svg { flex-shrink: 0; transition: transform .15s; }
.nav-has-dropdown:hover .nav-dropdown-trigger svg { transform: rotate(180deg); }
/* top:100% keeps the panel flush with the trigger row so there is no dead gap
   to cross with the mouse (which was making it disappear). */
.nav-mega {
  position: absolute; top: 100%; left: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); width: 440px; max-width: calc(100vw - 2rem);
  padding: .4rem; display: none; z-index: 300;
}
/* transparent bridge fills the visual offset so hover is never lost */
.nav-has-dropdown::after { content: ""; position: absolute; top: 100%; left: 0; width: 200px; height: 8px; }
.nav-has-dropdown:hover .nav-mega { display: block; }
.nav-mega-cols { display: grid; grid-template-columns: 1fr 1fr; gap: .1rem; }
.nav-mega a {
  display: block; min-width: 0; padding: .55rem .7rem; font-size: .86rem; color: var(--text);
  border-radius: 6px; transition: background .1s, color .1s; font-weight: 500; overflow-wrap: anywhere;
}
.nav-mega a:hover { background: var(--blue-light); color: var(--blue-dark); }
.nav-actions { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }

.nav-hamburger { display: none; flex-direction: column; gap: 4px; width: 40px; height: 40px;
  align-items: center; justify-content: center; background: none; border: none; cursor: pointer; }
.nav-hamburger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }
.nav-hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile nav panel */
.nav-mobile-panel {
  position: fixed; inset: var(--nav-height) 0 0 0; background: var(--surface); z-index: 99;
  transform: translateX(100%); transition: transform .25s ease; overflow-y: auto; padding: 1rem 1.25rem 3rem;
}
.nav-mobile-panel.open { transform: translateX(0); }
.mob-link { display: block; padding: .8rem .5rem; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--border); }
.mob-link.active { color: var(--blue-dark); }
.nav-mobile-acc-btn { display: flex; justify-content: space-between; align-items: center; width: 100%;
  padding: .8rem .5rem; font-weight: 600; color: var(--text); background: none; border: none;
  border-bottom: 1px solid var(--border); cursor: pointer; font-family: inherit; font-size: 1rem; }
.nav-mobile-acc-btn svg { transition: transform .2s; }
.nav-mobile-acc-btn.open svg { transform: rotate(180deg); }
.nav-mobile-acc-body { display: none; padding: .25rem 0 .5rem .75rem; }
.nav-mobile-acc-body.open { display: block; }
.mob-sub-link { display: block; padding: .55rem .5rem; font-size: .9rem; color: var(--text-muted); }
.nav-mobile-actions { margin-top: 1.25rem; display: flex; flex-direction: column; gap: .6rem; }

/* ---- FLASH ---- */
.alert { padding: .85rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: .75rem; font-size: .92rem; }
.alert-info { background: var(--blue-light); color: var(--blue-deep); }
.alert-success { background: #dcfce7; color: #166534; }
.alert-danger { background: #fee2e2; color: #991b1b; }

/* ============================================================
   HERO - Dark, with the glowing GO gauge
   ============================================================ */
.hero {
  position: relative; overflow: hidden; color: var(--hero-text);
  background:
    radial-gradient(ellipse 60% 55% at 50% -5%, rgba(14,165,233,.30) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 85% 15%, rgba(245,158,11,.10) 0%, transparent 55%),
    var(--hero-bg);
  padding-top: 3rem;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--hero-border) 1px, transparent 1px),
                    linear-gradient(90deg, var(--hero-border) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 0%, transparent 75%);
}
.hero > * { position: relative; z-index: 1; }
.hero-headline { text-align: center; padding: 0 1rem 2rem; }
.hero-headline h1 { color: #fff; margin-bottom: .6rem; }
.hero-headline h1 span { color: var(--accent); }
.hero-headline p { color: var(--hero-muted); font-size: 1.1rem; max-width: 560px; margin: 0 auto; }
.hero-ip { display: inline-flex; align-items: center; gap: .5rem; margin-top: 1rem;
  font-family: var(--mono); font-size: .82rem; color: var(--hero-muted);
  background: rgba(255,255,255,.04); border: 1px solid var(--hero-border); padding: .4rem .8rem; border-radius: 999px; }
.hero-ip b { color: var(--hero-text); }

.hero-inner {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 2rem; align-items: center;
  min-height: 480px; padding-bottom: 1rem;
}

/* Context / metrics panels */
.test-panel {
  background: var(--hero-surface); border: 1px solid var(--hero-border); border-radius: var(--radius-lg);
  padding: 1.4rem; display: flex; flex-direction: column; min-width: 0;
}
.test-panel-right { gap: .8rem; }
.context-item { display: flex; align-items: flex-start; gap: .8rem; padding: .9rem 0; border-bottom: 1px solid var(--hero-border); }
.context-item:last-of-type { border-bottom: none; }
.context-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--hero-raised);
  display: grid; place-items: center; flex-shrink: 0; color: var(--blue); }
.context-icon svg { width: 18px; height: 18px; }
.context-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.context-label { font-size: .68rem; color: var(--hero-muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.context-value { font-size: .9rem; font-weight: 600; color: var(--hero-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 20px; }
.context-value.skeleton { color: var(--hero-muted); }
#ctx-ip-value { font-family: var(--mono); font-size: .78rem; }

.test-mode-toggle { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--hero-border); }
.toggle-label { font-size: .68rem; color: var(--hero-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.toggle-options { display: flex; gap: 2px; background: var(--hero-bg); padding: 3px; border-radius: 999px; }
.toggle-btn { padding: .3rem .85rem; font-size: .74rem; font-weight: 700; border-radius: 999px; border: none; background: transparent; color: var(--hero-muted); cursor: pointer; font-family: inherit; transition: all .15s; }
.toggle-btn.active { background: var(--accent); color: #3a2400; }

/* Center gauge */
.test-center { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; width: 280px; flex-shrink: 0; margin: 0 auto; }
.go-wrapper { position: relative; width: 260px; height: 260px; display: grid; place-items: center; flex-shrink: 0; }
.test-orbit-ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px dashed var(--hero-border); pointer-events: none; transition: border-color .4s; }
.test-orbit-ring.active { border-color: rgba(14,165,233,.55); animation: orbitSpin 3s linear infinite; }
@keyframes orbitSpin { to { transform: rotate(360deg); } }
.orbit-dot { position: absolute; top: -5px; left: calc(50% - 5px); width: 10px; height: 10px; background: var(--blue);
  border-radius: 50%; box-shadow: 0 0 10px var(--blue), 0 0 22px rgba(14,165,233,.7); opacity: 0; transition: opacity .15s; }
.test-orbit-ring.active .orbit-dot { opacity: 1; }
.test-progress-arc { position: absolute; inset: 12px; pointer-events: none; z-index: 1; opacity: 0; transition: opacity .25s; }
.test-progress-arc.visible { opacity: 1; }
.arc-bg { stroke: rgba(255,255,255,.07); }
.arc-fill { stroke: var(--blue); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 100px 100px;
  transition: stroke-dashoffset .25s linear; filter: drop-shadow(0 0 6px var(--blue)); }

.go-btn { position: relative; z-index: 2; width: 172px; height: 172px; border-radius: 50%;
  background: var(--hero-surface); border: 2.5px solid var(--blue); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; cursor: pointer;
  transition: background .2s, box-shadow .2s, transform .12s, color .12s;
  box-shadow: 0 0 0 12px rgba(14,165,233,.05), 0 0 0 24px rgba(14,165,233,.025); font-family: inherit; }
.go-btn:hover { background: var(--blue); color: #fff; transform: scale(1.05); }
.go-btn:active { transform: scale(.97); }
.go-btn.running { background: var(--hero-raised); cursor: default; animation: glowPulse 2s ease-in-out infinite; }
@keyframes glowPulse {
  0%,100% { box-shadow: 0 0 20px rgba(14,165,233,.2), 0 0 0 12px rgba(14,165,233,.05); }
  50% { box-shadow: 0 0 60px rgba(14,165,233,.55), 0 0 0 20px rgba(14,165,233,.09); }
}
.go-label { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.go-phase { font-size: .68rem; color: var(--blue); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; min-height: 15px; }

.test-live-number { font-family: var(--mono); display: flex; align-items: baseline; gap: .5rem; max-height: 0; overflow: hidden; opacity: 0; transition: max-height .3s ease, opacity .3s ease; }
.test-live-number.visible { max-height: 60px; opacity: 1; }
#live-value { font-size: 2.4rem; font-weight: 800; color: var(--accent); }
.live-unit { font-size: 1rem; color: var(--hero-muted); }

.retest-btn { margin-top: .25rem; }

/* Metric cards */
.metric-card { background: var(--hero-raised); border: 1px solid var(--hero-border); border-radius: var(--radius); padding: 1rem 1.1rem; transition: border-color .2s; }
.metric-card.active { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.metric-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .7rem; }
.metric-icon { width: 18px; height: 18px; color: var(--blue); }
.metric-name { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--hero-muted); }
.metric-value-row { display: flex; align-items: baseline; gap: .4rem; margin-bottom: .7rem; }
.metric-value { font-family: var(--mono); font-size: 1.9rem; font-weight: 800; color: #fff; line-height: 1; transition: color .15s; }
.metric-value.excellent { color: var(--q-excellent); }
.metric-value.good { color: var(--q-good); }
.metric-value.fair { color: var(--q-fair); }
.metric-value.poor { color: var(--q-poor); }
.metric-unit { font-size: .85rem; color: var(--hero-muted); }
.metric-bar { height: 4px; background: var(--hero-border); border-radius: 999px; overflow: hidden; }
.metric-bar-fill { height: 100%; background: linear-gradient(90deg, var(--blue-deep), var(--blue)); border-radius: 999px; width: 0; transition: width .3s ease; }
.metric-row-pair { display: flex; gap: .8rem; }
.metric-mini { flex: 1; background: var(--hero-raised); border: 1px solid var(--hero-border); border-radius: 10px; padding: .75rem .9rem; display: flex; flex-direction: column; gap: 2px; }
.metric-mini-label { font-size: .68rem; color: var(--hero-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.metric-mini-value { font-family: var(--mono); font-size: 1.35rem; font-weight: 800; color: #fff; line-height: 1.2; }
.metric-mini-unit { font-size: .68rem; color: var(--hero-muted); }

/* Trust bar */
.trust-bar { display: flex; align-items: center; justify-content: center; gap: 2rem; padding: 1.4rem 0 2.4rem; flex-wrap: wrap; }
.trust-item { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--hero-muted); }
.trust-item svg { color: var(--blue); flex-shrink: 0; }

/* ============================================================
   CONTENT (light) - Sudoku.by-style cards & prose
   ============================================================ */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 1.1rem; }
.hub-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem;
  transition: transform .15s, box-shadow .15s, border-color .15s; display: flex; flex-direction: column; gap: .5rem;
}
.hub-card:hover { transform: translateY(-3px); border-color: var(--blue-border); }
.hub-card-icon { width: 44px; height: 44px; border-radius: 11px; background: var(--blue-light); color: var(--blue-dark); display: grid; place-items: center; margin-bottom: .3rem; }
.hub-card-icon svg { width: 22px; height: 22px; }
.hub-card h3 { font-size: 1.05rem; }
.hub-card p { font-size: .9rem; margin: 0; }
.hub-card .hub-more { margin-top: auto; font-size: .85rem; font-weight: 600; color: var(--blue-dark); display: inline-flex; align-items: center; gap: .3rem; }

/* Feature row */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.feature { text-align: center; }
.feature-icon { width: 52px; height: 52px; margin: 0 auto 1rem; border-radius: 14px; background: var(--blue-light); color: var(--blue-dark); display: grid; place-items: center; }
.feature h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.feature p { font-size: .92rem; }

/* Stat strip */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.stat { text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem 1rem; }
.stat-num { font-family: var(--mono); font-size: 2rem; font-weight: 800; color: var(--blue-dark); line-height: 1; }
.stat-label { font-size: .85rem; color: var(--text-muted); margin-top: .35rem; }

/* ---- ARTICLE / PROSE ---- */
.article-hero { background: var(--surface); border-bottom: 1px solid var(--border); padding: 2.75rem 0 2.25rem; }
.breadcrumb { font-size: .82rem; color: var(--text-light); margin-bottom: .9rem; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--blue-dark); }
.article-banner { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover;
  border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow);
  margin-top: -1.5rem; margin-bottom: -1rem; position: relative; z-index: 1; background: var(--hero-bg); }
.article-hero h1 { max-width: 820px; }
.article-hero .lead { font-size: 1.15rem; color: var(--text-muted); max-width: 720px; margin-top: .9rem; }
.article-meta { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.1rem; font-size: .82rem; color: var(--text-light); }

.article-layout { display: grid; grid-template-columns: 1fr 280px; gap: 2.5rem; align-items: start; }
.prose { max-width: 760px; }
.prose > h2 { margin: 2.2rem 0 .9rem; padding-top: .4rem; }
.prose > h3 { margin: 1.6rem 0 .6rem; }
.prose p { font-size: 1.02rem; line-height: 1.75; }
.prose ul, .prose ol { margin: 0 0 1.1rem 1.25rem; color: var(--text-muted); }
.prose li { margin-bottom: .5rem; line-height: 1.7; }
.prose ul li::marker { color: var(--blue); }
.prose strong { color: var(--text); }
.prose a { color: var(--blue-dark); text-decoration: underline; text-underline-offset: 2px; }
.prose img { border-radius: var(--radius); border: 1px solid var(--border); margin: 1.5rem 0; }
.prose figure { margin: 1.5rem 0; }
.prose figcaption { font-size: .82rem; color: var(--text-light); text-align: center; margin-top: .5rem; }

.callout { background: var(--blue-light); border: 1px solid var(--blue-border); border-left: 4px solid var(--blue);
  border-radius: var(--radius); padding: 1.1rem 1.25rem; margin: 1.5rem 0; }
.callout p { color: var(--blue-deep); margin: 0; }
.callout.accent { background: var(--accent-light); border-color: #fde68a; border-left-color: var(--accent); }
.callout.accent p { color: #78350f; }
.callout .callout-title { font-weight: 700; color: var(--text); display: block; margin-bottom: .3rem; }

.key-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.4rem; margin: 1.25rem 0 1.75rem; }
.key-box .minihead { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--blue-dark); margin-bottom: .6rem; }
.key-box ul { margin: 0 0 0 1.1rem; }
.key-box li { font-size: .95rem; }

/* ---- TABLES ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); margin: 1.5rem 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--surface); min-width: 560px; }
.data-table th { text-align: left; padding: .8rem 1rem; background: var(--surface-3); color: var(--text-muted);
  font-weight: 700; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: .8rem 1rem; border-top: 1px solid var(--border); color: var(--text-muted); vertical-align: middle; }
.data-table tr:hover td { background: var(--surface-2); }
.data-table td:first-child, .data-table th:first-child { position: sticky; left: 0; }
.data-table .rank { font-family: var(--mono); font-weight: 700; color: var(--blue-dark); width: 44px; }
.data-table .name { color: var(--text); font-weight: 600; }
.data-table .cell-sub { display: block; font-size: .78rem; font-weight: 400; color: var(--text-light); margin-top: 3px; max-width: 340px; line-height: 1.35; }
.tag { display: inline-block; font-size: .72rem; font-weight: 600; padding: .18rem .55rem; border-radius: 999px; white-space: nowrap; }
.tag-fiber { background: #dcfce7; color: #166534; }
.tag-cable { background: var(--blue-light); color: var(--blue-deep); }
.tag-wireless { background: #f3e8ff; color: #6b21a8; }
.tag-satellite { background: var(--accent-light); color: #92400e; }
.tag-dsl { background: var(--surface-3); color: var(--text-muted); }
.badge-excellent { color: var(--q-excellent); font-weight: 700; }
.badge-good { color: var(--q-good); font-weight: 700; }
.badge-fair { color: var(--q-fair); font-weight: 700; }
.badge-poor { color: var(--q-poor); font-weight: 700; }

/* ---- FAQ ---- */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .75rem; background: var(--surface); overflow: hidden; }
.faq-q { display: flex; justify-content: space-between; align-items: center; gap: 1rem; width: 100%; text-align: left;
  padding: 1.1rem 1.3rem; font-weight: 600; font-size: 1rem; color: var(--text); background: none; border: none; cursor: pointer; font-family: inherit; }
.faq-q svg { flex-shrink: 0; color: var(--blue); transition: transform .2s; }
.faq-item.open .faq-q svg { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.faq-a-inner { padding: 0 1.3rem 1.2rem; color: var(--text-muted); font-size: .96rem; line-height: 1.7; }
.faq-item.open .faq-a { max-height: 400px; }

/* ---- Sidebar (TOC + related) ---- */
.sidebar { position: sticky; top: calc(var(--nav-height) + 1rem); display: flex; flex-direction: column; gap: 1.25rem; }
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.side-card .minihead { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-light); margin-bottom: .7rem; }
.side-card ul { list-style: none; display: flex; flex-direction: column; gap: .1rem; }
.side-card li a { display: block; padding: .4rem .5rem; border-radius: 6px; font-size: .88rem; color: var(--text-muted); }
.side-card li a:hover { background: var(--blue-light); color: var(--blue-dark); }
.side-cta { background: linear-gradient(135deg, var(--blue-deep), var(--blue-dark)); color: #fff; text-align: center; }
.side-cta .minihead { color: rgba(255,255,255,.7); }
.side-cta p { color: rgba(255,255,255,.85); font-size: .88rem; margin-bottom: .9rem; }

/* ---- Read next ---- */
.read-next { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 1rem; }
.read-next a { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; transition: border-color .15s, transform .15s; }
.read-next a:hover { border-color: var(--blue-border); transform: translateY(-2px); }
.read-next .rn-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-light); }
.read-next .rn-title { display: block; margin-top: .3rem; font-weight: 700; color: var(--text); font-size: .98rem; }

/* ---- CTA band ---- */
.cta-band { background: linear-gradient(135deg, var(--blue-deep), var(--blue-dark)); color: #fff; border-radius: var(--radius-lg); padding: 2.5rem; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.85); max-width: 540px; margin: .6rem auto 1.4rem; }

/* ---- FOOTER ---- */
.site-footer { background: var(--hero-bg); color: var(--hero-muted); padding: 3rem 0 1.5rem; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
.footer-brand { display: flex; align-items: center; gap: .5rem; font-size: 1.15rem; font-weight: 800; color: #fff; margin-bottom: .8rem; }
.footer-brand .logo-mark { width: 28px; height: 28px; border-radius: 7px; background: linear-gradient(135deg, var(--blue), var(--blue-deep)); display: grid; place-items: center; }
.footer-desc { font-size: .88rem; line-height: 1.7; max-width: 300px; }
.footer-heading { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: #cbd5e1; margin-bottom: .9rem; font-weight: 700; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: .55rem; }
.footer-links a { color: var(--hero-muted); font-size: .88rem; }
.footer-links a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-top: 2.25rem; padding-top: 1.5rem; border-top: 1px solid var(--hero-border); font-size: .82rem; color: var(--text-light); }

/* ---- Error pages ---- */
.error-page { text-align: center; padding: 5rem 1.5rem; }
.error-page .code { font-family: var(--mono); font-size: 5rem; font-weight: 800; color: var(--blue-light); line-height: 1; }
.error-page h1 { margin: .5rem 0 .75rem; }

/* ---- utilities ---- */
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none; }
.skeleton { position: relative; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1000px) {
  .nav-links, .nav-actions .btn { display: none; }
  .nav-hamburger { display: flex; }
  .article-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .test-panel-left { order: 2; }
  .test-center { order: 1; }
  .test-panel-right { order: 3; }
}
@media (max-width: 560px) {
  .container { padding: 0 1.1rem; }
  .go-wrapper { width: 220px; height: 220px; }
  .go-btn { width: 148px; height: 148px; }
  .go-label { font-size: 2.1rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .trust-bar { gap: 1rem; }
}

/* ---- Overflow safety (no horizontal side-scroll) ---- */
.hero-ip { max-width: 100%; overflow-wrap: anywhere; }
.test-center { max-width: 100%; }
#ctx-ip-value, #hero-ip-value { overflow-wrap: anywhere; }
.data-table td, .data-table th { overflow-wrap: anywhere; }

/* ---- Touch devices: comfortable tap targets (min ~44px) ---- */
@media (pointer: coarse) {
  .toggle-btn { min-height: 40px; padding-inline: 1.15rem; }
  .toggle-options { padding: 4px; }
  .nav-hamburger { width: 44px; height: 44px; }
  .faq-q { min-height: 54px; }
  .btn, .btn-sm { min-height: 44px; }
  .footer-links a { display: inline-flex; align-items: center; min-height: 36px; }
  .side-card li a { min-height: 40px; display: flex; align-items: center; }
  .nav-links a, .nav-dropdown-trigger { min-height: 40px; }
  .change-server-btn, .breadcrumb a { padding-block: .25rem; }
}
