
:root {
    --bg-deep: #030305;
    --primary: #5578a8;
    --primary-rgb: 85, 120, 168;
    --primary-dim: rgba(var(--primary-rgb), 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.06);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --hover-fill: rgba(var(--primary-rgb), 0.07);
    --hover-fill-strong: rgba(var(--primary-rgb), 0.12);
    --hover-border: rgba(var(--primary-rgb), 0.28);
    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Mono', monospace;

    --surface: color-mix(in srgb, var(--text-main) 3.5%, var(--bg-deep));
    --surface-2: color-mix(in srgb, var(--text-main) 6%, var(--bg-deep));
    --line: color-mix(in srgb, var(--text-main) 8%, transparent);
    --line-strong: color-mix(in srgb, var(--text-main) 14%, transparent);
    --text-faint: color-mix(in srgb, var(--text-muted) 70%, var(--bg-deep));
    --grid: color-mix(in srgb, var(--text-main) 6%, transparent);
    --bar: color-mix(in srgb, var(--primary) 22%, transparent);
    --bar-hot: color-mix(in srgb, var(--primary) 34%, transparent);
    --map-land: color-mix(in srgb, var(--text-main) 11%, var(--bg-deep));
    --shadow: 0 1px 0 color-mix(in srgb, var(--text-main) 4%, transparent) inset, 0 12px 32px -18px rgba(0, 0, 0, 0.7);

    --r-panel: 14px;
    --r-ctrl: 8px;
    --topbar-h: 108px;
}

[data-theme="light"] {
    --bg-deep: #f8fafc;
    --text-main: #071023;
    --text-muted: #475569;
    --border: rgba(7, 16, 35, 0.06);
    --hover-fill: rgba(var(--primary-rgb), 0.08);
    --hover-fill-strong: rgba(var(--primary-rgb), 0.14);
    --surface: #fff;
    --surface-2: color-mix(in srgb, var(--text-main) 3%, #fff);
    --line: color-mix(in srgb, var(--text-main) 9%, transparent);
    --line-strong: color-mix(in srgb, var(--text-main) 16%, transparent);
    --text-faint: color-mix(in srgb, var(--text-muted) 75%, #fff);
    --bar: color-mix(in srgb, var(--primary) 16%, transparent);
    --bar-hot: color-mix(in srgb, var(--primary) 26%, transparent);
    --map-land: color-mix(in srgb, var(--text-main) 7%, #fff);
    --shadow: 0 1px 2px rgba(7, 16, 35, 0.04), 0 8px 24px -16px rgba(7, 16, 35, 0.18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
button, input, select, textarea { font-family: inherit; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 12px); }

body {
    font-family: var(--font-main);
    background: var(--bg-deep);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-variant-numeric: tabular-nums;
}

a { color: var(--primary); }
::selection { background: rgba(var(--primary-rgb), 0.3); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: 12px; top: -48px; z-index: 50;
    background: var(--primary); color: #fff; padding: 8px 14px; border-radius: var(--r-ctrl);
    text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }

.topbar {
    position: sticky; top: 0; z-index: 20;
    background: linear-gradient(color-mix(in srgb, var(--bg-deep) 92%, transparent), color-mix(in srgb, var(--bg-deep) 92%, transparent)), var(--bg-deep);
    border-bottom: 1px solid var(--line);
}
.topbar-row, .section-nav {
    max-width: 1320px; margin: 0 auto; padding: 0 24px;
}
.topbar-row {
    display: flex; align-items: center; gap: 10px; height: 60px;
}
.brand {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-main); text-decoration: none; font-weight: 600;
    padding: 6px 8px 6px 4px; margin-left: -4px; border-radius: var(--r-ctrl);
    transition: background-color 0.15s ease, color 0.15s ease;
}
.brand:hover { background: var(--hover-fill); }
.brand svg { color: var(--text-muted); }
.crumb-sep { color: var(--text-faint); }
.crumb { color: var(--text-muted); font-weight: 500; }

.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.status {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 12.5px; color: var(--text-muted); white-space: nowrap;
}
.status-dot {
    width: 8px; height: 8px; border-radius: 50%; flex: none;
    background: var(--text-faint);
}
.status-dot.is-live { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent); }
.status-dot.is-stale { background: var(--warning); }
.status-dot.is-error { background: var(--danger); }
.status-dot.is-connecting { background: var(--text-muted); animation: an-blink 1.2s ease-in-out infinite; }
@keyframes an-blink { 50% { opacity: 0.35; } }

.range {
    display: inline-flex; padding: 3px; gap: 2px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.range-btn {
    border: 0; background: transparent; color: var(--text-muted);
    font-size: 12.5px; font-weight: 500; padding: 5px 10px; border-radius: 7px;
    cursor: pointer; white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.range-btn:hover { color: var(--text-main); background: var(--hover-fill); }
.range-btn.is-active { background: var(--surface-2); color: var(--text-main); box-shadow: 0 0 0 1px var(--line-strong) inset; }

.icon-btn {
    display: inline-grid; place-items: center; width: 34px; height: 34px;
    border: 1px solid var(--line); background: var(--surface); color: var(--text-muted);
    border-radius: var(--r-ctrl); cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { color: var(--text-main); border-color: var(--hover-border); background: var(--hover-fill); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn:disabled { cursor: progress; }
.icon-btn:disabled svg { animation: an-spin 0.9s linear infinite; }
@keyframes an-spin { to { transform: rotate(360deg); } }

.section-nav {
    display: flex; gap: 2px; height: 46px; align-items: stretch;
    overflow-x: auto; scrollbar-width: none;
}
.section-nav::-webkit-scrollbar { display: none; }
.section-nav a {
    display: flex; align-items: center; padding: 0 10px; position: relative;
    color: var(--text-muted); text-decoration: none; font-size: 13px; font-weight: 500;
    white-space: nowrap; transition: color 0.15s ease;
}
.section-nav a:hover { color: var(--text-main); }
.section-nav a.is-current { color: var(--text-main); }
.section-nav a.is-current::after {
    content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
    background: var(--primary); border-radius: 2px 2px 0 0;
}

.wrap { max-width: 1320px; margin: 0 auto; padding: 28px 24px 40px; }

.page-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
    margin-bottom: 22px;
}
.page-head h1 {
    font-size: clamp(24px, 2.4vw, 30px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15;
}
.lede { margin-top: 6px; color: var(--text-muted); max-width: 68ch; text-wrap: pretty; }
.updated { color: var(--text-faint); font-size: 12.5px; white-space: nowrap; }

.notice {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 14px 16px; margin-bottom: 18px;
    border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent);
    background: color-mix(in srgb, var(--warning) 8%, var(--surface));
    border-radius: 12px;
}
.notice[hidden] { display: none; }
.notice-icon { color: var(--warning); flex: none; margin-top: 1px; }
.notice.is-error { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); }
.notice.is-error .notice-icon { color: var(--danger); }
.notice-title { font-size: 14px; font-weight: 600; }
.notice-text { color: var(--text-muted); margin-top: 2px; }
.notice-detail { color: var(--text-faint); font-size: 12px; margin-top: 4px; font-family: var(--font-mono); word-break: break-word; }

.band { display: grid; gap: 16px; margin-bottom: 16px; }
.band > * { min-width: 0; }
.band-hero { grid-template-columns: minmax(0, 1fr) 320px; }
.band-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.band-usage { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-panel);
    box-shadow: var(--shadow);
    padding: 18px 20px 20px;
    min-width: 0;
}
.panel-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    flex-wrap: wrap; min-height: 32px;
}
.panel-head h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; }
.panel-sub { color: var(--text-muted); font-size: 13px; margin-top: 4px; max-width: 72ch; }
.panel-meta { color: var(--text-muted); font-size: 12.5px; }
.panel-note { color: var(--text-faint); font-size: 12.5px; margin-top: 10px; }
.panel-note[hidden] { display: none; }

.seg {
    display: inline-flex; gap: 2px; padding: 3px; max-width: 100%; overflow-x: auto;
    background: var(--surface-2); border-radius: 9px; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
    border: 0; background: transparent; color: var(--text-muted);
    font-size: 12.5px; font-weight: 500; padding: 4px 10px; border-radius: 6px;
    cursor: pointer; white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.seg button:hover { color: var(--text-main); }
.seg button.is-active { background: var(--surface); color: var(--text-main); box-shadow: 0 0 0 1px var(--line-strong) inset; }
.seg-count { font-size: 11px; font-weight: 600; color: var(--text-faint); margin-left: 3px; font-variant-numeric: tabular-nums; }
.seg-count:empty { display: none; }
.seg-count--warn { color: var(--danger); }
.panel-sub .panel-meta { white-space: nowrap; }
.panel-sub .panel-meta:not(:empty)::before { content: '· '; }

.panel-hero { padding: 0; overflow: hidden; display: flex; flex-direction: column; }

.metrics {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    border-bottom: 1px solid var(--line);
}
.metric {
    display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
    text-align: left; padding: 16px 20px 15px; min-width: 0;
    border: 0; background: transparent; color: inherit; font: inherit;
    border-right: 1px solid var(--line); position: relative;
}
.metric:last-child { border-right: 0; }
button.metric { cursor: pointer; transition: background-color 0.15s ease; }
button.metric:hover { background: var(--hover-fill); }
button.metric.is-active::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary);
}
.metric-label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
button.metric.is-active .metric-label { color: var(--text-main); }
.metric-value { white-space: nowrap; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.metric.is-static .metric-value { color: color-mix(in srgb, var(--text-main) 85%, var(--text-muted)); }
.metric-delta { font-size: 12px; font-weight: 600; min-height: 18px; display: inline-flex; align-items: center; gap: 3px; color: var(--text-faint); }
.metric-delta.is-good { color: var(--success); }
.metric-delta.is-bad { color: var(--danger); }
.metric-delta .delta-ref { color: var(--text-faint); font-weight: 500; }

.chart { position: relative; height: 300px; padding: 18px 12px 4px 0; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis-text { fill: var(--text-faint); font-size: 11px; font-family: var(--font-main); }
.chart .area { fill: url(#anAreaGrad); }
.chart .line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cross { stroke: var(--line-strong); stroke-width: 1; shape-rendering: crispEdges; }
.chart .dot { fill: var(--primary); stroke: var(--surface); stroke-width: 2; }
.chart-tip {
    position: absolute; top: 10px; pointer-events: none; z-index: 2;
    background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 8px;
    padding: 7px 10px; font-size: 12px; white-space: nowrap;
    box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.5);
    transform: translateX(-50%); opacity: 0; transition: opacity 0.12s ease;
}
.chart-tip.is-on { opacity: 1; }
.chart-tip b { display: block; font-size: 14px; }
.chart-tip span { color: var(--text-muted); }
.chart-foot { padding: 0 20px 14px; color: var(--text-faint); font-size: 12px; min-height: 18px; }
.chart-empty { display: grid; place-items: center; height: 100%; color: var(--text-muted); font-size: 13px; }

.panel-live { display: flex; flex-direction: column; }
.live-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.live-state .status-dot { background: var(--success); }
.live-state.is-stale .status-dot { background: var(--text-faint); }
.feed { list-style: none; margin-top: 12px; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.feed li {
    display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 2px 10px; align-items: center;
    padding: 9px 0; border-top: 1px solid var(--line);
}
.feed li:first-child { border-top: 0; }
.feed .empty { grid-column: 1 / -1; display: block; color: var(--text-muted); padding: 24px 0; text-align: center; border: 0; }
.feed-flag { grid-row: span 2; display: grid; }
.feed-path { font-family: var(--font-mono); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-time { color: var(--text-faint); font-size: 12px; text-align: right; white-space: nowrap; }
.feed-meta { color: var(--text-muted); font-size: 12px; display: flex; gap: 8px; }
.feed-lat { font-size: 12px; font-weight: 600; text-align: right; }
.feed-lat.fast { color: var(--success); }
.feed-lat.mid { color: var(--warning); }
.feed-lat.slow { color: var(--danger); }
.feed li.is-new { animation: an-new 1.6s ease-out; }
@keyframes an-new { from { background: var(--hover-fill-strong); } to { background: transparent; } }

.list-head {
    display: flex; justify-content: space-between; gap: 12px;
    margin-top: 14px; padding: 0 10px 6px;
    color: var(--text-faint); font-size: 12px; font-weight: 500;
}
.list { display: flex; flex-direction: column; gap: 3px; }
.row {
    position: relative; display: flex; align-items: center; gap: 10px;
    min-height: 34px; padding: 0 10px; border-radius: 7px; isolation: isolate;
}
.row-bar {
    position: absolute; inset: 0 auto 0 0; z-index: -1;
    background: var(--bar); border-radius: 7px; min-width: 3px;
    transform-origin: left center;
}
.row:hover .row-bar { background: var(--bar-hot); }
.row-label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; }
.row-label > span { overflow: hidden; text-overflow: ellipsis; }
.row-label.is-path > span { font-family: var(--font-mono); font-size: 12.5px; }
.row-label a { color: inherit; text-decoration: none; }
.row-label a:hover { text-decoration: underline; text-underline-offset: 2px; }
.row-icon { flex: none; color: var(--text-muted); display: inline-grid; place-items: center; width: 16px; }
.cc {
    flex: none; display: inline-grid; place-items: center; width: 24px; height: 16px;
    font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.02em;
    color: var(--text-muted); border: 1px solid var(--line-strong); border-radius: 4px;
}
.row-value { font-weight: 600; white-space: nowrap; }
.row-share { color: var(--text-faint); font-size: 12px; width: 44px; text-align: right; white-space: nowrap; }
.list-more {
    margin-top: 10px; align-self: flex-start;
    border: 0; background: transparent; color: var(--text-muted); font-size: 12.5px; font-weight: 500;
    padding: 5px 10px; border-radius: 6px; cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.list-more:hover { color: var(--text-main); background: var(--hover-fill); }
.list-empty { color: var(--text-muted); padding: 22px 10px; text-align: center; font-size: 13px; }
.list-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
.list-cols .list-more { grid-column: 1 / -1; justify-self: start; }

.geo-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; margin-top: 12px; }
.geo-body > * { min-width: 0; }
.geo-side .list-head { margin-top: 0; }
.map-stage {
    position: relative; border-radius: 10px; overflow: hidden;
    background: var(--bg-deep); border: 1px solid var(--line); aspect-ratio: 1000 / 470;
}
.map-view { position: absolute; inset: 0; display: none; }
.map-view.is-active { display: block; }
.map-svg { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.map-view.is-zoomed .map-svg:active { cursor: grabbing; }
.map-shape { fill: var(--map-land); stroke: var(--bg-deep); stroke-width: 0.5; vector-effect: non-scaling-stroke; transition: opacity 0.15s ease; }
.map-stage {
    --lv0: color-mix(in srgb, var(--primary) 28%, var(--map-land));
    --lv1: color-mix(in srgb, var(--primary) 46%, var(--map-land));
    --lv2: color-mix(in srgb, var(--primary) 64%, var(--map-land));
    --lv3: color-mix(in srgb, var(--primary) 82%, var(--map-land));
    --lv4: var(--primary);
}
.map-shape.b0 { fill: var(--lv0); }
.map-shape.b1 { fill: var(--lv1); }
.map-shape.b2 { fill: var(--lv2); }
.map-shape.b3 { fill: var(--lv3); }
.map-shape.b4 { fill: var(--lv4); }
.map-legend .lv0 { background: var(--lv0); }
.map-legend .lv1 { background: var(--lv1); }
.map-legend .lv2 { background: var(--lv2); }
.map-legend .lv3 { background: var(--lv3); }
.map-legend .lv4 { background: var(--lv4); }
.map-svg.is-focused .map-shape:not(.is-hot) { opacity: 0.55; }
.map-shape.is-hot { stroke: var(--text-main); stroke-width: 1; }
.map-grat { fill: none; stroke: var(--grid); stroke-width: 0.6; vector-effect: non-scaling-stroke; }
.map-cities { display: none; }
.map-stage.show-cities .map-cities { display: inline; }
.map-city { fill: color-mix(in srgb, var(--text-main) 92%, transparent); stroke: var(--surface-2); stroke-width: 1.2; vector-effect: non-scaling-stroke; cursor: pointer; }
.map-city.is-cluster { fill: color-mix(in srgb, var(--text-main) 85%, var(--primary)); }
.map-cluster-ring { fill: none; stroke: color-mix(in srgb, var(--text-main) 40%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-city.is-hot { fill: var(--primary); }
.map-controls { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; }
.map-ctrl {
    width: 28px; height: 28px; display: grid; place-items: center; cursor: pointer;
    border: 1px solid var(--line); background: var(--surface); color: var(--text-muted); border-radius: 7px;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.map-ctrl:hover { color: var(--text-main); border-color: var(--hover-border); }
.map-ctrl svg { width: 14px; height: 14px; }
.map-tip {
    position: absolute; pointer-events: none; z-index: 3;
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px;
    padding: 6px 10px; font-size: 12px; white-space: nowrap;
    transform: translate(-50%, calc(-100% - 12px)); opacity: 0; transition: opacity 0.12s ease;
}
.map-tip.show { opacity: 1; }
.map-tip strong { display: block; font-weight: 600; }
.map-tip span { color: var(--text-muted); }
.map-tip .mt-more { color: var(--text-muted); font-weight: 500; }
.map-legend {
    position: absolute; left: 12px; bottom: 10px; display: flex; align-items: center; gap: 3px;
    font-size: 11px; color: var(--text-muted);
}
.map-legend i { width: 18px; height: 8px; border-radius: 2px; display: block; }
.map-legend span { margin: 0 4px; }
.map-empty { display: grid; place-items: center; height: 100%; color: var(--text-muted); }

.vitals { margin-top: 16px; }
.vitals-bar { display: flex; height: 10px; gap: 2px; border-radius: 5px; overflow: hidden; }
.vitals-bar i { display: block; height: 100%; min-width: 3px; }
.vitals-rows { margin-top: 14px; display: flex; flex-direction: column; }
.vital {
    display: grid; grid-template-columns: 16px minmax(0, 1fr) auto auto; gap: 10px; align-items: center;
    padding: 10px 0; border-top: 1px solid var(--line);
}
.vital:first-child { border-top: 0; }
.vital-icon { display: grid; place-items: center; }
.vital-label { font-weight: 500; }
.vital-label small { display: block; color: var(--text-faint); font-size: 12px; font-weight: 400; }
.vital-avg { color: var(--text-muted); font-size: 12.5px; white-space: nowrap; }
.vital-share { font-weight: 600; min-width: 48px; text-align: right; }
.v-good { color: var(--success); }
.v-mid { color: var(--warning); }
.v-bad { color: var(--danger); }
.bg-good { background: var(--success); }
.bg-mid { background: var(--warning); }
.bg-bad { background: var(--danger); }

.heatmap { margin-top: 16px; overflow-x: auto; }
.heat-grid {
    display: grid; grid-template-columns: 28px repeat(24, minmax(0, 1fr));
    gap: 3px;
}
.heat-day { color: var(--text-muted); font-size: 11.5px; align-self: center; }
.heat-hour { color: var(--text-faint); font-size: 10.5px; text-align: left; white-space: nowrap; overflow: visible; }
.heat-cell {
    aspect-ratio: 1 / 1; border-radius: 3px;
    background: var(--surface-2);
}
.heat-cell.h1 { background: color-mix(in srgb, var(--primary) 22%, var(--surface-2)); }
.heat-cell.h2 { background: color-mix(in srgb, var(--primary) 42%, var(--surface-2)); }
.heat-cell.h3 { background: color-mix(in srgb, var(--primary) 64%, var(--surface-2)); }
.heat-cell.h4 { background: color-mix(in srgb, var(--primary) 84%, var(--surface-2)); }
.heat-cell.h5 { background: var(--primary); }
.heat-cell:hover { outline: 1.5px solid var(--text-main); outline-offset: 1px; }
.heat-legend { display: flex; align-items: center; gap: 3px; justify-content: flex-end; margin-top: 12px; font-size: 11px; color: var(--text-muted); }
.heat-legend .heat-cell { width: 12px; min-height: 0; height: 12px; aspect-ratio: auto; }
.heat-legend .heat-cell:hover { outline: 0; }
.heat-legend span { margin: 0 4px; }

.behave { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; margin-top: 14px; }
.behave-block h3 { font-size: 12.5px; font-weight: 500; color: var(--text-muted); margin-bottom: 10px; }
.behave-block.engage { grid-column: 1 / -1; padding-top: 16px; border-top: 1px solid var(--line); }
.hist { display: flex; flex-direction: column; gap: 5px; }
.hist-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) 38px; gap: 8px; align-items: center; font-size: 12.5px; }
.hist-label { color: var(--text-muted); white-space: nowrap; }
.hist-track { display: block; height: 14px; }
.hist-fill { display: block; height: 100%; background: var(--primary); border-radius: 0 4px 4px 0; min-width: 2px; opacity: 0.85; }
.hist-row:hover .hist-fill { opacity: 1; }
.hist-val { text-align: right; font-weight: 600; }
.engage-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.engage-sub { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.engage-how { color: var(--text-faint); font-size: 12.5px; margin-top: 8px; max-width: 64ch; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.stat-value { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
.stat-sub { font-size: 12px; color: var(--text-faint); }
.cf-days { margin-top: 16px; display: flex; flex-direction: column; }
.cf-day {
    display: grid; grid-template-columns: 110px minmax(0, 1fr) 90px 80px 90px; gap: 14px; align-items: center;
    padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px;
}
.cf-day.is-head { color: var(--text-faint); font-size: 12px; font-weight: 500; border-top: 0; padding-top: 0; }
.cf-day > span:not(:first-child) { text-align: right; white-space: nowrap; }
.cf-day > .cf-split { text-align: left; }
.cf-track { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; }
.cf-track i { display: block; height: 100%; }
.cf-track .cached { background: var(--primary); }
.cf-track .origin { background: var(--line-strong); }

.float-tip {
    position: fixed; z-index: 30; pointer-events: none;
    background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 7px;
    padding: 5px 9px; font-size: 12px; white-space: nowrap; color: var(--text-main);
    transform: translate(-50%, -100%); opacity: 0; transition: opacity 0.12s ease;
}
.float-tip.is-on { opacity: 1; }

body.is-loading .band { opacity: 0.55; transition: opacity 0.2s ease; }
.band { transition: opacity 0.2s ease; }

.source-note { color: var(--text-faint); font-size: 12.5px; margin-top: 8px; }

.skeleton {
    border-radius: 8px;
    background: linear-gradient(90deg, var(--surface-2) 0%, color-mix(in srgb, var(--text-main) 9%, var(--bg-deep)) 50%, var(--surface-2) 100%);
    background-size: 200% 100%; animation: an-shimmer 1.4s ease-in-out infinite;
}
.skeleton-chart { height: 100%; min-height: 160px; }
.skeleton-list { height: 220px; margin-top: 4px; }
@keyframes an-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

@media (max-width: 1100px) {
    .geo-body { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 1200px) {
    .band-hero { grid-template-columns: minmax(0, 1fr); }
    .panel-live .feed { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
    .panel-live .feed li:nth-child(2) { border-top: 0; }
}
@media (max-width: 960px) {
    .geo-body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
    .band-2, .band-usage { grid-template-columns: minmax(0, 1fr); }
    .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .metric { border-bottom: 1px solid var(--line); }
    .metric:nth-child(3) { border-right: 0; }
    .metrics .metric:nth-child(n+4) { border-bottom: 0; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .list-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
    :root { --topbar-h: 150px; }
    .topbar-row { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 8px; row-gap: 8px; }
    .topbar-tools { margin-left: 0; width: 100%; }
    .range { flex: 1; }
    .range-btn { flex: 1; padding: 6px 4px; }
    .status { order: 3; }
    .topbar-row .status { display: none; }
    .page-head { flex-direction: column; align-items: flex-start; gap: 6px; }
}
@media (max-width: 640px) {
    .topbar-row, .section-nav { padding-left: 16px; padding-right: 16px; }
    .wrap { padding: 20px 16px 32px; }
    .panel { padding: 16px; }
    .panel-hero { padding: 0; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric { padding: 12px 14px; }
    .metric:nth-child(3) { border-right: 1px solid var(--line); }
    .metric:nth-child(2n) { border-right: 0; }
    .metrics .metric:nth-child(n+4) { border-bottom: 1px solid var(--line); }
    .metrics .metric:last-child { border-bottom: 0; grid-column: 1 / -1; }
    .metric-value { font-size: 22px; }
    .chart { height: 230px; }
    .behave { grid-template-columns: minmax(0, 1fr); }
    .stats { gap: 8px; }
    .stat { padding: 12px; }
    .stat-value { font-size: 19px; }
    .cf-day { grid-template-columns: 76px minmax(0, 1fr) 64px 60px; gap: 10px; }
    .cf-day > :nth-child(5) { display: none; }
    .panel-live .feed { grid-template-columns: minmax(0, 1fr); }
    .panel-live .feed li:nth-child(2) { border-top: 1px solid var(--line); }
    .row-share { display: none; }
    .seg button { padding: 4px 8px; }
    .heat-grid { gap: 2px; grid-template-columns: 22px repeat(24, minmax(0, 1fr)); }
    .heat-cell { border-radius: 2px; }
}

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