:root {
  --orange: #e85d04;
  --orange-accent: #ff7a2f;
  --orange-deep: #c44d00;
  --orange-soft: rgba(232, 93, 4, .10);
  --bg: #f6f7fa;
  --bg-alt: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --surface-strong: #121a2a;
  --text: #172033;
  --text-strong: #0d1422;
  --muted: #6f7888;
  --muted-2: #9aa2af;
  --border: #dfe3e9;
  --border-strong: #cdd3dc;
  --download: #e85d04;
  --upload: #ff8a4c;
  --ping: #e4a100;
  --jitter: #7c63c9;
  --danger: #d93b3b;
  --success: #1b9a5a;
  --header-bg: rgba(255,255,255,.92);
  --shadow-sm: 0 8px 24px rgba(20, 28, 45, .07);
  --shadow: 0 24px 70px rgba(20, 28, 45, .12);
  --gauge-track: #e5e8ed;
  --gauge-tick: #858d9a;
  --input-bg: #fff;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #080b11;
  --bg-alt: #0c111b;
  --surface: #111722;
  --surface-2: #151d2a;
  --surface-strong: #080b11;
  --text: #eef2f8;
  --text-strong: #ffffff;
  --muted: #a4adbb;
  --muted-2: #798392;
  --border: rgba(255,255,255,.11);
  --border-strong: rgba(255,255,255,.18);
  --header-bg: rgba(7, 10, 15, .91);
  --shadow-sm: 0 10px 28px rgba(0,0,0,.28);
  --shadow: 0 28px 80px rgba(0,0,0,.38);
  --gauge-track: #272d37;
  --gauge-tick: #9ba3af;
  --input-bg: #0d131d;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 6rem, rgba(232,93,4,.08), transparent 24rem),
    var(--bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  transition: background-color .25s ease, color .25s ease;
}
button, select { font: inherit; }
button { color: inherit; }
button:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(232,93,4,.35); outline-offset: 3px; }
img, svg { display: block; }
h1, h2, h3, p { margin-top: 0; }
h2 { margin-bottom: .35rem; color: var(--text-strong); font-size: clamp(1.25rem, 2.6vw, 1.7rem); }
h3 { margin: 0; color: var(--text-strong); font-size: 1.05rem; }
.mono { font-family: "Roboto Mono", ui-monospace, monospace; }
.visually-hidden { position: absolute!important; width: 1px!important; height: 1px!important; padding: 0!important; margin: -1px!important; overflow: hidden!important; clip: rect(0,0,0,0)!important; white-space: nowrap!important; border: 0!important; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 999; padding: .75rem 1rem; color: #111; background: #fff; border-radius: .5rem; }
.skip-link:focus { top: 1rem; }

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: 68px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(232,93,4,.08);
  backdrop-filter: blur(18px);
}
.header-inner {
  width: min(1220px, calc(100% - 2rem));
  height: 100%;
  margin: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 1.2rem;
}
.brand { display: inline-flex; align-items: center; gap: .7rem; width: fit-content; color: var(--text-strong); text-decoration: none; }
.brand img { filter: drop-shadow(0 5px 13px rgba(232,93,4,.18)); }
.brand-copy { display: flex; flex-direction: column; line-height: 1.03; letter-spacing: .035em; }
.brand-copy strong { font-size: .92rem; }
.brand-copy small { margin-top: .22rem; color: var(--orange); font-size: .58rem; font-weight: 700; letter-spacing: .2em; }
.header-actions { justify-self: end; display: flex; align-items: center; gap: .75rem; }
.server-button {
  display: flex;
  align-items: center;
  gap: .58rem;
  max-width: 295px;
  min-width: 205px;
  padding: .48rem .75rem;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface-2);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.server-button:hover { border-color: rgba(232,93,4,.42); }
.server-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; text-align: left; line-height: 1.08; }
.server-copy small { color: var(--muted-2); font-size: .5rem; font-weight: 700; letter-spacing: .13em; }
.server-copy strong { margin-top: .16rem; overflow: hidden; color: var(--text-strong); text-overflow: ellipsis; white-space: nowrap; font-size: .7rem; }
.server-button > svg { width: 15px; flex: 0 0 auto; fill: var(--muted); }
.status-dot { width: .55rem; height: .55rem; flex: 0 0 auto; border-radius: 50%; background: #e4a100; box-shadow: 0 0 0 4px rgba(228,161,0,.12); }
.status-dot.ready { background: var(--success); box-shadow: 0 0 0 4px rgba(27,154,90,.12); }
.theme-toggle {
  display: flex;
  align-items: center;
  gap: .3rem;
  height: 38px;
  padding: 0 .45rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 999px;
  cursor: pointer;
}
.theme-toggle > span:not(.toggle-track) { width: 16px; color: var(--muted); text-align: center; font-size: .76rem; }
.toggle-track { position: relative; width: 31px; height: 17px; background: var(--border-strong); border-radius: 999px; }
.toggle-track span { position: absolute; top: 3px; left: 3px; width: 11px; height: 11px; background: var(--surface); border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s ease; }
html[data-theme="dark"] .toggle-track { background: var(--orange); }
html[data-theme="dark"] .toggle-track span { transform: translateX(14px); }

main { padding-top: 68px; }
.shared-result-banner { position: sticky; top: 68px; z-index: 30; display: flex; align-items: center; justify-content: center; gap: 1rem; padding: .75rem 1rem; color: #5e2600; background: #fff0e5; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.shared-result-banner div { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
.shared-result-banner button { border: 0; color: inherit; background: transparent; cursor: pointer; font-size: 1.3rem; }

.speed-stage {
  min-height: 720px;
  padding: 1.6rem 1rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.test-tabs { display: flex; align-items: center; gap: .4rem; min-height: 34px; margin-bottom: .8rem; }
.test-tab { padding: .45rem .62rem; border: 0; color: var(--muted-2); background: transparent; border-radius: .55rem; cursor: pointer; font-size: .66rem; font-weight: 600; letter-spacing: .035em; }
.test-tab span { margin-right: .22rem; }
.test-tab.active { color: var(--orange); background: var(--orange-soft); }
.test-tab:hover { color: var(--text-strong); }
.test-console { width: min(690px, 100%); text-align: center; }
.headline-results { min-height: 78px; display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: start; padding: 0 3.6rem; }
.headline-metric { min-width: 0; }
.metric-label { display: flex; align-items: center; justify-content: center; gap: .3rem; color: var(--muted); font-size: .74rem; font-weight: 500; letter-spacing: .01em; }
.metric-label small { color: var(--muted-2); font-size: .7rem; }
.metric-icon { width: 18px; height: 18px; display: inline-grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-weight: 700; line-height: 1; }
.download-metric .metric-icon { color: var(--download); }
.upload-metric .metric-icon { color: var(--upload); }
.headline-metric > strong { display: block; min-height: 48px; margin-top: .08rem; color: var(--text-strong); font-size: clamp(2.15rem, 6vw, 3.05rem); font-weight: 300; line-height: 1; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.metric-progress { width: 100%; height: 2px; margin-top: .4rem; overflow: hidden; background: var(--border); border-radius: 999px; }
.metric-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--orange-deep), var(--orange-accent)); transition: width .2s linear; }
.latency-row { position: relative; min-height: 35px; display: flex; align-items: center; justify-content: center; gap: 1.05rem; margin-top: .2rem; color: var(--muted); font-size: .73rem; }
.latency-title { color: var(--text); }
.latency-item { display: inline-flex; align-items: center; gap: .32rem; }
.latency-item i { width: 17px; height: 17px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-style: normal; font-size: .62rem; }
.latency-item.ping i { color: var(--ping); }
.latency-item.jitter i { color: var(--jitter); }
.latency-item strong { min-width: 26px; color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.latency-progress { position: absolute; left: 50%; bottom: -2px; width: 140px; height: 1px; transform: translateX(-50%); overflow: hidden; background: transparent; }
.latency-progress span { display: block; width: 0; height: 100%; background: var(--ping); }
.quality-chip { padding: .18rem .46rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; font-size: .58rem; }
.connection-summary {
  width: min(620px, 100%);
  margin: -.2rem auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.connection-party {
  display: flex;
  align-items: center;
  gap: .78rem;
  min-width: 0;
  text-align: left;
}

.connection-party > span:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.party-icon {
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
}

.party-icon svg {
  width: 21px;
  fill: var(--muted);
}

.provider-summary {
  justify-content: center;
}

.provider-live-card {
  width: min(590px, 100%);
  justify-content: center;
}

.provider-live-copy {
  max-width: 530px;
}

.provider-live-copy strong {
  overflow: visible;
  color: var(--success);
  text-overflow: clip;
  white-space: normal;
  font-size: 1.03rem;
  font-weight: 700;
  line-height: 1.18;
}

.provider-live-copy small {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .18rem;
  overflow: visible;
  color: var(--muted);
  text-overflow: clip;
  white-space: normal;
  font-size: .72rem;
  line-height: 1.25;
}

.provider-party-icon svg {
  fill: var(--muted);
}

.provider-meta-dot {
  opacity: .6;
}
.test-message { min-height: 1.4rem; max-width: 620px; margin: 1rem auto .3rem; color: var(--muted); font-size: .76rem; }
.test-message.error { color: var(--danger); }
.cancel-test-button { margin-top: .25rem; color: var(--danger); }
.action-buttons { display: flex; justify-content: center; gap: .7rem; margin-top: .85rem; }
.primary-button, .secondary-button { min-height: 42px; padding: .68rem 1.2rem; border-radius: 999px; font-weight: 700; cursor: pointer; }
.primary-button { width: 100%; border: 0; color: #fff; background: linear-gradient(135deg, var(--orange-deep), var(--orange-accent)); box-shadow: 0 8px 20px rgba(232,93,4,.2); }
.primary-button:hover { filter: brightness(1.04); }
.secondary-button { border: 1px solid rgba(232,93,4,.45); color: var(--orange-deep); background: var(--orange-soft); }
html[data-theme="dark"] .secondary-button { color: var(--orange-accent); }
.compact-button { width: auto; min-width: 120px; }
.text-button { padding: .35rem .45rem; border: 0; color: var(--orange); background: transparent; cursor: pointer; font-size: .72rem; font-weight: 600; }

.results-section, .network-section, .history-section { width: min(1120px, calc(100% - 2rem)); margin: 0 auto 2rem; }
.results-section { scroll-margin-top: 90px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 1rem; }
.section-heading > p { max-width: 520px; margin-bottom: .2rem; color: var(--muted); text-align: right; font-size: .78rem; }
.section-heading.compact { align-items: center; }
.eyebrow { margin: 0 0 .3rem; color: var(--orange); font-size: .62rem; font-weight: 700; letter-spacing: .16em; }
.result-date { color: var(--muted); font-size: .72rem; }
.proof-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.proof-card { min-width: 0; min-height: 92px; display: flex; align-items: center; gap: .72rem; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 15px; box-shadow: var(--shadow-sm); }
.proof-card.wide { grid-column: span 2; }
.proof-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; color: var(--orange); background: var(--orange-soft); border-radius: 50%; font-size: .85rem; font-weight: 700; }
.proof-card > div { min-width: 0; display: flex; flex-direction: column; }
.proof-card small { color: var(--muted-2); font-size: .54rem; font-weight: 700; letter-spacing: .11em; }
.proof-card strong { margin-top: .16rem; overflow: hidden; color: var(--text-strong); text-overflow: ellipsis; white-space: nowrap; font-size: .72rem; }
#backend-status.verified { color: var(--success); }
.network-section { margin-top: 3.2rem; }
.network-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 1rem; align-items: stretch; }
.network-card { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-sm); }
.card-heading { min-height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); }
.card-kicker { color: var(--orange); font-size: .55rem; font-weight: 700; letter-spacing: .14em; }
.card-symbol { width: 38px; height: 38px; display: grid; place-items: center; color: var(--orange); background: var(--orange-soft); border-radius: 12px; font-size: .7rem; font-weight: 700; }

.site-footer { display: grid; grid-template-columns: 1fr 1.35fr 1fr; align-items: center; gap: 2rem; padding: 1.45rem max(1rem, calc((100% - 1120px) / 2)); color: var(--muted); background: var(--surface); border-top: 1px solid var(--border); font-size: .68rem; }
.footer-brand { display: flex; align-items: center; gap: .65rem; }
.footer-brand span { display: flex; flex-direction: column; }
.footer-brand strong { color: var(--text-strong); }
.footer-brand small { color: var(--orange); }
.site-footer p { margin: 0; text-align: center; }
.engine-credit { text-align: right!important; }

.settings-modal { width: min(590px, calc(100% - 2rem)); padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); }
.settings-modal::backdrop { background: rgba(3, 6, 12, .66); backdrop-filter: blur(6px); }
.settings-modal form { padding: 1.4rem; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.close-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--border); color: var(--muted); background: var(--surface-2); border-radius: 50%; cursor: pointer; font-size: 1.3rem; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; margin: 1rem 0; }
.settings-grid label:first-child { grid-column: 1 / -1; }
.settings-modal label { display: flex; flex-direction: column; gap: .4rem; color: var(--muted); font-size: .72rem; }
.settings-modal select { width: 100%; min-height: 44px; padding: .7rem .8rem; color: var(--text); background: var(--input-bg); border: 1px solid var(--border); border-radius: .7rem; }
.settings-note { margin: 1rem 0; padding: .85rem; background: var(--orange-soft); border: 1px solid rgba(232,93,4,.22); border-radius: .75rem; }
.settings-note p { margin: .2rem 0 0; color: var(--muted); font-size: .72rem; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 1.5rem; transform: translateX(-50%); padding: .75rem 1rem; color: #fff; background: #171e2a; border-radius: 999px; box-shadow: var(--shadow); font-weight: 700; font-size: .75rem; }
[hidden] { display: none!important; }

@media (max-width: 980px) {
  .header-inner { grid-template-columns: 1fr auto; }
  .proof-grid { grid-template-columns: repeat(2, 1fr); }
  .network-grid { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr; text-align: center; }
  .footer-brand { justify-content: center; }
  .engine-credit { text-align: center!important; }
}

@media (max-width: 700px) {
  .site-header { height: 62px; }
  .header-inner { width: calc(100% - 1.2rem); gap: .5rem; }
  .brand-copy small { display: none; }
  .brand img { width: 35px; height: 35px; }
  .server-button { min-width: 0; max-width: 165px; padding: .42rem .58rem; }
  .server-copy small { display: none; }
  .server-copy strong { font-size: .62rem; }
  .theme-toggle > span:not(.toggle-track) { display: none; }
  main { padding-top: 62px; }
  .shared-result-banner { top: 62px; }
  .speed-stage { min-height: 660px; padding-top: 1rem; }
  .headline-results { gap: 1.2rem; padding: 0 1rem; }
  .connection-link i { width: 11px; }
  .party-icon { width: 34px; height: 34px; }
  .proof-card.wide { grid-column: span 1; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: .25rem; }
  .section-heading > p { text-align: left; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid label:first-child { grid-column: auto; }
}

@media (max-width: 620px) {
  .brand-copy strong { font-size: .78rem; }
  .proof-grid { grid-template-columns: 1fr; }
  .latency-row { gap: .62rem; }
  .quality-chip { display: none; }
  .results-section, .network-section, .history-section { width: min(100% - 1.1rem, 1120px); }
  .site-footer { padding: 1.2rem; }
}

@media (max-width: 420px) {
  .brand-copy { display: none; }
  .server-button { max-width: 145px; }
  .headline-results { gap: .5rem; padding: 0; }
  .metric-label { font-size: .64rem; }
  .metric-label small { display: none; }
  .party-icon { margin: auto; }
}

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

/* v1.3 compact completed state and social sharing */
.completed-summary {
  width: min(540px, 100%);
  margin: .9rem auto 0;
  padding: 1rem 1.05rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}
.completed-identity {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: .2rem .8rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.completed-identity > span {
  grid-column: 1 / -1;
  color: var(--muted-2);
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .13em;
}
.completed-identity strong {
  color: var(--orange);
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}
.completed-identity p {
  margin: 0;
  color: var(--text);
  font-size: .72rem;
  text-align: right;
}
.share-heading {
  margin: .8rem 0 .55rem;
  color: var(--muted);
  font-size: .64rem;
  font-weight: 600;
}
.social-share {
  display: flex;
  justify-content: center;
  gap: .55rem;
}
.social-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 800;
  box-shadow: 0 7px 18px rgba(0,0,0,.12);
  transition: transform .18s ease, filter .18s ease;
}
.social-button:hover { transform: translateY(-2px); filter: brightness(1.05); }
.social-button.whatsapp { background: #25d366; }
.social-button.facebook { background: #1877f2; font-size: 1rem; }
.social-button.x-share { background: #111; }
.social-button.linkedin { background: #0a66c2; }
.social-button.copy-link { color: var(--text-strong); background: var(--surface-2); border: 1px solid var(--border); }
.more-details-button {
  margin-top: .85rem;
  padding: .35rem .7rem;
  border: 0;
  color: var(--orange);
  background: transparent;
  cursor: pointer;
  font-size: .7rem;
  font-weight: 700;
}
.more-details-button::after { content: " ↓"; }
.more-details-button[aria-expanded="true"]::after { content: " ↑"; }
.details-container { padding-top: .35rem; }

.public-test-providers {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem .9rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: .75rem;
}
.public-test-providers > div:first-child { display: flex; flex-direction: column; gap: .15rem; }
.public-test-providers strong { color: var(--text-strong); font-size: .72rem; }
.public-test-providers span { color: var(--muted); font-size: .62rem; }
.provider-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.provider-links a {
  padding: .34rem .58rem;
  color: var(--orange-deep);
  background: var(--orange-soft);
  border: 1px solid rgba(232,93,4,.2);
  border-radius: 999px;
  text-decoration: none;
  font-size: .62rem;
  font-weight: 700;
}
html[data-theme="dark"] .provider-links a { color: var(--orange-accent); }

@media (max-width: 620px) {
  .completed-identity { grid-template-columns: 1fr; }
  .completed-identity p { text-align: left; }
  .public-test-providers { align-items: flex-start; flex-direction: column; }
  .provider-links { justify-content: flex-start; }
}

/* v1.4 startup provider detection and collision-safe live metrics */
.test-console { container-type: inline-size; }
.headline-results {
  width: 100%;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1rem, 8vw, 5rem);
}
.headline-metric { overflow: hidden; }
.headline-metric > strong {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
  font-size: clamp(1.75rem, 8.5cqw, 3.05rem);
  line-height: 1.08;
  letter-spacing: -.045em;
}
.metric-label { min-height: 20px; white-space: nowrap; }
.latency-row { flex-wrap: wrap; row-gap: .35rem; }

.idle-provider {
  width: fit-content;
  max-width: min(430px, 100%);
  min-height: 58px;
  margin: -.55rem auto .25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  padding: .45rem .85rem;
  color: var(--text);
  border-radius: 999px;
  transition: opacity .22s ease, transform .22s ease;
}
.provider-globe {
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.provider-globe svg { width: 25px; height: 25px; fill: currentColor; }
.provider-copy { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.provider-name-row { min-width: 0; display: flex; align-items: center; gap: .48rem; }
.provider-name-row strong {
  max-width: min(320px, 62vw);
  overflow: hidden;
  color: var(--success);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 650;
}
.provider-name-row i {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-right: 3px solid var(--success);
  border-bottom: 3px solid var(--success);
  transform: translateY(-2px) rotate(45deg);
  border-radius: 1px;
}
.provider-copy small { margin-top: .18rem; color: var(--muted); font-size: .7rem; font-weight: 500; }

body:not([data-test-state="IDLE"]):not([data-test-state="SELECTING"]):not([data-test-state="VERIFYING"]) .idle-provider {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}
body[data-test-state="IDLE"] .connection-summary,
body[data-test-state="SELECTING"] .connection-summary,
body[data-test-state="VERIFYING"] .connection-summary { display: none; }
body[data-test-state="IDLE"] .idle-provider,
body[data-test-state="SELECTING"] .idle-provider,
body[data-test-state="VERIFYING"] .idle-provider { opacity: 1; transform: none; }
body[data-test-state="SELECTING"] .provider-globe,
body[data-test-state="VERIFYING"] .provider-globe { animation: provider-turn 1.8s linear infinite; }
body[data-test-state="SELECTING"] .provider-name-row strong,
body[data-test-state="VERIFYING"] .provider-name-row strong { animation: provider-soft-blink 1.15s ease-in-out infinite; }

@keyframes provider-turn { to { transform: rotate(360deg); } }
@keyframes provider-soft-blink { 0%,100% { opacity: .48; } 50% { opacity: 1; } }

@container (max-width: 480px) {
  .headline-results { gap: .45rem; padding-inline: 0; }
  .headline-metric > strong { min-height: 43px; font-size: clamp(1.48rem, 10cqw, 2.3rem); }
  .metric-label { gap: .2rem; font-size: .61rem; }
  .metric-label small { display: none; }
  .latency-row { gap: .5rem; }
}

@media (max-width: 420px) {
  .idle-provider { margin-top: -.9rem; padding-inline: .35rem; }
  .provider-name-row strong { max-width: 220px; font-size: .9rem; }
  .provider-copy small { font-size: .64rem; }
}
body:not([data-test-state="IDLE"]):not([data-test-state="SELECTING"]):not([data-test-state="VERIFYING"]) .idle-provider { display: none; }
.headline-results, .latency-row { transition: opacity .2s ease, transform .2s ease; }
body[data-test-state="IDLE"] .headline-results,
body[data-test-state="IDLE"] .latency-row,
body[data-test-state="SELECTING"] .headline-results,
body[data-test-state="SELECTING"] .latency-row,
body[data-test-state="VERIFYING"] .headline-results,
body[data-test-state="VERIFYING"] .latency-row {
  visibility: hidden;
  opacity: 0;
  transform: translateY(-4px);
}
/* Keep the ready/loading screen compact; live metrics appear only after measurement starts. */
body[data-test-state="IDLE"] .headline-results,
body[data-test-state="IDLE"] .latency-row,
body[data-test-state="SELECTING"] .headline-results,
body[data-test-state="SELECTING"] .latency-row,
body[data-test-state="VERIFYING"] .headline-results,
body[data-test-state="VERIFYING"] .latency-row { display: none; }


.network-grid.identity-only {
  grid-template-columns: minmax(0, 1fr);
}

.network-grid.identity-only .network-card {
  width: 100%;
}


@media (max-width: 700px) {
  .provider-live-card {
    width: min(520px, 100%);
  }

  .provider-live-copy strong {
    font-size: .92rem;
  }

  .provider-live-copy small {
    font-size: .66rem;
  }
}

@media (max-width: 420px) {
  .provider-live-card {
    align-items: center;
    gap: .58rem;
  }

  .provider-live-copy strong {
    font-size: .84rem;
  }

  .provider-live-copy small {
    font-size: .61rem;
  }

  .party-icon {
    width: 37px;
    height: 37px;
  }
}


/* Provider card refinement: full text, centered, white + orange */
.provider-summary {
  width: min(760px, 92vw);
  margin-left: auto;
  margin-right: auto;
}

.provider-live-card {
  width: 100%;
  max-width: 760px;
  justify-content: flex-start;
  padding: .78rem 1rem;
  border: 1px solid rgba(232, 93, 4, .28);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.01));
  box-shadow:
    0 8px 22px rgba(0,0,0,.08),
    inset 0 0 0 1px rgba(255,255,255,.015);
}

.provider-live-copy {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.provider-live-copy strong {
  display: block;
  width: 100%;
  max-width: none;
  overflow: visible;
  color: #ffffff;
  text-overflow: clip;
  white-space: normal;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.22;
}

.provider-live-copy small {
  display: flex;
  width: 100%;
  max-width: none;
  align-items: center;
  flex-wrap: wrap;
  gap: .34rem;
  margin-top: .24rem;
  overflow: visible;
  color: var(--orange);
  text-overflow: clip;
  white-space: normal;
  font-size: .74rem;
  font-weight: 500;
  line-height: 1.25;
}

.provider-meta-dot {
  color: rgba(255,255,255,.48);
  opacity: 1;
}

.provider-party-icon {
  border-color: rgba(232,93,4,.36);
  background: rgba(255,255,255,.025);
}

.provider-party-icon svg {
  fill: var(--orange);
}

[data-theme="light"] .provider-live-card {
  background: rgba(255,255,255,.88);
  border-color: rgba(232,93,4,.26);
}

[data-theme="light"] .provider-live-copy strong {
  color: #1d2430;
}

[data-theme="light"] .provider-live-copy small {
  color: var(--orange);
}

@media (max-width: 700px) {
  .provider-summary {
    width: min(620px, 94vw);
  }

  .provider-live-card {
    padding: .7rem .82rem;
  }

  .provider-live-copy strong {
    font-size: .94rem;
  }

  .provider-live-copy small {
    font-size: .67rem;
  }
}

@media (max-width: 420px) {
  .provider-summary {
    width: min(96vw, 560px);
  }

  .provider-live-card {
    padding: .65rem .72rem;
  }

  .provider-live-copy strong {
    font-size: .86rem;
  }

  .provider-live-copy small {
    font-size: .62rem;
  }
}


/* Provider summary refinement: no box/border, centered text directly under globe */
.provider-summary {
  width: min(760px, 92vw);
  margin-left: auto;
  margin-right: auto;
  justify-content: center;
}

.provider-live-card {
  width: auto;
  max-width: 760px;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.provider-live-copy {
  width: auto;
  max-width: 680px;
  text-align: center;
}

.provider-live-copy strong {
  display: block;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
}

.provider-live-copy small {
  justify-content: center;
  width: auto;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.provider-party-icon {
  display: none;
}

[data-theme="light"] .provider-live-card {
  background: transparent;
  border: 0;
}

@media (max-width: 700px) {
  .provider-live-card {
    width: auto;
    padding: 0;
  }

  .provider-live-copy {
    max-width: 92vw;
  }
}

@media (max-width: 420px) {
  .provider-live-card {
    width: auto;
    padding: 0;
  }

  .provider-live-copy {
    max-width: 94vw;
  }
}


/* Mobile layout refinement */
@media (max-width: 700px) {
  .header-inner {
    padding: 0 .9rem;
    min-height: 72px;
    gap: .7rem;
  }

  .brand {
    min-width: 0;
    gap: .55rem;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .brand-copy h4 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.05;
    letter-spacing: .01em;
    white-space: normal;
  }

  .header-actions {
    gap: .45rem;
  }

  .server-button {
    max-width: 245px;
    min-width: 0;
    padding: .55rem .7rem;
  }

  .server-copy {
    min-width: 0;
  }

  .server-copy strong {
    display: block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .theme-toggle {
    flex: 0 0 auto;
  }

  .speed-stage {
    padding-left: .8rem;
    padding-right: .8rem;
  }

  .test-tabs {
    margin-top: .8rem;
    margin-bottom: .85rem;
    gap: .45rem;
  }

  .test-tab {
    padding: .72rem 1rem;
    font-size: .74rem;
  }

  .headline-results {
    width: 100%;
    grid-template-columns: 1fr 1fr;
    gap: .8rem;
  }

  .headline-metric strong {
    font-size: clamp(2.35rem, 12vw, 3.3rem);
  }

  .latency-row {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    row-gap: .55rem;
  }

  .gauge {
    width: min(470px, 100%);
    height: 390px;
    margin-left: auto;
    margin-right: auto;
    transform: none;
  }

  .gauge-svg {
    overflow: visible;
  }

  .gauge-reading {
    top: 282px;
    width: 240px;
  }

  .gauge-reading strong {
    font-size: clamp(2.8rem, 14vw, 4rem);
  }

  .speed-unit {
    margin-top: .35rem;
  }

  .provider-summary {
    width: min(94vw, 620px);
    margin-top: .15rem;
  }

  .provider-live-card {
    width: 100%;
    justify-content: center;
  }

  .provider-live-copy {
    width: 100%;
    max-width: 100%;
    text-align: center;
  }

  .provider-live-copy strong {
    font-size: 1rem;
    line-height: 1.18;
    text-align: center;
  }

  .provider-live-copy small {
    justify-content: center;
    font-size: .72rem;
    text-align: center;
  }

  .test-message {
    width: min(94vw, 620px);
    margin-left: auto;
    margin-right: auto;
    font-size: .82rem;
    line-height: 1.4;
  }

  .site-footer {
    margin-top: 2rem;
  }
}

@media (max-width: 480px) {
  .header-inner {
    min-height: 70px;
    padding: 0 .72rem;
  }

  .brand img {
    width: 31px;
    height: 31px;
  }

  .brand-copy h4 {
    max-width: 185px;
    font-size: .92rem;
  }

  .server-button {
    max-width: 205px;
    padding: .5rem .62rem;
  }

  .server-copy small {
    font-size: .52rem;
  }

  .server-copy strong {
    max-width: 145px;
    font-size: .7rem;
  }


  .headline-results {
    gap: .55rem;
  }

  .headline-metric {
    min-width: 0;
  }

  .headline-metric strong {
    font-size: clamp(2.1rem, 13vw, 2.9rem);
  }

  .metric-label {
    font-size: .72rem;
  }

  .latency-row {
    font-size: .74rem;
  }

  .gauge {
    width: min(390px, 100vw);
    height: 345px;
  }

  .gauge-reading {
    top: 248px;
    width: 205px;
  }

  .gauge-reading strong {
    min-height: 52px;
    font-size: clamp(2.35rem, 15vw, 3.45rem);
  }

  .provider-summary {
    margin-top: .1rem;
  }

  .provider-live-copy strong {
    font-size: .92rem;
  }

  .provider-live-copy small {
    font-size: .66rem;
  }

  .test-message {
    font-size: .78rem;
    padding: 0 .4rem;
  }

  .cancel-test-button {
    margin-top: .8rem;
  }

  .site-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Green provider globe icon */
.provider-party-icon svg,
.provider-globe svg {
  fill: #20b26b !important;
}

.provider-party-icon,
.provider-globe {
  color: #20b26b !important;
}


/* Android/mobile active-test layout: compact, stable, no viewport manipulation. */
.speed-stage,
.test-console,
.gauge,
.go-button,
.go-ring,
.go-particle-layer-v3 {
  overflow-anchor: none;
}

/* Hide tabs only while test is actively running; remove their blank space. */
body[data-test-state="VERIFYING"] .test-tabs,
body[data-test-state="PINGING"] .test-tabs,
body[data-test-state="DOWNLOADING"] .test-tabs,
body[data-test-state="UPLOADING"] .test-tabs {
  display: none !important;
}

@media (max-width: 700px) {
  html,
  body {
    overflow-anchor: none;
  }

  /* One fixed geometry for all active phases: VERIFYING -> PING -> DOWNLOAD -> UPLOAD. */
  body[data-test-state="VERIFYING"] .speed-stage,
  body[data-test-state="PINGING"] .speed-stage,
  body[data-test-state="DOWNLOADING"] .speed-stage,
  body[data-test-state="UPLOADING"] .speed-stage {
    min-height: 0;
    padding-top: .28rem;
    padding-bottom: 1rem;
  }

  body[data-test-state="VERIFYING"] .test-console,
  body[data-test-state="PINGING"] .test-console,
  body[data-test-state="DOWNLOADING"] .test-console,
  body[data-test-state="UPLOADING"] .test-console {
    margin-top: 0;
  }

  body[data-test-state="VERIFYING"] .headline-results,
  body[data-test-state="PINGING"] .headline-results,
  body[data-test-state="DOWNLOADING"] .headline-results,
  body[data-test-state="UPLOADING"] .headline-results {
    margin-top: 0;
    min-height: 72px;
  }

  body[data-test-state="VERIFYING"] .latency-row,
  body[data-test-state="PINGING"] .latency-row,
  body[data-test-state="DOWNLOADING"] .latency-row,
  body[data-test-state="UPLOADING"] .latency-row {
    margin-top: .02rem;
  }

  /* Fixed animated/test region: effects are transform-only and cannot alter document height. */
  body[data-test-state="VERIFYING"] .gauge,
  body[data-test-state="PINGING"] .gauge,
  body[data-test-state="DOWNLOADING"] .gauge,
  body[data-test-state="UPLOADING"] .gauge {
    width: min(430px, 100%);
    height: 345px;
    min-height: 345px;
    max-height: 345px;
    margin-top: -.25rem;
    margin-bottom: 0;
    contain: layout paint;
  }

  body[data-test-state="VERIFYING"] .gauge-reading,
  body[data-test-state="PINGING"] .gauge-reading,
  body[data-test-state="DOWNLOADING"] .gauge-reading,
  body[data-test-state="UPLOADING"] .gauge-reading {
    top: 246px;
  }

  body[data-test-state="VERIFYING"] .provider-summary,
  body[data-test-state="PINGING"] .provider-summary,
  body[data-test-state="DOWNLOADING"] .provider-summary,
  body[data-test-state="UPLOADING"] .provider-summary {
    margin-top: -.2rem;
  }

  body[data-test-state="VERIFYING"] .test-message,
  body[data-test-state="PINGING"] .test-message,
  body[data-test-state="DOWNLOADING"] .test-message,
  body[data-test-state="UPLOADING"] .test-message {
    margin-top: .48rem;
    margin-bottom: .22rem;
  }

  body[data-test-state="VERIFYING"] .cancel-test-button,
  body[data-test-state="PINGING"] .cancel-test-button,
  body[data-test-state="DOWNLOADING"] .cancel-test-button,
  body[data-test-state="UPLOADING"] .cancel-test-button {
    margin-top: .38rem;
  }
}

/* Android Chrome phone widths similar to supplied screenshot. */
@media (max-width: 480px) {
  body[data-test-state="VERIFYING"] .speed-stage,
  body[data-test-state="PINGING"] .speed-stage,
  body[data-test-state="DOWNLOADING"] .speed-stage,
  body[data-test-state="UPLOADING"] .speed-stage {
    padding-top: .12rem;
    padding-left: .5rem;
    padding-right: .5rem;
    padding-bottom: .7rem;
  }

  body[data-test-state="VERIFYING"] .headline-results,
  body[data-test-state="PINGING"] .headline-results,
  body[data-test-state="DOWNLOADING"] .headline-results,
  body[data-test-state="UPLOADING"] .headline-results {
    min-height: 66px;
    padding-left: .25rem;
    padding-right: .25rem;
    gap: .4rem;
  }

  body[data-test-state="VERIFYING"] .headline-metric > strong,
  body[data-test-state="PINGING"] .headline-metric > strong,
  body[data-test-state="DOWNLOADING"] .headline-metric > strong,
  body[data-test-state="UPLOADING"] .headline-metric > strong {
    min-height: 40px;
    font-size: clamp(2rem, 13vw, 2.72rem);
  }

  body[data-test-state="VERIFYING"] .latency-row,
  body[data-test-state="PINGING"] .latency-row,
  body[data-test-state="DOWNLOADING"] .latency-row,
  body[data-test-state="UPLOADING"] .latency-row {
    min-height: 30px;
    row-gap: .25rem;
    margin-top: 0;
  }

  body[data-test-state="VERIFYING"] .gauge,
  body[data-test-state="PINGING"] .gauge,
  body[data-test-state="DOWNLOADING"] .gauge,
  body[data-test-state="UPLOADING"] .gauge {
    width: min(350px, 96vw);
    height: 302px;
    min-height: 302px;
    max-height: 302px;
    margin-top: -.38rem;
  }

  body[data-test-state="VERIFYING"] .gauge-reading,
  body[data-test-state="PINGING"] .gauge-reading,
  body[data-test-state="DOWNLOADING"] .gauge-reading,
  body[data-test-state="UPLOADING"] .gauge-reading {
    top: 215px;
    width: 194px;
  }

  body[data-test-state="VERIFYING"] .gauge-reading strong,
  body[data-test-state="PINGING"] .gauge-reading strong,
  body[data-test-state="DOWNLOADING"] .gauge-reading strong,
  body[data-test-state="UPLOADING"] .gauge-reading strong {
    min-height: 46px;
    font-size: clamp(2.22rem, 14vw, 3.15rem);
  }

  body[data-test-state="VERIFYING"] .provider-summary,
  body[data-test-state="PINGING"] .provider-summary,
  body[data-test-state="DOWNLOADING"] .provider-summary,
  body[data-test-state="UPLOADING"] .provider-summary {
    margin-top: -.42rem;
  }

  body[data-test-state="VERIFYING"] .provider-live-copy strong,
  body[data-test-state="PINGING"] .provider-live-copy strong,
  body[data-test-state="DOWNLOADING"] .provider-live-copy strong,
  body[data-test-state="UPLOADING"] .provider-live-copy strong {
    font-size: .87rem;
  }

  body[data-test-state="VERIFYING"] .provider-live-copy small,
  body[data-test-state="PINGING"] .provider-live-copy small,
  body[data-test-state="DOWNLOADING"] .provider-live-copy small,
  body[data-test-state="UPLOADING"] .provider-live-copy small {
    font-size: .63rem;
  }

  body[data-test-state="VERIFYING"] .test-message,
  body[data-test-state="PINGING"] .test-message,
  body[data-test-state="DOWNLOADING"] .test-message,
  body[data-test-state="UPLOADING"] .test-message {
    margin-top: .34rem;
    font-size: .73rem;
    line-height: 1.25;
  }
}


/* Final mobile viewport stability: never let effects create horizontal overflow. */
@media (max-width: 700px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  .page-shell,
  main,
  #main-content,
  .speed-stage,
  .test-console {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
}

/* ── Server selection panel (added v4) ────────────── */
.server-panel-backdrop{position:fixed;inset:0;z-index:49;background:rgba(0,0,0,.45);backdrop-filter:blur(3px);}
.server-panel{position:fixed;top:0;right:0;z-index:50;width:min(400px,100vw);height:100vh;overflow-y:auto;background:var(--surface);border-left:1px solid var(--border);box-shadow:-8px 0 40px rgba(0,0,0,.18);display:flex;flex-direction:column;animation:srv-slide-in .22s cubic-bezier(.4,0,.2,1);}
@keyframes srv-slide-in{from{transform:translateX(100%)}to{transform:none}}
.srv-panel-header{display:flex;align-items:flex-start;justify-content:space-between;padding:1.1rem 1.2rem .7rem;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--surface);z-index:2;}
.srv-panel-header h3{margin:0;font-size:1rem;}
.srv-panel-sub{margin:0;padding:.55rem 1.2rem;color:var(--muted);font-size:.72rem;border-bottom:1px solid var(--border);}
.srv-panel-search-wrap{padding:.7rem 1rem .5rem;}
.srv-panel-search{width:100%;padding:.6rem .85rem;border:1px solid var(--border);border-radius:999px;background:var(--surface-2);color:var(--text);font:inherit;font-size:.8rem;outline:none;}
.srv-panel-search:focus{border-color:rgba(232,93,4,.45);}
.srv-panel-list{flex:1;padding:.4rem .6rem;}
.srv-panel-item{width:100%;display:flex;align-items:center;gap:.8rem;padding:.7rem .8rem;border:1px solid transparent;border-radius:10px;background:transparent;text-align:left;cursor:pointer;transition:background .15s,border-color .15s;margin-bottom:.3rem;}
.srv-panel-item:hover{background:var(--surface-2);border-color:var(--border);}
.srv-panel-item.is-selected{background:var(--orange-soft);border-color:rgba(232,93,4,.3);}
.srv-item-flag{font-size:1.3rem;flex-shrink:0;}
.srv-item-info{flex:1;min-width:0;}
.srv-item-info strong{display:block;font-size:.8rem;color:var(--text-strong);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.srv-item-info small{display:block;color:var(--muted);font-size:.68rem;margin-top:.15rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.srv-item-ping{font-size:.72rem;font-family:"Roboto Mono",monospace;font-weight:600;flex-shrink:0;}
.srv-item-ping.ping-good{color:var(--success);}
.srv-item-ping.ping-ok{color:var(--ping);}
.srv-item-ping.ping-slow{color:var(--muted);}
.srv-item-check{color:var(--orange);font-weight:700;flex-shrink:0;}
.srv-panel-empty{padding:1.5rem;text-align:center;color:var(--muted);font-size:.82rem;}
.srv-panel-footer{padding:.9rem 1.2rem;border-top:1px solid var(--border);display:flex;gap:1rem;flex-wrap:wrap;}
.srv-ext-link{font-size:.7rem;color:var(--muted);text-decoration:none;}
.srv-ext-link:hover{color:var(--orange);}
@media(max-width:480px){.server-panel{width:100vw;border-left:none;}}
