/**
 * The control band — one control vocabulary for every surface that
 * plays a chart (2026-09-17): the Backing Track Builder, the practice
 * modal's Backing mode, and next the song/tune pages.
 *
 * `.pg-band` is the two-row band itself (transport + tempo on the first
 * row, the option buttons on the second). The controls are the
 * `.pg-band-*` classes; popovers (`.pg-band-pop`) are position:fixed and
 * live OUTSIDE the band, so they carry the tokens too; a surface that
 * uses the controls outside a band (the builder's title bar) puts
 * `.pg-band-host` on its root.
 *
 * Sizing is by the width the band actually has (container query).
 */

.pg-band, .pg-band-pop, .pg-band-host {
  --pgb-ink: #1f2937; --pgb-ink-2: #374151; --pgb-muted: #6b7280; --pgb-faint: #9aa1ab;
  --pgb-line: #e5e7eb; --pgb-line-2: #eef0f2; --pgb-soft: #f6f7f8; --pgb-bg: #fbfcfd;
  --pgb-green: #53a96b; --pgb-green-d: #2c6b40; --pgb-green-soft: #ecf6ef; --pgb-green-line: #b3d4bd;
  --pgb-blue: #1e4f75; --pgb-blue-soft: #eef4f9; --pgb-blue-line: #dbe7f2;
  --pgb-red: #b03434;
  color: var(--pgb-ink);
  font-family: var(--pg-font-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-size: 15px;
  line-height: 1.35;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}
.pg-band *, .pg-band *::before, .pg-band *::after,
.pg-band-pop *, .pg-band-pop *::before, .pg-band-pop *::after { box-sizing: border-box; }
.pg-band [hidden], .pg-band-pop [hidden],
.pg-band-paywall[hidden], .pg-band-countin[hidden], .pg-band-status[hidden], .pg-band-pop[hidden] { display: none !important; }
.pg-band svg, .pg-band-pop svg { display: block; flex: none; }
.pg-band :where(button, input, select), .pg-band-pop :where(button, input, select) {
  font: inherit; color: inherit; letter-spacing: normal; text-transform: none;
  margin: 0; box-shadow: none;
}
.pg-band :where(button), .pg-band-pop :where(button) { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pg-band button:disabled, .pg-band-pop button:disabled { cursor: default; opacity: .4; }
.pg-band :focus-visible, .pg-band-pop :focus-visible { outline: 2px solid rgba(30, 79, 117, .45); outline-offset: 2px; }
.pg-band-pop kbd {
  display: inline-block; min-width: 18px; padding: 0 5px; border: 1px solid var(--pgb-line);
  border-bottom-width: 2px; border-radius: 5px; background: #fff;
  font: 600 11px/16px inherit; font-family: inherit; color: var(--pgb-muted); text-align: center;
}
.pg-band-sp { flex: 1 1 auto; }

/* ── The band ─────────────────────────────────────────────────────── */
.pg-band {
  container-type: inline-size;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  padding: 12px 18px;
  background: var(--pgb-bg);
}
.pg-band__transport { display: flex; align-items: center; gap: 4px; }
.pg-band__transport .pg-band-icon { color: var(--pgb-ink-2); }
.pg-band__transport .pg-band-toggle { margin-left: 6px; }
.pg-band__opts { display: flex; align-items: center; gap: 6px; flex: 1 1 100%; }

/* ── Controls ─────────────────────────────────────────────────────── */
.pg-band-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px;
  border: 1px solid var(--pgb-line); border-radius: 9px; background: #fff;
  font-size: 13.5px; font-weight: 600; color: var(--pgb-ink-2); white-space: nowrap;
  transition: border-color .12s, background .12s;
}
.pg-band-btn svg { width: 16px; height: 16px; color: var(--pgb-muted); }
.pg-band-btn:hover:not(:disabled) { border-color: #cdd4da; background: #fcfcfd; }
.pg-band-btn.is-open { border-color: #cdd4da; background: var(--pgb-soft); }
.pg-band-btn.is-on { background: var(--pgb-green-soft); border-color: var(--pgb-green-line); color: var(--pgb-green-d); }
.pg-band-btn.is-on svg { color: var(--pgb-green-d); }
/* An active button stays green under the pointer (the plain hover rule
   outranked .is-on and blanked it — you couldn't see a click turn it off). */
.pg-band-btn.is-on:hover:not(:disabled),
.pg-band-toggle.is-on:hover { background: #dcefe2; border-color: var(--pgb-green-line); }
.pg-band-btn.is-danger svg { color: var(--pgb-red); }
.pg-band-icon {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid transparent; border-radius: 9px; background: transparent;
  color: var(--pgb-muted);
}
.pg-band-icon svg { width: 18px; height: 18px; }
.pg-band-icon:hover:not(:disabled) { background: var(--pgb-soft); color: var(--pgb-ink-2); }
.pg-band-icon.is-open { background: var(--pgb-soft); }
.pg-band-icon.has-dot { position: relative; }
.pg-band-icon.has-dot::after { content: ''; position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--pgb-blue); box-shadow: 0 0 0 2px #fff; }
.pg-band-step {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; padding: 0;
  border: 1px solid var(--pgb-line); border-radius: 7px; background: #fff;
  font-size: 15px; font-weight: 600; line-height: 1; color: var(--pgb-muted);
}
.pg-band-step:hover:not(:disabled) { border-color: #cdd4da; color: var(--pgb-ink); }
.pg-band-stepper { display: inline-flex; align-items: center; gap: 6px; }
.pg-band-stepper b { min-width: 20px; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; }
.pg-band-lbl { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pgb-faint); }
.pg-band-toggle {
  height: 30px; padding: 0 10px;
  border: 1px solid var(--pgb-line); border-radius: 9px; background: #fff;   /* the option buttons' shape, not a pill */
  font-size: 13px; font-weight: 600; color: var(--pgb-ink-2); white-space: nowrap;
}
.pg-band-toggle:hover { border-color: #cdd4da; }
/* Count in: the same button as Speed up / Drop out (it is a .pg-band-btn), height of the transport icons. */
.pg-band-btn.pg-band-toggle { height: 30px; padding: 0 10px; font-size: 13px; }
/* In the options row it is one of them: same height and type. */
.pg-band__opts .pg-band-btn.pg-band-toggle { height: 34px; padding: 0 12px; font-size: 13.5px; margin-left: 0; }
.pg-band--inline .pg-band__opts .pg-band-btn.pg-band-toggle { height: 30px; padding: 0 8px; font-size: 13px; }
.pg-band-toggle.is-on { background: var(--pgb-green-soft); border-color: var(--pgb-green-line); color: var(--pgb-green-d); }

/* Play */
.pg-band-play {
  position: relative; display: grid; place-items: center;
  width: 52px; height: 52px; margin-right: 4px; padding: 0;
  border: 0; border-radius: 50%;
  background: var(--pgb-green); color: #fff;
  box-shadow: 0 2px 6px rgba(83, 169, 107, .35);
  transition: background .12s, transform .08s;
}
.pg-band-play:hover { background: #4a9c60; }
.pg-band-play:active { transform: scale(.96); }
.pg-band-play__i { grid-area: 1 / 1; display: grid; place-items: center; }
.pg-band-play__i svg { width: 24px; height: 24px; }
.pg-band-play__i.is-play svg { margin-left: 0; }   /* the path already sits 2px right of centre (optical) */
.pg-band-play__i.is-pause { display: none; }
.pg-band-play.is-playing .pg-band-play__i.is-play { display: none; }
.pg-band-play.is-playing .pg-band-play__i.is-pause { display: grid; }
.pg-band-play:disabled { opacity: 1; }
.pg-band-play.is-loading::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid rgba(83, 169, 107, .25); border-top-color: var(--pgb-green);
  animation: pg-band-spin .9s linear infinite;
}
@keyframes pg-band-spin { to { transform: rotate(360deg); } }

/* Range: a thin track with a green fill up to the thumb (--fill set by JS). */
.pg-band-range {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: 22px; margin: 0; padding: 0;
  border: 0; background: transparent; cursor: pointer;
  --fill: 50%;
}
.pg-band-range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(to right, var(--pgb-green) 0 var(--fill), var(--pgb-line-2) var(--fill) 100%);
}
.pg-band-range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--pgb-line-2); }
.pg-band-range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--pgb-green); }
.pg-band-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; margin-top: -6px; border-radius: 50%;
  background: #fff; border: 2px solid var(--pgb-green); box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}
.pg-band-range::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2px solid var(--pgb-green); box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}
.pg-band-range:focus, .pg-band-range:focus-visible { outline: none; border: 0; box-shadow: none; }
.pg-band-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(83, 169, 107, .25); }

/* Tempo: label · slider · "100 BPM" */
.pg-band-tempo { display: flex; align-items: center; gap: 10px; flex: 1 1 260px; min-width: 220px; max-width: 420px; }
.pg-band-tempo .pg-band-range { flex: 1 1 auto; min-width: 120px; }
.pg-band-tempo__read { display: inline-flex; align-items: baseline; gap: 4px; flex: none; position: relative; }
/* Speed up's bump, on the number: "+10" in green over it, then the new
   value flashes green as it settles. */
.pg-band-tempo__bump {
  position: absolute; left: 0; top: 50%; width: 46px; transform: translateY(-50%) scale(.9);
  text-align: right; padding-right: 5px; box-sizing: border-box;
  font-size: 16px; font-weight: 800; color: var(--pgb-green-d); font-variant-numeric: tabular-nums;
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s;
}
.pg-band-tempo__read.is-bumping .pg-band-tempo__bump { opacity: 1; transform: translateY(-50%) scale(1); }
.pg-band-tempo__read.is-bumping .pg-band-tempo__val { color: transparent !important; }
.pg-band-tempo__read.is-bumped .pg-band-tempo__val { color: var(--pgb-green-d) !important; background: var(--pgb-green-soft); transition: color .6s, background .6s; }
.pg-band--inline .pg-band-tempo__bump { width: 40px; font-size: 15px; }
.pg-band-tempo__val {
  width: 46px; height: 30px; padding: 0 4px;
  border: 1px solid transparent; border-radius: 7px; background: transparent;
  text-align: right; font-size: 16px !important; font-weight: 700; font-variant-numeric: tabular-nums;
}
.pg-band-tempo__val:hover { background: #fff; border-color: var(--pgb-line); }
.pg-band-tempo__val:focus { outline: none; background: #fff; border-color: var(--pgb-blue-line); }
.pg-band-tempo__unit { font-size: 12px; font-weight: 600; color: var(--pgb-muted); }
.pg-band-bump {
  font-size: 11.5px; font-weight: 700; color: var(--pgb-green-d);
  background: var(--pgb-green-soft); border-radius: 999px; padding: 1px 7px;
  opacity: 0; transform: translateY(3px); transition: opacity .2s, transform .2s;
}
.pg-band-bump.is-show { opacity: 1; transform: none; }

/* Trainers: the Speed-up ring fills as passes go by; the bump flashes green. */
.pg-band-trainer { position: relative; }
.pg-band-trainer svg.pg-band-trainer__ring { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; pointer-events: none; overflow: visible; color: inherit; }
.pg-band .pg-band-trainer svg.pg-band-trainer__ring { width: 100%; height: 100%; }   /* beats the icon-size rules (.pg-band--inline .pg-band-btn svg drew it as a 15px circle) */
.pg-band-trainer__ring rect { fill: none; stroke: var(--pgb-green); stroke-width: 0; width: calc(100% - 3px); height: calc(100% - 3px); }
.pg-band-trainer.is-bump { background: var(--pgb-green); border-color: var(--pgb-green); color: #fff; transition: background .15s; }
.pg-band-trainer.is-bump svg { color: #fff; }

/* Chip: a labelled value with a hidden <select> over it. */
.pg-band-chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 10px 0 11px;
  border: 1px solid var(--pgb-line); border-radius: 999px; background: #fff;
  font-size: 14px; font-weight: 700; color: var(--pgb-ink-2); white-space: nowrap;
  cursor: pointer; margin: 0;
}
.pg-band-chip:hover { border-color: #cdd4da; }
.pg-band-chip:has(select:focus-visible) { box-shadow: 0 0 0 3px rgba(30, 79, 117, .12); }
.pg-band-chip__k { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--pgb-faint); }
.pg-band-chip__caret svg { width: 12px; height: 12px; color: var(--pgb-faint); }
.pg-band-chip select {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; border: 0; -webkit-appearance: none; appearance: none;
  font-size: 16px;   /* no iOS zoom */
}
.pg-band-chip.is-key .pg-band-chip__v { color: var(--pgb-blue); }
.pg-band-chip.is-static { cursor: default; }
.pg-band-chip.is-static:hover { border-color: var(--pgb-line); }
.pg-band__meta { display: inline-flex; gap: 6px; }
.pg-band__meta:empty { display: none; }

/* Inline (song page): one fixed shape at every width —
     row 1  play · restart · stop · Count in  |  tempo · BPM  |  beat dots
     row 2  Speed up · Drop out · Band
   A phone can't hold row 1, so there the tempo takes its own line. */
.pg-band--inline { gap: 8px 10px; padding: 8px 10px; }
.pg-band--inline .pg-band-tempo .pg-band-lbl { display: none; }   /* the slider + BPM say it */
.pg-band--inline .pg-band__transport { gap: 2px; flex: 0 1 auto; }
.pg-band--inline .pg-band-tempo { flex: 1 1 140px; min-width: 140px; max-width: 220px; gap: 6px; }
.pg-band--inline .pg-band-tempo .pg-band-range { min-width: 60px; }
.pg-band--inline .pg-band-tempo__read { flex: none; white-space: nowrap; }
.pg-band--inline .pg-band__opts { display: flex; flex: 1 1 100%; margin-left: 0; gap: 4px; }
.pg-band--inline .pg-band__opts .pg-band-sp { display: none; }
.pg-band--inline .pg-band__opts .pg-band-btn { flex-direction: row; height: 30px; padding: 0 8px; font-size: 13px; }
.pg-band--inline .pg-band__transport .pg-band-toggle { margin-left: 2px; }
.pg-band--inline .pg-band-play { width: 36px; height: 36px; margin-right: 2px; }
.pg-band--inline .pg-band-play__i svg { width: 18px; height: 18px; }
.pg-band--inline .pg-band-icon { width: 30px; height: 30px; }
.pg-band--inline .pg-band-icon svg { width: 16px; height: 16px; }
.pg-band--inline .pg-band-toggle { height: 28px; padding: 0 8px; margin-left: 2px; }
.pg-band--inline .pg-band-btn { height: 30px; padding: 0 8px; font-size: 13px; gap: 5px; }
.pg-band--inline .pg-band-btn svg { width: 15px; height: 15px; }
.pg-band--inline .pg-band-metro { margin-left: 6px; gap: 6px; flex: none; }   /* beside the tempo, not at the far edge */
.pg-band--inline .pg-band-metro__dot { width: 15px; height: 15px; }
.pg-band--inline .pg-band-tempo__val { height: 26px; font-size: 15px !important; width: 40px; }
@container (max-width: 340px) {   /* phones: row 1 (play · restart · stop · Count in + a 140px tempo) needs ~330px */
  .pg-band--inline .pg-band__transport { order: 1; }
  .pg-band--inline .pg-band-metro { order: 2; }
  .pg-band--inline .pg-band-tempo { order: 3; flex-basis: 100%; max-width: none; }
  .pg-band--inline .pg-band__opts { order: 4; }
}

/* Visual metronome: one dot per beat; armed dots flash on their beat. */
.pg-band-metro { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
.pg-band-metro:empty { display: none; }
.pg-band-metro__dot {
  width: 20px; height: 20px; padding: 0; border-radius: 50%;
  border: 2px solid var(--pgb-line); background: transparent;
  transition: background .05s linear, border-color .12s, transform .06s;
}
.pg-band-metro__dot.is-armed { background: var(--pgb-green-soft); border-color: var(--pgb-green); }
.pg-band-metro__dot:hover { border-color: var(--pgb-blue); }
.pg-band-metro__dot:active { transform: scale(.92); }
.pg-band-metro__dot.is-active { background: var(--pgb-green); border-color: var(--pgb-green); transform: scale(1.12); }

/* Switch */
.pg-band-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--pgb-ink-2); }
.pg-band-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pg-band-switch__ui { position: relative; flex: none; width: 34px; height: 20px; border-radius: 999px; background: #d7dce1; transition: background .15s; }
.pg-band-switch__ui::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s; }
.pg-band-switch input:checked + .pg-band-switch__ui { background: var(--pgb-green); }
.pg-band-switch input:checked + .pg-band-switch__ui::after { transform: translateX(14px); }
.pg-band-switch input:focus-visible + .pg-band-switch__ui { box-shadow: 0 0 0 3px rgba(83, 169, 107, .3); }
.pg-band-switch small { display: block; font-size: 11.5px; font-weight: 500; color: var(--pgb-faint); }
.pg-band-switch.is-head { justify-content: space-between; }

/* Segmented */
.pg-band-seg { display: inline-flex; border: 1px solid var(--pgb-line); border-radius: 9px; overflow: hidden; background: #fff; }
.pg-band-seg button { height: 32px; padding: 0 11px; border: 0; border-radius: 0; background: none; font-size: 13px; font-weight: 600; color: var(--pgb-muted); white-space: nowrap; }
.pg-band-seg button + button { border-left: 1px solid var(--pgb-line); }
.pg-band-seg button.is-on { background: var(--pgb-blue-soft); color: var(--pgb-blue); }

/* ── Popovers (position:fixed, outside the band) ──────────────────── */
.pg-band-pop {
  position: fixed; z-index: 100050; left: 0; top: 0;
  min-width: 220px; max-width: min(340px, calc(100vw - 16px));
  padding: 12px 14px;
  background: #fff; border: 1px solid var(--pgb-line); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .14), 0 2px 6px rgba(15, 23, 42, .06);
}
.pg-band-pop__title { font-size: 14px; font-weight: 700; color: var(--pgb-ink); margin-bottom: 8px; }
.pg-band-switch.is-head .pg-band-pop__title { margin: 0; }
.pg-band-pop__desc { margin: 6px 0 10px; font-size: 12.5px; line-height: 1.45; color: var(--pgb-muted); }
.pg-band-pop__line { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13.5px; color: var(--pgb-ink-2); }
.pg-band-pop__rule { height: 1px; margin: 10px -14px; background: var(--pgb-line-2); }
.pg-band-pop__field { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.pg-band-pop__field:first-of-type { margin-top: 2px; }
.pg-band-pop__field .pg-band-seg { display: grid; grid-template-columns: 1fr 1fr; }
.pg-band-pop__field .pg-band-seg button { height: 30px; padding: 0 10px; }
.pg-band-pop.is-narrow { width: 220px; min-width: 0; }

.pg-band-mix { width: 300px; }
/* Knobs (the practice modal's mixer): drag round to set, click to mute. */
/* Band | Metronome, Click | Drum — the site's segmented pill. */
.pg-band-seg { display: flex; border: 1px solid var(--pgb-line, #e5e7eb); border-radius: 9px; overflow: hidden; background: #fff; margin: 0 0 10px; }
.pg-band-seg button { flex: 1 1 0; height: 32px; padding: 0 10px; margin: 0; border: 0; border-radius: 0; background: none; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--pgb-muted, #6b7280); cursor: pointer; }
.pg-band-seg button + button { border-left: 1px solid var(--pgb-line, #e5e7eb); }
.pg-band-seg button[aria-pressed="true"] { background: var(--pgb-blue-soft, #eef4f9); color: var(--pgb-blue, #1e4f75); }
.pg-band-metrokind[hidden], .pg-band-mixwrap[hidden] { display: none; }
.pg-band-knobs { display: flex; justify-content: space-around; gap: 8px; padding: 6px 0 10px; }
.pg-band-knob { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pg-band-knob[hidden] { display: none; }
.pg-band-knob__body {
  position: relative; width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; cursor: grab; touch-action: none; outline: none;
}
.pg-band-knob__body:active { cursor: grabbing; }
.pg-band-knob__body:focus-visible { box-shadow: 0 0 0 3px rgba(30, 79, 117, .25); }
.pg-band-knob__arc { position: absolute; inset: 0; width: 100%; height: 100%; }
.pg-band-knob__track { stroke: var(--pgb-line, #e5e7eb); }
.pg-band-knob__fill { stroke: var(--pgb-green, #53a96b); transition: stroke .15s; }
.pg-band-knob__cap {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; border: 1px solid var(--pgb-line, #e5e7eb);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
  color: var(--pgb-ink-2, #374151);
}
.pg-band-knob__icon { width: 24px; height: 24px; display: block; }
.pg-band-knob__slash {
  position: absolute; left: 50%; top: 50%; width: 30px; height: 2px; margin: -1px 0 0 -15px;
  background: currentColor; border-radius: 1px; transform: rotate(45deg); opacity: 0;
}
.pg-band-knob__name { font-size: 12px; font-weight: 600; color: var(--pgb-ink-2, #374151); }
.pg-band-knob.is-muted .pg-band-knob__fill { stroke: var(--pgb-faint, #9aa1ab); }
.pg-band-knob.is-muted .pg-band-knob__cap { color: var(--pgb-faint, #9aa1ab); background: #f7f8fa; }
.pg-band-knob.is-muted .pg-band-knob__slash { opacity: 1; }
.pg-band-knob.is-muted .pg-band-knob__name { color: var(--pgb-faint, #9aa1ab); text-decoration: line-through; }
.pg-band-knob__hid { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden; clip: rect(0 0 0 0); border: 0 !important; opacity: 0; pointer-events: none; }
.pg-band-mix__row { display: grid; grid-template-columns: 30px 72px 1fr; align-items: center; gap: 6px; height: 38px; }
.pg-band-mix__name { font-size: 13.5px; font-weight: 600; color: var(--pgb-ink-2); }
.pg-band-mix__mute { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--pgb-muted); }
.pg-band-mix__mute:hover { background: var(--pgb-soft); }
.pg-band-mix__mute svg { width: 18px; height: 18px; }
.pg-band-mix__mute .pg-band-x { display: none; }
.pg-band-mix__mute.is-muted { color: var(--pgb-red); }
.pg-band-mix__mute.is-muted .pg-band-wave { display: none; }
.pg-band-mix__mute.is-muted .pg-band-x { display: inline; }
.pg-band-mix__row.is-muted .pg-band-mix__name { color: var(--pgb-faint); text-decoration: line-through; }
.pg-band-mix__row.is-muted .pg-band-range { opacity: .45; }
.pg-band-mix .pg-band-switch { margin: 8px 0 2px 6px; }

.pg-band-menu { padding: 6px; min-width: 210px; }
.pg-band-menu .pg-band-pop__title { padding: 6px 8px 2px; margin-bottom: 4px; font-size: 12.5px; color: var(--pgb-muted); font-weight: 600; }
.pg-band-menu__item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 36px; padding: 6px 10px;
  border: 0; border-radius: 8px; background: none;
  font-size: 14px; font-weight: 500; color: var(--pgb-ink); text-align: left;
}
.pg-band-menu__item svg { width: 17px; height: 17px; color: var(--pgb-muted); }
.pg-band-menu__item span { flex: 1; }
.pg-band-menu__item small { display: inline; margin-left: 4px; font-size: 12px; color: var(--pgb-faint); }
.pg-band-menu__item:hover:not(:disabled) { background: var(--pgb-soft); }
.pg-band-menu__item.is-danger, .pg-band-menu__item.is-danger svg { color: var(--pgb-red); }
.pg-band-menu__item.is-saved, .pg-band-menu__item.is-saved svg { color: var(--pgb-green-d); }
.pg-band-menu__item.is-dirty, .pg-band-menu__item.is-dirty svg { color: var(--pgb-blue); font-weight: 700; }
.pg-band-menu__rule { height: 1px; margin: 4px 2px; background: var(--pgb-line-2); }
.pg-band-menu__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 10px; font-size: 14px; }
.pg-band-menu__lbl { color: var(--pgb-ink); }

/* ── Narrower bands (home Tools card, the modal on a phone) ───────── */
@container (max-width: 820px) {
  .pg-band__transport { gap: 4px; }
  .pg-band-tempo { max-width: none; }
}
@container (max-width: 560px) {
  .pg-band__transport { flex: 1 1 100%; }
  .pg-band__transport .pg-band-toggle { margin-left: auto; }
  .pg-band-tempo { flex-basis: 100%; }
  .pg-band__opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .pg-band__opts:has(.pg-band-sp) { grid-template-columns: repeat(4, minmax(0, 1fr)); }   /* a host option (the Builder's Display) makes four */
  /* The Band icon ends the play row instead of wrapping onto its own. */
  .pg-band:not(.pg-band--inline) .pg-band__transport { flex: 1 1 auto; order: 1; }
  .pg-band:not(.pg-band--inline) .pg-band-bandbtn { order: 2; margin-left: auto; }
  .pg-band:not(.pg-band--inline) .pg-band-metro { order: 2; }
  .pg-band:not(.pg-band--inline) .pg-band-tempo { order: 3; }
  .pg-band:not(.pg-band--inline) .pg-band__opts { order: 4; }
  .pg-band__opts .pg-band-sp { display: none; }
  .pg-band__opts .pg-band-btn { justify-content: center; height: 32px; padding: 0 4px; font-size: 12.5px; }
}

/* ── In-card extras the band owns: status, count-in, preview gate ─── */
.pg-band-status { padding: 7px 18px; border-bottom: 1px solid var(--pgb-line-2); font-size: 13px; color: var(--pgb-muted); background: #fff; }
/* Inline (song page): the loading line is a ROW, so un-hiding it on the
   first play grew the panel by its height and it snapped back when the
   banks finished — the panel visibly flashed taller as the audio loaded
   (Phil, 2026-09-20). Hang it under the panel instead: same look, but
   out of flow, so nothing reflows and the chart below never moves.
   NOTE the status is a child of .pg-cm-band on the song page, a SIBLING
   of the .pg-band--inline panel — not inside it. Matching only the
   panel missed it entirely (computed position stayed static). */
.pg-band--inline, .pg-cm-band { position: relative; }
.pg-cm-band > .pg-band-status, .pg-band--inline > .pg-band-status {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 4;
  border-bottom: 0; border-radius: 0 0 10px 10px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .10);
}
.pg-band-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pg-band-countin {
  position: absolute; left: 50%; top: 55%; z-index: 20;
  transform: translate(-50%, -50%);
  display: grid; place-items: center;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(31, 41, 55, .82); color: #fff;
  font-size: 60px; font-weight: 800; font-variant-numeric: tabular-nums;
  pointer-events: none;
}
/* The count beats the lead's pickup falls on: "4 ♪", on green. */
.pg-band-countin.is-pickup { background: rgba(44, 107, 64, .9); font-size: 48px; width: 136px; }
.pg-band-paywall {
  position: absolute; inset: 0; z-index: 30;
  display: grid; place-items: center; padding: 20px;
  border-radius: inherit;
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(3px);
}
.pg-band-paywall__card {
  max-width: 420px; padding: 24px 26px; text-align: center;
  background: #fff; border: 1px solid var(--pgb-line, #e5e7eb); border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .15);
  color: var(--pgb-ink, #1f2937);
  font-family: var(--pg-font-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}
.pg-band-paywall__card h3 { margin: 0 0 8px; font-size: 20px; color: var(--pgb-blue, #1e4f75); }
.pg-band-paywall__card p { margin: 0 0 16px; font-size: 14.5px; line-height: 1.5; color: var(--pgb-ink-2, #374151); }
.pg-band-paywall__cta {
  display: inline-flex; align-items: center; height: 42px; padding: 0 20px;
  border: 0; border-radius: 10px; background: var(--pgb-green, #53a96b); color: #fff !important;
  font-size: 15px; font-weight: 700; text-decoration: none !important; cursor: pointer;
}
.pg-band-paywall__card .pg-toolhelp-chip { display: block; margin: 12px auto 0; }
.pg-band-paywall__dismiss { display: block; margin: 14px auto 0; border: 0; background: none; font-size: 13px; color: var(--pgb-muted, #6b7280); text-decoration: underline; cursor: pointer; }

@media print {
  .pg-band, .pg-band-pop, .pg-band-status, .pg-band-countin, .pg-band-paywall { display: none !important; }
}

/* Band: settings, not a practice option — a small icon at the end of the
   top row (after the beat dots). A dot marks it off its defaults (metronome
   instead of the band, a voice muted or turned down). */
.pg-band-bandbtn { position: relative; flex: none; margin-left: 4px; color: var(--pgb-ink-2); }
.pg-band-bandbtn:hover { border-color: var(--pgb-line); background: #fff; }
.pg-band-bandbtn.is-open { border-color: var(--pgb-line); background: #fff; color: var(--pgb-blue, #1e4f75); }
.pg-band-bandbtn.is-on::after {
  content: ""; position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--pgb-green); box-shadow: 0 0 0 2px #f5f7f9;
}
.pg-band-metro:empty + .pg-band-bandbtn { margin-left: auto; }
@container (max-width: 340px) { .pg-band--inline .pg-band-bandbtn { order: 2; } }

/* Drop out, like the beat dots: it flashes on each beat of the last bar
   before a drop, and while the band is out it turns white. */
@keyframes pg-band-beat { from { background: var(--pgb-green); border-color: var(--pgb-green); color: #fff; } }
.pg-band-dropbtn.is-beat { animation: pg-band-beat .28s ease-out; }
.pg-band-dropbtn.is-dropping { background: #fff !important; border-color: var(--pgb-green) !important; color: var(--pgb-green-d) !important; }
/* Count in fills as it counts. */
.pg-band-btn[data-qb="countin"].is-counting {
  background-image: linear-gradient(90deg, #c9e6d2 0 calc(var(--pgb-ci-p, 0) * 100%), transparent 0);
  background-color: var(--pgb-green-soft); color: var(--pgb-green-d);
}
@media (prefers-reduced-motion: reduce) { .pg-band-dropbtn.is-beat { animation: none; } }

/* The Band icon reads as a button: a bordered square like the others. */
.pg-band-bandbtn { border-color: var(--pgb-line); background: #fff; }
.pg-band-bandbtn:hover { border-color: #cdd4da; background: #fcfcfd; }

/* The metronome's four voices + the drum groove / tonal voicing choice. */
.pg-band-seg--4 { display: grid; grid-template-columns: repeat(4, 1fr); }
.pg-band-metrokind .pg-band-pop__field { flex-direction: row; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--pgb-ink-2); }
.pg-band-metrokind .pg-band-pop__field[hidden] { display: none; }
/* Metronome popover polish: the voices sit flush, the ring only for keys. */
.pg-band-metrokind .pg-band-seg { margin: 0; }
.pg-band-metrokind .pg-band-pop__field { margin-top: 12px; }
.pg-band-metrokind .pg-band-pop__field > span { color: var(--pgb-muted); font-weight: 600; }
.pg-band-metrokind + .pg-band-mixwrap[hidden] + .pg-band-pop__rule { margin-top: 12px; }
.pg-band-seg button:focus { outline: none; }
.pg-band-seg button:focus-visible { outline: 2px solid var(--pgb-blue, #1e4f75); outline-offset: -2px; }
.pg-band-seg button:not([aria-pressed="true"]):hover { color: var(--pgb-ink-2, #374151); background: #fafbfc; }
.pg-band-pop__sel {
  height: 30px; min-width: 150px; padding: 0 26px 0 10px; margin: 0;
  border: 1px solid var(--pgb-line); border-radius: 8px; background-color: #fff;
  font: inherit; font-weight: 600; color: var(--pgb-ink); cursor: pointer;
}

/* Rhythm pattern — staff test (pg-band.php, voice-engine.js setPattern). */
.pg-band-pattern { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 13.5px; font-weight: 600; color: var(--pgb-ink-2); }
.pg-band-pattern small { display: block; font-weight: 500; color: var(--pgb-muted); font-size: 11.5px; }
.pg-band-pattern select { height: 30px; max-width: 58%; border: 1px solid var(--pgb-line); border-radius: 8px; background: #fff; font: 600 12.5px/1 system-ui, sans-serif; color: var(--pgb-ink-2); padding: 0 6px; }
