@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    color-scheme: light;
    --paper: #f5f5f5;
    --surface: #ffffff;
    --ink: #323130;
    --muted: #605e5c;
    --line: #e1dfdd;
    --accent: #0078d4;
    --accent-soft: #eff6fc;
    --accent-hover: #106ebe;
    --accent-border: #c7e0f4;
    --restricted: #d83b01;
    --success: #107c10;
    --critical: #2e7d32;
    --realtime: #e8c547;
    --interactive: #e88b3a;
    --standard: #cb4b3f;
    --async: #7a2336;
    --critical-text: #25662a;
    --realtime-text: #806000;
    --interactive-text: #a13a01;
    --standard-text: #b13029;
    --async-text: #7a2336;
    --mono: 'IBM Plex Mono', monospace;
    --sans: 'Manrope', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; letter-spacing: 0; }
[hidden] { display: none !important; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 13px; line-height: 1.5; }
button, input, select { font: inherit; color: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
button { background: none; border: 0; }
button:disabled { cursor: wait; opacity: .5; }
a { color: inherit; text-decoration: none; }
svg.lucide { width: 18px; height: 18px; stroke-width: 1.7; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; flex-shrink: 0; }
select { background-color: var(--surface); border: 1px solid var(--line); border-radius: 5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; z-index: 20000; top: -60px; left: 20px; background: var(--ink); color: white; padding: 10px 18px; }
.skip-link:focus { top: 12px; }

.header { position: relative; z-index: 500; background: var(--accent); color: var(--surface); border-bottom: 1px solid var(--accent-hover); }
.header-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 28px; min-height: 76px; max-width: 1840px; padding: 12px 36px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; justify-self: start; min-width: 0; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 7px; background: var(--accent); color: white; }
.header .brand-mark { width: 40px; height: 40px; flex-shrink: 0; border: 1px solid #ffffff40; background: #ffffff14; color: var(--surface); border-radius: 8px; }
.brand-mark svg.lucide { width: 23px; height: 23px; stroke-width: 1.6; }
.brand-copy { display: grid; gap: 4px; }
.brand-name { font-size: 21px; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.brand-name > span { font-weight: 500; }
.brand-platform { color: var(--surface); font: 9px var(--mono); }
.view-toggle { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-self: center; width: 240px; height: 42px; padding: 4px; gap: 4px; border: 1px solid #ffffff30; border-radius: 7px; background: #005a9e; }
.view-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; color: var(--surface); font-size: 12px; font-weight: 600; white-space: nowrap; border-radius: 4px; transition: background .15s, color .15s; }
.view-btn:hover { background: #004578; }
.view-btn.active { background: var(--surface); color: #005a9e; box-shadow: 0 1px 4px #00000014; }
.header-right { display: flex; align-items: center; justify-self: end; gap: 16px; min-width: 0; }
.header-actions { display: flex; align-items: center; gap: 4px; padding-left: 16px; border-left: 1px solid #ffffff40; }
.data-status { display: inline-flex; gap: 7px; align-items: center; padding: 5px 9px; border: 1px solid var(--line); border-radius: 4px; margin-right: 6px; background: var(--surface); color: var(--ink); font-size: 10px; white-space: nowrap; }
.header .data-status { margin: 0; font-size: 11px; }
.header .data-status:not(.demo) { padding: 0; background: transparent; color: var(--surface); border-color: transparent; }
.header .data-status:not(.demo) .status-dot { background: #b6efab; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.data-status.demo { color: var(--ink); border-color: #ffb900; background: #fff4ce; }
.data-status.demo .status-dot { background: var(--interactive); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--muted); transition: background .15s, color .15s; }
.icon-btn:hover { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-border); }
.header .icon-btn { width: 36px; height: 36px; background: transparent; color: var(--surface); border-color: transparent; }
.header .icon-btn:hover { background: #005a9e; }
.header :focus-visible { outline-color: var(--surface); }
.header .view-btn.active:focus-visible { outline-color: var(--accent); outline-offset: -3px; }
.icon-btn.small { width: 28px; height: 28px; border-color: transparent; background: transparent; }
.icon-btn.small svg { width: 16px; height: 16px; }
[data-tooltip] { position: relative; }
[data-tooltip]::after { content: attr(data-tooltip); position: absolute; z-index: 12000; top: calc(100% + 8px); right: 0; width: max-content; max-width: 210px; padding: 6px 9px; background: var(--ink); color: white; font: 11px var(--sans); border-radius: 4px; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .15s; }
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after { opacity: 1; visibility: visible; }
.is-refreshing svg { animation: rotate 1.2s linear infinite; }

.dashboard { max-width: 1840px; margin: 0 auto; padding: 26px 36px 0; }
.overview-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.eyebrow { display: block; color: var(--muted); font: 9px var(--mono); }
h1 { font-size: 28px; font-weight: 700; line-height: 1.35; margin-top: 4px; }
.heading-period { color: var(--accent); }
.last-measurement { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.last-measurement svg { width: 16px; height: 16px; }
.last-measurement-label { display: block; font-size: 10px; margin-bottom: 3px; }
.last-measurement-value { display: block; font: 11px var(--mono); color: var(--ink); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 20px 0 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.metric { padding: 0 28px; border-right: 1px solid var(--line); min-width: 0; }
.metric:first-child { padding-left: 0; }
.metric:last-child { border-right: 0; }
.metric-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.metric-label svg.lucide { width: 14px; height: 14px; }
.metric-value { font: 500 31px/1.3 var(--mono); margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.metric-unit { margin-left: 6px; font-size: 15px; color: var(--muted); font-weight: 400; }
.metric-highlight { color: var(--accent); }
.metric-caption { font-size: 10px; color: var(--muted); overflow-wrap: anywhere; }
.data-notice { padding: 10px 14px; margin: -8px 0 18px; color: var(--ink); background: #fff4ce; border-left: 3px solid #ffb900; font-size: 12px; }

.network-workspace { display: grid; grid-template-columns: 236px minmax(0, 1fr) 298px; height: max(560px, calc(100dvh - 367px)); max-height: 850px; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sidebar { min-width: 0; padding: 0 20px 16px 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; background: var(--paper); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 58px; }
h2 { font-size: 13px; font-weight: 800; }
h3 { font-size: 11px; font-weight: 700; }
.panel-heading-icon { color: var(--muted); width: 15px !important; height: 15px !important; }
.region-selector { padding: 7px 0 21px; border-bottom: 1px solid var(--line); }
.region-selector label { margin-bottom: 9px; }
.region-selector select { width: 100%; min-height: 40px; font-size: 12px; font-weight: 700; padding: 8px 9px; }
.source-meta { display: flex; align-items: center; gap: 6px; min-height: 22px; margin-top: 6px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.source-meta .region-dot { width: 5px; height: 5px; }
.destination-filter { padding-top: 15px; }
.filter-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.filter-controls { display: flex; gap: 1px; }
.geo-filters { display: flex; flex-direction: column; gap: 2px; }
.geo-filter-btn { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 33px; padding: 5px 8px; border-radius: 4px; color: var(--muted); text-align: left; font-size: 11px; transition: background .15s; }
.geo-filter-btn:hover { background: var(--accent-soft); }
.geo-filter-btn.active { color: var(--ink); }
.geo-check { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border: 1px solid #8a8886; border-radius: 3px; flex-shrink: 0; }
.geo-check svg.lucide { width: 10px; height: 10px; stroke-width: 3; visibility: hidden; }
.geo-filter-btn.active .geo-check, .geo-filter-btn.partial .geo-check { background: var(--accent); border-color: var(--accent); color: white; }
.geo-filter-btn.active .geo-check svg { visibility: visible; }
.geo-filter-btn.partial .geo-check::after { content: ''; width: 7px; height: 2px; background: white; }
.geo-filter-btn.partial .geo-check svg { display: none; }
.geo-filter-btn .count { margin-left: auto; font: 10px var(--mono); color: var(--muted); }
.regions-list-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 11px 0; margin-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; text-align: left; }
.toggle-icon { width: 13px !important; height: 13px !important; transition: transform .15s; }
.regions-list-toggle.open .toggle-icon { transform: rotate(180deg); }
.destination-checkboxes { display: none; max-height: 245px; overflow-y: auto; padding: 5px 0; }
.destination-checkboxes.open { display: block; }
.destination-checkbox-item { display: flex; align-items: center; gap: 9px; padding: 6px 3px; font-size: 11px; }
.destination-checkbox-item label { cursor: pointer; }
.destination-checkboxes .search-field { position: sticky; top: 0; background: var(--surface); margin-bottom: 8px; }
.filter-summary { margin-top: 3px; font: 9px var(--mono); color: var(--accent-hover); }
.region-legend { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
.region-legend h3 { margin-bottom: 10px; }
.region-legend > div { display: flex; flex-wrap: wrap; gap: 8px 13px; }
.region-legend span { display: flex; align-items: center; gap: 5px; font-size: 9px; color: var(--muted); }
.region-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.recommended { background: var(--success); }
.other { background: var(--accent); }
.restricted { background: var(--restricted); }
.region-details { margin-top: 17px; border-top: 1px solid var(--line); padding-top: 10px; }
.region-details summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-size: 10px; color: var(--muted); list-style: none; }
.region-details summary::-webkit-details-marker { display: none; }
.region-details summary svg { width: 13px; height: 13px; }
.region-details[open] summary svg { transform: rotate(180deg); }
.stats-panel { padding: 12px 0; }
.stat-item { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 10px; }
.stat-label { color: var(--muted); flex-shrink: 0; }
.stat-value { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.stat-hint { display: none; }

.map-panel { display: flex; flex-direction: column; min-width: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.map-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 66px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.map-heading h2 { font-size: 12px; }
.map-heading #mapRegionLabel { font-size: 10px; color: var(--muted); }
.map-tools { display: flex; align-items: center; gap: 13px; }
.toggle-control { display: inline-flex; align-items: center; gap: 6px; position: relative; cursor: pointer; font-size: 10px; color: var(--muted); }
.toggle-control input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.switch-track { width: 25px; height: 14px; border-radius: 12px; background: #8a8886; position: relative; pointer-events: none; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 8px; height: 8px; background: white; border-radius: 50%; transition: transform .15s; }
.toggle-control input:checked + .switch-track { background: var(--accent); }
.toggle-control input:checked + .switch-track::after { transform: translateX(11px); }
.toggle-control input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 3px; }
.map-stage { position: relative; flex: 1; min-height: 0; isolation: isolate; }
#map { height: 100%; width: 100%; background: #f3f2f1; z-index: 0; }
.map-coordinate { display: flex; align-items: center; gap: 6px; position: absolute; z-index: 400; top: 17px; left: 20px; padding: 5px 7px; background: #ffffffd9; color: var(--muted); font: 9px var(--mono); pointer-events: none; }
.map-coordinate .status-dot { width: 4px; height: 4px; }
.map-legend { position: absolute; bottom: 27px; left: 20px; z-index: 400; width: min(338px, calc(100% - 82px)); padding: 12px 14px; background: #ffffffed; border: 1px solid var(--line); border-radius: 4px; }
.map-legend-title { font: 8px var(--mono); color: var(--muted); display: flex; justify-content: space-between; margin-bottom: 9px; }
.map-legend-title > span { text-transform: none; }
.latency-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.latency-scale > span { color: var(--muted); font: 8px var(--mono); white-space: nowrap; }
.latency-scale b { display: block; width: 100%; height: 7px; border-radius: 1px; margin-bottom: 6px; }
.critical-bg { background: var(--critical); }
.realtime-bg { background: var(--realtime); }
.interactive-bg { background: var(--interactive); }
.standard-bg { background: var(--standard); }
.async-bg { background: var(--async); }
.leaflet-container { font-family: var(--sans); }
.leaflet-container a { color: var(--accent); }
.leaflet-control-attribution { font-size: 8px !important; background: #ffffffbb !important; }
.leaflet-touch .leaflet-bar { border: 1px solid var(--line); box-shadow: 0 2px 6px #00000008; border-radius: 5px; overflow: hidden; }
.leaflet-touch .leaflet-bar a { width: 30px; height: 30px; line-height: 30px; font-size: 19px; font-weight: 400; color: var(--ink); border-color: var(--line); }
.leaflet-bottom.leaflet-right .leaflet-control-zoom { margin: 0 16px 27px 0; }
.leaflet-tooltip { border: 1px solid var(--line); padding: 6px 9px; color: var(--ink); box-shadow: 0 2px 8px #00000012; border-radius: 4px; font-size: 10px; }
.source-tooltip { background: var(--ink); color: white; border: 0; font-weight: 600; }
.source-tooltip.leaflet-tooltip-top::before { border-top-color: var(--ink); }
.leaflet-popup-content-wrapper { border-radius: 7px; color: var(--ink); box-shadow: 0 5px 24px #00000026; }
.leaflet-popup-content { min-width: 225px; max-width: 270px; margin: 16px; font: 11px/1.7 var(--sans); }
.popup-title { font-weight: 800; padding-bottom: 9px; margin-bottom: 7px; border-bottom: 1px solid var(--line); }
.popup-rtt { font: 500 21px/1.6 var(--mono); }
.popup-latency, .popup-route, .popup-measurements { color: var(--muted); font-size: 10px; }
.popup-measurements { border-top: 1px solid var(--line); padding-top: 7px; margin-top: 8px; font-family: var(--mono); }

.routes-panel { min-width: 0; display: flex; flex-direction: column; padding: 0 17px; overflow: hidden; }
.routes-panel .panel-heading { min-height: 58px; }
.routes-panel h2 { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.count-badge { font: 9px var(--mono); color: var(--muted); background: #f3f2f1; border-radius: 3px; padding: 2px 5px; }
.route-context { display: flex; gap: 6px; align-items: center; color: var(--accent-hover); font-size: 10px; margin: -1px 0 16px; }
.route-context > svg { width: 12px; height: 12px; margin-left: auto; }
.search-field { display: flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; }
.search-field > svg { width: 13px; height: 13px; color: var(--muted); }
.search-field:focus-within { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.search-field input { min-width: 0; width: 100%; height: 32px; border: 0; outline: 0; background: transparent; font-size: 10px; }
.search-field input::placeholder { color: #767370; }
.ranking-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-top: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--muted); }
.ranking-toolbar > span { font: 8px var(--mono); }
.ranking-toolbar select { min-height: 26px; max-width: 115px; padding: 3px 4px; font-size: 9px; border: 0; color: var(--muted); }
.latency-list { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; margin-right: -9px; padding-right: 9px; }
.latency-item { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; border-bottom: 1px solid #edebe9; padding: 14px 1px; text-align: left; cursor: pointer; transition: background .15s; }
.latency-item:hover, .latency-item.active { background: var(--accent-soft); }
.route-rank { color: var(--muted); font: 9px var(--mono); }
.route-info { min-width: 0; }
.destination { display: block; font-size: 11px; font-weight: 700; overflow-wrap: anywhere; }
.route-country { display: block; color: var(--muted); font-size: 9px; margin-top: 3px; }
.value { display: block; text-align: right; font: 500 12px var(--mono); white-space: nowrap; }
.value small { font-size: 8px; font-weight: 400; color: var(--muted); }
.latency-bar { display: block; height: 3px; width: 49px; margin-top: 7px; margin-left: auto; background: #edebe9; border-radius: 2px; }
.latency-bar b { display: block; height: 100%; border-radius: 2px; background: currentColor; }
.critical { color: var(--critical-text); }
.realtime { color: var(--realtime-text); }
.interactive { color: var(--interactive-text); }
.standard { color: var(--standard-text); }
.async { color: var(--async-text); }
.latency-details { display: none; grid-column: 2 / -1; color: var(--muted); font: 9px/1.8 var(--mono); }
.latency-item.active .latency-details { display: grid; }
.route-footnote { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 41px; color: var(--muted); border-top: 1px solid var(--line); font-size: 9px; flex-shrink: 0; }
.route-footnote svg { width: 12px; height: 12px; }
.no-data { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 48px 20px; min-height: 175px; color: var(--muted); text-align: center; font-size: 12px; }
.no-data svg { width: 28px; height: 28px; opacity: .6; }
.sidebar-close, .mobile-menu-btn, .sidebar-overlay { display: none; }

.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 36px; margin: auto; max-width: 1840px; color: var(--muted); font-size: 9px; }
.site-footer > div { display: flex; align-items: center; gap: 22px; }
.site-footer a { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.site-footer a:hover { color: var(--accent); }
.site-footer svg.lucide { width: 11px; height: 11px; }
.site-footer-sep { padding: 0 9px; color: #c8c6c4; }
.toast { position: fixed; z-index: 12000; bottom: 24px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); background: var(--ink); color: white; padding: 12px 18px; border-radius: 5px; box-shadow: 0 4px 20px #0000001f; font-size: 12px; }
.loading { position: fixed; z-index: 15000; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--paper); transition: opacity .25s, visibility .25s; }
.loading.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-content { width: min(280px, calc(100% - 48px)); text-align: center; }
.loading-title { font-size: 23px; font-weight: 800; margin: 15px 0 6px; }
.loading-text { font-size: 11px; color: var(--muted); }
.progress-container { height: 3px; margin-top: 22px; border-radius: 2px; background: var(--line); overflow: hidden; }
.progress-bar { width: 0; height: 100%; background: var(--accent); transition: width .3s; }
.loading-percent { margin-top: 8px; font: 10px var(--mono); color: var(--muted); }

#matrix { height: max(560px, calc(100dvh - 367px)); display: flex; flex-direction: column; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.matrix-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.matrix-select, .matrix-btn { min-height: 33px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); font-size: 11px; }
.matrix-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.matrix-btn:hover { background: var(--accent-soft); border-color: var(--accent-border); }
.matrix-btn-accent { background: var(--accent); color: white; border-color: var(--accent); }
.matrix-btn-accent:hover { color: var(--accent); }
.matrix-toolbar-label { color: var(--muted); font-size: 10px; }
.matrix-legend { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; color: var(--muted); font-size: 9px; }
.matrix-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.matrix-legend-item b { width: 14px; height: 14px; border-radius: 2px; }
.matrix-scroll { flex: 1; overflow: auto; position: relative; min-height: 0; scrollbar-width: thin; scrollbar-color: #c8c6c4 var(--paper); }
.matrix-table { border-collapse: separate; border-spacing: 0; min-width: max-content; font-size: 10px; }
.matrix-corner { position: sticky; top: 0; left: 0; z-index: 3; background: var(--paper); color: var(--muted); padding: 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); min-width: 160px; text-align: left; font: 10px var(--mono); }
.matrix-col-header { position: sticky; top: 0; z-index: 2; background: var(--paper); border-bottom: 1px solid var(--line); padding: 0; height: 146px; min-width: 48px; max-width: 48px; vertical-align: bottom; }
.matrix-col-header-text { writing-mode: vertical-rl; transform: rotate(180deg); padding: 10px 15px; white-space: nowrap; font-weight: 600; font-size: 10px; }
.matrix-row-header { position: sticky; left: 0; z-index: 1; background: var(--paper); padding: 9px 12px; font-weight: 600; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; min-width: 160px; font-size: 10px; }
.matrix-cell { padding: 6px 4px; text-align: center; font: 400 10px var(--mono); min-width: 48px; max-width: 48px; border-right: 2px solid white; border-bottom: 2px solid white; cursor: crosshair; }
.matrix-cell:hover, .matrix-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.matrix-tooltip, .matrix-sparkline-popup { position: fixed; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 13px 15px; color: var(--ink); font-size: 11px; line-height: 1.8; z-index: 10001; pointer-events: none; box-shadow: 0 6px 24px #00000020; display: none; max-width: min(320px, calc(100vw - 24px)); }
.matrix-sparkline-popup canvas { display: block; max-width: 100%; }
.sparkline-title { font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.sparkline-value { font: 500 15px var(--mono); color: var(--accent); margin-bottom: 8px; }
.sparkline-value span, .sparkline-meta { font: 10px var(--sans); color: var(--muted); }
.matrix-multiselect-popover { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 13px; box-shadow: 0 8px 30px #00000026; width: min(270px, calc(100vw - 24px)); max-height: min(430px, calc(100dvh - 100px)); display: flex; flex-direction: column; }
.matrix-search { padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); font-size: 11px; margin-bottom: 10px; width: 100%; }
.matrix-multiselect-list { overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 2px; }
.matrix-ms-item { display: flex; align-items: center; gap: 8px; padding: 7px 5px; border-radius: 3px; font-size: 11px; cursor: pointer; }
.matrix-ms-item:hover { background: var(--accent-soft); }
.matrix-selection-controls { display: flex; gap: 7px; margin-bottom: 9px; }
.matrix-apply { width: 100%; margin-top: 12px; flex-shrink: 0; }
.matrix-btn svg.lucide { width: 13px; height: 13px; }
.matrix-multiselect-list > p { padding: 20px 5px; color: var(--muted); font-size: 11px; }

@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
body.ready .overview-header, body.ready .metrics, body.ready .network-workspace { animation: enter .4s backwards; }
body.ready .metrics { animation-delay: .05s; }
body.ready .network-workspace { animation-delay: .1s; }

@media (min-width: 1600px) {
    .network-workspace { grid-template-columns: 260px minmax(0, 1fr) 326px; }
    .sidebar { padding-right: 25px; }
    .routes-panel { padding: 0 22px; }
    .destination { font-size: 12px; }
    .geo-filter-btn { min-height: 35px; }
}

@media (max-width: 1199px) {
    .header-inner { padding: 12px 24px; gap: 20px; }
    .dashboard { padding-right: 24px; padding-left: 24px; }
    .network-workspace { grid-template-columns: 204px minmax(0, 1fr) 258px; }
    .sidebar { padding-right: 14px; }
    .routes-panel { padding: 0 12px; }
    .view-toggle { width: 216px; }
    .map-heading { padding: 12px; }
    .map-tools { gap: 8px; }
    .map-coordinate { left: 12px; }
    .map-legend { left: 12px; padding: 10px; }
    .metric { padding: 0 18px; }
    .metric-value { font-size: 28px; }
    .site-footer { padding: 18px 24px; }
}

@media (max-width: 1023px) {
    .network-workspace { grid-template-columns: minmax(0, 1fr) 280px; }
    .sidebar { position: fixed; z-index: 11000; top: 0; left: 0; bottom: 0; width: 290px; max-width: calc(100vw - 36px); padding: 5px 20px 24px; transform: translateX(-105%); transition: transform .2s; box-shadow: 8px 0 36px #00000020; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.active { display: block; position: fixed; z-index: 10999; inset: 0; background: #0000004d; backdrop-filter: blur(2px); }
    .sidebar-close, .mobile-menu-btn { display: inline-flex; }
    .sidebar .panel-heading-icon { display: none; }
    .map-panel { border-left: 0; }
    .data-status { font-size: 9px; }
    .metric-label { font-size: 10px; }
    .metric-caption { font-size: 9px; }
    .site-footer { flex-wrap: wrap; }
}

@media (max-width: 767px) {
    .header-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 14px 12px; padding: 14px 18px; }
    .brand { grid-column: 1; grid-row: 1; gap: 9px; }
    .brand-mark { width: 30px; height: 30px; border-radius: 5px; }
    .header .brand-mark { width: 34px; height: 34px; border-radius: 6px; }
    .brand-mark svg.lucide { width: 20px; height: 20px; }
    .brand-name { font-size: 19px; }
    .brand-platform { font-size: 8px; }
    .brand-copy { gap: 3px; }
    .header-right { display: contents; }
    .header-actions { grid-column: 2; grid-row: 1; justify-self: end; padding: 0; border: 0; }
    .header .icon-btn { width: 34px; height: 34px; }
    .header .icon-btn svg { width: 17px; height: 17px; }
    .header .data-status { grid-column: 2; grid-row: 2; justify-self: end; gap: 6px; font-size: 9px; }
    .view-toggle { grid-column: 1; grid-row: 2; justify-self: start; width: min(216px, 100%); height: 40px; }
    .view-btn { font-size: 11px; gap: 6px; }
    .view-btn svg.lucide { width: 15px; height: 15px; }
    .dashboard { padding: 22px 18px 0; }
    .overview-header { align-items: flex-start; margin-bottom: 20px; gap: 10px; }
    .eyebrow { font-size: 8px; }
    h1 { font-size: 24px; }
    .last-measurement { gap: 6px; padding-top: 2px; text-align: right; }
    .last-measurement svg { display: none; }
    .last-measurement-label { font-size: 8px; }
    .last-measurement-value { font-size: 8px; max-width: 95px; line-height: 1.7; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; margin-bottom: 22px; }
    .metric { padding: 15px 16px; }
    .metric:nth-child(odd) { padding-left: 0; }
    .metric:nth-child(even) { border-right: 0; }
    .metric:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
    .metric-value { font-size: 27px; margin: 5px 0 2px; }
    .metric-label { font-size: 9px; gap: 5px; }
    .metric-label svg.lucide { width: 12px; height: 12px; }
    .metric-caption { font-size: 8px; }
    .metric-unit { font-size: 12px; }
    .network-workspace { display: flex; flex-direction: column; height: auto; max-height: none; background: transparent; }
    .map-panel { height: 425px; flex-shrink: 0; border-right: 0; border-bottom: 1px solid var(--line); margin: 0 -18px; }
    .map-heading { padding: 11px 18px; min-height: 62px; background: var(--surface); }
    .map-heading h2 { font-size: 12px; }
    .map-heading #mapRegionLabel { font-size: 9px; }
    .map-tools { gap: 9px; }
    .map-tools .icon-btn { width: 30px; height: 30px; }
    .toggle-control { font-size: 9px; }
    .map-coordinate { left: 18px; top: 12px; font-size: 8px; }
    .map-legend { left: 18px; width: min(275px, calc(100% - 81px)); bottom: 27px; }
    .latency-scale > span { font-size: 8px; }
    .routes-panel { overflow: visible; padding: 0; margin-top: 8px; }
    .routes-panel .panel-heading { min-height: 53px; }
    .routes-panel h2 { font-size: 13px; }
    .route-context { margin-bottom: 13px; }
    .route-search input { font-size: 12px; }
    .ranking-toolbar { margin-top: 11px; }
    .ranking-toolbar > span { font-size: 9px; }
    .ranking-toolbar select { font-size: 10px; }
    .latency-list { max-height: 460px; flex: auto; }
    .latency-item { grid-template-columns: 24px minmax(0, 1fr) auto; padding: 15px 2px; }
    .destination { font-size: 12px; }
    .value { font-size: 14px; }
    .route-country { font-size: 10px; }
    .site-footer { padding: 20px 18px; line-height: 1.8; font-size: 8px; gap: 10px; }
    .site-footer > div { gap: 18px; flex-wrap: wrap; }
    .site-footer-sep { padding: 0 4px; }
    #matrix { height: 620px; margin: 0 -18px; }
    .matrix-toolbar { padding: 12px; gap: 8px; }
    .matrix-legend { flex-basis: 100%; margin-left: 0; gap: 9px; order: 2; }
    .matrix-btn, .matrix-select { font-size: 10px; padding: 6px 8px; }
    .matrix-toolbar-label { font-size: 9px; }
    .matrix-col-header { height: 130px; min-width: 43px; max-width: 43px; }
    .matrix-cell { min-width: 43px; max-width: 43px; font-size: 9px; }
    .matrix-col-header-text { font-size: 9px; padding: 8px 13px; }
    .matrix-row-header, .matrix-corner { min-width: 125px; font-size: 9px; padding: 7px 8px; }
}

@media (max-width: 359px) {
    .header-inner { padding-left: 12px; padding-right: 12px; }
    .header .data-status { font-size: 8px; }
    .brand-name { font-size: 18px; }
    .dashboard { padding-left: 12px; padding-right: 12px; }
    h1 { font-size: 21px; }
    .metric { padding-right: 9px; padding-left: 10px; }
    .metric-label { font-size: 8px; }
    .map-panel, #matrix { margin-left: -12px; margin-right: -12px; }
    .toggle-control > span:last-child { display: none; }
}

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