/* Chart panel ------------------------------------------------------------- */
#chartWrap { height: clamp(290px, 36vh, 400px); max-height: 46%; flex: none; transition: height .15s; display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 10px; }
#chartWrap.split { height: clamp(370px, 46vh, 520px); max-height: 56%; }
#chartWrap.folded { height: auto; }
#chartWrap.folded .chart-sub, #chartWrap.folded .chart-box { display: none; }
#chartWrap.folded #btnChartFold svg { transform: rotate(180deg); }
.chart-bar { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.chart-bar .check { margin-top: 0; }
.seg { display: inline-flex; padding: 2px; background: var(--surface-2); border-radius: 8px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 4px 11px; border-radius: 6px; font-weight: 550; color: var(--ink-2); font-size: 12.5px; }
.seg input:checked + span { background: var(--raised); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 0 0 1px var(--ring); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 8px; border-radius: 13px;
  border: 1px solid var(--line-2); cursor: pointer; font-size: 12px; font-weight: 550; color: var(--ink-2); user-select: none; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--c); }
.chip:has(input:checked) { border-color: var(--line-2); background: var(--surface-2); color: var(--ink); }
.chip:has(input:checked) i { background: var(--c); }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); }
.chip.dim { opacity: .45; }
.wxctl { display: flex; gap: 6px; }
.wxctl select { width: auto; height: 28px; font-size: 12px; }
.chart-sub { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; min-height: 26px; margin: 8px 0 4px; }
.chart-sub .note:empty { display: none; }
.chart-sub .note { white-space: nowrap; }
.chart-box { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; position: relative; }
.cv { position: relative; flex: 1; min-height: 0; }
.cv > canvas { position: absolute; left: 0; top: 0; }
.cv + .cv { flex: 0.8; border-top: 1px solid var(--line); padding-top: 4px; }
.tableview { position: absolute; inset: 0; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.tableview table { border-collapse: collapse; width: 100%; font-size: 12px; font-variant-numeric: tabular-nums; }
.tableview th, .tableview td { padding: 5px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tableview th:first-child, .tableview td:first-child { text-align: left; }
.tableview th { position: sticky; top: 0; background: var(--surface-2); color: var(--ink-2); font-weight: 600; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; }

/* Series buttons: the first two, plus any that are switched on, until "More series" is pressed */
.chips.less .chip:nth-child(n+3):not(:has(input:checked)) { display: none; }
#btnMoreSeries { font-size: 12px; align-self: center; }
