/* Admin: channel board. Categorical slots (fixed order by selection) and status colours
   follow the validated reference palette; every row is read off one shared ruler. */
:root {
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --status-good: #008300; --status-warn: #eda100; --status-bad: #e34948;
}
@media (prefers-color-scheme: dark) {
  :root { --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --status-good: #3ccf91; --status-warn: #e0a64a; --status-bad: #e66767; }
}
.yk-compare { display: block; }
.yk-compare .toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.yk-input { font: inherit; padding: .45rem .6rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
input.yk-input { min-width: 220px; }
.toolbar .dir { padding: .45rem .6rem; line-height: 1; }
.small { font-size: .78rem; }

/* The zone wash names calm / lively / intense once, in the header. Rows stay neutral so the
   only colour in the list is the dot itself. */
.axis .band {
  background: linear-gradient(to right,
    color-mix(in srgb, var(--status-good) 30%, transparent) 0 var(--amber),
    color-mix(in srgb, var(--status-warn) 32%, transparent) var(--amber) var(--red),
    color-mix(in srgb, var(--status-bad) 32%, transparent) var(--red) 100%);
}

/* board */
.board { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.board-head, .brow-main { display: grid; grid-template-columns: 1.5rem 2rem minmax(11rem, 20rem) 3rem minmax(10rem, 1fr) 4rem 4.6rem; align-items: center; gap: .7rem; padding: .4rem .9rem; }
.board-head { position: sticky; top: 0; z-index: 1; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); background: var(--bg); border-bottom: 1px solid var(--line); padding-block: .5rem; }
.board-head .ctr { text-align: center; }
.board-head .axis { position: relative; height: 2.4rem; }
.axis-label { position: absolute; top: 0; left: 0; }
.axis .band { position: absolute; left: 0; right: 0; top: 1.1rem; height: 6px; border-radius: 3px; }
.axis .tick { position: absolute; bottom: 0; transform: translateX(-50%); font-size: .68rem; letter-spacing: 0; color: var(--ink-3); }
.axis .tick.start { left: 0; transform: none; }
.axis .tick.end { left: auto; right: 0; transform: none; }
.brows { list-style: none; margin: 0; padding: 0; }
.brow { border-bottom: 1px solid var(--line); }
.brow:last-child { border-bottom: 0; }
.brow-main { cursor: pointer; }
.brow-main:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.brow.open .brow-main { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.brow.selected { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.brow.selected.series-1 { box-shadow: inset 4px 0 var(--series-1); }
.brow.selected.series-2 { box-shadow: inset 4px 0 var(--series-2); }
.brow.selected.series-3 { box-shadow: inset 4px 0 var(--series-3); }
.brow.selected.series-4 { box-shadow: inset 4px 0 var(--series-4); }
.rank { font-size: .78rem; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.who { min-width: 0; }
.yk-compare a.name { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; text-decoration: none; }
.yk-compare a.name:hover { color: var(--accent); text-decoration: underline; }
.who .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; gap: 3px; justify-content: center; }
.chip { width: 9px; height: 14px; border-radius: 2px; background: var(--line); }
.chip.good { background: var(--status-good); } .chip.warn { background: var(--status-warn); } .chip.bad { background: var(--status-bad); }
.val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* One ruler, one dot: down the list is the rank, across the rail is the reading. The two
   hairlines are the amber and red thresholds, so they line up as gridlines down the whole board. */
.track { --rail: color-mix(in srgb, var(--ink) 11%, transparent); --gl: color-mix(in srgb, var(--ink) 20%, transparent);
  position: relative; height: 16px;
  background: linear-gradient(var(--gl), var(--gl)) var(--amber) 0 / 1px 100% no-repeat,
    linear-gradient(var(--gl), var(--gl)) var(--red) 0 / 1px 100% no-repeat,
    linear-gradient(var(--rail), var(--rail)) 0 50% / 100% 2px no-repeat; }
.track .dot { position: absolute; top: 50%; width: 11px; height: 11px; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--surface); }
.track.sm { height: 13px; }
.track.sm .dot { width: 9px; height: 9px; }
.dot.good { background: var(--status-good); }
.dot.warn { background: var(--status-warn); }
.dot.bad { background: var(--status-bad); }
.dot.none { background: var(--ink-3); }
.grade { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.grade.g0 { background: var(--line); color: var(--ink-2); }
.grade.g1 { background: color-mix(in srgb, var(--status-good) 18%, transparent); color: var(--status-good); }
.grade.g2 { background: color-mix(in srgb, var(--status-warn) 22%, transparent); color: var(--status-warn); }
.grade.g3 { background: color-mix(in srgb, var(--status-bad) 18%, transparent); color: var(--status-bad); }

/* expanded row: the nine metrics, each on its own zoned ruler */
.bdetail { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: .4rem 1.6rem; padding: .3rem 1rem 1rem 4rem; background: color-mix(in srgb, var(--ink) 3%, transparent); }
.bdetail h4 { margin: .5rem 0 .35rem; font-size: .68rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.dmetric { display: grid; grid-template-columns: 8.5rem 1fr 4rem; gap: .6rem; align-items: center; font-size: .82rem; padding: .12rem 0; }
.dlabel { color: var(--ink-2); }
.dval { text-align: right; font-variant-numeric: tabular-nums; }

/* comparison panel */
.compare { margin-bottom: 1.2rem; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-bottom: .8rem; font-size: .9rem; }
.legend-item { display: inline-flex; align-items: center; gap: .4rem; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.swatch.series-1 { background: var(--series-1); } .swatch.series-2 { background: var(--series-2); } .swatch.series-3 { background: var(--series-3); } .swatch.series-4 { background: var(--series-4); }
.legend .x { border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 0 .2rem; font-size: 1rem; }
.cmp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.cmp-group { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; }
.cmp-group h3 { margin: 0 0 .6rem; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.cmp-metric { margin-bottom: .8rem; }
.cmp-label { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: .25rem; }
.cmp-bars { position: relative; display: grid; gap: 2px; --gl: color-mix(in srgb, var(--ink) 22%, transparent);
  background: linear-gradient(var(--gl), var(--gl)) var(--amber) 0 / 1px 100% no-repeat,
    linear-gradient(var(--gl), var(--gl)) var(--red) 0 / 1px 100% no-repeat; }
.cmp-row { display: grid; grid-template-columns: 1fr 52px; align-items: center; gap: .4rem; height: 12px; }
.cmp-row .bar-fill { height: 10px; border-radius: 0 3px 3px 0; }
.bar-fill { height: 100%; background: var(--accent); }
.bar-fill.series-1 { background: var(--series-1); } .bar-fill.series-2 { background: var(--series-2); }
.bar-fill.series-3 { background: var(--series-3); } .bar-fill.series-4 { background: var(--series-4); }
.cmp-val { font-size: .78rem; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
