:root {
  --bg-deepest: #060608;
  --bg-primary: #0d0d14;
  --bg-elevated: #12121f;
  --bg-card: #16162a;
  --bg-card-strong: #1b1b31;
  --gold-700: #b08928;
  --gold-500: #c8963e;
  --gold-400: #d4a84e;
  --gold-300: #e2bc60;
  --gold-100: #f5e6c8;
  --text-primary: #f0f0f5;
  --text-secondary: #a8b0c0;
  --text-muted: #737b8c;
  --green: #53d6a2;
  --amber: #f2b84b;
  --red: #ef7272;
  --blue: #72a7ef;
  --border: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(200, 150, 62, 0.36);
  --font-display: "Bebas Neue", "Impact", sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-lg: 0 18px 60px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text-primary);
  background: var(--bg-deepest);
  font-family: var(--font-body);
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold-300);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 5%, rgba(200, 150, 62, 0.16), transparent 32%),
    radial-gradient(circle at 88% 100%, rgba(180, 120, 30, 0.1), transparent 34%);
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: var(--gold-400);
  font-family: var(--font-display);
  font-size: clamp(0.72rem, 1.1vw, 0.9rem);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

/* Public live board */
.public-page {
  height: 100dvh;
  overflow: hidden;
}

.live-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(0.7rem, 1.7vh, 1.25rem);
  width: min(100%, 1800px);
  height: 100dvh;
  margin: 0 auto;
  padding: clamp(0.8rem, 2vw, 1.75rem);
}

.live-header,
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand,
.admin-brand {
  display: flex;
  align-items: center;
  gap: clamp(0.7rem, 1.4vw, 1.1rem);
}

.brand__logo {
  width: clamp(42px, 4.4vw, 66px);
  height: clamp(42px, 4.4vw, 66px);
  object-fit: contain;
}

.brand h1,
.admin-toolbar h1,
.login-card h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.2vw, 3rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.025em;
  color: var(--gold-100);
}

.header-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.65rem, 1.6vw, 1.5rem);
}

.viewer-count,
.connection {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.3rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  background: rgba(18, 18, 31, 0.74);
  white-space: nowrap;
}

.viewer-count strong {
  color: var(--text-primary);
  font-size: 1.05rem;
}

.viewer-count__icon {
  display: grid;
  width: 18px;
  height: 18px;
  color: var(--gold-400);
}

.viewer-count__icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.event-clock {
  min-width: 7.5ch;
  color: var(--gold-300);
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.2vw, 1.8rem);
  letter-spacing: 0.08em;
  text-align: center;
}

.connection {
  font-size: 0.82rem;
}

.connection__dot,
.status-pill__dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--amber);
}

.connection.is-online .connection__dot {
  background: var(--green);
  box-shadow: 0 0 12px rgba(83, 214, 162, 0.65);
}

.connection.is-offline .connection__dot {
  background: var(--red);
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 34px;
  padding: 0.35rem 0.62rem;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.sound-toggle:hover,
.sound-toggle:focus-visible {
  color: var(--gold-200);
  border-color: var(--border-gold);
  background: var(--gold-subtle);
}

.sound-toggle.is-enabled {
  color: var(--green);
  border-color: rgba(83, 214, 162, 0.45);
  background: rgba(83, 214, 162, 0.1);
}

.sound-toggle__icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sound-toggle__icon--on {
  display: none;
}

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 34px;
  padding: 0.35rem 0.62rem;
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  color: var(--gold-200);
  background: var(--gold-subtle);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.home-link:hover,
.home-link:focus-visible {
  color: var(--text-primary);
  border-color: var(--gold-300);
  background: rgba(200, 150, 62, 0.24);
}

.home-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sound-toggle.is-enabled .sound-toggle__icon--off {
  display: none;
}

.sound-toggle.is-enabled .sound-toggle__icon--on {
  display: block;
}

.venue-card--changed {
  animation: venue-card-flash 6.5s ease-in-out 1;
}

.venue-card__header-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex: 0 0 auto;
}

.venue-card__update-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(242, 190, 73, 0.72);
  border-radius: 999px;
  color: var(--gold-100);
  background: rgba(242, 190, 73, 0.2);
  box-shadow: 0 0 16px rgba(242, 190, 73, 0.24);
  font-size: clamp(0.62rem, 0.82vw, 0.74rem);
  font-weight: 800;
  letter-spacing: 0.045em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  animation: update-badge-pulse 6.5s ease-in-out 1;
}

.venue-card__update-badge svg {
  width: 0.9rem;
  height: 0.9rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

@keyframes venue-card-flash {
  0%, 100% {
    filter: brightness(1);
    box-shadow: 0 0 0 0 rgba(242, 190, 73, 0);
    transform: translateZ(0);
  }
  12%, 36%, 60% {
    filter: brightness(1.58);
    box-shadow: 0 0 0 3px rgba(242, 190, 73, 0.82), 0 0 28px rgba(242, 190, 73, 0.48);
    transform: translateZ(0);
  }
  24%, 48%, 72% {
    filter: brightness(1.08);
    box-shadow: 0 0 0 1px rgba(242, 190, 73, 0.32), 0 0 8px rgba(242, 190, 73, 0.18);
    transform: translateZ(0);
  }
}

@keyframes update-badge-pulse {
  0%, 100% { opacity: 0.72; transform: scale(1); }
  12%, 36%, 60% { opacity: 1; transform: scale(1.06); }
  24%, 48%, 72% { opacity: 0.82; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .venue-card--changed {
    animation: none;
    outline: 2px solid var(--gold-300);
    outline-offset: 3px;
  }

  .venue-card__update-badge {
    animation: none;
  }
}

.venue-grid {
  display: grid;
  grid-template-columns: repeat(var(--columns, 3), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows, 1), minmax(0, 1fr));
  gap: clamp(0.65rem, 1.4vw, 1.2rem);
  min-height: 0;
}

.loading-card {
  display: grid;
  place-content: center;
  justify-items: center;
  grid-column: 1 / -1;
  gap: 1rem;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: rgba(22, 22, 42, 0.7);
}

.publication-card {
  display: grid;
  align-content: center;
  justify-items: center;
  grid-column: 1 / -1;
  min-height: 0;
  padding: clamp(1.5rem, 5vw, 4rem);
  overflow: hidden;
  color: var(--text-secondary);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 50% 0%, rgba(200, 150, 62, 0.16), transparent 58%),
    rgba(22, 22, 42, 0.86);
  text-align: center;
}

.publication-card__label {
  margin-bottom: 0.8rem;
  color: var(--gold-400);
  font-size: clamp(0.68rem, 1vw, 0.78rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.publication-card h2 {
  max-width: 780px;
  margin: 0;
  color: var(--gold-100);
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4.8rem);
  font-weight: 400;
  line-height: 1;
}

.publication-card p {
  max-width: 680px;
  margin: 1rem 0 0;
  font-size: clamp(0.9rem, 1.5vw, 1.08rem);
  line-height: 1.65;
}

.loading-card__mark {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(200, 150, 62, 0.2);
  border-top-color: var(--gold-400);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.venue-card {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  background: linear-gradient(155deg, rgba(28, 28, 53, 0.97), rgba(14, 14, 25, 0.98));
  box-shadow: var(--shadow-lg);
}

.venue-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--status-color, var(--gold-400)), transparent);
}

.venue-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: clamp(0.9rem, 2vh, 1.4rem) clamp(0.9rem, 1.5vw, 1.4rem) 0;
}

.venue-card__name {
  margin: 0;
  overflow: hidden;
  color: var(--gold-100);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.3vw, 2.15rem);
  font-weight: 400;
  letter-spacing: 0.035em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.venue-card__location {
  margin: 0.28rem 0 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: clamp(0.72rem, 1vw, 0.88rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  flex: 0 0 auto;
  padding: 0.35rem 0.58rem;
  border: 1px solid color-mix(in srgb, var(--status-color) 42%, transparent);
  border-radius: 999px;
  color: var(--status-color);
  background: color-mix(in srgb, var(--status-color) 10%, transparent);
  font-size: clamp(0.68rem, 0.9vw, 0.8rem);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.status-pill__dot {
  background: currentColor;
}

.venue-card[data-status="live"] { --status-color: var(--green); }
.venue-card[data-status="paused"] { --status-color: var(--amber); }
.venue-card[data-status="delayed"] { --status-color: var(--red); }
.venue-card[data-status="completed"] { --status-color: var(--blue); }
.venue-card[data-status="scheduled"] { --status-color: var(--gold-400); }

.venue-card__programme {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding: clamp(0.8rem, 2.1vh, 1.6rem) clamp(0.9rem, 1.5vw, 1.4rem);
}

.programme-label,
.next-label,
.progress-label {
  color: var(--text-muted);
  font-size: clamp(0.66rem, 0.85vw, 0.76rem);
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.programme-title {
  margin: 0.42rem 0 0;
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 4.2rem);
  font-weight: 400;
  letter-spacing: 0.015em;
  line-height: 0.95;
}

.programme-category {
  margin: 0.45rem 0 0;
  color: var(--gold-300);
  font-size: clamp(0.9rem, 1.3vw, 1.12rem);
  font-weight: 600;
}

.programme-time {
  margin: 0.35rem 0 0;
  color: var(--text-secondary);
  font-size: clamp(0.75rem, 1vw, 0.9rem);
}

.participant-progress {
  padding: 0 clamp(0.9rem, 1.5vw, 1.4rem) clamp(0.8rem, 1.8vh, 1.3rem);
}

.progress-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.progress-value {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  letter-spacing: 0.04em;
}

.progress-track {
  height: clamp(8px, 1.2vh, 12px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(3, 3, 8, 0.7);
}

.progress-fill {
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-700), var(--gold-300));
  transition: width 350ms ease;
}

.no-counter {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.venue-card__next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-width: 0;
  padding: clamp(0.75rem, 1.6vh, 1rem) clamp(0.9rem, 1.5vw, 1.4rem);
  border-top: 1px solid var(--border);
  background: rgba(4, 4, 10, 0.32);
}

.next-copy {
  min-width: 0;
}

.next-programme {
  margin: 0.12rem 0 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: clamp(0.78rem, 1.1vw, 0.95rem);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-schedule {
  margin: 0.3rem 0 0;
  color: var(--gold-300);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.last-updated {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: clamp(0.67rem, 0.85vw, 0.77rem);
  white-space: nowrap;
}

.live-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 1.2rem;
  color: var(--text-muted);
  font-size: clamp(0.68rem, 0.9vw, 0.82rem);
}

.page-indicator {
  color: var(--gold-400);
  font-weight: 700;
}

.noscript {
  position: fixed;
  inset: 1rem;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 2rem;
  color: white;
  background: #111;
}

/* Admin */
.admin-page {
  min-height: 100dvh;
  background: var(--bg-deepest);
}

.admin-shell {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, 1180px);
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

.admin-header {
  min-height: 64px;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-gold);
}

.admin-brand {
  color: var(--text-primary);
  text-decoration: none;
}

.admin-brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.admin-brand span {
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 0.95;
  letter-spacing: 0.035em;
}

.admin-brand small {
  display: block;
  margin-bottom: 0.22rem;
  color: var(--gold-400);
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.admin-account {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--text-secondary);
}

.login-panel {
  display: grid;
  min-height: calc(100dvh - 90px);
  place-items: center;
  padding: 2rem 0;
}

.login-card {
  width: min(100%, 420px);
  padding: clamp(1.4rem, 5vw, 2.4rem);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  background: rgba(22, 22, 42, 0.95);
  box-shadow: var(--shadow-lg);
}

.login-card__intro {
  margin: 0.7rem 0 1.5rem;
  color: var(--text-secondary);
}

.field {
  display: grid;
  gap: 0.38rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
}

.field input,
.field textarea,
.programme-select {
  width: 100%;
  min-height: 44px;
  padding: 0 0.8rem;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
}

.field input:hover,
.field textarea:hover,
.programme-select:hover {
  border-color: var(--border-gold);
}

.button {
  min-height: 42px;
  padding: 0.65rem 1rem;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  font-weight: 700;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.button:hover:not(:disabled) {
  border-color: var(--border-gold);
  background: var(--bg-card-strong);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button--gold {
  color: #15100a;
  border-color: var(--gold-300);
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
}

.button--gold:hover:not(:disabled) {
  color: #090704;
  background: linear-gradient(135deg, var(--gold-100), var(--gold-400));
}

.button--danger {
  color: #ffc4c4;
  border-color: rgba(239, 114, 114, 0.35);
  background: rgba(239, 114, 114, 0.1);
}

.button--quiet {
  color: var(--text-secondary);
  background: transparent;
}

.button--small {
  min-height: 36px;
  padding: 0.45rem 0.72rem;
  font-size: 0.82rem;
}

.button--full {
  width: 100%;
}

.form-message {
  min-height: 1.3em;
  margin: 0.8rem 0 0;
  color: #ffb1b1;
  font-size: 0.87rem;
}

.admin-workspace {
  padding-top: 1.5rem;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.admin-venues {
  display: grid;
  gap: 1.2rem;
}

.venue-selector {
  display: grid;
  gap: 0.4rem;
  max-width: 520px;
  margin-bottom: 1.2rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.venue-selector select {
  min-height: 48px;
  padding: 0 0.9rem;
  color: var(--text-primary);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  font: 600 1rem var(--font-body);
}

.venue-selector select:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

.audit-control {
  margin: 2.5rem 0 0;
  padding: 1.2rem;
  border-top: 1px solid var(--border);
}

.audit-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.audit-intro { color: var(--text-secondary); }
.audit-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.audit-list { overflow: auto; margin-top: 1rem; }
.audit-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 0.82rem; }
.audit-table th, .audit-table td { padding: 0.55rem 0.65rem; border-bottom: 1px solid var(--border-subtle); text-align: left; vertical-align: top; }
.audit-table th { color: var(--text-secondary); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
.audit-table td { color: var(--text-primary); }
.audit-table td:nth-child(1), .audit-table td:nth-child(3) { white-space: nowrap; color: var(--text-muted); }

.chart-change-dialog { position: fixed; width: min(560px, calc(100% - 2rem)); max-width: none; max-height: min(80dvh, 620px); margin: auto; padding: clamp(1.3rem, 4vw, 2rem); overflow: auto; border: 1px solid var(--gold-300); border-radius: var(--radius-xl); color: var(--text-primary); background: linear-gradient(145deg, #202039, #0e0e18 75%); box-shadow: 0 24px 90px rgba(0,0,0,.72); }
.chart-change-dialog::backdrop { background: rgba(3,3,9,.78); backdrop-filter: blur(5px); }
.chart-change-dialog__mark { display: grid; width: 48px; height: 48px; margin-bottom: .8rem; place-items: center; border-radius: 50%; color: #17130b; background: var(--gold-300); font: 2rem/1 var(--font-display); }
.chart-change-dialog h2 { margin: .3rem 0 .8rem; color: var(--gold-100); font: 2rem/1.05 var(--font-display); }
.chart-change-dialog__venue { margin: 0; font-weight: 700; }
.chart-change-dialog ul { display: grid; gap: .55rem; margin: .8rem 0 1.2rem; padding: 0; list-style: none; }
.chart-change-dialog li { padding: .75rem .85rem; border-left: 3px solid var(--gold-300); border-radius: var(--radius-sm); background: rgba(211,166,76,.12); }

.live-alert-dialog { width: min(760px, calc(100% - 2rem)); padding: clamp(1.5rem, 5vw, 3rem); border-width: 2px; }
.live-alert-dialog h2 { padding-right: 1.5rem; font-size: clamp(2rem, 5vw, 3rem); }
.live-alert-dialog__close { position: absolute; top: .75rem; right: .75rem; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--border-gold); border-radius: 50%; color: var(--gold-100); background: #171725; font-size: 1.8rem; cursor: pointer; }
.live-alert-dialog__close:hover { background: #2a2837; }
.live-alert-dialog__message { margin: 1rem 0 1.5rem; font-size: clamp(1.2rem, 3vw, 1.65rem); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.live-alert-dialog__message + .live-alert-dialog__message { padding-top: 1rem; border-top: 1px solid var(--border-gold); }
.live-alert-dialog__message a { color: var(--gold-100); text-decoration: underline; text-underline-offset: .2em; }
.live-alert-dialog__message a:hover { color: var(--gold-300); }
#liveAlertMessage { min-height: 110px; padding: .8rem; resize: vertical; font: inherit; font-weight: 400; }

.admin-venue {
  overflow: hidden;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  background: rgba(22, 22, 42, 0.96);
  box-shadow: var(--shadow-lg);
}

.admin-venue__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.admin-venue__top h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  color: var(--gold-100);
}

.admin-venue__top p {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.admin-venue__body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 1.25rem;
  padding: 1.25rem;
}

.admin-current {
  display: grid;
  align-content: start;
  gap: 1rem;
  min-width: 0;
}

.admin-programme-name {
  margin: 0.25rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 0.95;
}

.admin-programme-category {
  margin: 0.4rem 0 0;
  color: var(--gold-300);
}

.counter-control {
  display: grid;
  grid-template-columns: 54px minmax(100px, 1fr) 54px;
  gap: 0.6rem;
  align-items: stretch;
}

.counter-button {
  min-height: 58px;
  padding: 0;
  font-size: 1.55rem;
}

.counter-display {
  display: grid;
  place-items: center;
  min-height: 58px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.04em;
}

.admin-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.admin-controls .button {
  min-height: 50px;
}

.programme-picker {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(8, 8, 14, 0.42);
}

.programme-picker h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0.035em;
}

.total-editor {
  display: grid;
  gap: 0.6rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(22, 22, 42, 0.58);
}

.total-editor small {
  display: block;
  margin-top: 0.18rem;
  color: var(--text-muted);
}

.total-editor__controls {
  display: grid;
  grid-template-columns: 42px minmax(70px, 1fr) 42px minmax(90px, auto);
  gap: 0.45rem;
}

.total-editor__step {
  min-height: 44px;
  padding: 0;
  font-size: 1.25rem;
}

.total-editor__input {
  width: 100%;
  min-width: 0;
  padding: 0 0.5rem;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  font-family: var(--font-display);
  font-size: 1.35rem;
  text-align: center;
}

/* Program chart administrator */
.chart-workspace {
  padding-top: 1.5rem;
}

.publication-control {
  --publication-color: var(--amber);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.2rem;
  padding: clamp(1.1rem, 2.5vw, 1.5rem);
  border: 1px solid color-mix(in srgb, var(--publication-color) 42%, transparent);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, color-mix(in srgb, var(--publication-color) 9%, var(--bg-card)), rgba(13, 13, 20, 0.92));
  box-shadow: var(--shadow-md);
  transition: border-color 180ms ease, background 180ms ease;
}

.publication-control[data-state="published"] {
  --publication-color: var(--green);
}

.publication-control__copy {
  max-width: 690px;
}

.publication-control__status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--publication-color);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.publication-control__status::before {
  width: 8px;
  height: 8px;
  content: "";
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px color-mix(in srgb, currentColor 55%, transparent);
}

.publication-control h2 {
  margin: 0.28rem 0 0.35rem;
  color: var(--gold-100);
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 400;
}

.publication-control__copy > p {
  margin: 0;
  color: var(--text-secondary);
}

.publication-control__message {
  min-height: 1.3em;
  margin-top: 0.55rem !important;
  color: var(--publication-color) !important;
  font-size: 0.82rem;
  font-weight: 600;
}

.publication-switch {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 0.5rem;
  cursor: pointer;
}

.publication-switch__label {
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
}

.publication-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.publication-switch__track {
  position: relative;
  width: 68px;
  height: 38px;
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  background: var(--bg-deepest);
  transition: border-color 180ms ease, background 180ms ease;
}

.publication-switch__thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  transition: transform 180ms ease, background 180ms ease;
}

.publication-switch input:checked + .publication-switch__track {
  border-color: var(--green);
  background: rgba(83, 214, 162, 0.2);
}

.publication-switch input:checked + .publication-switch__track .publication-switch__thumb {
  background: var(--green);
  transform: translateX(30px);
}

.publication-switch input:focus-visible + .publication-switch__track {
  outline: 3px solid color-mix(in srgb, var(--gold-300) 45%, transparent);
  outline-offset: 4px;
}

.publication-switch input:disabled + .publication-switch__track {
  cursor: wait;
  opacity: 0.55;
}

.announcement-control {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.2rem;
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  background: rgba(22, 22, 42, 0.9);
}

.announcement-control__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.announcement-control__heading h2 {
  margin: 0.15rem 0 0;
  color: var(--gold-100);
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 400;
}

.announcement-control__heading > p {
  max-width: 34rem;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.announcement-list {
  display: grid;
  gap: 0.55rem;
}

.announcement-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px auto auto;
  gap: 0.55rem;
  align-items: center;
}

.announcement-row input[type="text"],
.announcement-row select {
  min-height: 42px;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  background: rgba(5, 5, 12, 0.72);
  font: inherit;
}

.announcement-row__active {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  white-space: nowrap;
}

.announcement-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.state-reset-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  margin: 0 0 1.2rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(22, 22, 42, 0.68);
}

.state-reset-control h2 {
  margin: 0.2rem 0 0.35rem;
  color: var(--gold-100);
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 400;
}

.state-reset-control p:not(.eyebrow) {
  max-width: 52rem;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.state-reset-control__message:empty { display: none; }
.state-reset-control__message:not(:empty) { margin-top: 0.45rem !important; color: var(--gold-300) !important; }

@media (max-width: 767px) {
  .announcement-control__heading { align-items: flex-start; flex-direction: column; }
  .announcement-row { grid-template-columns: minmax(0, 1fr) auto; }
  .announcement-row__level { grid-column: 1; }
  .announcement-row__active { grid-column: 2; grid-row: 2; }
  .announcement-row__remove { grid-column: 1 / -1; justify-self: start; }
  .state-reset-control { align-items: flex-start; flex-direction: column; }
}

.chart-summary {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}

.chart-summary__event,
.chart-summary__stat {
  display: grid;
  align-content: center;
  min-height: 105px;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(22, 22, 42, 0.88);
}

.chart-summary__event strong {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-summary__event small,
.chart-summary__stat span {
  color: var(--text-muted);
}

.chart-summary__stat {
  justify-items: center;
  text-align: center;
}

.chart-summary__stat strong {
  color: var(--gold-300);
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 400;
  line-height: 1;
}

.chart-upload-card {
  display: grid;
  gap: 1rem;
  max-width: 780px;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  background: rgba(22, 22, 42, 0.95);
  box-shadow: var(--shadow-lg);
}

.chart-viewer {
  margin-bottom: 1.2rem;
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: rgba(13, 13, 20, 0.72);
}

.chart-viewer__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.chart-viewer__heading h2 {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 400;
  color: var(--gold-100);
}

.chart-viewer__heading > p {
  margin: 0 0 0.25rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.schedule-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 0.85rem;
}

.schedule-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  background: rgba(22, 22, 42, 0.9);
}

.schedule-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
}

.schedule-card__header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 400;
  color: var(--gold-100);
}

.schedule-card__header p {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.schedule-card__count {
  flex: 0 0 auto;
  padding: 0.3rem 0.48rem;
  color: var(--gold-300);
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}

.schedule-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.schedule-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.72rem 1rem;
  border-bottom: 1px solid var(--border);
}

.schedule-row--editable { grid-template-columns: 42px minmax(0, 1fr) auto auto; }
.schedule-card__admin-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 0.35rem; }
.schedule-row__move-controls { display: grid; grid-template-rows: repeat(2, 25px); gap: 0.15rem; }
.schedule-move-button { display: grid; width: 30px; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--gold-100); background: rgba(5,5,12,.65); font: 700 1rem/1 var(--font-body); cursor: pointer; }
.schedule-move-button:hover:not(:disabled), .schedule-move-button:focus-visible { border-color: var(--gold-300); color: var(--gold-300); }
.schedule-move-button:disabled { opacity: .35; cursor: not-allowed; }

.schedule-row:last-child {
  border-bottom: 0;
}

.schedule-row__time {
  color: var(--gold-300);
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.schedule-row__copy {
  display: grid;
  min-width: 0;
}

.schedule-row__copy strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-row__copy span,
.schedule-row__participants {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.schedule-row__participants {
  padding: 0.25rem 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.schedule-board--preview {
  grid-template-columns: 1fr;
  max-height: 430px;
  margin-top: 0.9rem;
  padding-right: 0.25rem;
  overflow-y: auto;
}

.chart-upload-card h2,
.chart-preview h3 {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 400;
  color: var(--gold-100);
}

.chart-upload-card p {
  margin: 0.35rem 0 0;
  color: var(--text-secondary);
}

.file-drop {
  display: grid;
  place-items: center;
  gap: 0.35rem;
  min-height: 180px;
  padding: 1.25rem;
  border: 1px dashed var(--border-gold);
  border-radius: var(--radius-lg);
  background: rgba(8, 8, 14, 0.45);
  cursor: pointer;
  text-align: center;
  transition: border-color 180ms ease, background 180ms ease;
}

.file-drop:hover,
.file-drop.has-file {
  border-color: var(--gold-300);
  background: rgba(200, 150, 62, 0.08);
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.file-drop__icon {
  display: grid;
  width: 38px;
  height: 38px;
  color: var(--gold-400);
}

.file-drop__icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.file-drop span:last-child {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.chart-preview {
  padding: 1rem;
  border: 1px solid rgba(83, 214, 162, 0.28);
  border-radius: var(--radius-lg);
  background: rgba(83, 214, 162, 0.06);
}

.chart-preview h3 {
  color: var(--green);
  font-size: 1.35rem;
}

.chart-preview__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.chart-preview__grid div {
  display: grid;
  padding: 0.65rem;
  border-radius: var(--radius-md);
  background: rgba(6, 6, 8, 0.35);
}

.chart-preview__grid strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
}

.chart-preview__grid span,
.chart-preview__venues {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.chart-warning {
  padding-left: 0.75rem;
  border-left: 2px solid var(--amber);
  font-size: 0.84rem;
}

.next-summary {
  padding: 0.8rem;
  border-left: 2px solid var(--gold-500);
  color: var(--text-secondary);
  background: rgba(200, 150, 62, 0.06);
}

.next-summary strong {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-primary);
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  max-width: min(360px, calc(100% - 2rem));
  padding: 0.8rem 1rem;
  color: var(--text-primary);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  background: rgba(22, 22, 42, 0.97);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  border-color: rgba(239, 114, 114, 0.5);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .viewer-count span:last-child,
  .connection span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .viewer-count,
  .connection,
  .sound-toggle {
    min-width: 2.3rem;
    justify-content: center;
    padding-inline: 0.55rem;
  }

  .admin-venue__body {
    grid-template-columns: 1fr;
  }

  .chart-summary {
    grid-template-columns: repeat(3, 1fr);
  }

  .chart-summary__event {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .live-shell {
    gap: 0.55rem;
    padding: 0.65rem;
  }

  .brand .eyebrow,
  .event-clock,
  .live-footer span:last-child {
    display: none;
  }

  .brand h1 {
    font-size: 1.45rem;
  }

  .brand__logo {
    width: 38px;
    height: 38px;
  }

  .header-meta {
    gap: 0.4rem;
  }

  .home-link span {
    display: none;
  }

  .venue-grid {
    grid-template-columns: repeat(var(--mobile-columns, 1), minmax(0, 1fr));
    grid-template-rows: repeat(var(--mobile-rows, 3), minmax(0, 1fr));
    gap: 0.45rem;
  }

  .venue-card {
    grid-template-columns: minmax(0, 1fr) minmax(110px, 0.56fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    border-radius: 13px;
  }

  .venue-card__header {
    grid-column: 1 / -1;
    padding: 0.65rem 0.7rem 0;
  }

  .venue-card__name {
    font-size: 1.15rem;
  }

  .venue-card__location,
  .programme-label,
  .programme-time,
  .last-updated {
    display: none;
  }

  .venue-card__programme {
    padding: 0.45rem 0.7rem 0.65rem;
  }

  .programme-title {
    margin-top: 0;
    font-size: clamp(1.3rem, 6vw, 1.9rem);
  }

  .programme-category {
    margin-top: 0.2rem;
    font-size: 0.78rem;
  }

  .participant-progress {
    align-self: center;
    padding: 0.45rem 0.7rem 0.65rem 0;
  }

  .progress-heading {
    display: block;
    margin-bottom: 0.3rem;
  }

  .progress-label {
    font-size: 0.58rem;
  }

  .progress-value {
    display: block;
    margin-top: 0.08rem;
    font-size: 1.15rem;
  }

  .venue-card__next {
    grid-column: 1 / -1;
    padding: 0.45rem 0.7rem;
  }

  .next-programme {
    font-size: 0.72rem;
  }

  .live-footer {
    font-size: 0.65rem;
  }

  .admin-shell {
    width: min(100% - 1rem, 1180px);
    padding-top: 0.5rem;
  }

  .admin-account #adminName {
    display: none;
  }

  .admin-venue__top,
  .admin-venue__body {
    padding: 0.9rem;
  }

  .admin-venue__top h2 {
    font-size: 1.55rem;
  }

  .total-editor__controls {
    grid-template-columns: 42px minmax(64px, 1fr) 42px;
  }

  .total-editor__controls .button--gold {
    grid-column: 1 / -1;
  }

  .chart-workspace .admin-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-summary {
    grid-template-columns: 1fr 1fr;
  }

  .publication-control {
    align-items: stretch;
    flex-direction: column;
  }

  .publication-switch {
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: start;
  }

  .chart-summary__event,
  .chart-summary__stat:last-child {
    grid-column: 1 / -1;
  }

  .chart-summary__event,
  .chart-summary__stat {
    min-height: 88px;
  }

  .chart-preview__grid {
    grid-template-columns: 1fr;
  }

  .chart-viewer__heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .schedule-row {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .schedule-row--editable { grid-template-columns: 40px minmax(0, 1fr) 32px; }

  .schedule-row--editable .schedule-row__participants { grid-column: 2; grid-row: 2; }

  .schedule-row__move-controls { grid-column: 3; grid-row: 1 / span 2; align-self: center; }

  .schedule-row__participants {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-height: 650px) and (min-width: 701px) {
  .live-shell {
    gap: 0.55rem;
    padding-block: 0.65rem;
  }

  .brand__logo {
    width: 42px;
    height: 42px;
  }

  .venue-card__programme {
    padding-block: 0.55rem;
  }

  .programme-title {
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
  }

  .venue-card__header,
  .venue-card__next {
    padding-block: 0.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
