/* MusicMin — Stage mode. Everything here is scoped to .live-view.is-stage (or the stage's own
   elements), so normal Live View is untouched. Phone rules use the app's one phone condition:
   (max-width:768px), ((orientation:landscape) and (max-height:500px) and (pointer:coarse)). */

/* The entry buttons, in the Session Flow sidebar under its title: Stage View (the MD's view) and
   Stage Display (the band's window). Labels centred; one height. */
.live-sidebar-stage-group { display:grid; grid-template-columns:1fr; gap:6px; margin:0 0 14px; }
.live-sidebar-overlay .live-sidebar-stage-group { margin:0 20px 14px; }
.live-sidebar-stage-group button {
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  min-height:40px; padding:6px 10px; border:1.5px solid var(--primary); border-radius:10px;
  background:transparent; color:var(--primary); font:inherit; font-size:13px; font-weight:800;
  line-height:1.1; text-align:center; white-space:nowrap; cursor:pointer;
}
/* Stage View's colour is deep teal — the accent of Stage View itself ("Now:" line, Stage Display,
   the band's current step) — so the button looks like the view it opens, and stays distinct from
   blue Start Live Flow, black Present, and the amber reserved for the MD's calls. */
.live-sidebar-stage-group .live-sidebar-stage-btn { background:#0f766e; border-color:#0f766e; color:#fff; }
.live-sidebar-stage-group .live-sidebar-display-btn { border-color:#0f766e; color:#0f766e; }
body.dark .live-sidebar-stage-group .live-sidebar-stage-btn { background:#2dd4bf; border-color:#2dd4bf; color:#042f2e; }
body.dark .live-sidebar-stage-group .live-sidebar-display-btn { border-color:#2dd4bf; color:#5eead4; }
.live-sidebar-stage-group button:hover { background:rgba(15,118,110,.1); }
.live-sidebar-stage-group .live-sidebar-stage-btn:hover { background:#115e59; border-color:#115e59; }
body.dark .live-sidebar-stage-group .live-sidebar-stage-btn:hover { background:#5eead4; border-color:#5eead4; }

/* The event card's Stage View button, same teal. */
.btn-stage-view { background:#0f766e !important; border-color:#0f766e !important; color:#fff !important; }
.btn-stage-view:hover:not(:disabled) { background:#115e59 !important; border-color:#115e59 !important; }
body.dark .btn-stage-view { background:#2dd4bf !important; border-color:#2dd4bf !important; color:#042f2e !important; }
body.dark .btn-stage-view:hover:not(:disabled) { background:#5eead4 !important; border-color:#5eead4 !important; }
.btn-stage-view:disabled { opacity:.45; }

/* The stage chrome exists in the DOM from load and only shows in Stage mode. */
.stage-top, .stage-next, .stage-panel { display:none; }

.live-view.is-stage {
  padding:0 !important;
  --stage-bg:#000; --stage-fg:#f8fafc; --stage-muted:#94a3b8; --stage-line:rgba(255,255,255,.14);
  background:var(--stage-bg) !important; color:var(--stage-fg);
}
body.light .live-view.is-stage {
  --stage-bg:#fff; --stage-fg:#0f172a; --stage-muted:#475569; --stage-line:rgba(15,23,42,.14);
}
.live-view.is-stage.is-stage-pseudo {
  height:100dvh;
  padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left) !important;
}

/* Out of the way: everything that is for preparing a song rather than playing it. */
.live-view.is-stage .live-header-shell,
.live-view.is-stage #hamburger-menu,
.live-view.is-stage .live-sidebar-overlay,
.live-view.is-stage #live-sidebar,
.live-view.is-stage .live-sidebar-toggle,
.live-view.is-stage #live-controls,
.live-view.is-stage #floating-controls,
.live-view.is-stage #floating-controls-toggle,
.live-view.is-stage #floating-youtube-shortcut,
.live-view.is-stage #floating-speed-panel,
.live-view.is-stage #live-instructions { display:none !important; }

/* The top row: the bar, then the roadmap (moved in here on entry), then a hairline of progress. */
.live-view.is-stage .stage-top {
  display:flex; flex-wrap:wrap; align-items:center; flex:0 0 auto;
  padding:calc(4px + var(--mm-safe-top, 0px)) 12px 0; gap:0 10px;
  border-bottom:1px solid var(--stage-line);
}
.live-view.is-stage .stage-head, .live-view.is-stage .stage-bar {
  display:flex; align-items:center; gap:12px; min-height:44px; min-width:0;
  font-size:16px; font-weight:700; white-space:nowrap;
}
/* What is playing takes the room; the buttons sit at the end of the same line, or on the next
   line, right-aligned, when a narrow window has no room for both. */
.live-view.is-stage .stage-head { flex:1 1 18ch; }
.live-view.is-stage .stage-bar { flex:0 0 auto; max-width:100%; margin-left:auto; flex-wrap:wrap; justify-content:flex-end; row-gap:6px; }
.stage-top .stage-title { flex:1 1 auto; min-width:6ch; overflow:hidden; text-overflow:ellipsis; font-size:18px; font-weight:800; }
.stage-top .stage-key { color:#fbbf24; }
body.light .stage-top .stage-key { color:#b45309; }
.stage-top .stage-capo { color:var(--stage-muted); }
.stage-top .stage-capo[hidden] { display:none; }
.stage-top .stage-page { color:var(--stage-muted); font-variant-numeric:tabular-nums; min-width:2.5em; text-align:right; }
.stage-bar button, .stage-head button {
  min-height:36px; padding:4px 12px; border:1px solid var(--stage-line); border-radius:999px;
  background:transparent; color:inherit; font:inherit; font-size:14px; cursor:pointer;
}
.stage-bar button:hover, .stage-head button:hover { border-color:var(--stage-muted); }
.stage-bar .stage-more, .stage-bar .stage-exit { min-width:40px; padding:4px 10px; font-size:18px; line-height:1; }
.stage-bar .stage-follow { max-width:30ch; overflow:hidden; text-overflow:ellipsis; }
.stage-bar .stage-follow[hidden] { display:none; }
.stage-bar .stage-follow.is-following { border-color:#22c55e; color:#4ade80; }
body.light .stage-bar .stage-follow.is-following { color:#15803d; }
.stage-bar .stage-follow.is-paused { border-color:#f59e0b; color:#fbbf24; }
.stage-bar .stage-follow.is-you { opacity:.75; cursor:default; }

.live-view.is-stage .live-roadmap { flex:1 1 100%; margin:2px 0 6px; padding:2px 0; }
/* Stage View: bigger steps, and the first words of each section under its name — the lyrics
   display's preview line, so the MD can see what the band will sing next. */
.live-view.is-stage .live-roadmap-chip { min-height:56px; max-width:240px; padding:7px 14px 7px 10px; }
.live-view.is-stage .live-roadmap-name { font-size:15px; }
.live-view.is-stage .live-roadmap-num { width:26px; height:26px; font-size:13px; }
.live-view.is-stage .live-roadmap-preview { display:block; font-size:13.5px; }
.live-view.is-stage .live-roadmap-preview.is-instruction { font-size:15px; }
.live-view.is-stage .live-roadmap-chip { max-width:280px; }
/* Chords-only hides the words, never the band's instructions that sit among them. */
.live-view.is-stage.stage-chords-only .live-seg-lyric .inline-instruction { visibility:visible; }
.live-view.is-stage .live-roadmap-summary { font-size:15px; color:#79e2cb; opacity:1; }
body.light .live-view.is-stage .live-roadmap-summary { color:#006f60; }
/* The bar already says "You're directing"; the roadmap's copy of it is just lost width. */
.live-view.is-stage .live-roadmap-director.is-you { display:none; }
.live-view.is-stage .live-roadmap-director { border-color:var(--stage-line); }

/* Songs with no sections have no roadmap; a page-progress hairline stands in for it. */
.live-view.is-stage .stage-progress { flex:1 1 100%; height:3px; margin:0 -12px; background:transparent; }
.live-view.is-stage .live-roadmap:not([hidden]) ~ .stage-progress { display:none; }
.stage-progress-fill { display:block; height:100%; width:0; background:var(--primary); }

/* The chart: big, edge to edge, nothing floating over it. */
.live-view.is-stage .live-view-main { padding-top:6px; gap:0; }
.live-view.is-stage .live-view-content { padding:0 16px 16px !important; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }
.live-view.is-stage .live-view-content { --mm-chord-color:#fbbf24; }
body.light .live-view.is-stage .live-view-content { --mm-chord-color:#b45309; }
.live-view.is-stage.is-stage-contrast .live-view-content { font-weight:700; color:#fff; }
.live-view.is-stage.is-stage-contrast .live-view-content { --mm-chord-color:#fde047; }
.live-view.is-stage.is-stage-contrast .live-view-content .chord-line { font-weight:900; }
.live-view.is-stage.is-stage-contrast .section-header { color:#7dd3fc; }

/* Next song, along the bottom. Tapping it is the same as a forward page turn at the end. */
.live-view.is-stage .stage-next {
  display:flex; align-items:baseline; gap:10px; flex:0 0 auto; width:100%;
  min-height:40px; padding:8px 16px calc(8px + env(safe-area-inset-bottom));
  border:0; border-top:1px solid var(--stage-line); background:transparent; color:inherit;
  font:inherit; font-size:15px; text-align:left; cursor:pointer; white-space:nowrap; overflow:hidden;
}
.live-view.is-stage .stage-next[hidden] { display:none; }
.stage-next .stage-next-kicker { color:var(--stage-muted); font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.stage-next .stage-next-title { overflow:hidden; text-overflow:ellipsis; min-width:0; }
.stage-next .stage-next-meta { color:var(--stage-muted); }
.stage-next .stage-next-go { margin-left:auto; color:#22c55e; font-weight:800; }
.live-view.is-stage .stage-next.is-armed { background:rgba(34,197,94,.14); border-top-color:#22c55e; }
.live-view.is-stage .stage-next.is-end .stage-next-title { color:var(--stage-muted); }
.live-view.is-stage .stage-next.is-flash { animation:stage-flash .6s ease; }
@keyframes stage-flash { 0%,100% { background:transparent; } 40% { background:rgba(245,158,11,.25); } }

/* The ⋯ panel. */
.live-view.is-stage .stage-panel {
  position:fixed; top:calc(56px + var(--mm-safe-top, 0px)); right:12px; z-index:2004;
  display:grid; grid-template-columns:1fr 1fr; gap:8px; width:min(340px, calc(100vw - 24px));
  padding:12px; border:1px solid rgba(255,255,255,.2); border-radius:14px;
  background:rgba(15,23,42,.97); color:#fff; box-shadow:0 14px 34px rgba(0,0,0,.4);
}
.live-view.is-stage .stage-panel[hidden] { display:none; }
.stage-panel button {
  min-height:44px; padding:8px 10px; border:1px solid rgba(255,255,255,.22); border-radius:10px;
  background:rgba(255,255,255,.06); color:#fff; font-size:14px; font-weight:700; cursor:pointer;
}
.stage-panel button[aria-pressed="true"] { border-color:#22c55e; }

/* The metronome panel's anchor (the floating button) is hidden here, so pin it under the bar. */
.live-view.is-stage .metronome-panel { left:auto !important; right:12px !important; top:calc(56px + var(--mm-safe-top, 0px)) !important; bottom:auto !important; }

/* Phones. Portrait: title and key only in the bar; BPM moves to ⋯ (the Click button). */
@media (max-width:768px), ((orientation:landscape) and (max-height:500px) and (pointer:coarse)) {
  .live-view.is-stage .stage-head, .live-view.is-stage .stage-bar { gap:8px; min-height:40px; font-size:14px; }
  .stage-top .stage-title { font-size:16px; }
  .stage-bar .stage-bpm { display:none; }
  .stage-bar .stage-follow { max-width:14ch; padding:4px 8px; font-size:12px; }
  /* Room is the title's; an idle Follow pill lives in ⋯ on a phone. */
  .stage-bar .stage-follow:not(.is-following):not(.is-paused) { display:none; }
  .stage-bar .stage-more, .stage-bar .stage-exit { min-width:36px; padding:4px 8px; }
  .live-view.is-stage .live-roadmap-chip { min-height:40px; padding:4px 10px 4px 7px; }
  .live-view.is-stage .live-roadmap-preview { display:none; }
  .live-view.is-stage .live-roadmap-name { font-size:13px; }
  .live-view.is-stage .live-view-content { padding:0 10px 12px !important; }
  .live-view.is-stage .stage-next { min-height:30px; padding:5px 12px calc(5px + env(safe-area-inset-bottom)); font-size:13px; }
  .live-view.is-stage .stage-panel { left:12px; right:12px; width:auto; }
}
/* Short landscape phone: height is everything. Bar and roadmap share one row; the next strip
   keeps only the title. */
@media ((orientation:landscape) and (max-height:500px) and (pointer:coarse)) {
  .live-view.is-stage .live-roadmap { flex:1 1 100%; min-width:0; margin:0; }
  .live-view.is-stage .stage-next .stage-next-meta,
  .live-view.is-stage .stage-next .stage-next-kicker { display:none; }
}

.live-view .live-roadmap { gap:6px 8px; padding:8px 16px; margin:4px 0 0; }
.live-view.is-stage .live-roadmap { padding:4px 0 8px; }
.stage-context { display:flex;flex:1 1 100%;gap:8px 18px;flex-wrap:wrap;padding:5px 0;color:var(--stage-muted);font-size:13px; }
.stage-instrument-note { flex:1 1 100%;color:var(--stage-fg);white-space:pre-wrap;overflow-wrap:anywhere; }
.stage-instrument-note[hidden],.stage-cue[hidden] { display:none; }
.stage-cue { flex:1 1 100%;padding:6px 10px;margin:4px 0;background:color-mix(in srgb,var(--primary) 18%,transparent);border-radius:8px;font-size:14px; }
.stage-pedal-help { grid-column:1/-1;font-size:12px;line-height:1.5;margin:4px 0;color:#cbd5e1; }
.live-view.is-stage.stage-lyrics-only .live-seg-chord,.live-view.is-stage.stage-lyrics-only .live-chord-only-line { visibility:hidden; }
.live-view.is-stage.stage-chords-only .live-seg-lyric { visibility:hidden; }
.live-view.is-stage.stage-chords-only .lyrics-line:not(.live-chorded-line) { visibility:hidden; }
.stage-notes-dialog { width:min(480px,calc(100vw - 32px));border:1px solid #475569;border-radius:16px;padding:24px;background:#182330;color:#f8fafc; }
.stage-notes-dialog::backdrop { background:#0009; }.stage-notes-dialog h2 { margin-top:0;font-size:22px; }
.stage-notes-dialog textarea { display:block;width:100%;min-height:100px;padding:12px;font:inherit;color:inherit;background:#0d1620;border:1px solid #64748b;border-radius:8px;margin:8px 0; }
.stage-notes-dialog button { min-height:44px;padding:8px 18px;margin-right:8px;border-radius:8px;border:1px solid #64748b;color:inherit;background:#26374a;cursor:pointer; }
@media(max-width:768px), ((orientation:landscape) and (max-height:500px) and (pointer:coarse)) {
  .live-view .live-roadmap { padding:6px 10px; }
  .live-view.is-stage .stage-follow:not(.is-following):not(.is-paused) { display:block; }
  .live-view.is-stage .stage-follow { max-width:none; }
  .live-view.is-stage .stage-bpm { display:block;font-size:12px;padding:4px 6px; }
  .stage-context { font-size:12px; }
  .live-view.is-stage .stage-next { flex-wrap:wrap;white-space:normal; }
  .live-view.is-stage .stage-panel { max-height:calc(100dvh - 85px);overflow:auto; }
}
@media ((orientation:landscape) and (max-height:500px) and (pointer:coarse)) {
  .live-view.is-stage .live-roadmap-summary,.live-view.is-stage .stage-context { display:none; }
  .live-view.is-stage .live-roadmap-chip { min-height:36px; }
  .live-view.is-stage .stage-cue { font-size:12px;margin:0;padding:3px 8px; }
}

/* Stage View bar extras: full screen and the Stage Display window. */
.stage-bar .stage-fullscreen, .stage-bar .stage-display-btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; line-height:1; }
.stage-bar .stage-fullscreen svg { width:16px; height:16px; }
.stage-bar .stage-display-btn { border-color:#79e2cb; color:#79e2cb; }
body.light .stage-bar .stage-display-btn { border-color:#006f60; color:#006f60; }
.stage-bar .stage-call-btn { border-color:#f59e0b; color:#fbbf24; font-weight:800; }
body.light .stage-bar .stage-call-btn { color:#b45309; }
.stage-bar .stage-call-btn[hidden] { display:none; }

/* Teleprompter (3.9.0): the button, its small menu, and the Android app's full-window frame. */
.stage-bar .stage-prompter-btn { display:inline-flex; align-items:center; gap:6px; line-height:1; border-color:#facc15; color:#fde047; }
body.light .stage-bar .stage-prompter-btn { border-color:#a16207; color:#a16207; }
.stage-bar .stage-prompter-btn.is-open { background:rgba(250,204,21,.16); }
.stage-prompter-btn[hidden], .live-sidebar-prompter-btn[hidden] { display:none !important; }
.live-sidebar-stage-group .live-sidebar-prompter-btn { border-color:#a16207; color:#a16207; }
body.dark .live-sidebar-stage-group .live-sidebar-prompter-btn { border-color:#facc15; color:#fde047; }
.stage-prompter-menu { position:fixed; z-index:10050; display:flex; flex-direction:column; min-width:220px; max-width:min(340px,calc(100vw - 16px));
  padding:6px; border-radius:14px; background:#0b1119; border:1px solid rgba(250,204,21,.45); box-shadow:0 18px 50px rgba(0,0,0,.55); }
.stage-prompter-menu-item { all:unset; box-sizing:border-box; padding:10px 12px; border-radius:9px; color:#f8fafc; font:600 14px/1.25 inherit; cursor:pointer; }
.stage-prompter-menu-item:hover, .stage-prompter-menu-item:focus-visible { background:rgba(250,204,21,.16); }
.stage-prompter-menu-item.is-current { color:#fde047; }
.stage-prompter-frame { position:fixed; inset:0; z-index:10060; background:#000; }
.stage-prompter-frame iframe { width:100%; height:100%; border:0; display:block; }

/* The MD's call pad: big targets, numbered for the keyboard (1–9), sent to every reader. */
.stage-callpad {
  position:fixed; top:var(--mm-overlay-top, calc(56px + var(--mm-safe-top, 0px))); right:12px; z-index:2005;
  max-height:calc(100dvh - var(--mm-overlay-top, 56px) - 12px); overflow:auto;
  width:min(460px, calc(100vw - 24px)); padding:14px; border:1px solid rgba(245,158,11,.5); border-radius:16px;
  background:rgba(15,23,42,.98); color:#fff; box-shadow:0 18px 40px rgba(0,0,0,.5);
}
.stage-callpad[hidden] { display:none; }
.stage-callpad h3 { margin:0 0 4px; font-size:15px; }
.stage-callpad .stage-callpad-help { margin:0 0 10px; font-size:12px; color:#cbd5e1; }
.stage-callpad .stage-callpad-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:8px; }
.stage-callpad button {
  position:relative; min-height:52px; padding:8px; border:1px solid rgba(255,255,255,.22); border-radius:12px;
  background:rgba(255,255,255,.06); color:#fff; font:inherit; font-size:14px; font-weight:800; cursor:pointer;
}
.stage-callpad button:hover { border-color:#f59e0b; background:rgba(245,158,11,.14); }
.stage-callpad button kbd { position:absolute; top:4px; left:6px; font:inherit; font-size:10px; opacity:.6; }
.stage-callpad .stage-callpad-sections { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.stage-callpad .stage-callpad-sections button { min-height:38px; padding:6px 10px; font-size:13px; font-weight:700; }
.stage-callpad .stage-callpad-text { display:flex; gap:6px; margin-top:10px; }
.stage-callpad .stage-callpad-text input { flex:1; min-width:0; min-height:40px; padding:6px 10px; border:1px solid rgba(255,255,255,.3); border-radius:10px; background:#0b1220; color:#fff; font:inherit; }
.stage-callpad .stage-callpad-status { margin:8px 0 0; font-size:12px; color:#cbd5e1; min-height:1.2em; }

/* A call arriving: one unmissable line across the top of the chart, for a few seconds. */
.stage-call-banner {
  position:fixed; left:50%; top:var(--mm-overlay-top, calc(64px + var(--mm-safe-top, 0px))); transform:translateX(-50%); z-index:2006;
  display:flex; align-items:center; gap:14px; max-width:calc(100vw - 24px); padding:12px 22px;
  border-radius:16px; border:2px solid #f5ad32; background:#663d08; color:#fff3d6; box-shadow:0 14px 40px rgba(0,0,0,.45);
  font-size:clamp(20px, 3vw, 34px); font-weight:900; letter-spacing:.01em; pointer-events:none;
  animation:stage-call-in .25s ease-out;
}
.stage-call-banner[hidden] { display:none; }
.stage-call-banner small { display:flex; flex-direction:column; justify-content:center; gap:.12em; padding-left:.55em; border-left:2px solid color-mix(in srgb, currentColor 30%, transparent); color:#f5cd87; font-size:.4em; line-height:1.1; white-space:nowrap; }
.stage-call-banner small:empty { display:none; }
.stage-call-banner .from-k { font-size:.75em; font-weight:700; text-transform:uppercase; letter-spacing:.12em; }
.stage-call-banner .from-n { font-weight:650; max-width:12em; overflow:hidden; text-overflow:ellipsis; }
.stage-call-banner.is-section { background:#79e2cb; color:#111827; border-color:#79e2cb; }
.stage-call-banner.is-pending { opacity:.85; }
@keyframes stage-call-in { from { transform:translate(-50%, -12px); opacity:0; } to { transform:translate(-50%, 0); opacity:1; } }
@media (max-width:768px), ((orientation:landscape) and (max-height:500px) and (pointer:coarse)) {
  .stage-callpad { left:12px; right:12px; width:auto; max-height:calc(100dvh - 80px); overflow:auto; }
  .stage-callpad .stage-callpad-grid { grid-template-columns:repeat(2, 1fr); }
  .stage-bar .stage-display-btn .stage-btn-label, .stage-bar .stage-fullscreen .stage-btn-label { display:none; }
}

/* Band members' requests: violet; urgent: red and pulsing. The MD's own calls stay amber. */
.stage-call-banner.is-member { background:#a78bfa; color:#1e1b4b; border-color:#a78bfa; }
.stage-call-banner.is-urgent { background:#ef4444; color:#fff; border-color:#ef4444; animation:stage-call-in .25s ease-out, stage-urgent 1s ease-in-out infinite; }
@keyframes stage-urgent { 50% { box-shadow:0 0 0 12px rgba(239,68,68,.35), 0 14px 40px rgba(0,0,0,.45); } }
.stage-callpad.is-member { border-color:rgba(167,139,250,.6); }
.stage-callpad.is-member button:hover { border-color:#a78bfa; background:rgba(167,139,250,.16); }
.stage-callpad button.is-urgent { border-color:#ef4444; color:#fecaca; background:rgba(239,68,68,.16); }
.stage-callpad .stage-callpad-close { position:absolute; top:8px; right:8px; min-height:32px; width:32px; padding:0; font-size:14px; }
/* Outside Stage View the pad and banner sit over normal Live Flow, on phones too. */
.live-view:not(.is-stage) .stage-callpad { top:var(--mm-overlay-top, calc(70px + var(--mm-safe-top, 0px))); }
.live-sidebar-stage-group .live-call-md-btn { border-color:#7c3aed; color:#6d28d9; }
body.dark .live-sidebar-stage-group .live-call-md-btn { border-color:#a78bfa; color:#c4b5fd; }
.live-sidebar-stage-group button[hidden], .floating-stage button[hidden] { display:none !important; }

/* Requests from the band, waiting for a leader's "Got it". Sits under the bar on the right, over
   Live Flow or Stage View; urgent ones first and red. */
.stage-requests {
  position:fixed; right:12px; top:var(--mm-overlay-top, calc(116px + var(--mm-safe-top, 0px))); z-index:2004;
  width:min(320px, calc(100vw - 24px)); max-height:50vh; overflow:auto; padding:10px;
  border:1px solid rgba(167,139,250,.55); border-radius:14px; background:rgba(15,23,42,.96); color:#fff;
  box-shadow:0 14px 34px rgba(0,0,0,.4);
}
.stage-requests[hidden] { display:none; }
.stage-requests-title { margin:0 2px 8px; font-size:12px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; color:#c4b5fd; }
.stage-request { display:flex; align-items:center; gap:10px; padding:8px 10px; margin-top:6px; border-left:4px solid #a78bfa; border-radius:10px; background:rgba(167,139,250,.12); }
.stage-request.is-urgent { border-left-color:#ef4444; background:rgba(239,68,68,.16); }
.stage-request.is-acked { border-left-color:#22c55e; background:rgba(34,197,94,.14); opacity:.85; }
.stage-request-text { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.stage-request-text strong { font-size:14px; font-weight:800; overflow-wrap:anywhere; }
.stage-request-text span { font-size:12px; color:#cbd5e1; }
.stage-request-ack { flex:0 0 auto; min-height:36px; padding:4px 14px; border:0; border-radius:999px; background:#a78bfa; color:#1e1b4b; font:inherit; font-size:13px; font-weight:850; cursor:pointer; }
.stage-request.is-urgent .stage-request-ack { background:#ef4444; color:#fff; }
.stage-request-done { flex:0 0 auto; color:#4ade80; font-size:13px; font-weight:850; }
/* The member's own confirmation. */
.stage-call-banner.is-ack { background:#22c55e; color:#052e16; border-color:#22c55e; }
@media (max-width:768px), ((orientation:landscape) and (max-height:500px) and (pointer:coarse)) {
  .stage-requests { left:12px; right:12px; width:auto; top:auto; bottom:calc(56px + env(safe-area-inset-bottom)); max-height:40dvh; }
}

/* The MD's emoji calls: a row of faces under the main calls. */
.stage-callpad .stage-callpad-emoji { display:grid; grid-template-columns:repeat(4, 1fr); gap:6px; margin-top:10px; }
.stage-callpad .stage-callpad-emoji:empty { display:none; }
.stage-callpad .stage-callpad-emoji button { min-height:58px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; padding:6px 4px; }
.stage-callpad .stage-callpad-emoji .emoji { font-size:24px; line-height:1; }
.stage-callpad .stage-callpad-emoji .words { font-size:11px; font-weight:700; opacity:.85; }

/* Leaving: fade and lift away, the reverse of the slide-in. Overrides the urgent pulse too. */
.stage-call-banner.is-leaving { animation:stage-call-out .45s ease forwards !important; }
@keyframes stage-call-out { from { opacity:1; transform:translate(-50%, 0); } to { opacity:0; transform:translate(-50%, -12px) scale(.97); } }
/* An acknowledged request shows green, then fades just before it is removed (at ~3.6 s). */
.stage-request.is-acked { animation:stage-req-out .45s ease 3.05s forwards; }
@keyframes stage-req-out { to { opacity:0; transform:translateX(12px); } }

/* MD View: the step being played is larger with a soft glow — done with a zoom (transform), not
   by resizing it. Resizing reflowed the whole strip on every section change: the neighbours slid
   sideways, the roadmap's height dipped and the chart under it bobbed. A transform moves nothing
   else, so the only motion is the step itself. The track keeps room around it for the zoom. */
.live-view.is-stage .live-roadmap-track { align-items:center; gap:12px; padding:9px 10px; }
.live-view.is-stage .live-roadmap-chip {
  transform-origin:center; will-change:transform;
  transition:transform .32s cubic-bezier(.2,.75,.25,1), box-shadow .32s ease, background-color .25s ease, border-color .25s ease, color .25s ease, opacity .25s ease;
}
.live-view.is-stage .live-roadmap-chip.is-current {
  transform:scale(1.1); z-index:1;
  box-shadow:0 0 0 3px color-mix(in srgb, var(--mm-kind) 40%, transparent), 0 8px 24px color-mix(in srgb, var(--mm-kind) 35%, transparent);
}
.live-view.is-stage .live-roadmap-next { color:var(--stage-fg); opacity:.7; }
@media (max-width:768px), ((orientation:landscape) and (max-height:500px) and (pointer:coarse)) {
  .live-view.is-stage .live-roadmap-chip.is-current { transform:scale(1.06); }
}

/* A call that would not fit above the roadmap at full size. */
.stage-call-banner.is-compact { font-size:clamp(16px, 2vw, 24px); padding:8px 16px; gap:10px; }

/* Pin for the call pad, beside its close button. */
.stage-callpad .stage-callpad-pin { position:absolute; top:8px; right:48px; min-height:32px; padding:0 10px; font-size:12px; font-weight:800; }
.stage-callpad .stage-callpad-pin[aria-pressed="true"] { border-color:#f59e0b; color:#fbbf24; background:rgba(245,158,11,.14); }
.stage-callpad .stage-callpad-title { padding-right:150px; }

/* The Live / Now line stays one fixed-height line: the browsing note and its buttons appearing
   must not wrap and push the chart down while the MD scrolls. */
.live-view .live-roadmap-summary { flex-wrap:nowrap; white-space:nowrap; overflow:hidden; min-height:30px; max-height:32px; }
.live-view .live-roadmap-summary .live-roadmap-browsing { min-width:0; overflow:hidden; text-overflow:ellipsis; }
.live-view .live-roadmap-summary > * { flex:0 1 auto; }
.live-view .live-roadmap-summary .live-roadmap-browse-btn { flex:0 0 auto; }
/* On a phone the line is too short for Now, the note, both buttons and Next: while browsing, the
   buttons are what matter, and Now and Next are already lit in the strip above. */
@media (max-width:768px), ((orientation:landscape) and (max-height:500px) and (pointer:coarse)) {
  .live-view .live-roadmap-summary.is-browsing { gap:6px 8px; }
  .live-view .live-roadmap-summary.is-browsing .live-roadmap-now,
  .live-view .live-roadmap-summary.is-browsing .live-roadmap-next { display:none; }
  .live-view .live-roadmap-summary .live-roadmap-browse-btn { padding:4px 10px; }
}

/* "📣 Call MD" beside the YouTube button (right:84px / 68px on phones), same height, in the violet
   the MD sees member requests in. A pill with words, not another round icon, so it is found. */
.floating-call-md-shortcut {
  position:fixed; right:148px; bottom:20px; z-index:2002; height:54px; padding:0 18px;
  display:flex; align-items:center; gap:8px; border:1px solid rgba(255,255,255,.3); border-radius:999px;
  background:#7c3aed; color:#fff; font:inherit; font-size:15px; font-weight:850; cursor:pointer;
  box-shadow:0 10px 28px rgba(76,29,149,.38); -webkit-tap-highlight-color:transparent;
  transition:transform .2s ease, background .2s ease;
}
.floating-call-md-shortcut span:first-child { font-size:20px; line-height:1; }
.floating-call-md-shortcut:hover { background:#6d28d9; transform:scale(1.04); }
.floating-call-md-shortcut:active { transform:scale(.96); }
.floating-call-md-shortcut[hidden], .live-view.is-stage .floating-call-md-shortcut { display:none !important; }
@media (max-width:768px), ((orientation:landscape) and (max-height:500px) and (pointer:coarse)) {
  .floating-call-md-shortcut { right:126px; bottom:calc(10px + env(safe-area-inset-bottom)); height:50px; padding:0 14px; font-size:14px; }
}

/* The set list in MD View: Live Flow's Session Flow panel on the left, in the stage's colours.
   The current song is filled, songs already played are dimmed, a tap jumps. */
.stage-top .stage-setlist-btn { min-width:40px; font-size:18px; line-height:1; }
.stage-top .stage-setlist-btn[aria-pressed="true"] { border-color:var(--stage-muted); background:rgba(255,255,255,.08); }
.stage-top .stage-setlist-btn[hidden] { display:none; }
.live-view.is-stage.stage-setlist-on #live-sidebar {
  display:block !important; flex:0 0 250px; width:250px; max-width:250px; margin:0; padding:10px 10px 16px;
  overflow:auto; background:transparent; color:var(--stage-fg); border:0; border-right:1px solid var(--stage-line);
}
.live-view.is-stage.stage-setlist-on #live-sidebar-title { font-size:12px !important; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--stage-muted); margin:2px 4px 10px !important; }
.live-view.is-stage.stage-setlist-on #live-sidebar-mode-toggle { display:none !important; }
.live-view.is-stage #live-sidebar .flow-item {
  margin:0 0 6px; padding:9px 10px; border:1px solid var(--stage-line); border-radius:10px;
  background:rgba(255,255,255,.03); color:var(--stage-fg); transform:none; transition:background .2s ease, border-color .2s ease, opacity .2s ease;
}
body.light .live-view.is-stage #live-sidebar .flow-item { background:rgba(15,23,42,.03); }
.live-view.is-stage #live-sidebar .flow-item:hover { border-color:var(--stage-muted); transform:none; }
.live-view.is-stage #live-sidebar .flow-item:has(~ .flow-item.active) { opacity:.45; }
.live-view.is-stage #live-sidebar .flow-item.active { background:var(--primary); border-color:var(--primary); color:#fff; opacity:1; }
.live-view.is-stage #live-sidebar .flow-section { font-size:11px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; opacity:.75; }
.live-view.is-stage #live-sidebar .flow-title { font-size:15px; font-weight:800; margin-top:2px; }
.live-view.is-stage #live-sidebar .flow-version { color:inherit !important; opacity:.7; }
.live-view.is-stage.stage-setlist-on .live-view-content { padding-left:18px !important; }
/* Phones: the same list slides over from the left when ☰ is tapped. */
.live-view.is-stage .live-sidebar-overlay.show { display:block !important; }
/* Inside MD View the panel is just the set list: no entry buttons to the view you are already in,
   and it says what it is. */
.live-view.is-stage .live-sidebar-stage-group { display:none !important; }
.live-view.is-stage.stage-setlist-on #live-sidebar-title { display:none !important; }
.live-view.is-stage.stage-setlist-on #live-sidebar::before { content:'Set list'; display:block; margin:2px 4px 10px; font-size:12px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--stage-muted); }

/* Readability: a dark ring keeps the edge on a washed-out projector; the emoji is cap-height; an
   urgent call alone is in capitals; a hairline drains over the time the call stays up. */
/* Centred at left:50%, a banner is only offered half the screen and wraps early; size it to
   its words instead, up to the max-width. */
.stage-call-banner{position:fixed;width:max-content;box-shadow:0 0 0 3px rgba(0,0,0,.55),0 18px 50px rgba(0,0,0,.6)}
.stage-call-banner .call-emoji{font-size:.78em;line-height:1;margin-right:-.15em}
.stage-call-banner.is-urgent .call-text{text-transform:uppercase;letter-spacing:.02em}
.stage-call-banner .call-drain{position:absolute;left:18px;right:18px;bottom:5px;height:4px;border-radius:2px;background:#ffc44d;opacity:1;transform-origin:left center;animation:stage-call-drain linear forwards;pointer-events:none}
/* The MD's own call is a dark amber card (as on the Stage Display); the coloured kinds keep their
   solid fill, with the sender and the drain in the text colour. */
.stage-call-banner:is(.is-section,.is-member,.is-urgent,.is-ack) small { color:inherit; }
.stage-call-banner:is(.is-section,.is-member,.is-urgent,.is-ack) .call-drain { background:currentColor; opacity:.3; }
@keyframes stage-call-drain{from{transform:scaleX(1)}to{transform:scaleX(0)}}

/* Editing the call pad's buttons (saved on this device). While editing, the pad shows only the
   editor; the buttons come back on Save or Cancel. */
.stage-callpad .stage-callpad-editor { display:none; }
.stage-callpad.is-editing .stage-callpad-editor { display:block; }
.stage-callpad.is-editing .stage-callpad-help, .stage-callpad.is-editing .stage-callpad-grid,
.stage-callpad.is-editing .stage-callpad-emoji, .stage-callpad.is-editing .stage-callpad-sections,
.stage-callpad.is-editing .stage-callpad-text, .stage-callpad.is-editing .stage-callpad-edit,
.stage-callpad.is-editing .stage-callpad-status { display:none; }
.stage-callpad .stage-callpad-edit { min-height:32px; margin-top:10px; padding:4px 12px; font-size:12px; font-weight:800; opacity:.85; }
.stage-callpad .stage-preset-note { margin:0 0 8px; font-size:12px; color:#cbd5e1; }
.stage-callpad .stage-callpad-editor h4 { margin:12px 0 6px; font-size:12px; letter-spacing:.06em; text-transform:uppercase; color:#cbd5e1; }
.stage-callpad .stage-preset-row { display:flex; align-items:center; gap:6px; margin-bottom:6px; }
.stage-callpad .stage-preset-row kbd { flex:0 0 22px; text-align:center; font:inherit; font-size:12px; opacity:.6; }
.stage-callpad .stage-preset-row input { min-width:0; min-height:38px; padding:6px 10px; border:1px solid rgba(255,255,255,.3); border-radius:10px; background:#0b1220; color:#fff; font:inherit; font-size:14px; font-weight:700; }
.stage-callpad .stage-preset-row .stage-preset-text { flex:1; }
.stage-callpad .stage-preset-row .stage-preset-emoji { flex:0 0 52px; width:52px; text-align:center; font-size:20px; padding:4px; }
.stage-callpad .stage-preset-row input:disabled { opacity:.6; }
.stage-callpad .stage-preset-row button { min-height:38px; width:38px; padding:0; font-size:15px; }
.stage-callpad .stage-preset-row button:disabled { opacity:.25; cursor:default; }
.stage-callpad .stage-preset-row button.is-remove:not(:disabled):hover { border-color:#ef4444; background:rgba(239,68,68,.16); }
.stage-callpad .stage-preset-add { min-height:36px; width:100%; margin:2px 0 4px; font-size:13px; border-style:dashed; }
.stage-callpad .stage-preset-actions { display:flex; gap:8px; margin-top:14px; }
.stage-callpad .stage-preset-actions button { min-height:42px; padding:6px 14px; font-size:14px; }
.stage-callpad .stage-preset-actions .stage-preset-reset { margin-right:auto; font-size:12px; opacity:.8; }
.stage-callpad .stage-preset-actions .stage-preset-save { border-color:#f59e0b; background:#f59e0b; color:#111827; }
.stage-callpad.is-member .stage-preset-actions .stage-preset-save { border-color:#a78bfa; background:#a78bfa; color:#1e1b4b; }

/* Auto-scroll speed in the MD View menu: a full-width row under Auto-scroll. */
.stage-panel .stage-panel-speed { grid-column:1 / -1; display:flex; align-items:center; gap:10px; min-height:44px; padding:4px 10px; border:1px solid rgba(255,255,255,.22); border-radius:10px; background:rgba(255,255,255,.06); font-size:14px; font-weight:700; }
.stage-panel .stage-panel-speed input { flex:1; min-width:0; accent-color:#79e2cb; height:28px; }
.stage-panel .stage-panel-speed output { min-width:2.2em; text-align:right; font-variant-numeric:tabular-nums; opacity:.85; }
/* The menu opens over a pinned call pad, never under it. */
.live-view.is-stage .stage-panel { z-index:2007; }
/* The MD can tap their own call to take it down everywhere. */
.stage-call-banner.is-clearable { pointer-events:auto; cursor:pointer; }

/* Typing on the dark pad and tray. The app's light theme gives every input a white card
   background with !important; here that left white words on white. */
.stage-callpad input:not([type="checkbox"]):not([type="radio"]),
.stage-requests input:not([type="checkbox"]):not([type="radio"]) {
  background:#0b1220 !important; color:#fff !important; -webkit-text-fill-color:#fff; caret-color:#fff;
  border:1px solid rgba(255,255,255,.3) !important;
}
.stage-callpad input::placeholder, .stage-requests input::placeholder { color:#94a3b8; -webkit-text-fill-color:#94a3b8; opacity:1; }

/* The MD's answers to a request: Got it, Nope, or a short reply in their own words. */
.stage-request { flex-wrap:wrap; }
.stage-request-actions { flex:1 1 100%; display:flex; gap:6px; }
.stage-request-actions button { flex:1; }
.stage-request-nope, .stage-request-reply, .stage-request-send, .stage-request-cancel {
  flex:0 0 auto; min-height:36px; padding:4px 12px; border:1px solid rgba(255,255,255,.3); border-radius:999px;
  background:transparent; color:#fff; font:inherit; font-size:13px; font-weight:800; cursor:pointer;
}
.stage-request-nope:hover { border-color:#94a3b8; background:rgba(148,163,184,.18); }
.stage-request-reply:hover { border-color:#38bdf8; background:rgba(56,189,248,.16); }
.stage-request-replyform { flex:1 1 100%; min-width:0; display:flex; gap:6px; }
.stage-request-replyform input { flex:1 1 0; width:0 !important; min-width:0; min-height:38px; padding:6px 10px; border-radius:10px !important; font:inherit; font-size:14px; }
.stage-request-send { border-color:#38bdf8; background:#38bdf8; color:#082f49; }
.stage-request-cancel { width:36px; padding:0; }
.stage-request.is-nope { border-left-color:#94a3b8; background:rgba(148,163,184,.14); }
.stage-request.is-nope .stage-request-done { color:#cbd5e1; }
.stage-request .stage-request-done { max-width:100%; overflow-wrap:anywhere; }
.stage-call-banner.is-nope { background:#475569; color:#fff; border-color:#475569; }
.stage-call-banner.is-reply { background:#38bdf8; color:#082f49; border-color:#38bdf8; }
.stage-call-banner:is(.is-nope,.is-reply) small { color:inherit; border-left-color:color-mix(in srgb, currentColor 30%, transparent); }
.stage-call-banner:is(.is-nope,.is-reply) .call-drain { background:currentColor; opacity:.3; }
.stage-request-done.is-sending { color:#cbd5e1; font-weight:700; }
.stage-latency:empty { display:none; }

/* The instant link (3.5.0): a green badge beside "Connected", and a pill in the ⋯ menu. */
.stage-instant { display:inline-flex; align-items:center; gap:4px; margin-left:8px; padding:1px 9px; border-radius:999px;
  background:rgba(34,197,94,.18); border:1px solid rgba(34,197,94,.55); color:#4ade80; font-size:12px; font-weight:800; letter-spacing:.01em; white-space:nowrap; }
.stage-instant[hidden] { display:none; }
body.light .stage-instant { color:#15803d; background:rgba(34,197,94,.14); }
.stage-latency { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.stage-instant.is-menu { margin-left:0; padding:3px 11px; font-size:13px; }
.stage-latency-text { color:inherit; }

/* 3.5.4: band requests beside an open (or pinned) call pad, never under it; a count on Call. */
.live-view.has-callpad .stage-requests { right:calc(24px + min(460px, 100vw - 24px)); }
@media (max-width:768px), ((orientation:landscape) and (max-height:500px) and (pointer:coarse)) {
  /* No room beside it on a phone: the cards stay at the bottom, above the pad. */
  .live-view.has-callpad .stage-requests { right:12px; z-index:2007; }
}
.stage-call-count { display:inline-flex; align-items:center; justify-content:center; min-width:20px; height:20px; margin-left:6px; padding:0 6px; border-radius:999px; background:#ef4444; color:#fff; font-size:12px; font-weight:900; line-height:1; animation:stage-count-pop .3s ease-out; }
@keyframes stage-count-pop { from { transform:scale(.6); } to { transform:scale(1); } }

/* 3.5.6: asking for the lead, and the leader being asked. */
.stage-bar .stage-lead-btn { border-color:#a78bfa; color:#c4b5fd; font-weight:800; }
.stage-bar .stage-lead-btn.is-asked { border-style:dashed; opacity:.9; }
.stage-bar .stage-lead-btn[hidden], .stage-lead-ask[hidden] { display:none; }
body.light .stage-bar .stage-lead-btn { color:#6d28d9; }
.stage-lead-ask {
  position:fixed; left:50%; top:var(--mm-overlay-top, calc(80px + var(--mm-safe-top, 0px))); transform:translateX(-50%); z-index:2008;
  display:flex; flex-direction:column; gap:6px; width:min(420px, calc(100vw - 24px)); padding:14px 16px;
  border:2px solid #a78bfa; border-radius:16px; background:#1e1b4b; color:#ede9fe; box-shadow:0 18px 50px rgba(0,0,0,.6);
}
.stage-lead-ask strong { font-size:17px; }
.stage-lead-ask span { font-size:13px; color:#c4b5fd; }
.stage-lead-ask-actions { display:flex; gap:8px; margin-top:4px; }
.stage-lead-ask-actions button { flex:1; min-height:44px; border-radius:12px; border:1px solid rgba(255,255,255,.3); background:transparent; color:#fff; font:inherit; font-weight:850; font-size:15px; cursor:pointer; }
.stage-lead-ask-actions .stage-lead-yes { background:#a78bfa; border-color:#a78bfa; color:#1e1b4b; }

/* 3.9.0 — All stop: the MD's one red button, above the calls, never edited away. */
.stage-callpad .stage-callpad-allstop:empty { display:none; }
.stage-callpad .stage-callpad-allstop { margin:0 0 8px; }
.stage-callpad .stage-callpad-allstop .stage-allstop { width:100%; min-height:48px; border-color:#ef4444; background:#b91c1c; color:#fff; font-size:15px; font-weight:900; letter-spacing:.02em; }
.stage-callpad .stage-callpad-allstop .stage-allstop:hover { background:#dc2626; border-color:#fecaca; }
.stage-callpad.is-editing .stage-callpad-allstop { display:none; }
/* "More me": what, and which way. */
.stage-callpad .stage-callpad-grid.is-mix .stage-mix-way { grid-column:1 / -1; display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.stage-callpad .stage-mix-way button { min-height:44px; }
.stage-callpad .stage-mix-way button.is-on { border-color:#a78bfa; background:rgba(167,139,250,.28); }
.stage-callpad .stage-callpad-grid.is-mix .stage-mix-back { grid-column:1 / -1; min-height:40px; font-size:13px; opacity:.85; }
/* The next song was skipped or chosen by the MD or the Worship leader. */
.live-view.is-stage .stage-next.is-changed .stage-next-kicker { color:#fbbf24; }
/* Save for the team sits beside Save; the row wraps when it holds five. */
.stage-callpad .stage-preset-actions { flex-wrap:wrap; }
.stage-callpad .stage-preset-actions .stage-preset-team { border-color:#14b8a6; background:#14b8a6; color:#04201d; }
.stage-callpad .stage-preset-actions .stage-preset-team-reset { font-size:12px; opacity:.8; }

/* 3.9.0 B — the ready check on a member's pad, and the bar when the MD asks. */
.stage-callpad .stage-ready-row { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.stage-callpad .stage-ready-row .stage-ready-k { flex:1 1 100%; font-size:12px; font-weight:800; color:#cbd5e1; }
.stage-callpad .stage-ready-row button { flex:1 1 0; min-height:44px; }
.stage-ready-yes.is-on { border-color:#22c55e !important; background:rgba(34,197,94,.22) !important; }
.stage-ready-no.is-on { border-color:#ef4444 !important; background:rgba(239,68,68,.2) !important; }
.stage-callpad .stage-ready-issues { display:grid; grid-template-columns:repeat(2, 1fr); gap:6px; }
.stage-callpad .stage-ready-issues button { min-height:42px; font-size:13px; }
.stage-callpad .stage-ready-form { grid-column:1 / -1; display:flex; gap:6px; }
.stage-callpad .stage-ready-form input { flex:1; min-width:0; min-height:40px; padding:6px 10px; border:1px solid rgba(255,255,255,.3); border-radius:10px; background:#0b1220; color:#fff; font:inherit; }
.stage-callpad .stage-ready-back { grid-column:1 / -1; min-height:36px; font-size:12px; opacity:.85; }
.stage-ready-bar {
  position:fixed; left:50%; bottom:calc(16px + env(safe-area-inset-bottom)); transform:translateX(-50%); z-index:2007;
  display:flex; align-items:center; gap:8px; width:max-content; max-width:calc(100vw - 24px); padding:8px 10px 8px 14px;
  border:2px solid #22c55e; border-radius:16px; background:#0b1220; color:#fff; box-shadow:0 12px 32px rgba(0,0,0,.45);
}
.stage-ready-bar[hidden] { display:none; }
.stage-ready-bar .stage-ready-k { font-weight:850; }
.stage-ready-bar button { min-height:42px; padding:6px 12px; border:1px solid rgba(255,255,255,.3); border-radius:12px; background:rgba(255,255,255,.08); color:#fff; font:inherit; font-size:14px; font-weight:800; cursor:pointer; }
.stage-ready-bar .stage-ready-yes { border-color:#22c55e; background:#16a34a; }
.stage-ready-bar .stage-ready-close { width:42px; padding:0; }
@media (max-width:768px), ((orientation:landscape) and (max-height:500px) and (pointer:coarse)) {
  .stage-ready-bar { left:8px; right:8px; width:auto; transform:none; flex-wrap:wrap; }
  .stage-ready-bar .stage-ready-k { flex:1 1 100%; }
  .stage-ready-bar .stage-ready-yes, .stage-ready-bar .stage-ready-no { flex:1; }
}
/* Key change and the count-in, under the section calls. */
.stage-callpad .stage-callpad-keys:empty, .stage-callpad .stage-callpad-countin:empty { display:none; }
.stage-callpad .stage-callpad-keys, .stage-callpad .stage-callpad-countin { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:10px; }
.stage-callpad .stage-key-k { flex:1 1 100%; font-size:12px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; color:#cbd5e1; }
.stage-callpad .stage-callpad-keys button { min-height:36px; min-width:44px; padding:4px 8px; font-size:13px; }
.stage-callpad .stage-callpad-keys button.is-now { border-color:#22c55e; }
.stage-callpad .stage-callpad-countin select, .stage-callpad .stage-callpad-countin input { min-height:38px; padding:4px 8px; border:1px solid rgba(255,255,255,.3); border-radius:10px; background:#0b1220; color:#fff; font:inherit; }
.stage-callpad .stage-callpad-countin input { width:80px; }
.stage-callpad .stage-callpad-countin button { min-height:38px; padding:4px 12px; font-size:13px; }
.stage-callpad .stage-countin-go { border-color:#f59e0b; background:rgba(245,158,11,.2); }
.stage-callpad.is-editing .stage-callpad-keys, .stage-callpad.is-editing .stage-callpad-countin { display:none; }
.stage-callpad .stage-preset-countin { display:block; margin:12px 0 4px; font-size:12.5px; color:#cbd5e1; line-height:1.35; }
.stage-call-banner .stage-key-show { margin-left:10px; min-height:36px; padding:4px 12px; border:1px solid currentColor; border-radius:999px; background:transparent; color:inherit; font:inherit; font-size:14px; font-weight:850; cursor:pointer; }
/* The count itself: one big number, the first beat of each bar brighter. Over the chart, never
   blocking a tap (it is gone a moment later). */
.stage-countin {
  position:fixed; inset:0; z-index:2008; display:flex; align-items:center; justify-content:center; pointer-events:none;
  font-size:min(42vh, 60vw); font-weight:900; line-height:1; color:rgba(245,158,11,.92); text-shadow:0 0 40px rgba(0,0,0,.8);
  font-variant-numeric:tabular-nums;
}
.stage-countin[hidden] { display:none; }
.stage-countin.is-one { color:#fde68a; }
.stage-countin.is-waiting { font-size:min(10vh, 12vw); color:rgba(245,158,11,.75); }

/* ---- 4.0 phone review ---------------------------------------------------------------------- */
/* A call is never hidden by an open panel: Crew talk (11500) and the speaker panel (10070) sat
   on top of every banner, ✋ ALL STOP included. Banners let taps through except their buttons. */
.stage-call-banner { z-index:11600; }
.stage-call-banner .stage-key-show { pointer-events:auto; }
@media (max-width:768px), ((orientation:landscape) and (max-height:500px) and (pointer:coarse)) {
  /* The call pad is a sheet on a phone: from just under the top edge, never past the bottom, so
     the message box, Send, key change and ✎ Edit buttons can always be scrolled to. It used to
     start under the roadmap with a height that assumed it started at the top. */
  .stage-callpad, .live-view:not(.is-stage) .stage-callpad {
    top:calc(8px + env(safe-area-inset-top)); left:8px; right:8px; width:auto;
    max-height:calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overscroll-behavior:contain;
  }
  /* Band requests waiting: the tray keeps the bottom, the pad stops above it, ALL STOP stays clear. */
  .live-view.has-callpad:has(.stage-requests:not([hidden])) .stage-callpad {
    max-height:calc(60dvh - 72px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
  .live-view.has-callpad .stage-requests { max-height:calc(40dvh - 8px); }
  .stage-callpad .stage-callpad-help { display:none; }   /* keyboard keys: not on a phone */
  .stage-callpad .stage-callpad-close { width:40px; min-height:40px; }
  /* The ready check sits above the floating buttons, not on them, and gives way to the pad
     (which has the same Ready buttons). */
  .stage-ready-bar { bottom:calc(80px + env(safe-area-inset-bottom)); }
  .live-view.has-callpad ~ .stage-ready-bar, body:has(.live-view.has-callpad) .stage-ready-bar { display:none; }
  /* The ⋯ panel opens under the stage bar however many rows the bar wrapped to. */
  .live-view.is-stage .stage-panel { top:var(--mm-overlay-top, calc(56px + var(--mm-safe-top, 0px))); max-height:calc(100dvh - var(--mm-overlay-top, 56px) - 12px); overflow:auto; }
}
@media (orientation:landscape) and (max-height:500px) and (pointer:coarse) {
  /* On its side, one row: the label inline and short. */
  .stage-ready-bar { flex-wrap:nowrap; padding:4px 6px 4px 12px; bottom:calc(8px + env(safe-area-inset-bottom)); left:auto; right:88px; }
  .stage-ready-bar .stage-ready-k { flex:0 1 auto; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .stage-ready-bar button { min-height:38px; }
}

/* ---- 4.0 MD View's header on a phone ------------------------------------------------------- */
/* It took a third of an iPhone before the chart began: ☰ alone on a row, the title, then two
   rows of buttons, the arrangement and connection, and a "You are leading" box. Now: ☰, title and
   key on one row; every button in one row under it that scrolls sideways, with ⋯ always at its
   right end; the arrangement and a healthy connection in ⋯ (a dropped one still shows); the
   leader line one short line, and none at all when the bar already says "You're directing". */
.stage-panel-status { display:none; }
@media (max-width:768px), ((orientation:landscape) and (max-height:500px) and (pointer:coarse)) {
  .live-view.is-stage .stage-top { padding-top:calc(2px + var(--mm-safe-top, 0px)); }
  .live-view.is-stage .stage-head { flex:1 1 100%; min-height:44px; }
  .live-view.is-stage .stage-head .stage-title { flex:1 1 auto; min-width:0; }
  .live-view.is-stage .stage-bar {
    flex:1 1 100%; margin-left:0; flex-wrap:nowrap; justify-content:flex-start; gap:6px; min-height:46px; padding:1px 0 3px;
    overflow-x:auto; overflow-y:hidden; overscroll-behavior-x:contain; scrollbar-width:none;
    scroll-padding-inline-end:52px;   /* a focused button is scrolled clear of the held ⋯ */
  }
  .live-view.is-stage .stage-bar::-webkit-scrollbar { display:none; }
  .live-view.is-stage .stage-bar > * { flex:0 0 auto; }
  .live-view.is-stage .stage-head button, .live-view.is-stage .stage-bar button { min-height:40px; min-width:40px; }
  /* What a thumb wants first; then the rest in their usual order; ✕ last but one (it is in ⋯ too)
     and ⋯ last, held at the right end so it is never scrolled away. */
  .live-view.is-stage .stage-bar .stage-lead-btn, .live-view.is-stage .stage-bar .stage-call-btn,
  .live-view.is-stage .stage-bar .stage-crew-btn, .live-view.is-stage .stage-bar .stage-onscreen { order:-1; }
  .live-view.is-stage .stage-bar .stage-exit { order:1; width:40px; padding:0; }
  .live-view.is-stage .stage-bar .stage-more {
    order:2; position:sticky; right:0; z-index:1; width:40px; padding:0; margin-left:auto;
    background:var(--stage-bg); box-shadow:0 0 0 6px var(--stage-bg), -18px 0 12px -4px var(--stage-bg);
  }
  /* The status line: only when there is something to act on (a dropped connection, a note). */
  .live-view.is-stage .stage-context { padding:0 0 3px; }
  .live-view.is-stage .stage-context .stage-arrangement, .live-view.is-stage .stage-context .stage-instant,
  .live-view.is-stage .stage-context .stage-connection.is-ok { display:none; }
  .live-view.is-stage .stage-context:not(:has(.stage-instrument-note:not([hidden]))):not(:has(.stage-connection:not(.is-ok))) { display:none; }
  .live-view.is-stage .stage-cue { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin:0 0 4px; padding:3px 10px; font-size:12.5px; }
  .live-view.is-stage .stage-panel .stage-panel-status { display:block; margin:0; font-weight:700; color:#e2e8f0; }
}
/* On its side: what is playing and the buttons share one row, the roadmap the next. */
@media ((orientation:landscape) and (max-height:500px) and (pointer:coarse)) {
  .live-view.is-stage .stage-head { flex:1 1 30%; }
  .live-view.is-stage .stage-bar { flex:0 1 auto; max-width:calc(70% - 10px); }
}

/* 4.0: the member's Call MD pill while a request waits for its answer, and when none came. */
.floating-call-md-shortcut span:last-child { min-width:0; max-width:min(52vw, 260px); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.floating-call-md-shortcut.is-waiting { background:#4c1d95; border-color:#a78bfa; }
.floating-call-md-shortcut.is-waiting span:first-child { animation:stage-wait-pulse 1.6s ease-in-out infinite; }
.floating-call-md-shortcut.is-unanswered { background:#475569; border-color:#94a3b8; }
@keyframes stage-wait-pulse { 50% { opacity:.45; } }
@media (prefers-reduced-motion:reduce) { .floating-call-md-shortcut.is-waiting span:first-child { animation:none; } }
