:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}
.multitype input:disabled{opacity:.7;cursor:default}.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 .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}.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){.measure-domains{padding-inline:14px}}@media(max-width:620px){.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; border-radius: 8px; }
.brand { display: inline-flex; align-items: baseline; gap: 5px; font-size: 28px; font-weight: 750; letter-spacing: -1.4px; }
.brand span { font-weight: 350; }
.live-indicator { margin-left: auto; display: flex; align-items: center; color: var(--muted); font-size: 14px; }
.live-indicator i { border-radius: 50%; box-shadow: 0 0 0 4px #c68f381c; }
.live-indicator.online i { box-shadow: 0 0 0 4px #2f806c1c; }
main { margin: auto; }
.panel { background: var(--surface); border: 1px solid var(--line); }
select { min-height: 42px; padding: 8px 30px 8px 12px; border: 1px solid #dce3ec; background: #fff; max-width: 100%; }
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; white-space: nowrap; }
.text-button { font-weight: 550; color: var(--accent); padding: 8px 0; }
.text-button:hover { text-decoration: underline; }
.signal-controls label { display: flex; flex-direction: column; color: var(--muted); }
.signal-controls select { color: var(--ink); width: 100%; }
.notice { border: 1px solid #d8e4f1; padding: 14px 18px; margin-bottom: 18px; }
.notice.error { background: #fff3f0; }
.config-panel > summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.config-panel > summary::-webkit-details-marker { display: none; }
.config-panel > summary::before { content: '›'; line-height: 1; }
.config-panel[open] > summary::before { transform: rotate(90deg); }
.config-panel > summary small { margin-left: auto; color: var(--muted); font-weight: 450; }
#config-form { border-top: 1px solid var(--line); }
.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); }
#config-status { color: var(--muted); text-align: right; }
.config-table-wrap { overflow-x: auto; border: 1px solid var(--line); }
.config-table { width: 100%; border-collapse: collapse; min-width: 880px; font-size: 14px; }
.config-table th { padding: 10px 12px; color: var(--muted); text-align: left; font-weight: 500; }
.config-table td { padding: 8px 12px; border-top: 1px solid #eef2f6; }
.config-table td:first-child { width: 110px; }
.config-table input[type=text], .config-table input[type=number] { width: 100%; min-height: 40px; border: 1px solid #dce3ec; padding: 7px 10px; }
.config-table input[type=checkbox] { 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; }

.exploration-toolbar { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.view-tabs { display: inline-flex; padding: 4px; }
.view-tabs button { font-weight: 550; color: var(--muted); }
.analysis-layout { display: grid; grid-template-columns: minmax(480px, 29%) minmax(0,1fr); align-items: start; }
.channel-overview { min-width: 0; }
.channel-table-heading { display: flex; align-items: center; justify-content: space-between; }
.channel-table-heading h2 { font-weight: 600; }
.channel-values { overflow-x: auto; }
.channel-values table { border-collapse: collapse; width: 100%; table-layout: fixed; font-variant-numeric: tabular-nums; }
.channel-values th { color: var(--muted); text-align: right; font-weight: 500; border-bottom: 1px solid var(--line); line-height: 1.4; }
.channel-values td { text-align: right; border-bottom: 1px solid #f0f3f7; vertical-align: middle; }
.channel-values th:first-child, .channel-values td:first-child { text-align: left; }
.channel-values .role-heading td { font-weight: 600; border: 0; }
.channel-name { display: flex; align-items: center; }
.channel-dot { display: inline-block; flex-shrink: 0; border-radius: 50%; background: var(--series); }
.channel-values small { color: var(--muted); }
.muted-row .channel-dot { opacity: .35; }
.eye-button { display: inline-flex; align-items: center; justify-content: center; }
.eye-button:hover { color: var(--accent); background: var(--accent-soft); }

/* The chart and its supporting insights form one continuous workspace. */
.chart-column { min-width: 0; border-left: 1px solid var(--line); }
.date-controls { display: flex; justify-content: center; align-items: center; margin-bottom: 24px; }
.date-selector { position: relative; font-weight: 550; text-align: center; min-height: 42px; }
.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 { font-weight: 550; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; padding: 4px 8px; color: var(--muted); }
.icon-button:hover:enabled { background: var(--accent-soft); color: var(--accent); }
.signal-controls { display: flex; gap: 12px; flex-wrap: wrap; }
.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; text-align: center; padding: 24px; }
.loading span { border: 2px solid #dce5ef; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tooltip-row i { border-radius: 50%; background: var(--series); flex-shrink: 0; }
.chart-tooltip, .distribution-tooltip { border: 1px solid #dce4ee; pointer-events: none; }
.chart-tooltip { max-width: min(380px, 100%); }
.chart-tooltip > strong { display: block; color: var(--ink); }
.chart-tooltip > span { display: block; color: var(--muted); }
.tooltip-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.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); }
.peak-value { display: flex; flex-direction: column; gap: 5px; }
.peak-value > span { color: var(--muted); }
.peak-value > strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.peak-value time, .peak-value small { color: var(--muted); }
.distribution-wrap { position: relative; min-width: 0; border-left: 1px solid var(--line); padding-left: 24px; }
.distribution-tooltip { left: 0; }
.distribution-tooltip .peak-value { margin-top: 14px; }
.donut-wrap { display: flex; align-items: center; }
.donut { flex-shrink: 0; }
.donut text { fill: var(--muted); font: 10px -apple-system, sans-serif; text-anchor: middle; }
.donut .donut-value { 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; }
.donut-key button { display: flex; align-items: center; gap: 7px; text-align: left; padding: 4px 0; font: inherit; cursor: help; }
.donut-key button b { margin-left: auto; font-weight: 500; white-space: nowrap; color: var(--ink); }

@media (max-width: 1500px) {
  .analysis-layout { grid-template-columns: 470px minmax(0,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) {
  .analysis-layout { display: flex; flex-direction: column; }
  .chart-column { order: -1; width: 100%; border-left: 0; }
  .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; }
  .distribution-wrap { border-top: 0; border-left: 1px solid var(--line); padding: 0 0 0 24px; }
}
@media (max-width: 760px) {
  .view-tabs { overflow-x: auto; }
  .signal-controls { width: 100%; }
}
@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 { 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); }
.brand { color: var(--ink); }
.brand span { color: var(--muted); }
.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 { padding-block: 7px; }
.text-button:hover { text-underline-offset: 4px; }
.signal-controls label { gap: 5px; font-weight: 500; }
.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-weight: 550; }
.config-panel > summary::before { color: var(--muted); font-size: 22px; transition: transform .2s ease; }
#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); }
.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; }

.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; 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; 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-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; }
.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 { letter-spacing: -.25px; }
.channel-values th { padding: 10px 6px; }
.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); 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 .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; }
.signal-controls select { min-height: 39px; }
.chart-wrap { height: clamp(380px,28vw,510px); }
.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); backdrop-filter: blur(14px); }
.chart-tooltip { min-width: 280px; max-width: min(390px,100%); }
.chart-tooltip > strong { font-weight: 550; margin-bottom: 5px; }
.chart-tooltip > span { margin-bottom: 14px; }
.tooltip-row { margin-top: 8px; }
.tooltip-row b { color: var(--ink); }
.tooltip-row small { padding-left: 15px; }
.peak-value > strong { font-size: 23px; font-weight: 550; letter-spacing: -.6px; }
.distribution-tooltip > strong { 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; }
.donut-key button { color: var(--muted); border-radius: 4px; }
.donut-key button:hover { color: var(--ink); }

@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); } }
@media (max-width: 1650px) {
  main { padding: 22px 26px 34px; }
  .exploration-toolbar { gap: 14px; padding: 18px 20px; }
  .view-tabs button { min-width: 65px; padding-inline: 11px; }
  .date-controls { gap: 3px; }
  .date-selector { padding-inline: 9px; }
  .chart-column { padding: 24px; }
  .distribution-wrap { border-left: 0; border-top: 1px solid var(--line); padding: 22px 0 0; }
  .donut-wrap { max-width: 520px; }
}
@media (max-width: 1250px) {
  .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; }
  .distribution-wrap { border-top: 0; border-left: 1px solid var(--line); padding: 0 0 0 24px; }
  .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; }
  .brand { font-size: 25px; }
  .live-indicator span { display: none; }
  #theme-toggle { width: 35px; height: 35px; }
  main { padding: 16px 14px 24px; }
  .panel { border-radius: 13px; }
  .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%; }
  .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; }
  .date-controls { order: 2; gap: 2px; padding-top: 2px; border-top: 0; margin-bottom: 0; }
  .date-selector { padding-inline: 6px; }
  .period-latest { margin-left: 4px; padding-inline: 8px; }
  .date-controls .icon-button { min-width: 28px; padding-inline: 5px; }
  .chart-column { padding: 20px 14px; }
  .signal-controls { gap: 10px; }
  .signal-controls label { flex: 1; min-width: 0; }
  .signal-controls select { min-height: 38px; }
  .chart-wrap { height: 350px; }
  .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; }
}
@media (max-width: 400px) {
  .signal-controls { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.signal-controls label, .config-panel > summary small, .config-table th, .channel-values th, .channel-values .role-heading td, .channel-values small { font-size: 13px; }
.config-panel > summary, .view-tabs button { font-size: 15px; }
.text-button, .channel-values table, .signal-controls select, .donut-key, .chart-tooltip, .distribution-tooltip { font-size: 14px; }
.channel-table-heading h2 { font-size: 18px; }
.period-latest, .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; }
.view-tabs:not(.has-indicator) button[aria-pressed=true] { background: var(--surface); }
.exploration-toolbar { position: sticky; top: 0; z-index: 15; background: var(--surface); }
.chart-tooltip { transition: opacity .12s ease; }
@media (max-width: 760px) {
.signal-controls label, .period-latest, .signal-controls select, .donut-key, .date-selector { font-size: 13px; }
.view-tabs button { font-size: 14px; }
}

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;
}
.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;
}
.channel-values .subchannel-row td { 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 { 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; }
main > .panel, main > .notice { margin: 0; }
.page-view { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.page-view > .panel { 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; }
  }
}
main { padding-top: 8px; gap: 12px; }
body:not(.parcours) main:has(> .settings-view:not([hidden])) { padding-top: 16px; }
.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; }
.multitype .chart-tooltip { max-width: min(420px,calc(100vw - 24px)); }
.chart-tooltip.is-pinned, .distribution-tooltip.is-pinned { pointer-events: auto; max-height: min(60dvh,420px); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; transition: none; }
.tooltip-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; background: var(--tooltip); }
.tooltip-header > strong { min-width: 0; margin: 0; color: var(--ink); font-weight: 550; }
.chart-tooltip .tooltip-header > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 1.25; }
.tooltip-close { display: grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font-size: 20px; line-height: 1; }
.tooltip-header > .tooltip-close { width: 44px; height: 44px; }
.chart-tooltip.is-pinned .tooltip-row { display: grid; grid-template-columns: 7px minmax(0,1fr) auto; gap: 2px 6px; }
.chart-tooltip.is-pinned .tooltip-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-tooltip .tooltip-period { width: 100%; margin-top: 8px; }
.multitype .tooltip-row small { grid-column: 2 / -1; text-align: right; color: var(--muted); }
@media(pointer:coarse){.tooltip-close{width:44px;height:44px}.chart-tooltip .tooltip-period{min-height:44px}}
