:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  color: #172338;
  background: #f5f7fb;
  --page: #f5f7fb;
  --surface: #fff;
  --text: #172338;
  --muted: #64748b;
  --border: #e3e9f1;
  --blue: #2563eb;
  --blue-soft: #edf3ff;
  --teal: #0d9488;
  --purple: #7c3aed;
  --sidebar-width: 208px;
  --header-height: 64px;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, summary, select { -webkit-tap-highlight-color: transparent; }
button { min-height: 36px; padding: 8px 14px; border: 1px solid var(--blue); border-radius: 7px; background: var(--blue); color: #fff; line-height: 1.3; font-weight: 550; cursor: pointer; transition: background-color .12s ease, border-color .12s ease; }
button:hover { background: #1d4ed8; border-color: #1d4ed8; }
button:disabled { cursor: default; opacity: .5; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid #93b4ff; outline-offset: 3px; }
input, select { min-height: 38px; min-width: 0; max-width: 100%; padding: 8px 11px; border: 1px solid #d6deea; border-radius: 7px; color: var(--text); background: var(--surface); }
input::placeholder { color: #7b879b; }
input[type="search"] { width: 100%; }
input[type="datetime-local"] { font-variant-numeric: tabular-nums; }
label { display: flex; flex-direction: column; gap: 7px; color: #475569; font-size: 12px; font-weight: 550; }
a { color: var(--blue); }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; line-height: 1.4; font-weight: 650; }
h1 { font-size: 17px; }
h2 { font-size: 23px; letter-spacing: -.03em; }
h3 { font-size: 14px; }
h4 { font-size: 13px; }
small { font-size: 12px; }
svg { display: block; }
.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; z-index: 100; top: -100px; left: 16px; padding: 12px 18px; border-radius: 8px; background: var(--text); color: #fff; }
.skip-link:focus { top: 10px; }
.muted, .section-hint, .control-hint { color: var(--muted); font-size: 12px; line-height: 1.7; }
.eyebrow { display: block; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .055em; line-height: 1.6; }
.secondary, .quiet { border-color: #d7e0ec; color: #3a4c66; background: var(--surface); }
.secondary:hover, .quiet:hover { border-color: #a9bdd9; background: #f2f6fc; }
.good { color: #117b57; }
.warn { color: #a35d0c; }
.notice { margin: 0 0 18px; padding: 11px 14px; border: 1px solid; border-radius: 8px; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.notice-warning { color: #925815; background: #fff8e9; border-color: #f1dcad; }
.notice-error { color: #a42c36; background: #fff1f2; border-color: #f4cbd0; }
.notice-info { color: #375c94; background: #eff5ff; border-color: #d4e2f9; }

/* Shared application shell. */
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: var(--sidebar-width); display: flex; flex-direction: column; padding: 0 14px 16px; background: var(--surface); border-right: 1px solid var(--border); }
.brand { height: 88px; display: flex; align-items: center; gap: 10px; padding: 0 9px; }
.brand-mark { display: grid; place-items: center; width: 33px; height: 33px; flex: 0 0 auto; color: #fff; background: var(--blue); border-radius: 9px; }
.brand-mark svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.brand strong { display: block; font-size: 14px; font-weight: 700; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; letter-spacing: .06em; }
.sidebar-caption { padding: 16px 12px 10px; color: #8995a8; font-size: 11px; }
.main-nav { display: grid; gap: 5px; }
.main-nav button { width: 100%; display: flex; align-items: center; gap: 11px; text-align: left; min-height: 42px; padding: 10px 13px; border: 0; color: #52637c; background: transparent; border-radius: 8px; font-weight: 500; }
.main-nav button:hover { background: #f4f7fc; color: #20324f; }
.main-nav button[aria-pressed="true"] { color: #215aca; background: var(--blue-soft); font-weight: 650; }
.main-nav svg, .host-icon svg, .logout-button svg { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-bottom { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid var(--border); }
.sidebar-host { display: flex; align-items: center; gap: 9px; margin: 2px 8px 6px; padding: 11px 10px; border: 1px solid #e8edf5; border-radius: 8px; background: #f8fafc; }
.host-icon { color: #7b8aa1; }
.sidebar-host strong { display: block; font-size: 11px; font-weight: 550; }
.sidebar-host small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.sidebar-bottom p { margin-top: 15px; font-size: 11px; color: #7b879b; }
.app-main { min-width: 0; margin-left: var(--sidebar-width); }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; gap: 24px; min-height: var(--header-height); padding: 0 28px; border-bottom: 1px solid var(--border); background: #fff; }
.topbar h1 { margin-right: auto; }
.health { text-align: right; font-size: 11px; line-height: 1.35; }
.health small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.logout-button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 8px 10px; font-size: 11px; }
.logout-button svg { width: 15px; height: 15px; }
.page-content { width: 100%; max-width: 1920px; margin: 0 auto; padding: 24px 28px 32px; }
.page-content:focus { outline: none; }
.view { min-width: 0; }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.page-intro .eyebrow { margin-bottom: 3px; }
.section-hint { margin-bottom: 3px; }
.host-details { margin: -3px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.8; font-variant-numeric: tabular-nums; }
.overview-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.overview-intro h2 { flex: 0 0 auto; font-size: 15px; letter-spacing: 0; }
.overview-intro .host-details { margin: 0; font-size: 11px; }
.history-controls { margin-bottom: 16px; }
.control-row, .toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.inline-field { display: flex; flex-direction: row; align-items: center; gap: 10px; font-size: 12px; }
.inline-field select { min-width: 142px; font-size: 12px; font-weight: 500; }
.control-hint { margin-left: auto; }
.query-message { min-height: 20px; margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.75; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.custom-range { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.custom-range label { flex: 0 1 auto; }
.custom-range input { font-size: 12px; }
.custom-range small, .range-to { padding-bottom: 10px; color: var(--muted); font-size: 12px; }
.panel, .chart-panel { min-width: 0; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); box-shadow: 0 2px 5px #20335403; }

/* Overview: the current value belongs to its history card. */
.overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 18px; }
.metric-panel { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 14px 18px 10px; }
.metric-heading { grid-column: 1; grid-row: 1; display: flex; align-items: center; justify-content: flex-start; gap: 15px; min-height: 28px; }
.metric-heading h3 { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.metric-dot, .legend-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; }
.cpu-dot, .rx-dot { background: var(--blue); }
.memory-dot { background: var(--purple); }
.network-dot, .tx-dot { background: var(--teal); }
.disk-dot { background: #c57e20; }
.unit-note { color: var(--muted); font-size: 11px; }
.compact-field { display: flex; flex-direction: row; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.compact-field select { min-height: 28px; padding: 3px 7px; font-size: 11px; }
.metric-value-row { grid-column: 2; grid-row: 1; display: flex; align-items: baseline; justify-content: flex-end; flex-wrap: wrap; gap: 9px; margin: 0; }
.metric-value { font-size: 26px; line-height: 1.25; font-weight: 650; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.dual-value { font-size: 23px; }
.live-label { color: #718198; font-size: 11px; white-space: nowrap; }
.metric-detail { grid-column: 1 / -1; min-height: 20px; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.8; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-panel > .chart-host, .metric-panel > .capacity-summary { grid-column: 1 / -1; }
.chart-host { position: relative; min-width: 0; margin-top: 9px; }
.chart-host > .chart-notice:only-child { display: grid; place-items: center; min-height: 200px; }
.chart-svg { width: 100%; height: 200px; overflow: visible; color: var(--muted); font-family: inherit; }
.chart-svg text { font-family: inherit; }
.chart-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.chart-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; min-height: 20px; margin-bottom: 3px; }
.chart-legend-item { display: inline-flex; align-items: center; gap: 6px; color: #667990; font-size: 11px; line-height: 1.6; }
.chart-legend-swatch { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--series-color, #2563eb); }
.chart-legend-swatch.dashed, .dashed .chart-legend-swatch { border-top-style: dashed; }
.chart-tooltip { position: absolute; z-index: 6; top: 28px; left: 66px; max-width: calc(100% - 82px); white-space: pre-line; padding: 10px 12px; border: 1px solid #dbe3ef; border-radius: 7px; background: #fff; box-shadow: 0 5px 20px #223b601c; color: var(--text); font-size: 11px; line-height: 1.8; pointer-events: none; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.chart-summary, .chart-notice { color: var(--muted); font-size: 11px; line-height: 1.8; }
.chart-summary { margin-top: 4px; }
.chart-notice { padding: 7px 0; }
.chart-data { margin-top: 5px; }
.chart-data > summary { padding: 4px 0; color: #61738e; font-size: 11px; cursor: pointer; }
.chart-data-table { max-height: 330px; margin-top: 7px; overflow: auto; font-size: 11px; }
.chart-data-table table { table-layout: auto; width: 100%; }
.chart-data-table th, .chart-data-table td { padding: 7px 9px; font-size: 11px; }
.chart-data-table th:first-child, .chart-data-table td:first-child { width: auto; white-space: nowrap; }
.chart-data-table th { position: sticky; top: 0; }
.capacity-summary { margin-top: 8px; padding-top: 8px; border-top: 1px solid #edf1f6; color: var(--muted); font-size: 11px; line-height: 1.7; }
.capacity-summary::after { content: ""; display: block; width: 100%; height: 4px; margin-top: 6px; border-radius: 4px; background: linear-gradient(to right, #92a9ce 0%, #92a9ce var(--capacity, 0%), #edf2f8 var(--capacity, 0%), #edf2f8 100%); }
.disclosure { margin-top: 17px; padding: 0 16px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.disclosure > summary { padding: 13px 0; color: #53647b; font-size: 11px; font-weight: 550; cursor: pointer; line-height: 1.6; }
.disclosure > summary > span { margin-left: 16px; color: #7b899d; font-weight: 400; }
.explanation { padding: 1px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.9; }
.explanation p + p { margin-top: 5px; }
.device-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 20px; padding: 3px 0 17px; }
.device-grid > section { min-width: 0; }
.device-grid h3 { margin-bottom: 10px; color: #445771; font-size: 12px; }
.device-grid p, .device-grid section > div { color: var(--muted); font-size: 11px; line-height: 1.9; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* Services: persistent selection and detail, with no overlay. */
.service-workspace { display: grid; grid-template-columns: minmax(0, 38fr) minmax(0, 62fr); gap: 20px; align-items: start; }
.service-master { overflow: hidden; }
.master-heading, .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; }
.count-label { color: #6d7e95; font-size: 11px; white-space: nowrap; }
.service-filters { display: flex; align-items: end; gap: 12px; padding: 0 20px 18px; }
.search-field { flex: 1; min-width: 0; }
.search-field > span { font-size: 11px; }
.search-field input { font-size: 12px; font-weight: 400; }
.sort-field { flex: 0 0 auto; font-size: 11px; }
.sort-field select { max-width: 170px; font-size: 11px; }
.service-list-labels { display: flex; justify-content: space-between; gap: 12px; padding: 9px 20px; color: #7b899d; background: #f8fafc; border-block: 1px solid var(--border); font-size: 11px; }
.service-list { max-height: calc(100vh - 300px); min-height: 240px; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.service-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 64px; padding: 13px 20px; border: 0; border-bottom: 1px solid #eef2f7; border-left: 3px solid transparent; border-radius: 0; color: var(--text); background: #fff; text-align: left; font-size: 12px; font-weight: 500; }
.service-row:hover { background: #f7faff; border-color: #eef2f7; border-left-color: #b8cdf4; }
.service-row.selected, .service-row[aria-pressed="true"] { border-left-color: var(--blue); background: var(--blue-soft); color: #214f9d; }
.service-row:focus-visible { position: relative; outline-offset: -4px; }
.service-row-name { display: block; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.service-row-meta { display: block; flex: 0 0 auto; color: #687d9b; font-size: 11px; font-weight: 400; text-align: right; line-height: 1.8; font-variant-numeric: tabular-nums; }
.service-detail { min-height: 600px; padding: 21px 22px; }
.service-detail-heading { margin-bottom: 18px; }
.service-detail-heading h3 { margin: 6px 0; font-size: 19px; overflow-wrap: anywhere; }
.service-path { display: block; color: #718098; font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.service-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 17px 0; border-block: 1px solid var(--border); }
.service-stats > div { min-width: 0; }
.service-stats span, .service-stats small { display: block; color: var(--muted); font-size: 11px; line-height: 1.7; }
.service-stats strong { display: block; margin: 7px 0 0; color: #21334e; font-size: 17px; line-height: 1.5; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.service-stats > .muted { grid-column: 1 / -1; }
.service-history-controls { margin: 19px 0 13px; }
.service-history-controls .custom-range { padding: 12px 0; border: 0; }
.service-history-controls .custom-range label { flex: 1 1 180px; }
.service-charts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.service-chart-panel { padding: 14px 14px 10px; border-color: #e8edf5; border-radius: 8px; box-shadow: none; }
.service-chart-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; min-height: 28px; }
.service-chart-panel .chart-host { margin-top: 4px; }

/* Processes: a dense, scrollable table with a persistent header. */
.process-panel { overflow: hidden; }
.process-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 20px; padding: 18px 20px; }
.process-toolbar .search-field { flex: 0 1 380px; }
.process-toolbar .count-label { align-self: center; margin-top: 20px; }
.process-toolbar > .muted { margin-left: auto; padding-bottom: 8px; }
.table-wrap { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { padding: 13px 17px; border-bottom: 1px solid #e9eef5; text-align: right; vertical-align: middle; font-size: 12px; line-height: 1.65; }
th { color: #65758d; background: #f8fafc; font-size: 11px; font-weight: 550; }
th:first-child, td:first-child { text-align: left; }
th button { min-height: 28px; padding: 3px 0; color: inherit; background: transparent; border: 0; font-size: inherit; font-weight: inherit; white-space: nowrap; }
th button:hover { color: #215aca; background: transparent; }
th[aria-sort="ascending"], th[aria-sort="descending"] { color: #265ebd; background: #f0f5fd; }
th small { display: block; color: #8793a5; font-size: 11px; font-weight: 400; }
td { color: #33445e; font-variant-numeric: tabular-nums; }
td strong { color: #263850; font-weight: 550; }
td small { display: block; margin-top: 3px; color: #8190a5; font-size: 11px; overflow-wrap: anywhere; }
tbody tr:hover { background: #f8fbff; }
tbody tr:last-child td { border-bottom: 0; }
.numeric { white-space: nowrap; }
.empty { padding: 32px 20px !important; color: var(--muted); text-align: center !important; font-size: 12px; font-weight: 400; }
.process-scroll { max-height: calc(100vh - 290px); min-height: 280px; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; border-top: 1px solid var(--border); }
.process-table { min-width: 770px; }
.process-table th { position: sticky; z-index: 2; top: 0; box-shadow: inset 0 -1px var(--border); }
.process-table th:first-child { width: 34%; }
.process-table th:nth-child(2) { width: 10%; }
.process-table th:nth-child(3), .process-table th:nth-child(4) { width: 15%; }
.process-table th:nth-child(5) { width: 17%; }
.process-table th:last-child { width: 9%; text-align: left; }
.process-table td:last-child { text-align: left; }
.process-table td { height: 59px; padding-top: 10px; padding-bottom: 10px; }
.meter-value { position: relative; z-index: 1; display: block; }
.meter-track { display: block; height: 3px; margin-top: 5px; border-radius: 3px; background: #eef2f8; overflow: hidden; }
.meter-fill { display: block; height: 100%; max-width: 100%; border-radius: inherit; background: #9fbff0; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--border); }
.pager > div { display: flex; align-items: center; gap: 16px; }
.pager button { min-height: 31px; padding: 6px 10px; font-size: 11px; }
.pager-hint, #process-page { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }

/* Traffic: period total, source ranking, then the full report. */
.traffic-health { text-align: right; color: var(--muted); font-size: 11px; line-height: 1.6; }
.traffic-health small { display: block; font-size: 11px; }
.traffic-controls { margin-bottom: 18px; }
.periods { display: flex; gap: 3px; padding: 3px; border: 1px solid #dfe6f0; border-radius: 8px; background: #fff; }
.periods button { min-height: 32px; padding: 6px 15px; color: #66768d; border: 0; background: transparent; font-size: 12px; }
.periods button:hover { color: #234b87; background: #f4f7fc; }
.periods button[aria-pressed="true"] { color: #225fc6; background: #edf3ff; }
.traffic-controls #refresh { margin-left: auto; }
.traffic-controls #refresh-note { margin-left: 0; }
.traffic-overview { display: grid; grid-template-columns: minmax(0, 35fr) minmax(0, 65fr); gap: 20px; align-items: stretch; margin-bottom: 20px; }
.traffic-total-panel { display: flex; flex-direction: column; padding: 24px 26px 20px; }
.traffic-total-panel h3 { margin-top: 5px; color: #495c77; font-size: 13px; font-weight: 550; }
.traffic-total { display: block; margin-top: 17px; color: #1d3863; font-size: clamp(30px, 2.9vw, 46px); line-height: 1.2; font-weight: 600; letter-spacing: -.045em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.traffic-directions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.traffic-directions span, .ranking-legend span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.traffic-directions strong { display: block; margin-top: 8px; color: #344d73; font-size: 19px; font-weight: 550; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.traffic-window { margin-top: 17px; color: var(--muted); font-size: 11px; line-height: 1.9; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.traffic-window #result-time { color: #8290a5; }
.total-footnote { margin-top: auto; padding-top: 20px; color: #8290a5; font-size: 11px; line-height: 1.8; }
.traffic-ranking-panel { min-height: 330px; padding: 22px 24px 15px; }
.ranking-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.ranking-heading .muted { margin-top: 4px; font-size: 11px; }
.ranking-legend { display: flex; gap: 13px; }
.ranking-legend span { font-size: 11px; white-space: nowrap; }
.traffic-ranking { display: grid; gap: 4px; }
.traffic-rank-row { display: grid; grid-template-columns: minmax(110px, 25%) minmax(0, 1fr) 105px; align-items: center; gap: 14px; width: 100%; min-height: 29px; padding: 6px 7px; border: 0; border-radius: 5px; color: #3d5170; background: transparent; text-align: left; font-size: 11px; font-weight: 400; }
.traffic-rank-row:hover { color: #214f9b; background: #f3f7fe; }
.rank-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rank-track { display: flex; height: 9px; min-width: 0; width: 100%; background: #f1f5fa; border-radius: 3px; overflow: hidden; }
.rank-rx, .rank-tx { display: block; height: 100%; min-width: 0; max-width: 100%; }
.rank-rx { background: #6b9df3; }
.rank-tx { background: #5bc3b5; }
.rank-value { color: #546a87; text-align: right; white-space: nowrap; font-size: 11px; font-variant-numeric: tabular-nums; }
.traffic-detail-panel { overflow: hidden; }
.traffic-detail-panel .panel-heading { border-bottom: 1px solid var(--border); }
.traffic-table { min-width: 980px; }
.traffic-table th:first-child { width: 23%; }
.traffic-table th:nth-child(2), .traffic-table th:nth-child(3), .traffic-table th:nth-child(4) { width: 11%; }
.traffic-table th:nth-child(5) { width: 21%; }
.traffic-table th:last-child { width: 23%; text-align: left; }
.traffic-table td:last-child { text-align: left; }
.traffic-table td { font-size: 11px; }
.traffic-table .status { display: inline-block; font-size: 11px; }
.status-normal { color: #4f7b65; }
.status-warning { color: #a06e26; }
.traffic-table tr.rank-highlight { background: #e9f2ff; box-shadow: inset 3px 0 #2563eb; }
.traffic-table td details { margin-top: 4px; color: #788aa3; font-size: 11px; }
.traffic-table td summary { width: fit-content; color: #6b82a3; cursor: pointer; }
.traffic-table td details p { margin-top: 6px; font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; }
.historical-disclosure { padding-inline: 0; overflow: hidden; }
.historical-disclosure > summary { padding-inline: 16px; }
.traffic-footer { margin-top: 18px; color: #7a899f; font-size: 11px; line-height: 1.9; }
.traffic-footer > p { padding-left: 2px; }
.traffic-footer .disclosure { margin-top: 10px; }
#footer-state { display: block; margin-top: 10px; padding-left: 2px; color: #71839c; }

/* The same visual language for the existing login flow. */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 40px 20px; background: #f5f7fb; }
.login-shell { width: min(420px, 100%); }
.login-brand { justify-content: center; height: auto; margin-bottom: 28px; }
.login-brand .brand-mark { width: 38px; height: 38px; border-radius: 10px; }
.login-brand strong { font-size: 17px; }
.login-brand small { margin-top: 4px; font-size: 11px; letter-spacing: 0; }
.setup { padding: 32px; border: 1px solid #e0e7f1; border-radius: 14px; background: #fff; box-shadow: 0 12px 40px #243b5c07; }
.setup h1 { font-size: 23px; font-weight: 650; }
.setup > p { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.setup form { display: grid; gap: 20px; margin-top: 26px; }
.setup label { font-size: 12px; gap: 9px; }
.setup input { width: 100%; min-height: 43px; font-size: 14px; font-weight: 400; }
.setup button { width: 100%; min-height: 43px; margin-top: 2px; }
.setup #message { min-height: 22px; margin-top: 18px; color: #697e9b; font-size: 11px; }
.login-note { margin-top: 20px; color: #8592a6; font-size: 11px; text-align: center; line-height: 1.8; }

@media (min-width: 1700px) {
  .service-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-detail { min-height: 620px; }
}
@media (max-width: 1250px) {
  .page-content { padding: 22px; }
  .topbar { padding-inline: 22px; }
  .section-hint { max-width: 290px; }
  .service-filters { flex-wrap: wrap; }
  .service-filters .search-field { flex-basis: 100%; }
  .service-filters .sort-field { flex: 1; }
  .sort-field select { max-width: 100%; }
  .service-list { max-height: calc(100vh - 350px); }
  .service-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .traffic-overview { grid-template-columns: minmax(0, 40fr) minmax(0, 60fr); }
  .traffic-rank-row { grid-template-columns: minmax(85px, 30%) minmax(0, 1fr) 85px; gap: 9px; }
  .traffic-ranking-panel { padding-inline: 17px; }
  .metric-value { font-size: 25px; }
  .dual-value { font-size: 20px; }
  .metric-panel { display: block; }
  .metric-heading { justify-content: space-between; }
  .metric-value-row { justify-content: flex-start; margin-top: 8px; }
}
@media (max-width: 1000px) {
  :root { --sidebar-width: 176px; }
  .brand { gap: 8px; padding-inline: 6px; }
  .brand strong { font-size: 12px; }
  .brand-mark { width: 29px; height: 29px; }
  .sidebar { padding-inline: 10px; }
  .page-intro { align-items: start; }
  .section-hint { max-width: 240px; }
  .overview-grid, .traffic-overview { grid-template-columns: minmax(0, 1fr); }
  .service-workspace { grid-template-columns: minmax(0, 40fr) minmax(0, 60fr); gap: 14px; }
  .service-detail { padding: 18px 16px; }
  .service-row { padding-inline: 12px; gap: 8px; }
  .service-row-meta { font-size: 11px; }
  .device-grid { grid-template-columns: 1fr; gap: 18px; }
  .control-hint { width: 100%; margin-left: 0; }
  .traffic-controls #refresh-note { width: auto; }
  .process-toolbar > .muted { margin-left: 0; }
}
@media (max-width: 720px) {
  :root { --sidebar-width: 64px; }
  .sidebar { padding: 0 7px 12px; }
  .brand { justify-content: center; height: 64px; padding: 0; }
  .sidebar .brand > div, .sidebar-caption, .sidebar-host, .sidebar-bottom p, .main-nav button span { display: none; }
  .sidebar-bottom { padding: 12px 0 0; }
  .main-nav { margin-top: 18px; }
  .main-nav button { justify-content: center; min-height: 44px; padding: 10px; }
  .main-nav svg { width: 21px; height: 21px; }
  .topbar { gap: 12px; padding-inline: 15px; }
  .topbar h1 { font-size: 15px; }
  .health { max-width: 190px; font-size: 11px; }
  .health small { font-size: 11px; }
  .logout-button { justify-content: center; min-width: 30px; padding-inline: 8px; }
  .logout-button span { display: none; }
  .page-content { padding: 18px 14px 24px; }
  .page-intro { display: block; margin-bottom: 16px; }
  h2 { font-size: 21px; }
  .section-hint { max-width: none; margin-top: 8px; font-size: 11px; }
  .overview-intro { align-items: start; flex-direction: column; gap: 8px; }
  .metric-panel { padding: 15px 14px 12px; }
  .metric-value { font-size: 26px; }
  .dual-value { font-size: 21px; }
  .service-workspace { grid-template-columns: minmax(0, 1fr); }
  .service-list { max-height: 300px; min-height: 180px; }
  .service-filters { flex-wrap: nowrap; padding-inline: 16px; }
  .service-filters .search-field { flex: 1; }
  .service-filters .sort-field { flex: 0 1 130px; }
  .service-detail { min-height: 0; }
  .service-row { padding-inline: 17px; }
  .service-row-meta { font-size: 11px; }
  .process-toolbar { gap: 12px; padding: 16px; }
  .process-toolbar .search-field { flex-basis: 100%; }
  .process-toolbar .count-label { margin-top: 0; }
  .process-toolbar > .muted { padding-bottom: 0; }
  .process-scroll { max-height: 560px; }
  .pager { justify-content: center; padding: 13px 10px; }
  .pager-hint { display: none; }
  .pager > div { gap: 10px; }
  .traffic-health { margin-top: 8px; text-align: left; }
  .periods { max-width: 100%; }
  .periods button { padding-inline: 10px; font-size: 11px; }
  .traffic-controls #refresh { margin-left: 0; }
  .traffic-controls #refresh-note { margin-left: auto; font-size: 11px; }
  .traffic-total-panel { padding: 21px; }
  .traffic-total { font-size: 39px; }
  .ranking-heading { flex-wrap: wrap; }
  .traffic-rank-row { grid-template-columns: minmax(75px, 28%) minmax(0, 1fr) 85px; padding-inline: 0; }
  .disclosure > summary > span { display: block; margin: 4px 0 0 12px; }
  .custom-range { padding: 12px; }
  .custom-range label { flex: 1 1 190px; }
  .range-to { display: none; }
  .login-page { padding: 28px 16px; }
  .setup { padding: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Traffic is the primary reading path on the overview. */
.usage-hero { margin-bottom: 28px; padding: 24px; border: 1px solid #bfd5f5; border-radius: 16px; background: linear-gradient(115deg,#f3f8ff,#fff 60%); }
.usage-heading,.usage-controls,.usage-change,.usage-live { display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.usage-heading { justify-content:space-between; margin-bottom:22px; }
.usage-heading h2 { margin:5px 0 0; font-size:25px; letter-spacing:-.5px; }
.usage-controls { gap:10px; }
.usage-cards { display:grid; grid-template-columns:1.15fr 1fr 1fr; gap:16px; }
.usage-card { min-width:0; border:1px solid #dce6f4; border-radius:12px; padding:22px; background:#fff; }
.usage-card > strong { display:block; margin:12px 0 5px; font-size:clamp(30px,2.7vw,48px); letter-spacing:-1.5px; line-height:1.15; font-variant-numeric:tabular-nums; white-space:nowrap; }
.usage-total { background:#143e76; color:#fff; border-color:#143e76; }
.usage-label { font-size:15px; font-weight:650; }
.usage-exact { display:block; color:#63758e; font-size:13px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.usage-total .usage-exact { color:#cadcf5; }
.usage-delta { display:inline-block; margin:18px 0 0; padding:7px 10px; border-radius:6px; color:#155eb3; background:#edf5ff; font-weight:650; font-variant-numeric:tabular-nums; }
.usage-rx .usage-label { color:#2266b0; }.usage-tx .usage-label { color:#087f7b; }
.usage-change { margin:15px 0 10px; justify-content:space-between; font-size:13px; color:#445d7e; }
.usage-meta { color:#65758c; font-size:12px; line-height:1.6; }.usage-meta p { margin:3px 0; }
.usage-live { margin-top:18px; padding-top:16px; border-top:1px solid #dbe7f5; font-size:13px; }
.usage-live strong { font-size:18px; margin-left:8px; font-variant-numeric:tabular-nums; color:#1e3a5f; }
.usage-live small { margin-left:auto; color:#65758c; }
@media(max-width:1100px) { .usage-cards { grid-template-columns:repeat(3,minmax(0,1fr));gap:10px; }.usage-card { padding:16px; }.usage-card>strong {font-size:30px;} }
@media(max-width:760px) { .usage-hero {padding:16px;}.usage-cards {grid-template-columns:1fr;}.usage-card>strong{font-size:36px;}.usage-live small{margin-left:0;}.usage-controls{width:100%;} }
