:root {
  --bg: #f4f5f7; --card: #ffffff; --text: #1d2330; --muted: #6b7385; --line: #e2e5eb;
  --accent: #3d6df2; --ok: #1f9d55; --warn: #c27c0e; --bad: #d23c3c; --off: #a3a9b6;
  --code: #f0f2f5; --danger-bg: #fdecec;
  /* charts (History page, sparklines, memory bar): the dataviz reference categorical slots 1-4, validated in this
     order against the card surface (adjacent CVD dE >= 8.4, normal >= 19.8); greys for memory that isn't an app's */
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100;
  /* slots 5-7 for people on the Activity page (same reference set and order; aqua, yellow and magenta are under 3:1
     on white, so names are always printed next to them); --q1..6 the heatmap's one-hue blue ramp, near-zero lightest */
  --c5: #e87ba4; --c6: #008300; --c7: #6250d6;
  /* slots 8-16, people only: slot 8 is the reference red, 9-16 the same eight hues one OKLCH lightness step
     darker (light) / lighter-or-darker within the band (dark); validated in slot order (adjacent CVD dE 8.2 light,
     7.3 dark; normal >= 17.6). Non-adjacent pairs can be close, so a name is always printed beside a swatch */
  --c8: #e34948; --c9: #0452a2; --c10: #ba4203; --c11: #0d825a; --c12: #b87d0b;
  --c13: #bb537d; --c14: #41ac3c; --c15: #867cfe; --c16: #b51221;
  /* slots 17-24 (2026-11-22, owner's call): eight in-between hues; past 16 no order clears the gates (adjacent CVD dE
     5.2 light / 5.1 dark, normal 15.4 / 13.9), so these lean on the printed names */
  --c17: #4848b4; --c18: #8d6e3f; --c19: #0097a7; --c20: #a0522d;
  --c21: #d0469e; --c22: #7a8a00; --c23: #9a4fb5; --c24: #5c7a99;
  --q1: #cde2fb; --q2: #9ec5f4; --q3: #6da7ec; --q4: #3987e5; --q5: #256abf; --q6: #184f95;
  --m-wired: #5f6676; --m-comp: #9aa1af; --m-cache: #ccd1d9;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --card: #1b1f27; --text: #e4e7ee; --muted: #8d95a7; --line: #2b313c;
    --accent: #6d93ff; --ok: #3cc47c; --warn: #e3a03a; --bad: #f06363; --off: #5b6272;
    --code: #11141a; --danger-bg: #3a1f22;
    --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500;
    --c5: #d55181; --c6: #008300; --c7: #9085e9;
    --c8: #e66767; --c9: #2071cd; --c10: #c14201; --c11: #0d865e; --c12: #ac7313;
    --c13: #bd3a6d; --c14: #2a9926; --c15: #7c70d1; --c16: #cd5153;
    --c17: #6a6ad6; --c18: #a58450; --c19: #14a3b3; --c20: #bf6a44;
    --c21: #d65aa8; --c22: #8f9e12; --c23: #ad6cc9; --c24: #7896b5;
    --q1: #104281; --q2: #184f95; --q3: #256abf; --q4: #3987e5; --q5: #6da7ec; --q6: #b7d3f6;
    --m-wired: #8d95a7; --m-comp: #5b6272; --m-cache: #363d4a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 8px 0 16px; }
h2 { font-size: 15px; margin: 0 0 10px; }
h3 { font-size: 13px; margin: 14px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
main { max-width: 1280px; margin: 0 auto; padding: 16px; }
main.narrow { max-width: 420px; padding-top: 10vh; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.top .brand { flex: 0 0 auto; }
.top .brand a.home { color: var(--text); }
.top .brand a.home:hover { text-decoration: none; }
.top .tabs { display: flex; align-items: stretch; gap: 4px; margin-right: auto; align-self: stretch; }
.top .tabs a { display: flex; align-items: center; padding: 0 10px; margin-bottom: -11px; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap; }
.top .tabs a:hover { color: var(--text); text-decoration: none; }
.top .tabs a.active { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.top > .row { flex: 0 0 auto; }
.top + main.narrow { padding-top: 32px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.two > .card { margin-bottom: 16px; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; gap: 0; } }
.grid { display: grid; gap: 10px; }
.grid.services { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid.games { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tile { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.tile.on { border-color: var(--ok); }
.tile-head { display: flex; align-items: center; gap: 8px; }
.row { display: flex; gap: 6px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.tile .row { margin-top: 6px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.inline { display: inline; margin: 0; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.right { float: right; }
.good { color: var(--ok); }
.bad { color: var(--bad); }
.warn-text { color: var(--warn); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--off); flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad, .dot.error { background: var(--bad); }
.summary { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; background: var(--card); border: 1px solid var(--line); }
.summary.error { border-color: var(--bad); } .summary.warn { border-color: var(--warn); } .summary.ok { border-color: var(--ok); }
.summary > div:first-child { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--code); color: var(--muted); }
.tag.ok { background: var(--ok); color: #fff; } .tag.error, .tag.bad { background: var(--bad); color: #fff; } .tag.warn { background: var(--warn); color: #fff; } .tag.info { background: var(--accent); color: #fff; }
.pill { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: var(--code); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok); color: #fff; } .pill.failed, .pill.lost { background: var(--bad); color: #fff; }
.pill.refused { background: var(--warn); color: #fff; } .pill.running { background: var(--accent); color: #fff; }
.issues { list-style: none; margin: 0; padding: 0; } .issues li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.issues li:last-child { border: 0; }
.issues li { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; } .issues li > span { min-width: 0; }
.issues li > button { flex: none; }
.summary details.dismissed { margin-left: auto; } .summary details.dismissed[open] { flex-basis: 100%; }
.summary details.dismissed > summary { margin-top: 0; text-align: right; }
.plain { list-style: none; padding: 0; margin: 0; } .plain li { padding: 4px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.compact td { padding: 3px 6px; }
.scroll-x { overflow-x: auto; }
button, input { font: inherit; }
input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); margin-top: 4px; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 6px; padding: 3px 9px; font-size: 12px; white-space: nowrap; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; padding: 8px 12px; font-size: 14px; }
button.danger { color: var(--bad); }
button.danger:hover:not(:disabled) { border-color: var(--bad); background: var(--danger-bg); }
button.ghost { border-color: transparent; background: none; color: var(--accent); padding: 2px 4px; font-size: 14px; }
details summary { cursor: pointer; color: var(--muted); margin-top: 4px; }
.drive { margin-bottom: 10px; }
.bar { position: relative; height: 8px; background: var(--code); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.bar span { display: block; height: 100%; background: var(--ok); } .bar span.warn { background: var(--warn); } .bar span.bad { background: var(--bad); }
.bar i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--muted); }
pre.output { background: var(--code); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 0;
  white-space: pre-wrap; word-break: break-word; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 70vh; overflow: auto; }
pre.output.short { max-height: 240px; }
#drawer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--card); border-top: 2px solid var(--accent);
  box-shadow: 0 -6px 20px rgba(0,0,0,.15); max-height: 45vh; display: flex; flex-direction: column; }
#drawer[hidden] { display: none; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 8px 16px; }
.drawer-head #drawer-close { margin-left: auto; }
#drawer .output { border-radius: 0; border: 0; border-top: 1px solid var(--line); flex: 1; max-height: none; }
@media (max-width: 600px) {
  .top { flex-wrap: wrap; row-gap: 0; padding-bottom: 0; }
  .top .tabs { order: 3; flex: 1 0 100%; overflow-x: auto; margin: 6px -16px 0; padding: 0 6px; border-top: 1px solid var(--line); }
  .top .tabs a { margin-bottom: 0; padding: 9px 10px; }
  .top > .row { margin-left: auto; padding-bottom: 6px; }
  .top .brand { padding-bottom: 6px; }
  .right { float: none; display: block; }
}
.brand { display: flex; align-items: center; gap: 10px; }
.live { font-size: 12px; color: var(--off); }
.live.on { color: var(--ok); }
.live.off { color: var(--warn); }
td.prog { min-width: 170px; }
td.prog .bar { margin: 2px 0 3px; }
#tip { position: fixed; z-index: 20; max-width: min(420px, calc(100vw - 8px)); padding: 7px 10px; border-radius: 6px;
  background: var(--text); color: var(--bg); font-size: 12px; line-height: 1.4; white-space: pre-line;
  box-shadow: 0 4px 14px rgba(0,0,0,.2); pointer-events: none; }
#tip[hidden] { display: none; }
[data-tip] { cursor: help; }
[data-tip]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tip-u { border-bottom: 1px dotted var(--muted); }
button[data-tip], a[data-tip] { cursor: pointer; }
.tag.pp { background: none; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
/* Downloads card: collapsible groups (active downloads per category, requests per status), closed by default;
   app.js remembers which ones are open across live refreshes and reloads (data-key) */
details.group { border: 1px solid var(--line); border-left: 6px solid var(--g, var(--off)); border-radius: 8px;
  margin: 8px 0; background: var(--card); overflow: hidden; }
details.group > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 0;
  color: var(--text); cursor: pointer; min-width: 0; background: color-mix(in srgb, var(--g, var(--off)) 12%, var(--card)); }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::before { content: "▸"; font-size: 16px; line-height: 1; color: var(--g, var(--off)); flex: none;
  transition: transform .15s; }
details.group[open] > summary::before { transform: rotate(90deg); }
details.group[open] > summary { border-bottom: 1px solid var(--line); }
details.group > summary:hover { background: color-mix(in srgb, var(--g, var(--off)) 22%, var(--card)); }
details.group > .scroll-x { padding: 2px 8px 8px; }
details.group > p { margin: 0 12px 10px; }
.group-title { font-weight: 700; font-size: 15px; flex: none; }
.count { flex: none; font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 10px; background: var(--g, var(--off)); color: #fff; }
.group-info { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar.mini { width: 80px; flex: none; margin: 0; }
@media (max-width: 600px) { .bar.mini { display: none; } }
details.group td .tag { display: inline-block; max-width: 170px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: middle; }
.kind-movies { --g: #e5a00d; } .kind-tv { --g: var(--accent); } .kind-music { --g: #c05bd6; }
.kind-books { --g: var(--ok); } .kind-other { --g: #7a8396; }
.wait-approval { --g: var(--bad); } .wait-searching { --g: var(--warn); } .wait-downloading { --g: var(--ok); }
.wait-airing { --g: #8e6cf0; } .wait-unreleased { --g: var(--accent); } .wait-other, .wait-limit { --g: #7a8396; }
h3.waiting-head { margin-top: 18px; }
/* Plex art card: one group per list, closed by default like the Downloads card's */
.art-films { --g: #e5a00d; } .art-changed { --g: var(--warn); } .art-colls { --g: var(--accent); }
.art-dirs { --g: #8e6cf0; } .art-ignored, .art-howto { --g: #7a8396; }
ol.howto { margin: 8px 12px 10px 30px; padding: 0; } ol.howto li { margin: 4px 0; }
table.waiting td:last-child { width: 1%; white-space: nowrap; }
table.waiting tr.nextbest > td { width: auto; white-space: normal; padding: 6px 10px 10px; border-left: 3px solid var(--g, var(--accent)); }
table.nb { width: 100%; margin: 4px 0; }
table.nb td { vertical-align: top; }
table.nb td:first-child { word-break: break-all; }
/* Members page */
.grid.members { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); margin-bottom: 16px; }
form.member { background: var(--card); }
form.member label { display: block; font-size: 12px; color: var(--muted); margin-top: 8px; }
form.member .row label { flex: 1; min-width: 0; }
form.member .row.wrap { margin-top: 10px; }
select { font: inherit; width: 100%; padding: 6px 8px; margin-top: 4px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--text); }
fieldset { border: 1px solid var(--line); border-radius: 6px; margin: 10px 0 0; padding: 4px 10px 6px; }
legend { font-size: 12px; color: var(--muted); padding: 0 4px; }
form.member label.check { display: inline-flex; align-items: center; gap: 5px; margin: 4px 14px 0 0; color: var(--text); font-size: 13px; }
input[type=checkbox] { width: auto; margin: 0; }
button.primary-sm { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Off-peak downloads row (Downloads card) */
.offpeak { margin: 0 0 10px; gap: 8px; }
.offpeak summary { cursor: pointer; }
.offpeak form.job { margin-top: 6px; gap: 10px; }
.offpeak form.job label { color: var(--muted); }
.offpeak select { width: auto; margin: 0 0 0 4px; padding: 3px 6px; }
.offpeak input[type=number] { width: 5.5em; margin: 0 4px; padding: 3px 6px; }


/* Sparklines (history.CACHE): one series, the line in the accent hue over a 10% wash, an end dot with a surface ring */
.spark-link { display: inline-flex; vertical-align: middle; flex: none; }
.spark-link:hover { text-decoration: none; }
svg.spark { display: block; overflow: visible; }
svg.spark .line { fill: none; stroke: var(--c1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.spark .area { fill: var(--c1); opacity: .1; }
svg.spark circle { fill: var(--c1); stroke: var(--card); stroke-width: 1.5; }
.spark-link.inline { margin: 0 2px; }
.drive-row { display: flex; align-items: center; gap: 10px; }
.drive-row .bar { flex: 1; }

/* Memory card: one stacked bar of the whole RAM (2px surface gaps), keys with values below it */
.membar { display: flex; gap: 2px; height: 16px; margin: 4px 0 8px; }
.membar .seg { min-width: 2px; border-radius: 0; }
.membar .seg:first-child { border-radius: 4px 0 0 4px; }
.membar .seg:last-child { border-radius: 0 4px 4px 0; }
.membar .seg:hover, .membar .seg:focus-visible { filter: brightness(1.12); }
.m-wired { background: var(--m-wired); } .m-vm { background: var(--c1); } .m-plex { background: var(--c2); }
.m-claude { background: var(--c3); } .m-other { background: var(--c4); } .m-compressed { background: var(--m-comp); }
.m-cached { background: var(--m-cache); } .m-free { background: var(--code); }
.memkeys { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 10px; }
.memkey { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.memkey i { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.memstats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-bottom: 8px; }
.memstats .stat { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; }
.memstats .stat > div { min-width: 0; }
.memstats .stat > div > span:first-child { display: block; white-space: nowrap; }
.memstats .stat strong { font-size: 16px; white-space: nowrap; }
.mem-ctr { --g: var(--c1); }
table.ctrmem td.num, table.ctrmem th { white-space: nowrap; }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
th.num { text-align: right; }
td.ctrbar { min-width: 110px; width: 18%; }
td.ctrbar .bar { margin-top: 6px; }

/* History page */
.filters { gap: 10px; margin: 0 0 12px; }
.segctl { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.segctl a { padding: 4px 10px; color: var(--text); border-right: 1px solid var(--line); }
.segctl a:last-child { border-right: 0; }
.segctl a:hover { text-decoration: none; background: var(--code); }
.segctl a.on { background: var(--accent); color: #fff; font-weight: 600; }
.segctl a.on .muted { color: inherit; opacity: .8; }
#charts.loading { opacity: .55; }
.charts { display: grid; gap: 14px 18px; }
.charts.wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.charts.multi { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.chart { min-width: 0; }
.chart-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 2px; }
.chart.small .chart-head strong { font-size: 13px; }
.legend { display: flex; flex-wrap: wrap; gap: 2px 14px; color: var(--muted); }
.lkey { display: inline-flex; align-items: center; gap: 5px; }
.lkey i, .ctip-row i { width: 12px; height: 2px; border-radius: 1px; flex: none; }
.lkey i.c1, .ctip-row i.c1 { background: var(--c1); } .lkey i.c2, .ctip-row i.c2 { background: var(--c2); }
.lkey i.c3, .ctip-row i.c3 { background: var(--c3); }
svg.plot { display: block; touch-action: pan-y; }
svg.plot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg.plot text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
svg.plot .grid { stroke: var(--line); stroke-width: 1; }
svg.plot .axis { stroke: var(--m-comp); stroke-width: 1; }
svg.plot .ref { stroke: var(--muted); stroke-width: 1; }
svg.plot text.reftxt { fill: var(--muted); font-size: 10px; }
svg.plot .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.plot .line.c1 { stroke: var(--c1); } svg.plot .line.c2 { stroke: var(--c2); } svg.plot .line.c3 { stroke: var(--c3); }
svg.plot .area.c1 { fill: var(--c1); opacity: .1; }
svg.plot .dot { stroke: var(--card); stroke-width: 2; }
svg.plot .dot.c1 { fill: var(--c1); } svg.plot .dot.c2 { fill: var(--c2); } svg.plot .dot.c3 { fill: var(--c3); }
svg.plot .cross { stroke: var(--muted); stroke-width: 1; }
svg.plot .hit { fill: transparent; cursor: crosshair; }
svg.plot .ev { stroke: var(--card); stroke-width: 1.5; pointer-events: none; }
.ev.lv-error { fill: var(--bad); } .ev.lv-warn { fill: var(--warn); } .ev.lv-ok { fill: var(--ok); } .ev.lv-action { fill: var(--accent); }
.ctip { position: fixed; z-index: 20; max-width: min(360px, calc(100vw - 8px)); padding: 7px 10px; border-radius: 6px;
  background: var(--card); color: var(--text); border: 1px solid var(--line); font-size: 12px; line-height: 1.4;
  box-shadow: 0 4px 14px rgba(0,0,0,.18); pointer-events: none; }
.ctip[hidden] { display: none; }
.ctip-when { color: var(--muted); margin-bottom: 3px; }
.ctip-row { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.ctip-ev { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--line); }
.lvl { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; }
.lvl i { width: 8px; height: 8px; border-radius: 50%; background: var(--off); flex: none; }
.lvl.lv-error i { background: var(--bad); } .lvl.lv-warn i { background: var(--warn); } .lvl.lv-ok i { background: var(--ok); }
.lvl.lv-action i { background: var(--accent); }
.chart .empty { margin: 6px 0 12px; }
details.datatable { margin-top: 10px; }
table.timeline td.when { white-space: nowrap; }
table.timeline td:nth-child(2), table.timeline td:nth-child(3) { white-space: nowrap; }
@media (max-width: 600px) { table.timeline td:nth-child(3) { display: none; } }
table.ctrmem td:last-child { min-width: 240px; }   /* phones: the table scrolls inside its box instead of tall rows */

/* Activity page (activity.py, static/activity.js): people keep one colour (c1-c24, assigned once) on every chart */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; min-width: 0; }
.kpi strong { display: block; font-size: 22px; line-height: 1.25; }
.who { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sw { width: 10px; height: 10px; border-radius: 2px; flex: none; background: var(--off); }
.sw.c1 { background: var(--c1); } .sw.c2 { background: var(--c2); } .sw.c3 { background: var(--c3); }
.sw.c4 { background: var(--c4); } .sw.c5 { background: var(--c5); } .sw.c6 { background: var(--c6); }
.sw.c7 { background: var(--c7); }
.sw.c8 { background: var(--c8); } .sw.c9 { background: var(--c9); }
.sw.c10 { background: var(--c10); } .sw.c11 { background: var(--c11); } .sw.c12 { background: var(--c12); }
.sw.c13 { background: var(--c13); } .sw.c14 { background: var(--c14); } .sw.c15 { background: var(--c15); }
.sw.c16 { background: var(--c16); }
.sw.c17 { background: var(--c17); } .sw.c18 { background: var(--c18); } .sw.c19 { background: var(--c19); } .sw.c20 { background: var(--c20); }
.sw.c21 { background: var(--c21); } .sw.c22 { background: var(--c22); } .sw.c23 { background: var(--c23); } .sw.c24 { background: var(--c24); }
.sw.c0 { background: var(--off); }
.sw.none { background: repeating-linear-gradient(135deg, var(--off) 0 2px, transparent 2px 4px); box-shadow: inset 0 0 0 1px var(--off); }
.sw.ref { height: 0; border-top: 2px dashed var(--text); border-radius: 0; background: none; width: 14px; }
.sw.q { border-radius: 2px; width: 16px; }
.sw.q1 { background: var(--q1); } .sw.q2 { background: var(--q2); } .sw.q3 { background: var(--q3); }
.sw.q4 { background: var(--q4); } .sw.q5 { background: var(--q5); } .sw.q6 { background: var(--q6); }
.sw.q0 { background: var(--code); box-shadow: inset 0 0 0 1px var(--line); }
table.people td, table.people th { white-space: nowrap; }
table.people tbody tr[data-person] { cursor: pointer; }
table.people tbody tr[data-person]:hover, table.people tbody tr[data-person]:focus-visible { background: var(--code); outline: none; }
table.people tr.on { background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
table.people tfoot td { color: var(--muted); }
.focus-chip { display: inline-flex; align-items: center; gap: 6px; }
.focus-chip[hidden] { display: none; }
.segctl button { border: 0; border-right: 1px solid var(--line); border-radius: 0; background: none; padding: 4px 10px;
  font-size: 13px; color: var(--text); }
.segctl button:last-child { border-right: 0; }
.segctl button:hover { background: var(--code); }
.segctl button.on { background: var(--accent); color: #fff; font-weight: 600; }
svg.plot .bar1 { fill: var(--c1); } svg.plot .bar2 { fill: var(--c2); } svg.plot .bar3 { fill: var(--c3); }
svg.plot .bar4 { fill: var(--c4); } svg.plot .bar5 { fill: var(--c5); } svg.plot .bar6 { fill: var(--c6); }
svg.plot .bar7 { fill: var(--c7); }
svg.plot .bar8 { fill: var(--c8); } svg.plot .bar9 { fill: var(--c9); }
svg.plot .bar10 { fill: var(--c10); } svg.plot .bar11 { fill: var(--c11); } svg.plot .bar12 { fill: var(--c12); }
svg.plot .bar13 { fill: var(--c13); } svg.plot .bar14 { fill: var(--c14); } svg.plot .bar15 { fill: var(--c15); }
svg.plot .bar16 { fill: var(--c16); }
svg.plot .bar17 { fill: var(--c17); } svg.plot .bar18 { fill: var(--c18); } svg.plot .bar19 { fill: var(--c19); } svg.plot .bar20 { fill: var(--c20); }
svg.plot .bar21 { fill: var(--c21); } svg.plot .bar22 { fill: var(--c22); } svg.plot .bar23 { fill: var(--c23); } svg.plot .bar24 { fill: var(--c24); }
svg.plot .bar0 { fill: var(--off); }
svg.plot .hatchbg { fill: color-mix(in srgb, var(--off) 35%, var(--card)); } svg.plot .hatchline { stroke: var(--off); stroke-width: 2; }
svg.plot .col.sel rect { filter: brightness(1.12); }
svg.plot .colhit { fill: transparent; }
svg.plot .refline { fill: none; stroke: var(--text); stroke-width: 2; stroke-dasharray: 5 3; opacity: .7; }
svg.heat { display: block; touch-action: pan-y; }
svg.heat:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg.heat text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
svg.heat .cell { stroke: var(--card); stroke-width: 2; }
svg.heat .cell.sel { stroke: var(--text); stroke-width: 2; }
svg.heat .q0 { fill: var(--code); } svg.heat .q1 { fill: var(--q1); } svg.heat .q2 { fill: var(--q2); }
svg.heat .q3 { fill: var(--q3); } svg.heat .q4 { fill: var(--q4); } svg.heat .q5 { fill: var(--q5); } svg.heat .q6 { fill: var(--q6); }
svg.heat .window { stroke: var(--text); stroke-width: 2; fill: none; }
svg.heat text.wtxt { fill: var(--text); font-size: 11px; }
.recent { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 4px 24px; }
.recent h3 { margin-top: 0; }
.recent td.when { white-space: nowrap; }
.recent td.what { min-width: 180px; }
.nowplay { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.nowplay .tile .bar span { background: var(--c1); }
.person-head { gap: 12px; margin-bottom: 6px; }
.person-head h1 { margin: 0; font-size: 20px; }
a.who { color: var(--text); }
a.who:hover { color: var(--accent); }
table.people-sync td { white-space: nowrap; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 0 14px; }
form.card.member label { display: block; font-size: 12px; color: var(--muted); margin-top: 8px; }
form.card.member label.check { display: inline-flex; align-items: center; gap: 6px; margin: 4px 14px 0 0; color: var(--text); font-size: 13px; }
.page { max-width: 1280px; margin: 0 auto; padding: 0 16px 16px; }
h2.page-h { font-size: 17px; margin: 4px 0 0; }
.hstrip { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.hstrip .hs { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: 13px; white-space: nowrap; }
.hstrip .hs:hover { text-decoration: none; color: var(--accent); }
.top .row a.small { color: var(--muted); }
.top .row a.small.active { color: var(--text); font-weight: 600; }
