/* Sound in Motion identity: brand palette from the logo guide */
:root {
  /* brand palette */
  --mb-red: #ED3B5B;
  --mb-cyan: #00BBD8;
  --mb-blue: #005CFF;
  --mb-yellow: #FFD700;
  --mb-purple: #6910EE;
  --mb-green: #399A4A;
  --mb-orange: #E9680A;
  --mb-brown: #805E3C;
  --mb-pink: #FF5EA5;
  /* site tones */
  --sun: #F9D851;
  --sky: #54BAFA;
  --ink: #000000;
  --paper: #ffffff;

  --bg: var(--sun);
  --panel: var(--paper);
  --text: var(--ink);
  --muted: #4a4220;
  --border: var(--ink);
  --accent: var(--mb-red);
  --rec: var(--mb-green);
  --warn: var(--mb-orange);
  --err: var(--mb-red);
  --off: #b9ad73;
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --radius: 18px;

  /* timeline */
  --tl-ink: #000000;
  --tl-on-dark: #ffffff;
  --tl-line: rgba(0, 0, 0, 0.22);
  --tl-wave: rgba(0, 0, 0, 0.32);
  --tl-mark: rgba(0, 0, 0, 0.45);
  --tl-mark-edge: #000000;
  --tl-bookmark: #FFD700;
  --tl-playhead: #000000;
  --tl-playhead-cap: #ED3B5B;
  --tl-label-bg: #000000;
  --tl-label-text: #FFD700;
  --tl-row-second: var(--mb-pink);
  --tl-row-minute: var(--mb-cyan);
  --tl-row-hour: var(--mb-blue);
  --tl-row-day: var(--mb-purple);
  --tl-row-month: var(--mb-orange);

  color-scheme: light;
  --display: "Figtree", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.45 var(--display);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
button, input, select { font: inherit; color: inherit; }

/* pills */
button {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 12px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 8px 15px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .08s ease, box-shadow .08s ease;
}
button:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: var(--shadow-sm); }
button:active:not(:disabled) { transform: translate(1px, 1px); box-shadow: none; }
button:disabled { opacity: .45; cursor: default; }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover:not(:disabled) { background: var(--paper); border-color: var(--ink); }
button.accent { background: var(--mb-red); color: #fff; }
button.accent-outline { background: var(--mb-blue); color: #fff; }
button.active { background: var(--ink); color: var(--mb-yellow); }
button.small { padding: 5px 10px; font-size: 11px; }
button.danger-text { color: #b8102f; }
button.danger-text.armed { background: var(--mb-red); border-color: var(--ink); color: #fff; }

input, select {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 7px 11px;
  min-width: 0;
  font-weight: 600;
}
input:focus-visible, button:focus-visible, select:focus-visible {
  outline: 3px solid var(--mb-blue);
  outline-offset: 2px;
}
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: #b8102f; font-weight: 700; min-height: 1.2em; }

/* top bar */
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 12px 20px 6px; background: var(--sun);
}
.brand { display: flex; align-items: center; gap: 12px; white-space: nowrap; text-decoration: none; color: inherit; }
.brand img.logo { height: 34px; width: auto; display: block; }
.brand .app-name {
  font-weight: 900; font-size: 20px; text-transform: uppercase; letter-spacing: -.02em;
  padding-left: 12px; border-left: 3px solid var(--ink); line-height: 1;
}
.topbar-actions { display: flex; gap: 6px; margin-left: auto; }

/* Station tabs: one row like browser tabs, sitting on the header's bottom line.
   Tabs shrink evenly as space runs out (names get "…", badges become dots),
   then the row scrolls sideways. The selected tab opens into the page. */
.station-tabs {
  display: flex; align-items: flex-end; gap: 4px;
  padding: 6px max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  box-shadow: inset 0 -3px 0 var(--ink); /* the header line, drawn under the tabs */
  position: relative; /* tab offsetLeft is measured from the strip */
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
.station-tabs::-webkit-scrollbar { display: none; }
.station-tabs button {
  container: tab / inline-size;
  flex: 0 1 230px; min-width: 112px;
  display: flex; align-items: center; gap: 7px;
  padding: 9px 12px 8px; border: 3px solid var(--ink); border-radius: 14px 14px 0 0;
  background: var(--st, var(--paper)); color: var(--st-ink, var(--ink));
  font-size: 11.5px; text-align: left;
}
.station-tabs button:hover:not(:disabled) { transform: none; box-shadow: none; filter: brightness(1.06); }
.station-tabs button.active {
  background: var(--bg); color: var(--ink); border-bottom-color: var(--bg);
  padding-top: 13px; box-shadow: inset 0 5px 0 var(--st); filter: none;
}
.station-tabs .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.station-tabs .led, .station-tabs .st-badge { flex: none; }
/* (widths are the tab's inner width, ~30px less than the tab) */
/* medium tabs: value only ("● 24:54", "16:00"); status-only badges become dots */
@container tab (max-width: 205px) {
  .st-badge .lbl { display: none; }
  .st-badge.warn, .st-badge.off { font-size: 0; padding: 3px; min-width: 14px; min-height: 14px; }
}
/* narrow tabs: dots only, upcoming times hidden */
@container tab (max-width: 110px) {
  .st-badge.next, .st-badge.off { display: none; }
  .st-badge.rec { font-size: 0; gap: 0; padding: 3px; min-width: 14px; min-height: 14px; justify-content: center; }
}
.led {
  width: 10px; height: 10px; border-radius: 50%; background: var(--off); flex: none; display: inline-block;
  border: 2px solid var(--ink);
}
.led.recording { background: #ff2d4a; animation: pulse 1.4s ease-in-out infinite; }
.led.retrying, .led.starting { background: var(--mb-yellow); }
.led.error { background: var(--mb-red); }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(255, 45, 74, .35); } }
@media (prefers-reduced-motion: reduce) { .led.recording, .st-badge.rec::before { animation: none; } }

/* sharing */
#btnShare { background: var(--ink); color: var(--mb-yellow); }
.role-chip {
  font-weight: 900; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  background: var(--ink); color: var(--mb-yellow); border-radius: 999px; padding: 4px 10px;
}
.role-chip[hidden] { display: none; }
.shared-banner {
  align-self: center; display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--mb-yellow); font-weight: 800; font-size: 13px;
  padding: 7px 16px; border-radius: 999px; max-width: 100%;
}
.shared-banner[hidden] { display: none; }
.share-what { font-weight: 800; margin: 8px 0 10px; }
.share-url {
  width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
  background: var(--sun); font-weight: 600;
}
/* Listener view (shared-link visitors): play and share only */
body.listener #btnSchedule, body.listener #btnStations,
body.listener #exportWrap, body.listener #btnBookmark, body.listener .group-label { display: none; }
.url-cell { display: flex; flex-direction: column; gap: 5px; }
.url-cell select.loc { font-size: 12px; padding: 4px 8px; }
/* Operators: everything except managing stations and users */
body.operator #btnStations { display: none; }
#btnUsers[hidden] { display: none; }
.users td:nth-child(1) { width: 22%; }
.users td:nth-child(2) { width: 14%; font-size: inherit; }
.users td:nth-child(3) { width: 34%; }
.users td:nth-child(3) .row-actions input { flex: 1; min-width: 0; }
.users td:nth-child(4) { width: 12%; }

/* recording status badges on station pills and the current-station chip */
.st-badge {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 2px;
  font-size: 10px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase;
  font-variant-numeric: tabular-nums; line-height: 1;
  padding: 3px 7px; border-radius: 999px; border: 2px solid var(--ink);
  background: var(--paper); color: var(--ink); white-space: nowrap;
}
.st-badge.rec { background: var(--mb-red); color: #fff; }
.st-badge.rec::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff;
  animation: blink 1s steps(2, start) infinite;
}
.st-badge.warn { background: var(--mb-yellow); }
.st-badge.next { background: rgba(255, 255, 255, .85); }
.st-badge.off { background: var(--ink); color: var(--paper); }
@keyframes blink { to { visibility: hidden; } }
.now-station .st-badge { font-size: 12px; padding: 4px 9px; margin-left: 4px; }

/* clock */
.clockbar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 16px 20px;
}
.now-station {
  display: flex; align-items: center; gap: 10px;
  font-weight: 900; font-size: 26px; text-transform: uppercase; letter-spacing: -.02em; line-height: 1;
  background: var(--st, transparent); color: var(--st-ink, inherit);
  border: 3px solid var(--ink); border-radius: 999px; padding: 8px 18px 8px 14px; box-shadow: var(--shadow-sm);
}
.clock { display: flex; align-items: center; gap: 6px; row-gap: 10px; flex-wrap: wrap; font-variant-numeric: tabular-nums; flex: 1; justify-content: center; }
.clock .cell {
  background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow-sm);
  padding: 4px 10px; font-size: 26px; font-weight: 900; min-width: 2.1em; text-align: center; line-height: 1.2;
}
.clock .cell.wide { min-width: 7em; text-transform: uppercase; font-size: 20px; padding: 7px 12px; background: var(--mb-pink); }
.clock #cYear { background: var(--mb-cyan); }
.clock #cH, .clock #cM, .clock #cS { background: var(--ink); color: var(--mb-yellow); }
.clock .cell.small { min-width: 1.3em; background: var(--mb-red); color: #fff; }
.clock .sep { font-weight: 900; font-size: 24px; }
.clock .gap { width: 14px; }
.jump { display: flex; gap: 6px; }

/* timeline */
main { flex: 1 0 auto; padding: 4px 20px 16px; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.timeline-wrap {
  flex: none;
  border: 3px solid var(--ink); border-radius: var(--radius); overflow: hidden;
  background: var(--paper); box-shadow: var(--shadow);
}
#timeline { display: block; width: 100%; height: 340px; cursor: grab; touch-action: none; }
#timeline.dragging { cursor: grabbing; }
.message { min-height: 1.4em; text-align: center; font-weight: 800; }
.message:not(:empty) {
  align-self: center; background: var(--ink); color: var(--mb-yellow);
  padding: 5px 14px; border-radius: 999px;
}

/* transport */
.transport {
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: space-between; align-items: center;
  padding: 12px 20px; background: var(--sky); border-top: 3px solid var(--ink);
}
.group { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.group-label { font-weight: 900; text-transform: uppercase; font-size: 12px; margin-right: 2px; }
/* transport buttons: icon + label (labels shrink away on phones) */
.tbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tbtn .ic { width: 16px; height: 16px; flex: none; fill: currentColor; }
.tbtn .ic-stroke { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.tbtn .ic-stroke circle { fill: currentColor; stroke: none; }
.play .ic-stop, .play.playing .ic-play { display: none; }
.play.playing .ic-stop { display: block; }
#btnLive .ic { fill: #ff2d4a; }
#btnLive.active .ic { animation: pulse 1.4s ease-in-out infinite; border-radius: 50%; }
.play {
  min-width: 112px; font-size: 15px; padding: 11px 20px;
  background: var(--mb-red); color: #fff; box-shadow: var(--shadow-sm);
}
.play.playing { background: var(--ink); color: var(--mb-yellow); }
#btnLatest { background: var(--mb-yellow); }
#btnLive { background: var(--mb-purple); color: #fff; }
#btnLive.active { background: var(--ink); color: var(--mb-yellow); }
#btnMarkIn, #btnMarkOut { background: var(--mb-pink); }
/* Export ▾ menu */
.menu-wrap { position: relative; display: inline-flex; }
.menu {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 60; min-width: 260px;
  display: flex; flex-direction: column; gap: 4px; padding: 6px;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 5px 5px 0 var(--ink);
}
.menu[hidden] { display: none; }
.menu button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  border: 2px solid transparent; border-radius: 12px; padding: 8px 10px; background: transparent;
  text-transform: none; letter-spacing: 0; white-space: normal;
}
.menu button strong { font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.menu button span { font-weight: 600; font-size: 12px; color: var(--muted); }
.menu button:hover:not(:disabled), .menu button:focus-visible { background: var(--sun); border-color: var(--ink); transform: none; box-shadow: none; }
.volume { display: flex; align-items: center; gap: 6px; font-weight: 900; font-size: 12px; text-transform: uppercase; }
.volume input { width: 110px; padding: 0; border: 0; accent-color: var(--ink); background: transparent; }
#markInfo { font-weight: 700; }
.statusline {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 7px 20px; font-size: 12px; font-weight: 700; background: var(--ink); color: var(--mb-yellow);
}
.statusline .muted { color: var(--mb-yellow); }

/* dialogs */
.dlg {
  background: var(--paper); color: var(--text); border: 3px solid var(--ink); border-radius: 22px;
  box-shadow: 8px 8px 0 var(--ink);
  padding: 18px 22px 22px; width: min(1000px, calc(100vw - 32px)); max-height: calc(100vh - 64px);
}
.dlg.narrow { width: min(440px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(0, 0, 0, .45); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dlg-head h2 { margin: 0; font-size: 26px; font-weight: 900; text-transform: uppercase; letter-spacing: -.02em; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; padding: 6px; }
.tbl td { padding: 7px 6px; border-top: 2px solid var(--ink); vertical-align: middle; }
.tbl input:not([type=checkbox]) { width: 100%; }
.tbl input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--mb-green); }
.tbl td:nth-child(2) { width: 22%; }
.tbl td:nth-child(4) { width: 22%; font-size: 12px; }
.tbl .row-actions { display: flex; gap: 4px; }
.bm-list { list-style: none; margin: 12px 0 0; padding: 0; max-height: 60vh; overflow: auto; }
.bm-list li { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-top: 2px solid var(--ink); }
.bm-list li .when { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 12px; white-space: nowrap; background: var(--mb-yellow); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 8px; }
.bm-list li .lbl { flex: 1; font-weight: 700; }

/* schedule */
.sched td:nth-child(2) { width: auto; font-size: inherit; font-weight: 800; }
.sched td:nth-child(3) { width: 40%; }
.sched td:nth-child(4) { width: auto; font-size: inherit; }
.sched .when { font-variant-numeric: tabular-nums; font-weight: 700; }
.badge {
  display: inline-block; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 999px; margin-left: 8px; vertical-align: 1px;
  background: var(--paper); border: 2px solid var(--ink);
}
.badge.live { background: #3ee06b; }
button.badge-link {
  min-height: 0; font: inherit; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 999px; border: 2px solid var(--ink); background: var(--mb-yellow); cursor: pointer;
}
button.badge-link:hover:not(:disabled) { background: var(--ink); color: var(--mb-yellow); transform: none; box-shadow: none; }
.sched-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 6px; }
.sched-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.sched-tabs button .n { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: var(--mb-yellow); font-size: 10px; }
.sched-tabs button.active { background: var(--ink); color: var(--mb-yellow); }
.sched-tabs button.active .n { background: var(--mb-yellow); color: var(--ink); }
.sched tr.grp td { background: var(--sun); font-weight: 900; text-transform: uppercase; font-size: 11px; letter-spacing: .06em; padding: 6px 8px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 10px; }
.pager[hidden] { display: none; }
.sched-form {
  margin-top: 18px; padding: 16px; border: 3px solid var(--ink); border-radius: 18px;
  display: flex; flex-direction: column; gap: 12px; background: var(--sun);
}
.sched-form h3 { margin: 0; font-size: 16px; font-weight: 900; text-transform: uppercase; }
.field-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.field-row[hidden] { display: none; }
.field-row label { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; }
.field-row label.grow { flex: 1; min-width: 220px; }
.field-row label.grow input { flex: 1; }
.seg { display: flex; gap: 14px; }
.seg input { accent-color: var(--ink); }
.days { display: flex; gap: 5px; flex-wrap: wrap; }
.days label { gap: 0; }
.days input { position: absolute; opacity: 0; pointer-events: none; }
.days span {
  display: inline-block; min-width: 44px; text-align: center; padding: 6px 0; border-radius: 999px;
  border: 2px solid var(--ink); background: var(--paper); cursor: pointer; font-size: 12px; font-weight: 900; text-transform: uppercase;
}
.days input:checked + span { background: var(--mb-blue); color: #fff; }
.days input:focus-visible + span { outline: 3px solid var(--mb-blue); outline-offset: 2px; }

/* login */
.login-page { align-items: center; justify-content: center; padding: 16px; }
.login-card {
  display: flex; flex-direction: column; gap: 10px; width: min(380px, 100%);
  background: var(--paper); border: 3px solid var(--ink); border-radius: 24px; padding: 30px;
  box-shadow: 8px 8px 0 var(--ink);
}
.login-card .logo { width: 200px; height: auto; }
.login-card h1 { margin: 6px 0 0; font-size: 40px; font-weight: 900; text-transform: uppercase; letter-spacing: -.03em; line-height: .95; }
.login-card h1 span { color: var(--mb-pink); }
.login-card p { margin: 0 0 8px; font-weight: 600; }
.login-card label { font-weight: 900; text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
.login-card label .opt { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--muted); }
.login-card button { padding: 11px; font-size: 14px; }

/* touch screens: no hover lift, comfortable targets */
@media (hover: none) {
  button:hover:not(:disabled) { transform: none; box-shadow: none; }
}

/* edge-to-edge when installed (viewport-fit=cover) */
.topbar { padding-top: max(12px, env(safe-area-inset-top)); padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
.statusline { padding-bottom: max(7px, env(safe-area-inset-bottom)); }
.long { display: inline; }

@media (max-width: 760px) {
  body { font-size: 14px; }
  button { min-height: 40px; }
  input, select { font-size: 16px; } /* stops iOS zooming into fields */

  .topbar { gap: 8px; flex-wrap: wrap; padding: max(10px, env(safe-area-inset-top)) 14px 4px; }
  .brand { gap: 8px; }
  .brand img.logo { height: 26px; }
  .brand .app-name { font-size: 15px; padding-left: 8px; }
  .topbar-actions { margin-left: auto; gap: 2px; }
  .topbar-actions button { padding: 5px 6px; font-size: 10px; letter-spacing: .03em; min-height: 32px; }
  .station-tabs { padding: 4px 14px 0; }
  .station-tabs button { min-height: 0; padding: 8px 10px 7px; font-size: 11px; }
  .station-tabs button.active { padding-top: 11px; }

  .clockbar { padding: 12px 14px 6px; gap: 10px; }
  .now-station { font-size: 18px; padding: 6px 14px 6px 10px; }
  .clock { flex: 1 1 100%; justify-content: flex-start; gap: 3px; flex-wrap: nowrap; }
  .clock .cell { font-size: 15px; padding: 3px 5px; min-width: 1.75em; border-radius: 9px; }
  .clock .cell.wide { min-width: 0; font-size: 12px; padding: 5px 7px; }
  .clock .cell.small, .clock .cell.small + .sep, .clock #cS + .sep { display: none; }
  .clock .gap { width: 8px; flex: none; }
  .clock .sep { font-size: 15px; }
  .jump { flex: 1 1 100%; }
  .jump input { flex: 1; }

  main { padding: 6px 14px 12px; justify-content: flex-start; }
  .timeline-wrap { border-radius: 14px; box-shadow: var(--shadow-sm); }
  #timeline { touch-action: pan-y; } /* horizontal drags scrub, vertical swipes scroll the page */

  /* Playback controls become a bar fixed to the bottom of the screen */
  body { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .transport { padding: 12px 14px; justify-content: flex-start; gap: 10px; }
  .transport .group { width: 100%; }
  .transport .group.center {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; margin: 0;
    padding: 10px max(12px, env(safe-area-inset-left)) calc(10px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right));
    background: var(--sky); border-top: 3px solid var(--ink);
    flex-wrap: nowrap; gap: 6px;
  }
  /* fixed-size controls so no browser squeezes Play (Firefox shrank it to a sliver) */
  .transport .group.center { justify-content: space-between; align-items: center; gap: 4px; }
  .transport .group.center .tbtn { flex: 0 0 auto; min-width: 44px; height: 46px; min-height: 46px; padding: 0 8px; gap: 3px; font-size: 11px; letter-spacing: .03em; }
  .transport .group.center .tbtn .lbl.hide-sm { display: none; }
  .transport .group.center .tbtn .ic { width: 18px; height: 18px; }
  .transport .group.center .play { width: 60px; min-width: 60px; height: 60px; padding: 0; border-radius: 50%; }
  .transport .group.center .play .lbl { display: none; }
  .transport .group.center .play .ic { width: 26px; height: 26px; }
  .long { display: none; }

  .role-chip { font-size: 10px; padding: 3px 8px; }
  .volume { display: none; } /* phones use their hardware volume */
  #markInfo { flex-basis: 100%; }
  .statusline { padding: 7px 14px; }

  /* dialogs become full-screen sheets */
  .dlg {
    width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0;
    border: 0; border-radius: 0; box-shadow: none;
    padding: max(14px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  }
  .dlg.narrow { height: auto; margin: auto auto 0; border-top: 3px solid var(--ink); border-radius: 22px 22px 0 0; }
  .dlg-head h2 { font-size: 22px; }
  .tbl, .tbl tbody, .tbl tfoot, .tbl tr, .tbl td { display: block; width: 100% !important; }
  .tbl thead { display: none; }
  .tbl tr { border-top: 2px solid var(--ink); padding: 8px 0; }
  .tbl td { border-top: 0; padding: 4px 0; }
  .sched tr { display: grid !important; grid-template-columns: 30px 1fr auto; column-gap: 10px; align-items: center; }
  .sched td { width: auto !important; padding: 1px 0; }
  .sched td:nth-child(1) { grid-column: 1; grid-row: 1 / span 3; }
  .sched td:nth-child(2), .sched td:nth-child(3), .sched td:nth-child(4) { grid-column: 2; }
  .sched td:nth-child(4):empty, .sched td:nth-child(4):has(span:empty) { display: none; }
  .sched td:nth-child(4) { font-size: 12px; }
  .sched td:nth-child(5) { grid-column: 3; grid-row: 1 / span 3; }
  .sched-form { padding: 12px; }
  .field-row label { flex-wrap: wrap; }
  .days span { min-width: 40px; padding: 8px 0; }
}

@media (max-width: 760px) { .sched tr.grp { display: block !important; } }

/* Settings ▾ (admin export / import) */
.backup-menu { position: relative; }
.backup-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; display: flex; flex-direction: column; gap: 6px; min-width: 190px; padding: 8px; background: #fff; border: 3px solid #000; border-radius: 14px; box-shadow: 4px 4px 0 #000; }
.backup-pop[hidden] { display: none; }
.backup-pop button { width: 100%; text-align: left; }
