/* ═══════════════════════════════════════════════
   SALA EPISCOPORUM — Vatican-internal livestream
   Aesthetic auth gate + ecclesiastic workstation
   ═══════════════════════════════════════════════ */

:root {
  --sala-paper: #f4ecdc;
  --sala-paper-deep: #ebe0c8;
  --sala-ink: #2a2418;
  --sala-ink-soft: #4a3f2a;
  --sala-muted: #8a7a5a;
  --sala-rule: rgba(80, 60, 30, 0.18);
  --sala-rule-soft: rgba(80, 60, 30, 0.08);
  --sala-gold: #a78440;
  --sala-gold-faint: rgba(167, 132, 64, 0.18);
  --sala-cardinal: #7a1f23;
  --sala-cardinal-soft: rgba(122, 31, 35, 0.7);
  --sala-wood: #3a2a18;
  --sala-wood-light: #5b3f22;
  --sala-screen: #0c1a14;
  --sala-screen-glow: #b9d8c1;
}

body.sala-page {
  /* The gold palette is otherwise only defined on .lg-stage (login) and
     .bc-app (workstation interior). Body-level modals (#bc-poll, the help
     modal) live outside .bc-app, so var(--gold*) failed there — the
     selected vote radio never got its gold fill. Define them on the body
     so they resolve everywhere on both pages. */
  --gold: #c9a14a;
  --gold-2: #b88a36;
  --gold-soft: #e8c97a;
  --gold-deep: #6b4710;
  font-family: var(--font-body);
  color: var(--sala-ink);
  background: var(--sala-paper);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Latin chrome utilities ── */
.sala-latin {
  font-family: var(--font-display);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sala-mono {
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
/* ═══════════════════════════════════════════════
   LOGIN / ACCESSUS — Sala Episcoporum
   Adapted from the Bishop Login design hand-off.
   Stage with stone-vignette background, gold top
   strip, parchment card flanked by candles, status
   bar. Drives the same #sala-login-form / register
   IDs as the original gate.
   ═══════════════════════════════════════════════ */

body.sala-login-page {
  background: #0a0806;
  color: #e9e2d4;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  /* Allow vertical scroll. The card can be taller than the viewport on
     short screens — the topbar and statusbar stay pinned (fixed)
     while the card scrolls between them. */
}

.lg-stage {
  --gold: #c9a14a;
  --gold-2: #b88a36;
  --gold-soft: #e8c97a;
  --gold-deep: #6b4710;
  --paper: #f7efde;
  --paper-2: #ede1c2;
  --rule: rgba(255, 220, 170, 0.10);
  --rule-2: rgba(255, 220, 170, 0.20);
  --ok: #6cb16a;

  position: relative;
  min-height: 100vh;
  display: grid; place-items: center;
  /* Padding clears room for the fixed topbar (56px) + statusbar (~52px)
     so the card never collides with them. */
  padding: 80px 16px 88px;
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, rgba(220, 175, 110, 0.10), transparent 70%),
    radial-gradient(ellipse 110% 90% at 50% 100%, rgba(0, 0, 0, 0.65), transparent 60%),
    radial-gradient(ellipse 100% 80% at 50% 0%, rgba(0, 0, 0, 0.55), transparent 60%),
    linear-gradient(180deg, #1c1610 0%, #14100b 50%, #0a0806 100%);
}
.lg-stage::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 12% 22%, rgba(255, 220, 170, 0.04) 0 1px, transparent 2px),
    radial-gradient(circle at 38% 78%, rgba(255, 220, 170, 0.03) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 35%, rgba(255, 220, 170, 0.04) 0 1px, transparent 2px),
    radial-gradient(circle at 88% 65%, rgba(255, 220, 170, 0.03) 0 1px, transparent 2px);
  background-size: 220px 220px, 280px 280px, 320px 320px, 260px 260px;
  pointer-events: none;
}

.lg-arch {
  position: absolute;
  top: 50%; left: 50%;
  width: 620px; height: 760px;
  transform: translate(-50%, -52%);
  background: radial-gradient(ellipse 80% 60% at 50% 25%, rgba(232, 201, 122, 0.05), transparent 70%);
  border-radius: 50% 50% 0 0 / 30% 30% 0 0;
  pointer-events: none;
}

/* ----- Top brand strip ----- */
.lg-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: linear-gradient(180deg, #d4a64f 0%, #b6862c 100%);
  color: #1a1208;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 6px 20px rgba(0, 0, 0, 0.4);
  z-index: 50;
}
.lg-topbar::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 1px; background: rgba(0, 0, 0, 0.45);
}
.lg-brand { display: flex; align-items: center; gap: 14px; }
.lg-brand-link {
  color: inherit;
  text-decoration: none;
  padding: 4px 8px 4px 4px;
  border-radius: 3px;
  transition: background 0.2s ease;
}
.lg-brand-link:hover {
  background: rgba(0, 0, 0, 0.08);
}
.lg-brand-link:focus-visible {
  outline: 2px solid #1a1208;
  outline-offset: 2px;
}
.lg-brand-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 2px;
  color: rgba(26, 18, 8, 0.82);
  transition: color 0.2s ease, transform 0.2s ease;
}
.lg-brand-link:hover .lg-brand-back {
  color: rgba(26, 18, 8, 0.95);
  transform: translateX(-2px);
}
.lg-brand-text { display: inline-flex; flex-direction: column; }
@media (prefers-reduced-motion: reduce) {
  .lg-brand-link,
  .lg-brand-back { transition: none; }
  .lg-brand-link:hover .lg-brand-back { transform: none; }
}
.lg-seal {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff1c8, #c08a26 70%, #6b4710);
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
}
.lg-seal-inner {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #1a1208;
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255, 220, 160, 0.4);
  color: var(--gold-soft);
  font-family: "Cinzel", serif;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}
.lg-word-1 {
  font-family: "Cinzel", serif;
  font-weight: 600;
  letter-spacing: 0.20em;
  font-size: 1rem;
  color: #1a1208;
}
.lg-word-2 {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 0.875rem;
  color: rgba(26, 18, 8, 0.85);
  margin-top: 2px;
  letter-spacing: 0.04em;
}
.lg-topbar-right {
  display: flex; align-items: center; gap: 16px;
  font-family: "Cinzel", serif;
  font-size: 0.8125rem;
  letter-spacing: 0.18em;
  color: rgba(26, 18, 8, 0.88);
}
.lg-sysok {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  padding: 6px 10px;
  border-radius: 2px;
}
.lg-sysok-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #2f5e2d;
  box-shadow: 0 0 6px #6cb16a;
}

/* ----- Bottom status strip ----- */
.lg-statusbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 14px 28px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  color: rgba(232, 201, 122, 0.85);
  border-top: 1px solid var(--rule);
  background: rgba(10, 8, 5, 0.7);
  backdrop-filter: blur(2px);
  z-index: 50;
}
.lg-statusbar .dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  margin: 0 10px;
  vertical-align: middle;
  box-shadow: 0 0 4px var(--ok);
}

/* ----- Altarpiece composition ----- */
.lg-altar {
  position: relative;
  z-index: 2;
  margin: 60px 0 44px;
  display: flex; justify-content: center;
}
.lg-altar-inner { position: relative; }

.lg-card {
  position: relative;
  /* Widened from the original 580px so the 2-column registration
     grid has real breathing room — each column ends up ~310px
     wide instead of the cramped ~240px the first 660px attempt
     produced. Login form still looks balanced at this width
     (single-column input fills it gracefully). */
  width: 780px;
  padding: 8px;
  background: linear-gradient(180deg, #d4a64f 0%, #8a5f1d 50%, #c39036 100%);
  border-radius: 4px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 30px 60px rgba(0, 0, 0, 0.6),
    0 10px 30px rgba(0, 0, 0, 0.5);
}
.lg-card::before {
  content: "";
  position: absolute; inset: 2px;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  pointer-events: none;
}
.lg-paper {
  position: relative;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(232, 201, 122, 0.18), transparent 70%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(180, 130, 60, 0.12), transparent 70%),
    linear-gradient(180deg, #f7efde 0%, #ede1c2 100%);
  color: #1a1208;
  padding: 36px 56px 32px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(107, 71, 16, 0.25), inset 0 0 60px rgba(120, 80, 30, 0.08);
}
.lg-paper::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 25% 30%, rgba(107, 71, 16, 0.04) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 60%, rgba(107, 71, 16, 0.04) 0 1px, transparent 2px),
    radial-gradient(circle at 45% 80%, rgba(107, 71, 16, 0.03) 0 1px, transparent 2px);
  background-size: 90px 90px, 130px 130px, 110px 110px;
  pointer-events: none;
  border-radius: 2px;
}

.lg-card-head {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(107, 71, 16, 0.2);
  margin-bottom: 22px;
  position: relative;
}
.lg-card-head::after {
  content: "✦";
  position: absolute; bottom: -8px; left: 50%;
  transform: translateX(-50%);
  color: var(--gold-2);
  font-size: 0.75rem;
  background: var(--paper-2);
  padding: 0 8px;
}
.lg-emblem {
  width: 64px; height: 64px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(232, 201, 122, 0.4), transparent 60%),
    radial-gradient(circle at 50% 50%, #f7efde, #d4b47a);
  border: 2px solid rgba(107, 71, 16, 0.55);
  box-shadow:
    0 0 0 4px rgba(107, 71, 16, 0.15),
    inset 0 0 12px rgba(107, 71, 16, 0.2);
  display: grid; place-items: center;
  position: relative;
}
.lg-emblem-keys {
  position: absolute; inset: 0;
  display: grid; place-items: center;
}
.lg-emblem-keys svg { width: 38px; height: 38px; }

.lg-title {
  font-family: "Cinzel", serif;
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 1.625rem;
  color: #1a1208;
  text-align: center;
  text-transform: none;
}
.lg-subtitle {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.1875rem;
  color: rgba(26, 18, 8, 0.92);
  text-align: center;
  letter-spacing: 0.02em;
  margin-top: 4px;
  line-height: 1.4;
}

.lg-section-label {
  font-family: "Cinzel", serif;
  font-size: 1rem;
  letter-spacing: 0.22em;
  color: rgba(26, 18, 8, 0.92);
  text-align: center;
  margin-bottom: 22px;
}

.lg-error {
  font-family: "Cinzel", serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8b1f1a;
  text-align: center;
  min-height: 1em;
  margin: 0 0 16px 0;
  border-radius: 3px;
  transition: background-color 120ms ease, padding 120ms ease;
}

.lg-error:not(:empty) {
  background: rgba(179, 38, 30, 0.09);
  border: 1px solid rgba(179, 38, 30, 0.35);
  padding: 10px 14px;
  margin: 0 0 18px 0;
}

@media (prefers-reduced-motion: reduce) {
  .lg-error { transition: none; }
}

.lg-form { margin: 0; }

/* Registration form layout: 2×2 grid of fields. Halves the form
   height vs the previous stacked layout. Login and Forgot forms
   are short enough that they stay single-column (no .lg-fields-grid
   wrapper there). Below the 700px breakpoint the grid collapses
   to a single column so the form remains usable. */
.lg-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* Widened gap so the two columns visually separate rather than
     blurring into a single dense field-strip. */
  column-gap: 28px;
  align-items: start;
}

@media (max-width: 700px) {
  .lg-fields-grid {
    grid-template-columns: 1fr;
    column-gap: 0;
  }
}

.lg-field { margin-bottom: 16px; min-width: 0; }
.lg-field-label {
  display: flex; align-items: baseline; justify-content: space-between;
  font-family: "Cinzel", serif;
  font-size: 1rem;
  letter-spacing: 0.16em;
  color: rgba(26, 18, 8, 0.95);
  margin-bottom: 8px;
}
.lg-field-label label {
  font: inherit; color: inherit; letter-spacing: inherit;
  text-transform: none;
}
.lg-field-hint {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  /* Dropped from 1.375rem — it was reading larger than the label
     itself which inverted the visual hierarchy. 1rem keeps the
     accessibility floor while leaving the label dominant. */
  font-size: 1rem;
  color: rgba(107, 71, 16, 0.85);
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
}
.lg-field-helper {
  margin: 10px 0 0 4px;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: rgba(74, 50, 12, 0.95);
  letter-spacing: 0;
}
.lg-field-helper em { font-style: italic; }
.lg-input-wrap {
  position: relative;
  display: flex; align-items: center;
  background: rgba(255, 250, 235, 0.7);
  border: 1px solid rgba(107, 71, 16, 0.35);
  border-radius: 2px;
  padding: 0 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lg-input-wrap:focus-within {
  border-color: var(--gold-2);
  box-shadow: 0 0 0 2px rgba(201, 161, 74, 0.18);
  background: #fff;
}
.lg-input-ic {
  color: rgba(107, 71, 16, 0.7);
  font-size: 1rem;
  margin-right: 12px;
  width: 18px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.lg-input-ic svg { width: 18px; height: 18px; }
.lg-input {
  flex: 1;
  border: 0; outline: 0;
  background: transparent;
  font-family: "JetBrains Mono", monospace;
  font-size: 1.0625rem;
  color: #1a1208;
  padding: 14px 0;
  letter-spacing: 0.02em;
  width: 100%;
  min-width: 0;
}
.lg-input::placeholder {
  color: rgba(107, 71, 16, 0.7);
  font-style: italic;
  font-family: "Cormorant Garamond", serif;
  /* Matched to .lg-input (1.0625rem) so the typed text doesn't
     visually shrink when the visitor starts entering a value.
     Previously 1.5rem, which jumped down ~7px on first keystroke. */
  font-size: 1.0625rem;
  letter-spacing: 0;
}
.lg-select {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.0625rem;
  appearance: none;
  -webkit-appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, rgba(107, 71, 16, 0.55) 50%) calc(100% - 14px) 50% / 6px 6px no-repeat,
    linear-gradient(135deg, rgba(107, 71, 16, 0.55) 50%, transparent 50%) calc(100% - 8px) 50% / 6px 6px no-repeat;
  padding-right: 24px;
}
.lg-select:not([data-empty]) { color: #1a1208; font-style: normal; font-family: "JetBrains Mono", monospace; font-size: 1.0625rem; }
.lg-eye {
  background: transparent; border: 0; cursor: pointer;
  color: rgba(107, 71, 16, 0.7);
  font-size: 1rem; padding: 6px;
  flex-shrink: 0;
}
.lg-eye svg { width: 18px; height: 18px; }
.lg-eye:hover { color: var(--gold-deep); }
.lg-eye:focus-visible { outline: 1px solid var(--gold-2); outline-offset: 2px; }

.lg-submit {
  width: 100%;
  background: linear-gradient(180deg, #d4a64f 0%, #b6862c 100%);
  color: #1a1208;
  border: 1px solid rgba(0, 0, 0, 0.4);
  border-radius: 2px;
  padding: 16px;
  font-family: "Cinzel", serif;
  font-weight: 700;
  letter-spacing: 0.22em;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.5), 0 2px 0 rgba(0, 0, 0, 0.25);
  transition: transform 0.06s, box-shadow 0.15s, background 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 12px;
}
.lg-submit svg { width: 16px; height: 16px; }
.lg-submit:hover  { background: linear-gradient(180deg, #ddb159 0%, #c19236 100%); }
.lg-submit:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.4), 0 1px 0 rgba(0, 0, 0, 0.25); }
.lg-submit:focus-visible { outline: 2px solid #1a1208; outline-offset: 2px; }
.lg-submit[disabled] { opacity: 0.75; cursor: not-allowed; }

.lg-divider {
  display: flex; align-items: center; gap: 14px;
  margin: 22px 0 16px;
  font-family: "Cinzel", serif;
  /* Bumped from 0.9375rem to the 1rem floor (visible label, not
     decorative). */
  font-size: 1rem;
  letter-spacing: 0.22em;
  color: rgba(26, 18, 8, 0.92);
}
.lg-divider::before, .lg-divider::after {
  content: ""; flex: 1; height: 1px;
  background: rgba(107, 71, 16, 0.25);
}
.lg-alt { display: flex; gap: 10px; }
.lg-alt-btn {
  flex: 1;
  background: rgba(255, 250, 235, 0.5);
  border: 1px solid rgba(107, 71, 16, 0.4);
  color: rgba(26, 18, 8, 0.95);
  padding: 12px 10px;
  font-family: "Cinzel", serif;
  /* Bumped from 0.875rem to the 1rem accessibility floor — these
     are button labels and must be legible even though the buttons
     are currently disabled placeholders. */
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  border-radius: 2px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.lg-alt-btn svg { width: 14px; height: 14px; }
.lg-alt-btn:hover {
  background: rgba(255, 250, 235, 0.85);
  border-color: rgba(107, 71, 16, 0.5);
}
.lg-alt-btn:focus-visible {
  outline: 2px solid var(--gold-2);
  outline-offset: 2px;
  background: rgba(255, 250, 235, 0.85);
}
.lg-alt-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.lg-alt-ic { font-size: 0.75rem; opacity: 0.85; display: inline-flex; }

.lg-mode-switch {
  text-align: center;
  margin: 22px 0 0;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.0625rem;
  color: rgba(26, 18, 8, 0.9);
}

.lg-forgot {
  text-align: center;
  margin: 12px 0 0;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1rem;
  color: rgba(26, 18, 8, 0.85);
}
.lg-link {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.0625rem;
  color: var(--gold-deep);
  text-decoration: none;
  border: 0;
  background: transparent;
  padding: 0;
  border-bottom: 1px dashed rgba(107, 71, 16, 0.5);
  font-weight: 500;
  cursor: pointer;
}
.lg-link:hover { color: #1a1208; border-bottom-style: solid; }
.lg-link:focus-visible { outline: 1px solid var(--gold-2); outline-offset: 2px; }

/* GDPR consent checkbox + Auditor Anonymus link */
.lg-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0 16px;
  cursor: pointer;
}
.lg-consent input { display: none; }
.lg-consent-box {
  flex-shrink: 0;
  width: 18px; height: 18px;
  margin-top: 3px;
  border: 1px solid rgba(107, 71, 16, 0.6);
  border-radius: 1px;
  background: rgba(255, 250, 235, 0.6);
  display: grid; place-items: center;
  color: var(--gold-deep);
  font-size: 0.875rem; line-height: 1;
}
.lg-consent input:checked + .lg-consent-box::before { content: "✓"; }
.lg-consent-text {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: rgba(26, 18, 8, 0.95);
}

.lg-anonymous-switch {
  text-align: center;
  margin: 22px 0 0;
  padding-top: 14px;
  border-top: 1px dashed rgba(107, 71, 16, 0.18);
}
.lg-anonymous-link {
  font-size: 1.5rem;
  color: rgba(107, 71, 16, 0.95);
  border-bottom-style: dotted;
  font-weight: 500;
}

.lg-footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(107, 71, 16, 0.2);
  text-align: center;
}
.lg-quote {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.3125rem;
  font-style: italic;
  color: rgba(26, 18, 8, 0.95);
  text-align: center;
  margin: 6px 0 0;
  font-weight: 500;
}
.lg-quote-attr {
  font-family: "Cinzel", serif;
  font-style: normal;
  /* Bumped from 0.8125rem so the scripture citation reads at
     comfortable size. Still smaller than the quote itself so the
     visual hierarchy holds. */
  font-size: 0.9375rem;
  letter-spacing: 0.22em;
  color: rgba(26, 18, 8, 0.85);
  margin-top: 8px;
}

.lg-build {
  text-align: center;
  margin: 16px 0 0;
  font-family: "JetBrains Mono", monospace;
  /* Bumped from 0.75rem (≈12px) which Beatriz flagged as hard to
     read. Still smaller than body to stay in chrome territory, but
     no longer microscopic. Opacity nudged up too. */
  font-size: 0.875rem;
  letter-spacing: 0.16em;
  color: rgba(232, 201, 122, 0.85);
}

/* Responsive guards */
@media (max-width: 700px) {
  .lg-card { width: min(94vw, 520px); }
  .lg-paper { padding: 28px 24px 26px; }
  .lg-title { font-size: 1.375rem; letter-spacing: 0.14em; }
  .lg-subtitle { font-size: 1.0625rem; }
  .lg-section-label { font-size: 0.9375rem; letter-spacing: 0.18em; margin-bottom: 18px; }
  .lg-input { font-size: 1.0625rem; padding: 13px 0; }
  .lg-input::placeholder { font-size: 1rem; }
  .lg-submit { font-size: 0.9375rem; padding: 14px; letter-spacing: 0.18em; }
  .lg-quote { font-size: 1.1875rem; }
  .lg-link { font-size: 1rem; }
  .lg-mode-switch { font-size: 1rem; }
  .lg-topbar-right .lg-date { display: none; }
  .lg-topbar { padding: 0 20px; height: 50px; }
  .lg-word-1 { font-size: 0.875rem; letter-spacing: 0.14em; }
  .lg-word-2 { font-size: 0.8125rem; }
  .lg-statusbar { padding: 12px 20px; font-size: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .lg-flame, .lg-flame-core, .lg-flame-glow { animation: none; }
}

/* Skip link visible only on keyboard focus, on the dark stage */
body.sala-login-page .skip-link:focus,
body.sala-login-page .skip-link:focus-visible {
  background: var(--gold-soft, #e8c97a);
  color: #1a1208;
  z-index: 10;
}
/* ═══════════════════════════════════════════════
   SALA — Workstation (broadcast UI)
   Adapted from Lvminis Fidei design handoff.
   ═══════════════════════════════════════════════ */

body.sala-workstation {
  background: #0a0805;
  color: #e9e2d4;
  height: 100vh;
  min-height: 700px;
  margin: 0;
  overflow: hidden;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

.bc-app {
  --gold: #c9a14a;
  --gold-2: #b88a36;
  --gold-soft: #e8c97a;
  --ink: #15110c;
  --ink-2: #1d1812;
  --ink-3: #2a2218;
  --paper: #f7efde;
  --rule: rgba(255, 220, 170, 0.10);
  --rule-2: rgba(255, 220, 170, 0.18);
  --warn: #d96b3e;
  --ok: #6cb16a;

  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  background: var(--ink);
  color: #e9e2d4;
  display: flex; flex-direction: column;
  font-size: 0.8125rem;
  font-feature-settings: "ss01", "tnum";
  overflow: hidden;
}

/* ===== Top bar ===== */
.bc-top {
  height: 56px;
  flex: 0 0 56px;
  background: linear-gradient(180deg, #d4a64f 0%, #b6862c 100%);
  color: #1a1208;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  position: relative;
  border-bottom: 1px solid rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.bc-top::after {
  content: "";
  position: absolute; left: 18px; right: 18px; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.5), transparent);
}
.bc-top-left { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.bc-mark-img {
  display: block;
  height: 38px;
  width: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}

.bc-wordmark { line-height: 1.05; flex-shrink: 0; }
.bc-word-1 {
  font-family: "Cinzel", "Cormorant Garamond", serif;
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 0.9375rem;
  color: #1a1208;
}

.bc-top-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.bc-time {
  font-family: "Cinzel", serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: #1a1208;
  border: 1px solid rgba(0, 0, 0, 0.4);
  padding: 4px 8px;
  border-radius: 2px;
}

.bc-user { display: flex; align-items: center; gap: 10px; }
.bc-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(180deg, #2b2014, #0e0a05);
  display: grid; place-items: center;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}
.bc-avatar-inner {
  font-family: "Cinzel", serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--gold-soft);
}
.bc-avatar-emblem {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  box-sizing: border-box;
}
.bc-avatar-emblem svg { width: 100%; height: 100%; }
.bc-avatar-emblem.is-card    { color: #e04848; } /* Cardinalis red */
.bc-avatar-emblem.is-mons    { color: #6cb16a; } /* Episcopus / Mons. green */
.bc-avatar-emblem.is-prael   { color: #b47fda; } /* Praelatus violet */
.bc-avatar-emblem.is-postul,
.bc-avatar-emblem.is-default { color: #d4b67a; } /* Postulator / unprefixed gold */
/* Bumped from 280px to 360px so the "rank · nomen" line has room
   without ellipsising at typical names (e.g. "Archiepiscopus ·
   Brazov" ~ 320px at Cinzel 0.9375rem with 0.18em tracking). */
.bc-user-meta { line-height: 1.1; text-align: right; min-width: 0; max-width: 360px; }
.bc-user-name {
  font-family: "Cinzel", "Cormorant Garamond", serif;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #1a1208;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bc-user-role {
  font-family: "Cormorant Garamond", "Cinzel", serif;
  font-style: italic;
  font-size: 1.125rem;
  color: rgba(26, 18, 8, 0.9);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bc-user-logout {
  font: inherit;
  font-family: "Cinzel", serif;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: rgba(26, 18, 8, 0.9);
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.25);
  padding: 5px 12px;
  border-radius: 2px;
  cursor: pointer;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
}
.bc-user-logout:hover { color: #1a1208; background: rgba(0, 0, 0, 0.06); }
.bc-user-logout:focus-visible { outline: 2px solid #1a1208; outline-offset: 2px; }
a.bc-user-logout { text-decoration: none; display: inline-flex; align-items: center; }

/* ===== Body ===== */
.bc-body { flex: 1; display: flex; min-height: 0; min-width: 0; }

.bc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }

/* ===== Player ===== */
.bc-player {
  display: flex; flex-direction: column;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.bc-player-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 12px 16px 10px 16px;
  border-bottom: 1px solid var(--rule);
}
.bc-player-pretitle {
  display: block;
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  color: rgba(232, 201, 122, 0.85);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.bc-player-title h2 {
  margin: 0;
  font-family: "Cormorant Garamond", "Cinzel", serif;
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: 0.01em;
  color: #f4ead3;
}
.bc-player-actions { display: flex; gap: 6px; }
.bc-icon-btn {
  width: 28px; height: 28px;
  border-radius: 4px;
  background: transparent;
  border: 1px solid var(--rule-2);
  color: #c8b89d;
  cursor: pointer;
  font-size: 0.8125rem;
}
.bc-icon-btn:hover { background: rgba(255, 220, 170, 0.05); }
.bc-icon-btn:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 2px; }
.bc-icon-btn[disabled],
.bc-icon-btn[aria-disabled="true"] {
  opacity: 0.35;
  cursor: not-allowed;
}
.bc-icon-btn[disabled]:hover,
.bc-icon-btn[aria-disabled="true"]:hover {
  background: transparent;
}

/* ===== Share-confirmation modal ===== */
.bc-modal {
  position: fixed; inset: 0;
  z-index: 9000;
  display: grid; place-items: center;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
.bc-modal[hidden] { display: none; }
.bc-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 8, 5, 0.65);
  backdrop-filter: blur(3px);
  cursor: pointer;
}
.bc-modal-card {
  position: relative;
  z-index: 1;
  width: min(640px, 92vw);
  padding: 7px;
  background: linear-gradient(180deg, #d4a64f 0%, #8a5f1d 50%, #c39036 100%);
  border-radius: 4px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 30px 60px rgba(0, 0, 0, 0.6),
    0 10px 30px rgba(0, 0, 0, 0.5);
  animation: bcModalIn 0.18s ease-out;
}
@keyframes bcModalIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.bc-modal-card::before {
  content: "";
  position: absolute; inset: 2px;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  pointer-events: none;
}
.bc-modal-card > * { position: relative; z-index: 1; }
.bc-modal-card {
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(232, 201, 122, 0.18), transparent 70%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(180, 130, 60, 0.12), transparent 70%),
    linear-gradient(180deg, #f7efde 0%, #ede1c2 100%);
}
.bc-modal-eyebrow {
  font-family: "Cinzel", serif;
  font-size: 1.3125rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(107, 71, 16, 0.95);
  text-align: center;
  padding: 32px 36px 8px;
}
.bc-modal-title {
  margin: 0;
  padding: 0 36px;
  font-family: "Cormorant Garamond", "Cinzel", serif;
  font-weight: 600;
  font-size: 2.75rem;
  letter-spacing: 0.02em;
  text-align: center;
  color: #1a1208;
}
.bc-modal-body {
  margin: 16px 0 0;
  padding: 0 36px;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.875rem;
  line-height: 1.4;
  text-align: center;
  color: rgba(26, 18, 8, 0.92);
}
.bc-modal-close {
  display: block;
  margin: 28px auto 32px;
  font-family: "Cinzel", serif;
  font-size: 1.375rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #1a1208;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.35);
  padding: 14px 36px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.bc-modal-close:hover { background: rgba(0, 0, 0, 0.06); }
.bc-modal-close:focus-visible { outline: 2px solid #1a1208; outline-offset: 2px; }

/* ── Sala instructions modal (reuses .bc-modal overlay + frame) ── */
.bc-help-card {
  position: relative;
  width: min(640px, 94vw);
  max-height: 84vh;
  overflow-y: auto;
  text-align: left;
  padding: 2rem 2.25rem 1.75rem;
  background-image: none;
  background: linear-gradient(180deg, #f7efde 0%, #ede1c2 100%);
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 120, 70, 0.5) transparent;
}
.bc-help-card::-webkit-scrollbar { width: 10px; }
.bc-help-card::-webkit-scrollbar-track { background: transparent; margin: 6px 0; }
.bc-help-card::-webkit-scrollbar-thumb {
  background: rgba(150, 120, 70, 0.45);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.bc-help-card::-webkit-scrollbar-thumb:hover {
  background: rgba(150, 120, 70, 0.7);
  background-clip: padding-box;
}
.bc-help-x {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: rgba(80, 60, 30, 0.6);
  cursor: pointer;
}
.bc-help-x:hover { color: #2a1f12; }
.bc-help-x:focus-visible { outline: 2px solid rgba(167, 132, 64, 0.85); outline-offset: 2px; }
.bc-help-eyebrow {
  font-family: "Cinzel", serif;
  font-size: 0.8125rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(122, 88, 30, 0.9);
  text-align: center;
}
.bc-help-title {
  font-family: "Cinzel", "Cormorant Garamond", serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: #241a0e;
  text-align: center;
  margin: 0.4rem 0 1.2rem;
}
.bc-help-card h4 {
  font-family: "Cinzel", serif;
  font-size: 0.9375rem;
  letter-spacing: 0.05em;
  color: #6b4710;
  margin: 1.5rem 0 0.4rem;
}
.bc-help-card p {
  font-family: "Cormorant Garamond", "EB Garamond", serif;
  font-size: 1.125rem;
  line-height: 1.6;
  color: rgba(42, 31, 18, 0.9);
  margin: 0 0 0.9rem;
}
.bc-help-card em { font-style: italic; }
.bc-help-closing {
  font-style: italic;
  text-align: center;
  color: rgba(122, 88, 30, 0.95) !important;
  margin-top: 1.4rem !important;
}
.bc-help-autotoggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: rgba(42, 31, 18, 0.65);
  cursor: pointer;
}
.bc-help-autotoggle input { cursor: pointer; }
.bc-help-card .bc-modal-close { display: block; margin: 1.25rem auto 0; }

.bc-stage {
  position: relative;
  background: #050403;
  aspect-ratio: 16 / 9;
  /* Always render at true 16:9. The width is the SMALLER of:
     - 100% of the player section's width (the player column is
       the binding constraint on narrow viewports), and
     - what would fit vertically at 16:9 after we reserve room
       for the chrome and the chat floor below (the height is the
       binding constraint on wide / short viewports — the prior
       `max-height` cap clipped the bottom of a too-tall 16:9 box,
       which stretched the box's effective ratio).
     The reserved height equals top-bar 56 + player-head ~68 +
     status-strip ~38 + 22rem chat floor (matches .bc-chat
     min-height, #264). aspect-ratio derives the height. */
  width: min(100%, calc((100vh - 56px - 68px - 38px - 22rem) * 16 / 9));
  margin-inline: auto;
  overflow: hidden;
}
.bc-stage iframe { width: 100%; height: 100%; border: 0; display: block; }

.bc-stage-overlay {
  position: absolute; inset: 0;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
}
.bc-overlay-tl { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.bc-overlay-tr { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.bc-live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(217, 64, 64, 0.92);
  color: #fff;
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  padding: 4px 10px;
  border-radius: 2px;
}
.bc-live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #fff;
  animation: bcPulse 1.6s infinite;
}
@keyframes bcPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.bc-standby-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(20, 17, 12, 0.85);
  color: var(--gold-soft);
  border: 1px solid var(--rule-2);
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  padding: 4px 10px;
  border-radius: 2px;
}
.bc-standby-pill span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--gold-soft);
}
.bc-overlay-title {
  background: rgba(20, 17, 12, 0.7);
  border: 1px solid var(--rule);
  color: #e9e2d4;
  padding: 4px 10px;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  border-radius: 2px;
  backdrop-filter: blur(6px);
}
.bc-rec-tag {
  background: rgba(20, 17, 12, 0.7);
  border: 1px solid var(--rule);
  color: rgba(232, 201, 122, 0.92);
  padding: 4px 10px;
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  border-radius: 2px;
  backdrop-filter: blur(6px);
}

/* ===== Standby ===== */
.bc-standby {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, #1a140d 0%, #0a0805 75%),
    #050403;
  overflow: hidden;
  display: grid; place-items: center;
}
.bc-standby-bg {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, rgba(255, 220, 170, 0.02) 0 2px, transparent 2px 8px);
  opacity: 0.7;
}
.bc-standby-rays {
  position: absolute;
  width: 250%; height: 250%;
  left: -75%; top: -75%;
  background: conic-gradient(from 0deg at 50% 50%,
    transparent 0deg,
    transparent 148deg,
    rgba(255, 230, 170, 0.10) 162deg,
    rgba(255, 240, 195, 0.28) 180deg,
    rgba(255, 230, 170, 0.10) 198deg,
    transparent 212deg,
    transparent 360deg);
  filter: blur(18px);
  pointer-events: none;
  transform-origin: 50% 50%;
  animation: bcLighthouse 14s linear infinite;
  will-change: transform;
}
@keyframes bcLighthouse {
  to { transform: rotate(360deg); }
}

.bc-standby-emblem {
  position: relative;
  width: clamp(140px, 26%, 240px);
  display: flex; flex-direction: column; align-items: center;
  z-index: 1;
}
.bc-standby-emblem-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  padding: 18px;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 35% 30%, rgba(232, 201, 122, 0.4), transparent 60%),
    radial-gradient(circle at 50% 50%, #f7efde, #d4b47a);
  border-radius: 50%;
  box-shadow:
    0 0 0 2px rgba(107, 71, 16, 0.55),
    0 0 0 6px rgba(107, 71, 16, 0.15),
    inset 0 0 16px rgba(107, 71, 16, 0.2),
    0 0 40px rgba(232, 201, 122, 0.25);
}
.bc-standby-card {
  position: absolute;
  bottom: 10%;
  left: 50%; transform: translateX(-50%);
  background: rgba(20, 17, 12, 0.78);
  border: 1px solid rgba(232, 201, 122, 0.25);
  padding: 10px 22px 12px 22px;
  text-align: center;
  min-width: 320px;
  backdrop-filter: blur(4px);
  border-radius: 2px;
  z-index: 2;
}
.bc-standby-card-eyebrow {
  font-size: 0.6875rem;
  letter-spacing: 0.32em;
  color: var(--gold-soft);
  font-weight: 700;
}
.bc-standby-card-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.0625rem;
  font-weight: 600;
  color: #f4ead3;
  margin-top: 2px;
}
.bc-standby-card-meta {
  font-size: 0.75rem;
  color: rgba(232, 201, 122, 0.8);
  letter-spacing: 0.04em;
  margin-top: 4px;
}
.bc-standby-card-bar {
  margin-top: 10px;
  height: 2px;
  background: rgba(232, 201, 122, 0.12);
  overflow: hidden;
}
.bc-standby-card-bar-fill {
  width: 30%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
  animation: standbyBar 2.2s linear infinite;
}
@keyframes standbyBar {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* ===== Status strip (replaces the old fake controls bar) ===== */
.bc-status-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(180deg, #19140e, #100c08);
  padding: 12px 14px;
  border-top: 1px solid var(--rule);
  font-family: "Cinzel", serif;
  font-size: 0.8125rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}
.bc-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.bc-status-strip.is-offline { color: rgba(232, 201, 122, 0.78); }
.bc-status-strip.is-offline .bc-status-dot {
  background: rgba(232, 201, 122, 0.4);
}
.bc-status-strip.is-live { color: #fff; }
.bc-status-strip.is-live .bc-status-dot {
  background: #d94040;
  box-shadow: 0 0 8px rgba(217, 64, 64, 0.7);
  animation: bcPulse 1.6s infinite;
}

/* ===== Chat ===== */
.bc-chat {
  flex: 1;
  /* Chat floor: at least 4 messages + chat-head + chat-input always
     visible (#264). Paired with the .bc-stage max-height cap. */
  min-height: 22rem;
  background: #0d0a07;
  border-top: 1px solid var(--rule);
  display: flex; flex-direction: column;
}
.bc-chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--rule);
  background: #110d09;
}
.bc-chat-tabs { display: flex; gap: 4px; }
.bc-chat-tab {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  color: rgba(232, 201, 122, 0.78);
  border: 1px solid transparent;
  border-radius: 2px;
  text-transform: uppercase;
  cursor: pointer;
}
.bc-chat-tab.is-active {
  color: var(--gold-soft);
  border-color: var(--rule-2);
  background: rgba(232, 201, 122, 0.06);
}
.bc-chat-tab:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 2px;
  color: var(--gold-soft);
}
.bc-chat-tab[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}
.bc-chat-count {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem;
  color: rgba(232, 201, 122, 0.85);
  letter-spacing: 0.08em;
}
.bc-chat-count-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 6px var(--ok);
}

.bc-chat-list {
  flex: 1; overflow: auto;
  padding: 10px 14px;
  display: flex; flex-direction: column; gap: 8px;
  background:
    repeating-linear-gradient(180deg, rgba(255, 220, 170, 0.015) 0 26px, transparent 26px 52px),
    #0d0a07;
  /* Thin gold scrollbar matching the page palette (#316 follow-up). */
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 201, 122, 0.4) transparent;
}
.bc-chat-list::-webkit-scrollbar { width: 8px; }
.bc-chat-list::-webkit-scrollbar-track {
  background: transparent;
  margin: 4px 0;
}
.bc-chat-list::-webkit-scrollbar-thumb {
  background: rgba(232, 201, 122, 0.35);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.bc-chat-list::-webkit-scrollbar-thumb:hover {
  background: rgba(232, 201, 122, 0.6);
  background-clip: padding-box;
}
.bc-chat-empty {
  font-style: italic;
  font-size: 0.875rem;
  color: rgba(232, 201, 122, 0.78);
  padding: 10px 0;
}

/* Closed-state notice (#316). Rendered into .bc-chat-list when the
   chat is gated off (video standby / DEV OFFLINE). Replaces the
   normal backlog and silences the input form via .is-disabled. */
.bc-chat-closed {
  margin: auto;
  padding: 2.5rem 1.5rem;
  text-align: center;
  max-width: 32rem;
  color: rgba(232, 201, 122, 0.85);
}
.bc-chat-closed-eyebrow {
  font-family: "Cinzel", serif;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(232, 201, 122, 0.92);
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed rgba(232, 201, 122, 0.25);
}
.bc-chat-closed-body {
  font-family: "Cormorant Garamond", "EB Garamond", serif;
  font-style: italic;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: rgba(232, 201, 122, 0.78);
}

/* When the form is disabled (closed chat), grey it out and prevent
   pointer events. The input is also `disabled` via the HTML
   attribute, but the form-level class lets us mute the send
   button + avatar visually too. */
.bc-chat-input.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}
.bc-chat-join {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8125rem;
  color: rgba(232, 201, 122, 0.78);
  letter-spacing: 0.04em;
  font-style: italic;
  animation: bcFade 0.4s ease;
}
.bc-chat-join-ic {
  width: 16px; height: 16px;
  display: grid; place-items: center;
  border: 1px solid var(--rule-2);
  border-radius: 50%;
  font-size: 0.625rem;
  color: var(--gold-soft);
  font-style: normal;
}
.bc-chat-join-who { color: #d8c897; font-style: normal; font-weight: 600; }
@keyframes bcFade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.bc-chat-msg {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  animation: bcFade 0.4s ease;
}
.bc-chat-av {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.6875rem; font-weight: 700;
  font-family: "Cinzel", serif;
  letter-spacing: 0.05em;
  color: #1a1208;
}
.bc-av-r { background: linear-gradient(180deg, #c84a3a, #7a2410); color: #fef0e0; }
.bc-av-g { background: linear-gradient(180deg, #6cb16a, #2f5e2d); color: #f0f7e8; }
.bc-av-b { background: linear-gradient(180deg, #4a78c8, #1f3a72); color: #e8f0fe; }
.bc-av-y { background: linear-gradient(180deg, #d8b04a, #8a5e1c); }
.bc-av-v { background: linear-gradient(180deg, #8a5cc8, #3d2570); color: #f3e8fe; }
.bc-av-self { background: linear-gradient(180deg, #2b2014, #0e0a05); color: var(--gold-soft); }

.bc-chat-msg-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.bc-chat-msg-who { font-size: 0.875rem; font-weight: 600; color: #f4ead3; }
.bc-chat-msg-when { font-size: 0.6875rem; color: rgba(232, 201, 122, 0.72); letter-spacing: 0.04em; }
.bc-chat-msg-text { font-size: 0.9375rem; line-height: 1.5; color: #e2d8c0; text-wrap: pretty; }
.bc-chat-msg-text.is-latin { font-style: italic; color: #ecd28a; }
.bc-chat-msg.is-system .bc-chat-msg-text { font-style: italic; color: rgba(232, 201, 122, 0.85); }

.bc-chat-input {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  /* Invariant across viewport sizes. There is no responsive
     override of this rule anywhere in this file. Top + sides 14,
     bottom 22 so the input field always shows clear breathing
     room from the viewport's bottom edge regardless of screen
     dimensions, comfortably above Beatriz's 15-18px floor.
     box-sizing: border-box is explicit so padding is part of the
     form's height calculation, not added on top. */
  padding: 14px 14px 22px;
  box-sizing: border-box;
  border-top: 1px solid var(--rule);
  background: #110d09;
  align-items: center;
}
.bc-chat-input-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(180deg, #2b2014, #0e0a05);
  display: grid; place-items: center;
  font-family: "Cinzel", serif;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  color: var(--gold-soft);
}
.bc-chat-input-field {
  background: #0a0805;
  border: 1px solid var(--rule-2);
  padding: 5px 8px 5px 10px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.bc-chat-input-field input {
  flex: 1;
  background: transparent;
  border: 0;
  color: #e9e2d4;
  font: inherit;
  font-size: 0.9375rem;
  padding: 5px 0;
  outline: none;
}
.bc-chat-input-field input::placeholder {
  color: rgba(232, 201, 122, 0.65);
  font-style: italic;
}
.bc-chat-input-actions {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.8125rem;
  color: rgba(232, 201, 122, 0.78);
  flex-shrink: 0;
}
.bc-chat-send {
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  background: rgba(232, 201, 122, 0.16);
  color: var(--gold-soft);
  padding: 5px 12px;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
}
.bc-chat-send:hover { background: rgba(232, 201, 122, 0.2); }
.bc-chat-send:focus-visible { outline: 1px solid var(--gold-soft); outline-offset: 2px; }

/* ===== Right rail ===== */
.bc-rail {
  width: 25%;
  min-width: 280px;
  max-width: 460px;
  flex-shrink: 0;
  background: #100c08;
  border-left: 1px solid var(--rule);
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
  overflow: auto;
  /* Same thin gold scrollbar as the chat list. */
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 201, 122, 0.4) transparent;
}
.bc-rail::-webkit-scrollbar { width: 8px; }
.bc-rail::-webkit-scrollbar-track { background: transparent; margin: 4px 0; }
.bc-rail::-webkit-scrollbar-thumb {
  background: rgba(232, 201, 122, 0.35);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.bc-rail::-webkit-scrollbar-thumb:hover {
  background: rgba(232, 201, 122, 0.6);
  background-clip: padding-box;
}

/* Participant closed-state notice (#316 follow-up) — mirrors the
   chat closed notice, shown in the rail when video is off. */
.bc-part-closed {
  padding: 1.5rem 1rem;
  text-align: center;
  color: rgba(232, 201, 122, 0.78);
}
.bc-part-closed-body {
  font-family: "Cormorant Garamond", "EB Garamond", serif;
  font-style: italic;
  font-size: 1rem;
  line-height: 1.5;
  color: rgba(232, 201, 122, 0.72);
}

/* ===== Poll (votazione del Concilio) =====
   A modal (reuses .bc-modal overlay + frame) opened by sala-poll.js when
   the stream goes OFFLINE after being live (staging). Dark interior set
   inside the gold .bc-modal-card frame; the two readings get a gold
   (Flaminia) and a steel (Ciro) accent that carries through the option
   marks, the donut and the legend. */

/* The hidden attribute MUST win over the display:flex declarations on the
   inner views. Without this, sala-poll.js setting `.hidden = true` is
   silently ignored — an author `display` rule beats the UA
   `[hidden] { display:none }` — so a stale view (results/locked) would
   stay visible over the active one. (The .bc-modal overlay itself is
   already covered by the global `.bc-modal[hidden]` rule.) */
.bc-poll-vote[hidden],
.bc-poll-results[hidden],
.bc-poll-locked[hidden] { display: none !important; }

.bc-poll-modal { --poll-flaminia: var(--gold-soft); --poll-ciro: #8aa0ad; }

/* Override the parchment .bc-modal-card with a dark interior; keep the
   gold frame (the card's padding + gradient) around it. */
.bc-modal-card.bc-poll-card {
  width: min(620px, 94vw);
  max-height: 88vh;
  padding: 6px;
  background-image: none;
  background: linear-gradient(180deg, #d4a64f 0%, #8a5f1d 50%, #c39036 100%);
  overflow: hidden;
}
.bc-poll-close {
  position: absolute;
  top: 10px; right: 12px;
  z-index: 3;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: rgba(10, 8, 5, 0.35);
  border: 1px solid rgba(232, 201, 122, 0.45);
  border-radius: 50%;
  color: var(--gold-soft);
  font-size: 1.25rem; line-height: 1;
  cursor: pointer;
}
.bc-poll-close:hover { background: rgba(10, 8, 5, 0.55); }
.bc-poll-close:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 2px; }

.bc-poll-inner {
  background:
    radial-gradient(ellipse 90% 55% at 50% 0%, rgba(232, 201, 122, 0.10), transparent 70%),
    #15110c;
  border-radius: 3px;
  margin: 0;
  padding: 2.25rem 1.75rem;
  max-height: calc(88vh - 12px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 201, 122, 0.4) transparent;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.bc-poll-eyebrow {
  font-family: "Cinzel", serif;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(232, 201, 122, 0.92);
  text-align: center;
}
.bc-poll-title {
  font-family: "Cormorant Garamond", "EB Garamond", serif;
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.35;
  color: #f1e7cf;
  text-align: center;
  margin: 0;
  padding-bottom: 1rem;
  border-bottom: 1px dashed rgba(232, 201, 122, 0.25);
}

.bc-poll-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.bc-poll-option {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  padding: 1rem 1.1rem;
  background: rgba(255, 220, 170, 0.03);
  border: 1px solid var(--rule-2);
  border-radius: 4px;
  color: #e9e2d4;
  font-family: "Cormorant Garamond", "EB Garamond", serif;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.bc-poll-option:hover { background: rgba(255, 220, 170, 0.06); }
.bc-poll-option:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 2px;
}
.bc-poll-option-mark {
  flex: 0 0 auto;
  width: 1.15rem; height: 1.15rem;
  margin-top: 0.1rem;
  border-radius: 50%;
  border: 2px solid rgba(232, 201, 122, 0.55);
  background: rgba(0, 0, 0, 0.18);
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.bc-poll-option-text {
  font-size: 1.0625rem;
  line-height: 1.4;
}
.bc-poll-option.is-selected {
  border-color: var(--gold);
  background: rgba(232, 201, 122, 0.09);
}
/* Selected: the circle fills solid gold and shows a dark checkmark, so
   the chosen option is unmistakable (not just a tinted ring). */
.bc-poll-option.is-selected .bc-poll-option-mark {
  border-color: var(--gold-soft);
  background: var(--gold-soft);
}
.bc-poll-option.is-selected .bc-poll-option-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 46%;
  width: 0.28rem;
  height: 0.55rem;
  transform: translate(-50%, -50%) rotate(45deg);
  border: solid #1a1208;
  border-width: 0 0.14rem 0.14rem 0;
}

.bc-poll-submit {
  align-self: center;
  margin: 1.5rem 0 0.75rem;
  padding: 0.85rem 2.5rem;
  font-family: "Cinzel", serif;
  font-size: 0.875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #1a1208;
  background: linear-gradient(180deg, #d4a64f 0%, #b6862c 100%);
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s ease;
}
.bc-poll-submit:hover:not(:disabled) { filter: brightness(1.08); }
.bc-poll-submit:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 2px;
}
.bc-poll-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.bc-poll-hint {
  font-family: "Cormorant Garamond", "EB Garamond", serif;
  font-style: italic;
  font-size: 0.9375rem;
  color: rgba(232, 201, 122, 0.7);
  text-align: center;
  margin: 0;
}
.bc-poll-locked { display: flex; flex-direction: column; gap: 1rem; align-items: center; }

/* ── Results ── */
.bc-poll-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}
/* The shared vote chart (css/vote-chart.css + js/vote-chart.js) already
   defaults to the dark theme used here; just nudge the gold accents to
   match the Sala palette. */
.bc-poll-results .vote-chart { color: #e9e2d4; }
.bc-poll-results .vote-legend-yours,
.bc-poll-results .vote-legend-pct { color: var(--gold-soft); }
.bc-poll-results-note {
  font-family: "Cormorant Garamond", "EB Garamond", serif;
  font-style: italic;
  font-size: 1rem;
  color: rgba(232, 201, 122, 0.78);
  text-align: center;
  margin: 0;
}
.bc-poll-results-note:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 3px;
}

.bc-card {
  background: #15110c;
  border: 1px solid var(--rule);
  border-radius: 3px;
}
.bc-card-head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: "Cinzel", serif;
  font-size: 0.8125rem;
  letter-spacing: 0.18em;
  color: var(--gold-soft);
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, rgba(232, 201, 122, 0.05), transparent);
  text-transform: uppercase;
}
.bc-card-sub {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0;
  color: rgba(232, 201, 122, 0.78);
  font-weight: 400;
}
.bc-card-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 9px; }

.bc-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.875rem;
}
.bc-row-k { color: rgba(232, 201, 122, 0.78); letter-spacing: 0.04em; }
.bc-row-v { font-weight: 600; }
.bc-row-v.ok { color: var(--ok); }
.bc-row-v.warn { color: var(--warn); }

.bc-field { display: flex; flex-direction: column; gap: 3px; }
.bc-field label {
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  color: rgba(232, 201, 122, 0.78);
  text-transform: uppercase;
}
.bc-input {
  font-size: 0.875rem;
  background: #0a0805;
  border: 1px solid var(--rule-2);
  padding: 6px 8px;
  border-radius: 3px;
  color: #e9e2d4;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.bc-input-mini { font-size: 0.8125rem; padding: 5px 8px; }

.bc-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.bc-meters { display: flex; flex-direction: column; gap: 5px; margin-top: 2px; }
.bc-meter {
  display: grid;
  grid-template-columns: 36px 1fr 28px;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6875rem;
}
.bc-meter-lbl { color: rgba(232, 201, 122, 0.85); letter-spacing: 0.06em; }
.bc-meter-track { height: 4px; background: #0a0805; border: 1px solid var(--rule); overflow: hidden; }
.bc-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #4d8a3e 0%, #d8b04a 70%, #c84a3a 100%);
  transition: width 0.4s;
}
.bc-meter-fill.is-net { background: linear-gradient(90deg, var(--gold-2), var(--gold-soft)); }
.bc-meter-val { color: #d8c897; text-align: right; }

.bc-part-list { display: flex; flex-direction: column; gap: 6px; }
.bc-part {
  display: grid;
  grid-template-columns: 22px 1fr 22px;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px dashed var(--rule);
}
.bc-part:last-child { border-bottom: 0; }
.bc-part-num { font-family: "JetBrains Mono", monospace; font-size: 0.6875rem; color: rgba(232, 201, 122, 0.7); }
.bc-part-info { min-width: 0; }
.bc-part-name { font-size: 0.875rem; color: #e9e2d4; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-part-meta {
  display: flex; gap: 6px; align-items: center;
  font-size: 0.6875rem;
  color: rgba(232, 201, 122, 0.75);
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.bc-part-state.bc-state-online { color: var(--ok); }
.bc-part-state.bc-state-away   { color: var(--warn); }
.bc-part-mic {
  font-size: 0.875rem;
  text-align: center;
  color: var(--gold-soft);
  user-select: none;
}
.bc-part-mic.muted { color: rgba(232, 201, 122, 0.55); }

/* ===== Responsive guards (desktop-only via gate, but graceful) ===== */
@media (max-width: 1100px) {
  .bc-rail { min-width: 260px; }
}
@media (max-width: 900px) {
  .bc-rail { min-width: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  /* Suppress every named animation in the workstation. Pulses, fades,
     modal entry, the lighthouse cone, the standby bar, message join
     transitions — all replaced with their resting state. */
  .bc-standby-rays,
  .bc-standby-card-bar-fill,
  .bc-live-dot,
  .bc-status-strip.is-live .bc-status-dot,
  .bc-modal-card,
  .bc-chat-join,
  .bc-chat-msg { animation: none; }
}

/* ═══════════════════════════════════════════════
   Bigliettini — private prelate replies (#156, S5)
   ═══════════════════════════════════════════════ */
.bc-chat-msg.is-private {
  background: linear-gradient(180deg, rgba(246, 239, 224, 0.96) 0%, rgba(237, 226, 201, 0.94) 100%);
  /* Burgundy left border thicker than before so the bigliettino
     reads as visually "framed" against the dark chat surface. */
  border-left: 4px solid #5a1212;
  margin: 12px -8px 12px -8px;
  padding: 12px 14px 14px;
  border-radius: 2px;
  position: relative;
  /* Subtle outer shadow + inner glow gives the parchment a "lifted
     from the page" feel that distinguishes it more sharply from
     the flat dark chat bubbles around it. */
  box-shadow:
    0 1px 0 rgba(90, 18, 18, 0.45),
    0 6px 14px rgba(0, 0, 0, 0.4),
    inset 0 0 30px rgba(180, 130, 60, 0.07);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.bc-chat-msg.is-private.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.bc-chat-msg.is-private .bc-chat-av {
  background: linear-gradient(180deg, #5a1212 0%, #2a0808 100%);
  color: #f0e4cc;
  /* Burgundy gradient avatar so the visual language of "this
     prelate is writing privately, sealed in red wax" lands at a
     glance. */
}

.bc-chat-msg.is-private .bc-chat-msg-who {
  color: #5a1212;
  font-weight: 700;
  letter-spacing: 0.04em;
  /* Bumped from inherited 0.875rem so the prelate's name meets
     the project's 1rem accessibility floor inside the bigliettino. */
  font-size: 1rem;
}

.bc-chat-msg.is-private .bc-chat-msg-when {
  color: rgba(90, 18, 18, 0.78);
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: none;
  /* Bumped from inherited 0.6875rem. The timestamp/"In privato a"
     line stays slightly smaller than the body but is now legible
     at typical reading distance. */
  font-size: 0.9375rem;
}

.bc-private-text {
  /* Burgundy ink instead of plain dark — echoes the wax seal and
     reads as "a hand-written private note" rather than another
     dark message in disguise. The colour also distinguishes this
     text from the bc-chat-msg-who line above without competing. */
  color: #5a1212 !important;
  font-style: italic;
  font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  font-size: 1rem !important;
  line-height: 1.6 !important;
  font-weight: 500;
}

.bc-private-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Cinzel", serif;
  /* 1rem floor for the header — uppercase Cinzel at 0.8125rem
     was readable but tight; 0.9375rem keeps it on one line in
     the chat lane while clearing the accessibility minimum. */
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #5a1212;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(90, 18, 18, 0.35);
}

.bc-private-sigillum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Slightly larger wax-seal icon. */
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

@media (prefers-reduced-motion: reduce) {
  .bc-chat-msg.is-private {
    transition: none;
    opacity: 1;
    transform: none;
  }
}
