:root {
  color-scheme: light;
  --ink: #17365f;
  --ink-strong: #0d2b50;
  --muted: #5d7795;
  --blue: #2874f0;
  --panel: #f5f9ff;
  --panel-strong: #eaf3ff;
  --line: #b8d3f6;
  --danger: #ef5350;
  --green: #0f7a4a;
  --green-soft: #ecf8f2;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--ink);
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.viewer-mode button:disabled {
  cursor: not-allowed;
}

.moderator-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1180px, calc(100% - 34px));
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 24px 0;
  overflow: visible;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-strong);
  font-size: 1.3rem;
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--blue);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 999px;
  background: var(--panel-strong);
}

.status-pill {
  min-height: 36px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--ink-strong);
  font-weight: 850;
}

.gate,
.controls {
  min-height: 0;
  overflow: visible;
}

.gate {
  align-self: center;
  width: min(620px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--ink-strong);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 500;
  line-height: 1.05;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  color: var(--muted);
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink-strong);
}

input,
select {
  min-height: 48px;
}

textarea {
  min-height: 96px;
  padding-block: 12px;
  line-height: 1.35;
  resize: vertical;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 900;
  transition:
    transform 120ms ease,
    background-color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    color 120ms ease,
    opacity 120ms ease;
}

.primary-button {
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 7px 14px rgba(40, 116, 240, 0.16);
}

.secondary-button {
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink-strong);
  box-shadow: inset 0 -1px 0 rgba(13, 43, 80, 0.04);
}

.danger-button {
  background: var(--danger);
  color: #ffffff;
  box-shadow: 0 7px 14px rgba(239, 83, 80, 0.14);
}

.primary-button:hover,
.primary-button.is-active {
  background: #1e67df;
}

.secondary-button:hover,
.secondary-button.is-active {
  border-color: var(--blue);
  background: var(--panel-strong);
}

.danger-button:hover {
  background: #e84845;
}

.primary-button:active,
.secondary-button:active,
.danger-button:active,
.primary-button.is-pressed,
.secondary-button.is-pressed,
.danger-button.is-pressed {
  transform: translateY(1px) scale(0.985);
}

.primary-button.is-active,
.secondary-button.is-active {
  box-shadow:
    0 0 0 4px rgba(40, 116, 240, 0.16),
    inset 0 0 0 1px rgba(40, 116, 240, 0.2);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.danger-button:focus-visible {
  outline: 3px solid rgba(40, 116, 240, 0.28);
  outline-offset: 3px;
}

.gate .primary-button {
  margin-top: 18px;
}

.error {
  margin: 12px 0 0;
  color: #a03227;
  font-weight: 850;
}

.controls {
  display: grid;
  gap: 16px;
  padding-top: 22px;
}

.moderator-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #ffffff;
}

.moderator-tab {
  display: grid;
  gap: 3px;
  min-height: 64px;
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 10px 14px;
  background: transparent;
  color: var(--ink-strong);
  text-align: left;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 120ms ease;
}

.moderator-tab span,
.moderator-tab small {
  display: block;
}

.moderator-tab span {
  font-size: 1rem;
  font-weight: 950;
}

.moderator-tab small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.moderator-tab:hover,
.moderator-tab.active {
  border-color: var(--line);
  background: var(--panel);
}

.moderator-tab.active {
  border-color: var(--blue);
  background: var(--panel-strong);
  box-shadow:
    0 0 0 3px rgba(40, 116, 240, 0.12),
    inset 0 0 0 1px rgba(40, 116, 240, 0.08);
}

.moderator-tab:focus-visible {
  outline: 3px solid rgba(40, 116, 240, 0.28);
  outline-offset: 3px;
}

.moderator-tab-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.moderator-tab-panel[hidden] {
  display: none !important;
}

.rooms-panel {
  display: grid;
  gap: 16px;
}

.rooms-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.rooms-head h2,
.rooms-head p {
  margin: 0;
}

.rooms-head h2 {
  color: var(--ink-strong);
  font-size: 1.35rem;
  line-height: 1.1;
}

.rooms-head > span {
  max-width: 360px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.room-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.room-card.active {
  border-color: var(--blue);
  background: var(--panel-strong);
  box-shadow:
    0 0 0 4px rgba(40, 116, 240, 0.12),
    inset 0 0 0 1px rgba(40, 116, 240, 0.12);
}

.room-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--blue);
  color: #ffffff;
  font-weight: 950;
}

.room-main {
  min-width: 0;
}

.room-main strong,
.room-main span,
.room-main p {
  display: block;
}

.room-main strong {
  color: var(--ink-strong);
  font-size: 1rem;
  font-weight: 950;
}

.room-main span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.room-main p {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 780;
  line-height: 1.35;
}

.room-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.room-actions .secondary-button {
  min-height: 38px;
}

.room-actions a {
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.admin-desk {
  display: grid;
  gap: 14px;
}

.admin-desk-head,
.admin-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-desk-head h2,
.admin-desk-head p,
.admin-card-head p {
  margin: 0;
}

.admin-desk-head h2 {
  color: var(--ink-strong);
  font-size: 1.28rem;
  line-height: 1.14;
}

.admin-desk-status,
.admin-card-head > span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
  white-space: nowrap;
}

.admin-desk-status.is-live {
  border-color: var(--blue);
  background: var(--panel-strong);
  color: var(--ink-strong);
}

.admin-desk-status.is-error {
  border-color: var(--danger);
  background: #fff4f4;
  color: #a03227;
}

.admin-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.admin-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: 12px;
}

.admin-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.admin-card-head strong {
  display: block;
  color: var(--ink-strong);
  font-size: 1rem;
  font-weight: 950;
  line-height: 1.16;
}

.day-slot-board,
.match-queue,
.manual-slot-list {
  display: grid;
  gap: 8px;
}

.day-slot-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.day-slot-row.is-full {
  opacity: 0.72;
}

.day-slot-row strong,
.day-slot-row span,
.day-slot-row p,
.day-slot-row small {
  display: block;
}

.day-slot-row strong {
  color: var(--ink-strong);
  font-size: 1.05rem;
  font-weight: 950;
}

.day-slot-row span,
.day-slot-row small {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.day-slot-row p {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 820;
  overflow-wrap: anywhere;
}

.match-person {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
}

.match-person.selected {
  border-color: var(--blue);
  background: var(--panel-strong);
  box-shadow: 0 0 0 3px rgba(40, 116, 240, 0.12);
}

.match-person strong,
.match-person span,
.match-person small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-person strong {
  color: var(--ink-strong);
  font-weight: 950;
}

.match-person span,
.match-person small {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 820;
}

.match-slot-field {
  margin: 0;
}

.manual-form {
  gap: 14px;
}

.manual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.manual-grid label:nth-child(4),
.manual-grid label:nth-child(5) {
  grid-column: span 1;
}

.manual-slots {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.manual-slots legend {
  padding: 0 6px;
  color: var(--muted);
  font-weight: 900;
}

.manual-slot-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.manual-slot-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 58px;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.manual-slot-choice input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--blue);
}

.manual-slot-choice strong,
.manual-slot-choice small {
  display: block;
}

.manual-slot-choice strong {
  color: var(--ink-strong);
  font-weight: 950;
}

.manual-slot-choice small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.manual-notes {
  margin: 0;
}

.manual-duplicate-override {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.manual-duplicate-override input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--blue);
}

.referral-panel {
  display: grid;
  gap: 14px;
}

.referral-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.referral-head h2,
.referral-head p {
  margin: 0;
}

.referral-head h2 {
  color: var(--ink-strong);
  font-size: 1.25rem;
  line-height: 1.12;
}

.referral-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.referral-head-actions .secondary-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.referral-explainer {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.45;
}

.referral-status {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
  white-space: nowrap;
}

.referral-status.is-live {
  border-color: var(--blue);
  background: var(--panel-strong);
  color: var(--ink-strong);
}

.referral-status.is-error {
  border-color: var(--danger);
  background: #fff4f4;
  color: #a03227;
}

.referral-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.referral-form .primary-button {
  min-width: 190px;
  min-height: 44px;
}

.referral-list {
  display: grid;
  gap: 10px;
}

.referral-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.referral-card.is-inactive {
  background: #f7f9fc;
  opacity: 0.82;
}

.referral-card-main {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.referral-identity {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.referral-identity strong,
.referral-identity span {
  display: block;
}

.referral-identity strong {
  color: var(--ink-strong);
  font-size: 1.02rem;
  font-weight: 950;
}

.referral-identity span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.referral-state {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid rgba(15, 122, 74, 0.24);
  border-radius: 999px;
  padding: 0 10px;
  background: #edf9f2;
  color: #0f7a4a;
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 950;
  white-space: nowrap;
}

.referral-state.inactive {
  border-color: var(--line);
  background: #eef2f7;
  color: var(--muted);
}

.referral-funnel {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.referral-funnel > span {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 10px;
  background: var(--panel);
}

.referral-funnel em,
.referral-funnel strong {
  display: block;
}

.referral-funnel em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 850;
}

.referral-funnel strong {
  color: var(--ink-strong);
  font-size: 1.12rem;
  font-weight: 950;
}

.referral-card-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.referral-card-summary strong {
  color: var(--ink-strong);
}

.referral-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.referral-links .secondary-button {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.86rem;
}

.referral-settings {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.referral-settings summary {
  cursor: pointer;
  color: var(--ink-strong);
  font-size: 0.86rem;
  font-weight: 900;
}

.referral-settings form,
.payout-ledger {
  margin-top: 12px;
}

.referral-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.referral-setting-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.payout-ledger {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.payout-ledger-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.payout-ledger-head strong,
.payout-ledger-head span {
  display: block;
}

.payout-ledger-head span,
.payout-empty {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.payout-empty {
  margin: 0;
}

.payout-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(120px, 0.28fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 9px 10px;
  background: var(--panel);
}

.payout-row span strong,
.payout-row span small {
  display: block;
}

.payout-row span small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.referral-audit {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.referral-audit > strong {
  color: var(--ink-strong);
}

.referral-audit p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.referral-audit em {
  font-style: normal;
  white-space: nowrap;
}

.referral-qr-dialog {
  width: min(440px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 24px 80px rgba(16, 43, 82, 0.24);
}

.referral-qr-dialog::backdrop {
  background: rgba(16, 43, 82, 0.42);
}

.referral-qr-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.referral-qr-head h2,
.referral-qr-head p,
.referral-qr-dialog > p {
  margin: 0;
}

.referral-qr-dialog canvas {
  display: block;
  width: min(280px, 100%);
  height: auto;
  margin: 18px auto;
}

.referral-qr-dialog > p {
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.referral-qr-dialog > .primary-button {
  width: 100%;
  margin-top: 14px;
}

.icon-close {
  width: 40px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  color: var(--ink-strong);
  font-size: 1.4rem;
  line-height: 1;
}

.bookings-panel {
  display: grid;
  gap: 14px;
}

.bookings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.bookings-head h2,
.bookings-head p {
  margin: 0;
}

.bookings-head h2 {
  color: var(--ink-strong);
  font-size: 1.25rem;
  line-height: 1.12;
}

.booking-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.booking-actions a {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 18px;
  background: #ffffff;
  color: var(--ink-strong);
  font-weight: 900;
  text-decoration: none;
}

.booking-actions a:hover {
  border-color: var(--blue);
  background: var(--panel-strong);
}

.booking-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.booking-summary-pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink-strong);
  font-size: 0.86rem;
  font-weight: 850;
}

.booking-summary-pill.needs-match {
  border-color: #f1c27d;
  background: #fff7e8;
}

.booking-summary-pill.is-error {
  border-color: var(--danger);
  background: #fff4f4;
  color: #a03227;
}

.booking-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding-right: 3px;
  -webkit-overflow-scrolling: touch;
}

.booking-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.booking-card.canceled {
  opacity: 0.68;
}

.booking-card.completed {
  border-color: rgba(40, 116, 240, 0.34);
}

.booking-card.needs_match {
  border-color: rgba(15, 122, 74, 0.28);
  background: #fbfffd;
}

.booking-main {
  min-width: 0;
}

.booking-main strong,
.booking-main span,
.booking-main p {
  display: block;
}

.booking-main strong {
  color: var(--ink-strong);
  font-size: 1.02rem;
  font-weight: 950;
}

.booking-main span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.booking-main p {
  margin: 7px 0 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 780;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.booking-main .booking-location {
  color: var(--muted);
}

.booking-main .booking-calendar {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.booking-main .booking-calendar.synced {
  border-color: rgba(40, 116, 240, 0.35);
  background: var(--panel-strong);
  color: var(--ink-strong);
}

.booking-main .booking-calendar.failed {
  border-color: var(--danger);
  background: #fff4f4;
  color: #a03227;
}

.booking-main .booking-calendar.removal_failed {
  border-color: var(--danger);
  background: #fff4f4;
  color: #a03227;
}

.booking-main .booking-calendar.removed {
  border-color: rgba(15, 122, 74, 0.26);
  background: var(--green-soft);
  color: var(--green);
}

.booking-main .booking-calendar.not_scheduled {
  border-color: rgba(15, 122, 74, 0.26);
  background: var(--green-soft);
  color: var(--green);
}

.booking-main .booking-referral {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  border: 1px solid rgba(15, 122, 74, 0.26);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 900;
}

.booking-referral-editor {
  width: fit-content;
  max-width: 100%;
  margin-top: 8px;
}

.booking-referral-editor summary {
  width: fit-content;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.booking-referral-editor > div {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.booking-referral-editor select {
  min-width: min(240px, 62vw);
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 34px 0 10px;
  background: #ffffff;
  color: var(--ink-strong);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
}

.booking-referral-editor .secondary-button {
  min-height: 38px;
  padding: 0 14px;
}

.booking-card-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.booking-card-actions .secondary-button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.86rem;
}

.booking-status {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.booking-status.confirmed {
  border-color: rgba(40, 116, 240, 0.35);
  background: var(--panel-strong);
  color: var(--ink-strong);
}

.booking-status.needs_match {
  border-color: rgba(15, 122, 74, 0.28);
  background: var(--green-soft);
  color: var(--green);
}

.booking-status.canceled {
  border-color: var(--danger);
  background: #fff4f4;
  color: #a03227;
}

.booking-empty {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 820;
  line-height: 1.35;
}

.control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 16px;
}

.panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr 120px;
  gap: 12px;
}

.session-panel .secondary-button {
  margin-top: 14px;
}

.setup-sync {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.25;
}

.setup-sync span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setup-sync strong {
  color: var(--ink-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.setup-sync-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--line);
}

.setup-sync.is-sending {
  border-color: var(--blue);
  background: var(--panel-strong);
  color: var(--ink-strong);
}

.setup-sync.is-sending .setup-sync-dot {
  background: var(--blue);
  animation: setupPulse 900ms ease-in-out infinite;
}

.setup-sync.is-confirmed {
  border-color: rgba(40, 116, 240, 0.48);
  background: #f7fbff;
}

.setup-sync.is-confirmed .setup-sync-dot {
  background: var(--blue);
}

.setup-sync.is-error {
  border-color: var(--danger);
  background: #fff4f4;
  color: #a03227;
}

.setup-sync.is-error .setup-sync-dot {
  background: var(--danger);
}

@keyframes setupPulse {
  0%,
  100% {
    transform: scale(0.72);
    opacity: 0.48;
  }

  50% {
    transform: scale(1.12);
    opacity: 1;
  }
}

.now-panel {
  display: grid;
  align-content: center;
}

.timer {
  color: #0f1d19;
  font-size: clamp(3rem, 8vw, 5.8rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 0.95;
}

.now-panel strong,
.now-panel span {
  display: block;
}

.now-panel strong {
  margin-top: 10px;
  color: var(--ink-strong);
  font-size: 1.15rem;
}

.now-panel span {
  margin-top: 4px;
  color: var(--muted);
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.transport-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.transport-head .eyebrow {
  margin: 0;
}

.control-feedback {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  max-width: 52%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition:
    transform 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.control-feedback.is-live {
  transform: scale(1.02);
  border-color: var(--blue);
  background: var(--panel-strong);
  color: var(--ink-strong);
}

.control-feedback.is-error {
  border-color: var(--danger);
  background: #fff4f4;
  color: #a03227;
}

.message-panel {
  display: grid;
  gap: 14px;
}

.message-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.message-head h2,
.message-head p {
  margin: 0;
}

.message-head h2 {
  color: var(--ink-strong);
  font-size: 1.15rem;
  line-height: 1.12;
}

#messageStatus {
  display: inline-flex;
  min-height: 34px;
  max-width: 46%;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#messageStatus.has-message {
  border-color: var(--blue);
  background: var(--panel-strong);
  color: var(--ink-strong);
}

#messageStatus.is-sending {
  border-color: var(--blue);
  background: #ffffff;
  color: var(--ink-strong);
}

#messageStatus.is-error {
  border-color: var(--danger);
  background: #fff4f4;
  color: #a03227;
}

.message-field {
  margin: 0;
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.message-actions button {
  min-width: 170px;
}

.monitor-panel {
  display: grid;
  gap: 14px;
}

.monitor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.monitor-head h2,
.monitor-head p {
  margin: 0;
}

.monitor-head h2 {
  color: var(--ink-strong);
  font-size: 1.2rem;
  line-height: 1.14;
}

.monitor-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.monitor-actions span,
.monitor-actions button {
  min-height: 36px;
}

.monitor-actions span {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink-strong);
  font-size: 0.84rem;
  font-weight: 900;
  white-space: nowrap;
}

.monitor-actions .secondary-button {
  min-height: 36px;
  padding: 0 13px;
  font-size: 0.82rem;
}

.monitor-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
}

.monitor-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.monitor-card h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 0.98rem;
  font-weight: 950;
}

.device-list,
.session-log {
  display: grid;
  gap: 8px;
}

.session-log {
  max-height: 310px;
  overflow: auto;
  padding-right: 2px;
}

.device-card,
.session-event {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
}

.device-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.device-card.online {
  border-color: rgba(15, 122, 74, 0.34);
  background: var(--green-soft);
}

.device-card.stale {
  background: #fff8ec;
  border-color: #efcf9d;
}

.device-card strong,
.device-card span,
.device-card small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-card strong {
  color: var(--ink-strong);
  font-size: 0.95rem;
  font-weight: 950;
}

.device-card span,
.device-card small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 830;
}

.device-card em {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--ink-strong);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 950;
}

.session-event {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
}

.session-event time {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.session-event strong,
.session-event span {
  display: block;
  min-width: 0;
}

.session-event strong {
  color: var(--ink-strong);
  font-size: 0.88rem;
  font-weight: 950;
}

.session-event span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 820;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.monitor-empty {
  margin: 0;
  padding: 13px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 820;
  line-height: 1.34;
}

.monitor-empty.is-error {
  border-color: var(--danger);
  background: #fff4f4;
  color: #a03227;
}

.prompt-panel {
  display: grid;
  grid-template-rows: auto auto auto auto;
  min-height: 0;
  overflow: visible;
}

.prompt-head,
.prompt-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.prompt-head strong {
  display: block;
  color: var(--ink-strong);
  font-size: 1.25rem;
  font-weight: 900;
}

.topic-pill,
.prompt-meta-row span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink-strong);
  font-weight: 850;
}

.topic-pill {
  max-width: 44%;
  padding: 0 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prompt-type {
  margin: 12px 0;
  color: var(--muted);
  font-weight: 850;
}

.prompt-panel h2 {
  align-self: start;
  margin: 0;
  color: var(--ink-strong);
  font-size: clamp(1.2rem, 1.55vw, 1.85rem);
  font-weight: 850;
  line-height: 1.22;
  overflow: visible;
}

.prompt-meta-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 16px;
}

.prompt-meta-row span {
  padding: 0 12px;
  color: var(--muted);
}

.assignment-panel {
  display: grid;
  gap: 16px;
}

.assignment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.assignment-head h2,
.assignment-head p {
  margin: 0;
}

.assignment-head h2 {
  color: var(--ink-strong);
  font-size: 1.25rem;
  line-height: 1.12;
}

.assignment-head p:not(.eyebrow) {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.35;
}

.assignment-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.assignment-actions .secondary-button {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.84rem;
}

.assignment-table {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.assignment-block {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.assignment-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.assignment-block-head span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.assignment-block-head h3 {
  margin: 4px 0 0;
  color: var(--ink-strong);
  font-size: 1rem;
  font-weight: 950;
  line-height: 1.18;
}

.assignment-block-head strong {
  flex: 0 0 auto;
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--panel);
  color: var(--ink-strong);
  font-size: 0.82rem;
  font-weight: 950;
}

.assignment-row-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.assignment-chip {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.assignment-chip.is-swap {
  border-color: #efcf9d;
  background: #fff8ec;
  color: #9b6110;
}

.assignment-swap-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.35;
}

.assignment-prompts {
  display: grid;
  gap: 8px;
}

.assignment-prompt-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.assignment-prompt-row.is-swapped {
  border-color: #efcf9d;
  background: #fffaf2;
}

.assignment-prompt-row > strong {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink-strong);
  font-size: 0.84rem;
  font-weight: 950;
}

.assignment-prompt-row span,
.assignment-prompt-row small,
.assignment-prompt-row p {
  display: block;
  min-width: 0;
}

.assignment-prompt-row span {
  color: var(--ink-strong);
  font-size: 0.83rem;
  font-weight: 950;
}

.assignment-prompt-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.assignment-prompt-row p {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 760;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.link-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  padding: 14px 20px;
}

.link-panel p,
.link-panel a {
  margin: 0;
  color: var(--ink-strong);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.link-panel .eyebrow {
  margin-bottom: 7px;
}

.link-panel a {
  color: var(--blue);
}

@media (max-width: 1080px) {
  .monitor-grid {
    grid-template-columns: 1fr;
  }

  .assignment-table {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .link-panel {
    grid-template-columns: 1fr;
  }

  .moderator-shell {
    width: min(100% - 22px, 1180px);
    padding: 12px 0;
  }

  .moderator-tabs {
    grid-template-columns: 1fr;
  }

	  .control-grid,
	  .fields,
	  .button-grid,
	  .rooms-grid,
	  .admin-filter-row,
	  .admin-workspace,
	  .manual-grid,
	  .referral-form,
	  .referral-card {
	    grid-template-columns: 1fr;
	  }

  .rooms-head {
    align-items: flex-start;
    flex-direction: column;
  }

	  .bookings-head,
	  .booking-actions,
	  .admin-desk-head,
	  .admin-card-head,
	  .referral-head,
	  .monitor-head,
	  .assignment-head {
	    align-items: stretch;
	    flex-direction: column;
	  }

	  .admin-desk-status,
	  .admin-card-head > span,
	  .referral-status {
	    justify-content: flex-start;
	    white-space: normal;
	  }

	  .day-slot-row {
	    grid-template-columns: 1fr;
	  }

	  .manual-slot-list {
	    grid-template-columns: repeat(2, minmax(0, 1fr));
	  }

  .booking-card {
    grid-template-columns: 1fr;
  }

  .booking-card-actions {
    justify-items: stretch;
  }

  .booking-referral-editor,
  .booking-referral-editor > div,
  .booking-referral-editor select {
    width: 100%;
  }

  .referral-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .referral-funnel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .referral-settings-grid {
    grid-template-columns: 1fr;
  }

  .payout-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .payout-row select {
    grid-column: 1 / -1;
  }

  .referral-head-actions {
    justify-content: flex-start;
  }

  .setup-sync {
    align-items: start;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .setup-sync span:nth-child(2) {
    white-space: normal;
  }

  .setup-sync strong {
    grid-column: 2;
    justify-self: start;
  }

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

  .transport-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .message-head {
    flex-direction: column;
  }

  .control-feedback {
    max-width: 100%;
  }

  #messageStatus {
    max-width: 100%;
  }

  .message-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .monitor-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .monitor-actions span {
    justify-content: center;
  }

  .device-card {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .device-card em {
    justify-content: center;
  }

  .assignment-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .prompt-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topic-pill {
    max-width: 100%;
  }
}

@media (max-height: 760px) {
  .moderator-shell {
    padding: 12px 0;
  }

  .topbar {
    padding-bottom: 12px;
  }

  .controls {
    gap: 10px;
    padding-top: 12px;
  }

  .panel {
    padding: 14px;
  }

  .link-panel {
    padding: 10px 14px;
  }

  .timer {
    font-size: clamp(2.6rem, 7vw, 4.6rem);
  }

  .prompt-panel h2 {
    font-size: clamp(1.05rem, 1.8vw, 1.4rem);
  }

  .prompt-type {
    margin: 8px 0;
  }
}
