/* Bundled Bengali font (Noto Sans Bengali, SIL OFL 1.1 – see fonts/OFL-NotoSansBengali.txt).
   unicode-range limits it to Bengali text, so Latin keeps the system font. */
@font-face {
  font-family: "CT Bengali";
  src: url("fonts/noto-sans-bengali-bengali-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1;
}

/* CTAdmin – styles. Modes: setup (default), compact (phones), projection (body.mode-projection). */

/* ───────── Tokens ───────── */
:root {
  --pri: #AC1F24;
  --pri-ink: #fff;
  --bg: #f5f2f1;
  --surface: #ffffff;
  --txt: #1f1a1a;
  --muted: #6b6262;
  --line: #ddd5d4;
  --ring: #e9e1e0;
  --ok: #1f7a3d;
  --warn: #f2b01e;
  --danger: #b3261e;
  --radius: 14px;
  --shadow: 0 2px 14px rgba(40, 10, 10, .08);
  --tap: max(44px, 2.75rem);
}
body.dark-theme {
  --pri: #ff6b70;
  --pri-ink: #1b0b0c;
  --bg: #141011;
  --surface: #1e191a;
  --txt: #f1eaea;
  --muted: #a79c9c;
  --line: #3a3233;
  --ring: #352d2e;
  --shadow: 0 2px 14px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; font-size: calc(100% * var(--scale, 1)); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font: 1rem/1.4 "CT Bengali", "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--pri); }
.st0 { fill: var(--txt); }
.st1 { fill: var(--pri); }

/* ───────── Buttons & inputs ───────── */
.btn {
  min-height: var(--tap);
  padding: .45rem .9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--txt);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s, transform .05s;
}
.btn:hover:not(:disabled) { background: color-mix(in srgb, var(--txt) 7%, var(--surface)); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--pri) 60%, transparent);
  outline-offset: 2px;
}
.btn.primary { background: var(--pri); color: var(--pri-ink); border-color: var(--pri); }
.btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--pri) 88%, #000); }
.btn.go   { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #231a00; }
.btn.stop { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.go:hover:not(:disabled), .btn.warn:hover:not(:disabled), .btn.stop:hover:not(:disabled) { filter: brightness(1.08); background: inherit; }
.btn.chip { min-height: var(--tap); min-width: var(--tap); padding: .25rem .85rem; border-radius: 999px; font-weight: 500; }
.btn.tool[aria-pressed="false"]:not([data-mute]) { opacity: .55; }
.btn.icon, .btn[data-mute] { width: var(--tap); padding: 0; font-size: 1.15rem; }
.btn .ico + .lbl { margin-left: .45rem; }
.btn { white-space: nowrap; }
.btn.armed .ico { display: none; }
.btn.stop.armed { background: var(--surface); color: var(--danger); box-shadow: inset 0 0 0 2px var(--danger); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .65; } }
@media (prefers-reduced-motion: reduce) { .btn.stop.armed { animation: none; } }
[data-mute].muted { color: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

select, input[type=number], input[type=text] {
  min-height: var(--tap);
  padding: .3rem .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--txt);
  font: inherit;
}
input[type=range] { accent-color: var(--pri); }
input[type=checkbox] { accent-color: var(--pri); width: 1.1rem; height: 1.1rem; }
label.check { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }

/* ───────── App shell ───────── */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: .75rem;
  padding: .55rem 1rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .65rem; flex: 1; min-width: 0; }
.brand svg { height: 40px; width: 40px; flex: none; }
.brand h1 { margin: 0; font-size: 1.15rem; line-height: 1.1; color: var(--pri); }
.brand small { display: block; color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.actions .ico { font-size: 1.05rem; }

#stage {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(340px, 400px) minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  align-items: start;
}
body.hide-timer #timerBox, body.hide-plan #planPanel { display: none; }
body.hide-timer #stage, body.hide-plan #stage { grid-template-columns: minmax(0, 1fr); }

.page-footer { padding: 1rem; text-align: center; font-size: .85rem; color: var(--muted); }

/* ───────── Timer card ───────── */
#timerBox {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
}
#pie { width: 100%; max-width: 420px; height: auto; display: block; }
#remainingmin { stroke: var(--ring); }
#timeLabel, #precount {
  fill: var(--txt);
  font-family: "CT Bengali", "Segoe UI", system-ui, Arial, sans-serif;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  user-select: none;
}
@keyframes shake { 0%,100% { transform: rotate(0); } 20% { transform: rotate(2deg); } 50% { transform: rotate(-2deg); } 80% { transform: rotate(1.5deg); } }
#pie.shake { animation: shake .15s linear infinite; }
@media (prefers-reduced-motion: reduce) { #pie.shake { animation: none; } }

.clock { text-align: center; user-select: none; }
#dateTime { font-size: 1rem; color: var(--muted); }
#endTime  { font-size: 1.25rem; font-weight: 600; color: var(--pri); min-height: 1.5em; }

.timer-controls { width: 100%; display: flex; flex-direction: column; gap: .7rem; align-items: center; }
.duration-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem .6rem; }
.stepper { display: flex; align-items: center; gap: .3rem; }
.stepper input { width: 4.8rem; text-align: center; font-size: 1.2rem; font-weight: 600; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .btn { width: var(--tap); padding: 0; font-size: 1.3rem; }
.unit { color: var(--muted); margin-right: .3rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
#presetChips .btn.chip { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* preset editor rows (Settings → Timer presets) */
.preset-row { display: grid; grid-template-columns: minmax(0, 1.3fr) 4.2rem minmax(0, 1fr) var(--tap); gap: .4rem; align-items: center; margin: .4rem 0; }
.preset-head { margin-bottom: -.1rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.preset-row input, .preset-row select { min-width: 0; width: 100%; }
/* Bengali labels run wider than English: smaller chip text keeps the same rows (and so the same dial size) */
:lang(bn) .timer-controls .btn.chip { font-size: .85rem; padding-inline: .55rem; }
:lang(bn) .duration-row .unit { font-size: .9rem; }
.run-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: .5rem; width: 100%; }
.run-row .btn { min-height: 56px; font-size: 1.1rem; }
.run-row .btn[data-mute] { width: 56px; }
@media (max-width: 400px) {
  .run-row { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) auto; }
  .run-row .btn { padding-inline: .5rem; }
}

/* ───────── Seat plan ───────── */
#planPanel { min-width: 0; display: flex; flex-direction: column; }
.plan-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .5rem .6rem; margin-bottom: 1rem;
}
.plan-bar label.inline { display: flex; align-items: center; gap: .5rem; font-weight: 600; margin-right: auto; }

#planHolder { container-type: inline-size; min-width: 0; overflow-x: auto; }
.plan-container {
  --units: 12; --rows: 6; --fs: .4;
  --seat: max(34px, min(calc(100cqw / (var(--units) + 1)), 72px));
  --aisle: calc(var(--seat) * .6);
  display: flex; flex-direction: column; align-items: center;
}
.plan-container h1 { margin: .2rem 0 0; font-size: 1.3rem; text-align: center; }
.plan-sub { margin: .1rem 0 .5rem; color: var(--muted); font-size: .9rem; text-align: center; }
.plan-warn { margin: 0 0 .6rem; padding: .35rem .7rem; border-radius: 8px; font-weight: 600; color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
.podium {
  width: min(60%, 420px); height: 12px; margin-bottom: .4rem;
  border-radius: 6px; background: var(--pri); opacity: .85;
}
.podium-bottom .podium { order: 10; margin: .5rem 0 0; }
.podium-none .podium { display: none; }
.plan-grid { display: grid; row-gap: calc(var(--seat) * .12); justify-content: center; }
.seat {
  width: var(--seat);
  height: calc(var(--seat) * .98);
  margin: 0;
  padding: calc(var(--seat) * .05) 0 0;
  border: 1px solid color-mix(in srgb, var(--txt) 55%, transparent);
  border-radius: calc(var(--seat) * .09);
  background: var(--surface);
  color: var(--txt);
  font: inherit;
  text-align: center;
  line-height: 1;
}
.seat-num { display: block; font-weight: 700; font-size: calc(var(--seat) * var(--fs)); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chair {
  display: block; position: relative;
  width: 58%; height: 26%;
  margin: calc(var(--seat) * .06) auto 0;
  background: color-mix(in srgb, var(--txt) 45%, var(--surface));
  border-radius: 3px 3px 1px 1px;
}
.chair::before, .chair::after {
  content: ""; position: absolute; width: 14%; height: 18%; bottom: -18%;
  background: color-mix(in srgb, var(--txt) 45%, var(--surface));
}
.chair::before { left: 8%; }
.chair::after  { right: 8%; }
.seat.blocked {
  background: repeating-linear-gradient(135deg, transparent 0 5px, color-mix(in srgb, var(--txt) 14%, transparent) 5px 7px), var(--surface);
  color: var(--muted);
}
.seat .x { display: block; padding-top: calc(var(--seat) * .2); font-size: calc(var(--seat) * .35); }

/* blocked-seat editing */
.edit-bar {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap;
  margin: 0 0 1rem; padding: .5rem .6rem .5rem 1rem; border-radius: var(--radius);
  background: color-mix(in srgb, var(--pri) 12%, var(--surface)); border: 1px solid var(--pri); font-weight: 600;
}
body.edit-seats button.seat:not(:disabled) { cursor: pointer; }
body.edit-seats button.seat:not(:disabled):hover { box-shadow: inset 0 0 0 2px var(--pri); }
body.edit-seats button.seat:focus-visible { outline: 3px solid color-mix(in srgb, var(--pri) 60%, transparent); outline-offset: 1px; position: relative; z-index: 1; }
body.edit-seats button.seat:disabled { opacity: .35; }

/* ───────── Dialogs: settings drawer & license ───────── */
dialog { color: var(--txt); background: var(--surface); border: none; padding: 0; }
dialog::backdrop { background: rgba(0, 0, 0, .5); }
dialog h2 { margin: 0; font-size: 1.2rem; }

dialog.drawer {
  margin: 0 0 0 auto; width: min(400px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh;
  border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgba(0, 0, 0, .3);
  overscroll-behavior: contain;
}
dialog.drawer[open] { animation: drawerIn .2s ease-out; }
@keyframes drawerIn { from { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { dialog.drawer[open] { animation: none; } }
.drawer-head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .5rem .6rem .5rem 1.2rem; background: var(--surface); border-bottom: 1px solid var(--line);
}
.drawer-body { padding: 0 1.2rem calc(1.5rem + env(safe-area-inset-bottom)); }
.drawer-body section { padding: 1rem 0 1.1rem; border-bottom: 1px solid var(--line); scroll-margin-top: 4rem; }
.drawer-body section:last-child { border-bottom: none; }
.drawer-body h3 { margin: 0 0 .5rem; font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
:lang(bn) .drawer-body h3 { letter-spacing: 0; font-size: .85rem; }   /* letter-spacing breaks Bengali conjuncts */
.field { display: flex; align-items: center; justify-content: space-between; gap: .8rem; min-height: var(--tap); margin: .35rem 0; cursor: pointer; }
.field select { max-width: 58%; }
.field input[type=number], .field input[type=text] { width: 7rem; text-align: right; }
.vol { display: flex; align-items: center; gap: .4rem; }
.vol input[type=range] { width: 9rem; }
.cues { border: 1px solid var(--line); border-radius: 10px; margin: .6rem 0 .8rem; padding: .3rem .9rem .5rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); }
.cues legend { padding: 0 .3rem; font-size: .9rem; color: var(--muted); }
.cues label.check { min-height: var(--tap); }
.drawer-body h4.sub { margin: 1rem 0 .2rem; font-size: .95rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.btn-row .btn { font-weight: 500; }
.note { margin: .4rem 0; padding: .5rem .7rem; border-radius: 8px; font-size: .9rem; background: color-mix(in srgb, var(--txt) 6%, var(--surface)); }
fieldset.plain { border: none; margin: 0; padding: 0; min-width: 0; }
fieldset.plain:disabled .field { opacity: .55; cursor: default; }
.layout-status { margin: .5rem 0; font-size: .9rem; font-weight: 600; }
.layout-status.ok  { color: var(--ok); }
.layout-status.err { color: var(--danger); }
body.dark-theme .layout-status.ok { color: #6fd08f; }
.keys { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin: 0; align-items: center; }
.keys dt { white-space: nowrap; }
.keys dd { margin: 0; color: var(--muted); }
kbd {
  display: inline-block; min-width: 1.8em; padding: .1em .45em; text-align: center;
  font: 600 .85rem/1.4 ui-monospace, Consolas, monospace;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--bg);
}

dialog.modal {
  width: calc(100% - 2rem); max-width: 520px; max-height: 90dvh;
  padding: 1.25rem 1.25rem 1rem; border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0, 0, 0, .4);
}
dialog.modal h2 { margin-bottom: .8rem; }
.modal-close { position: absolute; top: .4rem; right: .4rem; width: var(--tap); height: var(--tap); background: none; border: none; font-size: 1.2rem; color: var(--txt); cursor: pointer; }
.modal-text { white-space: pre-wrap; font-size: .85rem; line-height: 1.4; }

/* ───────── Phone tab bar & projection bar (hidden by default) ───────── */
#tabBar, #projBar { display: none; }

/* ───────── Compact (phones / narrow windows) ───────── */
@media (max-width: 899px) {
  #stage { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .brand small, .actions .lbl, #toggleTimerBtn, #togglePlanBtn { display: none; }
  .actions .btn { width: var(--tap); padding: 0; }
  .plan-bar .lbl { display: none; }
  .plan-bar .btn { width: var(--tap); padding: 0; }
  .actions { flex-wrap: nowrap; }
  #stage { padding: .6rem; padding-bottom: calc(var(--tap) + 1.4rem + env(safe-area-inset-bottom)); }
  body[data-tab="timer"] #planPanel, body[data-tab="plan"] #timerBox { display: none; }
  body.hide-timer #planPanel, body.hide-plan #timerBox { display: flex; }
  #tabBar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  #tabBar button {
    flex: 1; min-height: 56px; border: none; background: none; color: var(--muted);
    font: inherit; font-weight: 600; cursor: pointer;
  }
  #tabBar button.active { color: var(--pri); box-shadow: inset 0 3px 0 var(--pri); }
  .page-footer { display: none; }
}

/* ───────── Fit to screen (setup mode): side-by-side desktop or one tab on phones; no page scrolling.
   The dial takes whatever height the controls leave; seats are sized by width and height. ───────── */
@media (min-width: 900px) and (min-height: 480px), (max-width: 700px) and (min-height: 480px) {
  body:not(.mode-projection) .app { height: 100dvh; min-height: 0; }
  body:not(.mode-projection) #stage { min-height: 0; align-items: stretch; grid-template-rows: minmax(0, 1fr); }
  body:not(.mode-projection) #timerBox { min-height: 0; overflow-y: auto; }
  body:not(.mode-projection) #pie { flex: 1 1 0; min-height: 110px; width: 100%; height: 100%; max-width: none; }
  body:not(.mode-projection) .clock, body:not(.mode-projection) .timer-controls { flex: none; }
  body:not(.mode-projection) #planHolder { flex: 1; min-height: 0; container-type: size; overflow: auto; }
  body:not(.mode-projection) .plan-container {
    --head: 5.8rem;
    --seat: max(26px, min(calc(100cqw / (var(--units) + 1)), calc((100cqh - var(--head)) / (var(--rows) * 1.12)), 72px));
  }
  body:not(.mode-projection) .plan-container.has-warn { --head: 8.8rem; }
  body:not(.mode-projection) .plan-bar { flex: none; margin-bottom: .6rem; }
  body:not(.mode-projection) .edit-bar { flex: none; margin-bottom: .6rem; }
  .page-footer { padding: .3rem 1rem; font-size: .75rem; }
}
@media (min-width: 900px) and (min-height: 480px) and (max-height: 760px) {
  #stage { padding: .6rem; gap: .6rem; }
  #timerBox { padding: .6rem; gap: .4rem; }
  .timer-controls { gap: .45rem; }
  .run-row .btn { min-height: var(--tap); }
  #endTime { min-height: 1.2em; }
}

/* ───────── Projection mode ───────── */
body.mode-projection { overflow: hidden; }
body.mode-projection .topbar,
body.mode-projection .page-footer,
body.mode-projection .timer-controls,
body.mode-projection .plan-bar,
body.mode-projection #tabBar { display: none !important; }
body.mode-projection .app { height: 100dvh; min-height: 0; }
body.mode-projection #stage {
  height: 100dvh; padding: 2vmin; gap: 2vmin; align-items: stretch;
  grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
}
body.mode-projection #timerBox, body.mode-projection #planPanel { display: flex !important; min-height: 0; min-width: 0; }
body.mode-projection #timerBox {
  container-type: size;
  justify-content: center; gap: 1.5vmin; padding: 2vmin;
}
body.mode-projection #pie { width: min(100cqw, calc(100cqh - 16vmin)); max-width: none; }
body.mode-projection #dateTime { font-size: clamp(.9rem, calc(2.4vmin * var(--scale, 1)), 2.2rem); }
body.mode-projection #endTime  { font-size: clamp(1.1rem, calc(3.6vmin * var(--scale, 1)), 3.4rem); }
body.mode-projection #planPanel { flex-direction: column; }
body.mode-projection #planHolder { container-type: size; flex: 1; min-height: 0; overflow: hidden; }
body.mode-projection .plan-container {
  height: 100cqh; justify-content: center;
  --seat: min(calc(100cqw / (var(--units) + 1)), calc((100cqh - 18cqh) / (var(--rows) * 1.12)));
}
body.mode-projection .plan-container h1 { font-size: 5.5cqh; margin: 0; }
body.mode-projection .plan-sub { font-size: 2.6cqh; margin: .3cqh 0 1cqh; }
body.mode-projection .edit-bar { display: none; }
body.mode-projection .podium { height: 1.6cqh; margin-bottom: 1cqh; }

/* auto layout by screen shape: wide → side by side; squarish/portrait → stacked */
@media (min-aspect-ratio: 13/10) {
  body.mode-projection #stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
}
@media (min-aspect-ratio: 16/10) {
  body.mode-projection #stage { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}
@media (max-aspect-ratio: 13/10) {
  body.mode-projection #stage { grid-template-rows: minmax(0, 5fr) minmax(0, 6fr); }
}
/* manual overrides (Settings → Projection layout) */
body.mode-projection[data-proj="side"] #stage  { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); grid-template-rows: minmax(0, 1fr); }
body.mode-projection[data-proj="stack"] #stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 5fr) minmax(0, 6fr); }
body.mode-projection[data-proj="timer"] #stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
body.mode-projection[data-proj="timer"] #planPanel { display: none !important; }
body.mode-projection[data-proj="plan"] #stage  { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
body.mode-projection[data-proj="plan"] #timerBox { display: none !important; }
body.hide-timer.mode-projection #timerBox, body.hide-plan.mode-projection #planPanel { display: flex !important; }

/* blocked-sound banner (stays visible in projection, above everything) */
.sound-banner {
  position: fixed; top: max(.6rem, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 300;
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; justify-content: center;
  width: max-content; max-width: calc(100vw - 16px); padding: .5rem .6rem .5rem 1rem; border-radius: 14px;
  background: var(--surface); color: var(--txt); border: 2px solid var(--danger); box-shadow: 0 6px 24px rgba(0, 0, 0, .35); font-weight: 600;
}
.sound-banner[hidden] { display: none; }

/* floating controls */
body.mode-projection #projBar {
  display: flex; gap: .5rem; position: fixed; left: 50%; bottom: max(2vmin, env(safe-area-inset-bottom)); transform: translateX(-50%);
  padding: .5rem; border-radius: 999px; z-index: 100;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
  transition: opacity .3s;
}
#projBar .btn { border-radius: 999px; min-width: 56px; min-height: 56px; font-size: 1.1rem; }
#projBar [data-action] .lbl { display: none; }
#projBar .proj-adj { display: flex; gap: .5rem; }
#projBar .adj { padding-inline: .9rem; font-weight: 600; white-space: nowrap; }
/* narrow screens: the bar wraps to two rows (time adjust on its own row) instead of overflowing */
@media (max-width: 640px) {
  body.mode-projection #projBar { flex-wrap: wrap; justify-content: center; width: max-content; max-width: calc(100vw - 16px); border-radius: 32px; }
  #projBar .proj-adj { order: -1; flex-basis: 100%; justify-content: center; }
}
#projBar .armed .lbl { display: inline; }
body.mode-projection.idle #projBar { opacity: 0; pointer-events: none; }
body.mode-projection.idle { cursor: none; }

/* ───────── Print: seat plan only ───────── */
@media print {
  :root, body.dark-theme { --bg: #fff; --surface: #fff; --txt: #000; --muted: #444; --pri: #AC1F24; }
  @page { size: landscape; margin: 10mm; }
  body { background: #fff; }
  .topbar, .page-footer, #timerBox, .plan-bar, .edit-bar, #tabBar, #projBar, dialog { display: none !important; }
  #stage { display: block; padding: 0; }
  #planPanel { display: block !important; }
  #planHolder { overflow: visible; container-type: normal; }
  .plan-container { --seat: min(calc(260mm / (var(--units) + 1)), calc(150mm / (var(--rows) * 1.12)), 24mm); }
  .plan-container h1 { font-size: 18pt; }
  .seat, .podium { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
