/* The Drawer. back-room.css
 * The Back Room shell: nav, the 236px sticky module rail, the stage
 * (stat tiles, tables, module-owned content), and the editor panel that
 * slides from the right. Every declaration reads
 * tokens.css and bench.css primitives (buttons, inputs, textareas);
 * only the br- structural classes live here. One breakpoint, 900px.
 */

html[data-skin] body.br {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--t-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.br a { color: var(--accent); text-decoration: none; }
body.br :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* The Back Room's own Bell band. Reserves the bar's real rendered height
   so it never sits over the stage; back-room.js's brSyncBarPadding()
   keeps --bench-bar-pad in step, the same convention bench.css uses for
   .bench/.fd on public pages. */
body.br { padding-bottom: var(--bench-bar-pad, 40px); }

/* ── Nav ────────────────────────────────────────────────────────────────────── */

.br-nav {
  background: var(--panel);
  border-bottom: var(--border-w) solid var(--line);
  position: sticky;
  top: 0;
  z-index: 60;
}

.br-nav-inner {
  max-width: var(--frame-max);
  margin: 0 auto;
  padding: 0 var(--s3);
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.br-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.br-pill {
  font-size: var(--t-micro);
  text-transform: var(--label-case);
  letter-spacing: var(--label-track);
  border: var(--border-w) solid var(--line-strong);
  padding: 4px 10px;
  border-radius: var(--radius);
  color: var(--ink-soft);
  margin-right: auto;
}

/* body.br a's default colour outranks .br-exit-link's on specificity
 * (same reason front-door.css's admin-door button needs the same
 * fix), so this needs the extra body.br a prefix too. */
body.br a.br-exit-link {
  font-size: var(--t-small);
  color: var(--ink-soft);
  white-space: nowrap;
}

body.br a.br-exit-link:hover { color: var(--accent); }

.br-register-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border: var(--border-w) solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--ground-sunk);
}

.br-register-btn {
  min-height: 34px;
  padding: 0 15px;
  border-radius: var(--radius-pill);
  border: var(--border-w) solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.br-register-btn.is-active {
  border-color: var(--line-strong);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
}

.br-theme-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: var(--border-w) solid var(--line-strong);
  background: var(--panel-raised);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14px;
}

/* ── Frame ──────────────────────────────────────────────────────────────────── */

.br-frame {
  max-width: var(--frame-max);
  margin: 0 auto;
  padding: var(--s4) var(--s3) var(--s6);
  width: 100%;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: var(--s4);
  align-items: start;
}

/* ── Module rail ────────────────────────────────────────────────────────────── */

.br-rail {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 4px;
}

.br-rail-list { display: grid; gap: 4px; }

.br-rail-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  text-align: left;
  font: inherit;
  font-size: var(--t-small);
  cursor: pointer;
  border-radius: var(--radius);
  border: var(--border-w) solid transparent;
  background: transparent;
  color: var(--ink-soft);
}

.br-rail-btn.is-active {
  border-color: var(--line-strong);
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.br-rail-btn:disabled {
  cursor: default;
  opacity: 0.55;
}

.br-rail-label { flex: 1; }

.br-rail-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
  flex: 0 0 auto;
}

.br-rail-note {
  margin: var(--s3) 0 0;
  font-size: var(--t-micro);
  color: var(--ink-faint);
  line-height: 1.5;
}

/* ── Stage ──────────────────────────────────────────────────────────────────── */

.br-stage-head {
  display: flex;
  align-items: flex-end;
  gap: var(--s3);
  flex-wrap: wrap;
  margin-bottom: var(--s3);
}

.br-stage-titles { flex: 1; min-width: 220px; }

.br-stage-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-title);
  line-height: 1;
  margin: 0 0 4px;
}

.br-stage-sub {
  margin: 0;
  font-size: var(--t-small);
  color: var(--ink-faint);
}

.br-stage-status {
  font-size: var(--t-small);
  color: var(--ink-faint);
}

.br-stage-status.is-saved { color: var(--good); }
.br-stage-status.is-error { color: var(--stop); }

.br-stage-foot {
  margin: var(--s3) 0 0;
  font-size: var(--t-small);
  color: var(--ink-faint);
  max-width: 66ch;
}

/* ── Stat tiles ─────────────────────────────────────────────────────────────── */

.br-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s2);
  margin-bottom: var(--s3);
}

.br-stat {
  background: var(--panel);
  border: var(--border-w) solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.br-stat-label {
  margin: 0 0 4px;
  font-size: var(--t-micro);
  text-transform: var(--label-case);
  letter-spacing: var(--label-track);
  color: var(--ink-faint);
}

.br-stat-value {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 34px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.br-stat-delta {
  margin: 4px 0 0;
  font-size: var(--t-small);
  color: var(--ink-faint);
}

.br-stat-delta.is-up { color: var(--good); }
.br-stat-delta.is-down { color: var(--stop); }

/* ── Section furniture (used by modules between blocks) ────────────────────── */

.br-section { margin-bottom: var(--s4); }

.br-section-head {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  margin: 0 0 var(--s2);
}

.br-section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  margin: 0;
}

.br-section-rule { flex: 1; height: 1px; background: var(--line); }

/* ── Group toggle (Status / Drawer), and the group headers it drives ────────── */

.br-group-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: var(--border-w) solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--ground-sunk);
  flex: 0 0 auto;
}

.br-group-btn {
  min-height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: var(--border-w) solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.br-group-btn.is-active {
  border-color: var(--line-strong);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
}

/* A row of its own, not a bare label: at a hundred Things this is the
   thing being scanned, so it earns a real click target and a mark that
   reads at a glance, not just smaller type. */
.br-group-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: var(--s2) 0 0;
  padding: 10px 4px;
  background: none;
  border: 0;
  border-top: var(--border-w) solid var(--line-strong);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.br-group-heading:first-of-type { margin-top: 0; border-top: 0; }

.br-group-heading:hover .br-group-label { color: var(--ink); }

.br-group-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: var(--border-w) solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1;
  color: var(--ink-soft);
}

.br-group-heading:hover .br-group-mark { border-color: var(--accent); color: var(--accent); }

.br-group-label {
  flex: 1;
  font-size: var(--t-micro);
  text-transform: var(--label-case);
  letter-spacing: var(--label-track);
  font-weight: var(--label-weight);
  color: var(--ink-faint);
}

.br-group-count {
  font-size: var(--t-micro);
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.br-empty {
  padding: 14px 18px;
  font-size: var(--t-small);
  color: var(--ink-faint);
  background: var(--panel);
  border: var(--border-w) solid var(--line-strong);
  border-radius: var(--radius-lg);
}

/* ── Data table ─────────────────────────────────────────────────────────────── */

.br-table {
  background: var(--panel);
  border: var(--border-w) solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.br-table-head {
  display: grid;
  gap: var(--s2);
  padding: 12px 18px;
  background: var(--ground-sunk);
  border-bottom: var(--border-w) solid var(--line-strong);
}

.br-table-sort {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: var(--t-micro);
  text-transform: var(--label-case);
  letter-spacing: var(--label-track);
  color: var(--ink-faint);
  text-align: left;
  cursor: pointer;
}

.br-table-sort:hover { color: var(--ink); }
.br-table-sort.is-sorted { color: var(--ink); font-weight: 500; }

.br-table-row {
  display: grid;
  gap: var(--s2);
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.br-table-row:last-child { border-bottom: 0; }
.br-table-row.is-selected { background: var(--ground-sunk); }

.br-table-cell {
  font-size: var(--t-small);
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.br-table-cell--name { color: var(--ink); white-space: pre-line; }

.br-table-open {
  min-height: 34px;
  padding: 0 12px;
  border: var(--border-w) solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel-raised);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  justify-self: start;
}

.br-table-open:hover { border-color: var(--accent); }

.br-table-flag {
  font-size: var(--t-micro);
  text-transform: var(--label-case);
  letter-spacing: var(--label-track);
  color: var(--stop);
}

/* ── Editor panel ───────────────────────────────────────────────────────────── */

/* inset: 0 alone reaches the true viewport bottom, right where the
   presence bar (bench-presence-bar, z-index 500, fixed to bottom: 0)
   sits on top of it: the bar's higher z-index both paints over and
   steals clicks from whatever of the panel falls in that strip, which is
   where the Save/Cancel row lands. --bench-bar-pad is
   already the bar's live-measured height (brSyncBarPadding() in
   back-room.js keeps it current, same variable body.br's own
   padding-bottom already reads), so borrowing it here stops the
   overlay - and the panel it flex-fills - short of the bar instead of
   guessing a fixed number that would drift the next time the bar's
   content changes height. */
.br-editor-overlay {
  position: fixed;
  inset: 0;
  bottom: var(--bench-bar-pad, 40px);
  z-index: 120;
  display: flex;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.35);
}

.br-editor-panel {
  width: min(460px, 100%);
  background: var(--panel);
  border-left: var(--border-w-heavy) solid var(--line-strong);
  display: flex;
  flex-direction: column;
  animation: benchSlide 0.18s ease-out;
}

.br-editor-head {
  padding: var(--s3);
  border-bottom: var(--border-w) solid var(--line);
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.br-editor-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  flex: 1;
}

.br-editor-close {
  width: 34px;
  height: 34px;
  border: var(--border-w) solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--panel-raised);
  color: var(--ink);
  cursor: pointer;
}

.br-editor-close:hover { color: var(--accent); }

.br-editor-body {
  padding: var(--s3);
  display: grid;
  gap: var(--s3);
  flex: 1;
  overflow: auto;
}

.br-field { display: grid; gap: 6px; }

.br-field-label {
  font-size: var(--t-micro);
  text-transform: var(--label-case);
  letter-spacing: var(--label-track);
  color: var(--ink-faint);
}

.br-field-hint {
  font-size: var(--t-micro);
  color: var(--ink-faint);
  margin: -2px 0 0;
}

/* ── Broadcast colour picker ────────────────────────────────────────────── */
/* Same shape as the Work Board's own piles_color picker
   (.wb-color-swatch in the-work-board.css): a curated five-key
   palette snapped to design tokens, not a free hex input. */

.br-color-swatches { display: flex; gap: 8px; }

.br-color-swatch {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  border: var(--border-w) solid var(--line-strong);
  cursor: pointer;
}

.br-color-swatch.is-selected {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--ink);
}

.br-danger {
  border: var(--border-w) solid var(--stop);
  border-radius: var(--radius);
  padding: var(--s3);
  background: var(--panel-raised);
}

.br-danger-line {
  margin: 0 0 8px;
  font-size: var(--t-small);
  color: var(--ink);
}

.br-danger-line strong { font-weight: 500; }

.br-danger-arm {
  min-height: 42px;
  padding: 0 16px;
  border: var(--border-w) solid var(--stop);
  border-radius: var(--radius);
  background: none;
  color: var(--stop);
  font: inherit;
  font-size: var(--t-small);
  cursor: pointer;
}

.br-danger-confirm {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.br-danger-confirm-line {
  font-size: var(--t-small);
  color: var(--ink-soft);
  width: 100%;
  margin: 0;
}

.br-danger-yes {
  min-height: 42px;
  padding: 0 16px;
  border: var(--border-w) solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--stop);
  color: var(--panel);
  font: inherit;
  font-size: var(--t-small);
  cursor: pointer;
}

.br-danger-keep {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: var(--t-small);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.br-editor-foot {
  padding: var(--s3);
  border-top: var(--border-w) solid var(--line);
  display: flex;
  gap: 10px;
  align-items: center;
}

.br-editor-note {
  margin-left: auto;
  font-size: var(--t-small);
  color: var(--ink-faint);
}

/* ── Small bar chart (Sender) ───────────────────────────────────────────────── */

.br-chart { margin: 10px 0 var(--s3); }

.br-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 64px;
}

/* The runs-over-time chart's prior-week bars render outlined so this week
   reads solid against last week at a glance. */
.br-chart-bar--outline {
  background: transparent;
  border: var(--border-w) solid var(--accent);
}

.br-chart-bar--outline.br-chart-bar--zero {
  border-color: var(--line-strong);
}

/* ── numbered sections, split bar, repeat bar ───────────────────────────────── */

/* Section index, per the design mock: 01 through 06 ahead of the title. */
.br-secnum {
  font-size: var(--t-micro);
  letter-spacing: var(--label-track);
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.br-subsection-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  margin: 0;
}

/* Guest vs signed-in split, one two-segment bar. */
.br-split {
  display: flex;
  height: 26px;
  border-radius: var(--radius);
  overflow: hidden;
  border: var(--border-w) solid var(--line-strong);
}

.br-split-seg {
  display: flex;
  align-items: center;
  padding: 0 10px;
  min-width: 2px;
}

.br-split-seg--guest  { background: var(--line-strong); }
.br-split-seg--signed { background: var(--accent); }

.br-split-label {
  font-size: var(--t-micro);
  white-space: nowrap;
  color: var(--ink);
}

.br-split-seg--signed .br-split-label { color: var(--accent-ink); }

/* The Per Thing table's came-back cell: a small bar, the percentage,
   and the honest raw count beside it. */
.br-repeat {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.br-repeat-bar {
  flex: 1 1 40px;
  min-width: 28px;
  height: 6px;
  border-radius: 3px;
  background: var(--line-strong);
  overflow: hidden;
}

.br-repeat-fill {
  display: block;
  height: 100%;
  background: var(--accent);
}

.br-repeat-pct {
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.br-repeat-count {
  font-size: var(--t-micro);
  color: var(--ink-faint);
  white-space: nowrap;
  flex: 0 0 auto;
}

/* The small "of N" beside a stat value, and the active-window chip the
   Per Thing table wears so its numbers always name their window. */
.br-stat-of {
  font-size: var(--t-small);
  font-weight: 400;
  color: var(--ink-faint);
}

.br-win-chip {
  font-size: var(--t-micro);
  text-transform: var(--label-case);
  letter-spacing: var(--label-track);
  color: var(--ink-faint);
  border: var(--border-w) solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  white-space: nowrap;
}

.br-chart-bar {
  flex: 1;
  min-width: 3px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  position: relative;
}

.br-chart-bar--zero { background: var(--line-strong); }

/* The current month's bar in the 6-month view: actual runs (solid,
   bottom) stacked under the projected remainder (same hue, hatched and
   lighter, top) - one bar, two kinds of number, so the seam between
   them has to read clearly without a legend. flex-direction: column so
   the first child (the projection) lands visually on top, matching the
   proj-then-actual markup order; .br-chart-bar's own flex: 1 is for
   when it is a direct child of .br-chart-bars sizing itself against
   its siblings, which does not apply once it is nested here, so it is
   pinned back to its own explicit height. */
.br-chart-bar-stack {
  flex: 1;
  min-width: 3px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.br-chart-bar-stack .br-chart-bar {
  flex: 0 0 auto;
  border-radius: 0;
}

.br-chart-bar-proj {
  flex: 0 0 auto;
  border-radius: 2px 2px 0 0;
  background: repeating-linear-gradient(135deg, var(--accent) 0 3px, transparent 3px 6px);
  opacity: 0.5;
  border-bottom: 2px solid var(--panel);
}

.br-chart-bar-label {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* The stacked actual+projected bar's own three labels. The actual
   number used to reuse .br-chart-bar-label positioned at the seam
   between the two segments, right where the stripe starts - unreadable.
   A later fix moved it inside the solid segment instead, which broke
   again the moment the actual count was small next to a large
   projection (a 2px-tall sliver has nowhere to put a 10px number).
   Both actual and projected are opaque chips positioned as siblings of
   the segments they describe, not children of them - fixed spots that
   read correctly whatever height either segment ends up at, and safe
   from the projected segment's own opacity:0.5, which would otherwise
   wash out anything nested inside it. The total reads as one explicit
   sum above the whole stack, where the single collision-prone label
   used to sit. */
.br-chart-bar-actual-num {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--ink);
  background: var(--panel);
  padding: 0 3px;
  border-radius: 2px;
  white-space: nowrap;
}

.br-chart-bar-proj-num {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--ink);
  background: var(--panel);
  padding: 0 3px;
  border-radius: 2px;
  white-space: nowrap;
}

.br-chart-bar-total-num {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--ink-faint);
  white-space: nowrap;
}

.br-chart-labels {
  display: flex;
  gap: 3px;
  margin-top: 4px;
}

.br-chart-label {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: var(--ink-faint);
}

.br-chart-label--weekend { color: var(--warn); }

/* ── Under 900 ──────────────────────────────────────────────────────────────── */

@media (max-width: 899px) {
  .br-nav-inner { padding: 10px 14px; min-height: 0; gap: 10px; }
  .br-wordmark { font-size: 20px; }
  .br-register-pill { display: none; }
  .br-theme-btn { width: 34px; height: 34px; font-size: 13px; }

  .br-frame {
    grid-template-columns: minmax(0, 1fr);
    padding: var(--s3);
  }

  .br-rail {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
  }

  .br-rail-list {
    display: flex;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    min-width: 0;
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 24px), transparent);
    mask-image: linear-gradient(to right, black calc(100% - 24px), transparent);
  }

  .br-rail-btn { width: auto; white-space: nowrap; }
  .br-rail-note { display: none; }

  .br-table-head, .br-table-row {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  .br-table-cell:not(.br-table-cell--name):not(:last-of-type) { display: none; }
  .br-table-sort:not(:first-child):not(:last-of-type) { display: none; }

  .br-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── The room uses the space people have ───────────────────────────────── */

.br-nav-inner,
.br-frame { max-width: 1560px; }

/* ── Arranging the rail ────────────────────────────────────────────────── */

.br-rail-arrange-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: var(--s1);
  align-items: center;
  border-top: 1px solid var(--line);
  padding: var(--s1) 0;
}

.br-rail-mini {
  font: inherit;
  font-size: var(--t-micro);
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  min-width: 32px;
}

.br-rail-mini.is-on {
  color: var(--ground);
  background: var(--accent);
  border-color: var(--accent);
}

.br-rail-arrange {
  font: inherit;
  font-size: var(--t-micro);
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  background: none;
  border: 0;
  padding: var(--s2) 0 0;
  cursor: pointer;
  text-align: left;
}

.br-rail-arrange:hover { color: var(--accent); }

.br-rail-pinmark { font-size: 10px; color: var(--accent); margin-left: 4px; }

/* On a phone the rail is a scrolling tab row; while arranging it goes
   vertical so pin and move controls are tappable. */
@media (max-width: 899px) {
  .br-rail-list.is-arranging {
    display: grid;
    grid-auto-flow: row;
    overflow-x: visible;
  }
}

/* ── The Bell band and door chime ────────────────────────────────────────
   The band itself reuses bench.css's own .bench-presence-bar family of
   classes unchanged (loaded on this page already), so it looks like the
   same Bell everywhere it appears. Only the chime control and its panel
   are new here: nothing on the public site has anything like it, since
   the chime is a Back Room only, admin only feature. */

/* --bar-ink-dim/--bar-ink/--bar-good are the Bell band's own custom
   properties, declared on .bench-presence-bar in bench.css. Both of
   these elements only ever render inside that bar (brPresenceBandHtml
   nests them in .bench-presence-bar-actions), so the fallback a
   var(--x, #hex) would need is never actually reached, and the token
   purity guard treats such a fallback as a literal regardless: leaving
   it out is both correct and what keeps this file passing that guard. */
.br-chime-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: none;
  color: var(--bar-ink-dim);
  font: inherit;
  font-size: 11px;
  text-transform: var(--label-case);
  letter-spacing: var(--label-track);
  cursor: pointer;
  padding: 0;
}

.br-chime-btn:hover { color: var(--bar-ink); }

.br-chime-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bar-ink-dim);
}

.br-chime-dot.is-on { background: var(--bar-good); }

.br-chime-panel {
  position: fixed;
  right: var(--s3);
  bottom: 56px;
  z-index: 501; /* above .bench-presence-bar's own 500 */
  width: min(320px, calc(100vw - 2 * var(--s3)));
  max-height: min(70vh, 520px);
  overflow-y: auto;
  background: var(--panel);
  border: var(--border-w) solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
  padding: var(--s3);
}

.br-chime-panel-head {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-bottom: var(--s2);
}

.br-chime-panel-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  flex: 1;
}

.br-chime-close {
  width: 26px;
  height: 26px;
  border: var(--border-w) solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--panel-raised);
  color: var(--ink);
  font-size: 11px;
  cursor: pointer;
}

.br-chime-close:hover { color: var(--accent); }

.br-chime-onoff {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  font-size: var(--t-small);
  color: var(--ink);
  cursor: pointer;
  margin-bottom: 4px;
}

.br-chime-onoff input { margin-top: 3px; flex: 0 0 auto; }

.br-chime-list {
  list-style: none;
  margin: var(--s3) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.br-chime-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.br-chime-select {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  min-height: 40px;
  padding: 0 10px;
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-raised);
  color: var(--ink);
  font: inherit;
  font-size: var(--t-small);
  cursor: pointer;
  text-align: left;
}

.br-chime-select:hover { border-color: var(--accent); }

.br-chime-select.is-active {
  border-color: var(--accent);
  background: var(--ground-sunk);
}

.br-chime-name { flex: 1; min-width: 0; }

.br-chime-tag {
  flex: 0 0 auto;
  font-size: var(--t-micro);
  text-transform: var(--label-case);
  letter-spacing: var(--label-track);
  color: var(--ink-faint);
}

.br-chime-preview {
  flex: 0 0 auto;
  width: 40px;
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius);
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 12px;
}

.br-chime-preview:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 899px) {
  .br-chime-panel { right: var(--s2); bottom: 52px; }
}
