:root {
  /* Chart colours: the validated 8-slot categorical palette, in its fixed order. */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --s-other: #b4b2a9;
  --grid: #e1e0d9;
  --axis: #898781;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --text: #1d2330;
  --muted: #667085;
  --line: #e2e5ea;
  --accent: #317a4b;
  --accent-text: #ffffff;
  --hover: #f0f4f1;
  --danger: #b42318;
  --manual: #d97706;
  --deleted: #98a2b3;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b;
    --panel: #1a1f27;
    --text: #e6e8ec;
    --muted: #98a2b3;
    --line: #2c333e;
    --accent: #4fa36c;
    --hover: #222a33;
    --danger: #f97066;
    --manual: #fbbf24;
    --deleted: #5d6675;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --s-other: #5d5c57;
    --grid: #2c2c2a;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1.2em; margin: 4px 0; }
h1 { font-size: 18px; margin: 0; }
h2 { font-size: 16px; margin: 16px 0 8px; }

button, select, input {
  font: inherit;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 10px;
}
button { cursor: pointer; }
button:hover { background: var(--hover); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.primary:hover { filter: brightness(1.08); }
button.ghost { background: transparent; }
button.danger { color: var(--danger); }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* sign in */
.login { display: flex; align-items: center; justify-content: center; min-height: 100%; padding: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
.login-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px; }
.login-card label, .dialog label { display: flex; flex-direction: column; gap: 4px; }

/* layout */
#app-view { display: flex; flex-direction: column; height: 100%; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.stats { display: flex; gap: 14px; color: var(--muted); font-size: 13px; flex-wrap: wrap; flex: 1; }
#user-wrap, #signin-button { margin-left: auto; }
.stats b { color: var(--text); font-weight: 600; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; }
.toolbar label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.toolbar label.check, label.check { flex-direction: row; gap: 6px; }
#search { flex: 1 1 260px; min-width: 200px; }
.spacer { flex: 1; }

.menu-wrap { position: relative; }
.menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 6px 24px rgb(0 0 0 / 0.15); padding: 4px; min-width: 200px; display: flex; flex-direction: column; }
.menu-right { left: auto; right: 0; }
.menu button { border: 0; text-align: left; background: transparent; padding: 7px 10px; }
.menu button:hover { background: var(--hover); }
.menu.columns { max-height: 60vh; overflow: auto; padding: 8px 12px; gap: 4px; }
.menu.columns label { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.topbar .menu-wrap .menu { left: auto; right: 0; }

/* views and tabs */
.view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.tabs { display: flex; gap: 4px; }
.tabs button { border-color: transparent; background: transparent; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--hover); border-color: var(--line); color: var(--text); font-weight: 600; }
/* The second row of tabs under Survey and Requests. */
.subtabs { padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.subtabs button { font-size: 13px; }
#dashboard-view[data-mode="db"] .only-main, #dashboard-view[data-mode="main"] .only-db { display: none; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.info { margin: 0 16px 8px; color: var(--muted); font-size: 13px; }
.radio { display: flex; flex-direction: row !important; gap: 8px; align-items: flex-start; }
.radio input { margin-top: 3px; }
.status { color: var(--muted); min-height: 1.2em; margin: 0; }

/* table */
.table-wrap { flex: 1; overflow: auto; margin: 0 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: max-content; min-width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 6px 10px; text-align: left; white-space: nowrap; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.grid thead th { position: sticky; top: 0; background: var(--panel); z-index: 5; font-weight: 600; cursor: default; user-select: none; box-shadow: inset 0 -1px var(--line); }
.grid thead th.actions-col { cursor: default; }
.grid thead th .arrow { color: var(--muted); margin-left: 4px; }
.grid tbody tr:hover { background: var(--hover); }
.grid td.editable { cursor: text; }
.grid td.manual::after { content: " ●"; color: var(--manual); font-size: 10px; }
.grid td.code { font-family: ui-monospace, Consolas, monospace; }
.grid tr.deleted td { color: var(--deleted); }
.grid tr.deleted td.code { text-decoration: line-through; }
.grid .num-col { position: sticky; left: 0; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums;
  background: var(--panel); box-shadow: inset -1px 0 var(--line); cursor: default; }
.grid thead th.num-col { z-index: 6; }
.grid tr:hover td.num-col { background: var(--hover); }
.grid td.actions-col { position: sticky; right: 0; background: var(--panel); box-shadow: inset 1px 0 var(--line); }
.grid tr:hover td.actions-col { background: var(--hover); }
.grid td.actions-col button { padding: 2px 8px; font-size: 12px; margin-left: 4px; }
.grid td.editing { padding: 2px 4px; overflow: visible; }
.grid td.editing input, .grid td.editing select { width: 100%; min-width: 140px; padding: 3px 6px; }
.empty { text-align: center; color: var(--muted); padding: 40px; }

.pager { display: flex; align-items: center; gap: 8px; padding: 8px 16px; color: var(--muted); }
.pager label { display: flex; gap: 6px; align-items: center; }
.hint { margin: 0 16px 10px; color: var(--muted); font-size: 12px; }
.manual-sample { color: var(--manual); }

/* dialogs */
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 0; background: var(--panel); color: var(--text); max-width: min(960px, 96vw); }
dialog::backdrop { background: rgb(0 0 0 / 0.35); }
.dialog { padding: 20px; display: flex; flex-direction: column; gap: 10px; min-width: 320px; }
.dialog.wide { min-width: min(760px, 92vw); }
.dialog h2:first-child { margin-top: 0; }
.dialog-body { max-height: 60vh; overflow: auto; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
table.small th, table.small td { padding: 4px 8px; font-size: 13px; max-width: 260px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.secret { font-family: ui-monospace, Consolas, monospace; background: var(--hover); padding: 10px; border-radius: 6px; word-break: break-all; user-select: all; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 8px 16px; border-radius: 8px; z-index: 50; }
.toast.error-toast { background: var(--danger); color: #fff; }
.page-error { position: fixed; top: 0; left: 0; right: 0; background: var(--danger); color: #fff; padding: 10px 16px; z-index: 60; overflow-wrap: anywhere; }
.page-error button { margin-left: 8px; }

@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; }
  /* No room to pin the buttons: let them scroll with the row. */
  .grid td.actions-col, .grid .num-col { position: static; box-shadow: none; }
  .table-wrap { margin: 0 8px; }
  .toolbar, .pager { padding-left: 8px; padding-right: 8px; }
  .pager { flex-wrap: wrap; }
}
.row-actions { display: flex; gap: 6px; }

/* dashboard */
.dash { overflow: auto; padding: 4px 16px 24px; gap: 16px; }
.dash h2 { font-size: 20px; margin: 8px 0 2px; }
.dash h3 { font-size: 15px; margin: 0 0 2px; }
.dash p.muted { margin: 0; font-size: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.tile, .panel, .card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.tile { padding: 14px 16px; }
.tile .label { color: var(--muted); font-size: 12px; }
.tile .value { font-size: 26px; font-weight: 600; margin: 2px 0; }
.tile .sub { color: var(--muted); font-size: 12px; }
.panel { padding: 16px; }
.panel-head, .section-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.panel-head > div:first-child, .section-head > div:first-child { flex: 1; min-width: 200px; }
.panel-head label, .section-head label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.chart { position: relative; height: 260px; }
.chart.small { height: 180px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .axis text { fill: var(--axis); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .base { stroke: var(--axis); stroke-width: 1; }
.chart .cross { stroke: var(--axis); stroke-width: 1; }
.chart .empty-note { fill: var(--muted); font-size: 13px; }
.tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.15); padding: 8px 10px; font-size: 12px; z-index: 10; min-width: 160px; }
.tip .row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.tip .row span:first-child { display: flex; gap: 6px; align-items: center; }
.tip b { display: block; margin-bottom: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.section-head .legend { margin-top: 4px; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.card { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card h4 { margin: 0; font-size: 14px; display: flex; gap: 8px; align-items: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .meta { font-size: 12px; color: var(--muted); }
.card .meta b { color: var(--text); font-weight: 600; }
.card svg.spark { width: 100%; height: 48px; display: block; }
.card .spark-note { height: 48px; display: flex; align-items: center; color: var(--muted); font-size: 12px; }
.seg { display: flex; gap: 2px; height: 8px; }
.seg span { border-radius: 4px; min-width: 2px; }
.card .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; font-size: 12px; color: var(--muted); }
.card .stats b { display: block; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
button.more { margin-top: 10px; }
.log-wrap { max-height: 420px; }
table.log { width: 100%; }
table.log td.num, table.log th.num { text-align: right; font-variant-numeric: tabular-nums; }
.delta { color: var(--muted); font-size: 11px; margin-left: 4px; }
#checkpoint-form { margin-bottom: 8px; }
#checkpoint-form input { flex: 1 1 260px; }
@media (max-width: 700px) {
  .dash { padding: 4px 8px 16px; }
  .chart { height: 220px; }
}
.legend > span { display: inline-flex; align-items: center; }

/* row checkboxes, visibility presets */
.grid label.pick { display: flex; gap: 8px; align-items: center; justify-content: space-between; min-width: 64px; cursor: pointer; }
.grid label.pick input { margin: 0; }
.grid tr.picked td { background: var(--hover); }
.grid tr.jh td.db { color: var(--muted); }
.menu-title { font-size: 12px; color: var(--muted); margin: 6px 0 2px; }
.menu label.preset { align-items: flex-start; white-space: normal; padding: 2px 0; }
.menu label.preset input { margin-top: 3px; }
.menu-note { margin: 4px 10px 6px; color: var(--muted); font-size: 12px; max-width: 260px; }
#selection { display: inline-flex; gap: 6px; align-items: center; color: var(--text); }
#selection button { padding: 2px 8px; }

/* dashboard, plain version */
.dash-head h2 { margin: 8px 0 2px; }
.overview { display: grid; grid-template-columns: minmax(220px, 1fr) 3fr; gap: 12px; align-items: stretch; }
.hero { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; display: flex; flex-direction: column; justify-content: center; }
.hero-value { font-size: 48px; font-weight: 600; line-height: 1.1; }
.hero-label { color: var(--muted); margin-top: 4px; }
.panel h3 { margin: 0 0 2px; }
.attention { list-style: none; margin: 10px 0 0; padding: 0; }
.attention li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.attention li:first-child { border-top: 0; }
.attention .count { font-size: 20px; font-weight: 600; min-width: 90px; text-align: right; font-variant-numeric: tabular-nums; }
.attention .what { flex: 1; }
.attention .what small { display: block; color: var(--muted); }
.attention li.ok .count { color: var(--muted); }
.hbars { display: grid; grid-template-columns: max-content 1fr max-content; gap: 8px 12px; align-items: center; margin-top: 10px; }
.hbars .name { color: var(--text); white-space: nowrap; }
.hbars .track { height: 14px; }
.hbars .bar { height: 14px; background: var(--s1); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbars .val { font-variant-numeric: tabular-nums; color: var(--text); }
.hbars .val small { color: var(--muted); margin-left: 6px; }
table.compare { width: 100%; margin-top: 10px; }
table.compare th, table.compare td { padding: 6px 10px; }
table.compare td.num, table.compare th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.compare td.barcell { width: 40%; }
table.compare .bar { height: 10px; background: var(--s1); border-radius: 0 4px 4px 0; min-width: 2px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 10px; }
.facts span b { font-variant-numeric: tabular-nums; }
/* Links look like what they are: a small outlined button, not coloured text. */
.linkish, .rq .tl-name a.tl-song, a[href]:not([download]) { display: inline-block; background: color-mix(in srgb, var(--accent) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: 6px; padding: 0 7px; color: var(--text); font-weight: 600; cursor: pointer; text-decoration: none; font-family: inherit; font-size: inherit; line-height: 1.55; max-width: 100%; vertical-align: baseline; }
.linkish:hover, .linkish:focus-visible, .rq .tl-name a.tl-song:hover, .rq .tl-name a.tl-song:focus-visible, a[href]:not([download]):hover, a[href]:not([download]):focus-visible {
  background: color-mix(in srgb, var(--accent) 22%, var(--panel)); border-color: var(--accent); color: var(--text); text-decoration: none; }
/* Opens another site: says so with an arrow. */
a[href][target="_blank"]::after { content: " ↗"; font-weight: 400; color: var(--muted); }
/* A long video title stays on one line, cut short. */
.tr-video a[href] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.changes { list-style: none; margin: 8px 0 0; padding: 0; }
.changes li { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.changes li:first-child { border-top: 0; }
.changes .when { color: var(--muted); font-variant-numeric: tabular-nums; }
.changes .by { color: var(--muted); font-size: 12px; }
@media (max-width: 700px) {
  .overview { grid-template-columns: 1fr; }
  .hero-value { font-size: 40px; }
  .changes li { grid-template-columns: 1fr; gap: 2px; }
  .attention .count { min-width: 64px; font-size: 18px; }
}

/* songs by language: a group of bars per language, one per database */
.lgroups { display: grid; grid-template-columns: max-content 1fr; gap: 10px 14px; margin-top: 12px; align-items: start; }
.lgroups .lname { font-weight: 600; padding-top: 1px; white-space: nowrap; }
.lgroups .lbars { display: grid; grid-template-columns: 1fr max-content; gap: 3px 10px; align-items: center; }
.lgroups .bar, .hbars .bar { border-radius: 0 4px 4px 0; min-width: 2px; }
.lgroups .bar { height: 10px; }
.bar.est { opacity: 0.55; }
.lgroups .v, .hbars .val { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text); white-space: nowrap; }
.hbars .val { font-size: 14px; }
.nofig { color: var(--muted); font-size: 12px; }
#supplier-facts { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
#supplier-facts .facts { margin-top: 4px; }
.est-langs { display: flex; flex-direction: column; gap: 6px; }
.est-langs .row { display: flex; gap: 8px; align-items: center; }
.est-langs input { width: 140px; }
.key.est { opacity: 0.55; }
.nofig { white-space: nowrap; }
@media (max-width: 700px) {
  /* Bars get the full width: each name sits on its own line above its bar. */
  .hbars { grid-template-columns: 1fr max-content; gap: 2px 10px; }
  .hbars .name { grid-column: 1 / -1; margin-top: 6px; }
  .lgroups { grid-template-columns: 1fr; gap: 4px; }
  .lgroups .lname { margin-top: 8px; }
}

/* update reminder; status colours always come with an icon and words */
:root { --st-good: #0ca30c; --st-warn: #fab219; --st-crit: #d03b3b; }
.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line);
  border-left: 4px solid var(--st-warn); border-radius: 8px; padding: 10px 14px; }
.notice.crit { border-left-color: var(--st-crit); }
.notice .icon { font-weight: 700; }
.updates { list-style: none; margin: 8px 0 0; padding: 0; }
.updates li { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 4px 16px; padding: 8px 0; border-top: 1px solid var(--line); }
.updates li:first-child { border-top: 0; }
.updates .who { font-weight: 600; }
.updates .who small { color: var(--muted); font-weight: 400; }
.status { display: inline-flex; gap: 6px; align-items: center; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.status.ok::before { background: var(--st-good); }
.status.due::before { background: var(--st-warn); }
.status.over::before { background: var(--st-crit); }
.status.over { font-weight: 600; }
@media (max-width: 700px) { .updates li { grid-template-columns: 1fr; } }
input.short { width: 80px; }

/* -- competitor survey -------------------------------------------------------- */
.survey-head { align-items: flex-end; margin-bottom: 0; }
.survey-head h2 { margin: 8px 0 2px; }
.survey-body { display: flex; flex-direction: column; gap: 16px; }
/* Each table across the full width, one under the other. */
.survey-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.survey-grid .panel { min-width: 0; }
.survey-tiles .tile.clickable { cursor: pointer; }
.survey-tiles .tile.clickable:hover { border-color: var(--filter, var(--accent)); }
.cov-legend { margin: 6px 0 0; }
.cov-legend .key { margin-right: 4px; vertical-align: -1px; }
.matrix-wrap { overflow-x: auto; margin-top: 10px; }
table.matrix { width: 100%; min-width: 0; }
.matrix th, .matrix td { padding: 5px 5px; font-size: 13px; vertical-align: middle; max-width: none; }
.matrix th[scope=row] { padding-left: 2px; }
.matrix thead th { color: var(--muted); font-weight: 600; text-align: center; }
.matrix th[scope=row] { font-weight: 600; text-align: left; }
.matrix th[scope=row] small { display: block; color: var(--muted); font-weight: 400; }
.matrix td { text-align: center; min-width: 0; }
.matrix td.none { color: var(--muted); }
.cov { display: flex; flex-direction: column; align-items: stretch; gap: 3px; width: 100%; padding: 4px 3px; border-color: transparent;
  background: transparent; font-variant-numeric: tabular-nums; }
.cov:hover { border-color: var(--line); }
.cov.static { border: 0; cursor: default; }
.cov.static:hover { border: 0; }
.cov .num { font-weight: 600; }
.cov .num small { color: var(--muted); font-weight: 400; }
.cov .track, .cov .fill { display: block; }
.cov .track { height: 6px; background: var(--grid); border-radius: 3px; overflow: hidden; }
.cov .fill { height: 6px; background: var(--s1); border-radius: 0 3px 3px 0; width: var(--w, 0%); }
/* Coverage levels: the status colours (always with the legend and the tooltip's word). */
.lv-good { background: var(--st-good) !important; }
.lv-fair { background: var(--st-warn) !important; }
.lv-poor { background: var(--st-crit) !important; }
:root { --lv-good-ink: #0a7a0a; --lv-fair-ink: #a86b00; --lv-poor-ink: #c0352f; }
@media (prefers-color-scheme: dark) { :root { --lv-good-ink: #4cc94c; --lv-fair-ink: #f5b93a; --lv-poor-ink: #f07167; } }
.lv-text-good { color: var(--lv-good-ink); }
.lv-text-fair { color: var(--lv-fair-ink); }
.lv-text-poor { color: var(--lv-poor-ink); }
.cov .miss { font-size: 11px; color: var(--muted); }
.cov.active { border-color: var(--accent); }
.survey-filters { padding: 0 0 10px; }
.survey-table { margin: 0; max-height: 75vh; flex: none; }
.grid td.miss-yes { color: var(--danger); font-weight: 600; }
.grid td.ok-yes { color: var(--muted); }

/* -- bar / pie switch and pie charts --------------------------------------------- */
.kind-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.kind-switch button { border: 0; border-radius: 0; background: transparent; color: var(--muted); padding: 5px 12px; }
.kind-switch button + button { border-left: 1px solid var(--line); }
.kind-switch button[aria-pressed="true"] { background: var(--hover); color: var(--text); font-weight: 600; }
.pies { display: flex; flex-wrap: wrap; gap: 20px 40px; margin-top: 12px; align-items: flex-start; }
.pie { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.pie.small { flex-direction: column; align-items: center; gap: 6px; width: 180px; }
.pie svg { display: block; width: 220px; height: 220px; flex: none; overflow: visible; }
.pie.small svg { width: 150px; height: 150px; }
/* The survey's pie views: one card per chart or competitor. */
.pie-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.pie-card { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.pie-card figcaption { margin-bottom: 8px; }
.pie-card figcaption small { color: var(--muted); }
.pie-card .pie svg { width: 140px; height: 140px; }
.pie-card.clickable { cursor: pointer; }
.pie-card.clickable:hover { border-color: var(--accent); }
.pie path, .pie circle { stroke: var(--panel); stroke-width: 2; stroke-linejoin: round; transition: opacity 0.15s; }
.pie path:hover, .pie circle:hover { opacity: 0.8; }
.pie .est { fill-opacity: 0.55; }
.pie .title { font-weight: 600; text-align: center; }
.pie .title small { display: block; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.pie-legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: max-content max-content max-content; gap: 4px 12px;
  align-items: center; font-size: 13px; }
.pie-legend li { display: contents; }
.pie-legend .name { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.pie-legend .v, .pie-legend .p { font-variant-numeric: tabular-nums; text-align: right; }
.pie-legend .p { color: var(--muted); }
.pie-note { color: var(--muted); font-size: 12px; margin-top: 6px; flex-basis: 100%; }
@media (max-width: 700px) {
  .pie svg { width: 180px; height: 180px; }
  .pie.small { width: 140px; }
  .pie.small svg { width: 120px; height: 120px; }
  .pies { gap: 16px 20px; justify-content: center; }
}

/* Applied filters stand out in their own colour (markFilters): not the green
   accent, which means primary buttons and Released. */
:root { --filter: #2a78d6; }
@media (prefers-color-scheme: dark) { :root { --filter: #5a9cf0; } }
.toolbar.filters select.on, .toolbar.filters input.on:not([type=checkbox]), select.on[data-default], #rq-w-singer.on {
  border-color: var(--filter); box-shadow: 0 0 0 1px var(--filter);
  background: color-mix(in srgb, var(--filter) 12%, var(--panel)); }
.toolbar.filters label.on, label.on:has(> [data-default]), label.on:has(> #rq-w-singer) { color: var(--filter); font-weight: 600; }
.toolbar.filters input[type=checkbox].on { accent-color: var(--filter); }
#clear-filters:disabled, #back-filters:disabled { opacity: 0.45; cursor: default; }
#clear-filters:not(:disabled) { color: var(--filter); border-color: var(--filter); }
@media (max-width: 700px) {
  .survey-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .survey-tiles .tile { padding: 10px 12px; }
  .survey-tiles .tile .value { font-size: 22px; }
}
/* Full-width survey tables: equal columns after the row names. */
.survey-grid table.matrix { table-layout: fixed; }
.survey-grid .matrix thead th:first-child { width: 170px; }
#survey-cov-new-matrix, #survey-cov-hit-matrix { min-width: 760px; }
#survey-supplier { min-width: 760px; }
.matrix thead th small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
.matrix tr.ours th, .matrix tr.ours td { border-top: 2px solid var(--line); }
.matrix thead th.corner { text-align: left; vertical-align: bottom; }

/* -- song requests (requests.js) and their link to the database ----------------- */
#rq-view, #wanted-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.rq-stats { flex: none; padding: 8px 16px 0; }
/* What the song database has for a request. */
.avail-pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; white-space: nowrap;
  background: var(--hover); border: 1px solid var(--line); }
.avail-pill.ours { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); font-weight: 600; }
.avail-pill.supplier { color: var(--s1); border-color: color-mix(in srgb, var(--s1) 45%, var(--line)); }
.avail-pill.competitor { color: var(--manual); border-color: color-mix(in srgb, var(--manual) 45%, var(--line)); }
.avail-pill.none { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.grid td.avail-cell.editable { cursor: pointer; }
.grid td.avail-cell.editable:hover .avail-pill { text-decoration: underline; }
.grid td.requested.editable { cursor: pointer; color: var(--text); font-weight: 600; background: color-mix(in srgb, var(--accent) 9%, var(--panel)); }
.grid td.requested.editable:hover { background: color-mix(in srgb, var(--accent) 18%, var(--panel)); }
.req-tiles { margin-top: 8px; }
button.req-tile { text-align: left; font: inherit; color: inherit; cursor: pointer; display: block; width: 100%; }
button.req-tile:hover { border-color: var(--axis); background: var(--panel); }
.req-tile.ours .value { color: var(--accent); }
.req-tile.supplier .value { color: var(--s1); }
.req-tile.competitor .value { color: var(--manual); }
.req-tile.none .value { color: var(--danger); }
.req-wanted-title { margin: 16px 0 6px; font-size: 13px; }
.req-wanted-wrap { margin: 0; max-height: 360px; }
.req-wanted-wrap table { width: 100%; }
.req-wanted-wrap td.num, .req-wanted-wrap th.num { text-align: right; font-variant-numeric: tabular-nums; }
.req-wanted-wrap tr.editable { cursor: pointer; }
.req-wanted-wrap tr.editable:hover { background: var(--hover); }
/* Narrow screens: the tabs get their own row and scroll sideways; the page
   scrolls, so the filters never squeeze a table to nothing. */
@media (max-width: 700px) {
  .tabs { order: 3; flex: 1 1 100%; overflow-x: auto; scrollbar-width: thin; }
  .tabs button { flex: none; white-space: nowrap; }
  #app-view { height: auto; min-height: 100%; }
  .view > .table-wrap, .view .table-wrap.survey-table { min-height: 60vh; }
}

/* -- month charts (new songs, the team's trend) ------------------------------------ */
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .target { stroke: var(--text); stroke-width: 2; stroke-dasharray: 5 3; }
.key.target-key { width: 14px; height: 0; border-top: 2px dashed var(--text); border-radius: 0; }
.tip .row.muted { color: var(--muted); }
/* Counts by month: the figure, and the change on the month before under it. */
table.matrix.months { min-width: 0; }
.matrix td.count { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.matrix td.count .num { display: block; font-weight: 600; }
.matrix td.count small { display: block; color: var(--muted); font-size: 11px; }
.matrix td.count small.up { color: var(--lv-good-ink); }
.matrix td.count small.down { color: var(--lv-poor-ink); }
.matrix th[scope=row] .key { vertical-align: -1px; }
.matrix th[scope=row] small.carried { color: var(--manual); }
.matrix tr.total th, .matrix tr.total td { border-top: 2px solid var(--line); font-weight: 600; }
.matrix small.churn { color: var(--muted); }

/* -- survey charts ------------------------------------------------------------------ */
.chart-list { margin: 0; max-height: 60vh; flex: none; }
.chart-table td.num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; width: 40px; }
.mv { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.mv.up { color: var(--lv-good-ink); }
.mv.down { color: var(--lv-poor-ink); }
.mv.new { color: var(--s1); }
.chart-legend { margin: 0; }

/* -- the changes an import would make ----------------------------------------------- */
.changes-body h3 { font-size: 14px; margin: 14px 0 6px; }
.changes-body h3:first-child { margin-top: 0; }
.changes-table { width: 100%; }
.changes-table tr.first td { border-top: 1px solid var(--line); }
.changes-table td.before { color: var(--lv-poor-ink); text-decoration: line-through; text-decoration-thickness: 1px; }
.changes-table td.after { color: var(--lv-good-ink); }
.changes-list { margin: 0; padding-left: 18px; font-size: 13px; }
.changes-body details summary { cursor: pointer; margin-top: 14px; font-weight: 600; font-size: 14px; }
#changes-dialog .dialog.wide { width: min(900px, 94vw); }

/* -- team ------------------------------------------------------------------------------ */
:root { --src-request: var(--s1); --src-trending: var(--s2); --src-other: var(--s-other); }
.src-request { background: var(--src-request); }
.src-trending { background: var(--src-trending); }
.src-other { background: var(--src-other); }
#tm-view .panels { display: grid; gap: 16px; }
#tm-view .panels.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 900px) { #tm-view .panels.two { grid-template-columns: minmax(0, 1fr); } }
#tm-view .tiles .tile.clickable { cursor: pointer; }
#tm-view .tiles .tile.clickable:hover { border-color: var(--filter); }
table.matrix.team { min-width: 720px; }
.matrix.team td.num { text-align: right; font-variant-numeric: tabular-nums; }
.matrix.team td.srccell { width: 22%; }
.matrix.team .seg.src { height: 10px; }
.matrix.team tr.clickable { cursor: pointer; }
.matrix.team tr.clickable:hover { background: var(--hover); }
.matrix.team tr.muted-row th, .matrix.team tr.muted-row td { color: var(--muted); }
.matrix.team .cov .num small { font-weight: 600; }
table.quality { width: 100%; }
table.quality td.num, table.quality th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tm-failed { margin: 12px 0 0; max-height: 260px; flex: none; }
.tm-failed tr.clickable { cursor: pointer; }
.track.workload { position: relative; height: 14px; }
.track.workload .even { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 2px dashed var(--axis); }
.tm-songs { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 0 -16px; }
.tm-songs .grid td.editing select, .tm-songs .grid td.editing input { min-width: 110px; }
.tm-songs .grid select.qc-passed { color: var(--lv-good-ink); font-weight: 600; }
.tm-songs .grid select.qc-failed { color: var(--lv-poor-ink); font-weight: 600; }
#tm-selection { display: inline-flex; gap: 8px; align-items: center; color: var(--text); flex-wrap: wrap; }
#tm-selection label { display: inline-flex; gap: 4px; align-items: center; color: var(--muted); }
#tm-targets .row { display: flex; gap: 10px; align-items: center; }
#tm-targets .tname { min-width: 160px; }
#tm-targets input { width: 120px; }

/* -- snapshots ----------------------------------------------------------------------- */
#snap-dialog .dialog.wide { width: min(900px, 94vw); }
.snap-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.snap { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.snap.current { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.snap.is-hidden { opacity: .6; border-style: dashed; }
.snap-show-hidden { margin-top: 6px; }
.snap-head { display: flex; gap: 12px; align-items: center; }
.snap-what { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.snap-what small { display: block; color: var(--muted); }
.snap details summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 6px; }
.snap details .changes-body { margin-top: 6px; max-height: 320px; overflow: auto; }
#snap-list-label { display: flex; gap: 6px; align-items: center; color: var(--muted); margin-top: 8px; }
.legend > span > i.key { margin-right: 6px; }
.updates .who .snap-link { display: block; font-weight: 400; font-size: 12px; margin-top: 2px; }

/* The sub-tab row: the views on the left, the tab's import, snapshots and export on the right. */
.subbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.subbar .subtabs { padding: 0; border: 0; background: none; }
.subbar-actions { display: flex; gap: 8px; align-items: center; }
@media (max-width: 700px) {
  .subbar { padding: 8px; }
  .subbar .tabs { order: 0; flex: 1 1 100%; }
  .subbar-actions { flex-wrap: wrap; }
}
.hero-code { color: var(--muted); font-size: 12px; margin-top: 8px; }
.snap-reminder { margin: 8px 0 4px; }
/* Counts by month: names on the left, every month a right-aligned column of the same width. */
table.matrix.months { table-layout: fixed; width: auto; min-width: 0; }
table.matrix.months thead th { text-align: right; padding-right: 10px; }
table.matrix.months thead th:first-child { text-align: left; width: 220px; }
table.matrix.months td, table.matrix.months th[scope=col] { width: 110px; }
table.matrix.months td.count, table.matrix.months td.none { text-align: right; padding-right: 10px; }
#sv-trend thead th { text-align: right; }
#sv-trend thead th:first-child { text-align: left; }
p.status::before { content: none; }
.snap-rem { display: block; }

/* Production: each work's flow, step by step. */
.flows { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px 24px; margin-top: 12px; }
.flow h4 { margin: 0 0 2px; font-size: 14px; }
.flow .hbars { margin-top: 4px; }
.flows-edit textarea { width: 100%; min-width: 260px; font: inherit; }
.flows-edit td { vertical-align: top; }
.stack-form { display: grid; gap: 8px; max-width: 480px; margin-top: 10px; }
.stack-form textarea { font: inherit; }

/* Production: KPI gauges, one per kind of work. */
.gauges { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.gauge-card { border: 1px solid var(--grid); border-radius: 8px; padding: 10px 12px; text-align: center; background: var(--panel); }
.gauge-card.clickable { cursor: pointer; }
.gauge-card:hover { border-color: var(--accent); }
.gauge-title { font-weight: 600; margin-bottom: 4px; }
.gauge { width: 160px; height: 92px; display: block; margin: 0 auto; }
.gauge path { fill: none; stroke-width: 14; stroke-linecap: round; }
.gauge .gauge-bg { stroke: var(--grid); }
.gauge .gauge-val { stroke: var(--s1); }
.gauge .gauge-val.lv-good { stroke: var(--st-good); background: none !important; }
.gauge .gauge-val.lv-fair { stroke: var(--st-warn); background: none !important; }
.gauge .gauge-val.lv-poor { stroke: var(--st-crit); background: none !important; }
.gauge .gauge-mark { stroke: var(--text); stroke-width: 2; }
.gauge-value { font-size: 18px; font-variant-numeric: tabular-nums; }
.gauge-status { font-size: 13px; margin: 2px 0; }
.small { font-size: 12px; }

/* The Jobs board: columns of job cards. */
.job { background: var(--panel); border: 1px solid var(--grid); border-left: 4px solid var(--accent); border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; display: grid; gap: 4px; }
.job.overdue { border-left-color: var(--st-crit); }
.job.done { border-left-color: var(--st-good); opacity: 0.85; }
.job-title { text-align: left; font-weight: 600; text-decoration: none; color: var(--text); }

.job-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 12px; align-items: center; }
.chip { background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 10px; padding: 1px 8px; }
.job-step { font-size: 13px; }
.job-bar { height: 6px; background: var(--grid); border-radius: 3px; overflow: hidden; }
.job-bar span { display: block; height: 6px; background: var(--accent); }
.job.done .job-bar span { background: var(--st-good); }
.job-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.job-actions .muted { margin-right: auto; font-size: 12px; }
.job-steps ol { margin: 4px 0 8px 18px; padding: 0; }
.job-steps .step-done { color: var(--muted); }
.job-steps .step-now { font-weight: 600; }
.templates-edit textarea { width: 100%; min-width: 220px; font: inherit; }
.templates-edit td { vertical-align: top; }
#job-form textarea { width: 100%; font: inherit; }

/* Database → Our songs: the production filters and button show only in Our songs;
   dashboard boxes, bars and figures open those songs. */
body:not(.ours-list) .ours-only { display: none !important; }
#dashboard-view .link { cursor: pointer; }
#dashboard-view .tile.link:hover, #dashboard-view .tile.link:focus-visible { border-color: var(--filter, var(--accent)); }
#dashboard-view td.link { color: var(--text); font-weight: 600; background: color-mix(in srgb, var(--accent) 9%, var(--panel)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, var(--line)); }
#dashboard-view td.link:hover { background: color-mix(in srgb, var(--accent) 18%, var(--panel)); }
#dashboard-view .track.link:hover .bar { filter: brightness(1.1); }
.grid td.qc-passed, .small td.qc-passed { color: var(--lv-good-ink); }
.grid td.qc-failed, .small td.qc-failed { color: var(--lv-poor-ink); font-weight: 600; }

/* Production → Jobs: the month's Gantt chart (jobs.js). Every row is
   --row high, so the arrows (an SVG over the days) can find the bars. */
.g-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12px; margin: 10px 0 6px; }
.g-key { display: inline-flex; align-items: center; gap: 5px; }
.g-key i { width: 16px; height: 10px; border-radius: 3px; background: var(--c); display: inline-block; }
.g-key i.fill { background: linear-gradient(to right, var(--muted) 60%, color-mix(in srgb, var(--muted) 30%, transparent) 60%); }
.g-key i.late { background: repeating-linear-gradient(135deg, var(--st-crit) 0 3px, transparent 3px 6px); }
.g-key i.plan { background: transparent; border: 1px dashed var(--muted); }
#tm-jobs-view, .gantt-wrap { flex: none; }
.gantt-wrap { overflow-x: auto; overflow-y: visible; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.gantt { display: grid; grid-template-columns: 250px 150px minmax(660px, 1fr); position: relative; user-select: none; }
/* Who: beside the job's name, staying in view when the chart scrolls sideways. */
.g-who { position: sticky; left: 250px; z-index: 4; background: var(--panel); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-content: center; gap: 2px 4px; padding: 2px 6px; height: var(--row); box-sizing: border-box; overflow-y: auto; font-size: 12px; }
.g-who.g-head { height: auto; top: 0; z-index: 5; font-weight: 600; font-size: 13px; align-items: center; }
.g-who.done { opacity: 0.8; }
.g-person { padding: 0 6px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); white-space: nowrap; max-width: 130px; overflow: hidden; text-overflow: ellipsis; line-height: 18px; }
.g-person.supplier { border-style: dashed; border-color: var(--muted); }
@media (max-width: 700px) { .gantt { grid-template-columns: 160px 100px minmax(560px, 1fr); } .g-who { left: 160px; } }
.g-label { position: sticky; left: 0; z-index: 4; background: var(--panel); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 6px 10px; display: grid; gap: 2px; align-content: center; min-width: 0; height: var(--row); box-sizing: border-box; overflow: hidden; }
.g-label .job-line { display: flex; align-items: flex-start; gap: 4px; min-width: 0; }
.g-label .job-title { flex: 1; min-width: 0; text-align: left; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; word-break: break-word; }
.g-label .job-del { flex: none; border: 0; background: none; padding: 0 2px; cursor: pointer; font-size: 12px; opacity: 0.45; line-height: 1.25; }
.g-label .job-del:hover, .g-label .job-del:focus-visible { opacity: 1; }
.g-label .job-meta { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
.g-label .chip { background: color-mix(in srgb, var(--c) 18%, transparent); }
.g-label.overdue { box-shadow: inset 3px 0 0 var(--st-crit); }
.g-label.done { opacity: 0.8; }
.g-head { font-weight: 600; font-size: 13px; height: auto; position: sticky; top: 0; z-index: 5; }
.g-track { position: relative; border-bottom: 1px solid var(--line); height: var(--row); box-sizing: border-box;
  background-image: linear-gradient(to right, var(--grid) 1px, transparent 1px); background-size: calc(100% / var(--days)) 100%; }
.g-days { display: grid; grid-template-columns: repeat(var(--days), 1fr); height: auto; background: var(--panel); position: sticky; top: 0; z-index: 3; }
.g-days span { text-align: center; font-size: 11px; color: var(--muted); padding: 4px 0; border-left: 1px solid var(--grid); display: flex; flex-direction: column; line-height: 1.2; }
.g-days span b { font-weight: 600; }
.g-days span small { font-size: 9px; text-transform: uppercase; letter-spacing: 0.02em; }
.g-days span.weekend { background: color-mix(in srgb, var(--grid) 45%, transparent); }
.g-days span.today { color: var(--accent-text); background: var(--accent); font-weight: 600; }
.g-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); opacity: 0.5; pointer-events: none; }
.g-plan { position: absolute; top: 50%; transform: translateY(-50%); height: 26px; border: 1px dashed var(--muted); border-radius: 5px; box-sizing: border-box; pointer-events: none; }
.g-bar { position: absolute; top: 50%; transform: translateY(-50%); height: 22px; border-radius: 5px; cursor: grab; touch-action: none;
  background: color-mix(in srgb, var(--c) 32%, var(--panel)); border: 1px solid var(--c); box-sizing: border-box; z-index: 2; }
.g-bar:active { cursor: grabbing; }
.g-bar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.g-bar.done { background: var(--c); cursor: pointer; }
.g-bar.target { outline: 2px solid var(--accent); outline-offset: 2px; }
.g-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c); border-radius: 4px 0 0 4px; pointer-events: none; }
.g-bar.done .g-fill { border-radius: 4px; }
.g-over { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, var(--st-crit) 0 4px, transparent 4px 8px); border-radius: 0 4px 4px 0; pointer-events: none; }
.g-name { position: absolute; left: 6px; right: 6px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; color: var(--text); pointer-events: none; text-shadow: 0 0 3px var(--panel), 0 0 3px var(--panel); }
.g-handle { position: absolute; top: -1px; bottom: -1px; width: 8px; cursor: ew-resize; }
.g-handle.start { left: -4px; }
.g-handle.end { right: -4px; }
.g-handle:hover { background: color-mix(in srgb, var(--c) 60%, transparent); border-radius: 3px; }
.g-progress { position: absolute; bottom: -9px; width: 10px; height: 10px; margin-left: -5px; cursor: ew-resize; color: var(--text); }
.g-progress::before { content: "◆"; font-size: 10px; line-height: 10px; display: block; text-align: center; }
.g-link { position: absolute; right: -16px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--panel);
  border: 2px solid var(--c); cursor: crosshair; opacity: 0; transition: opacity 0.1s; }
.g-bar:hover .g-link, .g-bar:focus-visible .g-link { opacity: 1; }
.g-late { position: absolute; top: 50%; transform: translateY(-50%); height: 22px; border-radius: 0 5px 5px 0; pointer-events: auto;
  background: repeating-linear-gradient(135deg, var(--st-crit) 0 3px, transparent 3px 7px); opacity: 0.75; z-index: 1; }
.g-from, .g-on { position: absolute; top: -9px; font-size: 10px; white-space: nowrap; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; padding: 0 5px; pointer-events: none; }
.g-from { left: 2px; }
.g-on { right: 2px; }
.g-links { position: absolute; z-index: 1; pointer-events: none; overflow: visible; }
.g-arrow { fill: none; stroke: var(--muted); stroke-width: 1.5; pointer-events: stroke; cursor: pointer; }
.g-arrow:hover { stroke: var(--st-crit); stroke-width: 2.5; }
.g-links marker path { fill: var(--muted); }
.g-drawing { position: absolute; height: 0; border-top: 2px dashed var(--accent); transform-origin: 0 0; pointer-events: none; z-index: 6; }
#job-form .date-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: end; }
#job-form .date-row label { flex: 1 1 160px; }
#job-form select[multiple] { width: 100%; }
td.yt-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
td.pre { white-space: pre-line; }
#apk-form .date-row { display: flex; flex-wrap: wrap; gap: 8px 16px; }
#apk-form .date-row label { flex: 1 1 160px; }
.audit-wrap { max-height: 60vh; }
.audit-detail { max-width: 420px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: ui-monospace, monospace; font-size: 11px; }
tr.audit-failed td { background: color-mix(in srgb, var(--danger) 6%, transparent); }
td.nowrap { white-space: nowrap; }
#audit-dialog { max-width: 96vw; width: min(1240px, 96vw); }
#audit-dialog .dialog.wide { min-width: 0; }
#audit-dialog .audit-wrap { overflow: auto; }
#audit-dialog .actions { flex-wrap: wrap; }

/* BGM: the playlists as cards, the rules, the songs. */
.bgm-cards { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; margin-bottom: 16px; }
.bgm-cards h4 { margin: 0 0 6px; font-weight: 500; }
.bgm-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.bgm-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); cursor: pointer; font: inherit; }
.bgm-card:hover { background: var(--hover); }
.bgm-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.bgm-n { font-size: 20px; font-weight: 600; }
.bgm-pill { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.bgm-pill.ok { color: var(--lv-good-ink); border-color: var(--lv-good-ink); }
.bgm-pill.bad { color: var(--lv-poor-ink); border-color: var(--lv-poor-ink); }
.bgm-rules { list-style: none; padding: 0; margin: 8px 0 12px; display: grid; gap: 4px; }
.bgm-rules li { display: flex; gap: 8px; align-items: baseline; }
.bgm-rules .mark { width: 1.2em; font-weight: 700; }
.bgm-rules li.ok .mark { color: var(--lv-good-ink); }
.bgm-rules li.bad .mark { color: var(--lv-poor-ink); }
.bgm-rules li.info .mark { color: var(--muted); }
.bgm-rules small { color: var(--muted); }
.bgm-add { position: relative; flex: 1 1 360px; max-width: 560px; }
.bgm-add input { width: 100%; box-sizing: border-box; }
.bgm-results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 2px); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .15); max-height: 360px; overflow-y: auto; }
.bgm-results p { margin: 0; padding: 10px; }
.bgm-result { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); cursor: pointer; font: inherit; }
.bgm-result:hover { background: var(--hover); }
.bgm-table td { vertical-align: middle; }
.bgm-table tr.bgm-bad td { background: color-mix(in srgb, var(--danger) 8%, transparent); }
.bgm-rel.bad input { color: var(--lv-poor-ink); border-color: var(--lv-poor-ink); }
.bgm-rel.warn input { border-color: var(--lv-fair-ink); }
.bgm-content { font: inherit; font-size: 13px; padding: 2px 10px; border-radius: 999px; border: 1px dashed var(--line); background: none; color: var(--muted); cursor: pointer; }
.bgm-content.ok { border: 1px solid var(--lv-good-ink); color: var(--lv-good-ink); }
.bgm-content.bad { border: 1px solid var(--lv-poor-ink); color: var(--lv-poor-ink); }
.bgm-actions { white-space: nowrap; text-align: right; }
.bgm-actions button { padding: 2px 8px; }
.bgm-checks { display: grid; gap: 4px; }
.bgm-moods { display: flex; flex-wrap: wrap; gap: 4px 14px; }
#bgm-content-dialog fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; }
label.grow { flex: 1 1 260px; display: flex; gap: 6px; align-items: center; }
label.grow input { flex: 1; }
@media (max-width: 800px) { .bgm-cards { grid-template-columns: minmax(0, 1fr); } }

/* APK versions by outlet. */
.apk-chips { flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.apk-chip { font: inherit; font-size: 13px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--lv-good-ink); color: var(--lv-good-ink); background: none; cursor: pointer; }
.apk-chip.old { border-color: var(--lv-poor-ink); color: var(--lv-poor-ink); }
.apk-chip.on { box-shadow: 0 0 0 2px var(--accent); }
.apk-v { font-weight: 600; color: var(--lv-good-ink); }
.apk-v.old { color: var(--lv-poor-ink); }
.apk-outlet-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 12px; max-height: 260px; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 8px; margin: 4px 0 8px; }
#apk-record-dialog .dialog, #apk-dialog .dialog, #apk-history-dialog .dialog { width: min(760px, 92vw); }

/* Competitors' song list: where a song charts. */
.tg-charts { display: flex; flex-wrap: nowrap; gap: 3px; }
.tg-chart { font-size: 12px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.tg-chart.new { border-color: var(--s1); }
.tg-chart.hit { border-color: var(--s3); }
tr.tg-both td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.churn.up { color: var(--lv-good-ink); }
.churn.down { color: var(--lv-poor-ink); }
body.no-ip .au-ip { display: none; }
.subbar-actions.log-hidden { display: none !important; }
.reminder-rows { display: grid; gap: 6px; margin-bottom: 8px; }
#reminder-rows .reminder-row { display: grid; grid-template-columns: minmax(0, 360px) auto minmax(0, 1fr); gap: 12px; align-items: center; text-align: left; padding: 4px 0; border-bottom: 1px solid var(--line); }
#reminder-rows .reminder-row > span:nth-child(2) { white-space: nowrap; }
@media (max-width: 700px) { #reminder-rows .reminder-row { grid-template-columns: 1fr; gap: 2px; } }
#dashboard-view[data-mode="main"] [data-dash].dash-off { display: none !important; }
.settings-tabs { margin: 4px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.settings-pane h3 { margin: 14px 0 6px; }
.settings-pane h3:first-child { margin-top: 0; }
#admin-dialog .dialog.wide { min-height: 420px; }

/* Production → By member. */
.tm-members th[scope="row"] { white-space: nowrap; }
.tm-unassigned th, .tm-unassigned td { background: color-mix(in srgb, var(--danger) 5%, transparent); }
.tm-bar { position: relative; display: inline-block; width: 90px; height: 16px; border-radius: 8px; background: var(--hover); overflow: hidden; vertical-align: middle; }
.tm-bar i { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--accent) 45%, transparent); }
.tm-bar span { position: relative; font-size: 11px; line-height: 16px; }
.tm-now { display: flex; flex-wrap: wrap; gap: 4px; }
.tm-job { font: inherit; font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--text); cursor: pointer; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-job.late { border-color: var(--lv-poor-ink); color: var(--lv-poor-ink); }
.tm-sub-h { margin: 14px 0 4px; font-weight: 500; }
#tm-summary { margin-bottom: 16px; }

/* A job's people. */
.job-people-field { display: grid; gap: 6px; margin: 6px 0; }
.job-people { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; align-items: center; }
.job-person { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 10px; border-radius: 999px; border: 1px solid var(--accent); font-size: 13px; }
.job-person.supplier { border-style: dashed; border-color: var(--muted); }
.job-person small { color: var(--muted); }
.job-person .x { border: 0; background: none; padding: 0 6px; cursor: pointer; color: var(--muted); font-size: 15px; }
.job-people-add { display: flex; flex-wrap: wrap; gap: 6px; }
.job-people-add input { flex: 1 1 220px; }
.field-label { font-weight: 500; }
.job-after { display: grid; gap: 4px; margin: 6px 0; }
.job-after-toggle { justify-self: start; text-align: left; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-after-list { display: grid; gap: 2px; max-height: 220px; overflow-y: auto; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }

/* Filters… and Sort… (filterbar.js). */
.fb-off { display: none !important; }
.fb-input { width: 140px; }
.fb-dialog .dialog { width: min(640px, 92vw); }
.fb-rows { display: grid; gap: 4px; margin: 8px 0; max-height: 55vh; overflow-y: auto; }
.fb-row { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 6px; }
.fb-row.on { background: var(--hover); }
.fb-row label { flex: 1; }
.fb-move button { padding: 1px 8px; }
.fb-offs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 10px; }
#fb-db-sort.on, .fb-sort.on { border-color: var(--accent); color: var(--accent); }
#supplier-dialog .dialog { width: min(900px, 94vw); }
#supplier-dialog tr.inactive input:not([type="checkbox"]) { color: var(--muted); }
#tm-supplier-rows input:not([type="checkbox"]) { width: 100%; box-sizing: border-box; }

/* Column widths by dragging a header's right edge (colresize.js). */
body.cw-hover, body.cw-hover th { cursor: col-resize !important; }
body.cw-dragging { cursor: col-resize !important; user-select: none; }
table.cw-fixed th, table.cw-fixed td { overflow: hidden; text-overflow: ellipsis; box-sizing: border-box; max-width: none; }

/* Survey → Trending */
.tr-actions { display: flex; gap: 6px; align-items: flex-start; }
.tr-langs { margin: 8px 0 12px; }
.tr-langs .tile.link { cursor: pointer; }
.tr-langs .tile.on { outline: 2px solid var(--accent); }
.tr-langs .tile .error { color: var(--danger); }
table.trending td { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.trending td.tr-video { max-width: 360px; }
table.trending td.tr-video small { display: block; }
select.apk-v-pick { font: inherit; font-weight: 600; padding: 1px 4px; }
.tr-cc { font-size: 11px; letter-spacing: .03em; }
table.trending td.tr-growth { white-space: nowrap; }
.tr-spark { vertical-align: middle; margin-left: 6px; }
.tr-spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }

/* Trending settings */
#tr-form [data-trpane] { min-height: 300px; max-height: 62vh; overflow: auto; }
#tr-form-langs { display: grid; gap: 6px; margin-bottom: 10px; }
.tr-lang { border: 1px solid var(--line); border-radius: 6px; }
.tr-lang > summary { display: flex; gap: 10px; align-items: center; padding: 8px 10px; cursor: pointer; flex-wrap: wrap; }
.tr-lang > summary:hover { background: var(--hover); }
.tr-lang[open] > summary { border-bottom: 1px solid var(--line); }
.tr-lang.off > summary .tr-sum-name, .tr-lang.off > summary .tr-sum-text { opacity: .55; }
.tr-sum-text { margin-left: auto; }
.tr-lang-body { padding: 4px 12px 8px; }
.tr-step { margin: 10px 0 4px; }
.tr-step h4 { display: flex; gap: 8px; align-items: center; margin: 0 0 6px; font-size: 14px; }
.tr-num { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; }
.tr-step p { margin: 4px 0 0; }
.tr-step textarea, .tr-rows textarea { width: 100%; font: inherit; }
.tr-lang-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 12px; }
.tr-lang-grid input { width: 100%; }
.tr-countries { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.tr-chip { border: 1px solid var(--line); border-radius: 14px; padding: 2px 10px; }
.tr-chip:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.tr-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 24px; max-width: 760px; }
.dialog label.tr-rule { display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 8px; }
.tr-rule select, .tr-between select { width: auto; }
.tr-rows { display: grid; gap: 10px; max-width: 720px; }
.tr-rows p { margin: -4px 0 4px; }
.tr-between { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tr-between input[type=number] { width: 90px; }

/* Settings → Outlets */
.outlet-show-picks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.outlet-codes { max-height: 50vh; overflow: auto; }
.outlet-codes input.outlet-code { width: 110px; text-transform: none; }
.outlet-codes input.outlet-brand { width: 160px; }
input.apk-installed { width: auto; padding: 2px 6px; font: inherit; }

/* APK versions coloured by age (team.js versionTone): latest green → yellow → orange → oldest red. */
.apk-tone { color: var(--vc); }
.apk-chip.apk-tone { border-color: var(--vc); }
select.apk-v-pick.apk-tone { border-color: var(--vc); }
.apk-chip.none { border-color: var(--line); color: var(--muted); }
select.apk-v-pick option:not(.apk-tone) { color: var(--text); }
@media (prefers-color-scheme: dark) {
  .apk-tone { color: var(--vcd); }
  .apk-chip.apk-tone, select.apk-v-pick.apk-tone { border-color: var(--vcd); }
}

/* Performance → the month: ◀ Last month, the month, Next month ▶. */
.month-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pf-entries { max-height: 60vh; flex: none; }
td.strong { font-weight: 600; }

/* Advertisement: the ad dialog's outlets. */
#ad-form .date-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: end; }
#ad-form .date-row label { flex: 1 1 160px; }
#ad-form .ad-outlet-picks { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px 10px; }
#ad-outlet-picks { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 6px; }
/* Advertisement list: titles and outlets wrap; the buttons stay on the right. */
#ad-rows td { white-space: normal; max-width: none; overflow: visible; text-overflow: clip; vertical-align: top; }
#ad-rows td.nowrap { white-space: nowrap; }
#ad-rows td:nth-child(5) { min-width: 160px; max-width: 260px; }
#ad-rows td.ad-actions { position: sticky; right: 0; background: var(--panel); }
.ad-actions button { padding: 2px 8px; font-size: 12px; }
#ad-outlets td.small { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ad-rows td:nth-child(3) { min-width: 180px; max-width: 300px; }
#ad-rows td:nth-child(9) { min-width: 175px; }
#ad-list-view .table-wrap { margin: 0; }
#ad-list-view .pager { padding: 8px 0; }

/* Performance → By area: a card per area of the site. */
.area-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.area-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.area-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.area-head h4 { margin: 0; }
.area-figures { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.area-card p { margin: 0; }
.area-card > button { align-self: flex-start; }

/* Job templates: the fixed ones (one per area), then the others. */
.templates-edit tr.tpl-section th { background: var(--bg, transparent); padding-top: 12px; text-align: left; font-weight: normal; border-bottom: 1px solid var(--line); }

/* Performance → By member: a card per person. */
.member-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.member-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; }
.member-card.has-late { border-color: color-mix(in srgb, var(--lv-poor-ink) 45%, var(--line)); }
.member-card .mc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.member-card h4 { margin: 0; }
.member-card .mc-line { display: grid; grid-template-columns: 72px 1fr; gap: 8px; align-items: center; }
.member-card .tm-bar { margin-left: 8px; vertical-align: middle; }
.member-card .tm-now { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.member-card p { margin: 0; }
#check-form .date-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: end; }
#check-form .date-row label { flex: 1 1 200px; }
#check-results h3 { margin: 12px 0 6px; }

/* Settings → Tabs: a row per tab, its sub-tabs indented under it. */
.nav-editor { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; overflow: auto; }
.nav-row { display: flex; align-items: center; gap: 6px; }
.nav-row input { flex: 0 1 260px; }
.nav-row.top input { font-weight: 600; }
.nav-subs { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 0 34px; }
#new-song-form .date-row { display: flex; flex-wrap: wrap; gap: 8px 16px; }
#new-song-form .date-row label { flex: 1 1 140px; }

/* The job dialog: its breakdown and checklist, a row each. */
.job-list-field { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.job-rows { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.job-row { display: flex; gap: 6px; align-items: center; }
.job-row input:not(.short) { flex: 1; }
.job-row.check-done input { text-decoration: line-through; color: var(--muted); }
.job-row.check-progress select { border-color: var(--lv-fair-ink); }
.job-row.check-done select { border-color: var(--lv-good-ink); }

/* Import weekly report: a block per person, a row per task. */
.report-person { margin-top: 12px; }
.report-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.report-head h3 { margin: 0; }
.report-person td input:not([type]) { width: 100%; min-width: 180px; }
.jb-view-bar { margin-bottom: 4px; }
.jb-seg { display: inline-flex; }
.jb-seg button { border-radius: 0; }
.jb-seg button:first-child { border-radius: 6px 0 0 6px; }
.jb-seg button:last-child { border-radius: 0 6px 6px 0; margin-left: -1px; }
.jb-seg button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
#jb-week-nav { display: inline-flex; gap: 8px; align-items: center; }
#jb-week-nav.hidden { display: none; }

/* Header filters (filterbar.js): a ▾ in each column header opens its filter and sort. */
th[data-col] { white-space: nowrap; }
.thf-btn { margin-left: 4px; padding: 0 5px; min-width: 20px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel);
  color: var(--muted); font-size: 11px; line-height: 1.5; cursor: pointer; vertical-align: middle; }
.thf-btn:hover, .thf-btn:focus-visible, .thf-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--text); }
.thf-btn.on { background: var(--filter, var(--accent)); border-color: var(--filter, var(--accent)); color: var(--accent-text); }
th.thf-on { box-shadow: inset 0 -3px var(--filter, var(--accent)); }
.thf-pop { position: fixed; z-index: 60; overflow: auto; background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); padding: 10px; text-align: left; font-weight: 400; }
.thf-pop.hidden { display: none; }
.thf-body { display: flex; flex-direction: column; gap: 8px; }
.thf-title { font-weight: 600; font-size: 13px; }
.thf-sort { display: flex; flex-wrap: wrap; gap: 6px; }
.thf-sort button { padding: 3px 8px; font-size: 12px; }
.thf-sort button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--panel)); }
.thf-body > label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); margin: 0; }
.thf-body > label.check { flex-direction: row; align-items: center; color: var(--text); }
.thf-body select, .thf-body input:not([type="checkbox"]) { width: 100%; min-width: 0; }
.thf-body .fb-col { color: var(--text); }
.thf-values { display: flex; flex-direction: column; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.thf-value { display: flex; justify-content: space-between; gap: 10px; text-align: left; padding: 5px 8px; border: 0; border-bottom: 1px solid var(--line);
  background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.thf-value:last-child { border-bottom: 0; }
.thf-value span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thf-value:hover, .thf-value:focus-visible { background: var(--hover); }
.thf-value.on { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); font-weight: 600; }
.thf-values p { margin: 6px 8px; }
.thf-actions { display: flex; justify-content: flex-end; }

/* A list's table fits its page: it scrolls inside (rows and columns) with its
   header pinned, so the sideways scrollbar is always on screen. --view-h is
   the scrolling page's height (app.js); the panel's padding is taken off. */
.dash .table-wrap { max-height: max(260px, calc(var(--view-h, 100dvh) - 84px)); }
.dash .table-wrap thead th { position: sticky; top: 0; z-index: 5; background: var(--panel); box-shadow: inset 0 -1px var(--line); }
@media (max-width: 700px) {
  /* The whole page scrolls here: a table is at most the screen's height. */
  .dash .table-wrap, .view > .table-wrap { max-height: calc(100dvh - 52px); }
}

/* Scrollbars of the tables stay visible (not overlay ones that hide). */
.table-wrap::-webkit-scrollbar { width: 12px; height: 12px; }
.table-wrap::-webkit-scrollbar-track { background: var(--hover); }
.table-wrap::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 55%, var(--panel)); border-radius: 6px; border: 2px solid var(--hover); }
.table-wrap::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.table-wrap::-webkit-scrollbar-corner { background: var(--hover); }
@supports not selector(::-webkit-scrollbar) {
  .table-wrap { scrollbar-width: auto; scrollbar-color: color-mix(in srgb, var(--muted) 55%, var(--panel)) var(--hover); }
}
/* The sideways slider under a wide table (app.js, sideways). */
.hbar { display: flex; align-items: center; gap: 6px; margin: 6px 16px 0; flex: none; }
.hbar.hidden { display: none; }
.hbar-range { flex: 1; min-width: 0; accent-color: var(--accent); cursor: ew-resize; }
.hbar-btn { padding: 1px 8px; font-size: 12px; line-height: 1.4; }
#ad-list-view .hbar { margin-left: 0; margin-right: 0; }
@media (max-width: 700px) { .hbar { margin: 6px 8px 0; } }
