html { background: #10131d; color: #f6f5ff; color-scheme: dark; }
html[data-theme=light] { background: #f1f4fa; color: #19243a; color-scheme: light; }
html[data-language-pending] body { visibility: hidden; }
:root {
    color-scheme: dark;
    --bg: #10131d;
    --surface: #181d2a;
    --surface-2: #202637;
    --header: #131722;
    --ink: #f6f5ff;
    --muted: #b2b9cf;
    --line: #333b50;
    --teal: #78eddb;
    --purple: #c2aeff;
    --brand-ink: #101b22;
    --primary: #78eddb;
    --active-bg: #223936;
    --shadow: #080a113d;
    --glow: #66ead529;
}
:root[data-theme=light] {
    color-scheme: light;
    --bg: #f1f4fa;
    --surface: #fff;
    --surface-2: #edf1f9;
    --header: #f9fbff;
    --ink: #19243a;
    --muted: #505e79;
    --line: #d1daea;
    --teal: #00776b;
    --purple: #6948bd;
    --brand-ink: #fff;
    --primary: #00776b;
    --active-bg: #dff4ee;
    --shadow: #26355c0d;
    --glow: #008d701c;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
    min-width: 0;
    margin: 0;
    color: var(--ink);
    background: radial-gradient(ellipse at 36% 0%, var(--surface-2), transparent 49rem), var(--bg);
    min-height: 100vh;
    font: 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
h1, h2, p, dl { margin: 0; }
h1 { font-size: clamp(1.8rem, 3.8vw, 2.75rem); letter-spacing: -.045em; line-height: 1.1; overflow-wrap: anywhere; }
h2 { font-size: 1.02rem; letter-spacing: -.015em; }
header { background: var(--header); border-bottom: 1px solid var(--line); }
.frame { width: min(1200px, calc(100% - 64px)); margin-inline: auto; }
.header-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 72px; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: .4em; justify-self: start; font-weight: 750; white-space: nowrap; color: var(--ink); letter-spacing: -.025em; font-size: 1.14rem; }
.brand:hover { text-decoration: none; }
.brand svg { color: var(--teal); width: 32px; height: 32px; margin-right: 4px; }
.brand span { color: var(--muted); font-weight: 500; }
nav, .preferences, .actions { display: flex; align-items: center; gap: 8px; }
nav a { padding: 8px 13px; border-radius: 8px; color: var(--muted); white-space: nowrap; font-weight: 650; }
nav a:hover, nav a[aria-current=page] { color: var(--teal); background: var(--active-bg); text-decoration: none; }
.preferences { justify-self: end; }
.icon-button { width: 40px; height: 40px; padding: 8px; display: inline-grid; place-items: center; font-size: 1.4rem; line-height: 1; }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
:root[data-theme=dark] .moon, :root[data-theme=light] .sun { display: none; }
main { padding-block: 46px 38px; min-height: calc(100vh - 155px); }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 17px; margin-bottom: 24px; }
.page-heading p { margin-top: 9px; color: var(--muted); }
.panel, dialog { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 10px 28px var(--shadow); min-width: 0; }
.primary, .quiet, .icon-button, input, select {
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--ink);
}
.quiet, .primary { display: inline-flex; padding: 8px 14px; min-height: 40px; align-items: center; justify-content: center; text-align: center; font-weight: 700; }
.primary { color: var(--brand-ink); background: var(--primary); border-color: var(--primary); }
.primary:hover, .quiet:hover { text-decoration: none; filter: brightness(1.08); }
input, select { padding: 7px 10px; min-height: 40px; min-width: 0; }
input::placeholder { color: var(--muted); opacity: .9; }
select { padding-right: 12px; }
.segmented { display: flex; padding: 4px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); }
.segmented button { padding: 6px 16px; border-radius: 7px; border: 0; background: transparent; color: var(--muted); font-weight: 750; }
.segmented button[aria-pressed=true] { color: var(--teal); background: var(--active-bg); }
.test-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 16px; }
.instrument { position: relative; display: flex; flex-direction: column; align-items: center; padding: 20px 24px 16px; overflow: hidden; }
.instrument-top { display: flex; width: 100%; justify-content: space-between; align-items: center; min-height: 36px; gap: 10px; color: var(--muted); }
.instrument-top label { display: inline-flex; gap: 8px; align-items: center; }
.instrument-top select { min-height: 34px; padding-block: 4px; }
.live-tag { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 700; }
.live-tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--glow); }
.dial { position: relative; width: min(100%, 431px); margin-top: 3px; }
.dial > svg { display: block; width: 100%; aspect-ratio: 360 / 265; overflow: visible; }
.track, .gauge-fill { fill: none; stroke-width: 7; stroke-linecap: round; }
.track { stroke: var(--line); opacity: .8; }
.gauge-fill { stroke: var(--teal); }
.instrument[data-phase=phaseUpload] .gauge-fill { stroke: var(--purple); }
.tick { stroke: var(--line); stroke-width: 1.3; }
.tick.major { stroke: var(--muted); stroke-width: 2; }
.tick-label { fill: var(--muted); font-size: 10px; font-weight: 650; text-anchor: middle; }
.needle { stroke: var(--ink); stroke-width: 2.1; stroke-linecap: round; }
.needle-hub { fill: var(--ink); }
.needle, .needle-hub { opacity: .85; }
.dial:has(.go:not([hidden])) .needle, .dial:has(.go:not([hidden])) .needle-hub { opacity: 0; }
.dial-center { position: absolute; z-index: 1; left: 50%; top: 55%; transform: translate(-50%, -50%); text-align: center; }
.go { position: relative; user-select: none; width: clamp(83px, 19vw, 112px); aspect-ratio: 1; border-radius: 50%; background: var(--surface); border: 2px solid var(--teal); color: var(--teal); font-size: 2rem; font-weight: 780; letter-spacing: -.05em; box-shadow: 0 0 29px var(--glow), inset 0 0 22px var(--glow); }
.go:hover { background: var(--active-bg); }
.go::after, .go::before { position: absolute; content: ""; pointer-events: none; inset: -8px; border: 1px solid var(--teal); border-radius: inherit; animation: radar 2.8s ease-out infinite; }
.go::after { animation-delay: 1.4s; }
@keyframes radar { 0% { transform: scale(.94); opacity: .45; } 80%, 100% { transform: scale(1.28); opacity: 0; } }
#readout { margin-top: 132%; min-width: 105px; background: var(--surface); border-radius: 10px; padding-inline: 7px; }
#readout output { display: block; font-size: clamp(1.55rem, 4.5vw, 2.65rem); font-weight: 760; letter-spacing: -.04em; line-height: 1.04; }
#readout span { color: var(--muted); font-size: .78rem; }
.instrument-message { text-align: center; min-height: 24px; color: var(--muted); }
.test-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; min-height: 42px; margin-top: 4px; }
.details { display: grid; grid-template-rows: auto 1fr; gap: 16px; }
.connection, .server { padding: 20px; }
.connection h2, .server h2 { color: var(--muted); }
.identity { margin: 7px 0 10px; font-weight: 750; font-size: clamp(1.05rem, 2.4vw, 1.34rem); overflow-wrap: anywhere; }
dl > div { display: grid; grid-template-columns: .9fr 1fr; gap: 9px; padding: 8px 0; border-top: 1px solid var(--line); }
dl dt, .muted { color: var(--muted); }
dl dd { margin: 0; overflow-wrap: anywhere; text-align: right; }
.server p { min-height: 12px; }
.server button { margin-top: 8px; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, .9fr)) repeat(2, minmax(0, 1.25fr)); gap: 12px; margin-top: 16px; }
.metric { padding: 14px; overflow: hidden; }
.metric h2 { color: var(--muted); }
.metric p { margin: 4px 0; white-space: nowrap; }
output { font-variant-numeric: tabular-nums; }
.metric output { font-size: clamp(1.15rem, 2.4vw, 1.85rem); font-weight: 750; letter-spacing: -.035em; }
.metric .unit, .metric-detail, .metric small { color: var(--muted); font-size: .8rem; }
.download { --series: var(--teal); }
.upload { --series: var(--purple); }
.metric output, .result-speeds output { color: var(--series, var(--ink)); }
.spark { display: block; width: 100%; height: 30px; margin-top: 3px; }
.spark polyline, .result-chart polyline { fill: none; stroke: var(--series, currentColor); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
dialog { color: var(--ink); padding: 19px; width: min(460px, calc(100% - 32px)); max-height: 85vh; }
dialog::backdrop { background: #050812af; }
.dialog-top, .chart-heading { display: flex; justify-content: space-between; align-items: center; gap: 13px; margin-bottom: 14px; }
.server-list { display: grid; gap: 7px; margin-top: 12px; }
.server-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; width: 100%; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; text-align: left; }
.server-row:hover, .server-row[aria-pressed=true] { border-color: var(--teal); }
.server-row strong, .server-row small { display: block; overflow-wrap: anywhere; }
.server-row small { color: var(--muted); }
#server-status { color: var(--muted); margin-top: 9px; }
.feedback:empty, .table-status:empty, #analytics-status:empty { display: none; }
.feedback { margin-block: 0 12px; color: var(--teal); }
.share-fallback { width: 100%; margin-top: 7px; }
.result-meta, .result-speeds, .result-latencies { display: grid; gap: 14px; }
.result-card { padding: 22px; }
.result-meta { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.result-meta span, .result-meta strong, .result-latencies span, .result-latencies strong, .result-latencies small { display: block; }
.result-meta span, .result-latencies span, .result-latencies small { color: var(--muted); font-size: .83rem; }
.result-meta strong { overflow-wrap: anywhere; }
.result-speeds { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 24px 0; }
.result-speeds article { padding: 14px; background: var(--surface-2); border-radius: 12px; }
.result-speeds p { color: var(--muted); white-space: nowrap; }
.result-speeds output { font-size: clamp(1.4rem, 4vw, 2.55rem); font-weight: 780; letter-spacing: -.04em; }
.result-latencies { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.result-latencies strong { font-size: 1.12rem; }
.chart-panel { padding: 20px; margin-block: 16px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: .8rem; }
.legend span::before { display: inline-block; content: ""; width: 9px; height: 9px; margin-right: 5px; background: var(--series); border-radius: 3px; }
.plot { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 10px; align-items: stretch; }
.chart-axis { display: flex; flex-direction: column; justify-content: space-between; text-align: right; }
.chart-time { display: flex; justify-content: space-between; grid-column: 2; }
.chart-axis, .chart-time { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.result-chart { display: block; width: 100%; height: 178px; }
.gridlines { stroke: var(--line); fill: none; vector-effect: non-scaling-stroke; }
.filters { display: grid; grid-template-columns: repeat(2, minmax(118px, 1fr)) repeat(3, minmax(110px, 1.1fr)) auto auto; align-items: end; gap: 10px; padding: 14px; margin-bottom: 16px; }
.filters-compact { grid-template-columns: repeat(2, minmax(118px, 190px)) auto auto; justify-content: start; }
label > span { color: var(--muted); }
.filters label, .admin-form label:not(.check) { display: grid; gap: 4px; font-weight: 650; min-width: 0; font-size: .88rem; }
.ledger { overflow: hidden; margin-bottom: 16px; }
.table-scroll { overflow-x: auto; }
.table-scroll:focus-visible { outline-offset: -3px; }
table { border-collapse: collapse; text-align: left; width: 100%; font-size: .87rem; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 12px; white-space: nowrap; }
th { background: var(--surface-2); color: var(--muted); font-weight: 750; }
th button { background: transparent; border: 0; color: inherit; font-weight: inherit; padding: 0; text-align: left; }
th button:hover { color: var(--teal); }
th small { color: var(--muted); display: inline-block; }
th[aria-sort] button { color: var(--teal); }
th[aria-sort=ascending] button::after { content: " ↑"; }
th[aria-sort=descending] button::after { content: " ↓"; }
tbody tr:hover { background: var(--surface-2); }
.table-status { padding: 12px; color: var(--muted); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 7px; padding: 10px 12px; color: var(--muted); }
.pager > div { display: flex; gap: 8px; align-items: center; }
.chart-select { display: flex; gap: 8px; align-items: center; }
.comparison { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, .8fr) minmax(60px, 3fr) minmax(80px, auto); align-items: center; gap: 11px; }
.bar-row strong { overflow-wrap: anywhere; }
.bar-row > span { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
meter { width: 100%; height: 16px; background: none; }
meter::-webkit-meter-bar { background: var(--surface-2); border: 0; }
meter::-webkit-meter-optimum-value { background: var(--series); }
meter::-moz-meter-bar { background: var(--series); }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.admin-panel { padding: 17px; }
.admin-form { display: grid; gap: 9px; margin-top: 8px; }
.admin-form .check { display: flex; align-items: center; gap: 8px; }
.admin-form .check input { min-height: auto; }
.admin-form button { justify-self: start; }
.admin-panel .feedback { margin-block: 10px 0; }
.footer { display: flex; justify-content: space-between; align-items: center; padding-block: 16px 24px; gap: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
@media (max-width: 1030px) {
    .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .filters-compact { grid-template-columns: repeat(2, minmax(118px, 190px)) auto auto; }
}
@media (max-width: 760px) {
    .frame { width: calc(100% - 30px); }
    .header-grid { grid-template-columns: 1fr auto; gap: 4px 10px; padding-block: 9px 7px; }
    .header-grid nav { grid-row: 2; grid-column: 1 / -1; flex-wrap: wrap; }
    .header-grid nav a { font-size: .88rem; padding: 6px 9px; }
    .preferences { grid-row: 1; grid-column: 2; }
    main { padding-block: 26px 25px; }
    .page-heading { align-items: start; flex-direction: column; margin-bottom: 15px; }
    #speedtest { display: flex; flex-direction: column; }
    .test-grid { display: contents; }
    .instrument { order: 1; }
    .metrics { order: 2; }
    .details { order: 3; margin-top: 12px; }
    .instrument { padding: 14px 12px 9px; }
    .details { grid-template-rows: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .connection, .server, .chart-panel, .result-card { padding: 13px; }
    .metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
    .metric { grid-column: span 2; padding: 9px; }
    .metric.download, .metric.upload { grid-column: span 3; }
    .metric .unit, .metric-detail, .metric small { font-size: .73rem; }
    .filters, .filters-compact, .result-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .result-meta { gap: 12px; }
    .admin-grid { grid-template-columns: minmax(0, 1fr); }
    .chart-heading { align-items: start; flex-wrap: wrap; }
    .chart-select { flex-wrap: wrap; }
    .bar-row { grid-template-columns: minmax(60px, 1fr) minmax(30px, 1fr) auto; }
}
@media (max-width: 450px) {
    .details { grid-template-columns: minmax(0, 1fr); }
    .dial { margin-top: 0; }
    #readout { margin-top: 94%; }
}
@media (prefers-reduced-motion: reduce) {
    .go::after, .go::before { animation: none; opacity: 0; }
}

.spark { color: var(--series); }
.spark .spark-area { stroke: none; }
.needle { filter: drop-shadow(0 0 3px var(--glow)); }
.node-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: .55rem; border: 1px solid var(--line); border-radius: 10px; padding: .75rem; }
.node-row small { color: var(--muted); overflow-wrap: anywhere; display: block; }
.node-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.node-actions button { min-height: 34px; padding: 5px 9px; }

.install-banner {
    position: fixed; z-index: 10; inset-inline-start: 50%;
    bottom: calc(19px + env(safe-area-inset-bottom, 0px));
    width: max-content; max-width: calc(100vw - 24px);
    display: flex; align-items: center; gap: .25rem;
    padding: .25rem .4rem; overflow: hidden;
    color: #eefaf7; background: #14252a; border: 1px solid #5dd9ba;
    border-radius: 100px; box-shadow: 0 5px 26px #173630a0, 0 0 17px #5dd9ba59;
    transform: translate(-50%, calc(100% + 70px));
    opacity: 0; transition: transform .28s ease-out, opacity .25s ease;
}
.install-banner.visible { transform: translate(-50%, 0); opacity: 1; }
.install-action, .install-close {
    border: 0; background: transparent; color: inherit;
    display: inline-flex; align-items: center; gap: .55rem; min-height: 42px;
}
.install-action { padding: .35rem .55rem; font-weight: 750; border-radius: 100px; }
.install-close { padding-inline: .55rem; font-size: 1.3rem; border-radius: 100px; }
.install-action:hover, .install-close:hover { background: #21433e; }
.install-countdown { position: absolute; inset: auto 0 0; height: 2px; background: #79edcb; transform-origin: left; }
.install-banner.visible .install-countdown { animation: install-countdown 10s linear forwards; }
@keyframes install-countdown { to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
    .install-banner { transition: none; }
    .install-countdown { display: none; }
}

.display-settings,.my-results,.share-details,.quality,.registrations { padding: 18px; min-width: 0; }
.display-settings,.my-results,.share-details,.registrations { margin-block: 14px; }
.measure-extras { order: 4; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(145px,1fr)); gap: 10px; margin-top: 9px; }
.settings-grid label { display: grid; min-width: 0; gap: 4px; }
.coordinates-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.quality { border: 1px solid var(--line); border-radius: 14px; margin-block: 14px; }
.quality-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.quality p { color: var(--muted); }
.grade { border: 1px solid var(--line); padding: .28rem .65rem; border-radius: 10px; color: var(--teal); font-size: 1.4rem; }
.quality-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; margin-top: 9px; }
.quality-grid article { padding: 9px; background: var(--surface-2); border-radius: 8px; display: grid; gap: 4px; }
.quality-grid span,.readiness span { color: var(--muted); font-size: .82rem; }
.readiness,#my-results-list { list-style: none; padding: 0; display: grid; gap: 6px; margin-bottom: 0; }
.readiness li,#my-results-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 12px; padding: 5px 0; }
.readiness [data-ready=true] strong { color: var(--teal); }
.my-results li { border-bottom: 1px solid var(--line); }
#server-search { width: 100%; margin-top: 12px; }
#server-sponsor,.result-qr a { overflow-wrap: anywhere; }
.host-menu { font-size: .85rem; }
.host-dialog { width: min(910px,calc(100% - 28px)); max-height: 88dvh; }
.host-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.host-grid h3 { margin: .2rem 0 .7rem; }
.host-grid ol { padding-inline-start: 20px; color: var(--muted); }
.host-grid pre { background: var(--surface-2); padding: 9px; overflow-wrap: anywhere; white-space: pre-wrap; border-radius: 8px; }
.os-tabs { width: max-content; max-width: 100%; }
.os-tabs [aria-selected=true] { color: var(--teal); background: var(--active-bg); }
.host-dialog .dialog-top h2 { margin-inline-end: auto; }
.registration-admin { margin-top: 14px; }
.share-details { display: grid; grid-template-columns: minmax(0,1fr) 160px; align-items: center; gap: 14px; }
.share-details .quality { margin: 0; }
.result-qr { display: grid; gap: 10px; }
.result-qr canvas { max-width: 100%; height: auto; image-rendering: pixelated; border-radius: 8px; }
@media (max-width: 760px) {
    .host-grid,.share-details { grid-template-columns: minmax(0,1fr); }
    .result-qr canvas { width: 132px; }
    .header-grid nav { gap: 3px; }
    .host-menu { min-height: 32px; padding: 4px 7px; }
    .measure-extras { order: 3; }
    .details { order: 4; }
}

/* Brand and unified measurement panel */
.brand { color: var(--ink); font-weight: 780; font-size: 1.24rem; letter-spacing: -.038em; }
.brand > span { color: var(--ink); font-weight: inherit; }
.brand .radar-brand { width: 43px; height: 43px; margin-right: 6px; overflow: visible; }
.radar-glow { stroke: #06b6d4; stroke-width: 5; opacity: .24; filter: drop-shadow(0 0 4px #06b6d4); animation: radar-glow 3s ease-in-out infinite; }
.radar-ring { stroke: #06b6d4; stroke-width: 1.9; }
.radar-track { stroke: #72e4f1; stroke-width: 1.2; }
.radar-inner { stroke: #42b2d1; }
.radar-eye { stroke: #a8f4ff; stroke-width: 1.7; }
.radar-pupil { fill: #a8f4ff; animation: radar-eye-shift 4s ease-in-out infinite; }
.radar-sweep { stroke: #06b6d4; stroke-width: 1.6; opacity: .72; transform-origin: 32px 32px; animation: radar-sweep 5s linear infinite; }
@keyframes radar-glow { 50% { opacity: .52; } }
@keyframes radar-eye-shift { 25% { transform: translate(2px,-1px); } 75% { transform: translate(-2px,1px); } }
@keyframes radar-sweep { to { transform: rotate(360deg); } }
@media(prefers-reduced-motion:reduce) {
    .radar-glow,.radar-pupil,.radar-sweep { animation: none; }
}
.measure-console {
    width: min(900px,100%); margin-inline: auto; padding: 15px clamp(10px,3.5vw,33px) 20px;
    display: grid; grid-template-areas: 'controls' 'metrics' 'dial' 'links'; justify-items: center;
    gap: 12px; position: relative; min-width: 0;
    background: radial-gradient(ellipse at 50% 64%,var(--active-bg),transparent 55%),var(--surface);
}
.console-controls { grid-area: controls; display: flex; align-items: center; justify-content: space-between; width: 100%; font-size: .86rem; }
.console-controls label { display: inline-flex; align-items: center; gap: 7px; }
.measure-kpis { grid-area: metrics; width: min(100%,580px); min-width: 0; }
.headline-kpis { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.headline-kpis article { text-align: center; border: 1px solid var(--line); border-radius: 14px; padding: 9px 7px 4px; min-width: 0; }
.headline-kpis h2 { font-size: clamp(.72rem,1.45vw,.95rem); text-transform: uppercase; letter-spacing: .055em; }
.headline-kpis h2 > span:first-child { color: var(--series); }
.headline-kpis small { color: var(--muted); text-transform: none; letter-spacing: 0; }
.headline-kpis output { color: var(--series); font: 740 clamp(1.34rem,4vw,2.65rem)/1.16 system-ui,sans-serif; letter-spacing: -.052em; overflow-wrap: anywhere; }
.headline-kpis .spark { height: 14px; }
.pulse-latency { display: grid; grid-template-columns: auto repeat(3,minmax(0,1fr)); gap: 6px; align-items: center; margin-top: 9px; }
.pulse-latency > strong { padding-inline-end: 4px; font-size: .86rem; white-space: nowrap; }
.pulse-latency small { color: var(--muted); font-weight: 500; }
.ping-value { display: grid; grid-template-columns: auto auto; align-items: center; justify-content: center; gap: 2px 5px; padding: 4px 2px; }
.ping-value > span:last-child { grid-column: 1/-1; color: var(--muted); font-size: .67rem; text-align: center; min-width: 0; }
.ping-icon { border: 1px solid currentColor; color: var(--ping); border-radius: 50%; width: 18px; height: 18px; display: inline-grid; place-items: center; line-height: 1; font-size: .75rem; }
.ping-idle { --ping: #d99f1a; } .ping-download { --ping: var(--teal); } .ping-upload { --ping: var(--purple); }
.ping-value output { font-size: .83rem; font-weight: 700; }
.experience-row { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; margin: 8px auto; }
.experience { min-width: 0; display: grid; justify-items: center; align-content: start; gap: 3px; text-align: center; font-size: .72rem; color: var(--muted); }
.experience svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.experience.web { --rating: #06b6d4; } .experience.game { --rating: #a78bfa; } .experience.stream { --rating: #10b981; } .experience.call { --rating: #f59e0b; }
.rating-dots { display: flex; gap: 3px; }
.rating-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--line); }
.rating-dots i.lit { background: var(--rating); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.measurement-detail,.result-readiness { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 12px; color: var(--muted); font-size: .76rem; }
.measurement-detail output,.result-readiness strong { color: var(--ink); }
.result-readiness { justify-content: start; margin-block: 12px; }
.console-dial { grid-area: dial; width: 100%; display: grid; justify-items: center; align-content: center; min-width: 0; }
.console-dial .dial { width: min(340px,100%); margin-inline: auto; }
.console-dial .dial-center { top: 59%; }
.console-dial #readout { margin-top: 80%; min-width: 0; background: transparent; }
.console-dial #readout output { font-size: clamp(1.1rem,5.7vw,2.1rem); }
.measure-console .console-dial .gauge-fill { stroke: url(#pulse-gradient); stroke-width: 13; }
.console-dial .track { stroke-width: 13; }
.console-dial .needle { stroke-width: 3.5; }
.console-dial .instrument-message { padding-block: 4px; min-height: 0; font-size: .81rem; }
.measure-console .test-actions { min-height: 0; }
.connections { grid-area: links; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 6px 16px; width: min(100%,580px); }
.connection-mode { display: none; }
.connection-summary { border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 3px; align-content: start; min-width: 0; overflow-wrap: anywhere; }
.connection-summary > span,.connection-summary small,.connection-mode > span { font-size: .76rem; color: var(--muted); }
.connection-summary strong { font-size: .9rem; }
.connection-summary button { justify-self: start; min-height: 32px; font-size: .75rem; margin-top: 2px; }
#speedtest.completed .measure-console {
    grid-template-areas: 'controls controls' 'dial metrics' 'links metrics';
    grid-template-columns: minmax(0,190px) minmax(0,1fr); align-items: start; column-gap: 22px;
}
#speedtest.completed .console-dial .dial > svg { display: none; }
#speedtest.completed .console-dial .dial { height: 83px; }
#speedtest.completed .console-dial .dial-center { top: 50%; }
#speedtest.completed .go { width: 68px; font-size: 1.2rem; }
#speedtest.completed .connections { grid-template-columns: minmax(0,1fr); }
#speedtest.completed .connection-mode { display: flex; gap: 6px; align-items: baseline; font-size: .83rem; }
#speedtest.completed .measure-kpis { align-self: center; }
#speedtest.completed .headline-kpis output { font-size: clamp(1.6rem,4.2vw,2.8rem); }
@media(max-width:535px) {
    #speedtest.completed .measure-console { grid-template-areas: 'controls controls' 'dial metrics' 'links links'; grid-template-columns: 60px minmax(0,1fr); gap: 8px; }
    #speedtest.completed .go { width: 44px; font-size: .86rem; }
    #speedtest.completed .connections { grid-template-columns: repeat(2,minmax(0,1fr)); }
    #speedtest.completed .connection-mode { grid-column: 1/-1; }
    #speedtest.completed .console-dial .instrument-message { max-width: 60px; overflow-wrap: anywhere; }
    #speedtest.completed .headline-kpis output { font-size: clamp(1.12rem,5.2vw,1.9rem); }
    .experience { font-size: .62rem; }
}

/* Enterprise footer */
.enterprise-footer { display: grid; justify-items: center; gap: 12px; margin-block-start: 21px; padding: 18px 0 20px; }
.footer-brand { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 9px 16px; text-align: center; }
.footer-brand p { margin: 0; font-family: ui-monospace,SFMono-Regular,Consolas,monospace; letter-spacing: .045em; }
.footer-brand p strong { color: #f59e0b; }
[data-theme=light] .footer-brand p strong { color: #9b4d04; }
.security-partner { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; font-size: .73rem; text-decoration: none; }
.security-partner svg,.traffic-badges svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.footer-policies,.traffic-badges { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 5px 12px; }
.footer-policies a,.footer-policies button { padding: 3px 2px; color: var(--muted); background: none; border: 0; font-size: .75rem; text-decoration: none; }
.footer-policies a:hover,.footer-policies button:hover { color: var(--ink); }
.traffic-badges { margin: 0; padding: 0; list-style: none; gap: 6px; }
.traffic-badges li { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--visit); color: var(--visit-ink,var(--visit)); background: #112131; border-radius: 999px; padding: 4px 8px; font-size: .75rem; line-height: 1.25; }
.traffic-badges strong { font-variant-numeric: tabular-nums; font-weight: 820; }
.visit-today { --visit: #06b6d4; --visit-ink: #63d9ef; }
.visit-week { --visit: #10b981; --visit-ink: #68e1b3; }
.visit-month { --visit: #3b82f6; --visit-ink: #a3c8ff; }
.visit-year { --visit: #f59e0b; --visit-ink: #ffcf7a; }
.visit-pages { --visit: #8b5cf6; --visit-ink: #c7adff; }
.policy-dialog { width: min(640px,calc(100% - 24px)); }
#policy-content { display: grid; gap: 10px; margin-bottom: 9px; color: var(--muted); }
.infrastructure-tools { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
#infrastructure-list { display: grid; gap: 4px; padding: 0; list-style: none; max-height: 38vh; overflow: auto; }
#infrastructure-list li { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 10px; align-items: center; padding: .4rem; border-bottom: 1px solid var(--line); }
#infrastructure-list li strong { overflow-wrap: anywhere; }
.status-online > span { color: var(--teal); } .status-offline > span { color: #dc785e; }

.brand .brand-name {
    color: #49dddb;
    background: linear-gradient(100deg, #4de9db, #66b6ff 40%, #b6a1ff 70%, #ffbf8c);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    letter-spacing: -.025em;
}
:root[data-theme="light"] .brand .brand-name {
    background-image: linear-gradient(100deg, #087d79, #1552af 42%, #6540b1 75%, #a35315);
}
.footer-policies button, .footer-policies a {
    text-decoration: none;
    font-weight: 500;
    letter-spacing: .018em;
    transition: color .2s ease;
}
.footer-policies button:hover, .footer-policies a:hover { color: var(--ink); text-decoration: none; }
.footer-policies button:active, .footer-policies a:active,
.footer-policies button:focus-visible, .footer-policies a:focus-visible { color: var(--teal); text-decoration: none; }
.preferences select, #host-language { max-width: min(12rem, 40vw); }
.embed-dialog { width: min(56rem, calc(100% - 1.5rem)); }
.embed-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: .8rem; }
.embed-options label, .embed-snippet { display: grid; gap: .35rem; }
.embed-options select, .embed-options input, .embed-snippet textarea { width: 100%; min-width: 0; }
.embed-options fieldset { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .5rem; margin: 0; }
.embed-preview { border: 1px solid var(--line); border-radius: .75rem; padding: .5rem; overflow: auto; }
.embed-preview iframe { display: block; max-width: 100%; max-height: 58vh; margin-inline: auto; border: 0; }
.embed-snippet { margin-block: 1rem; }
.embed-credit { margin: 1.2rem auto; text-align: center; font-size: .8rem; }
:root[data-embed="true"] main { width: min(100% - 1rem, 55rem); padding-block: .75rem; }
:root[data-embed="true"] .display-settings, :root[data-embed="true"] .my-results,
:root[data-embed="true"] .page-heading p, :root[data-embed="true"] .host-menu { display: none; }
.instrument.completed .measure-kpis, .instrument.completed .console-dial {
    animation: result-reveal .4s ease both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .instrument.completed .measure-kpis, .instrument.completed .console-dial { animation: none; }
}

.host-admin-tools { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem; margin-block: .8rem; }
.host-admin-tools label { display: grid; gap: .3rem; min-width: 0; }
.host-admin-tools select { max-width: 100%; }
.host-details { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .3rem .6rem; margin: .3rem 0; font-size: .82rem; }
.host-details dt { color: var(--muted); }
.host-details dd { margin: 0; overflow-wrap: anywhere; }
.host-details dd button { padding: .15rem .45rem; }
.host-statistics { width: min(52rem, calc(100% - 1.5rem)); }
.host-statistics .table-wrap { overflow-x: auto; }
.region-flag { width: 1.2rem; margin-inline-end: .45rem; vertical-align: middle; }

.radar-brand .radar-ring { stroke: url(#wan-masthead-ring); }

@media (max-width: 980px) {
    .header-grid { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding-block: 8px; }
    .header-grid nav { grid-row: 2; grid-column: 1 / -1; min-width: 0; flex-wrap: wrap; }
    .preferences { grid-row: 1; grid-column: 2; }
}
@media (max-width: 480px) {
    .brand { font-size: 1.04rem; }
    .brand .radar-brand { width: 34px; height: 34px; margin-inline-end: 2px; }
    .preferences select { max-width: 31vw; }
}

/* Compact settings, function colors, and host registration */
.display-settings {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    gap: .65rem;
    margin-block: .65rem;
    padding: .35rem .65rem;
    border-radius: .7rem;
}
.display-settings h2 { margin: 0; font-size: .8rem; line-height: 1.1; }
.display-settings .settings-grid {
    grid-template-columns: repeat(4,minmax(0,1fr));
    margin: 0;
    gap: .24rem .5rem;
}
.display-settings label { gap: .12rem; color: var(--muted); font-size: .68rem; line-height: 1.15; min-width: 0; }
.display-settings select { width: 100%; height: 26px; min-height: 26px; line-height: 1.1; padding: .08rem .35rem; font-size: .75rem; border-radius: .4rem; }
@media (max-width: 600px) {
    .display-settings { grid-template-columns: minmax(0,1fr); gap: .25rem; }
    .display-settings .settings-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

.ui-icon-definitions { position: absolute; inline-size: 0; block-size: 0; overflow: hidden; }
.ui-icon { width: 1.08em; height: 1.08em; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.nav-speed { --function-color: #5ee5af; --function-base: #10b981; }
.nav-history { --function-color: #8ebdff; --function-base: #3b82f6; }
.nav-chart { --function-color: #c4afff; --function-base: #8b5cf6; }
.nav-host { --function-color: #ffd083; --function-base: #f59e0b; }
.nav-embed { --function-color: #ffaee2; --function-base: #ec4899; }
.nav-cyan { --function-color: #7ce6f5; --function-base: #06b6d4; }
.nav-danger { --function-color: #ffa4a5; --function-base: #ef4444; }
[data-theme=light] .nav-speed { --function-color: #086c4a; }
[data-theme=light] .nav-history { --function-color: #1e54a8; }
[data-theme=light] .nav-chart { --function-color: #5c35a8; }
[data-theme=light] .nav-host { --function-color: #804309; }
[data-theme=light] .nav-embed { --function-color: #962460; }
[data-theme=light] .nav-cyan { --function-color: #086978; }
[data-theme=light] .nav-danger { --function-color: #a42c34; }

.main-navigation .nav-action, .node-actions .host-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .36rem;
    color: var(--function-color);
    border: 1px solid color-mix(in srgb, var(--function-base) 35%, var(--line));
    background: color-mix(in srgb, var(--function-base) 8%, var(--surface));
    border-radius: .56rem;
    min-width: 0;
    padding: .38rem .53rem;
    line-height: 1.22;
    white-space: normal;
    text-align: center;
    overflow-wrap: anywhere;
    font-size: .81rem;
    font-weight: 660;
    transition: background-color .18s ease, border-color .18s ease;
}
.main-navigation .nav-action:hover, .main-navigation .nav-action[aria-current=page],
.node-actions .host-action:hover:not(:disabled) {
    color: var(--function-color);
    border-color: var(--function-base);
    background: color-mix(in srgb, var(--function-base) 19%, var(--surface));
}
.main-navigation .nav-action:focus-visible, .node-actions .host-action:focus-visible {
    outline: 2px solid var(--function-base);
    outline-offset: 2px;
}
@media (max-width: 600px) {
    .header-grid .main-navigation { gap: .25rem; }
    .main-navigation .nav-action { padding: .34rem .4rem; font-size: .74rem; min-height: 32px; }
}

.admin-grid { grid-template-columns: minmax(0,1fr); }
.host-directory-panel #unlock { max-inline-size: 29rem; }
.host-directory-panel #node-list, #registration-rows {
    grid-template-columns: repeat(auto-fit,minmax(min(100%,18rem),1fr));
    align-items: stretch;
}
#node-list .node-row { align-content: start; grid-template-rows: auto auto auto 1fr auto; }
.node-row > strong { overflow-wrap: anywhere; }
@media (min-width: 1000px) {
    .host-directory-panel #node-list, #registration-rows { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 620px) {
    .host-directory-panel #node-list, #registration-rows { grid-template-columns: minmax(0,1fr); }
}

.partner-requirements {
    margin-block: 0 .75rem;
    padding: .65rem .75rem;
    border: 1px solid var(--line);
    border-inline-start: 3px solid var(--teal);
    border-radius: .5rem;
    background: var(--surface-2);
    color: var(--ink);
    font-size: .84rem;
    overflow-wrap: anywhere;
}
.partner-field-error {
    color: #ffb0b4;
    font-size: .76rem;
    font-weight: 650;
    overflow-wrap: anywhere;
}
#partner-form input[aria-invalid=true] { outline: 2px solid #ef4444; outline-offset: 1px; }
[data-theme=light] .partner-field-error { color: #9d2534; }
.partner-consent {
    padding: .65rem;
    border: 1px solid var(--line);
    border-radius: .5rem;
    background: var(--surface-2);
    overflow-wrap: anywhere;
}
#partner-form .partner-consent label { display: grid; grid-template-columns: 1.2rem minmax(0,1fr); align-items: start; gap: .45rem; }
.partner-consent input { width: 1rem; height: 1rem; min-height: 0; margin: .15rem 0 0; accent-color: var(--teal); }
.partner-consent .terms-link {
    display: inline-block;
    margin: .35rem 0 0;
    padding: .18rem 0;
    color: var(--teal);
    background: transparent;
    border: 0;
    text-decoration: underline;
    text-underline-offset: .18em;
    font-size: .83rem;
}
.partner-submit-hint { color: var(--muted); font-size: .76rem; margin: 0; overflow-wrap: anywhere; }
.host-terms-list { display: grid; gap: .55rem; padding-inline-start: 1.2rem; overflow-wrap: anywhere; }

.install-banner {
    inset-inline-start: auto;
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    max-width: min(19rem,calc(100vw - 24px));
    border-radius: .85rem;
    transform: translateY(calc(100% + 30px));
}
.install-banner.visible { transform: translateY(0); }
.install-banner.near-counters { visibility: hidden; pointer-events: none; }
.install-banner .install-action { font-size: .82rem; min-width: 0; text-align: start; }
.install-action span { overflow-wrap: anywhere; }
.install-action img, .install-action svg { flex: 0 0 auto; }
[data-theme=light] .install-banner {
    color: #125144;
    background: #edfdfa;
    border-color: #18816c;
    box-shadow: 0 4px 22px #27564d38;
}
[data-theme=light] .install-action:hover, [data-theme=light] .install-close:hover { background: #d9f4ee; }
