@font-face { font-family: "Barlow SC"; src: url(fonts/BarlowSemiCondensed-Regular.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow SC"; src: url(fonts/BarlowSemiCondensed-SemiBold.woff) format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Cond"; src: url(fonts/BarlowCondensed-SemiBold.woff) format("woff"); font-weight: 600; font-display: swap; }

:root {
  --panel: #1b2328;
  --raised: #243038;
  --sunk: #151c20;
  --line: #34434c;
  --text: #e8edef;
  --muted: #93a3ab;
  --amber: #ffb020;
  --teal: #4fd1c5;
  --red: #ff3b30;
  --amber-dim: #5a4518;
  --teal-dim: #1d4a47;
  --r-s: 4px;
  --r-m: 8px;
  --gap: 10px;
  --top-h: 46px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--panel);
  color: var(--text);
  font: 400 14.5px/1.4 "Barlow SC", "Bahnschrift", "Segoe UI", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
h2 { font-size: 16px; font-weight: 600; margin: 0; }
h3 { font-size: 18px; font-weight: 600; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--red); min-height: 1.4em; margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--line); background: var(--raised); border-radius: var(--r-s);
  padding: 8px 14px; cursor: pointer; font-weight: 600; line-height: 1.1;
}
.btn:hover { border-color: #4b5e69; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--teal); color: #0f2524; border-color: var(--teal); }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 9px; font-size: 12.5px; }
.btn.icon { width: 46px; height: 40px; padding: 0; display: grid; place-items: center; }
.btn.icon svg { width: 20px; height: 20px; fill: currentColor; }
.btn:disabled { opacity: .35; cursor: default; }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.login-box { width: min(340px, 100%); display: grid; gap: 10px; }
.login-box input { padding: 10px 12px; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-s); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 600; margin-bottom: 14px; }

/* ---------- top bar ---------- */
.top {
  display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 16px;
  height: var(--top-h); padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--sunk);
  position: sticky; top: 0; z-index: 5;
}
.station { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 16px; white-space: nowrap; }
.lamp { width: 12px; height: 12px; border-radius: 50%; background: #3a2423; box-shadow: inset 0 0 0 1px #5b3330; flex: none; }
.lamp.on { background: var(--red); box-shadow: 0 0 9px 2px rgba(255, 59, 48, .55); }
.clock { font: 600 22px/1 "Barlow Cond", sans-serif; letter-spacing: .02em; }
.status { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pill { font-size: 12.5px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.pill.ok { color: var(--text); border-color: var(--teal-dim); background: rgba(79, 209, 197, .08); }
.pill.bad { color: #ffd1cd; border-color: #6b2b27; background: rgba(255, 59, 48, .1); }
.tabs { display: flex; gap: 2px; }
.tabs button { background: none; border: 0; padding: 6px 10px; border-radius: var(--r-s); cursor: pointer; color: var(--muted); font-weight: 600; }
.tabs button[aria-selected="true"] { color: var(--text); background: var(--raised); }

/* ---------- live layout ---------- */
.tab { padding: var(--gap) 14px 20px; }
.live {
  display: grid; gap: var(--gap);
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  grid-template-areas: "decks side" "carts side";
}
.decks { grid-area: decks; display: grid; gap: var(--gap); align-content: start; }
.carts { grid-area: carts; }
.side { grid-area: side; display: grid; gap: var(--gap); align-content: start; min-width: 0; }
.meters { display: grid; grid-template-columns: auto 1fr; gap: 14px; }
.panel { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-m); padding: 9px 12px; min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.panel-head h2 { margin-right: auto; }
.panel-head .muted { margin-right: auto; }
.empty { color: var(--muted); margin: 6px 0; }

/* ---------- decks: the countdown is still the hero, just smaller ---------- */
.deck {
  --c: var(--amber); --cd: var(--amber-dim);
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-m);
  padding: 7px 12px 9px; display: grid; gap: 5px;
}
.deck[data-deck="1"] { --c: var(--teal); --cd: var(--teal-dim); }
.deck.onair { border-color: var(--c); box-shadow: inset 4px 0 0 var(--c); }
.deck-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); min-height: 22px; }
.deck-name { font: 600 17px/1 "Barlow Cond", sans-serif; color: var(--c); }
.deck-tag { font-weight: 600; }
.deck.onair .deck-tag { color: var(--text); }
.deck-kind { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.deck-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "rem title side"; gap: 4px 14px; align-items: center; }
.remain { grid-area: rem; font: 600 44px/0.9 "Barlow Cond", sans-serif; color: var(--c); letter-spacing: .01em; min-width: 3.1ch; }
.deck:not(.onair) .remain { color: color-mix(in srgb, var(--c) 55%, var(--muted)); }
.deck.ending .remain { color: var(--red); }
.deck-title { grid-area: title; display: grid; min-width: 0; }
.deck-title .t { font-size: 18px; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-title .a { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck.empty .deck-title .t { color: var(--muted); font-weight: 400; font-size: 15px; }
.deck-side { grid-area: side; display: grid; gap: 3px; justify-items: end; }
.deck-time { display: flex; align-items: baseline; gap: 10px; font-size: 13px; }
.elapsed { color: var(--muted); }
.intro-cd { font: 600 15px/1 "Barlow Cond", sans-serif; color: var(--text); }
.intro-cd:empty { display: none; }
.deck:not(.onair) .intro-cd { color: var(--muted); }
.bar { position: relative; height: 7px; background: var(--sunk); border-radius: 2px; overflow: hidden; }
.bar .mk { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; }
.mk-intro { background: var(--text); }
.mk-mix { background: var(--red); }
.bar i { display: block; height: 100%; width: 0; background: var(--c); }
.deck:not(.onair) .bar i { background: var(--cd); }
.deck-ctl { display: flex; gap: 4px; }
.deck-ctl .btn.icon { width: 34px; height: 28px; }
.deck-ctl .btn.icon svg { width: 16px; height: 16px; }
.deck-ctl .btn[data-cmd="play"] { color: var(--c); }

.modes { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.toggle {
  text-align: left; display: flex; align-items: center; padding: 7px 12px; border-radius: var(--r-m); cursor: pointer;
  background: var(--sunk); border: 1px solid var(--line);
}
.toggle[aria-pressed="true"] { border-color: var(--teal); background: rgba(79, 209, 197, .1); }
.toggle[aria-pressed="true"] b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); margin-right: 7px; vertical-align: 1px; }
.btn.next { font-size: 15px; padding: 0 20px; }

/* ---------- queue ---------- */
.qlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 52vh; overflow: auto; align-content: start; }
.qlist li {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto auto; gap: 8px; align-items: center;
  padding: 4px 6px 4px 8px; border-radius: var(--r-s); background: var(--sunk); cursor: grab;
}
.qlist li.drag { opacity: .4; }
.qlist li.over { box-shadow: inset 0 2px 0 var(--teal); }
.q-at { color: var(--muted); font-size: 12.5px; }
.q-t { min-width: 0; line-height: 1.25; }
.q-t b { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-t > span { color: var(--muted); font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-len { color: var(--muted); font-size: 13px; }
.q-act { display: flex; gap: 0; }
.q-act button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 3px 5px; border-radius: var(--r-s); }
.q-act button:hover { color: var(--text); background: var(--raised); }
.kind { font-size: 11.5px; padding: 0 5px; border-radius: 3px; margin-left: 6px; vertical-align: 1px; }
.kind-jingle { background: #3b2f57; color: #d6c8ff; }
.kind-ad { background: #5a3a19; color: #ffd7a8; }
.kind-show { background: #233f5c; color: #bcdcff; }
.next-ev { margin-top: 6px; color: var(--muted); font-size: 13px; }
.next-ev:empty { display: none; }

/* ---------- carts ---------- */
.cart-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(46px, auto); gap: 6px; }
.cart {
  --k: #4a5b65;
  position: relative; padding: 5px 8px 5px 13px; text-align: left; cursor: pointer;
  border-radius: var(--r-s); border: 1px solid var(--line); background: var(--sunk); overflow: hidden;
  display: grid; align-content: space-between;
}
.cart::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--k); }
.cart b { font-weight: 600; font-size: 14px; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cart small { color: var(--muted); font-size: 12px; }
.cart.blank { color: var(--muted); border-style: dashed; }
.cart.blank::before { display: none; }
.cart.playing { background: color-mix(in srgb, var(--k) 30%, var(--sunk)); border-color: var(--k); }
.cart.playing small { color: var(--text); }
.carts.editing .cart { outline: 1px dashed var(--muted); outline-offset: -4px; }

/* ---------- meters + history ---------- */
.vu { display: grid; grid-template-columns: 14px 14px auto; gap: 5px; min-height: 160px; }
.vu-ch { position: relative; background: var(--sunk); border-radius: 2px; overflow: hidden; display: flex; flex-direction: column-reverse; }
.vu-ch i { display: block; width: 100%; height: 0; background: linear-gradient(to top, var(--teal) 0 70%, var(--amber) 70% 90%, var(--red) 90%); background-size: 100% var(--vh, 160px); background-position: bottom; }
.vu-ch .pk { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--text); opacity: .85; }
.vu-scale { position: relative; width: 20px; font-size: 10.5px; color: var(--muted); }
.vu-scale span { position: absolute; left: 0; transform: translateY(-50%); line-height: 1; }
.vu-scale span:first-child { transform: none; }
.vu-scale span:last-child { transform: translateY(-100%); }
.hist { min-width: 0; display: flex; flex-direction: column; }
/* the list fills whatever height the panel gets from the row (contain: size keeps it from stretching the row itself) */
.hist ol { list-style: none; padding: 0; margin: 5px 0 0; flex: 1 1 auto; min-height: 150px; contain: size; overflow: auto; font-size: 13px; }
.hist li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; padding: 2px 0; border-bottom: 1px solid #2c3940; }
.hist li span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist .when { color: var(--muted); }
.hist li.day { display: block; color: var(--muted); font-size: 12px; font-weight: 600; padding: 7px 0 2px; border-bottom: 1px solid var(--line); }

/* ---------- library ---------- */
.lib-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.lib-bar input[type=search] { flex: 1 1 260px; padding: 9px 12px; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-s); }
.seg { display: flex; border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; }
.seg button { background: none; border: 0; padding: 7px 11px; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--raised); color: var(--text); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r-m); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; padding: 8px 10px; background: var(--sunk); position: sticky; top: 0; }
.tbl td { padding: 6px 10px; border-top: 1px solid #2c3940; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.tbl .num { text-align: right; }
.tbl td.act { text-align: right; }
.tbl td.act button { margin-left: 4px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 12px; }

/* ---------- schedule ---------- */
.ev-list { display: grid; gap: 8px; }
.ev {
  display: grid; grid-template-columns: auto 74px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-m); padding: 10px 14px;
}
.ev.off { opacity: .55; }
.ev-time { font: 600 28px/1 "Barlow Cond", sans-serif; }
.ev-main b { display: block; font-weight: 600; }
.ev-main span { color: var(--muted); font-size: 13.5px; }
.ev-act { display: flex; gap: 6px; }
.days { display: flex; gap: 4px; }
.days label { display: grid; place-items: center; width: 34px; height: 30px; border: 1px solid var(--line); border-radius: var(--r-s); cursor: pointer; }
.days input { position: absolute; opacity: 0; pointer-events: none; }
.days label:has(input:checked) { background: var(--teal); color: #0f2524; border-color: var(--teal); }
.days label:has(input:focus-visible) { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ---------- settings & forms ---------- */
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(300px, calc(25% - var(--gap))), 1fr)); gap: var(--gap); }
fieldset { border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px 16px 16px; margin: 0; background: var(--raised); display: grid; gap: 10px; align-content: start; min-width: 0; }
fieldset.wide { grid-column: 1 / -1; }
legend { font-weight: 600; padding: 0 6px; }
fieldset > .btn { justify-self: start; }
.subhead { font-weight: 600; margin-top: 6px; }
label { display: grid; gap: 4px; color: var(--muted); font-size: 13.5px; }
label.row, .row { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  padding: 8px 10px; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-s); color: var(--text); min-width: 0; width: 100%;
}
.row input:not([type=checkbox]) { flex: 1; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--teal); }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.folders, .targets { display: grid; gap: 8px; }
.folder, .target { display: grid; gap: 8px; align-items: end; background: var(--sunk); padding: 8px 10px; border-radius: var(--r-s); }
.folder { grid-template-columns: minmax(0, 1fr) 150px auto; }
.target { grid-template-columns: auto 170px minmax(0, 1.4fr) 90px minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1fr) 120px auto; }
.folder .path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; align-self: center; }
.set-actions { grid-column: 1 / -1; display: flex; gap: 14px; align-items: center; position: sticky; bottom: 0; padding: 12px 0; background: var(--panel); }
.set-actions #logout { margin-left: auto; }

/* ---------- dialog ---------- */
dialog { background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-m); padding: 0; width: min(720px, 94vw); max-height: 86vh; }
dialog::backdrop { background: rgba(10, 14, 16, .7); }
.dlg { display: grid; gap: 12px; padding: 14px 16px 16px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pick-list { list-style: none; padding: 0; margin: 0; max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-s); }
.pick-list li { padding: 7px 10px; border-bottom: 1px solid #2c3940; cursor: pointer; display: flex; gap: 8px; }
.pick-list li:hover, .pick-list li:focus-visible { background: var(--sunk); }
.pick-list li.dir::before { content: ""; width: 14px; height: 11px; margin-top: 4px; border: 1.5px solid var(--muted); border-radius: 2px; flex: none; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches label { width: 30px; height: 30px; border-radius: 4px; cursor: pointer; display: block; border: 2px solid transparent; }
.swatches input { position: absolute; opacity: 0; }
.swatches label:has(input:checked) { border-color: var(--text); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-grid .full { grid-column: 1 / -1; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* whole live view fits the window: lists scroll inside their panels, the page does not.
   Left: the two decks share all the height the jingle rows leave; they grow with the window.
   Right: queue on top, history below (a bit more than half). */
@media (min-width: 980px) and (min-height: 600px) {
  .live {
    height: calc(100vh - var(--top-h)); padding-bottom: var(--gap);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .decks { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) auto; align-content: stretch; min-height: 0; }
  .deck { grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; padding: 8px 14px 12px; }
  .deck-main { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title title" "rem side"; align-content: center; gap: 2px 14px; }
  .remain { font-size: clamp(40px, calc(13vh - 30px), 110px); align-self: end; }
  .deck-title .t { font-size: clamp(17px, calc(2.2vh + 6px), 28px); }
  .deck-title .a { font-size: clamp(13px, calc(1.4vh + 4px), 19px); }
  .deck-side { align-self: end; }
  .deck-ctl { gap: clamp(6px, 1vh, 10px); }
  .deck-ctl .btn.icon { width: clamp(46px, 8vh, 78px); height: clamp(36px, 6vh, 58px); border-radius: 6px; }
  .deck-ctl .btn.icon svg { width: clamp(18px, 3vh, 30px); height: clamp(18px, 3vh, 30px); }
  .deck-time { font-size: clamp(13px, 1.6vh, 16px); }
  .intro-cd { font-size: clamp(15px, 2.4vh, 24px); }
  .bar { height: clamp(7px, 1.1vh, 12px); }
  .side { display: flex; flex-direction: column; min-height: 0; }
  .queue { flex: 1 1 0; min-height: 0; }
  .meters { flex: 1.2 1 0; min-height: 0; }
  .queue { display: flex; flex-direction: column; }
  .qlist { flex: 1 1 auto; min-height: 0; max-height: none; }
  .cart-grid { grid-auto-rows: 50px; }
  .vu { min-height: 0; }
  .hist ol { min-height: 0; }
  .status { flex-wrap: nowrap; min-width: 0; overflow: hidden; }
  .pill { min-width: 0; flex: 0 1 auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 979px) {
  .live { grid-template-columns: 1fr; grid-template-areas: "decks" "carts" "side"; }
  .target { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .top { grid-template-columns: 1fr auto; gap: 8px 12px; padding: 8px 12px; height: auto; }
  .status { grid-column: 1 / -1; justify-content: flex-start; }
  .tabs { grid-column: 1 / -1; overflow-x: auto; }
  .tab { padding: 10px 10px 20px; }
  .deck-main { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "title title" "rem side"; }
  .remain { font-size: 40px; }
  .deck-title .t { font-size: 17px; }
  .modes { grid-template-columns: 1fr 1fr; }
  .modes .next { grid-column: 1 / -1; padding: 10px; }
  .cart-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .meters { grid-template-columns: 1fr; }
  .vu { height: 26px; min-height: 0; grid-template-columns: 1fr; grid-template-rows: 10px 10px; }
  .vu-ch { flex-direction: row; }
  .vu-ch i { height: 100% !important; width: var(--w, 0); background: linear-gradient(to right, var(--teal) 0 70%, var(--amber) 70% 90%, var(--red) 90%); background-size: var(--vw, 100%) 100%; background-position: left; }
  .vu-ch .pk { top: 0; bottom: 0 !important; right: auto; width: 2px; height: auto; left: var(--p, 0); }
  .vu-scale { display: none; }
  .cols3, .form-grid { grid-template-columns: 1fr; }
  .folder { grid-template-columns: 1fr; }
  .ev { grid-template-columns: auto 1fr; }
  .ev-main { grid-column: 1 / -1; }
  .ev-act { grid-column: 1 / -1; }
  .tbl th:nth-child(4), .tbl td:nth-child(4), .tbl th:nth-child(5), .tbl td:nth-child(5), .tbl th:nth-child(6), .tbl td:nth-child(6) { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- deck effects, transitions, seek ---------- */
.chip { background: var(--sunk); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.chip[aria-pressed="true"] { color: #0f2524; background: var(--teal); border-color: var(--teal); }
.chip:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.deck-head .chip { padding: 2px 9px; }
.chip.trans:empty { display: none; }
.deck.seekable .bar { cursor: pointer; }
.deck.seekable .bar:hover { outline: 1px solid var(--muted); }
.q-chips { display: flex; gap: 4px; }
.q-chips .chip { padding: 1px 8px; font-size: 12px; }
.hist-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
#grInfo { font-variant-numeric: tabular-nums; white-space: nowrap; }
.eq { grid-template-columns: 1fr auto; align-items: center; }
.eq input[type=range] { grid-column: 1 / -1; accent-color: var(--teal); padding: 0; }
.eq output { color: var(--text); grid-row: 1; grid-column: 2; }
.deck .chip[aria-pressed="true"] { background: var(--c); border-color: var(--c); }

/* ---------- marker editor ---------- */
.mk-wave { width: 100%; height: 140px; display: block; background: var(--sunk); border-radius: 4px; cursor: crosshair; touch-action: none; }
.mk-play { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mk-time { font: 600 22px/1 "Barlow Cond", sans-serif; font-variant-numeric: tabular-nums; min-width: 9ch; }
.mk-rows { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px 12px; align-items: center; }
.mk-rows .k { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.mk-rows .k i { width: 10px; height: 10px; border-radius: 2px; }
.mk-rows .v { font-variant-numeric: tabular-nums; color: var(--muted); }
.mk-rows .v.set { color: var(--text); }
.lib-mk { color: var(--muted); font-size: 12px; margin-left: 6px; }

/* library: artists on the left, their songs on the right */
.lib-groups { margin-bottom: 10px; flex-wrap: wrap; width: fit-content; max-width: 100%; }
.lib-body { display: grid; grid-template-columns: minmax(200px, 270px) minmax(0, 1fr); gap: var(--gap); }
.lib-artists { display: flex; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--panel); overflow: hidden; min-height: 0; }
.lib-letters { display: flex; flex-direction: column; overflow-y: auto; border-right: 1px solid var(--line); background: var(--sunk); flex: none; padding: 2px 0; }
.lib-letters button { background: none; border: 0; color: var(--muted); font: 600 12px/1 "Barlow SC", sans-serif; padding: 4px 8px; cursor: pointer; }
.lib-letters button:hover, .lib-letters button:focus-visible { color: var(--amber); }
#libArtists { list-style: none; margin: 0; padding: 4px; overflow-y: auto; flex: 1; position: relative; min-width: 0; }
#libArtists button { display: flex; width: 100%; gap: 8px; align-items: baseline; background: none; border: 0; color: var(--text); padding: 5px 8px; border-radius: var(--r-s); cursor: pointer; text-align: left; font: inherit; }
#libArtists button:hover { background: var(--raised); }
#libArtists button[aria-pressed="true"] { background: var(--amber-dim); }
#libArtists .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#libArtists .n { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
#libArtists li:first-child button { font-weight: 600; }
.lib-tracks { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.tbl th[data-sort] { cursor: pointer; user-select: none; }
.tbl th[data-sort]:hover { color: var(--text); }
.tbl th[aria-sort="ascending"]::after { content: " ▲"; font-size: 10px; }
.tbl th[aria-sort="descending"]::after { content: " ▼"; font-size: 10px; }
@media (min-width: 980px) {
  #tab-library:not([hidden]) { display: flex; flex-direction: column; height: calc(100vh - var(--top-h)); }
  .lib-body { flex: 1; min-height: 0; }
  .lib-tracks .table-wrap { flex: 1; min-height: 0; }
}
@media (max-width: 979px) {
  .lib-body { grid-template-columns: 1fr; }
  .lib-artists { height: 220px; }
}
#webStatus.warn { color: var(--red, #e5534b); }
