/* NodeScope design tokens. No CDN, webfonts or generated image dependencies. */
:root {
  color-scheme: dark;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --bg: #0c121b;
  --surface: #121d2a;
  --surface2: #182637;
  --sidebar: #0f1823;
  --text: #e4edf6;
  --muted: #a0b0c3;
  --soft: #92a5bb;
  --line: #293a4e;
  --accent: #79dfc6;
  --accent-bg: #163d39;
  --danger: #ff9fa9;
  --danger-bg: #3b2530;
  --warning: #f1c580;
  --warning-bg: #352e22;
  --blue: #a0bff8;
  --radius: 12px;
  --shadow: 0 8px 24px #0000000d;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fa;
  --surface: #ffffff;
  --surface2: #edf2f7;
  --sidebar: #fbfcfe;
  --text: #1a2c40;
  --muted: #52667d;
  --soft: #586e85;
  --line: #d9e2ec;
  --accent: #076b5b;
  --accent-bg: #e1f3ed;
  --danger: #af2543;
  --danger-bg: #fff0f3;
  --warning: #86500d;
  --warning-bg: #fff4df;
  --blue: #315dba;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-bottom: 90px; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.65; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 29px; font-weight: 650; letter-spacing: -.7px; line-height: 1.35; }
h2 { font-size: 18px; font-weight: 600; line-height: 1.5; }
h3 { font-size: 14px; font-weight: 600; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
button, select, input:not([type="range"]) { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; min-height: 40px; padding: 8px 12px; }
button { cursor: pointer; line-height: 1.4; font-weight: 500; }
button:hover { background: var(--surface2); border-color: var(--muted); }
button:disabled, select:disabled { opacity: .55; cursor: default; }
select { max-width: 100%; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 4px;
}
input[aria-invalid="true"] { border-color: var(--danger); }
input[type="range"] { min-height: 32px; width: 100%; accent-color: var(--accent); }
summary { cursor: pointer; min-height: 44px; }
summary::marker { color: var(--muted); }
pre, code, .mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.muted, .fineprint { color: var(--muted); }
.fineprint { font-size: 12px; line-height: 1.65; }
.eyebrow { font-size: 11px; font-weight: 600; color: var(--soft); letter-spacing: 1.6px; }
.section-label { color: var(--muted); font-size: 12px; font-weight: 500; }
.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.primary:hover { background: var(--accent); opacity: .9; }
.secondary { background: var(--surface); }
.text-button { border-color: transparent; background: transparent; color: var(--muted); padding: 7px 10px; }
.text-button:hover { color: var(--text); }
.icon-button { width: 42px; flex-shrink: 0; font-size: 21px; line-height: 1; padding: 8px; }
.boot { padding: 20vh 24px; text-align: center; color: var(--muted); }
/* Workspace shell */
.application { display: grid; grid-template-columns: 214px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 29px 18px 18px; background: var(--sidebar); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 20px; font-weight: 650; line-height: 1.25; }
.brand img { flex: 0 0 auto; }
.brand small { display: block; color: var(--soft); font-size: 8px; font-weight: 500; letter-spacing: 1.8px; margin-top: 6px; }
.sidebar-section { color: var(--soft); font-size: 11px; margin: 41px 12px 12px; }
.navigation { display: flex; flex-direction: column; gap: 7px; }
.nav-button { display: flex; align-items: center; gap: 11px; text-align: left; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); min-height: 46px; padding: 11px 14px; }
.nav-button.active { background: var(--accent-bg); color: var(--accent); }
.nav-symbol { width: 21px; font-size: 23px; font-weight: 400; text-align: center; line-height: 1; }
.nav-count { margin-left: auto; padding: 1px 6px; font-size: 11px; border-radius: 5px; background: var(--warning-bg); color: var(--warning); }
.sidebar-note { margin: auto 12px 27px; padding-top: 36px; font-size: 12px; color: var(--muted); }
.sidebar-note > span:last-child { display: block; margin-top: 8px; font-size: 11px; }
.tiny-dot { display: inline-block; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; margin-right: 7px; }
.sidebar-bottom { border-top: 1px solid var(--line); padding-top: 15px; }
.sidebar-bottom > button { width: 100%; display: flex; justify-content: space-between; }
.version-row { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--soft); padding-left: 10px; }
.version-row button { font-size: 12px; }
.workspace { min-width: 0; }
.topbar { min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 36px; border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; gap: 13px; align-items: center; font-size: 12px; color: var(--muted); }
.breadcrumb span:last-child { color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.mobile-action, .mobile-brand { display: none; }
main { padding: 28px 36px 22px; max-width: 1420px; margin: 0 auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 23px; }
.host-title { min-width: 0; }
.page-heading h1 { overflow-wrap: anywhere; margin-top: 6px; }
#inventory { font-size: 12px; margin-top: 7px; overflow-wrap: anywhere; }
.host-identity { display: inline-block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.host-identity summary { padding: 5px 0; min-height: 28px; }
.host-identity > div { display: grid; gap: 4px; overflow-wrap: anywhere; padding: 4px 0 8px; max-width: 560px; }
.heading-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
#host-select { max-width: 270px; min-width: 125px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 24px; }
/* State first, with traceable details one level below */
.status-panel { display: flex; align-items: flex-start; gap: 17px; padding: 21px 23px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--surface); margin-bottom: 14px; }
.status-panel.warning { border-left-color: var(--warning); }
.status-panel.danger { border-left-color: var(--danger); }
.status-panel.neutral { border-left-color: var(--soft); }
.status-icon { width: 35px; height: 35px; flex: 0 0 auto; display: grid; place-items: center; color: var(--accent); border: 1px solid currentColor; background: var(--accent-bg); border-radius: 50%; font-size: 19px; margin-top: 4px; }
.warning .status-icon { color: var(--warning); background: var(--warning-bg); }
.danger .status-icon { color: var(--danger); background: var(--danger-bg); }
.neutral .status-icon { color: var(--muted); background: var(--surface2); }
.status-copy { flex: 1; min-width: 0; }
.status-copy h2 { font-size: 19px; margin: 3px 0 5px; }
.status-copy > p { font-size: 13px; color: var(--muted); max-width: 850px; overflow-wrap: anywhere; }
.status-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; padding-top: 5px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.active-incident { margin-top: 10px; border-top: 1px solid var(--line); }
.active-incident summary { padding: 10px 0 5px; min-height: 40px; color: var(--warning); font-size: 13px; }
.active-incident p { color: var(--muted); font-size: 12px; margin: 5px 0; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 25px; padding: 3px 9px; border-radius: 6px; font-size: 11px; line-height: 1.5; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.good { color: var(--accent); background: var(--accent-bg); }
.badge.warning { color: var(--warning); background: var(--warning-bg); }
.badge.danger { color: var(--danger); background: var(--danger-bg); }
.badge.neutral { color: var(--muted); background: var(--surface2); }
.notice { border: 1px solid var(--line); border-radius: 9px; background: var(--surface2); color: var(--muted); padding: 12px 17px; font-size: 13px; margin-bottom: 15px; overflow-wrap: anywhere; }
.notice.danger { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.notice.history-notice { background: var(--warning-bg); border-color: var(--warning); color: var(--warning); font-size: 12px; }
.notice details summary { padding: 4px 0; min-height: 32px; color: var(--text); }
.notice details p { padding: 9px 0 4px; }
.boundary-note { padding: 0 17px; background: transparent; }
.boundary-note summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--warning); font-size: 12px; }
.boundary-note summary::after { content: "⌄"; color: var(--muted); }
.boundary-note summary .muted { margin-left: auto; font-size: 11px; }
.boundary-note p { border-top: 1px solid var(--line); padding: 12px 0; font-size: 12px; }
/* Time scope is explicit. Loading/failure has a persistent, local owner. */
.time-toolbar, .section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 23px 0 11px; }
.time-controls { display: flex; align-items: center; gap: 10px; font-size: 12px; min-width: 0; }
.time-controls > label { color: var(--muted); }
.segmented { display: flex; gap: 3px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
.segmented button { border: 0; background: transparent; color: var(--muted); border-radius: 6px; min-height: 34px; padding: 6px 17px; font-size: 13px; }
.segmented .selected { color: var(--accent); background: var(--accent-bg); }
.time-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.time-meta .fineprint { font-size: 11px; }
.history-controls { display: flex; align-items: flex-end; gap: 13px; margin-bottom: 14px; padding: 16px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); }
.history-controls label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; flex: 1; min-width: 0; }
.history-controls input { width: 100%; min-width: 0; font-size: 13px; }
.history-controls button { flex-shrink: 0; }
.query-feedback { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 17px; margin: 12px 0; color: var(--muted); background: var(--surface2); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; overflow-wrap: anywhere; }
.query-error { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }
.query-feedback button { flex-shrink: 0; font-size: 12px; }
.chart-panel > .query-feedback { margin-left: 20px; margin-right: 20px; }
.resource-strip { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; margin-bottom: 19px; }
.resource-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 0; position: relative; padding: 19px 21px; border: 0; border-radius: 0; border-right: 1px solid var(--line); background: transparent; min-width: 0; text-align: left; }
.resource-cell:last-child { border-right: 0; }
.resource-cell:hover { background: var(--surface2); }
.resource-cell.selected { background: var(--accent-bg); }
.resource-cell.selected::after { content: ""; position: absolute; bottom: 0; left: 20px; right: 20px; height: 2px; background: var(--accent); }
.resource-cell:focus-visible { outline-offset: -4px; z-index: 1; }
.resource-name { display: flex; width: 100%; align-items: center; justify-content: space-between; color: var(--text); font-size: 13px; }
.resource-arrow { color: var(--soft); font-size: 14px; }
.resource-caption { color: var(--muted); font-size: 11px; margin-top: 10px; }
.resource-value { display: block; font-size: 27px; letter-spacing: -.6px; font-weight: 600; line-height: 1.4; margin: 2px 0 5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.resource-note { color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.6; overflow-wrap: anywhere; }
[data-group="network"] .resource-value { font-size: 21px; line-height: 1.8; }
.resource-strip.cached .resource-caption::after { content: " · 上次"; color: var(--warning); }
/* Chart: SVG is data, not decoration; missing/partial data never connects. */
.chart-heading { align-items: flex-start; padding-bottom: 10px; }
.chart-heading h2 { margin-top: 4px; }
.chart-controls { display: flex; align-items: center; gap: 10px; max-width: 62%; }
.chart-controls select { min-width: 0; max-width: 310px; font-size: 12px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 18px; min-height: 30px; padding: 2px 24px 8px; color: var(--muted); font-size: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.legend-item:nth-child(2) .legend-dot { background: var(--blue); }
.chart-container { position: relative; height: 290px; padding: 0 14px; }
.chart-container svg { display: block; height: 290px; width: 100%; touch-action: pan-y; }
.grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; }
.axis-text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.metric-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.metric-line.second { stroke: var(--blue); }
.metric-band { fill: var(--accent); opacity: .1; }
.metric-band.second { fill: var(--blue); }
.metric-dot { fill: var(--accent); }
.metric-dot.second { fill: var(--blue); }
.missing-band { fill: var(--soft); opacity: .022; }
.cursor-line { stroke: var(--text); opacity: .65; stroke-width: 1; stroke-dasharray: 3 3; }
.event-marker { fill: var(--warning); }
.chart-empty { position: absolute; inset: 30px 18px 35px; display: flex; align-items: center; justify-content: center; text-align: center; flex-direction: column; gap: 10px; background: var(--surface); color: var(--muted); padding: 20px; pointer-events: none; }
.chart-empty strong { font-size: 14px; color: var(--text); font-weight: 500; }
.chart-empty small { font-size: 12px; max-width: 330px; }
.chart-footer { border-top: 1px solid var(--line); padding: 14px 23px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-variant-numeric: tabular-nums; min-height: 72px; }
.chart-footer .fineprint { font-size: 11px; }
.cursor-control { display: flex; align-items: center; gap: 14px; padding: 0 23px 12px; }
.chart-key { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0 23px 14px; font-size: 11px; }
.chart-table { border-top: 1px solid var(--line); }
.chart-table summary { padding: 12px 23px; color: var(--muted); font-size: 12px; }
/* Evidence and events use disclosure, not more dashboard cards. */
.evidence-panel summary { padding: 16px 23px; font-size: 14px; }
.evidence-panel summary > span { color: var(--muted); font-size: 12px; margin-left: 15px; }
.evidence-copy { padding: 16px 23px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); line-height: 1.9; overflow-wrap: anywhere; }
.evidence-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 28px; padding: 0 23px 19px; }
.evidence-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.evidence-row span { min-width: 0; overflow-wrap: anywhere; }
.evidence-row span:first-child { color: var(--muted); }
.evidence-row span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.evidence-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.section-toolbar h2 { font-size: 23px; }
.section-toolbar p { margin-top: 6px; font-size: 13px; }
.scope-notice { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 10px 15px; }
.scope-notice button { flex-shrink: 0; color: var(--accent); }
.event-row { display: grid; grid-template-columns: 155px minmax(0,1fr) auto; gap: 17px; padding: 20px 23px; border-top: 1px solid var(--line); align-items: start; }
.event-row:first-child { border-top: 0; }
.event-time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; padding-top: 3px; }
.event-row h3 { font-size: 14px; }
.event-row p { color: var(--muted); font-size: 12px; margin-top: 6px; overflow-wrap: anywhere; }
.empty-line { padding: 30px 23px; text-align: center; color: var(--muted); font-size: 13px; }
/* Ledger: exact totals, coverage and accounting policy stay separate. */
.traffic-hero { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr); align-items: center; gap: 36px; padding: 28px; }
.traffic-hero > div { min-width: 0; }
.traffic-hero .section-label { margin-top: 20px; }
.traffic-number { font-size: 43px; line-height: 1.4; font-weight: 600; letter-spacing: -1.2px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; margin: 4px 0 8px; }
.traffic-breakdown { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.traffic-breakdown strong { display: block; font-weight: 550; font-size: 24px; margin: 7px 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.traffic-breakdown small { display: block; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.traffic-detail { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; border-top: 1px solid var(--line); padding: 15px 27px; color: var(--muted); font-size: 12px; }
.traffic-method { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.method-panel { padding: 23px; }
.method-panel h3 { margin-bottom: 12px; }
.method-panel .evidence-row:last-child { border-bottom: 0; }
.quality-stat { color: var(--warning); font-size: 32px; font-weight: 550; letter-spacing: -.5px; margin: 7px 0; }
.quality-note { font-size: 12px; color: var(--muted); line-height: 1.9; }
.quota-section { padding: 17px 27px; border-top: 1px solid var(--line); }
.quota-label { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 12px; margin-bottom: 11px; }
.quota-label span:last-child { color: var(--muted); }
progress { display: block; width: 100%; height: 7px; border: 0; border-radius: 20px; background: var(--surface2); accent-color: var(--accent); }
progress::-webkit-progress-bar { background: var(--surface2); border-radius: 20px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 20px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 20px; }
.table-scroll { overflow-x: auto; border-radius: inherit; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
caption { padding: 10px 23px; text-align: left; color: var(--muted); font-size: 12px; }
th { padding: 12px 23px; color: var(--muted); background: var(--surface2); font-weight: 500; white-space: nowrap; }
td { padding: 16px 23px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
th[scope="row"] { border-top: 1px solid var(--line); background: transparent; }
td button { border: 0; background: transparent; padding: 8px 0; color: var(--text); font-weight: 550; }
.row-sub { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.empty-state { padding: 34px; }
.empty-state p { margin: 15px 0; color: var(--muted); max-width: 750px; }
.empty-icon { color: var(--accent); font-size: 30px; margin-bottom: 10px; }
.empty-state pre { background: var(--bg); padding: 20px; font-size: 12px; border: 1px solid var(--line); border-radius: 8px; overflow: auto; margin: 20px 0; line-height: 1.9; }
.page-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--soft); font-size: 11px; margin-top: 23px; }
.footer-dot { margin: 0 7px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 40; max-width: min(640px,90vw); padding: 15px 20px; border: 1px solid var(--warning); border-radius: 9px; background: var(--surface); color: var(--warning); box-shadow: 0 8px 36px #0005; font-size: 13px; overflow-wrap: anywhere; }
.error-text { font-size: 13px; color: var(--danger); min-height: 20px; margin-top: 12px; margin-bottom: 12px; }
/* Login */
.login-screen { display: grid; grid-template-columns: 1.15fr 1fr; max-width: 1200px; min-height: 100vh; gap: 80px; align-items: center; padding: 65px 45px; margin: auto; }
.login-story .brand { margin-bottom: 75px; }
.login-story > .eyebrow { color: var(--accent); margin-bottom: 17px; }
.login-story h1 { font-size: 43px; line-height: 1.45; letter-spacing: -1.5px; }
.login-story .lead { color: var(--muted); margin-top: 23px; line-height: 2; }
.login-principles { display: flex; gap: 23px; margin-top: 34px; font-size: 12px; color: var(--muted); }
.login-principles span::before { content: "·"; color: var(--accent); margin-right: 7px; }
.login-card { padding: 36px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.login-card h2 { font-size: 27px; margin: 10px 0; }
.login-card label { display: block; margin: 27px 0 10px; font-size: 13px; }
.login-card input { width: 100%; min-height: 48px; background: var(--bg); font-size: 14px; }
.login-card .primary { width: 100%; min-height: 48px; margin-top: 18px; display: flex; justify-content: space-between; align-items: center; }
.login-card > .fineprint { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; }
.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: fixed; left: 12px; top: -70px; z-index: 60; padding: 12px 17px; background: var(--accent); color: var(--bg); border-radius: 6px; }
.skip-link:focus { top: 10px; }
/* Compact desktop/tablet. Data keeps its labels; only the chrome collapses. */
@media (max-width:1150px) {
  .application { grid-template-columns: 186px minmax(0,1fr); }
  .sidebar { padding: 25px 13px 16px; }
  main { padding: 25px; }
  .topbar { padding-left: 25px; padding-right: 25px; }
  .page-heading { align-items: flex-start; }
  .heading-actions { flex-wrap: wrap; max-width: 300px; justify-content: flex-end; }
  .status-meta { font-size: 10px; }
  .resource-cell { padding: 17px 15px; }
  .resource-value { font-size: 23px; }
  [data-group="network"] .resource-value { font-size: 18px; }
  .traffic-hero { gap: 24px; }
  .traffic-number { font-size: 36px; }
  .traffic-breakdown strong { font-size: 20px; }
}
/* Phone/tablet navigation remains reachable without consuming the first screen. */
@media (max-width:850px) {
  .application { display: block; }
  .sidebar { position: static; height: auto; padding: 0; border: 0; }
  .sidebar > .brand, .sidebar-section, .sidebar-note, .sidebar-bottom { display: none; }
  .navigation { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; flex-direction: row; gap: 6px; padding: 6px 14px calc(6px + env(safe-area-inset-bottom)); background: var(--sidebar); border-top: 1px solid var(--line); }
  .nav-button { flex: 1; min-width: 0; min-height: 48px; justify-content: center; font-size: 13px; padding: 10px 8px; gap: 8px; }
  .nav-symbol { font-size: 22px; }
  .nav-count { margin-left: 0; }
  .mobile-action, .mobile-brand { display: inline-flex; }
  .mobile-brand { font-size: 16px; font-weight: 650; letter-spacing: -.4px; }
  .breadcrumb { display: none; }
  .topbar { min-height: 59px; padding: 7px 20px; }
  .topbar-actions { gap: 5px; }
  .topbar-actions button { padding: 8px; }
  main { padding: 22px 24px calc(87px + env(safe-area-inset-bottom)); }
  .resource-value { font-size: 25px; }
  .status-panel { flex-wrap: wrap; }
  .status-meta { width: 100%; display: flex; flex-direction: row; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 0; font-size: 11px; }
  .status-copy { width: calc(100% - 53px); }
  .login-screen { gap: 32px; padding: 36px 28px; }
  .login-story h1 { font-size: 34px; }
  .login-card { padding: 26px; }
  .toast { bottom: calc(82px + env(safe-area-inset-bottom)); }
}
@media (max-width:620px) {
  button, select, input:not([type="range"]) { min-height: 44px; }
  .topbar { padding: 6px 13px; gap: 7px; min-height: 57px; }
  .topbar-actions { gap: 1px; }
  .topbar-actions button { font-size: 12px; padding: 7px; }
  .topbar .badge { font-size: 10px; padding: 4px 7px; }
  .mobile-brand { font-size: 15px; }
  main { padding: 19px 15px calc(87px + env(safe-area-inset-bottom)); }
  .page-heading { flex-direction: column; gap: 12px; margin-bottom: 16px; }
  .page-heading h1 { font-size: 25px; margin-top: 5px; }
  .page-heading .eyebrow { display: none; }
  .host-identity { font-size: 11px; }
  .heading-actions { width: 100%; max-width: none; flex-wrap: nowrap; }
  #host-select { flex: 1; min-width: 0; max-width: none; font-size: 13px; }
  .heading-actions .secondary { font-size: 12px; }
  .status-panel { padding: 13px 15px; gap: 9px; }
  .status-icon { width: 30px; height: 30px; font-size: 17px; }
  .status-copy { width: calc(100% - 43px); }
  .status-copy h2 { font-size: 17px; }
  .status-copy > p { font-size: 12px; line-height: 1.85; }
  .section-label { font-size: 11px; }
  .status-meta { font-size: 10px; padding-top: 8px; }
  .notice { font-size: 12px; padding: 11px 13px; }
  .boundary-note { padding: 0 13px; }
  .boundary-note summary { flex-wrap: wrap; gap: 3px 8px; font-size: 12px; padding: 8px 0; }
  .boundary-note summary .muted { font-size: 10px; }
  .boundary-note p { font-size: 12px; }
  .time-toolbar { margin-top: 18px; gap: 8px; }
  .segmented { padding: 2px; }
  .segmented button { min-height: 39px; padding: 6px 14px; font-size: 12px; }
  .time-controls { gap: 7px; flex-wrap: wrap; }
  .time-controls > label[for="range"] { display: none; }
  .time-controls select { font-size: 12px; padding: 8px; }
  #return-live { font-size: 12px; min-height: 30px; padding: 4px 7px; }
  .time-meta .fineprint { font-size: 10px; }
  .history-controls { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .history-controls label { min-width: 125px; font-size: 12px; }
  .history-controls input { font-size: 12px; padding: 8px 5px; }
  .history-controls button { width: 100%; font-size: 12px; }
  .resource-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .resource-cell { display: flex; flex-direction: column; padding: 13px 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 104px; }
  .resource-cell:nth-child(2n) { border-right: 0; }
  .resource-cell:nth-child(n+3) { border-bottom: 0; }
  .resource-cell.selected::after { left: 14px; right: 14px; top: auto; bottom: 0; width: auto; height: 2px; }
  .resource-name { font-size: 12px; }
  .resource-caption, .resource-arrow { display: none; }
  .resource-value, [data-group="network"] .resource-value { font-size: 23px; line-height: 1.4; margin: 6px 0 3px; letter-spacing: -.4px; }
  [data-group="network"] .resource-value { font-size: 19px; line-height: 1.7; }
  .resource-note { font-size: 11px; }
  .resource-strip.cached .resource-name::after { content: "上次"; font-size: 10px; color: var(--warning); }
  .panel-heading { padding: 17px; }
  .chart-heading { flex-direction: column; gap: 10px; padding-bottom: 9px; }
  .chart-heading h2 { font-size: 18px; }
  .chart-controls { width: 100%; max-width: none; gap: 8px; }
  .chart-controls select { flex: 1; max-width: none; font-size: 12px; }
  .chart-controls .badge { font-size: 10px; }
  .chart-legend { padding: 2px 17px 6px; gap: 13px; font-size: 11px; }
  .chart-container, .chart-container svg { height: 250px; }
  .chart-container { padding: 0 8px; }
  .chart-footer { padding: 12px 17px; font-size: 12px; }
  .chart-footer .fineprint { font-size: 11px; }
  .chart-key { padding: 0 17px 12px; gap: 4px 11px; font-size: 10px; }
  .chart-table summary { padding: 13px 17px; }
  .cursor-control { padding: 0 17px 12px; gap: 10px; }
  .chart-panel > .query-feedback { margin-left: 13px; margin-right: 13px; }
  .query-feedback { font-size: 12px; flex-direction: column; align-items: stretch; }
  .query-feedback button { width: 100%; }
  .evidence-panel summary { padding: 15px 17px; font-size: 13px; }
  .evidence-panel summary > span { display: block; margin: 4px 0 0 13px; font-size: 11px; }
  .evidence-copy { padding: 14px 17px; font-size: 12px; }
  .evidence-grid { grid-template-columns: 1fr; padding: 0 17px 15px; }
  .evidence-row { font-size: 12px; padding: 12px 0; }
  .evidence-row small { font-size: 10px; }
  .related-events .panel-heading h2 { font-size: 17px; }
  .related-events .panel-heading .fineprint { font-size: 11px; }
  .related-events .text-button { font-size: 12px; white-space: nowrap; }
  .event-row { grid-template-columns: minmax(0,1fr) auto; gap: 6px 10px; padding: 17px; }
  .event-time { grid-column: 1/-1; font-size: 10px; }
  .event-row h3 { font-size: 13px; }
  .event-row p { font-size: 12px; line-height: 1.8; }
  .event-row .badge { font-size: 10px; }
  .event-row .badge::before { display: none; }
  .scope-notice { flex-direction: column; align-items: flex-start; gap: 5px; }
  .section-toolbar { flex-direction: column; align-items: stretch; gap: 15px; margin-top: 22px; }
  .section-toolbar h2 { font-size: 21px; }
  .section-toolbar p { font-size: 12px; }
  .section-toolbar .time-controls { justify-content: flex-start; gap: 8px; }
  #units-button { font-size: 12px; }
  .traffic-hero { grid-template-columns: 1fr; padding: 22px 19px; gap: 18px; }
  .traffic-number { font-size: 36px; }
  .traffic-breakdown { gap: 16px; border-top: 1px solid var(--line); padding-top: 15px; }
  .traffic-breakdown .section-label { margin-top: 0; }
  .traffic-breakdown strong { font-size: 22px; }
  .traffic-detail { padding: 14px 19px; font-size: 11px; }
  .traffic-method { grid-template-columns: 1fr; gap: 0; }
  .method-panel { padding: 20px; }
  .quality-note { font-size: 12px; }
  .quota-section { padding: 16px 19px; }
  .quota-label { font-size: 11px; }
  th, td, caption { padding: 12px 16px; }
  table { font-size: 12px; }
  .empty-state { padding: 24px 19px; }
  .empty-state p { font-size: 13px; }
  .empty-state pre { font-size: 11px; padding: 15px; }
  .page-footer { font-size: 10px; flex-direction: column; gap: 4px; }
  .nav-button { font-size: 12px; padding: 10px 5px; gap: 6px; }
  .navigation { gap: 4px; padding-left: 10px; padding-right: 10px; }
  .nav-symbol { font-size: 21px; width: 18px; }
  .login-screen { display: block; padding: 32px 22px; }
  .login-story .brand { margin-bottom: 36px; }
  .login-story h1 { font-size: 31px; letter-spacing: -.8px; }
  .login-story .lead { margin-top: 16px; font-size: 13px; }
  .login-principles { margin: 24px 0 29px; gap: 15px; font-size: 11px; }
  .login-card { padding: 26px; }
  .login-card h2 { font-size: 24px; }
  .login-card > .muted { font-size: 13px; }
}
@media (max-width:360px) {
  .topbar { flex-wrap: wrap; }
  .topbar-actions { margin-left: auto; }
  .mobile-brand { font-size: 14px; }
  main { padding-left: 12px; padding-right: 12px; }
  .boundary-note summary .muted { font-size: 10px; }
  .time-toolbar { align-items: flex-start; }
  .time-toolbar .time-controls { justify-content: flex-end; }
  .status-meta { flex-wrap: wrap; }
  .nav-count { font-size: 9px; padding: 1px 4px; }
}
@media (prefers-reduced-motion:no-preference) {
  button { transition: background .12s, color .12s; }
}
@media (forced-colors:active) {
  .resource-cell.selected, .nav-button.active, .segmented .selected { outline: 2px solid Highlight; outline-offset: -3px; }
  .metric-line, .metric-line.second { stroke: CanvasText; }
  .metric-dot, .metric-dot.second { fill: CanvasText; }
}
@media print {
  .sidebar, .topbar, .heading-actions, .time-toolbar, .page-footer { display: none; }
  .application { display: block; }
  main { padding: 0; }
  .panel { break-inside: avoid; }
}

#history-semantics { padding: 0 20px 16px; }
