/* MCA Rehearsal TrApp
   Visual idea: the stage manager's call board. A big call time, and coloured
   spike tape (the marking tape on stage floors) for every register.
   --spike is the accent: the Musical Company Augsburg magenta (#C40063).
   All fonts are system fonts: nothing is loaded from third parties. */

:root {
  color-scheme: light;
  --floor: #F0EEF0;
  --surface: #FFFFFF;
  --surface-2: #F6F4F6;
  --ink: #16202A;
  --ink-2: #4E5A68;
  --ink-3: #8A95A1;
  --line: #DDD8DD;
  --spike: #C40063;
  --spike-ink: #FFFFFF;
  --spike-hover: #A30052;
  --go: #23874F;
  --hold: #D7951A;
  --stop: #C93838;
  --focus: #1F6FD1;
  --loop-fill: rgba(196, 0, 99, 0.16);
  --shadow: 0 1px 2px rgba(22, 32, 42, 0.06), 0 6px 20px rgba(22, 32, 42, 0.06);

  --font-call: "Avenir Next Condensed", "Roboto Condensed", "Bahnschrift SemiCondensed", "Arial Narrow", "DejaVu Sans Condensed", sans-serif-condensed, sans-serif;
  --font-text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  --torn: polygon(0 7%, 3% 0, 48% 5%, 97% 0, 100% 9%, 98.5% 50%, 100% 93%, 96% 100%, 52% 95%, 4% 100%, 0 94%, 1.5% 50%);
  --tab-h: 62px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --floor: #151216;
    --surface: #1B2229;
    --surface-2: #222A32;
    --ink: #E8EDF2;
    --ink-2: #A5B0BC;
    --ink-3: #6E7A87;
    --line: #2E3741;
    --go: #3FB474;
    --hold: #E6A93A;
    --stop: #E35A5A;
    --focus: #72AEF5;
    --loop-fill: rgba(232, 60, 140, 0.24);
    --spike: #D4166F;
    --spike-hover: #E83C8C;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --floor: #151216;
  --surface: #1B2229;
  --surface-2: #222A32;
  --ink: #E8EDF2;
  --ink-2: #A5B0BC;
  --ink-3: #6E7A87;
  --line: #2E3741;
  --go: #3FB474;
  --hold: #E6A93A;
  --stop: #E35A5A;
  --focus: #72AEF5;
  --loop-fill: rgba(232, 60, 140, 0.24);
  --spike: #D4166F;
  --spike-hover: #E83C8C;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--floor);
  color: var(--ink);
  font: 16px/1.5 var(--font-text);
  accent-color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
#view:focus { outline: none; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { display: inline-flex; flex: none; }
.icon svg { display: block; }
[hidden] { display: none !important; }
body.booting .shell { visibility: hidden; }
.noscript { padding: 24px; }

.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.spacer { flex: 1; }
.prewrap { white-space: pre-wrap; }
.num { font-family: var(--font-call); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.shell { min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 8px) 16px 8px;
  background: color-mix(in srgb, var(--floor) 88%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; flex: 1; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.brand-name { font: 700 19px/1.05 var(--font-call); letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-ensemble { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 9px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.me-name { max-width: 9em; overflow: hidden; text-overflow: ellipsis; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabs a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--ink-3); font-size: 11.5px; font-weight: 600;
}
.tabs a.on { color: var(--ink); }
.tabs a.on::before {
  content: ""; position: absolute; top: 0; left: 50%; width: 38px; height: 5px; transform: translateX(-50%);
  background: var(--spike); clip-path: var(--torn);
}
main { padding: 4px 16px calc(var(--tab-h) + env(safe-area-inset-bottom) + 32px); }

body.guest .tabs, body.guest .me-link { display: none; }
body.guest .topbar { display: none; }
@media (max-width: 440px) {
  .me-link { padding: 8px; }
  .me-name { display: none; }
  .brand-name { font-size: 18px; }
}
body.guest main { padding-bottom: 48px; }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 248px 1fr; grid-template-rows: auto 1fr; }
  .topbar {
    grid-column: 1; grid-row: 1; position: sticky; top: 0;
    flex-direction: column; align-items: stretch; gap: 14px;
    padding: 24px 18px 16px; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .me-link { align-self: flex-start; }
  .brand-name { white-space: normal; }
  .tabs {
    grid-column: 1; grid-row: 2; position: sticky; top: 150px; align-self: start;
    display: flex; flex-direction: column; gap: 2px;
    height: auto; padding: 0 12px; background: transparent; border: 0;
  }
  .tabs a {
    flex-direction: row; justify-content: flex-start; gap: 12px;
    padding: 10px 12px; border-radius: 10px; font-size: 15px; color: var(--ink-2);
  }
  .tabs a:hover { background: var(--surface); }
  .tabs a.on { background: var(--surface); box-shadow: var(--shadow); }
  .tabs a.on::before { position: static; transform: none; margin: 0 -2px 0 -6px; width: 5px; height: 22px; }
  main { grid-column: 2; grid-row: 1 / span 2; padding: 28px 40px 64px; }
  body.guest .shell { display: block; }
}

/* ---------- page scaffolding ---------- */
.page { max-width: 760px; margin: 0 auto; }
.page.narrow { max-width: 600px; }
.page.wide, .page.mixer { max-width: 1100px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0 16px; }
.page-title { font: 700 clamp(30px, 7vw, 40px)/1.05 var(--font-call); letter-spacing: 0.005em; }
.lead { color: var(--ink-2); font-size: 17px; max-width: 62ch; margin-bottom: 18px; }
.hint { margin-top: 18px; color: var(--ink-2); font-size: 15px; }
.back {
  display: inline-flex; align-items: center; gap: 4px; margin: 10px 0 6px -4px;
  color: var(--ink-2); font-size: 15px; font-weight: 600; text-decoration: none;
}
.back:hover { color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; }
.toolbar .input[type="search"] { flex: 1 1 220px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 140px; }
.row-tight { gap: 8px; flex-wrap: nowrap; }
.row-tight > .input { flex: 1; }
.row-tight > .btn { flex: none; }
.col-num { flex: 0 0 88px !important; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; margin: 16px 0;
}
.section-title { font: 700 21px/1.2 var(--font-call); margin-bottom: 12px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.section-head .section-title { margin-bottom: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; padding: 8px 15px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn.busy { cursor: progress; opacity: 0.7; }
.btn-primary { background: var(--spike); border-color: var(--spike); color: var(--spike-ink); }
.btn-primary:hover { background: var(--spike-hover); border-color: var(--spike-hover); }
.btn-danger { background: var(--stop); border-color: var(--stop); color: #fff; }
.btn-quiet { background: transparent; border-color: transparent; }
.btn-quiet:hover { background: var(--surface-2); border-color: transparent; }
.btn-danger-text { color: var(--stop); }
.btn-s { min-height: 34px; padding: 5px 11px; font-size: 14px; border-radius: 8px; }
.btn-l { min-height: 50px; padding: 12px 22px; font-size: 16px; }
.btn-icon { min-height: 40px; min-width: 40px; padding: 0; border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-icon:hover { background: var(--surface-2); color: var(--ink); border-color: transparent; }
.btn.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 14px; font-weight: 650; color: var(--ink-2); }
.field-hint { font-size: 13.5px; color: var(--ink-2); font-weight: 400; }
.input {
  width: 100%; min-height: 44px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 16px; /* prevents iOS zoom on focus */
}
.input:focus { border-color: var(--ink-3); }
.input:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; }
textarea.input { resize: vertical; min-height: 88px; line-height: 1.45; }
.input-s { min-height: 38px; padding: 6px 10px; width: auto; }
.input-l { min-height: 52px; font-size: 18px; }
select.input { padding-right: 32px; }
.form-error { color: var(--stop); font-size: 14.5px; font-weight: 600; }
.form-error:empty { display: none; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.check, .radio { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; cursor: pointer; flex-wrap: wrap; }
.check input, .radio input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; }
.check .field-hint { flex-basis: 100%; padding-left: 30px; margin-top: -6px; }
fieldset.scope { border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
fieldset.scope legend { padding: 0 6px; margin-left: -6px; }
.repeat { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }

.pick-list {
  max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); padding: 4px;
}
.pick { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.pick:hover { background: var(--surface-2); }
.pick input { width: 18px; height: 18px; margin: 0; }
.pick .num { width: 2.6em; text-align: right; color: var(--ink-2); }

/* ---------- segmented ---------- */
.seg {
  display: inline-flex; gap: 3px; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px;
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.seg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 6px 13px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-2); font-weight: 600; font-size: 14.5px;
  cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.seg-btn.on.tone-go { background: var(--go); color: #fff; }
.seg-btn.on.tone-hold { background: var(--hold); color: #221800; }
.seg-btn.on.tone-stop { background: var(--stop); color: #fff; }
.seg-btn.on.tone-muted { background: var(--ink-2); color: var(--surface); }
.seg-btn:disabled { opacity: 0.5; }
.seg-s .seg-btn { min-height: 32px; padding: 4px 10px; font-size: 13.5px; }
.seg-l { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; overflow: visible; }
.seg-l .seg-btn { min-height: 50px; font-size: 15.5px; padding: 6px 8px; }
@media (max-width: 480px) {
  .seg-l .seg-btn { flex-direction: column; gap: 2px; min-height: 58px; font-size: 14px; white-space: normal; text-align: center; line-height: 1.15; }
}
.page > .seg { margin-bottom: 4px; }

/* ---------- spike tape ---------- */
.tape {
  display: inline-flex; align-items: center;
  padding: 3px 11px 4px; background: var(--tape); color: var(--tape-ink, #16130A);
  font: 700 14px/1.15 var(--font-call); letter-spacing: 0.02em;
  clip-path: var(--torn); transform: rotate(-0.7deg); white-space: nowrap;
}
.tape:nth-child(even) { transform: rotate(0.6deg); }
.tape-s { padding: 2px 8px 3px; font-size: 12.5px; }
.tapes { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 14.5px; cursor: pointer;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip-tape { border-radius: 4px; border-left: 6px solid var(--tape); }
.chip-tape.on { background: var(--tape); border-color: var(--tape); color: var(--tape-ink, #16130A); clip-path: var(--torn); border-radius: 0; }

/* ---------- the call (next rehearsal) ---------- */
.call {
  margin: 18px 0 30px; padding: 22px 20px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
}
.call-kicker { color: var(--ink-2); font-weight: 650; font-size: 15px; }
.call-date { font: 700 clamp(32px, 9vw, 48px)/1 var(--font-call); margin-top: 4px; }
.call-time {
  display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.18em; row-gap: 4px;
  font: 800 clamp(68px, 22vw, 128px)/0.88 var(--font-call);
  font-variant-numeric: tabular-nums; letter-spacing: -0.015em; margin: 8px 0 16px;
}
.call-until { white-space: nowrap; font-size: max(20px, 0.24em); line-height: 1.1; font-weight: 650; letter-spacing: 0.01em; color: var(--ink-2); }
.call-tape {
  display: inline-block; max-width: 100%; margin-left: -6px;
  padding: 7px 18px 8px; background: var(--spike); color: var(--spike-ink);
  font: 700 clamp(21px, 5.4vw, 28px)/1.15 var(--font-call); text-decoration: none;
  clip-path: var(--torn); transform: rotate(-1.2deg);
}
.call-tape:hover { text-decoration: underline; }
.call-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 16px 0 0; color: var(--ink-2); font-size: 15.5px; }
.fact { display: inline-flex; align-items: center; gap: 6px; }
.call-songs { margin-top: 10px; font-size: 15.5px; }
.call-songs-label { color: var(--ink-2); }
.call-foot { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.call.is-cancelled .call-time, .call.is-cancelled .call-date { text-decoration: line-through; text-decoration-thickness: 3px; color: var(--ink-3); }
.call.is-cancelled .call-tape { background: var(--stop); color: #fff; }

/* ---------- event list ---------- */
.month { margin-top: 26px; }
.month-head { font: 700 19px/1.2 var(--font-call); color: var(--ink-2); margin: 0 0 10px 2px; }
.ev-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ev { display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 10px; border-top: 1px solid var(--line); }
.ev:first-child { border-top: 0; }
.ev-link { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; text-decoration: none; }
.ev-link:hover .ev-title { text-decoration: underline; }
.ev-date { width: 44px; flex: none; display: flex; flex-direction: column; align-items: center; font-family: var(--font-call); padding-top: 1px; }
.ev-wd { font-size: 13px; font-weight: 650; color: var(--ink-2); line-height: 1.1; }
.ev-d { font-size: 29px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.ev-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ev-title { font-weight: 650; overflow-wrap: anywhere; }
.ev-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.ev-loc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch; }
.ev-kind { color: var(--ink); font-weight: 600; }
.ev-main .tapes { margin-top: 3px; }
.ev-side { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; flex: none; }
.ev-side .seg-btn { min-width: 34px; padding: 4px 7px; }
.ev-attended { font-size: 13.5px; color: var(--ink-2); }
.ev.is-cancelled .ev-title, .ev.is-cancelled .ev-d { color: var(--ink-3); text-decoration: line-through; }
.ev.is-other .ev-title, .ev.is-other .ev-d, .ev.is-other .ev-wd { color: var(--ink-2); font-weight: 600; }

.ev-holiday {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 8px 14px 8px 66px; border-top: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-2); font-size: 14px;
}
.ev-holiday:first-child { border-top: 0; }
.ev-holiday-name { font-weight: 650; }
.ev-holiday.is-ferien .ev-holiday-name::before {
  content: ""; display: inline-block; width: 18px; height: 8px; margin-right: 8px;
  background: var(--ink-3); clip-path: var(--torn); vertical-align: 1px;
}
.ev-holiday-dates { font-variant-numeric: tabular-nums; white-space: nowrap; }
.holiday-badge {
  display: inline-flex; align-self: flex-start; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
  font-size: 12.5px; font-weight: 650; white-space: nowrap;
}
.holiday-badge.is-feiertag { border-color: color-mix(in srgb, var(--hold) 55%, var(--line)); color: color-mix(in srgb, var(--hold) 60%, var(--ink)); }
.ev-main .holiday-badge { margin-top: 3px; }
.fact.leads { color: var(--ink); font-weight: 600; }

.counts { display: flex; align-items: center; gap: 10px; }
.cb { display: flex; gap: 2px; width: 92px; height: 7px; border-radius: 4px; overflow: hidden; flex: none; }
.cb > span { min-width: 3px; }
.cb-yes { background: var(--go); }
.cb-maybe { background: var(--hold); }
.cb-no { background: var(--stop); }
.cb-open { background: var(--line); }
.counts-text { font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.call-foot .cb { width: 140px; }

/* ---------- event detail ---------- */
.detail-head { margin-bottom: 8px; }
.detail-kind { color: var(--ink-2); font-weight: 650; font-size: 15px; margin-top: 8px; }
.detail-head .page-title { margin: 2px 0 14px; }
.banner { padding: 10px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; margin: 8px 0 14px; }
.banner-stop { background: color-mix(in srgb, var(--stop) 14%, var(--surface)); border-color: color-mix(in srgb, var(--stop) 40%, var(--line)); color: var(--ink); }
.facts { display: grid; gap: 10px; margin: 0; }
.facts > div { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: baseline; }
.facts dt { color: var(--ink-2); font-size: 14px; font-weight: 650; }
.facts dd { margin: 0; font-size: 16.5px; font-variant-numeric: tabular-nums; }
.my-answer .input { margin-top: 12px; }
.song-mini { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.song-mini a { display: flex; gap: 12px; padding: 7px 8px; border-radius: 8px; text-decoration: none; }
.song-mini a:hover { background: var(--surface-2); }
.song-mini .num { width: 2.4em; text-align: right; color: var(--ink-2); }

.reg-block { margin-top: 18px; }
.reg-head { display: flex; align-items: center; gap: 10px; font: 700 16px var(--font-call); color: var(--ink-2); margin-bottom: 6px; }
.reg-count { font: 600 13.5px var(--font-text); color: var(--ink-2); }
.people { list-style: none; margin: 0; padding: 0; border-left: 4px solid var(--tape, var(--line)); }
.person { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 9px 4px 9px 12px; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person-main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 160px; }
.person-name { font-weight: 600; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.person-part, .person-contact { font-size: 13.5px; color: var(--ink-2); }
.person-note { font-size: 14px; color: var(--ink); font-style: italic; }
.person-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 0; border: 0; background: none;
  text-align: left; cursor: pointer; color: var(--ink-2);
}
.person-btn:hover .person-name { text-decoration: underline; }
.is-inactive .person-name { color: var(--ink-3); }
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.badge.tone-go { background: color-mix(in srgb, var(--go) 18%, transparent); color: var(--go); }
.badge.tone-hold { background: color-mix(in srgb, var(--hold) 22%, transparent); color: color-mix(in srgb, var(--hold) 70%, var(--ink)); }
.badge.tone-stop { background: color-mix(in srgb, var(--stop) 16%, transparent); color: var(--stop); }
.badge.tone-lead { background: var(--spike); color: var(--spike-ink); }
.person.is-lead { background: color-mix(in srgb, var(--spike) 6%, transparent); }
.badge.tone-open { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.presence-summary { font-size: 14.5px; color: var(--ink-2); margin: 10px 0 2px; }
.panel > .counts { margin: 4px 0 4px; }
.panel > .seg { margin-top: 14px; }

/* ---------- who are you ---------- */
.who-list { display: flex; flex-direction: column; gap: 22px; margin-top: 18px; }
.who-head { margin-bottom: 10px; font-size: 16px; }
.who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.who-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  text-align: left; cursor: pointer;
}
.who-btn:hover { border-color: var(--ink-3); }
.who-name { font-weight: 650; }
.who-part { font-size: 13px; color: var(--ink-2); }
.who-skip { margin-top: 26px; }

/* ---------- login ---------- */
.login { max-width: 460px; margin: 10vh auto 0; display: flex; flex-direction: column; gap: 10px; }
.login-app {
  align-self: flex-start; padding: 4px 14px 5px; background: var(--spike); color: var(--spike-ink);
  font: 700 17px var(--font-call); clip-path: var(--torn); transform: rotate(-1.5deg);
}
.login-logo { width: 96px; height: 96px; }
.login-ensemble { font: 800 clamp(38px, 11vw, 58px)/0.98 var(--font-call); margin-top: 14px; }
.login-text { color: var(--ink-2); font-size: 17px; }
.login-form { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
.login-form .btn { margin-top: 6px; }

/* ---------- empty, loading, toast, dialog ---------- */
.empty { padding: 36px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-title { font: 700 22px var(--font-call); }
.empty-text { color: var(--ink-2); max-width: 46ch; }
.loading { display: block; height: 3px; margin: 30px auto; max-width: 240px; background: var(--line); border-radius: 2px; overflow: hidden; }
.loading-bar { display: block; height: 100%; width: 35%; background: var(--ink-2); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 14px); z-index: 100;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: min(520px, calc(100vw - 32px)); padding: 11px 18px; border-radius: 12px;
  background: var(--ink); color: var(--surface); font-weight: 600; font-size: 15px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  transition: opacity 0.18s, transform 0.18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-error { background: var(--stop); color: #fff; }
@media (min-width: 960px) { .toast { bottom: 28px; } }

.dialog {
  width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 32px);
  padding: 0; border: 0; border-radius: 18px; background: var(--surface); color: var(--ink);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}
.dialog-wide { width: min(680px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(9, 13, 17, 0.5); }
.dialog-body { padding: 22px; }
.dialog-title { font: 700 24px/1.15 var(--font-call); margin-bottom: 8px; }
.dialog-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 40px; height: 30px; border: 0; background: var(--tape); clip-path: var(--torn); cursor: pointer; }
.swatch.on { outline: 3px solid var(--ink); outline-offset: 3px; clip-path: none; border-radius: 3px; }

/* ---------- repertoire ---------- */
.song-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.song-list > li + li { border-top: 1px solid var(--line); }
.song { display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 10px; text-decoration: none; }
.song:hover .song-title { text-decoration: underline; }
.song-num { width: 3.1rem; flex: none; text-align: right; font: 700 26px/1 var(--font-call); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.song-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.song-title { font-weight: 650; }
.song-sub { font-size: 14px; color: var(--ink-2); }
.song-has { display: flex; gap: 10px; flex: none; color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.has { display: inline-flex; align-items: center; gap: 4px; }
.has-mixer { color: var(--ink); }
@media (max-width: 520px) { .has-mixer span:last-child { display: none; } }

.song-head { display: flex; align-items: flex-start; gap: 16px; margin: 6px 0 8px; }
.song-head-num {
  flex: none; padding: 4px 14px 6px; background: var(--spike); color: var(--spike-ink);
  font: 800 clamp(34px, 9vw, 48px)/1 var(--font-call); font-variant-numeric: tabular-nums;
  clip-path: var(--torn); transform: rotate(-1.5deg); margin-top: 4px;
}
.song-head .lead { margin: 6px 0 0; }
.notes { margin: 14px 0; padding: 14px 16px; border-left: 4px solid var(--spike); background: var(--surface); border-radius: 0 10px 10px 0; }

.mixer-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  margin: 18px 0; padding: 20px; border-radius: 14px; background: var(--ink); color: var(--surface);
}
.mixer-cta .section-title { margin-bottom: 4px; }
.mixer-cta p { color: color-mix(in srgb, var(--surface) 78%, transparent); max-width: 46ch; }
.mixer-cta .tapes { margin-top: 12px; }
.mixer-cta-text { flex: 1 1 280px; }

.tracks, .sheets { list-style: none; margin: 0; padding: 0; border-left: 4px solid var(--tape, var(--line)); }
.track, .sheet { display: flex; align-items: center; gap: 4px; padding: 3px 0 3px 8px; border-bottom: 1px solid var(--line); }
.track:last-child, .sheet:last-child { border-bottom: 0; }
.track-play, .sheet-open {
  display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;
  min-height: 46px; padding: 6px 8px; border: 0; border-radius: 8px; background: none;
  text-align: left; cursor: pointer; text-decoration: none; font-weight: 600;
}
.track-play:hover, .sheet-open:hover { background: var(--surface-2); }
.track-title, .sheet-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.track.on .track-play { color: var(--ink); }
.track.on .track-play .icon { color: var(--spike-ink); background: var(--spike); border-radius: 50%; padding: 6px; margin: -6px; }
.sheets { border-left-color: var(--line); }

.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 26px 18px; border: 2px dashed var(--line); border-radius: 12px; cursor: pointer; color: var(--ink-2);
}
.dropzone:hover, .dropzone.over { border-color: var(--ink-2); background: var(--surface-2); }
.dz-title { font-weight: 700; color: var(--ink); }
.dz-text { font-size: 14px; max-width: 52ch; }
.upload-queue { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.up { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "tape name" "bar bar" "status status"; gap: 4px 10px; align-items: center; font-size: 14px; }
.up:not(:has(.tape)) { grid-template-areas: "name name" "bar bar" "status status"; }
.up .tape { grid-area: tape; }
.up-name { grid-area: name; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.up-bar { grid-area: bar; height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; }
.up-bar > span { display: block; height: 100%; width: 0; background: var(--ink-2); transition: width 0.15s; }
.up-status { grid-area: status; color: var(--ink-2); font-size: 13px; }
.up-status.err { color: var(--stop); font-weight: 600; }

/* ---------- single-track player ---------- */
.tp {
  position: sticky; top: calc(env(safe-area-inset-top) + 62px); z-index: 5;
  margin: 0 0 14px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
}
@media (min-width: 960px) { .tp { top: 12px; } }
.tp-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 650; margin-bottom: 6px; }
.tp-bar { display: flex; align-items: center; gap: 10px; }
.tp-seek { flex: 1; min-width: 0; }
.tp-time { font: 600 14px var(--font-call); font-variant-numeric: tabular-nums; color: var(--ink-2); min-width: 2.8em; text-align: center; }
.tp-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 8px; }
.tp-play, .mx-play {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--spike); color: var(--spike-ink);
}
.tp-play:active, .mx-play:active { transform: scale(0.96); }
.tp-tempo { margin-left: 6px; }
.tp-loop { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- mixer ---------- */
.mx-head { margin: 6px 0 14px; }
.mx-head .detail-kind { margin-top: 0; }
.mx-deck { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.wave { position: relative; height: 104px; border-radius: 10px; background: var(--surface-2); touch-action: none; cursor: pointer; overflow: hidden; }
.wave-canvas { display: block; width: 100%; height: 100%; }
.mx-transport { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: center; margin-top: 14px; }
.mx-time { font: 700 26px var(--font-call); font-variant-numeric: tabular-nums; text-align: center; }
.mx-time-total { color: var(--ink-2); }
.mx-buttons { display: flex; align-items: center; justify-content: center; gap: 10px; }
.mx-play { width: 64px; height: 64px; }
.mx-tempo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.mx-tempo .range { width: 180px; }
.mx-tempo-value { font: 700 18px var(--font-call); font-variant-numeric: tabular-nums; min-width: 3.4em; }
.mx-tempo-status { flex-basis: 100%; text-align: center; font-size: 13.5px; color: var(--ink-2); }
.mx-tempo-status:empty { display: none; }
.mx-loop { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.mx-hint { text-align: center; margin-top: 10px; }
@media (min-width: 760px) {
  .mx-transport { grid-template-columns: 1fr auto 1fr; }
  .mx-time { text-align: left; }
  .mx-tempo { justify-content: flex-end; }
  .mx-tempo-status { text-align: right; }
}

.presets { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 12px; }
.presets-voice { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.presets-btns { display: flex; gap: 6px; flex-wrap: wrap; }

.strips { display: grid; gap: 10px; }
.strip {
  display: grid; align-items: center; column-gap: 14px; row-gap: 6px;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  grid-template-areas: "tape name btns" "tape vol vol" "tape pan pan";
  padding: 12px 14px 12px 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.strip-tape {
  grid-area: tape; align-self: stretch; position: relative; margin: -12px 0;
  background: color-mix(in srgb, var(--tape) 30%, var(--surface-2));
}
.strip-meter { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: var(--tape); transition: height 0.06s linear; }
.strip-name { grid-area: name; display: flex; flex-direction: column; min-width: 0; }
.strip-reg { font: 700 21px/1.1 var(--font-call); }
.strip-file { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip-btns { grid-area: btns; display: flex; gap: 6px; }
.ms {
  width: 42px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2);
  font: 800 16px var(--font-call); color: var(--ink-2); cursor: pointer;
}
.ms-m.on { background: var(--stop); border-color: var(--stop); color: #fff; }
.ms-s.on { background: var(--spike); border-color: var(--spike); color: var(--spike-ink); }
.strip-vol { grid-area: vol; display: flex; }
.strip-pan { grid-area: pan; display: flex; align-items: center; gap: 8px; font: 700 12px var(--font-call); color: var(--ink-3); }
.range { width: 100%; min-height: 30px; margin: 0; cursor: pointer; }
.range-pan { flex: 1; }
.strip.is-silent .strip-reg, .strip.is-silent .strip-file { color: var(--ink-3); }
.strip.is-silent .strip-tape { background: var(--surface-2); }
.strip.is-solo { border-color: var(--spike); box-shadow: inset 0 0 0 1px var(--spike); }
@media (min-width: 760px) {
  .strip {
    grid-template-columns: 18px minmax(120px, 190px) auto minmax(0, 1fr) minmax(130px, 200px);
    grid-template-areas: "tape name btns vol pan";
    row-gap: 0;
  }
}

/* ---------- ensemble ---------- */
.subnav { display: flex; gap: 4px; margin: 0 0 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.subnav a {
  padding: 10px 14px; text-decoration: none; font-weight: 650; color: var(--ink-2);
  border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.subnav a.on { color: var(--ink); border-bottom-color: var(--spike); }
.reg-list { list-style: none; margin: 0 0 14px; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.reg-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 0; border-top: 1px solid var(--line); }
.reg-item:first-child { border-top: 0; }
.reg-swatch { width: 14px; align-self: stretch; margin: -8px 0; background: var(--tape); }
.reg-name { font: 700 19px var(--font-call); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table thead th { font-size: 13.5px; color: var(--ink-2); font-weight: 650; background: var(--surface-2); }
.table tbody th { font-weight: 600; }
.th-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.th-sort.on { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.rate { display: inline-flex; align-items: center; gap: 8px; }
.rate-bar { width: 70px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.rate-bar > span { display: block; height: 100%; background: var(--go); }
.rate-bar > span.low { background: var(--hold); }

/* ---------- team planning ---------- */
.check-inline { font-weight: 600; font-size: 14.5px; align-items: center; }
.check-inline input { margin: 0; }
.pl-wrap { max-height: 72vh; overflow: auto; }
.pl-table { font-size: 14px; }
.pl-table thead th { position: sticky; top: 0; z-index: 2; }
.pl-table th.pl-event, .pl-table td.pl-event {
  position: sticky; left: 0; z-index: 1; background: var(--surface);
  min-width: 170px; max-width: 220px; white-space: normal; box-shadow: 1px 0 0 var(--line);
}
.pl-table thead th.pl-event { z-index: 3; background: var(--surface-2); }
.pl-event { display: table-cell; }
.pl-event-link { display: flex; flex-direction: column; text-decoration: none; }
.pl-date { font: 700 15px var(--font-call); font-variant-numeric: tabular-nums; }
.pl-title { font-weight: 600; }
.pl-event-link:hover .pl-title { text-decoration: underline; }
.pl-meta { display: flex; gap: 6px; flex-wrap: wrap; color: var(--ink-2); font-weight: 400; font-size: 13px; }
.pl-event .holiday-badge { margin-top: 4px; }
.pl-person { text-align: center !important; min-width: 74px; }
.pl-person-name { display: block; color: var(--ink); font-weight: 700; }
.pl-person-role { display: block; font-weight: 500; font-size: 12px; white-space: normal; line-height: 1.2; }
.pl-person.is-mine { box-shadow: inset 0 -3px 0 var(--spike); }
.pl-leads { min-width: 110px; white-space: normal !important; }
.pl-leads-names { font-weight: 700; color: var(--spike); }
.pl-leads-open { color: var(--ink-3); font-size: 13px; }
.pl-cell { text-align: center; padding: 6px !important; vertical-align: middle; }
.pl-cell.is-mine { background: color-mix(in srgb, var(--spike) 5%, transparent); }
.pl-cell.is-lead { background: color-mix(in srgb, var(--spike) 14%, transparent); }
.pl-avail {
  display: inline-flex; align-items: center; justify-content: center; min-width: 52px; min-height: 34px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-weight: 700; font-size: 13.5px; color: var(--ink-3);
}
button.pl-avail { cursor: pointer; }
.pl-avail.av-yes { background: var(--go); border-color: var(--go); color: #fff; }
.pl-avail.av-maybe { background: var(--hold); border-color: var(--hold); color: #221800; }
.pl-avail.av-no { background: color-mix(in srgb, var(--stop) 14%, var(--surface)); border-color: color-mix(in srgb, var(--stop) 40%, var(--line)); color: var(--stop); }
.pl-lead {
  display: block; margin: 4px auto 0; padding: 1px 8px; border: 1px dashed var(--line); border-radius: 999px;
  background: none; font-size: 11.5px; font-weight: 650; color: var(--ink-3); cursor: pointer;
}
.pl-lead.on { border: 1px solid var(--spike); background: var(--spike); color: var(--spike-ink); }
span.pl-lead { cursor: default; display: inline-block; }
.pl-table tr.is-cancelled .pl-title { text-decoration: line-through; color: var(--ink-3); }
.pl-holiday th { background: var(--surface-2) !important; color: var(--ink-2); font-weight: 650; text-align: left; position: static; }
.pl-holiday-name::before {
  content: ""; display: inline-block; width: 18px; height: 8px; margin-right: 8px;
  background: var(--ink-3); clip-path: var(--torn); vertical-align: 1px;
}

@media (max-width: 600px) {
  .pl-table th.pl-event, .pl-table td.pl-event { min-width: 116px; max-width: 132px; }
  .pl-leads { min-width: 64px; }
  .pl-person { min-width: 60px; }
  .pl-avail { min-width: 44px; }
  .pl-event .holiday-badge { white-space: normal; }
}

/* ---------- calendar ---------- */
.feed-main { border-color: var(--spike); box-shadow: inset 0 0 0 1px var(--spike); }
.feed-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.feed-list { list-style: none; margin: 0; padding: 0; }
.feed-row { padding: 12px 0; border-top: 1px solid var(--line); }
.feed-row:first-child { border-top: 0; padding-top: 0; }
.feed-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 650; }
.feed-row .feed-actions { margin-top: 8px; }
.howto-list { display: grid; gap: 4px 16px; margin: 0 0 14px; }
.howto-list dt { font-weight: 700; margin-top: 8px; }
.howto-list dd { margin: 0; color: var(--ink-2); }
@media (min-width: 640px) {
  .howto-list { grid-template-columns: 150px 1fr; }
  .howto-list dt { margin-top: 0; }
}

/* ---------- profile ---------- */
.me-card { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.me-card-name { font: 700 26px var(--font-call); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
