/* AFR-IX Speed Test — cambia estos tokens para ajustar los colores de marca */
:root {
  --bg: #031a17;
  --bg-2: #082a26;
  --panel: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #eaf6f1;
  --muted: #8fb3ab;
  --accent: #39b54a;     /* verde AFR-IX */
  --accent-2: #00a79d;   /* turquesa AFR-IX */
  --down-1: #1f9a43;
  --down-2: #6fdc7c;
  --up-1: #00857d;
  --up-2: #3fe3d4;
  --good: #6fdc7c;       /* veredictos: bueno / aceptable / limitado */
  --ok: #f5b942;
  --poor: #ff8a7a;
  --track: rgba(255, 255, 255, 0.07);
  --radius: 20px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;

  /* color de la fase en curso (lo cambia body[data-phase]) */
  --g1: var(--down-1);
  --g2: var(--down-2);
  color-scheme: dark;
}
body[data-phase="upload"] { --g1: var(--up-1); --g2: var(--up-2); }
body[data-phase="ping"] { --g1: #5d7d76; --g2: #9cc0b8; }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  line-height: 1.4;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 50% -10%, rgba(57, 181, 74, 0.16), transparent 60%),
    radial-gradient(700px 480px at 100% 100%, rgba(0, 167, 157, 0.10), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, select { font: inherit; color: inherit; }
select { background: var(--bg-2); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Cabecera ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand a { display: block; border-radius: 6px; }
.brand img { display: block; height: 32px; width: auto; }
.brand-tag {
  padding-left: 10px;
  border-left: 1px solid var(--card-border);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Selector de idioma: <select> nativo invisible sobre la píldora «ES ▾» */
.lang {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font: 600 12px var(--font);
  letter-spacing: 0.08em;
  cursor: pointer;
}
.lang:hover { color: var(--text); }
.caret { width: 9px; height: 6px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lang select,
.change select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 16px; /* evita el zoom automático de iOS */
}
.lang:has(select:focus-visible) { outline: 2px solid var(--accent-2); outline-offset: 3px; color: var(--text); }

main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 4px 12px 24px;
}

/* ---------- Panel ---------- */
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 24px 16px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Aviso de resultado compartido */
.banner {
  display: none;
  margin: 0;
  padding: 6px 14px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
body[data-state="shared"] .banner:not(:empty) { display: block; }

/* ---------- Resultados ---------- */
.results {
  display: none;
  width: 100%;
  max-width: 460px;
  grid-template-columns: 1fr 1fr;
}
.result {
  min-width: 0;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.result + .result { border-left: 1px solid var(--card-border); }
.result-head {
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.result-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-main { display: flex; align-items: baseline; justify-content: center; gap: 5px; margin-top: 4px; }
.result-value {
  font-size: 34px;
  font-weight: 300;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
/* La unidad es un botón (Mbps ↔ MB/s) con área táctil ampliada sin mover el diseño */
.result-unit {
  position: relative;
  padding: 12px 6px;
  margin: -12px -6px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.result-unit:hover { color: var(--text); text-decoration: underline dotted; text-underline-offset: 3px; }

.delta { display: none; margin-top: 2px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
body[data-state="done"] .delta:not(:empty) { display: block; }
.delta.up { color: var(--good); }
.delta.down { color: var(--poor); }
.delta.flat { color: var(--muted); font-weight: 500; }

/* Gráfica en vivo de cada fase */
.spark {
  display: block;
  width: 100%;
  height: 28px;
  margin-top: 8px;
  overflow: visible;
  border-bottom: 1px solid var(--track);
  color: var(--down-2);
  transition: opacity 0.3s;
}
.result[data-key="upload"] .spark { color: var(--up-2); }
.spark-area { fill: currentColor; fill-opacity: 0.16; stroke: none; }
.spark-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.spark-warm { opacity: 0.35; }
body[data-state="running"]:not([data-phase="download"]) .result[data-key="download"] .spark,
body[data-state="running"]:not([data-phase="upload"]) .result[data-key="upload"] .spark { opacity: 0.5; }
body[data-state="shared"] .spark { display: none; }

.ico {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  color: var(--bg);
  flex: none;
}
.ico-down { background: var(--down-2); }
.ico-up { background: var(--up-2); }

/* ---------- Latencias ---------- */
.latency { display: none; width: 100%; max-width: 460px; }
.latency-title {
  margin: 0 0 8px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.lat-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.12);
}
.lat { min-width: 0; padding: 10px 4px; text-align: center; }
.lat + .lat { border-left: 1px solid var(--card-border); }
.lat dt { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lat dd { margin: 3px 0 0; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

body[data-state="running"] .results,
body[data-state="done"] .results,
body[data-state="shared"] .results,
body.partial .results { display: grid; }
body[data-state="running"] .latency,
body[data-state="done"] .latency,
body[data-state="shared"] .latency,
body.partial .latency { display: block; }

/* ---------- Escenario ---------- */
.stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Botón de inicio */
.launch { display: none; flex-direction: column; align-items: center; gap: 18px; padding: 8px 0 2px; }
body[data-state="idle"] .launch { display: flex; }
body.no-go .launch { display: none; }

.go {
  position: relative;
  width: 184px;
  height: 184px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, rgba(57, 181, 74, 0.14), rgba(0, 167, 157, 0.04) 70%);
  color: var(--text);
  font: 600 26px var(--font);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s, background 0.3s, box-shadow 0.3s;
}
.go::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(57, 181, 74, 0.35);
}
.go-ring {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2) 35%, transparent 55%, transparent 85%, var(--accent));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  animation: spin 3.2s linear infinite;
}
.go-label { position: relative; max-width: 80%; line-height: 1.15; overflow-wrap: anywhere; transition: opacity 0.3s; }
.go-label[data-len="l"] { font-size: 21px; letter-spacing: 0.06em; }
.go-label[data-len="xl"] { font-size: 16px; letter-spacing: 0.04em; }
.go:hover:not(:disabled) {
  background: radial-gradient(circle at 50% 40%, rgba(57, 181, 74, 0.26), rgba(0, 167, 157, 0.08) 70%);
  box-shadow: 0 0 60px rgba(57, 181, 74, 0.25);
}
.go:active:not(:disabled) { transform: scale(0.97); }
.go:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 6px; }
.go:disabled { cursor: default; }
.go:disabled .go-label { opacity: 0.5; }
.go[aria-busy="true"] .go-ring { animation-duration: 1.2s; }      /* buscando servidor */
.go:disabled:not([aria-busy="true"]) .go-ring { animation: none; opacity: 0.3; }
@keyframes spin { to { transform: rotate(360deg); } }

.hint { margin: 0; color: var(--muted); font-size: 13px; text-align: center; }

/* Medidor */
.gauge {
  position: relative;
  display: none;
  width: min(340px, 100%);
  aspect-ratio: 300 / 270;
}
body[data-state="running"] .gauge { display: block; }
.gauge svg { display: block; width: 100%; height: 100%; overflow: visible; }
.arc-track, .arc-value, .arc-spin { fill: none; stroke-width: 16; stroke-linecap: round; }
.arc-track { stroke: var(--track); }
.arc-value {
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--g2) 45%, transparent));
  transition: opacity 0.2s;
}
.stop-1 { stop-color: var(--g1); }
.stop-2 { stop-color: var(--g2); }
.arc-head {
  fill: #fff;
  stroke: var(--g2);
  stroke-width: 4;
  filter: drop-shadow(0 0 6px var(--g2)) drop-shadow(0 0 14px color-mix(in srgb, var(--g2) 60%, transparent));
  transition: opacity 0.2s;
}
/* Fase de latencia: segmento de 40° que recorre la pista */
.arc-spin {
  stroke: var(--g2);
  opacity: 0;
  transform-box: view-box;
  transform-origin: 150px 150px;
}
body[data-phase="ping"] .arc-spin { opacity: 0.9; animation: sweep 1.3s ease-in-out infinite alternate; }
body[data-phase="ping"] .arc-value,
body[data-phase="ping"] .arc-head,
body[data-phase="ping"] .ticks { opacity: 0; }
@keyframes sweep { from { transform: rotate(0deg); } to { transform: rotate(230deg); } }

.ticks { transition: opacity 0.2s; }
.ticks.fade { opacity: 0; }
.ticks text {
  fill: var(--muted);
  font: 500 11px var(--font);
  text-anchor: middle;
  dominant-baseline: middle;
}
.readout {
  position: absolute;
  left: 0;
  right: 0;
  top: 57%;
  transform: translateY(-50%);
  text-align: center;
  pointer-events: none;
}
.value {
  font-size: clamp(42px, 13vw, 56px);
  font-weight: 300;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.unit {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}
.unit .ico:empty { display: none; }
.unit .sep { margin: 0 -2px; }

/* Botón discreto para detener */
.stop {
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-top: -12px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
.stop:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
body[data-state="running"] .stop { display: inline-flex; }

/* ---------- Resumen (calidad + estabilidad) ---------- */
.summary { display: none; width: 100%; max-width: 460px; }
body[data-state="done"] .summary,
body[data-state="shared"] .summary { display: block; }
.quality { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--card-border); }
.quality li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  border-bottom: 1px solid var(--card-border);
  font-size: 14px;
}
.q-ico {
  width: 16px; height: 16px;
  flex: none;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.q-label { flex: 1; min-width: 0; }
.verdict { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
[data-v="good"] .dot { background: var(--good); }
[data-v="ok"] .dot { background: var(--ok); }
[data-v="poor"] .dot { background: var(--poor); }

.grade-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  margin-top: 6px;
  font-size: 14px;
}
.grade-label { flex: 1; min-width: 0; }
.grade {
  min-width: 36px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}
.grade[data-g="good"] { background: var(--good); color: var(--bg); }
.grade[data-g="ok"] { background: var(--ok); color: var(--bg); }
.grade[data-g="poor"] { background: var(--poor); color: var(--bg); }
.grade-inc { min-width: 4.5em; text-align: right; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.usage { margin: 6px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.usage:empty { display: none; }

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.pill {
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
}
.pill:hover:not(:disabled) { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.3); }
.pill.primary { background: var(--accent); border-color: var(--accent); color: #04140f; }
.pill.primary:hover:not(:disabled) { background: #46c457; border-color: #46c457; }
.pill:active:not(:disabled) { transform: scale(0.98); }
.pill:disabled { opacity: 0.5; cursor: default; }
.pill.is-done { border-color: var(--accent); color: var(--good); }
#tryYours { display: none; }
body[data-state="shared"] #tryYours { display: inline-flex; }
body[data-state="shared"] #again,
body[data-state="shared"] #share { display: none; }

.cta { margin: 16px 0 0; text-align: center; font-size: 12px; }
.cta a { color: var(--muted); }
.cta a:hover { color: var(--accent); }
body[data-state="shared"] .cta,
body[data-state="shared"] .usage { display: none; }

/* ---------- Mensajes ---------- */
.status { max-width: 460px; margin: -6px 0 0; font-size: 14px; text-align: center; color: var(--muted); }
.status:empty { display: none; }
.status.is-error { color: var(--poor); }
body[data-state="shared"] .status.is-pre { display: none; }  /* avisos del nodo: solo al volver a «Haz tu prueba» */
.status-detail { color: var(--muted); font-size: 12px; }
.link {
  padding: 12px 6px;
  margin: -12px -2px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link:hover { color: var(--text); }

.notice { max-width: 460px; margin: -6px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.notice:empty,
body[data-state="shared"] .notice,
body[data-state="idle"]:not(.partial) .notice { display: none; }

/* ---------- Cliente / servidor ---------- */
.meta {
  width: 100%;
  max-width: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--card-border);
}
.meta-item { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.meta-ico {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  display: grid;
  place-items: center;
  flex: none;
}
.meta-ico svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; }
.meta-body { min-width: 0; }
.meta-label { color: var(--muted); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.meta-title { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.meta-sub { margin-top: 1px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.meta-sub:empty { display: none; }
.meta-sub.is-error { color: var(--poor); }
.change {
  position: relative;
  display: inline-block;
  margin-top: 2px;
  padding: 10px 0;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
}
.change:hover span { text-decoration: underline; }
.change:has(select:focus-visible) span { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 3px; }
.change:has(select:disabled) { opacity: 0.5; pointer-events: none; }
body[data-state="shared"] .meta { display: none; }

/* ---------- Opciones ---------- */
.options { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 24px; }
body[data-state="running"] .options,
body[data-state="shared"] .options { display: none; }
.opt { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
}
.switch button {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.switch button:hover:not(:disabled) { color: var(--text); }
.switch button[aria-pressed="true"] { background: var(--bg-2); color: var(--text); box-shadow: inset 0 0 0 1px rgba(57, 181, 74, 0.5); }
.switch button:disabled { cursor: default; }

/* ---------- Progreso ---------- */
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: transform 0.25s linear;
}

/* ---------- Historial ---------- */
.history {
  margin-top: 16px;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: var(--panel);
}
.history > summary {
  min-height: 48px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  border-radius: 16px;
}
.history > summary::-webkit-details-marker { display: none; }
.history > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: -4px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s, margin 0.2s;
}
.history[open] > summary::after { margin-top: 4px; transform: rotate(-135deg); }
.history > summary:hover { color: var(--text); }
.history-body { padding: 0 10px 8px; }
.h-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.h-table th {
  padding: 8px 5px;
  border-bottom: 1px solid var(--card-border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}
.h-table td { padding: 8px 5px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); text-align: right; white-space: nowrap; }
.h-table th:first-child,
.h-table td:first-child { text-align: left; }
.h-unit { font-weight: 500; opacity: 0.8; }
.history-body .link { display: inline-block; margin: 2px 0 0; padding: 12px 5px; font-size: 13px; font-weight: 500; color: var(--muted); }
.history-body .link:hover { color: var(--poor); }

/* ---------- Pie ---------- */
.foot {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 4px 8px;
  padding: 12px 16px max(20px, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 12px;
}
.foot a { color: var(--muted); }
.foot a:hover { color: var(--text); }
.privacy { display: inline; }
.privacy summary {
  display: inline;
  padding: 12px 4px;
  margin: -12px -4px;
  list-style: none;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.privacy summary::-webkit-details-marker { display: none; }
.privacy summary:hover { color: var(--text); }
.privacy p {
  position: absolute;
  top: 40px;
  left: 50%;
  width: min(520px, calc(100% - 32px));
  margin: 0;
  transform: translateX(-50%);
  text-align: center;
  line-height: 1.5;
}
.foot:has(.privacy[open]) { padding-bottom: 76px; }

/* Área de texto oculta para copiar sin API de portapapeles */
.clip { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---------- Pantallas anchas ---------- */
@media (min-width: 560px) {
  .top { padding: max(18px, env(safe-area-inset-top)) 40px 18px; }
  .brand { gap: 12px; }
  .brand img { height: 40px; }
  .brand-tag { padding-left: 12px; font-size: 13px; }
  .lang { min-height: 32px; }
  main { padding: 8px 16px 32px; }
  .panel { padding: 32px 40px 34px; gap: 24px; }
  .result-head { font-size: 13px; letter-spacing: 0.1em; }
  .result-value { font-size: 42px; }
  .result-unit { font-size: 13px; }
  .go { width: 210px; height: 210px; font-size: 30px; }
  .go-label[data-len="l"] { font-size: 24px; }
  .go-label[data-len="xl"] { font-size: 18px; }
  .gauge { width: min(380px, 100%); }
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 40px; }
  .switch button { min-height: 30px; }
  .change { padding: 2px 0; }
  .h-table th, .h-table td { padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .go-ring { animation: none !important; }
  body[data-phase="ping"] .arc-spin { animation: none; transform: rotate(115deg); }
  .progress span, .ticks, .spark, .arc-value, .arc-head, .go, .pill,
  .history > summary::after { transition: none; }
}
