@font-face { font-family: "Sora"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("/fonts/sora-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Sora"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("/fonts/sora-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #07101F;
  --bg-image: radial-gradient(1200px 700px at 50% -10%, #0F2447 0%, transparent 55%);
  --surface: #0E1D38;
  --line: #1B2E4E;
  --text: #EAF2FB;
  --value: #FFFFFF;
  --muted: #7F93AD;
  --dim: #4E6383;
  --blue: #62B5E5;
  --blue-soft: #9CDBFF;
  --amber: #F2B94B;
  --amber-soft: #FFD98A;
  --pale: #C7E6FF;
  --dl-1: #2E86C7; --dl-2: #9CDBFF;
  --ul-1: #D9932A; --ul-2: #FFD98A;
  --pg-1: #7FB6DA; --pg-2: #E6F5FF;
  --btn-text: #04101F;
  --surface-alpha: 80%;
  --accent: var(--pale);
  --accent-grad: url(#gradPing);
  --radius: 18px;
  --ease: cubic-bezier(.22,.8,.3,1);
}
/* ---- temas ---- */
:root[data-theme="galaxia"] {
  --bg: #03040C; --bg-image: radial-gradient(900px 600px at 50% 30%, rgba(60,80,180,.18) 0%, transparent 60%);
  --surface: #0A0E22; --line: #1C2347; --text: #EEF1FF; --muted: #8A93C4; --dim: #4D5580;
  --blue: #8AB4FF; --blue-soft: #C9DAFF; --amber: #FFB86B; --amber-soft: #FFD9A8; --pale: #E8ECFF;
  --dl-1: #4F7DFF; --dl-2: #C9DAFF; --ul-1: #FF8A3D; --ul-2: #FFD9A8; --pg-1: #9AA6FF; --pg-2: #FFFFFF; --btn-text: #060A1F; --surface-alpha: 62%;
}
:root[data-theme="fibra"] {
  --bg: #020407; --bg-image: radial-gradient(1000px 500px at 50% 100%, rgba(53,224,255,.10) 0%, transparent 60%);
  --surface: #071018; --line: #10222E; --text: #E9FBFF; --muted: #6F98A8; --dim: #3E5C69;
  --blue: #35E0FF; --blue-soft: #A5F1FF; --amber: #FF7A59; --amber-soft: #FFB59F; --pale: #D7F8FF;
  --dl-1: #0FA8D0; --dl-2: #A5F1FF; --ul-1: #E0532F; --ul-2: #FFB59F; --pg-1: #5AC8E0; --pg-2: #FFFFFF; --btn-text: #02141A; --surface-alpha: 65%;
}
:root[data-theme="neon"] {
  --bg: #1A0B33; --bg-image: linear-gradient(180deg, #0D0520 0%, #1A0B33 55%, #2B0F3F 100%);
  --surface: #22103F; --line: #3A1B5E; --text: #FBEFFF; --muted: #B58AD6; --dim: #7A4FA0;
  --blue: #2DE2E6; --blue-soft: #A6F7F8; --amber: #FF2E97; --amber-soft: #FFA1CF; --pale: #F9F871;
  --dl-1: #0FB5B9; --dl-2: #A6F7F8; --ul-1: #C6106C; --ul-2: #FFA1CF; --pg-1: #E0DE4E; --pg-2: #FFFDD0; --btn-text: #16062B; --surface-alpha: 55%;
}
:root[data-theme="aurora"] {
  --bg: #050B12; --bg-image: radial-gradient(900px 500px at 50% 0%, rgba(40,90,90,.25) 0%, transparent 60%);
  --surface: #0A1A22; --line: #14303A; --text: #E6FFF6; --muted: #7FA6A0; --dim: #4A6D6A;
  --blue: #5CF2C0; --blue-soft: #B8FFE6; --amber: #F26BD8; --amber-soft: #FFB3EE; --pale: #CFFAF0;
  --dl-1: #1FB98A; --dl-2: #B8FFE6; --ul-1: #C13AA9; --ul-2: #FFB3EE; --pg-1: #7FD9C6; --pg-2: #FFFFFF; --btn-text: #03150F; --surface-alpha: 60%;
}
:root[data-theme="matrix"] {
  --bg: #020803; --bg-image: radial-gradient(900px 500px at 50% 0%, rgba(20,80,35,.25) 0%, transparent 60%);
  --surface: #06140A; --line: #0F2A16; --text: #D8FFE0; --value: #F2FFF5; --muted: #5FA872; --dim: #2F6B40;
  --blue: #4AF07A; --blue-soft: #B4FFC8; --amber: #E6FF6A; --amber-soft: #F4FFB0; --pale: #A8FFC4;
  --dl-1: #12A64A; --dl-2: #B4FFC8; --ul-1: #9FB800; --ul-2: #F4FFB0; --pg-1: #3FCF7A; --pg-2: #EFFFF3; --btn-text: #02140A; --surface-alpha: 70%;
}
:root[data-theme="claro"] {
  --bg: #F5F7FB; --bg-image: radial-gradient(900px 500px at 50% -10%, #FFFFFF 0%, transparent 60%);
  --surface: #FFFFFF; --line: #E1E6EF; --text: #0E1A2B; --value: #0E1A2B; --muted: #5B6B82; --dim: #97A3B5;
  --blue: #1E6FD9; --blue-soft: #1557B0; --amber: #D97B00; --amber-soft: #A85F00; --pale: #2B6CB0;
  --dl-1: #1E6FD9; --dl-2: #63A4FF; --ul-1: #D97B00; --ul-2: #FFB74D; --pg-1: #2B6CB0; --pg-2: #7FB3F0; --btn-text: #FFFFFF; --surface-alpha: 88%;
}
.st-dl1 { stop-color: var(--dl-1); } .st-dl2 { stop-color: var(--dl-2); }
.st-ul1 { stop-color: var(--ul-1); } .st-ul2 { stop-color: var(--ul-2); }
.st-pg1 { stop-color: var(--pg-1); } .st-pg2 { stop-color: var(--pg-2); }
.st-adl { stop-color: var(--blue); } .st-aul { stop-color: var(--amber); }

/* ---- fundo animado ---- */
.fx-css { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: var(--bg-image); transition: background .5s; }
.fx { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.stage, .bottom { position: relative; z-index: 2; }
.top { position: relative; z-index: 3; } /* acima do palco: o menu de temas precisa receber o clique */
:root[data-theme="claro"] .fx-css::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(245,247,251,.6) 100%); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg); transition: background .5s, color .5s;
  color: var(--text); font-family: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400; font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
button { font: inherit; }
b { font-weight: 700; }

/* ---------- topo / rodapé ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px 6px; max-width: 860px; width: 100%; margin: 0 auto; }
.brand img { display: block; height: 26px; width: auto; }
.top-right { display: flex; align-items: center; gap: 12px; }
.top-meta { text-align: right; line-height: 1.2; }
.theme { position: relative; }
.theme-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--muted); cursor: pointer; display: grid; place-items: center; transition: color .2s, border-color .2s, transform .2s; }
.theme-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.theme-btn svg circle { fill: currentColor; stroke: none; }
.theme-btn:hover, .theme-btn[aria-expanded="true"] { color: var(--text); border-color: var(--muted); transform: rotate(-12deg); }
.theme-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.theme-menu { position: absolute; right: 0; top: 46px; z-index: 5; min-width: 190px; padding: 8px; border-radius: 14px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(10px); box-shadow: 0 16px 40px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 2px; animation: pop .18s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.theme-menu p { margin: 4px 10px 6px; font-size: 11px; color: var(--muted); }
.theme-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.theme-menu button:hover, .theme-menu button:focus-visible { background: color-mix(in srgb, var(--text) 8%, transparent); outline: none; }
.theme-menu button[aria-checked="true"] { background: color-mix(in srgb, var(--blue) 16%, transparent); }
.theme-menu i { width: 22px; height: 22px; border-radius: 50%; flex: none; background: conic-gradient(from 210deg, var(--a) 0 50%, var(--b) 50% 100%); box-shadow: inset 0 0 0 3px var(--c); }
.btn.copied { background: var(--blue); border-color: var(--blue); color: var(--btn-text); }
.top-title { display: block; font-weight: 600; font-size: 15px; letter-spacing: .01em; }
.top-server { display: block; font-size: 12px; color: var(--muted); }
.bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 20px 22px; max-width: 860px; width: 100%; margin: 0 auto; color: var(--dim); font-size: 12px; }

.notice { position: relative; z-index: 2; margin: 4px auto 0; max-width: 860px; width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); background: color-mix(in srgb, var(--amber) 12%, transparent); color: var(--text); font-size: 14px; text-align: center; }

/* ---------- palco ---------- */
.stage { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; max-width: 860px; margin: 0 auto; padding: 8px 16px 0; }
.stage[data-phase="ping"] { --accent: var(--pale); --accent-grad: url(#gradPing); }
.stage[data-phase="download"] { --accent: var(--blue); --accent-grad: url(#gradDl); }
.stage[data-phase="upload"] { --accent: var(--amber); --accent-grad: url(#gradUl); }
.stage[data-phase="done"] { --accent: var(--blue); }

/* ---------- medidor ---------- */
.gauge-wrap { position: relative; width: min(78vw, 400px); aspect-ratio: 1; margin-top: 6px; transition: opacity .5s var(--ease), transform .5s var(--ease); }
.gauge-wrap.leaving { opacity: 0; transform: scale(.92); pointer-events: none; position: absolute; }
.gauge { position: relative; width: 100%; height: 100%; display: block; overflow: visible; }
.gauge .track { fill: none; stroke: var(--line); stroke-width: 14; stroke-linecap: round; }
.gauge .progress { fill: none; stroke: var(--accent-grad); stroke-width: 14; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 65%, transparent)); transition: stroke .6s; }
.gauge .head { fill: var(--value); opacity: 0; transition: opacity .3s; filter: drop-shadow(0 0 8px var(--accent)); }
.stage[data-phase="download"] .head, .stage[data-phase="upload"] .head, .stage[data-phase="done"] .head { opacity: 1; }
.gauge .peak-mark { fill: none; stroke: var(--accent); stroke-width: 2.5; opacity: 0; transition: opacity .3s; filter: drop-shadow(0 0 6px var(--accent)); }
.stage[data-phase="download"] .peak-mark, .stage[data-phase="upload"] .peak-mark, .stage[data-phase="done"] .peak-mark { opacity: .95; }
.gauge .ticks line { stroke: var(--dim); stroke-width: 2; stroke-linecap: round; }
.gauge .ticks text { fill: var(--muted); font-size: 14px; font-weight: 500; text-anchor: middle; dominant-baseline: middle; }
.glow { position: absolute; inset: 6%; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 38%, transparent) 0%, transparent 62%); opacity: 0; transition: opacity .4s, background .6s; pointer-events: none; filter: blur(6px); }

.reading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 4%; }
.value { font-size: clamp(56px, 19vw, 96px); font-weight: 700; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--value); transition: color .5s; }
.unit { font-size: 16px; font-weight: 500; color: var(--accent); margin-top: 6px; transition: color .5s; }
.phase { font-size: 13px; color: var(--muted); margin-top: 14px; min-height: 1.4em; }

.value[data-len="5"] { font-size: clamp(46px, 15vw, 78px); }
.value[data-len="6"], .value[data-len="7"] { font-size: clamp(40px, 13vw, 66px); }

.stage[data-phase="idle"] .value, .stage[data-phase="ping"] .value { color: var(--dim); }
.stage[data-phase="idle"] .unit, .stage[data-phase="ping"] .unit { color: var(--dim); }

/* mostrador de latência: aparece só enquanto a latência é medida */
.ping-live { display: none; align-items: baseline; gap: 8px; margin-top: -6px; min-height: 40px; font-variant-numeric: tabular-nums; }
.ping-live span { font-size: 14px; color: var(--muted); }
.ping-live b { font-size: 34px; font-weight: 700; color: var(--pale); letter-spacing: -.02em; line-height: 1; }
.ping-live small { font-size: 14px; color: var(--pale); }
.stage[data-phase="ping"] .ping-live { display: flex; }

/* sonar: só na fase de latência; lembra os arcos do logo */
.sonar { position: absolute; inset: 0; pointer-events: none; }
.sonar i { position: absolute; left: 50%; top: 50%; width: 62%; aspect-ratio: 1; border-radius: 50%; border: 1.5px solid var(--pale); transform: translate(-50%, -50%) scale(.35); opacity: 0; }
.stage[data-phase="ping"] .sonar i { animation: sonar 2.4s var(--ease) infinite; }
.stage[data-phase="ping"] .sonar i:nth-child(2) { animation-delay: .8s; }
.stage[data-phase="ping"] .sonar i:nth-child(3) { animation-delay: 1.6s; }
@keyframes sonar { 0% { transform: translate(-50%,-50%) scale(.35); opacity: .55; } 100% { transform: translate(-50%,-50%) scale(1.02); opacity: 0; } }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; }
.tile { position: relative; background: color-mix(in srgb, var(--surface) var(--surface-alpha), transparent); border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow: hidden; }
.tile::before { content: ""; position: absolute; left: 12px; right: 12px; top: 0; height: 2px; border-radius: 0 0 2px 2px; background: var(--tile-color, var(--dim)); opacity: .25; transition: opacity .4s; }
.tile[data-tile="ping"], .tile[data-tile="jitter"] { --tile-color: var(--pale); }
.tile[data-tile="download"] { --tile-color: var(--blue); }
.tile[data-tile="upload"] { --tile-color: var(--amber); }
.tile.active::before, .tile.done::before { opacity: 1; }
.tile-label { font-size: 12px; color: var(--muted); }
.tile-value { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile-value b { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.tile-value small { font-size: 11px; color: var(--muted); margin-left: 4px; }
.tile-sub { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.active .tile-value b { color: var(--tile-color); }

/* ---------- plano ---------- */
.plan-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; width: 100%; font-size: 13px; color: var(--muted); }
.plan-pick select { font: inherit; font-size: 14px; color: var(--text); background: color-mix(in srgb, var(--surface) var(--surface-alpha), transparent); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; min-width: 200px; }
.plan-pick select:focus { outline: none; border-color: var(--blue); }
.plan-hint { flex-basis: 100%; text-align: center; font-size: 12px; color: var(--dim); }
.plan-compare { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) var(--surface-alpha), transparent); }
.plan-title { margin: 0 0 4px; font-size: 14px; }
.plan-row { display: grid; grid-template-columns: 70px 1fr 64px; align-items: center; gap: 12px; font-size: 13px; }
.plan-row span { color: var(--muted); }
.plan-row i { display: block; height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--text) 8%, transparent); overflow: hidden; }
.plan-row b { display: block; height: 100%; width: 0; border-radius: 999px; transition: width 1s var(--ease); }
.plan-row-dl b { background: linear-gradient(90deg, var(--dl-1), var(--dl-2)); }
.plan-row-ul b { background: linear-gradient(90deg, var(--ul-1), var(--ul-2)); }
.plan-row em { font-style: normal; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.plan-row-dl em { color: var(--blue-soft); } .plan-row-ul em { color: var(--amber-soft); }
.stage[data-phase="done"] .plan-pick { order: 5; }

/* ---------- resultado ---------- */
.result { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 18px; animation: rise .6s var(--ease) both; padding-top: 4px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.result-main { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.result-big { background: color-mix(in srgb, var(--surface) var(--surface-alpha), transparent); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px 18px; text-align: center; }
.result-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.result-num { font-variant-numeric: tabular-nums; }
.result-num b { font-size: clamp(40px, 10vw, 64px); font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.result-num small { display: block; font-size: 13px; margin-top: 8px; font-weight: 500; }
.result-peak { display: inline-flex; align-items: baseline; gap: 6px; margin-top: 14px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 60%, transparent); font-variant-numeric: tabular-nums; }
.result-peak span { font-size: 12px; color: var(--muted); }
.result-peak b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.result-peak small { font-size: 11px; color: var(--muted); }
.result-dl .result-peak b { color: var(--blue-soft); } .result-ul .result-peak b { color: var(--amber-soft); }
.result-dl b { color: var(--blue-soft); } .result-dl small { color: var(--blue); }
.result-ul b { color: var(--amber-soft); } .result-ul small { color: var(--amber); }
.verdict { margin: 0; max-width: 46ch; text-align: center; color: var(--text); font-size: 15px; }
.link-note { margin: -6px 0 0; max-width: 52ch; text-align: center; font-size: 14px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); color: var(--text); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.link-note::before { content: ""; display: inline-block; width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M2 8.5a15 15 0 0 1 20 0M5.5 12a10 10 0 0 1 13 0M9 15.5a5 5 0 0 1 6 0'/%3E%3Ccircle cx='12' cy='19' r='1' fill='black'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M2 8.5a15 15 0 0 1 20 0M5.5 12a10 10 0 0 1 13 0M9 15.5a5 5 0 0 1 6 0'/%3E%3Ccircle cx='12' cy='19' r='1' fill='black'/%3E%3C/svg%3E") center / contain no-repeat; }
.link-note[data-kind="wifi"], .link-note[data-kind="movel"] { border-color: color-mix(in srgb, var(--amber) 45%, transparent); color: var(--amber-soft); background: color-mix(in srgb, var(--amber) 10%, transparent); }
.link-note[data-kind="cabo"] { color: var(--muted); }
.link-note[data-kind="cabo"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4v8a4 4 0 0 0 4 4h8a4 4 0 0 0 4-4V4M9 4v4M15 4v4M12 16v4'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4v8a4 4 0 0 0 4 4h8a4 4 0 0 0 4-4V4M9 4v4M15 4v4M12 16v4'/%3E%3C/svg%3E"); }

.result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; }
.result-grid div { background: color-mix(in srgb, var(--surface) 60%, transparent); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.result-grid span { display: block; font-size: 12px; color: var(--muted); }
.result-grid b { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 12px 22px; cursor: pointer; font-weight: 600; font-size: 15px; transition: background .2s, transform .15s, border-color .2s; }
.btn:hover { border-color: var(--muted); }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: var(--btn-text); }
.btn.primary:hover { background: var(--blue-soft); border-color: var(--blue-soft); }
.result-id { margin: 0; font-size: 12px; color: var(--dim); }

/* ---------- erro ---------- */
.error { text-align: center; max-width: 44ch; padding: 24px 0; }
.error h2 { font-size: 20px; margin: 0 0 8px; font-weight: 600; }
.error p { color: var(--muted); margin: 0 0 18px; }

/* ---------- gráfico ---------- */
.graph-wrap { width: 100%; margin-top: 6px; }
.graph { display: block; width: 100%; height: 110px; border-bottom: 1px solid var(--line); }
.graph-mid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.area-dl { fill: url(#areaDl); } .area-ul { fill: url(#areaUl); }
.line-dl { fill: none; stroke: var(--blue); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.line-ul { fill: none; stroke: var(--amber); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.graph-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); padding-top: 6px; }
.graph-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.lg-dl::before { background: var(--blue); } .lg-ul::before { background: var(--amber); }

/* ---------- responsivo ---------- */
@media (max-width: 560px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
  .top-title { display: none; }
  .top-server { display: none; }
  .bottom { justify-content: center; text-align: center; }
  .gauge .ticks text { font-size: 15px; }
}
@media (min-width: 900px) and (min-height: 760px) {
  .stage { gap: 24px; }
  .gauge-wrap { width: 420px; }
}
@media (prefers-reduced-motion: reduce) {
  .stage[data-phase="ping"] .sonar i { animation: none; }
  .result { animation: none; }
  .gauge-wrap, .tile::before, .glow { transition: none; }
}
