:root {
  color-scheme: light;
  --ink: #243347;
  --muted: #64748b;
  --accent: #456f9f;
  --accent-soft: #edf3fa;
  --line: #e3e9f0;
  --surface: #fff;
  --canvas: #f4f6f9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}
.analysis-rename{display:flex;gap:14px;flex-wrap:wrap;align-items:flex-end;padding:20px 24px;border-top:1px solid var(--line)}.analysis-rename label{flex:1;min-width:180px;max-width:620px;display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--muted)}.analysis-rename input{width:100%;min-height:40px;padding:8px 12px;font:inherit;color:var(--ink);background:var(--input);border:1px solid var(--input-border);border-radius:8px}.analysis-rename>span{font-size:13px;color:var(--muted);align-self:center}
.multitype .sensor-item{gap:20px;align-items:center;padding:14px 0}.sensor-name{display:flex;flex:1;min-width:0;max-width:620px;flex-direction:column;gap:6px}.sensor-name>span{font-size:12px;color:var(--muted)}.sensor-name input{width:100%;min-height:38px;padding:7px 11px;color:var(--ink);background:var(--input);border:1px solid var(--input-border);border-radius:8px;font:inherit}.sensor-enabled{display:flex;align-items:center;gap:8px;white-space:nowrap;color:var(--muted);font-size:13px}.sensor-enabled input{accent-color:var(--accent);width:17px;height:17px}.multitype input:disabled{opacity:.7;cursor:default}
.analysis-picker{display:block;min-width:0;max-width:420px;border-left:1px solid var(--line);padding-left:20px}.analysis-picker select{width:100%;font-size:14px;font-weight:550;border-color:transparent;background-color:var(--surface);text-overflow:ellipsis}.measure-domains{display:flex;gap:6px;padding:16px 22px 0;flex-wrap:wrap}.measure-domains button{padding:8px 13px;border-radius:9px;color:var(--muted);font-size:14px;font-weight:550}.measure-domains button[aria-pressed=true]{color:var(--accent);background:var(--accent-soft)}.multitype .generic-insights{display:block}.multitype .generic-insights.with-distribution{display:grid}.multitype .channel-values th:first-child,.multitype .channel-values td:first-child{width:46%}.multitype .channel-values th:last-child,.multitype .channel-values td:last-child{width:36px}.multitype .chart-tooltip{min-width:240px;padding:10px 13px;max-width:min(370px,95%)}.multitype .tooltip-row{margin-top:2px;gap:7px;font-size:12px;line-height:1.4}.multitype .chart-tooltip>strong{font-size:12px;white-space:nowrap;margin-bottom:6px}.sensor-item{display:flex;justify-content:space-between;padding:12px 0;border-bottom:1px solid var(--line);font-size:14px}.sensor-item span{color:var(--muted)}.multitype .channel-name{overflow-wrap:anywhere}.multitype .channel-values td{white-space:nowrap}.multitype .channel-values td:first-child{white-space:normal}@media(max-width:900px){.analysis-picker{max-width:330px;padding-left:10px}.analysis-picker select{font-size:13px}.measure-domains{padding-inline:14px}}@media(max-width:620px){.header-identity{max-width:100%}.analysis-picker{max-width:calc(100vw - 170px)}.analysis-picker select{font-size:12px}.measure-domains button{font-size:12px;padding:7px 10px}}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { border: 0; background: transparent; }
button:disabled { cursor: default; opacity: .4; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button, select, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #88b3de; outline-offset: 3px; }
[hidden] { display: none !important; }
/* Anchor hidden labels so wide, scrollable tables cannot enlarge the page. */
.sr-only, .skip:not(:focus) { position: absolute; top: 0; left: 0; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip:focus { position: fixed; top: 12px; left: 12px; padding: 12px 18px; z-index: 100; background: white; border-radius: 8px; }

/* One type scale and one spacing rhythm across controls, tables and charts. */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1840px; margin: auto; padding: 0 32px; min-height: 76px; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: baseline; gap: 5px; color: var(--accent); font-size: 28px; font-weight: 750; letter-spacing: -1.4px; }
.brand span { font-weight: 350; }
.topbar h1 { font-size: 18px; font-weight: 500; letter-spacing: -.25px; border-left: 1px solid var(--line); padding-left: 28px; }
.live-indicator { margin-left: auto; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 14px; }
.live-indicator i { width: 9px; height: 9px; border-radius: 50%; background: #c68f38; box-shadow: 0 0 0 4px #c68f381c; }
.live-indicator.online i { background: #2f806c; box-shadow: 0 0 0 4px #2f806c1c; }
main { max-width: 1840px; margin: auto; padding: 24px 32px 32px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
select { min-height: 42px; padding: 8px 30px 8px 12px; border: 1px solid #dce3ec; border-radius: 7px; background: #fff; font-size: 15px; max-width: 100%; }
select:hover { border-color: #b6c8db; }
select:disabled { color: var(--muted); background: #f8fafc; cursor: default; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px; font-size: 14px; font-weight: 550; border: 1px solid #dce3ec; border-radius: 7px; background: white; white-space: nowrap; }
.button:hover:enabled { background: var(--accent-soft); border-color: #bacde1; }
.button-dark { background: var(--accent); border-color: var(--accent); color: white; }
.button-dark:hover:enabled { background: #345c88; border-color: #345c88; }
.text-button { font-size: 14px; font-weight: 550; color: var(--accent); padding: 8px 0; }
.text-button:hover { text-decoration: underline; }

/* Network simulation uses a compact, aligned control bar. */
.network-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding: 18px 24px; margin-bottom: 18px; }
.network-heading { padding-right: 24px; border-right: 1px solid var(--line); }
.network-toggle { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.network-toggle input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.network-controls { display: flex; align-items: flex-end; flex: 1; gap: 18px; }
.network-controls > label, .signal-controls label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.network-controls > label { flex: 1; }
.network-controls select, .signal-controls select { color: var(--ink); width: 100%; }
.notice { border: 1px solid #d8e4f1; border-radius: 8px; padding: 14px 18px; margin-bottom: 18px; background: #edf4fc; font-size: 15px; }
.notice.error { border-color: #ebc5bf; background: #fff3f0; color: #943e36; }

/* Configuration stays collapsed during analysis and uses the same visual rhythm. */
.config-panel { margin-bottom: 18px; }
.config-panel > summary { min-height: 58px; padding: 14px 24px; display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; font-size: 16px; font-weight: 600; }
.config-panel > summary::-webkit-details-marker { display: none; }
.config-panel > summary::before { content: '›'; color: var(--accent); font-size: 24px; line-height: 1; transition: transform .15s ease; }
.config-panel[open] > summary::before { transform: rotate(90deg); }
.config-panel > summary small { margin-left: auto; color: var(--muted); font-size: 14px; font-weight: 450; }
#config-form { border-top: 1px solid var(--line); padding: 22px 24px 24px; }
.config-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.config-head label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 14px; }
#config-status { color: var(--muted); font-size: 14px; text-align: right; }
#config-status.pending { color: #94622c; }
#config-status.applied { color: #2f7464; }
.config-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; }
.config-table { width: 100%; border-collapse: collapse; min-width: 880px; font-size: 14px; }
.config-table th { padding: 10px 12px; color: var(--muted); background: #f8fafc; text-align: left; font-size: 13px; font-weight: 500; }
.config-table td { padding: 8px 12px; border-top: 1px solid #eef2f6; }
.config-table td:first-child { width: 110px; font-weight: 600; color: #566b83; }
.config-table input[type=text], .config-table input[type=number] { width: 100%; min-height: 40px; border: 1px solid #dce3ec; border-radius: 7px; padding: 7px 10px; background: white; }
.config-table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.config-table select { width: 100%; min-width: 88px; }
.config-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* Quiet performance strip, with emphasis on the measured values. */
.performance-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); background: white; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 24px; }
.performance-card { padding: 18px 24px; min-width: 0; }
.performance-card + .performance-card { border-left: 1px solid var(--line); }
.metric-label { font-size: 14px; color: var(--muted); font-weight: 500; }
.performance-card > strong { display: block; margin: 4px 0; font-size: 32px; line-height: 1.25; font-weight: 600; letter-spacing: -.9px; font-variant-numeric: tabular-nums; }
.performance-card > strong small { font-size: 15px; font-weight: 400; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.performance-card > small { display: block; font-size: 13px; color: var(--muted); }

.exploration-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.view-tabs { display: inline-flex; padding: 4px; gap: 3px; border-radius: 9px; background: #f2f5f8; }
.view-tabs button { min-width: 86px; min-height: 40px; padding: 8px 18px; font-size: 15px; font-weight: 550; color: var(--muted); border-radius: 6px; }
.view-tabs button:hover { color: var(--accent); }
.view-tabs button[aria-pressed=true] { color: var(--accent); background: white; box-shadow: 0 1px 4px #24334715; }
.zone-control select { min-width: 195px; background-color: #fbfcfe; }
.analysis-layout { display: grid; grid-template-columns: minmax(480px, 29%) minmax(0,1fr); align-items: start; }
.channel-overview { min-width: 0; padding: 24px 0; }
.channel-table-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 20px 20px; min-height: 58px; }
.channel-table-heading h2 { font-size: 18px; font-weight: 600; letter-spacing: -.3px; }
.channel-values { overflow-x: auto; }
.channel-values table { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 14px; font-variant-numeric: tabular-nums; }
.channel-values th { padding: 10px 7px; color: var(--muted); text-align: right; font-size: 13px; font-weight: 500; border-bottom: 1px solid var(--line); line-height: 1.4; }
.channel-values td { padding: 12px 7px; text-align: right; border-bottom: 1px solid #f0f3f7; vertical-align: middle; }
.channel-values th:first-child, .channel-values td:first-child { padding-left: 20px; text-align: left; }
.channel-values th:last-child, .channel-values td:last-child { padding-right: 14px; }
.channel-values tbody tr:not(.role-heading):hover { background: #f9fbfd; }
.channel-values .role-heading td { padding-top: 10px; padding-bottom: 10px; background: #f5f7fa; font-size: 13px; font-weight: 600; color: #566b83; border: 0; }
.channel-name { display: flex; align-items: center; gap: 9px; line-height: 1.45; }
.channel-dot { width: 8px; height: 8px; display: inline-block; flex-shrink: 0; border-radius: 50%; background: var(--series); }
.channel-values small { font-size: 12px; color: var(--muted); }
.channel-values .muted-row { color: #8997a8; }
.muted-row .channel-dot { opacity: .35; }
.eye-button { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 32px; padding: 5px; color: #7d8da0; border-radius: 6px; }
.eye-button:hover { color: var(--accent); background: var(--accent-soft); }
.eye-button svg { width: 19px; height: 19px; }

/* The chart and its supporting insights form one continuous workspace. */
.chart-column { min-width: 0; padding: 24px; border-left: 1px solid var(--line); }
.date-controls { display: flex; justify-content: center; align-items: center; gap: 12px; margin-bottom: 24px; }
.date-selector { position: relative; padding: 8px 16px; border-radius: 7px; font-size: 17px; font-weight: 550; text-align: center; min-height: 42px; }
.date-selector:hover { background: #f6f8fb; }
.date-selector:focus-within { outline: 3px solid #88b3de; outline-offset: 2px; }
.date-selector input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.date-selector input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.year-selector { min-width: 120px; font-size: 17px; font-weight: 550; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 4px 8px; color: var(--muted); font-size: 22px; border-radius: 6px; }
.icon-button:hover:enabled { background: var(--accent-soft); color: var(--accent); }
.chart-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.signal-controls { display: flex; gap: 12px; flex-wrap: wrap; }
.signal-controls select { font-size: 14px; }
.chart-heading-right { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; margin-left: auto; }
.resolution-badge { font-size: 13px; color: var(--muted); white-space: nowrap; }
.chart-wrap { height: clamp(380px, 27vw, 490px); position: relative; }
.chart-wrap canvas { display: block; width: 100%; height: 100%; }
#chart { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.loading, .empty-chart { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); background: #ffffffdc; font-size: 15px; text-align: center; padding: 24px; }
.loading span { width: 20px; height: 20px; border: 2px solid #dce5ef; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tooltip-row i { width: 8px; height: 8px; border-radius: 50%; background: var(--series); flex-shrink: 0; }
.chart-tooltip, .distribution-tooltip { position: absolute; z-index: 10; padding: 16px; border: 1px solid #dce4ee; border-radius: 10px; background: #fffffff7; box-shadow: 0 8px 32px #22364f20; color: #42556c; font-size: 14px; pointer-events: none; }
.chart-tooltip { min-width: 270px; max-width: min(380px, 100%); }
.chart-tooltip > strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.chart-tooltip > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.tooltip-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 7px; }
.tooltip-row b { font-variant-numeric: tabular-nums; font-weight: 550; margin-left: auto; white-space: nowrap; }
.tooltip-row small { flex-basis: 100%; color: var(--muted); padding-left: 16px; font-size: 13px; }

.chart-insights { display: grid; grid-template-columns: minmax(0,.95fr) minmax(0,1.05fr); gap: 24px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.chart-insights h3 { font-size: 16px; font-weight: 600; letter-spacing: -.2px; }
.insight-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.peak-panel select { max-width: 220px; font-size: 14px; }
#peak-values { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.peak-value { display: flex; flex-direction: column; gap: 5px; font-size: 14px; }
.peak-value > span { color: var(--muted); }
.peak-value > strong { font-size: 20px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.peak-value time, .peak-value small { font-size: 13px; color: var(--muted); }
.distribution-wrap { position: relative; min-width: 0; border-left: 1px solid var(--line); padding-left: 24px; }
.distribution-tooltip { left: 0; right: 0; bottom: calc(100% + 12px); }
.distribution-tooltip .peak-value { margin-top: 14px; }
.distribution-tooltip > strong { font-size: 15px; }
.distribution h3 { margin-bottom: 14px; }
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut { width: 146px; flex-shrink: 0; }
.donut text { fill: var(--muted); font: 10px -apple-system, sans-serif; text-anchor: middle; }
.donut .donut-value { font-size: 17px; font-weight: 600; fill: var(--ink); }
.donut [data-donut-channel] { cursor: help; }
.donut [data-donut-channel]:focus { outline: none; stroke-width: 21; }
.donut-key { flex: 1; min-width: 0; display: grid; gap: 4px; font-size: 13px; }
.donut-key button { display: flex; align-items: center; gap: 7px; text-align: left; padding: 4px 0; font: inherit; color: #56677e; cursor: help; }
.donut-key button b { margin-left: auto; font-weight: 500; white-space: nowrap; color: var(--ink); }
.panel-note { font-size: 14px; color: var(--muted); }

@media (max-width: 1500px) {
  .topbar-inner { padding-inline: 24px; }
  main { padding: 20px 24px 28px; }
  .analysis-layout { grid-template-columns: 470px minmax(0,1fr); }
  .chart-column { padding: 20px; }
  .chart-heading-right { flex-basis: 100%; justify-content: space-between; }
  .chart-insights { grid-template-columns: 1fr; }
  .distribution-wrap { border-left: 0; border-top: 1px solid var(--line); padding: 20px 0 0; }
  .donut-wrap { max-width: 480px; }
}
@media (max-width: 1180px) {
  .network-panel { gap: 16px; }
  .network-heading { padding-right: 0; border-right: 0; flex-basis: 100%; }
  .analysis-layout { display: flex; flex-direction: column; }
  .chart-column { order: -1; width: 100%; border-left: 0; padding: 24px; }
  .channel-overview { width: 100%; border-top: 1px solid var(--line); }
  .channel-table-heading { padding-inline: 24px; }
  .channel-values th, .channel-values td { padding-inline: 14px; }
  .channel-values th:first-child, .channel-values td:first-child { padding-left: 24px; }
  .chart-heading-right { flex-basis: auto; }
  .chart-insights { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .distribution-wrap { border-top: 0; border-left: 1px solid var(--line); padding: 0 0 0 24px; }
  .performance-card { padding: 18px; }
}
@media (max-width: 760px) {
  .topbar-inner { min-height: 68px; padding-inline: 18px; gap: 18px; }
  .brand { font-size: 25px; }
  .topbar h1 { font-size: 16px; padding-left: 18px; }
  .live-indicator span { display: none; }
  main { padding: 16px 16px 24px; }
  .network-panel { padding: 18px; }
  .network-controls { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 14px; }
  .network-controls > label { min-width: 0; }
  .network-controls .button { align-self: end; padding-inline: 10px; }
  .config-panel > summary { padding-inline: 18px; }
  .config-panel > summary small { display: none; }
  #config-form { padding: 18px; }
  .config-head { align-items: stretch; flex-direction: column; gap: 12px; }
  #config-status { text-align: left; }
  .config-actions { flex-direction: column-reverse; }
  .config-actions .button { width: 100%; }
  .performance-grid { grid-template-columns: 1fr 1fr; }
  .performance-card { padding: 16px; }
  .performance-card .metric-label { min-height: 42px; }
  .performance-card:nth-child(3) { border-left: 0; }
  .performance-card:nth-child(n+3) { border-top: 1px solid var(--line); }
  .performance-card > strong { font-size: 28px; }
  .exploration-toolbar { padding: 14px; flex-wrap: wrap; gap: 12px; }
  .view-tabs { width: 100%; overflow-x: auto; }
  .view-tabs button { flex: 1 0 auto; min-width: 0; padding-inline: 6px; }
  .zone-control { width: 100%; }
  .zone-control select { width: 100%; }
  .chart-column { padding: 18px 14px; }
  .date-controls { gap: 3px; margin-bottom: 18px; }
  .date-selector { font-size: 16px; padding-inline: 6px; }
  .chart-heading { gap: 14px; margin-bottom: 18px; }
  .signal-controls { width: 100%; gap: 10px; }
  .signal-controls label { flex: 1; min-width: 0; }
  .chart-heading-right { flex-basis: 100%; width: 100%; justify-content: space-between; gap: 8px; }
  .chart-heading-right .button { padding-inline: 12px; }
  .resolution-badge { white-space: normal; }
  .chart-wrap { height: 350px; }
  .chart-insights { grid-template-columns: 1fr; gap: 20px; }
  .distribution-wrap { border-left: 0; border-top: 1px solid var(--line); padding: 20px 0 0; }
  .channel-values table { min-width: 540px; }
  .channel-values th, .channel-values td { padding-inline: 8px; }
  .channel-values th:first-child, .channel-values td:first-child { padding-left: 16px; }
  .channel-table-heading { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .loading span { animation: none; }
}

/* Refined analysis workspace. Shared tokens cover native controls and Canvas. */
:root {
  --ink: #202b3d; --muted: #6b778b; --subtle: #8a94a5;
  --accent: #3567e8; --accent-soft: #edf2ff; --line: #e6eaf0;
  --surface: #fff; --surface-soft: #f7f9fc; --surface-hover: #f0f4fa;
  --canvas: #f3f5f8; --input: #fff; --input-border: #dce2eb;
  --tooltip: #fffffff7; --overlay: #ffffffe8;
  --shadow: 0 5px 22px #20335404, 0 1px 3px #20335403;
  --shadow-float: 0 14px 50px #182c4c22, 0 2px 8px #182c4c0a;
  --success: #29806b; --warning: #a6742c;
  --chart-grid: #e9edf4; --chart-text: #77849a; --chart-zero: #bac5d6;
  --chart-hover: #91a1b9; --chart-selection: #3567e814; --chart-selection-border: #6c91ef;
  --ease: cubic-bezier(.22,.68,0,1.05);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e7edf8; --muted: #95a4bd; --subtle: #75849e;
  --accent: #86a9ff; --accent-soft: #213252; --line: #263246;
  --surface: #161f2e; --surface-soft: #1b2638; --surface-hover: #233148;
  --canvas: #0e1420; --input: #1b2638; --input-border: #304058;
  --tooltip: #202c40fa; --overlay: #161f2ee8;
  --shadow: 0 4px 20px #0000000a;
  --shadow-float: 0 14px 50px #00000044, 0 2px 8px #00000022;
  --success: #63c7aa; --warning: #e4b56c;
  --chart-grid: #2a3549; --chart-text: #97a5bf; --chart-zero: #50617b;
  --chart-hover: #8da0c1; --chart-selection: #86a9ff1f; --chart-selection-border: #86a9ff;
}
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { transition: background-color .25s ease, color .25s ease; }
button, select, .panel, .performance-grid { transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease; }
button { touch-action: manipulation; }
button:active:enabled { transform: translateY(1px); }
input[type=checkbox] { accent-color: var(--accent); }
:focus-visible { outline-color: var(--accent); }
.skip:focus { background: var(--surface); box-shadow: var(--shadow-float); }
.topbar-inner { max-width: 1920px; padding-inline: 36px; min-height: 78px; }
.brand { color: var(--ink); }
.brand span { color: var(--muted); }
.topbar h1 { font-size: 17px; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 24px; }
.live-indicator { gap: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-indicator i { width: 7px; height: 7px; background: var(--warning); box-shadow: 0 0 0 4px color-mix(in srgb,var(--warning) 12%,transparent); }
.live-indicator.online i { background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb,var(--success) 12%,transparent); animation: live-pulse 3.5s ease-in-out infinite; }
#theme-toggle { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); background: var(--surface); }
#theme-toggle:hover { background: var(--surface-hover); color: var(--ink); }
#theme-toggle svg { width: 19px; height: 19px; stroke-width: 1.7; }
#theme-toggle .theme-sun { display: none; }
[data-theme="dark"] #theme-toggle .theme-moon { display: none; }
[data-theme="dark"] #theme-toggle .theme-sun { display: block; }
main { max-width: 1920px; padding: 24px 36px 40px; }
.panel { border-radius: 16px; box-shadow: var(--shadow); }
select { border-color: var(--input-border); border-radius: 9px; background-color: var(--input); font-size: 14px; }
select:hover { border-color: var(--subtle); }
select:disabled { background-color: var(--surface-soft); }
.button { padding-inline: 15px; border-color: var(--input-border); border-radius: 9px; background: var(--surface); }
.button svg { width: 17px; height: 17px; }
.button:hover:enabled { background: var(--surface-hover); border-color: var(--subtle); }
.button-dark { background: #3567e8; border-color: #3567e8; color: #fff; box-shadow: 0 2px 4px #3567e818; }
.button-dark:hover:enabled { background: #2454d0; border-color: #2454d0; box-shadow: 0 3px 10px #3567e82a; }
.text-button { font-size: 13px; padding-block: 7px; }
.text-button:hover { text-underline-offset: 4px; }
.network-panel { gap: 24px; padding: 15px 22px; margin-bottom: 12px; }
.network-toggle { font-size: 14px; font-weight: 550; }
.network-toggle input { width: 17px; height: 17px; }
.network-controls { gap: 16px; }
.network-controls > label, .signal-controls label { gap: 5px; font-size: 12px; font-weight: 500; }
.network-controls select { min-height: 38px; padding-block: 6px; }
.network-controls .button { min-height: 38px; }
.notice { border-color: color-mix(in srgb,var(--accent) 25%,var(--line)); border-radius: 12px; background: var(--accent-soft); font-size: 14px; }
.notice.error { border-color: #c56d624f; background: color-mix(in srgb,var(--surface) 92%,#c56d62); color: #b8675c; }
.config-panel { margin-bottom: 12px; border-radius: 13px; }
.config-panel > summary { min-height: 52px; padding: 12px 22px; font-size: 14px; font-weight: 550; }
.config-panel > summary::before { color: var(--muted); font-size: 22px; transition: transform .2s ease; }
.config-panel > summary small { font-size: 12px; }
#config-form { padding: 22px; animation: content-in .25s var(--ease); }
.config-head label, #config-status { font-size: 13px; }
#config-status.pending { color: var(--warning); }
#config-status.applied { color: var(--success); }
.config-table-wrap { border-radius: 10px; }
.config-table th { padding-block: 11px; background: var(--surface-soft); font-size: 12px; }
.config-table td { border-top-color: var(--line); }
.config-table td:first-child { font-weight: 550; color: var(--muted); }
.config-table input[type=text], .config-table input[type=number] { border-color: var(--input-border); border-radius: 8px; background: var(--input); }
.config-table input[type=checkbox] { width: 17px; height: 17px; }
.performance-grid { border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.performance-card { padding: 14px 22px; display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 16px; }
.metric-label { font-size: 12px; }
.performance-card > strong { grid-column: 2; grid-row: 1 / 3; margin: 0; font-size: 26px; line-height: 1.2; font-weight: 550; letter-spacing: -.8px; white-space: nowrap; }
.performance-card > strong small { font-size: 12px; margin-left: 5px; }
.performance-card > small { font-size: 11px; color: var(--subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.exploration { overflow: clip; }
.exploration-toolbar { flex-wrap: wrap; gap: 16px 20px; padding: 20px 24px; }
.view-tabs { position: relative; gap: 2px; border-radius: 11px; background: var(--surface-soft); isolation: isolate; }
.tab-indicator { position: absolute; z-index: -1; top: 4px; left: 0; height: calc(100% - 8px); border-radius: 8px; background: var(--surface); box-shadow: 0 1px 5px #20335413; transition: width .3s var(--ease), transform .3s var(--ease); pointer-events: none; }
[data-theme="dark"] .tab-indicator { background: #31415c; box-shadow: 0 1px 5px #00000022; }
.view-tabs button { position: relative; min-width: 76px; min-height: 39px; padding: 8px 14px; font-size: 14px; border-radius: 8px; white-space: nowrap; }
.view-tabs button:hover { color: var(--ink); }
.view-tabs button[aria-pressed=true] { color: var(--accent); background: transparent; box-shadow: none; }
.view-tabs:not(:has(.tab-indicator)) button[aria-pressed=true] { background: var(--surface); box-shadow: 0 1px 5px #20335413; }
.date-controls { gap: 7px; margin: 0; }
.date-selector { padding: 8px 12px; border-radius: 9px; font-size: 15px; letter-spacing: -.2px; }
.date-selector:hover { background: var(--surface-hover); }
.date-selector:focus-within { outline-color: var(--accent); }
.year-selector { min-width: 100px; font-size: 15px; }
.period-latest { min-height: 34px; padding: 6px 10px; margin-left: 3px; border-radius: 8px; font-size: 12px; font-weight: 500; color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.period-latest:hover:enabled { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.zone-control select { min-width: 170px; max-width: 220px; min-height: 39px; color: var(--muted); background-color: var(--surface); font-size: 12px; border-color: transparent; }
.zone-control select:hover { border-color: var(--input-border); }
.icon-button { min-width: 34px; height: 34px; font-size: 21px; border-radius: 8px; }
.icon-button svg { width: 18px; height: 18px; }
.analysis-layout { grid-template-columns: 420px minmax(0,1fr); }
.channel-overview { container-type: inline-size; }
.analysis-layout > .chart-column { border-left: 0; }
.channel-overview { padding: 26px 0 18px; }
.channel-table-heading { padding: 0 22px 19px; min-height: 52px; }
.channel-table-heading h2 { font-size: 16px; letter-spacing: -.25px; }
.channel-values table { font-size: 13px; }
.channel-values th { padding: 10px 6px; font-size: 11px; }
.channel-values td { padding: 13px 6px; border-bottom-color: var(--line); transition: background-color .16s ease, opacity .16s ease; }
.channel-values th:first-child, .channel-values td:first-child { padding-left: 22px; }
.channel-values th:last-child, .channel-values td:last-child { padding-right: 12px; }
.channel-values tbody tr:not(.role-heading):hover { background: var(--surface-soft); }
.channel-values tbody tr:last-child td { border-bottom: 0; }
.channel-values .role-heading td { padding-block: 11px; background: var(--surface-soft); font-size: 11px; letter-spacing: .1px; color: var(--muted); }
.channel-name { gap: 8px; line-height: 1.4; }
.channel-dot { width: 7px; height: 7px; box-shadow: 0 0 0 3px color-mix(in srgb,var(--series) 8%,transparent); }
.channel-values small { font-size: 11px; }
.channel-values .muted-row { color: var(--subtle); }
.eye-button { width: 26px; height: 30px; padding: 4px; color: var(--subtle); border-radius: 7px; }
.eye-button svg { width: 17px; height: 17px; }
.chart-column { padding: 26px 28px 28px; }
.chart-heading { margin-bottom: 25px; }
.signal-controls select { font-size: 13px; min-height: 39px; }
.chart-heading-right { gap: 10px; }
.chart-heading-right .button { min-height: 39px; font-size: 12px; }
.resolution-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; font-size: 11px; background: var(--surface-soft); }
.chart-range { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.workspace-caption { color: var(--muted); font-size: 11px; letter-spacing: 1px; font-weight: 550; text-transform: uppercase; }
.chart-wrap { height: clamp(380px,28vw,510px); }
.chart-reveal { animation: chart-in .4s cubic-bezier(.2,.7,.2,1) both; }
.loading, .empty-chart { color: var(--muted); background: var(--overlay); font-size: 14px; border-radius: 9px; backdrop-filter: blur(2px); }
.loading span { width: 19px; height: 19px; border-color: var(--line); border-top-color: var(--accent); }
.tooltip-row i { width: 7px; height: 7px; }
.chart-tooltip, .distribution-tooltip { padding: 17px 18px; border-color: var(--line); border-radius: 13px; background: var(--tooltip); box-shadow: var(--shadow-float); color: var(--muted); font-size: 12px; backdrop-filter: blur(14px); }
.chart-tooltip { min-width: 280px; max-width: min(390px,100%); }
.chart-tooltip > strong { font-size: 14px; font-weight: 550; margin-bottom: 5px; }
.chart-tooltip > span { font-size: 11px; margin-bottom: 14px; }
.tooltip-row { margin-top: 8px; }
.tooltip-row b { color: var(--ink); }
.tooltip-row small { padding-left: 15px; font-size: 11px; }
.chart-insights { grid-template-columns: minmax(0,1fr) minmax(0,1.1fr); margin-top: 26px; padding-top: 26px; }
.chart-insights h3 { font-size: 14px; }
.insight-heading { margin-bottom: 20px; }
.peak-panel select { max-width: 200px; min-height: 34px; font-size: 12px; padding-block: 5px; }
#peak-values { gap: 16px; }
.peak-value { font-size: 12px; }
.peak-value > strong { font-size: 23px; font-weight: 550; letter-spacing: -.6px; }
.peak-value time, .peak-value small { font-size: 11px; }
.distribution-tooltip > strong { font-size: 14px; color: var(--ink); }
.distribution h3 { margin-bottom: 18px; }
.donut-wrap { gap: 22px; }
.donut { width: 142px; }
.donut .donut-value { font-size: 18px; }
.donut [data-donut-channel] { transition: opacity .15s ease, stroke-width .2s var(--ease); }
.donut [data-donut-channel]:hover { stroke-width: 21; }
.donut-key { gap: 3px; font-size: 11px; }
.donut-key button { color: var(--muted); border-radius: 4px; }
.donut-key button:hover { color: var(--ink); }
.panel-note { font-size: 13px; }

.exploration.is-focused { position: fixed; z-index: 50; inset: 16px; overflow: auto; overscroll-behavior: contain; box-shadow: 0 0 0 24px var(--canvas),var(--shadow-float); border-radius: 17px; animation: focus-in .25s var(--ease); }
body.chart-focused { overflow: hidden; }
.exploration.is-focused .exploration-toolbar { position: sticky; top: 0; z-index: 12; background: var(--surface); }
.exploration.is-focused .analysis-layout { display: grid; grid-template-columns: minmax(0,1fr); }
.exploration.is-focused .channel-overview { display: none; }
.exploration.is-focused .channel-resizer { display: none; }
.exploration.is-focused .chart-column { border-left: 0; }
.exploration.is-focused .chart-wrap { height: clamp(320px,calc(100dvh - 410px),760px); }
.exploration.is-focused .chart-insights { grid-template-columns: repeat(2,minmax(0,1fr)); }
.exploration.is-focused #focus-chart { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
@keyframes live-pulse { 0%,100% { box-shadow: 0 0 0 4px color-mix(in srgb,var(--success) 10%,transparent); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb,var(--success) 4%,transparent); } }
@keyframes content-in { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes chart-in { from { opacity: .25; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes focus-in { from { opacity: .8; transform: scale(.99); } to { opacity: 1; transform: scale(1); } }
@media (max-width: 1650px) {
  .topbar-inner { padding-inline: 26px; }
  main { padding: 22px 26px 34px; }
  .exploration-toolbar { gap: 14px; padding: 18px 20px; }
  .view-tabs button { min-width: 65px; padding-inline: 11px; }
  .zone-control select { min-width: 145px; max-width: 180px; }
  .date-controls { gap: 3px; }
  .date-selector { font-size: 14px; padding-inline: 9px; }
  .chart-column { padding: 24px; }
  .chart-heading-right { flex-basis: 100%; justify-content: flex-end; }
  .performance-card { padding: 14px 18px; }
  .performance-card > strong { font-size: 23px; }
  .chart-insights { grid-template-columns: 1fr; }
  .distribution-wrap { border-left: 0; border-top: 1px solid var(--line); padding: 22px 0 0; }
  .donut-wrap { max-width: 520px; }
}
@media (max-width: 1250px) {
  .topbar-inner { min-height: 72px; gap: 22px; }
  .channel-resizer { display: none; }
  .network-panel { gap: 16px; }
  .network-heading { padding-right: 0; border-right: 0; }
  .network-controls { gap: 12px; }
  .network-controls > label { min-width: 130px; }
  .network-controls .button { font-size: 12px; padding-inline: 11px; }
  .analysis-layout { display: flex; flex-direction: column; }
  .chart-column { order: -1; width: 100%; border-left: 0; padding: 25px; }
  .channel-overview { width: 100%; border-top: 1px solid var(--line); padding-top: 24px; }
  .channel-values th, .channel-values td { padding-inline: 14px; }
  .channel-values th:first-child, .channel-values td:first-child { padding-left: 25px; }
  .channel-table-heading { padding-inline: 25px; }
  .chart-heading-right { flex-basis: auto; }
  .chart-insights { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .distribution-wrap { border-top: 0; border-left: 1px solid var(--line); padding: 0 0 0 24px; }
  .performance-card { display: block; padding: 14px 18px; }
  .performance-card > strong { margin: 4px 0; }
  .exploration-toolbar { gap: 12px; }
  .date-controls { order: 3; width: 100%; padding-top: 12px; border-top: 1px solid var(--line); }
  .view-tabs button { min-width: 76px; }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 10px; }
  .topbar-inner { min-height: 66px; padding-inline: 18px; gap: 16px; }
  .brand { font-size: 25px; }
  .topbar h1 { font-size: 14px; padding-left: 16px; }
  .header-actions { gap: 16px; }
  .live-indicator span { display: none; }
  #theme-toggle { width: 35px; height: 35px; }
  main { padding: 16px 14px 24px; }
  .panel { border-radius: 13px; }
  .network-panel { padding: 17px; gap: 15px; }
  .network-controls { display: grid; grid-template-columns: 1fr 1fr; width: 100%; flex-basis: 100%; gap: 12px; }
  .network-controls > label { min-width: 0; }
  .network-controls .button { align-self: end; font-size: 12px; }
  .config-panel > summary { padding-inline: 17px; }
  .config-panel > summary small { display: none; }
  #config-form { padding: 17px; }
  .config-head { align-items: stretch; flex-direction: column; gap: 12px; }
  #config-status { text-align: left; }
  .config-actions { flex-direction: column-reverse; }
  .config-actions .button { width: 100%; }
  .performance-grid { grid-template-columns: repeat(2,minmax(0,1fr)); margin-bottom: 18px; }
  .performance-card { padding: 13px 17px; }
  .performance-card .metric-label { min-height: auto; }
  .performance-card:nth-child(3) { border-left: 0; }
  .performance-card:nth-child(n+3) { border-top: 1px solid var(--line); }
  .performance-card > strong { font-size: 24px; margin: 4px 0; }
  .performance-card > small { font-size: 10px; }
  .exploration-toolbar { padding: 14px; gap: 12px; }
  .view-tabs { width: 100%; justify-content: space-between; }
  .view-tabs button { flex: 1; min-width: 0; padding-inline: 8px; font-size: 12px; }
  .zone-control { width: 100%; order: 3; display: flex; justify-content: center; }
  .zone-control select { width: auto; max-width: 100%; min-height: 32px; text-align: center; }
  .date-controls { order: 2; gap: 2px; padding-top: 2px; border-top: 0; margin-bottom: 0; }
  .date-selector { font-size: 13px; padding-inline: 6px; }
  .period-latest { margin-left: 4px; font-size: 11px; padding-inline: 8px; }
  .date-controls .icon-button { min-width: 28px; padding-inline: 5px; }
  .chart-column { padding: 20px 14px; }
  .chart-heading { gap: 13px; margin-bottom: 19px; }
  .signal-controls { gap: 10px; }
  .signal-controls label { flex: 1; min-width: 0; }
  .signal-controls select { font-size: 12px; min-height: 38px; }
  .chart-heading-right { flex-basis: 100%; width: 100%; justify-content: flex-end; gap: 8px; }
  .chart-heading-right .button { padding-inline: 11px; }
  .resolution-badge { margin-right: auto; font-size: 10px; padding-inline: 7px; white-space: normal; }
  .chart-wrap { height: 350px; }
  .chart-insights { grid-template-columns: 1fr; gap: 22px; margin-top: 23px; padding-top: 23px; }
  .distribution-wrap { border-left: 0; border-top: 1px solid var(--line); padding: 22px 0 0; }
  .channel-values table { min-width: 520px; }
  .channel-values th, .channel-values td { padding-inline: 8px; }
  .channel-values th:first-child, .channel-values td:first-child { padding-left: 17px; }
  .channel-table-heading { padding-inline: 17px; }
  .chart-tooltip { min-width: 250px; padding: 14px; }
  .exploration.is-focused { inset: 6px; border-radius: 12px; }
  .exploration.is-focused .chart-wrap { height: max(340px,calc(100dvh - 390px)); }
  .exploration.is-focused .chart-insights { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .topbar h1 { display: none; }
  .performance-card { padding: 12px; }
  .metric-label { font-size: 11px; }
  .performance-card > strong { font-size: 22px; }
  .signal-controls { width: 100%; }
  .chart-heading-right .button { padding-inline: 9px; }
  .date-selector { font-size: 12px; }
  .period-latest { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Keep the dense instrument view readable at normal laptop scale. */
.zone-control { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.zone-control > svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--muted); }
.zone-control select { font-size: 13px; padding-left: 5px; }
.network-controls > label, .signal-controls label, .metric-label,
.config-panel > summary small, .config-table th, .channel-values th,
.channel-values .role-heading td, .channel-values small,
.performance-card > small, .performance-card > strong small { font-size: 13px; }
.network-toggle, .config-panel > summary, .view-tabs button { font-size: 15px; }
.text-button, .channel-values table, .signal-controls select,
.chart-heading-right .button, .donut-key,
.chart-tooltip, .distribution-tooltip, .chart-insights h3 { font-size: 14px; }
.channel-table-heading h2 { font-size: 18px; }
.chart-heading-right { flex-basis: auto; }
.period-latest, .resolution-badge,
.peak-panel select, .peak-value, .peak-value time, .peak-value small,
.chart-tooltip > span, .tooltip-row small { font-size: 13px; }
.date-selector { font-size: 16px; }
.chart-tooltip > strong, .distribution-tooltip > strong { font-size: 15px; }
.performance-card > small { max-width: 100%; }
.view-tabs:not(.has-indicator) button[aria-pressed=true] { background: var(--surface); }
.exploration-toolbar { position: sticky; top: 0; z-index: 15; background: var(--surface); }
.peak-panel { padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.peak-panel .insight-heading { margin-bottom: 22px; }
.chart-tooltip { transition: opacity .12s ease; }
.focus-exit { display: none; }
.is-focused .focus-exit { display: inline-flex; order: 4; border: 1px solid var(--line); }
@media (max-width: 760px) {
  .is-focused .zone-control { width: auto; flex: 1; }
}
@media (max-width: 1500px) {
  .performance-card { display: block; }
  .performance-card > strong { margin: 3px 0; }
}
@media (max-width: 1000px) {
  .chart-heading-right { flex-basis: 100%; }
}
@media (max-width: 760px) {
  .network-controls > label, .signal-controls label, .performance-card > small,
  .period-latest, .resolution-badge,
  .chart-heading-right .button, .signal-controls select,
  .donut-key, .date-selector { font-size: 13px; }
  .network-controls select, .view-tabs button { font-size: 14px; }
  .chart-heading-right { justify-content: space-between; }
  .zone-control { width: 100%; }
  .performance-card { min-height: 102px; }
  .network-controls .button { font-size: 13px; }
}

select, select:disabled {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%238291a7' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
}
details.network-panel { display: block; padding: 0; }
.chart-tooltip, .distribution-tooltip {
  position: fixed;
  z-index: 80;
  right: auto;
  bottom: auto;
  width: max-content;
  min-width: min(280px,calc(100vw - 24px));
  max-width: min(390px,calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: hidden;
}
.chart-tooltip {
  min-width: min(240px,calc(100vw - 24px));
  padding: 10px 12px;
}
.chart-tooltip > strong {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
}
.chart-tooltip .tooltip-row {
  gap: 6px;
  margin-top: 2px;
  line-height: 1.25;
}
.chart-tooltip .tooltip-row small {
  padding-left: 13px;
  font-size: 11px;
  line-height: 1.15;
}
.network-body { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; padding: 20px 22px; border-top: 1px solid var(--line); }
.channel-values .subchannel-row td { padding-top: 7px; padding-bottom: 7px; font-size: 13px; color: var(--muted); }
.channel-values .subchannel-row td:first-child { padding-left: 40px; }
.subchannel-row .channel-dot { width: 6px; height: 6px; box-shadow: none; opacity: .75; }
.subchannel-row .eye-button { height: 26px; opacity: .7; }
.subchannel-row.muted-row td { color: var(--subtle); }
.channel-values th { white-space: nowrap; padding-block: 8px; }
.channel-values td, .channel-values .subchannel-row td, .channel-values .role-heading td {
  height: 38px;
  padding-top: 4px;
  padding-bottom: 4px;
  line-height: 14px;
}
.channel-values .channel-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 26px; }
.channel-values .channel-name .channel-dot { vertical-align: middle; margin-right: 8px; }
.channel-values .eye-button, .subchannel-row .eye-button { height: 26px; }
.channel-values td:not(:first-child) { white-space: nowrap; }
main { display: flex; flex-direction: column; gap: 16px; }
main > .panel, main > .performance-grid, main > .notice { margin: 0; }
.section-nav { display: inline-flex; align-self: flex-start; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.section-nav button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 40px; padding: 8px 17px; border-radius: 8px; background: transparent; color: var(--muted); font-size: 15px; font-weight: 550; }
.section-nav button:hover { background: var(--surface-soft); color: var(--ink); }
.section-nav button[aria-selected=true] { background: var(--accent-soft); color: var(--accent); }
.section-nav svg { width: 18px; height: 18px; }
.page-view { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.page-view > .panel, .page-view > .performance-grid { margin: 0; }
.page-view:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 12px; }
@media (min-width: 1251px) {
  @container (max-width: 399px) {
    .channel-values th:not(:first-child), .channel-values td:not(:first-child) { padding-inline: 4px; }
    .channel-values th:last-child, .channel-values td:last-child { padding-inline: 2px; }
    .channel-values .eye-button { padding-inline: 2px; }
  }
}
.topbar h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .brand, .header-actions { flex-shrink: 0; }
.header-actions .zone-control { width: auto; order: 0; }
.header-actions .zone-control select { width: auto; text-align: left; }
@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; padding-block: 14px; row-gap: 12px; }
  .topbar h1 { display: block; flex: 1; }
  .header-actions { width: 100%; gap: 14px; }
  .header-actions .zone-control { justify-content: flex-start; }
  .header-actions .zone-control select { min-height: 35px; }
  .header-actions .live-indicator { font-size: 13px; }
  .header-actions .live-indicator span { display: inline; }
}
@media (max-width: 520px) {
  .header-actions { flex-wrap: wrap; }
  .header-actions .zone-control { flex: 1; }
  .header-actions .live-indicator { order: 2; width: 100%; justify-content: flex-end; }
}
@media (max-width: 760px) {
  .network-body { padding: 17px; gap: 15px; }
}
.topbar-inner { gap: 24px; }
.header-identity { display: flex; align-items: center; gap: 28px; min-width: 0; flex: 0 1 auto; }
.header-identity h1 { max-width: clamp(130px,15vw,260px); }
.header-navigation { display: flex; align-items: center; justify-content: center; min-width: 240px; flex: 1; }
.header-navigation .section-nav { flex-shrink: 0; align-self: center; gap: 4px; margin: 0; padding: 3px; border-radius: 10px; }
.header-navigation .section-nav button { min-height: 36px; padding: 7px 13px; font-size: 14px; }
.header-navigation .section-nav svg { width: 16px; height: 16px; }
.header-actions { margin-left: 0; }
main { padding-top: 8px; gap: 12px; }
body:not(.parcours) main:has(> .settings-view:not([hidden])) { padding-top: 16px; }
.transfer-summary { display: flex; min-width: 0; overflow-x: auto; color: var(--muted); font-size: 12px; line-height: 18px; font-variant-numeric: tabular-nums; }
.transfer-summary-content { display: flex; align-items: baseline; flex: none; gap: 8px; margin-left: auto; white-space: nowrap; }
.transfer-summary small { margin-left: 3px; font: inherit; }
@media (max-width: 1200px) {
  .topbar-inner { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px 24px; padding-block: 12px; }
  .header-identity { grid-column: 1 / -1; }
  .header-identity h1 { max-width: 60vw; }
  .header-navigation { grid-column: 1; grid-row: 2; }
  .header-actions { grid-column: 2; grid-row: 2; width: auto; gap: 16px; }
}
@media (max-width: 820px) {
  .topbar-inner { grid-template-columns: minmax(0,1fr); }
  .header-identity { gap: 16px; }
  .header-identity h1 { max-width: none; }
  .header-navigation { grid-column: 1; grid-row: 2; }
  .header-actions { grid-column: 1; grid-row: 3; justify-content: space-between; width: 100%; }
}
@media (max-width: 520px) {
  .transfer-summary { font-size: 11px; }
  .transfer-summary-content { gap: 6px; }
}

/* Shared controls affect both history columns and the chart. */
.multitype .analysis-measure-toolbar { padding: 16px 22px; margin: 0; border-bottom: 1px solid var(--line); align-items: center; }
.multitype .channel-table-heading { padding-bottom: 10px; }
.multitype .channel-values .electrical-table th:first-child,
.multitype .channel-values .electrical-table td:first-child { width: auto; }
.multitype .electrical-table th { white-space: nowrap; }
.multitype .electrical-table .role-heading td { height: 40px; padding-block: 4px; }
.multitype .electrical-table .subchannel-row td { padding-block: 5px; }
.multitype .electrical-table .channel-name { overflow-wrap: normal; min-width: 0; }
.multitype .electrical-table .role-heading span { line-height: 1.25; }
.channel-empty { padding: 14px 20px; color: var(--muted); font-size: 13px; }
.multitype .chart-tooltip { max-width: min(420px,calc(100vw - 24px)); }
.multitype .tooltip-row small { grid-column: 2 / -1; text-align: right; color: var(--muted); }
@media (max-width: 620px) {
  .multitype .analysis-measure-toolbar { padding: 14px; gap: 14px; }
  .multitype .analysis-measure-toolbar .chart-heading-right { margin-left: 0; justify-content: space-between; width: 100%; }
  .multitype .analysis-measure-toolbar .signal-controls { width: 100%; flex-wrap: nowrap; }
  .multitype .analysis-measure-toolbar .signal-controls label { min-width: 0; flex: 1; }
}
