/* StemDeck — a practice console. Fader-cap colours per stem, a scrolling chord chart up top. */
:root {
  --ink: #18202b;        /* console body */
  --panel: #212b38;      /* channel strip */
  --panel-2: #2a3646;
  --line: #34425479;
  --text: #ebe6da;       /* warm white, like silkscreen paint */
  --muted: #95a1b2;
  --hot: #f2b544;        /* amber: playhead, active */

  --vocals: #f2b544;
  --drums: #e5675a;
  --bass: #5bb3a6;
  --guitar: #a593ea;
  --piano: #ebe6da;
  --other: #7fa3c8;

  --sec-intro: #4a5a70;
  --sec-verse: #3f6f8f;
  --sec-prechorus: #6d6aa8;
  --sec-chorus: #b8863a;
  --sec-bridge: #8f5a7d;
  --sec-instrumental: #4f7a63;
  --sec-outro: #4a5a70;

  --display: "Barlow Condensed", "Avenir Next Condensed", "Arial Narrow", sans-serif;
  --body: "Familjen Grotesk", -apple-system, "Helvetica Neue", sans-serif;
  --r-sm: 4px;
  --r-md: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ink);
  color: var(--text);
  font: 15px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
}
button, input, output { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--hot); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.app { display: grid; grid-template-columns: 300px 1fr; height: 100vh; }

/* ---------------- library ---------------- */
.library {
  background: #141b24;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
  padding: 18px 14px;
  gap: 12px;
}
.brand { font: 700 26px/1 var(--display); letter-spacing: .01em; padding: 2px 4px 6px; }
.add { display: flex; gap: 6px; }
.add input {
  flex: 1; min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 9px 10px;
}
.add input::placeholder { color: var(--muted); }
.add button, .head-actions button, .toggle, .step {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px 12px;
}
.add button { background: var(--hot); color: #1b1408; border-color: transparent; font-weight: 600; }
.drop {
  display: block; text-align: center; color: var(--muted); font-size: 13px;
  border: 1px dashed #3d4b5e; border-radius: var(--r-md); padding: 14px 8px; cursor: pointer;
}
.drop.over { border-color: var(--hot); color: var(--text); }
.tracks { list-style: none; margin: 4px 0 0; padding: 0; overflow-y: auto; flex: 1; }
.tracks li {
  display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center;
  padding: 8px; border-radius: var(--r-md); cursor: pointer;
}
.tracks li:hover { background: #1b2430; }
.tracks li[aria-current="true"] { background: var(--panel); }
.tracks .thumb {
  width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--panel-2) center/cover;
}
.tracks .meta { min-width: 0; }
.tracks .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tracks .a { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tracks .bar { height: 3px; background: #2b3747; border-radius: 2px; margin-top: 6px; overflow: hidden; }
.tracks .bar i { display: block; height: 100%; background: var(--hot); transition: width .4s; }
.tracks .err { color: var(--drums); font-size: 12px; }

/* ---------------- empty ---------------- */
.empty { display: grid; place-content: center; padding: 40px; max-width: 640px; margin: 0 auto; }
.empty h2 { font: 600 40px/1.05 var(--display); margin: 0 0 12px; }
.empty p { color: var(--muted); margin: 0; }

/* ---------------- deck ---------------- */
.deck {
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  padding: 20px 24px 0; gap: 14px;
}
.deck[hidden], .empty[hidden] { display: none; }

.song-head { display: flex; align-items: end; gap: 28px; flex-wrap: wrap; }
.titles { flex: 1; min-width: 240px; }
.titles h1 { font: 700 44px/1 var(--display); margin: 0; letter-spacing: .005em; }
.titles p { margin: 4px 0 0; color: var(--muted); font-size: 17px; }
.facts { display: flex; gap: 22px; margin: 0; }
.facts div { display: flex; flex-direction: column-reverse; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 0; font: 600 26px/1.1 var(--display); }
.head-actions { display: flex; gap: 6px; }
.ghost { background: transparent !important; color: var(--muted); }
.ghost:hover { color: var(--text); }
.danger:hover { color: var(--drums); border-color: var(--drums); }

/* ---------------- chord ribbon (the hero) ---------------- */
.chords {
  position: relative; height: 92px; overflow: hidden;
  background: var(--panel); border-radius: var(--r-md);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.chord-track { position: absolute; top: 0; bottom: 0; left: 0; will-change: transform; }
.chord {
  position: absolute; top: 14px; bottom: 14px;
  border-left: 2px solid #3a4859;
  padding-left: 10px;
  font: 600 40px/64px var(--display);
  color: #6f7d90;
  white-space: nowrap;
  cursor: pointer;
}
.chord.n { color: #46556a; font-size: 26px; }
.chord.on { color: var(--text); border-left-color: var(--hot); }
.chord.next { color: #b6bfcc; }
.chord-now {
  position: absolute; top: 0; bottom: 0; left: 30%;
  width: 2px; background: var(--hot); opacity: .9; pointer-events: none;
}

/* ---------------- timeline ---------------- */
.timeline { display: grid; gap: 6px; }
.sections { position: relative; height: 28px; }
.sec {
  position: absolute; top: 0; bottom: 0;
  border-radius: var(--r-sm);
  font-size: 12px; font-weight: 600; line-height: 28px;
  padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border: 0; text-align: left; color: #f4efe4;
  background: var(--sec-verse);
}
.sec + .sec { margin-left: 2px; }
.sec.intro { background: var(--sec-intro); }
.sec.prechorus { background: var(--sec-prechorus); }
.sec.chorus { background: var(--sec-chorus); }
.sec.bridge { background: var(--sec-bridge); }
.sec.instrumental { background: var(--sec-instrumental); }
.sec.outro { background: var(--sec-outro); }
.sec.on { box-shadow: inset 0 -3px 0 var(--hot); }
.wave-wrap { position: relative; height: 84px; cursor: text; touch-action: none; }
#wave { width: 100%; height: 100%; display: block; }
.playhead { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--hot); left: 0; pointer-events: none; }
.loop-region {
  position: absolute; top: 0; bottom: 0;
  background: rgba(242, 181, 68, .14);
  border-left: 2px solid var(--hot); border-right: 2px solid var(--hot);
  pointer-events: none;
}
.loop-region.off { background: rgba(149, 161, 178, .08); border-color: #5b6878; }
.times { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------------- lower: lyrics + mixer ---------------- */
.lower { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; min-height: 180px; flex: 1; }
.lyrics { min-height: 0; position: relative; }
.lyrics-scroll {
  height: 100%; overflow-y: auto; scroll-behavior: smooth;
  padding: 30% 4px 40%;
  mask-image: linear-gradient(transparent, #000 18%, #000 75%, transparent);
}
.line {
  font: 600 26px/1.25 var(--display); color: #5d6a7c;
  margin: 0 0 12px; cursor: pointer; max-width: 32ch;
  transition: color .2s;
}
.line:hover { color: #8794a6; }
.line.past { color: #46536479; }
.line.on { color: var(--text); }
.line .w.sung { color: var(--hot); }
.line.marker { font: 500 14px/1 var(--body); color: var(--muted); margin: 22px 0 10px; cursor: default; }
.lyrics-plain { white-space: pre-wrap; color: var(--muted); font-size: 16px; padding: 12px 4px; }
.lyrics-none { color: var(--muted); padding: 12px 4px; }

.strips { display: flex; gap: 8px; height: 100%; padding-bottom: 6px; overflow-x: auto; }
.strip {
  width: 76px; background: var(--panel); border-radius: var(--r-md);
  display: grid; grid-template-rows: auto auto 1fr auto; justify-items: center;
  padding: 10px 6px 12px; gap: 8px; min-height: 0;
  border-top: 3px solid var(--cap);
}
.strip .name { font: 600 17px/1 var(--display); display: grid; justify-items: center; gap: 4px; }
.strip .name .kit { font: 600 11px/1 var(--body); padding: 3px 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--muted); }
.strip .name .kit[aria-pressed="true"] { background: var(--drums); color: #1a0e0c; border-color: transparent; }
.strips.has-kit .strip .name { min-height: 40px; align-content: start; }  /* rows stay aligned with the Kit button */
.lower { grid-template-columns: minmax(300px, 1fr) minmax(0, max-content); }  /* many strips scroll instead of squeezing lyrics */
.mixer { min-width: 0; }
.strip .ms { display: flex; gap: 4px; }
.strip .ms button {
  width: 28px; height: 24px; padding: 0; font-size: 12px; font-weight: 600;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--muted);
}
.strip .ms .m[aria-pressed="true"] { background: var(--drums); color: #1a0e0c; border-color: transparent; }
.strip .ms .s[aria-pressed="true"] { background: var(--hot); color: #1b1408; border-color: transparent; }
.strip input[type="range"] {
  writing-mode: vertical-lr; direction: rtl;
  width: 34px; min-height: 90px; height: 100%;
  accent-color: var(--cap);
  appearance: auto;
}
.strip .dl { font-size: 12px; color: var(--muted); text-decoration: none; }
.eq { background: var(--panel); border-radius: var(--r-md); padding: 10px 14px 12px; align-self: start; }
.lower:has(> .eq:not([hidden])) > .lyrics { display: none; }  /* EQ takes the lyrics' place while open */
.eq-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.eq-head strong { font: 600 17px/1 var(--display); }
.eq-hint { color: var(--muted); font-size: 12px; flex: 1; }
.eq-bands { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; justify-items: center; }
.eq .band { display: grid; justify-items: center; gap: 4px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.eq .band input { writing-mode: vertical-lr; direction: rtl; width: 28px; height: 110px; accent-color: var(--hot); appearance: auto; }
.eq .band .db { color: var(--text); }
.strip .dl:hover { color: var(--text); }
.strip.muted { opacity: .5; }
.strip.master { --cap: var(--text); background: #263141; }

/* ---------------- transport ---------------- */
.transport {
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  border-top: 1px solid var(--line);
  margin: 0 -24px; padding: 12px 24px 14px;
  background: #1b2330;
}
.t-group { display: flex; align-items: center; gap: 8px; }
.round {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--panel-2); border: 1px solid var(--line);
  display: grid; place-items: center; padding: 0;
}
.round svg { width: 18px; height: 18px; fill: currentColor; }
.round.play { width: 52px; height: 52px; background: var(--hot); color: #1b1408; border: 0; }
.round.play svg { width: 22px; height: 22px; }
.play .i-pause, .playing .play .i-play { display: none; }
.playing .play .i-pause { display: block; }
.toggle[aria-pressed="true"] { background: var(--hot); color: #1b1408; border-color: transparent; font-weight: 600; }
.k-label { color: var(--muted); font-size: 13px; }
.knob output { font: 600 22px/1 var(--display); min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; }
.step { width: 32px; height: 32px; padding: 0; font-size: 18px; line-height: 1; }
#tempo { width: 140px; accent-color: var(--hot); }
.status { color: var(--muted); font-size: 13px; margin-left: auto; }
.status.busy::before {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; vertical-align: -1px;
  border: 2px solid var(--hot); border-right-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-veil {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
  background: rgba(24, 32, 43, .86); z-index: 5; color: var(--muted);
}
.loading-veil strong { display: block; font: 600 30px/1.1 var(--display); color: var(--text); margin-bottom: 8px; }
.loading-veil .bar { width: 320px; height: 4px; background: #2b3747; border-radius: 2px; margin: 14px auto 0; overflow: hidden; }
.loading-veil .bar i { display: block; height: 100%; background: var(--hot); transition: width .4s; }
.deck { position: relative; }

@media (max-width: 1000px) {
  .app { grid-template-columns: minmax(0, 1fr); height: auto; }  /* plain 1fr grows to the chord ribbon's width */
  .library { max-height: 320px; }
  .lower { grid-template-columns: 1fr; }
  .lyrics { height: 260px; }
  .lyrics-scroll { padding: 80px 4px 110px; }  /* % padding follows width, overflowing the 260px box */
  .strips { overflow-x: auto; height: 260px; }
}
@media (prefers-reduced-motion: reduce) {
  .lyrics-scroll { scroll-behavior: auto; }
  .status.busy::before { animation: none; }
}

/* ---------------- sidebar tabs, catalog, setlists ---------------- */
.tabs { display: flex; gap: 4px; background: #10161e; padding: 3px; border-radius: var(--r-md); }
.tabs button, .ed-tabs button {
  flex: 1; background: transparent; border: 0; border-radius: 6px; padding: 7px 8px; color: var(--muted); font-weight: 500;
}
.tabs button[aria-selected="true"], .ed-tabs button[aria-selected="true"] { background: var(--panel-2); color: var(--text); }
.pane { display: flex; flex-direction: column; gap: 12px; min-height: 0; flex: 1; }
.pane[hidden] { display: none; }
.find { display: flex; gap: 6px; }
.find input, .find select, .version-bar select, .sl-head input, .ed-row input {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 9px; min-width: 0;
}
.find input { flex: 1; }
.find select { width: 92px; }
select { color: var(--text); }
.tracks .a b { font-weight: 500; color: #b9c2cf; }
.wide { width: 100%; padding: 9px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm); }
.primary { background: var(--hot) !important; color: #1b1408 !important; border-color: transparent !important; font-weight: 600; }
.link { background: none; border: 0; padding: 4px 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }
.link.danger:hover { color: var(--drums); }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.setlists { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.setlists li { padding: 10px 8px; border-radius: var(--r-md); cursor: pointer; }
.setlists li:hover { background: #1b2430; }
.setlists .t { font-weight: 600; }
.setlists .a { color: var(--muted); font-size: 13px; }
#setlist-index, #setlist-detail { display: flex; flex-direction: column; gap: 10px; min-height: 0; flex: 1; }
#setlist-index[hidden], #setlist-detail[hidden] { display: none; }
.sl-head { display: grid; gap: 6px; }
.sl-head .link { justify-self: start; }
#sl-name { font: 600 22px/1.1 var(--display); }
.sl-items { margin: 0; padding: 0; list-style: none; overflow-y: auto; flex: 1; counter-reset: sl; }
.sl-items li {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center;
  padding: 8px 6px; border-radius: var(--r-md); background: var(--panel); margin-bottom: 6px; cursor: grab;
  counter-increment: sl;
}
.sl-items li::before { content: counter(sl); color: var(--muted); font: 600 18px/1 var(--display); text-align: center; }
.sl-items li.now { box-shadow: inset 3px 0 0 var(--hot); }
.sl-items li.drag-over { outline: 2px dashed var(--hot); }
.sl-items .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.sl-items select { margin-top: 4px; width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px 6px; font-size: 13px; }
.sl-items .x { background: none; border: 0; color: var(--muted); font-size: 18px; padding: 2px 6px; }
.sl-items .x:hover { color: var(--drums); }
.sl-actions { display: grid; gap: 8px; }

/* ---------------- version bar & editor ---------------- */
.version-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.version-bar button { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 12px; }
.version-bar select { max-width: 220px; }
.spacer { flex: 1; }
.dirty { color: var(--hot); font-size: 13px; }
.editor { background: var(--panel); border-radius: var(--r-md); padding: 12px; display: grid; gap: 10px; }
.editor[hidden] { display: none; }
.ed-tabs { display: flex; gap: 4px; background: #1a222d; padding: 3px; border-radius: var(--r-md); max-width: 460px; }
.ed-pane { display: grid; gap: 10px; }
.ed-pane[hidden] { display: none; }
.ed-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ed-row button:not(.link) { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 12px; }
.arr-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; min-height: 40px; }
.arr-list li, .palette button {
  display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-sm);
  padding: 7px 8px 7px 10px; font-size: 13px; font-weight: 600; color: #f4efe4; background: var(--sec-verse); border: 0;
}
.arr-list li { cursor: grab; }
.arr-list li.dragging { opacity: .4; }
.arr-list li.drag-over { outline: 2px dashed var(--hot); outline-offset: 2px; }
.arr-list li small { font-weight: 400; opacity: .75; }
.arr-list li button { background: rgba(0,0,0,.25); border: 0; border-radius: 3px; color: inherit; width: 20px; height: 20px; padding: 0; line-height: 1; }
.palette { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.palette button { opacity: .85; }
.palette button:hover { opacity: 1; }
.palette button::before { content: "+"; opacity: .7; }
.k-intro, .k-outro { background: var(--sec-intro) !important; }
.k-prechorus, .k-postchorus { background: var(--sec-prechorus) !important; }
.k-chorus, .k-tag { background: var(--sec-chorus) !important; }
.k-bridge, .k-breakdown { background: var(--sec-bridge) !important; }
.k-instrumental, .k-solo { background: var(--sec-instrumental) !important; }
.sec.selected { outline: 2px solid var(--text); outline-offset: -2px; }
.sec.seam::after { content: ""; position: absolute; left: -2px; top: -3px; bottom: -3px; width: 2px; background: var(--hot); }
.handle {
  position: absolute; top: -4px; bottom: -92px; width: 12px; margin-left: -6px; cursor: ew-resize; z-index: 3;
}
.handle::after { content: ""; position: absolute; left: 5px; top: 0; bottom: 0; width: 2px; background: rgba(235,230,218,.55); }
.handle:hover::after, .handle.drag::after { background: var(--hot); }
.setlist-nav .sl-pos { display: grid; line-height: 1.15; min-width: 120px; max-width: 220px; }
.setlist-nav #sl-pos { color: var(--muted); font-size: 12px; }
.setlist-nav #sl-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titles [contenteditable="true"] { outline: 1px dashed var(--muted); outline-offset: 4px; }

/* ---------------- time range on import ---------------- */
.range { font-size: 13px; color: var(--muted); }
.range summary { cursor: pointer; padding: 2px 2px; }
.range[open] summary { color: var(--text); }
.range-row { display: flex; gap: 8px; margin: 8px 0 6px; }
.range-row label { flex: 1; display: grid; gap: 4px; }
.range-row input {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 7px 9px; min-width: 0; font-variant-numeric: tabular-nums;
}
.tracks .clip { color: var(--hot); }

/* ---------------- scheduling + calendar ---------------- */
.brand-row { display: flex; align-items: center; justify-content: space-between; }
.cal-btn { border: 1px solid var(--line) !important; border-radius: var(--r-sm); padding: 6px 10px; }
.cal-btn[aria-pressed="true"] { color: var(--hot); border-color: var(--hot) !important; }
.ghost-btn { background: transparent; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 12px; color: var(--muted); }
.ghost-btn:hover { color: var(--text); }

.sl-when { display: grid; grid-template-columns: 1.4fr 1fr .8fr; gap: 6px; }
.sl-when label, .sl-field { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.sl-when input, .sl-field input, .sl-field textarea {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 6px 7px; min-width: 0; color: var(--text); font: 14px/1.3 var(--body); color-scheme: dark;
}
.sl-field textarea { resize: vertical; min-height: 44px; }
.sl-more { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
a.link { cursor: pointer; }

.setlist-groups { overflow-y: auto; flex: 1; display: grid; align-content: start; gap: 4px; }
.setlist-groups h3 { font: 500 12px/1 var(--body); color: var(--muted); margin: 12px 8px 4px; }
.setlist-groups ul { list-style: none; margin: 0; padding: 0; }
.setlist-groups li {
  display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center;
  padding: 8px; border-radius: var(--r-md); cursor: pointer;
}
.setlist-groups li:hover { background: #1b2430; }
.setlist-groups .day { display: grid; text-align: center; line-height: 1; border-radius: var(--r-sm); background: var(--panel); padding: 5px 0 6px; }
.setlist-groups .day b { font: 600 20px/1 var(--display); }
.setlist-groups .day small { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.setlist-groups .upcoming .day { box-shadow: inset 0 3px 0 var(--hot); }
.setlist-groups .past { opacity: .6; }
.setlist-groups .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setlist-groups .a { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.calendar { display: flex; flex-direction: column; gap: 14px; padding: 20px 24px; min-height: 0; overflow: auto; }
.calendar[hidden] { display: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cal-nav, .cal-actions { display: flex; align-items: center; gap: 8px; }
.cal-nav h2 { font: 700 40px/1 var(--display); margin: 0 6px; min-width: 7.5em; text-transform: capitalize; }
.cal-nav .round svg { fill: none; stroke: currentColor; stroke-width: 2.4; }

.up-next {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  background: var(--panel); border-radius: var(--r-md); padding: 12px 16px; border-left: 3px solid var(--hot);
}
.up-next:empty { display: none; }
.up-next .when { font: 600 26px/1 var(--display); color: var(--hot); }
.up-next .what { font-weight: 600; font-size: 17px; }
.up-next .meta { color: var(--muted); font-size: 13px; }
.up-next button { margin-left: auto; }

.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 12px; color: var(--muted); padding: 0 6px 2px; text-transform: capitalize; }
.cal-day {
  background: #1d2632; border-radius: var(--r-sm); min-height: 104px; padding: 6px;
  display: flex; flex-direction: column; gap: 4px; cursor: pointer; position: relative;
}
.cal-day:hover { background: #222d3a; }
.cal-day.out { background: #18202a; }
.cal-day.out .num { color: #4d5a6b; }
.cal-day.past .chip { opacity: .55; }
.cal-day .num { font: 600 18px/1 var(--display); color: #b9c2cf; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--hot); }
.cal-day.today .num { color: var(--hot); }
.cal-day.drop { background: #2a3646; outline: 2px dashed var(--hot); outline-offset: -2px; }
.chip {
  display: grid; text-align: left; gap: 1px;
  background: var(--panel-2); border: 0; border-left: 3px solid var(--hot); border-radius: 3px;
  padding: 4px 6px; font-size: 12px; line-height: 1.25; cursor: grab;
}
.chip .ct { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .cm { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.open { background: #3a4a5e; }
.chip.empty { border-left-color: var(--muted); }
.cal-hint { margin-top: -4px; }

@media (max-width: 760px) {
  .cal-grid { grid-template-columns: 1fr; }
  .cal-dow, .cal-day.out, .cal-day.blank { display: none; }
  .cal-day { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .cal-day .num::after { content: attr(data-dow); font: 400 12px var(--body); color: var(--muted); margin-left: 6px; }
}

/* ---------------- layout fixes after browser QA ---------------- */
[hidden] { display: none !important; }            /* .t-group etc. set display and beat the attribute */
.deck { overflow-y: auto; }
.deck > * { flex-shrink: 0; }
.deck > .lower { flex: 1 1 0; min-height: 200px; overflow: hidden; }
.transport { position: sticky; bottom: 0; z-index: 4; margin-top: auto; }
.sl-when { grid-template-columns: 1fr 1fr; }
.sl-when label:first-child { grid-column: 1 / -1; }
@media (max-width: 1000px) {
  .library { max-height: 60vh; overflow-y: auto; }
  .deck { overflow: visible; }
  .deck > .lower { flex: none; }
}
@media (max-width: 760px) {
  .calendar { padding: 16px; }
  .cal-nav { flex-wrap: wrap; }
  .cal-nav h2 { font-size: 30px; min-width: 0; flex: 1; }
  .up-next .when { font-size: 22px; }
}

/* ---------------- band site: login, user menu, requests ---------------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--ink); }
.login-card { width: min(360px, 100%); display: grid; gap: 12px; background: var(--panel); padding: 24px; border-radius: var(--r-md); }
.login-card label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.login-card input { font-size: 16px; padding: 10px 12px; }
.login-card .err:empty { display: none; }
.user-wrap { position: relative; }
.user-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; display: grid; min-width: 180px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px; }
.user-menu button { text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: var(--r-sm); }
.user-menu button:hover { background: var(--panel); }
.req-row { flex-wrap: wrap; gap: 8px; margin: 6px 0 2px; }
.req-row .grow { flex: 1; min-width: 140px; }
.req-row select, .req-row input { max-width: 100%; }
.req-row #req-speed { width: 64px; }
.tracks .req-actions { display: flex; gap: 8px; margin-top: 4px; }
.tracks li.request { cursor: default; opacity: .9; }
.share { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-right: 8px; }
.share small { color: var(--muted); }
.badge { font-size: 11px; padding: 1px 6px; border-radius: 99px; background: var(--panel-2); color: var(--muted); margin-left: 6px; }

.admin { display: flex; flex-direction: column; gap: 16px; padding: 20px 24px; overflow: auto; }
.admin[hidden] { display: none; }
.admin-head { display: flex; justify-content: space-between; align-items: center; }
.admin-head h2 { margin: 0; font: 600 30px/1 var(--display); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
.admin-table tr.disabled td { opacity: .5; }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-card { background: var(--panel); border-radius: var(--r-md); padding: 14px 16px; display: grid; gap: 8px; }
.admin-card h3 { margin: 0; }
.admin-row { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-row label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); flex: 1; min-width: 140px; }
.mac-token { white-space: pre-wrap; word-break: break-all; font-size: 12px; margin: 0; user-select: all; }
.mac-token:empty { display: none; }
.storage-bar { height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.storage-bar i { display: block; height: 100%; background: var(--hot); }
@media (max-width: 760px) { .admin { padding: 16px; } .admin-table th:nth-child(2), .admin-table td:nth-child(2) { display: none; } }
/* the band site's controls look like the rest of the console */
.req-row input, .req-row select, .login-card input, .admin input, .admin select {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 9px; min-width: 0; color: var(--text);
}
.admin-card input, .admin-card select { background: var(--ink); }
.admin-card > button, #btn-user, .login-card button {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 14px; justify-self: start;
}
#btn-user { padding: 6px 10px; }
.req-row label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
