:root {
  --bg: #141416;
  --bg2: #1f1f21;
  --bg3: #272729;
  --bg4: #2e2e30;
  --border: rgba(255, 255, 255, 0.07);
  --border-md: rgba(255, 255, 255, 0.12);
  --border-hi: rgba(201, 149, 42, 0.35);
  --gold: #c9952a;
  --gold-hi: #e0aa3e;
  --gold-dim: rgba(201, 149, 42, 0.12);
  --gold-glow: rgba(201, 149, 42, 0.18);
  --t1: #f0ede8;
  --t2: #9b9894;
  --t3: #5c5a57;
  --green: #4caf6a;
  --green-dim: rgba(76, 175, 106, 0.1);
  --green-hi: rgba(76, 175, 106, 0.3);
  --error: #e05252;
  --error-dim: rgba(224, 82, 82, 0.1);
  --error-hi: rgba(224, 82, 82, 0.3);
  --radius: 14px;
  --radius-sm: 8px;
  --f-display: 'Bebas Neue', sans-serif;
  --f-body: 'DM Sans', sans-serif;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.3);
}

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

html,
body {
  height: 100%;
  background: var(--bg);
  font-family: var(--f-body);
  color: var(--t1);
  -webkit-font-smoothing: antialiased;
}

/* ── App layout ─────────────────────────────────────── */

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 149, 42, 0.58) rgba(15, 17, 17, 0.72);
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-track {
  background: rgba(15, 17, 17, 0.72);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(201, 149, 42, 0.82),
    rgba(96, 105, 97, 0.72)
  );
  border: 2px solid rgba(15, 17, 17, 0.72);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(201, 149, 42, 0.92);
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--f-display);
  font-size: 17px;
  letter-spacing: 0.06em;
  color: var(--gold);
  flex-shrink: 0;
}

.sidebar-nav {
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--t2);
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.nav-item:hover {
  background: var(--bg3);
  color: var(--t1);
}

.nav-item.active {
  background: var(--gold-dim);
  border-color: var(--border-hi);
  color: var(--gold);
}

.main-content {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
}

.page-view {
  min-height: 100vh;
}

.page-view.hidden {
  display: none;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(
      ellipse 70% 50% at 50% -10%,
      rgba(201, 149, 42, 0.08) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 40% 30% at 80% 90%,
      rgba(201, 149, 42, 0.04) 0%,
      transparent 60%
    );
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 32px 20px 48px;
}

.booking-switch-row {
  --booking-top-control-height: 56px;
  width: min(1700px, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1100;
}

.booking-tabs {
  display: inline-flex;
  flex: 0 0 auto;
  height: var(--booking-top-control-height);
  width: max-content;
  align-items: stretch;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
}

.booking-tab {
  border: 0;
  border-radius: 6px;
  min-width: 118px;
  padding: 0 12px;
  color: var(--t2);
  background: transparent;
  font: 700 13px var(--f-body);
  cursor: pointer;
}

.booking-tab.active {
  color: #111;
  background: var(--gold);
}

.booking-reset-btn {
  display: inline-grid;
  width: 44px;
  min-width: 44px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(73, 201, 164, 0.38);
  border-radius: 6px;
  background: rgba(73, 201, 164, 0.08);
  color: var(--green);
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.booking-reset-btn:hover {
  border-color: var(--green);
  background: rgba(73, 201, 164, 0.14);
  color: var(--t1);
}

.booking-reset-btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.booking-mode {
  display: none;
  width: 100%;
}

.booking-mode.active {
  display: block;
}

.reverse-booking {
  display: grid;
  grid-template-columns: minmax(820px, 1fr) 350px;
  gap: 12px;
  width: min(1700px, 100%);
  min-height: calc(100vh - 132px);
  margin: 0 auto;
}

.availability-board {
  width: min(1700px, 100%);
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 160px),
    var(--bg2);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.board-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 26px 16px;
  border-bottom: 1px solid var(--border);
}

.board-head h1 {
  margin: 0 0 7px;
  font: 700 30px var(--f-serif);
  color: var(--t1);
}

.board-head h1 span {
  color: var(--gold);
}

.board-head-actions {
  display: flex;
  gap: 10px;
  align-self: flex-start;
}

.board-refresh,
.board-sync {
  width: auto;
  height: 42px;
  align-self: flex-start;
  margin: 0;
  padding: 0 18px;
}

.board-sync:disabled {
  opacity: 0.6;
  cursor: default;
}

.board-toolbar {
  display: grid;
  grid-template-columns:
    minmax(240px, 1fr) minmax(170px, 0.7fr) minmax(190px, 0.8fr)
    auto;
  gap: 12px;
  padding: 16px 26px;
  border-bottom: 1px solid var(--border);
  align-items: end;
}

/* Incoming calls stay compact and never cover an in-progress booking. */
.incoming-call-tray {
  position: relative;
  z-index: 1050;
  width: min(1700px, 100%);
  margin: -6px auto 16px;
  border: 1px solid rgba(73, 201, 164, 0.34);
  border-radius: var(--radius-sm);
  background: rgba(17, 18, 18, 0.96);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
}

.incoming-call-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 0;
  color: var(--t1);
  background: transparent;
  font: 700 12px var(--f-body);
  text-align: left;
  cursor: pointer;
}

.incoming-call-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(73, 201, 164, 0.12);
}

.incoming-call-count {
  min-width: 22px;
  height: 22px;
  margin-left: auto;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #111;
  background: var(--green);
  font-size: 11px;
}

.incoming-call-list {
  max-height: 270px;
  overflow: auto;
  border-top: 1px solid var(--border);
  scrollbar-color: rgba(201, 149, 42, 0.55) rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
}

.incoming-call-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
}

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

.incoming-call-copy {
  min-width: 0;
}

.incoming-call-copy strong,
.incoming-call-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incoming-call-copy strong {
  color: var(--t1);
  font-size: 13px;
}

.incoming-call-copy small {
  margin-top: 3px;
  color: var(--t3);
  font-size: 11px;
}

.incoming-call-actions {
  display: flex;
  gap: 7px;
}

.incoming-call-actions button,
.incoming-draft-restore {
  min-height: 32px;
  border: 1px solid var(--border-md);
  border-radius: 6px;
  padding: 0 11px;
  color: var(--t2);
  background: rgba(255, 255, 255, 0.035);
  font: 700 11px var(--f-body);
  cursor: pointer;
}

.incoming-call-actions .primary {
  border-color: rgba(73, 201, 164, 0.55);
  color: #111;
  background: var(--green);
}

.incoming-draft-restore {
  margin: 8px 12px 12px;
  color: var(--gold);
  border-color: rgba(201, 149, 42, 0.5);
}

.board-dispatch-table {
  min-width: 980px;
  table-layout: fixed;
}

.board-dispatch-table th:first-child,
.board-dispatch-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 164px;
  background: rgba(17, 18, 18, 0.98);
}

.board-dispatch-table th:first-child {
  z-index: 5;
}

.board-dispatch-user-head {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 120px;
}

.board-dispatch-user-head img,
.board-dispatch-user-head i {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  object-fit: cover;
  display: grid;
  place-items: center;
  color: #111;
  background: var(--gold);
  font-style: normal;
}

.board-dispatch-table td:not(:first-child) {
  min-width: 152px;
  padding: 7px;
}

.board-dispatch-table .slot-pill {
  min-height: 46px;
}

.board-dispatch-date {
  display: grid;
  gap: 3px;
}

.board-dispatch-date strong {
  color: var(--t1);
  font-size: 12px;
}

.board-dispatch-date small {
  color: var(--t3);
  font-size: 11px;
}

.slot-recommendations {
  margin-top: 16px;
  padding: 13px;
  border: 1px solid rgba(73, 201, 164, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(73, 201, 164, 0.045);
}

.slot-recommendations-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.slot-recommendations-head strong,
.slot-recommendations-head span {
  display: block;
}

.slot-recommendations-head strong {
  color: var(--t1);
  font-size: 13px;
}

.slot-recommendations-head span,
.slot-recommendations-live {
  margin-top: 2px;
  color: var(--t3);
  font-size: 10px;
}

.slot-recommendations-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.slot-recommendation {
  min-width: 0;
  min-height: 58px;
  border: 1px solid rgba(73, 201, 164, 0.46);
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--t1);
  background: rgba(73, 201, 164, 0.08);
  text-align: left;
  cursor: pointer;
  animation: recommended-slot-pulse 0.9s ease-in-out 2;
}

.slot-recommendation strong,
.slot-recommendation span,
.slot-recommendation small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-recommendation strong {
  font-size: 12px;
}

.slot-recommendation span {
  margin-top: 3px;
  color: var(--green);
  font-size: 11px;
}

.slot-recommendation small {
  margin-top: 3px;
  color: var(--t3);
  font-size: 10px;
}

.slot-btn.recommended {
  border-color: rgba(73, 201, 164, 0.72);
  box-shadow: inset 0 0 0 1px rgba(73, 201, 164, 0.28);
}

@keyframes recommended-slot-pulse {
  50% {
    background: rgba(73, 201, 164, 0.19);
    box-shadow: 0 0 0 3px rgba(73, 201, 164, 0.08);
  }
}

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

.user-setting-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.user-setting-row[open] {
  border-color: rgba(201, 149, 42, 0.34);
}

.user-setting-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 12px;
  list-style: none;
  cursor: pointer;
}

.user-setting-summary::-webkit-details-marker {
  display: none;
}

.user-setting-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  display: grid;
  place-items: center;
  color: #111;
  background: var(--gold);
  font-size: 11px;
}

.user-setting-name strong,
.user-setting-name small {
  display: block;
}

.user-setting-name strong {
  color: var(--t1);
  font-size: 13px;
}

.user-setting-name small {
  margin-top: 2px;
  color: var(--t3);
  font-size: 11px;
}

.user-setting-body {
  display: grid;
  gap: 14px;
  padding: 14px;
  border-top: 1px solid var(--border);
}

.user-setting-grid,
.incoming-webhook-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.user-job-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.user-job-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--t2);
  font-size: 11px;
}

.user-outside-area-setting {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 14px;
  min-height: 42px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.user-outside-area-setting .field-help {
  margin: 0;
}

.user-calendar-overrides {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.user-calendar-override {
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
}

.user-calendar-override strong {
  color: var(--t2);
  font-size: 11px;
}

.user-settings-legend {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--t3);
  font-size: 11px;
}

.user-settings-legend span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.incoming-webhook-card {
  margin-top: 16px;
}

.incoming-webhook-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
}

.incoming-webhook-actions button {
  width: auto;
  margin: 0;
}

.incoming-webhook-actions span {
  color: var(--t3);
  font-size: 11px;
}

.incoming-webhook-example {
  max-height: 210px;
  overflow: auto;
  margin: 12px 0 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--t2);
  background: rgba(0, 0, 0, 0.24);
  font: 11px/1.5 var(--f-mono);
  white-space: pre-wrap;
}

@media (prefers-reduced-motion: reduce) {
  .slot-recommendation {
    animation: none;
  }
}

/* Operational scheduling polish: territories, preferences, and board states. */
.scheduling-preferences {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(108, 158, 232, 0.035);
}

.scheduling-preferences-head strong,
.scheduling-preferences-head span {
  display: block;
}

.scheduling-preferences-head strong {
  color: var(--t1);
  font-size: 13px;
  font-weight: 600;
}

.scheduling-preferences-head span {
  margin-top: 2px;
  color: var(--t2);
  font-size: 10px;
}

.preference-mode-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.preference-mode {
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--border-md);
  border-radius: 6px;
  padding: 0 4px;
  color: var(--t2);
  background: var(--bg3);
  font: 600 10px/1.15 var(--f-body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.preference-mode:hover {
  border-color: rgba(108, 158, 232, 0.55);
  color: var(--t1);
  background: var(--blue-dim);
}

.preference-mode.active {
  border-color: rgba(108, 158, 232, 0.72);
  color: #eef5ff;
  background: rgba(108, 158, 232, 0.2);
  box-shadow: inset 0 0 0 1px rgba(108, 158, 232, 0.16);
}

.preference-time-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.preference-time-controls .text-input {
  min-height: 38px;
}

.slot-recommendations {
  border-color: rgba(108, 158, 232, 0.34);
  background: rgba(108, 158, 232, 0.045);
}

.slot-recommendations.has-top-choice {
  border-color: rgba(79, 179, 160, 0.34);
  background: rgba(79, 179, 160, 0.035);
}

.slot-recommendations-list {
  align-items: stretch;
}

.slot-recommendation {
  display: grid;
  align-content: start;
  gap: 3px;
  min-height: 92px;
  border-color: var(--border-md);
  background: rgba(255, 255, 255, 0.025);
  animation: none;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.slot-recommendation:hover {
  transform: translateY(-1px);
  border-color: rgba(108, 158, 232, 0.58);
  background: rgba(108, 158, 232, 0.08);
}

.slot-recommendation.top-choice {
  border-color: rgba(79, 179, 160, 0.68);
  background: rgba(79, 179, 160, 0.1);
  animation: recommended-slot-pulse 0.9s ease-in-out 2;
}

.slot-recommendation.preference-conflict:not(.top-choice) {
  border-color: rgba(201, 162, 75, 0.5);
  background: var(--amber-dim);
}

.slot-recommendation-topline {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 2px !important;
}

.slot-recommendation-badge,
.slot-recommendation-score {
  margin: 0 !important;
  font-size: 9px !important;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.slot-recommendation-badge {
  color: var(--teal) !important;
}

.slot-recommendation:not(.top-choice) .slot-recommendation-badge {
  color: var(--blue) !important;
}

.slot-recommendation-score {
  color: var(--t2) !important;
}

.slot-recommendation-meta {
  margin: 0 !important;
  color: var(--t2) !important;
  font-size: 10px !important;
}

.slot-recommendation small {
  margin-top: 1px;
}

.board-team-filter {
  padding: 11px 26px 13px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.012);
}

.board-team-filter-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.board-team-filter-head strong,
.board-team-filter-head span {
  display: block;
}

.board-team-filter-head strong {
  color: var(--t1);
  font-size: 11px;
  font-weight: 600;
}

.board-team-filter-head span {
  margin-top: 1px;
  color: var(--t3);
  font-size: 9px;
}

#boardUserFilterCount {
  color: var(--blue);
  font: 500 10px var(--f-mono);
}

.board-user-filters {
  gap: 6px;
  padding: 0;
}

.board-user-filter {
  min-height: 32px;
  border-color: var(--border-md);
  border-radius: 6px;
  color: var(--t2);
  background: var(--bg3);
  font-weight: 600;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.board-user-filter:hover {
  border-color: rgba(108, 158, 232, 0.5);
  color: var(--t1);
  background: var(--blue-dim);
}

.board-user-filter.active {
  border-color: rgba(108, 158, 232, 0.55);
  color: #eef5ff;
  background: rgba(108, 158, 232, 0.18);
}

.board-user-filter.active img,
.board-user-filter.active i {
  box-shadow: 0 0 0 1px rgba(108, 158, 232, 0.72);
}

.slot-pill.free {
  border-color: rgba(79, 179, 160, 0.34);
  color: var(--teal);
  background: rgba(79, 179, 160, 0.045);
}

.slot-pill.booked {
  border-color: rgba(76, 175, 106, 0.72);
  background: rgba(76, 175, 106, 0.18);
  box-shadow: inset 3px 0 0 rgba(76, 175, 106, 0.82);
}

.slot-pill.busy {
  border-color: rgba(108, 158, 232, 0.38);
  color: #b8c8de;
  background: rgba(108, 158, 232, 0.085);
}

.slot-pill.proposed {
  border-color: rgba(201, 162, 75, 0.68);
  color: #ead18d;
}

.board-status.free {
  color: var(--teal);
  border-color: rgba(79, 179, 160, 0.48);
  background: var(--teal-dim);
}

.board-status.booked {
  color: #e9fff4;
  border-color: rgba(76, 175, 106, 0.65);
  background: rgba(76, 175, 106, 0.34);
}

.board-status.busy {
  color: #c0d0e5;
  border-color: rgba(108, 158, 232, 0.44);
  background: var(--blue-dim);
}

.board-status.proposed {
  color: #ecd18b;
  border-color: rgba(201, 162, 75, 0.62);
  background-color: var(--amber-dim);
}

.slot-pill.has-actions:hover {
  border-color: rgba(201, 162, 75, 0.86);
  box-shadow: none;
}

.slot-pill-actions {
  border-color: rgba(201, 162, 75, 0.86);
  background: #111514;
}

.slot-pill-actions button {
  transition:
    color 140ms ease,
    background 140ms ease;
}

.slot-pill-actions .reserve-action:hover {
  color: #f1d991;
  background: var(--amber-dim);
}

.slot-pill-actions .schedule-action:hover,
.slot-pill-actions .reschedule-action:hover {
  color: #111;
  background: var(--gold-hi);
}

.slot-pill-actions .schedule-action,
.slot-pill-actions .reschedule-action {
  color: #111;
  background: var(--gold);
}

.slot-pill-actions .confirm-action {
  color: #0b1915;
  background: var(--teal);
}

.slot-pill-actions .confirm-action:hover {
  background: #66c8b6;
}

.slot-pill-actions .cancel-action {
  color: var(--red);
}

.slot-pill-actions .cancel-action:hover {
  color: #fff2ef;
  background: var(--red-dim);
}

.booking-calendar-coverage {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 250px;
}

.user-default-zips {
  margin-top: 10px;
}

.booking-territory-options,
.user-default-territories,
.user-override-territories {
  display: grid;
  gap: 4px;
  max-height: 118px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.018);
}

.territory-option {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  color: var(--t2);
  font-size: 10px;
  cursor: pointer;
}

.territory-option span:not(.territory-color),
.territory-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.territory-option small {
  color: var(--t3);
}

.territory-color {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--territory-color, var(--teal));
}

.booking-calendar-coverage[data-coverage-mode='custom']
  .booking-territory-options,
.user-default-coverage[data-coverage-mode='custom'] .user-default-territories,
.user-calendar-override[data-coverage-mode='custom'] .user-override-territories,
.user-calendar-override[data-coverage-mode='inherit']
  .user-override-territories,
.user-calendar-override[data-coverage-mode='inherit'] .user-override-zips {
  display: none;
}

.booking-calendar-coverage[data-coverage-mode='territories']
  .booking-calendar-zips,
.user-default-coverage[data-coverage-mode='territories'] .user-default-zips,
.user-calendar-override[data-coverage-mode='territories'] .user-override-zips {
  display: none;
}

.user-calendar-override {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.018);
}

.user-calendar-override > strong {
  overflow: hidden;
  color: var(--t1);
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.territory-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.territory-summary > span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--t2);
  background: var(--bg3);
  font-size: 10px;
}

.territory-summary strong {
  color: var(--t1);
  font: 500 11px var(--f-mono);
}

.territory-summary .territory-overlap {
  border-color: rgba(201, 162, 75, 0.45);
  color: #e6c97f;
  background: var(--amber-dim);
}

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

.territory-setting-row {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
}

.territory-setting-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.territory-color-input {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-md);
  border-radius: 6px;
  padding: 3px;
  background: var(--bg3);
  cursor: pointer;
}

.territory-assignment-count {
  color: var(--t3);
  font-size: 9px;
  white-space: nowrap;
}

.territory-zips {
  min-height: 94px;
  font-family: var(--f-mono);
  font-size: 11px;
}

.territory-row-warning {
  margin-top: 7px;
  overflow: hidden;
  color: #e3c477;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .preference-mode-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 640px) {
  .preference-mode-tabs,
  .preference-time-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-team-filter {
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .slot-recommendation.top-choice {
    animation: none;
  }
}

@media (max-width: 1050px) {
  .board-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .slot-recommendations-list,
  .user-setting-grid,
  .user-outside-area-setting,
  .user-calendar-overrides,
  .incoming-webhook-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  #pageBooking .page {
    padding-top: calc(var(--top-h) + 16px);
  }

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

  .booking-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) 44px;
    width: 100%;
  }

  .booking-tab {
    min-width: 0;
    padding-inline: 6px;
    font-size: 12px;
    line-height: 1.2;
  }

  .board-toolbar {
    grid-template-columns: 1fr;
  }

  .incoming-call-row {
    grid-template-columns: 1fr;
  }
}

.board-toolbar label {
  display: grid;
  gap: 7px;
}

.board-toolbar span {
  color: var(--t3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.board-view-tabs {
  display: inline-flex;
  height: 42px;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
}

.board-view-btn {
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--t2);
  background: transparent;
  font: 800 12px var(--f-body);
  cursor: pointer;
}

.board-view-btn.active {
  color: #111;
  background: var(--gold);
}

.board-user-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 12px 26px 0;
}

.board-user-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  border: 1px solid rgba(201, 149, 42, 0.32);
  border-radius: 999px;
  padding: 4px 10px 4px 5px;
  color: var(--t2);
  background: rgba(255, 255, 255, 0.035);
  font: 800 11px var(--f-body);
  cursor: pointer;
}

.board-user-filter.active {
  color: #111;
  background: var(--gold);
}

.board-user-filter img,
.board-user-filter i {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111;
  background: rgba(201, 149, 42, 0.75);
  font-size: 10px;
  font-style: normal;
}

/* ── drag & drop на дошці ─────────────────────────────────────────────── */

.slot-pill.draggable {
  cursor: grab;
}

.slot-pill.draggable:active {
  cursor: grabbing;
}

.slot-pill.dragging {
  opacity: 0.45;
}

/* Ціль підсвічується тільки поки над нею тягнуть — щоб було видно,
   куди саме впаде зустріч. */
.slot-pill.drop-target {
  background: var(--gold-dim);
  box-shadow: inset 0 0 0 2px var(--gold);
}

/* Контейнер контенту дошки — якір для оверлея завантаження */
.board-content {
  position: relative;
  min-height: 240px;
}

/* Лоадер перекриває дошку цілком: попередня дата має зникнути, інакше
   CSR бачить старі слоти й вважає, що завантаження вже завершилось.
   Непрозорий фон замість очищення DOM — не стрибає верстка. */
.board-loader {
  align-items: center;
  background: var(--bg);
  bottom: 0;
  color: var(--t2);
  flex-direction: column;
  gap: 16px;
  justify-content: center;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 6;
}

.board-loader-spin {
  animation: board-loader-spin 0.8s linear infinite;
  border: 3px solid var(--border-md);
  border-radius: 50%;
  border-top-color: var(--gold);
  height: 46px;
  width: 46px;
}

.board-loader-text {
  color: var(--t2);
  font-size: 14px;
  letter-spacing: 0.02em;
}

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

@media (prefers-reduced-motion: reduce) {
  .board-loader-spin {
    animation-duration: 2.4s;
  }
}

.board-table-wrap {
  max-height: calc(100vh - 265px);
  overflow: auto;
  scrollbar-color: rgba(201, 149, 42, 0.55) rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
}

.board-blocks-wrap {
  max-height: calc(100vh - 292px);
  overflow: auto;
  padding: 18px 26px 26px;
  scrollbar-color: rgba(201, 149, 42, 0.55) rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
}

.board-blocks {
  display: grid;
  grid-template-columns: 148px repeat(
      var(--board-slot-count, 4),
      minmax(132px, 1fr)
    );
  gap: 8px;
  min-width: 900px;
}

.board-time-head {
  color: var(--t2);
  font: 800 13px var(--f-body);
  text-align: center;
  letter-spacing: 0.02em;
}

.board-user-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 50px;
  color: var(--t1);
  font: 750 11px var(--f-body);
  text-transform: uppercase;
}

.board-user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.board-user-nm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.board-user-type {
  font: 600 9px var(--f-body);
  color: var(--t2);
  text-transform: none;
  letter-spacing: 0.2px;
}

.board-user-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.board-user-badge {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(201, 162, 75, 0.16);
  border: 1px solid rgba(201, 162, 75, 0.35);
  color: var(--t1);
  font: 600 8.5px var(--f-body);
  text-transform: none;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.est-modal-empty {
  font: 500 13px var(--f-body);
  color: var(--t2);
  font-style: italic;
}

.est-modal-body .board-user-badges {
  gap: 6px;
}

.est-modal-body .board-user-badge {
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 12px;
  letter-spacing: 0.3px;
}

.board-user-zone {
  font: 500 9px var(--f-body);
  color: var(--t2);
  text-transform: none;
}

.board-corner-zone {
  display: flex;
  align-items: flex-end;
  font: 500 9px var(--f-body);
  color: var(--t2);
}

.est-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.55);
}

.est-modal {
  width: min(640px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: #14161b;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.est-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.est-modal-head h3 {
  margin: 0;
  font: 700 15px var(--f-body);
  color: var(--t1);
}

.est-modal-head button {
  background: none;
  border: none;
  color: var(--t2);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.est-modal-body {
  padding: 16px 18px;
  overflow: auto;
}

.est-modal-section {
  margin-bottom: 16px;
}

.est-modal-section:last-child {
  margin-bottom: 0;
}

.est-modal-section-label {
  font: 700 10px var(--f-body);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--t2);
  margin-bottom: 6px;
}

.est-modal-info {
  font: 500 13px var(--f-body);
  color: var(--t1);
  line-height: 1.45;
  white-space: pre-wrap;
}

.est-modal-info.is-empty {
  color: var(--t2);
  font-style: italic;
}

.est-modal-area-label {
  font: 600 11px var(--f-body);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--t2);
  margin-bottom: 8px;
}

.est-modal-map {
  width: 100%;
  height: 360px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.est-modal-zip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.est-modal-zip-list span {
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(201, 162, 75, 0.15);
  color: var(--t1);
  font: 600 11px var(--f-body);
}

.board-user-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  margin-left: auto;
  align-self: center;
  border-radius: 50%;
  border: 1px solid rgba(201, 162, 75, 0.4);
  background: rgba(201, 162, 75, 0.1);
  color: #d8b45c;
  font: 700 11px 'Georgia', serif;
  font-style: italic;
  text-transform: none;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.1s ease;
}

.board-user-info:hover {
  background: rgba(201, 162, 75, 0.24);
  border-color: rgba(201, 162, 75, 0.75);
}

.board-user-info:focus-visible {
  outline: 2px solid rgba(201, 162, 75, 0.6);
  outline-offset: 2px;
}

.board-user-info:active {
  transform: scale(0.92);
}

.board-user-cell img,
.board-user-cell i {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(244, 241, 232, 0.72);
  color: var(--t1);
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-style: normal;
}

.slot-pill {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 50px;
  border: 1px solid rgba(244, 241, 232, 0.12);
  border-radius: 999px;
  color: var(--t1);
  background: rgba(255, 255, 255, 0.028);
  text-align: center;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.slot-pill strong {
  display: block;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.1;
}

.slot-pill small {
  display: block;
  max-width: 132px;
  color: var(--t2);
  font-size: 10px;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-pill.open {
  border-color: rgba(73, 201, 164, 0.24);
  color: var(--green);
  background: rgba(73, 201, 164, 0.055);
}

.slot-pill.booked {
  border-color: rgba(73, 201, 164, 0.54);
  background: rgba(73, 201, 164, 0.14);
}

.slot-pill.busy {
  border-color: rgba(148, 163, 184, 0.5);
  background: rgba(148, 163, 184, 0.08);
}

.slot-pill.proposed {
  border-color: rgba(201, 149, 42, 0.58);
  background: repeating-linear-gradient(
    135deg,
    rgba(201, 149, 42, 0.18) 0,
    rgba(201, 149, 42, 0.18) 8px,
    rgba(12, 13, 13, 0.42) 8px,
    rgba(12, 13, 13, 0.42) 15px
  );
}

.slot-pill-actions {
  position: absolute;
  inset: 0;
  display: none;
  grid-template-columns: repeat(2, 1fr);
  border-radius: inherit;
  border: 1px solid rgba(201, 149, 42, 0.72);
  background: rgba(12, 13, 13, 0.98);
}

.slot-pill:hover .slot-pill-actions {
  display: grid;
}

.slot-pill-actions button {
  border: 0;
  color: var(--t1);
  background: transparent;
  font: 900 10px var(--f-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.slot-pill-actions button + button {
  border-left: 1px solid rgba(244, 241, 232, 0.42);
}

.slot-pill-actions .primary {
  color: #111;
  background: var(--gold);
}

.slot-pill-actions .danger {
  color: var(--error);
}

.board-info-modal {
  max-width: 420px;
}

.board-info-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.board-info-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(244, 241, 232, 0.1);
}

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

.board-info-row span {
  color: var(--t2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.board-info-row strong {
  color: var(--t1);
  font-size: 13px;
  text-align: right;
}

.board-confirm-badge {
  background: rgba(224, 82, 82, 0.16);
  color: var(--error);
}

.board-confirm-message {
  margin: 10px 0 18px;
  color: var(--t2);
  font-size: 14px;
  line-height: 1.5;
}

.board-confirm-actions {
  display: flex;
  gap: 12px;
}

.board-confirm-actions button {
  flex: 1;
  height: 44px;
  margin: 0;
}

.board-confirm-danger {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
}

.board-confirm-danger:hover {
  filter: brightness(1.08);
}

.board-modal-opps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 8px;
}

.board-modal-note {
  margin: 4px 0 10px;
  padding: 10px 12px;
  border: 1px solid rgba(201, 149, 42, 0.4);
  border-radius: var(--radius-sm);
  background: rgba(201, 149, 42, 0.08);
  color: var(--t2);
  font-size: 12.5px;
  line-height: 1.45;
}

.board-modal-opp-loading {
  padding: 12px;
  color: var(--t2);
  font-size: 13px;
}

.board-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(10px);
}

.board-modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  box-shadow: var(--shadow);
  padding: 22px;
}

.board-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.board-modal-head h2 {
  margin: 8px 0 0;
  color: var(--t1);
  font: 700 25px var(--f-serif);
}

.board-modal-summary,
.board-modal-contact {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  margin-bottom: 14px;
  color: var(--t2);
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
  line-height: 1.45;
}

.board-modal-summary {
  color: var(--t1);
}

.board-modal-search {
  margin-bottom: 12px;
}

.board-modal-summary strong {
  color: var(--t1);
}

#boardModalJobType {
  margin-bottom: 18px;
}

#boardModalOpportunity {
  margin-top: 10px;
}

.board-sms-box {
  margin-top: 14px;
}

.board-sms-box textarea {
  min-height: 96px;
}

.board-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.availability-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--t1);
  font-size: 13px;
}

.availability-table th,
.availability-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  vertical-align: top;
  text-align: left;
}

.availability-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(17, 18, 18, 0.96);
  color: var(--t3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.board-slot-main {
  display: grid;
  gap: 3px;
}

.board-slot-main strong {
  font-weight: 700;
}

.board-slot-main small,
.board-muted {
  color: var(--t3);
  font-size: 11px;
}

.board-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--t2);
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.board-status.booked {
  color: #0f261f;
  border-color: rgba(73, 201, 164, 0.6);
  background: var(--green);
}

.board-status.busy {
  color: var(--t2);
  border-color: rgba(148, 163, 184, 0.48);
  background: rgba(148, 163, 184, 0.1);
}

.board-status.proposed {
  color: var(--gold);
  border-color: rgba(201, 149, 42, 0.55);
  background: repeating-linear-gradient(
    135deg,
    rgba(201, 149, 42, 0.16) 0,
    rgba(201, 149, 42, 0.16) 6px,
    rgba(12, 13, 13, 0.58) 6px,
    rgba(12, 13, 13, 0.58) 12px
  );
}

.board-user-line {
  display: flex;
  align-items: center;
  gap: 9px;
}

.board-user-line img,
.board-user-line i {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111;
  background: rgba(201, 149, 42, 0.75);
  font-size: 11px;
  font-style: normal;
}

.board-inline-search {
  position: relative;
  min-width: 230px;
}

.board-inline-search .text-input,
.board-inline-select,
.board-address-preview {
  width: 100%;
  min-height: 36px;
  font-size: 12px;
}

.board-address-preview {
  color: var(--t2);
  line-height: 1.35;
}

.board-contact-menu,
.board-opportunity-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 5px);
  z-index: 2500;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(17, 18, 18, 0.98);
  box-shadow: var(--shadow);
  max-height: 230px;
  overflow: auto;
}

.board-contact-menu button,
.board-opportunity-menu button {
  display: grid;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 9px 10px;
  color: var(--t1);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.board-contact-menu small,
.board-opportunity-menu small {
  color: var(--t3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Segmented pill: the two actions read as one control (left dark, right gold),
   matching the Blocks-view slot pill. */
.board-actions {
  display: inline-flex;
  border: 1px solid rgba(201, 149, 42, 0.65);
  border-radius: 999px;
  overflow: hidden;
  vertical-align: middle;
}

.board-actions button {
  height: 34px;
  border: 0;
  border-radius: 0;
  padding: 0 18px;
  font: 800 12px var(--f-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.board-actions button + button {
  border-left: 1px solid rgba(201, 149, 42, 0.55);
}

.board-book-btn {
  color: #111;
  background: var(--gold);
}

.board-book-btn:hover {
  background: #d8b25a;
}

.board-reserve-btn {
  color: var(--t1);
  background: rgba(12, 13, 13, 0.55);
}

.board-reserve-btn:hover {
  background: rgba(12, 13, 13, 0.75);
}

.board-actions button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.reverse-map-shell,
.reverse-drawer {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.reverse-map-shell {
  position: relative;
  min-height: calc(100vh - 132px);
}

.reverse-map-toolbar {
  position: absolute;
  z-index: 500;
  top: 12px;
  left: 76px;
  right: 12px;
  max-width: none;
  display: block;
  gap: 10px;
  align-items: start;
}

.reverse-calendar-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-start;
}

.reverse-cal-chip,
.reverse-empty-chip {
  border: 1px solid rgba(201, 149, 42, 0.35);
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--t1);
  background: rgba(17, 18, 18, 0.86);
  font: 700 12px var(--f-body);
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.reverse-cal-chip.active {
  color: #111;
  background: var(--gold);
}

.reverse-address-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 6px;
  height: var(--booking-top-control-height);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(17, 18, 18, 0.9);
  backdrop-filter: blur(12px);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.booking-switch-row.map-active .reverse-address-wrap {
  grid-column: 2;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.reverse-address-wrap .text-input {
  width: 100%;
  min-height: 0;
  height: 100%;
}

.reverse-addr-suggestions {
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  width: 100%;
  max-height: 290px;
  z-index: 2400;
}

.reverse-addr-suggestions .addr-item {
  display: block;
  width: 100%;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  background: transparent;
  text-align: left;
  font-family: var(--f-body);
}

.reverse-address-btn {
  width: auto;
  min-width: 96px;
  height: 100%;
  margin: 0;
  padding: 0 18px;
}

.reverse-map-status {
  position: absolute;
  z-index: 500;
  left: 14px;
  bottom: 14px;
  max-width: min(520px, calc(100% - 28px));
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--t2);
  background: rgba(17, 18, 18, 0.88);
  font-size: 12px;
  backdrop-filter: blur(12px);
  display: none;
}

.reverse-map-status.warn {
  display: block;
  color: var(--gold);
  border-color: rgba(201, 149, 42, 0.45);
}

.reverse-map-users {
  position: absolute;
  z-index: 500;
  left: 14px;
  right: 14px;
  bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: auto;
}

.reverse-map-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 190px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--t1);
  background: rgba(17, 18, 18, 0.88);
  font-family: var(--f-body);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.reverse-map-user i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.reverse-map-user.muted {
  color: var(--t3);
  cursor: default;
}

.reverse-map-user.active {
  color: #111;
  border-color: rgba(201, 149, 42, 0.85);
  background: var(--gold);
}

.reverse-map-user.inactive-by-filter {
  opacity: 0.42;
}

#reverseMapEl {
  width: 100%;
  min-height: calc(100vh - 132px);
  background: #111;
}

.reverse-drawer {
  min-height: calc(100vh - 132px);
  max-height: calc(100vh - 132px);
  overflow-y: auto;
}

.reverse-date-card {
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.reverse-date-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.reverse-date-head strong {
  color: var(--t1);
  font-family: var(--f-head);
  font-size: 18px;
  letter-spacing: 0;
}

.mini-icon-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--t1);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

.reverse-date-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.reverse-date-grid .dp-dow,
.reverse-date-grid .dp-day {
  min-height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 11px;
}

.reverse-date-grid .dp-dow {
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.reverse-date-grid .dp-day {
  border: 1px solid var(--border);
  color: var(--t2);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
}

.reverse-date-grid .dp-day.empty {
  border-color: transparent;
  background: transparent;
  cursor: default;
}

.reverse-date-grid .dp-day.disabled {
  opacity: 0.35;
  cursor: default;
}

.reverse-date-grid .dp-day.today {
  border-color: rgba(70, 194, 199, 0.55);
}

.reverse-date-grid .dp-day.has-booked::after {
  content: '';
  width: 4px;
  height: 4px;
  margin-top: 1px;
  border-radius: 999px;
  background: var(--gold);
}

.reverse-date-grid .dp-day.selected {
  color: #111;
  border-color: rgba(201, 149, 42, 0.9);
  background: var(--gold);
}

.reverse-drawer-empty {
  padding: 22px;
  color: var(--t3);
  font-style: italic;
}

.reverse-drawer-content {
  padding: 16px;
}

.reverse-drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.reverse-drawer-head h2 {
  margin: 10px 0 0;
  color: var(--t1);
  font-family: var(--f-head);
  font-size: 26px;
  letter-spacing: 0;
}

.reverse-panel {
  display: none;
}

.reverse-panel.active {
  display: block;
}

.reverse-panel .field-row {
  grid-template-columns: 1fr;
}

.reverse-panel .text-input,
.reverse-panel .text-select,
.reverse-panel .text-area {
  width: 100%;
}

.reverse-panel .search-input-row {
  min-height: 48px;
}

.reverse-panel .search-wrap {
  margin-bottom: 12px;
}

.reverse-panel .search-icon {
  padding: 0 12px;
}

.reverse-opportunity-panel {
  padding: 12px;
}

.reverse-opportunity-panel .opportunity-list {
  max-height: 260px;
}

.reverse-search-results {
  position: static;
  margin-top: 6px;
  max-height: 250px;
  overflow-y: auto;
}

.reverse-result-item {
  width: 100%;
  display: grid;
  gap: 3px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 10px;
  color: var(--t1);
  background: transparent;
  cursor: pointer;
}

.reverse-result-item small,
.reverse-selected-contact small {
  color: var(--t3);
}

.reverse-selected-contact {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  padding: 11px;
  border: 1px solid rgba(70, 194, 199, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(70, 194, 199, 0.08);
}

.reverse-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.reverse-summary div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
}

.reverse-summary span {
  color: var(--t3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.reverse-pin-popup {
  display: grid;
  gap: 6px;
  min-width: 220px;
}

.reverse-pin-title {
  font-weight: 800;
  margin-bottom: 2px;
}

.reverse-popup-user {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  border: 1px solid rgba(201, 149, 42, 0.35);
  border-radius: 8px;
  padding: 7px 9px;
  background: rgba(17, 18, 18, 0.94);
  color: #fff;
  cursor: pointer;
}

.reverse-popup-user.active {
  border-color: rgba(201, 149, 42, 0.85);
  background: rgba(201, 149, 42, 0.22);
}

.reverse-popup-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.reverse-popup-slot {
  border: 1px solid rgba(70, 194, 199, 0.45);
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(70, 194, 199, 0.12);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
}

.reverse-popup-empty {
  color: #777;
  font-size: 12px;
}

@media (max-width: 1120px) {
  .reverse-booking {
    grid-template-columns: 1fr;
  }

  .reverse-address-wrap {
    max-width: none;
  }

  .reverse-drawer,
  .reverse-map-shell,
  #reverseMapEl {
    min-height: 560px;
    max-height: none;
  }
}

@media (max-width: 820px) {
  .booking-switch-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .reverse-address-wrap {
    display: none;
  }

  .booking-switch-row.map-active .reverse-address-wrap {
    display: grid;
    grid-column: 1;
  }
}

.progress {
  width: 100%;
  max-width: 1100px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pstep {
  flex: 1;
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.pstep::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.pstep.done::after {
  transform: scaleX(1);
}

.pstep.active::after {
  transform: scaleX(0.5);
}

.booked-slot {
  opacity: 0.72;
  cursor: not-allowed;
  border-color: rgba(224, 82, 82, 0.35);
  border-style: dashed;
  background: rgba(224, 82, 82, 0.08);
  color: var(--error);
  text-decoration: none;
  pointer-events: none;
}

.booked-slot small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.65;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reserved-slot {
  opacity: 0.85;
  cursor: not-allowed;
  border-color: rgba(224, 168, 0, 0.45);
  border-style: dashed;
  background: rgba(224, 168, 0, 0.1);
  color: var(--gold);
  text-decoration: none;
  pointer-events: none;
}

.reserved-slot small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* My own reservation — interactive, so I can convert it into a booking. */
.reserved-mine {
  border-color: rgba(224, 168, 0, 0.55);
  border-style: solid;
  background: rgba(224, 168, 0, 0.14);
  color: var(--gold);
  cursor: pointer;
}

.reserved-mine:hover,
.reserved-mine.selected {
  border-color: var(--gold);
  background: rgba(224, 168, 0, 0.22);
}

.reserved-mine small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unavailable-slot {
  opacity: 0.42;
  cursor: not-allowed;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.025);
  color: var(--t3);
  pointer-events: none;
}

.unavailable-slot small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.72;
}

.step {
  width: 100%;
  max-width: 1100px;
}

.step.hidden {
  display: none;
}

.step.leaving {
  opacity: 0;
  transform: translateY(-14px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.step.entering {
  animation: stepIn 0.4s ease forwards;
}

.step-narrow .card {
  max-width: 580px;
  margin: 0 auto;
}

#step2.step-details {
  max-width: 1100px;
}

#step2.step-details .card {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  overflow: visible;
}

#step2.step-details .card-top {
  border-radius: var(--radius) var(--radius) 0 0;
}

#step2.step-details .card-footer {
  border-radius: 0 0 var(--radius) var(--radius);
}

.step2-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 360px);
  gap: 26px;
  align-items: start;
}

.step2-fields-column,
.step2-notes-column {
  min-width: 0;
}

.step2-notes-column {
  position: sticky;
  top: var(--sticky-top, 76px);
  max-height: calc(100vh - var(--sticky-top, 76px) - 16px);
  overflow-y: auto;
  padding-left: 26px;
  padding-right: 4px;
  border-left: 1px solid var(--border);
  scrollbar-color: var(--border-hi) transparent;
  scrollbar-width: thin;
}

.step2-notes-field {
  margin-bottom: 14px;
}

#fldDescription {
  min-height: 330px;
  max-height: 58vh;
  line-height: 1.55;
}

.qualification-complete {
  max-width: 520px;
  margin: 34px auto;
  padding: 28px;
  border: 1px solid rgba(73, 201, 164, 0.38);
  border-radius: 8px;
  background: rgba(73, 201, 164, 0.08);
  text-align: center;
}

.qualification-complete[hidden] {
  display: none;
}

.qualification-complete-icon {
  display: grid;
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  place-items: center;
  border: 1px solid rgba(73, 201, 164, 0.46);
  border-radius: 50%;
  color: var(--green);
}

.qualification-complete h3 {
  margin-bottom: 6px;
  color: var(--t1);
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 400;
}

.qualification-complete p {
  color: var(--t2);
  font-size: 13px;
  line-height: 1.55;
}

.reverse-qualification-complete {
  margin: 18px 0 0;
  padding: 22px 18px;
}

#step4.step-narrow .card {
  max-width: 760px;
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  opacity: 0;
  animation: fadeUp 0.5s 0.1s ease forwards;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-top {
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    rgba(201, 149, 42, 0.04) 0%,
    transparent 100%
  );
}

.card-body {
  padding: 20px 26px;
}

.card-footer {
  padding: 13px 28px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-label {
  font-size: 11px;
  color: var(--t3);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gold-dim);
  border: 1px solid var(--border-hi);
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.step-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.step-header-row .step-badge {
  margin-bottom: 0;
}

.step-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-dim);
  border: 1px solid var(--green-hi);
  color: var(--green);
  font-family: var(--f-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition:
    border-color 0.18s,
    background 0.18s,
    color 0.18s;
}

.step-reset-btn::before {
  content: none;
}

.step-reset-btn:hover {
  background: rgba(76, 175, 106, 0.14);
  border-color: var(--green);
  color: var(--t1);
}

.step-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

h1 {
  font-family: var(--f-display);
  font-size: 28px;
  letter-spacing: 1px;
  color: var(--t1);
  line-height: 1.1;
  margin-bottom: 8px;
}

h1 span {
  color: var(--gold);
}

#step1 h1,
#step2 h1,
#step3 h1 {
  white-space: nowrap;
}

.subtitle {
  font-size: 13.5px;
  color: var(--t2);
  line-height: 1.6;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 22px 0 14px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.section-head:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

#step2 .card-body {
  padding-top: 16px;
}

#step2Form .section-head:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.section-head h3 {
  font-family: var(--f-display);
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--t1);
  font-weight: 400;
}

.section-head .sh-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.field {
  margin-bottom: 16px;
  position: relative;
}

.field-help {
  color: var(--t3);
  font-size: 11px;
  line-height: 1.35;
  margin-top: 6px;
}

.follow-up-calendar-field {
  margin: 14px 0 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.field-row .field {
  margin-bottom: 0;
}

.input-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  display: block;
}

.input-label .req {
  color: var(--gold);
  margin-left: 2px;
}

.field-label-row {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 6px;
}

.field-label-row .input-label {
  margin-bottom: 0;
}

.inline-check {
  align-items: center;
  color: var(--t1);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  gap: 7px;
  user-select: none;
}

.inline-check input[type='checkbox'] {
  appearance: none;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-md);
  border-radius: 5px;
  display: grid;
  flex: 0 0 18px;
  height: 18px;
  place-items: center;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  width: 18px;
}

.inline-check input[type='checkbox']::after {
  border-bottom: 2px solid #111;
  border-left: 2px solid #111;
  content: '';
  height: 4px;
  transform: rotate(-45deg) scale(0);
  transition: transform 0.12s ease;
  width: 8px;
}

.inline-check input[type='checkbox']:checked {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.14);
}

.inline-check input[type='checkbox']:checked::after {
  transform: rotate(-45deg) scale(1);
}

.text-input,
.text-select,
.text-area {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--t1);
  font-size: 13.5px;
  font-family: var(--f-body);
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.text-input[type='date'] {
  color: var(--t1);
  color-scheme: dark;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23f4eee6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4'/%3E%3Cpath d='M16 2v4'/%3E%3Crect width='18' height='18' x='3' y='4' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
  padding-right: 42px;
}

.text-input[type='date']::-webkit-calendar-picker-indicator {
  cursor: pointer;
  height: 100%;
  margin-right: -8px;
  opacity: 0;
  width: 38px;
}

.text-input[type='date']::-webkit-calendar-picker-indicator:hover {
  opacity: 0;
}

/* Native clock icon on time inputs is dark by default — invert it to white. */
.text-input[type='time']::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(1) brightness(1.6);
  opacity: 0.85;
}

.text-input[type='time']::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* Board date: make the field span the toolbar and act as one full-width
   calendar button — clicking anywhere on it opens the date picker. */
.board-toolbar .board-date-field {
  width: 100%;
}

#boardDateInput {
  position: relative;
  cursor: pointer;
}

#boardDateInput::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

/* Scheduling-preference date: clicking anywhere on the field opens the picker. */
#preferenceDate {
  position: relative;
  cursor: pointer;
}

#preferenceDate::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.text-input::placeholder,
.text-area::placeholder {
  color: var(--t3);
}

.text-input:focus,
.text-select:focus,
.text-area:focus {
  border-color: var(--border-hi);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.text-input.err,
.text-select.err,
.text-area.err {
  border-color: var(--error-hi);
  box-shadow: 0 0 0 3px var(--error-dim);
}

.text-area {
  min-height: 80px;
  resize: vertical;
  font-family: var(--f-body);
}

.text-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239B9894' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.text-select option {
  background: var(--bg3);
  color: var(--t1);
}

.service-area-warning {
  display: none;
  margin: -6px 0 18px;
  padding: 11px 13px;
  border: 1px solid rgba(210, 157, 38, 0.38);
  border-radius: var(--radius-sm);
  background: rgba(210, 157, 38, 0.1);
  color: var(--t2);
  font-size: 12px;
  line-height: 1.45;
}

.service-area-warning.shown {
  display: block;
}

.service-area-warning strong {
  color: var(--gold);
}

.search-wrap {
  position: relative;
  margin-bottom: 6px;
}

.search-input-row {
  display: flex;
  gap: 0;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.search-input-row:focus-within {
  border-color: var(--border-hi);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.search-icon {
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--t3);
  flex-shrink: 0;
}

.search-input-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--t1);
  font-family: var(--f-body);
  font-size: 14px;
  padding: 13px 0;
  min-width: 0;
}

.search-input-row input::placeholder {
  color: var(--t3);
}

.search-clear {
  display: none;
  align-items: center;
  padding: 0 12px;
  background: none;
  border: none;
  color: var(--t3);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: color 0.2s;
}

.search-clear:hover {
  color: var(--t2);
}

.search-clear.shown {
  display: flex;
}

.search-spin {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 12px;
  flex-shrink: 0;
}

.search-spin.shown {
  display: block;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: var(--bg3);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  z-index: 100;
  overflow: hidden;
  display: none;
}

.search-dropdown.shown {
  display: block;
  max-height: 386px;
  overflow-y: auto;
}

#step1 .card,
#step1 .card-body {
  overflow: visible;
}

.user-combobox {
  position: relative;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 90;
  display: none;
  max-height: 290px;
  overflow-y: auto;
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  background: var(--bg3);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.user-dropdown.shown {
  display: block;
}

.user-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--t1);
  text-align: left;
  cursor: pointer;
}

.user-option:hover,
.user-option.active {
  background: var(--bg4);
}

.user-option .sd-avatar {
  width: 28px;
  height: 28px;
}

.user-option small {
  display: block;
  color: var(--t3);
  font-size: 11px;
  margin-top: 1px;
}

.user-empty {
  padding: 13px;
  color: var(--t3);
  font-size: 12px;
  text-align: center;
}

.sd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.sd-item:last-child {
  border-bottom: none;
}

.sd-item:hover,
.sd-item.focused {
  background: var(--bg4);
}

.sd-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--border-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  font-family: var(--f-display);
  letter-spacing: 0.5px;
  overflow: hidden;
  position: relative;
}

.sd-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.sd-info {
  flex: 1;
  min-width: 0;
}

.sd-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--t1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sd-name mark {
  background: none;
  color: var(--gold);
  font-weight: 700;
}

.sd-meta {
  font-size: 11px;
  color: var(--t3);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sd-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--t3);
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 7px;
  flex-shrink: 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sd-empty {
  padding: 18px 14px;
  font-size: 12.5px;
  color: var(--t3);
  text-align: center;
  font-style: italic;
}

.sd-section-label {
  padding: 6px 14px 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
}

.input-hint {
  font-size: 11.5px;
  color: var(--t3);
  margin-bottom: 18px;
  min-height: 16px;
  line-height: 1.4;
  margin-top: 6px;
}

.input-hint.err {
  color: var(--error);
}

.input-hint.ok {
  color: var(--green);
}

.result-box {
  border-radius: var(--radius-sm);
  padding: 16px;
  display: none;
  margin-bottom: 16px;
}

@keyframes resultIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-box.found {
  background: var(--green-dim);
  border: 1px solid var(--green-hi);
  animation: resultIn 0.3s ease;
}

.found-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.found-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(76, 175, 106, 0.15);
  border: 1px solid var(--green-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.found-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
}

.found-tag {
  font-size: 11px;
  color: var(--green);
}

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

.cf {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 8px 11px;
}

.cf.full {
  grid-column: 1 / -1;
}

.cf-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 2px;
}

.cf-val {
  font-size: 12.5px;
  color: var(--t1);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cf-val.empty {
  color: var(--t3);
  font-style: italic;
  font-weight: 400;
}

.opportunity-panel {
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin: 0 0 16px;
}

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

.opportunity-title {
  color: var(--t1);
  font-family: var(--f-display);
  font-size: 17px;
  letter-spacing: 0.04em;
}

.opportunity-subtitle {
  color: var(--t3);
  font-size: 11px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opportunity-note {
  background: rgba(201, 149, 42, 0.08);
  border: 1px solid rgba(201, 149, 42, 0.26);
  border-radius: var(--radius-sm);
  color: var(--t2);
  font-size: 11.5px;
  line-height: 1.35;
  margin: 0 0 10px;
  padding: 8px 10px;
}

.schedule-rule-note {
  margin-top: -4px;
}

.opportunity-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-height: 330px;
  overflow-y: auto;
  padding-right: 3px;
}

.opportunity-card {
  width: 100%;
  text-align: left;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition:
    background 0.16s,
    border-color 0.16s,
    box-shadow 0.16s;
}

.opportunity-card-new {
  align-items: center;
  display: flex;
  gap: 10px;
  min-height: 56px;
}

.opportunity-new-icon {
  align-items: center;
  background: rgba(76, 175, 106, 0.12);
  border: 1px solid var(--green-hi);
  border-radius: 50%;
  color: var(--green);
  display: flex;
  flex: 0 0 28px;
  font-size: 18px;
  font-weight: 500;
  height: 28px;
  justify-content: center;
  line-height: 1;
  width: 28px;
}

.opportunity-new-copy {
  color: var(--t3);
  font-size: 11px;
  font-weight: 400;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opportunity-card:hover {
  background: var(--bg4);
  border-color: var(--border-md);
}

.opportunity-card.disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.opportunity-card.disabled:hover {
  background: var(--bg3);
  border-color: var(--border);
}

.opportunity-card.selected {
  background: var(--green-dim);
  border-color: var(--green-hi);
  box-shadow: 0 0 0 2px rgba(76, 175, 106, 0.16);
}

.opportunity-card-top {
  display: block;
  gap: 10px;
  margin-bottom: 8px;
  min-width: 0;
  width: 100%;
}

.opportunity-card:not(.opportunity-card-new) .opportunity-card-top {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.opportunity-card-new .opportunity-card-top {
  margin-bottom: 0;
}

.opportunity-name {
  color: var(--t1);
  font-size: 13px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opportunity-status {
  border: 1px solid var(--border-md);
  border-radius: 999px;
  color: var(--t1);
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  text-transform: uppercase;
}

.opportunity-status.won {
  background: var(--green-dim);
  border-color: var(--green-hi);
  color: var(--green);
}

.opportunity-status.lost {
  background: rgba(228, 92, 79, 0.1);
  border-color: rgba(228, 92, 79, 0.45);
  color: var(--error);
}

.opportunity-fields {
  display: grid;
  gap: 8px;
}

.opportunity-field-row {
  align-items: start;
  display: grid;
  gap: 12px;
}

.opportunity-field-row-main {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 0.8fr);
}

.opportunity-field-row-sub {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 0.8fr);
}

.opportunity-field {
  min-width: 0;
}

.opportunity-field.align-left {
  text-align: left;
}

.opportunity-field.align-center {
  text-align: center;
}

.opportunity-field.align-right {
  text-align: right;
}

.opportunity-field-label {
  color: var(--t3);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.opportunity-field-value {
  color: var(--t1);
  font-size: 11.5px;
  font-weight: 400;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opportunity-disabled-reason {
  color: var(--t3);
  font-size: 10.5px;
  line-height: 1.35;
  margin-top: 8px;
}

.opportunity-empty {
  color: var(--t3);
  font-size: 12px;
  font-style: italic;
  padding: 10px 2px 2px;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--gold);
  border: none;
  border-radius: var(--radius-sm);
  color: #111;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--f-body);
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.1s;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}

.btn-primary.shown {
  display: flex;
}

.lookup-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.lookup-action-row .btn-primary,
.lookup-action-row .btn-outline-gold {
  display: inline-flex;
  width: 100%;
  margin-bottom: 0;
  min-height: 48px;
}

.lookup-action-row .lookup-single-action {
  grid-column: 1 / -1;
}

.btn-outline-gold {
  padding: 14px;
  background: #111;
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--f-body);
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.1s,
    border-color 0.2s;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-outline-gold:hover {
  background: rgba(210, 166, 63, 0.12);
  border-color: var(--gold-hi);
}

.btn-primary:hover {
  background: var(--gold-hi);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  color: var(--t2);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--f-body);
  cursor: pointer;
  transition: all 0.2s;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 10px;
}

.btn-secondary.shown {
  display: flex;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--t1);
}

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

.step-actions .back-btn {
  margin-bottom: 0;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--t3);
  font-size: 12px;
  font-family: var(--f-body);
  font-weight: 500;
  cursor: pointer;
  padding: 6px 0;
  margin-bottom: 16px;
  transition: color 0.2s;
}

.back-btn:hover {
  color: var(--t2);
}

.contact-pill {
  display: none;
  align-items: center;
  gap: 10px;
  background: var(--green-dim);
  border: 1px solid var(--green-hi);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.contact-pill.shown {
  display: flex;
}

.pill-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(76, 175, 106, 0.15);
  border: 1px solid var(--green-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.pill-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--t1);
}

.pill-sub {
  font-size: 11px;
  color: var(--green);
}

.addr-wrap {
  position: relative;
}

.addr-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg3);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  z-index: 50;
  max-height: 280px;
  overflow-y: auto;
  display: none;
}

.addr-suggestions.shown {
  display: block;
}

.addr-item {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--t1);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.addr-item:last-child {
  border-bottom: none;
}

.addr-item:hover,
.addr-item.active {
  background: var(--bg4);
}

.addr-item .ai-main {
  color: var(--t1);
  font-weight: 500;
}

.addr-item .ai-sub {
  color: var(--t3);
  font-size: 11.5px;
  margin-top: 1px;
}

.addr-loading {
  padding: 12px;
  font-size: 12px;
  color: var(--t3);
  text-align: center;
  font-style: italic;
}

.cal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.cal-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cal-card:hover {
  border-color: var(--border-md);
  background: var(--bg4);
}

.cal-card.selected {
  border-color: var(--gold);
  background: var(--gold-dim);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.cal-card.loading {
  opacity: 0.78;
}

.cal-card.loading .cal-name::after {
  content: ' loading';
  color: var(--t3);
  font-weight: 400;
}

.cal-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--gold-dim);
  border: 1px solid var(--border-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}

.cal-info {
  flex: 1;
  min-width: 0;
}

.cal-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-card .check {
  color: var(--gold);
  display: none;
}

.cal-card.selected .check {
  display: block;
}

.tz-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.tz-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--border-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}

.tz-info {
  flex: 1;
  min-width: 0;
}

.tz-label {
  font-size: 11px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}

.tz-source {
  font-size: 10.5px;
  color: var(--t3);
  margin-top: 1px;
}

.tz-select {
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 28px 7px 10px;
  color: var(--t1);
  font-size: 12.5px;
  font-family: var(--f-body);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239B9894' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  max-width: 50%;
}

.tz-select:focus {
  border-color: var(--border-hi);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.date-picker {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}

.dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.dp-month {
  font-family: var(--f-display);
  font-size: 16px;
  letter-spacing: 1px;
  color: var(--t1);
}

.dp-nav {
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--t2);
  transition: all 0.2s;
}

.dp-nav:hover {
  color: var(--t1);
  border-color: var(--border-md);
}

.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.dp-dow {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 0;
}

.dp-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 13px;
  color: var(--t2);
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  position: relative;
}

.dp-day:hover:not(.disabled):not(.empty) {
  background: var(--bg4);
  color: var(--t1);
}

.dp-day.disabled {
  color: var(--t3);
  cursor: not-allowed;
  opacity: 0.4;
}

.dp-day.empty {
  cursor: default;
}

.dp-day.today {
  border-color: var(--border-md);
}

.dp-day.selected {
  background: var(--gold);
  color: #111;
  font-weight: 700;
  border-color: var(--gold);
}

.dp-day.has-booked::after {
  content: '';
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--error);
}

.dp-day.has-booked.selected::after {
  background: #111;
}

.ext-cal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--t2);
}

.ext-cal-bar .ecb-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--t3);
  flex-shrink: 0;
  transition: background 0.3s;
}

.ext-cal-bar.loaded .ecb-dot {
  background: var(--green);
}

.ext-cal-bar.err .ecb-dot {
  background: var(--error);
}

.ext-cal-bar.loading .ecb-dot {
  animation: pulse 1s infinite;
  background: var(--gold);
}

.ext-cal-bar .ecb-label {
  font-weight: 600;
  color: var(--t1);
}

.ext-cal-bar .ecb-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--t3);
  text-align: right;
}

.estimator-block {
  margin-bottom: 18px;
}

.estimator-block:last-child {
  margin-bottom: 0;
}

.est-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.est-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--border-hi);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
}

.est-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.est-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--t1);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.est-meta {
  font-size: 11px;
  color: var(--t3);
  white-space: nowrap;
}

.ext-conflict-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(224, 82, 82, 0.12);
  border: 1px solid rgba(224, 82, 82, 0.3);
  color: var(--error);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.04em;
  vertical-align: middle;
  margin-left: 6px;
}

.slot-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 10px 0 6px;
  padding-left: 2px;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 6px;
}

.slot-grid.busy {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.slot {
  padding: 9px 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--t1);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  font-weight: 500;
  font-family: var(--f-body);
}

.slot:hover {
  background: var(--bg4);
  border-color: var(--border-md);
}

.slot.selected {
  background: var(--gold);
  color: #111;
  border-color: var(--gold);
  font-weight: 700;
}

.slot.ext-busy {
  background: rgba(224, 82, 82, 0.08);
  border: 1px solid rgba(224, 82, 82, 0.25);
  color: var(--error);
  cursor: not-allowed;
  opacity: 0.7;
}

.slot.ext-busy:hover {
  background: rgba(224, 82, 82, 0.08);
  border-color: rgba(224, 82, 82, 0.25);
}

.slot.busy {
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  color: var(--t3);
  cursor: not-allowed;
  padding: 7px 8px;
  line-height: 1.3;
}

.slot.busy:hover {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.1);
}

.slot.busy .b-time {
  font-size: 12px;
  color: var(--t2);
  font-weight: 600;
}

.slot.busy .b-loc {
  font-size: 10.5px;
  color: var(--t3);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-empty {
  font-size: 12px;
  color: var(--t3);
  padding: 12px;
  text-align: center;
  font-style: italic;
}

.step3-layout {
  display: grid;
  grid-template-columns: 560px 1fr;
  gap: 12px;
  align-items: start;
}

.step3-layout.no-map-selected {
  grid-template-columns: minmax(430px, 0.92fr) minmax(360px, 1.08fr);
}

.step3-layout.no-map-selected > .card {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 118px);
  min-height: 0;
}

.step3-layout.no-map-selected > .card .card-body {
  overflow-y: auto;
}

.map-column {
  position: sticky;
  top: var(--sticky-top, 84px);
  display: flex;
  flex-direction: column;
}

@media (max-width: 920px) {
  .step2-form-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .step2-notes-column {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 20px 0 0;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  #fldDescription {
    min-height: 190px;
    max-height: none;
  }

  .step3-layout {
    grid-template-columns: 1fr;
  }

  .step3-layout.no-map-selected {
    grid-template-columns: 1fr;
  }

  .step3-layout.no-map-selected > .card {
    max-height: none;
  }

  .step3-layout.no-map-selected > .card .card-body {
    overflow: visible;
  }

  .map-column {
    position: static;
  }
}

.map-panel {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--bg2);
  opacity: 0;
  animation: fadeUp 0.5s 0.2s ease forwards;
}

.map-column.map-disabled {
  position: static;
}

.map-column.map-disabled .map-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  animation: none;
  opacity: 1;
}

.map-column.map-disabled .map-panel-head,
.map-column.map-disabled #mapEl,
.map-column.map-disabled .map-selection-summary {
  display: none;
}

.map-column.map-disabled .map-action-bar {
  margin-top: 0;
  padding: 0;
}

.schedule-inline-action {
  margin-top: 12px;
}

.schedule-inline-action .btn-primary {
  margin-bottom: 0;
}

.no-map-slot-panel {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--bg2);
  opacity: 0;
  animation: fadeUp 0.5s 0.12s ease forwards;
  max-height: calc(100vh - 118px);
  min-height: 0;
}

.no-map-slot-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    rgba(201, 149, 42, 0.04) 0%,
    transparent 100%
  );
}

.no-map-slot-title {
  color: var(--t1);
  font-family: var(--f-head);
  font-size: 20px;
  letter-spacing: 0;
}

.no-map-slot-sub {
  margin-top: 3px;
  color: var(--t3);
  font-size: 12px;
}

.side-slots-scroll {
  max-height: calc(100vh - 188px);
  overflow-y: auto;
  padding: 12px;
}

.side-slots-scroll .member-slot-block:last-child {
  margin-bottom: 0;
}

.map-panel-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    rgba(201, 149, 42, 0.04) 0%,
    transparent 100%
  );
}

.map-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.map-title-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.map-panel-title {
  font-family: var(--f-display);
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--t1);
}

.map-panel-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.map-estimator-toggles {
  width: 100%;
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  justify-content: stretch;
}

.map-estimator-toggle {
  width: 100%;
  min-width: 0;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg3);
  color: var(--t2);
  font: inherit;
  font-size: 9.5px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  outline: none;
  cursor: pointer;
  transition: 0.15s ease;
}

.map-estimator-toggle.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #111;
  font-weight: 700;
}

#mapEl {
  height: min(400px, calc(100vh - var(--sticky-top, 84px) - 220px));
  min-height: 300px;
  background: var(--bg3);
}

.map-selection-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg3);
}

.map-selection-item {
  min-width: 0;
  padding: 0 10px;
  border-left: 1px solid var(--border);
}

.map-selection-item:first-child {
  padding-left: 0;
  border-left: 0;
}

.map-selection-item:last-child {
  padding-right: 0;
}

.map-selection-item span,
.map-selection-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-selection-item span {
  margin-bottom: 3px;
  color: var(--t3);
  font: 500 9px/1.2 var(--f-mono);
  text-transform: uppercase;
}

.map-selection-item strong {
  color: var(--t1);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
}

.map-action-bar {
  padding: 0 14px 14px;
}

.map-action-bar .btn-primary {
  margin-bottom: 0;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 14px;
  padding: 5px;
  gap: 5px;
}

.rv-row {
  background: var(--bg3);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
}

.rv-key {
  font-size: 11px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  padding-top: 1px;
}

.rv-val {
  font-size: 13px;
  color: var(--t1);
  font-weight: 500;
  word-break: break-word;
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--green-dim);
  border: 2px solid var(--green-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  color: var(--green);
  font-size: 30px;
  animation: successPop 0.5s ease;
}

@keyframes successPop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  70% {
    transform: scale(1.15);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.inline-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px;
  color: var(--t3);
  font-size: 13px;
}

.inline-loader .ldr-spin,
.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top-color: #111;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.inline-loader .ldr-spin {
  width: 16px;
  height: 16px;
  border-color: var(--border);
  border-top-color: var(--gold);
}

.btn-spinner {
  display: none;
}

.error-box {
  background: var(--error-dim);
  border: 1px solid var(--error-hi);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--error);
  line-height: 1.5;
  display: none;
}

.error-box.shown {
  display: block;
}

.error-box strong {
  color: var(--t1);
}

.error-box code {
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11.5px;
}

.booking-switch-row .reverse-address-wrap {
  box-sizing: border-box;
  align-items: stretch;
}

.booking-switch-row .reverse-address-wrap .text-input {
  box-sizing: border-box;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 14px;
}

.booking-switch-row .reverse-address-wrap .reverse-address-btn.btn-primary {
  box-sizing: border-box;
  width: auto;
  min-width: 96px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 18px;
  align-self: stretch;
}

.reverse-drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reverse-reset-btn {
  height: 29px;
  color: var(--green);
  border-color: rgba(73, 201, 164, 0.48);
  background: rgba(73, 201, 164, 0.1);
}

.honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.leaflet-container {
  background: #1a1a1e;
}

.leaflet-tile-pane {
  filter: brightness(0.72) saturate(0.55);
}

.leaflet-control-attribution {
  font-size: 9px;
  opacity: 0.35;
}

.leaflet-popup-content-wrapper {
  background: var(--bg3);
  border: 1px solid var(--border-md);
  color: var(--t1);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  font-family: var(--f-body);
  font-size: 12.5px;
}

.leaflet-popup-tip {
  background: var(--bg3);
}

.leaflet-popup-content b {
  color: var(--gold);
}

.leaflet-popup-content small {
  color: var(--t3);
  display: block;
  margin-top: 2px;
}

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

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

@media (max-width: 540px) {
  .card-top,
  .card-body,
  .card-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

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

  .cf-grid {
    grid-template-columns: 1fr;
  }

  .opportunity-fields {
    gap: 8px;
  }

  .opportunity-field-row-main,
  .opportunity-field-row-sub {
    grid-template-columns: 1fr;
  }

  .opportunity-field.align-center,
  .opportunity-field.align-right {
    text-align: left;
  }

  .opportunity-list {
    grid-template-columns: 1fr;
  }

  .lookup-action-row,
  .booking-group-topline {
    grid-template-columns: 1fr;
  }

  .booking-calendar-layout,
  .booking-calendar-mainline,
  .booking-calendar-template-line,
  .booking-external-fields {
    grid-template-columns: 1fr;
  }

  .opportunity-card:not(.opportunity-card-new) .opportunity-card-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .cf.full {
    grid-column: 1;
  }

  .rv-row {
    grid-template-columns: 100px 1fr;
  }

  .review-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }

  #step1 h1,
  #step2 h1 {
    white-space: normal;
  }

  .slot-grid.busy {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .tz-row {
    flex-wrap: wrap;
  }

  .tz-select {
    max-width: 100%;
  }

  #mapEl {
    height: 320px;
  }

  .map-panel-head {
    padding: 12px;
  }

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

.member-slot-block {
  border: 1px solid rgba(201, 149, 42, 0.25);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.member-slot-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

.member-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(201, 149, 42, 0.55);
  background: #1f1f21;
  color: #c9952a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 17px;
}

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-name {
  font-weight: 600;
  color: #fff;
  line-height: 1.1;
}

.member-email {
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
}

.slot-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 9px 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
  cursor: pointer;
  font: inherit;
  transition: 0.18s ease;
}

.slot-btn:hover {
  border-color: rgba(201, 149, 42, 0.65);
  background: rgba(201, 149, 42, 0.12);
}

.slot-btn.selected {
  color: #111;
  background: #c9952a;
  border-color: #e0aa3e;
}

.slot-btn.unavailable-slot {
  opacity: 0.42;
  cursor: not-allowed;
  border-style: dashed;
  color: rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.025);
  pointer-events: none;
}

.slot-btn.unavailable-slot small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.72;
}

.slot-empty {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  padding: 6px 0;
}

.slot-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 6px;
}

.review-item {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.035);
}

.review-label {
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
}

.review-value {
  color: #fff;
  font-weight: 500;
  font-size: 14px;
  word-break: break-word;
}

/* ── Toast ─────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  border: 1px solid var(--border-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  font-size: 14px;
  font-weight: 500;
  color: var(--t1);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.toast.toast--show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.toast.toast--success {
  border-color: var(--green-hi);
  color: var(--green);
  background: color-mix(in srgb, var(--bg2) 92%, var(--green));
}

.toast.toast--error {
  border-color: var(--error-hi);
  color: var(--error);
  background: color-mix(in srgb, var(--bg2) 92%, var(--error));
}

.toast-icon {
  font-size: 16px;
  line-height: 1;
}

/* ── Settings ──────────────────────────────────────── */

.settings-success {
  background: var(--green-dim);
  border: 1px solid var(--green-hi);
  color: var(--green);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}

.input-hint-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  font-weight: 500;
  color: var(--t3);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

/* ── Calendar multi-select ─────────────────────────── */

.cal-select-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.cal-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg3);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.cal-check-item:hover {
  border-color: var(--border-md);
  background: var(--bg4);
}

.cal-check-item.checked {
  border-color: var(--border-hi);
  background: var(--gold-dim);
}

.cal-check-item input[type='checkbox'] {
  display: none;
}

.cal-check-box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-md);
  background: var(--bg2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.cal-check-item.checked .cal-check-box {
  border-color: var(--gold);
  background: var(--gold);
}

.cal-check-tick {
  display: none;
  color: #000;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.cal-check-item.checked .cal-check-tick {
  display: block;
}

.cal-check-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--t1);
  flex: 1;
}

.cal-select-empty {
  color: var(--t3);
  font-size: 13px;
  padding: 8px 0;
}

/* ── Job type tag input ────────────────────────────── */

.booking-group-settings {
  display: grid;
  gap: 14px;
}

.booking-group-editor {
  border: 1px solid var(--border);
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.booking-group-topline {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.booking-group-topline .field {
  margin-bottom: 0;
}

.booking-add-calendar {
  align-self: end;
  min-height: 40px;
  white-space: nowrap;
}

.booking-calendar-lines {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.booking-calendar-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
}

.booking-calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.42fr);
  gap: 12px;
  align-items: start;
}

.booking-calendar-left {
  min-width: 0;
}

.booking-calendar-mainline {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto 28px;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--t1);
  font-size: 13px;
  font-weight: 700;
}

.booking-calendar-select-field {
  margin-bottom: 0;
}

.booking-calendar-template-line {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.booking-calendar-template-line .field {
  margin-bottom: 0;
}

.booking-map-check {
  min-height: 32px;
  padding: 0 8px;
  white-space: nowrap;
}

.booking-mode-check {
  min-width: 102px;
}

.booking-calendar-zips {
  display: none;
  resize: vertical;
  min-height: 112px;
  max-height: 112px;
}

.booking-calendar-row.map-enabled .booking-calendar-zips {
  display: block;
}

.booking-external-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
}

.booking-external-fields .field {
  margin-bottom: 0;
}

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  min-height: 0;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border-md);
  border-radius: 20px;
  padding: 5px 10px 5px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--t1);
  animation: chipIn 0.15s ease;
}

@keyframes chipIn {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.chip-remove {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--t3);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  padding: 0;
}

.chip-remove:hover {
  background: var(--error-dim);
  color: var(--error);
}

.tag-input-row {
  display: flex;
  gap: 8px;
}

.tag-input-row .text-input {
  flex: 1;
}

.btn-tag-add {
  flex-shrink: 0;
  padding: 0 18px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hi);
  background: var(--gold-dim);
  color: var(--gold);
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-tag-add:hover {
  background: var(--gold);
  color: #000;
}

/* ── Authorization page ── */
.auth-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--t1);
}

.auth-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--border-hi);
}

.auth-status-dot--ok {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}
.auth-status-dot--err {
  background: var(--error);
  box-shadow: 0 0 6px var(--error);
}

.auth-hint {
  font-size: 13px;
  color: var(--t2);
  line-height: 1.6;
  margin: 0 0 20px;
}

/* Source Intelligence style overrides */
:root {
  --bg: #0d0f0e;
  --bg2: #15191a;
  --bg3: #1b2122;
  --bg4: #202728;
  --border: #252d2e;
  --border-md: #323c3d;
  --border-hi: rgba(201, 162, 75, 0.42);
  --gold: #c9a24b;
  --gold-hi: #d8b45c;
  --gold-dim: rgba(201, 162, 75, 0.14);
  --gold-glow: rgba(201, 162, 75, 0.16);
  --t1: #e8ece9;
  --t2: #8c9894;
  --t3: #5c6a66;
  --green: #4fb3a0;
  --green-dim: rgba(79, 179, 160, 0.1);
  --green-hi: rgba(79, 179, 160, 0.32);
  --teal: #4fb3a0;
  --teal-dim: rgba(79, 179, 160, 0.12);
  --blue: #6c9ee8;
  --blue-dim: rgba(108, 158, 232, 0.12);
  --amber: #c9a24b;
  --amber-dim: rgba(201, 162, 75, 0.14);
  --red: #cd5b45;
  --red-dim: rgba(205, 91, 69, 0.14);
  --error: #cd5b45;
  --error-dim: rgba(205, 91, 69, 0.12);
  --error-hi: rgba(205, 91, 69, 0.32);
  --radius: 8px;
  --radius-sm: 6px;
  --f-display: 'Fraunces', serif;
  --f-serif: 'Fraunces', serif;
  --f-body: 'Inter', system-ui, -apple-system, sans-serif;
  --f-mono: 'JetBrains Mono', monospace;
  --sidebar-w: 210px;
  --top-h: 60px;
  --sticky-top: calc(var(--top-h) + 16px);
  --shadow: none;
}

body {
  font-size: 14px;
  line-height: 1.5;
}

body::before {
  display: none;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--top-h);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(13, 15, 14, 0.97);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--f-display);
  font-size: 17px;
  font-weight: 600;
}

.brand-logo {
  width: 36px;
  height: 36px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(201, 162, 75, 0.38);
  border-radius: 8px;
  background: #101313;
}

.brand-logo span {
  display: block;
  border-radius: 2px;
  background: var(--gold);
}

.brand-logo span:nth-child(1) {
  height: 9px;
}
.brand-logo span:nth-child(2) {
  height: 15px;
}
.brand-logo span:nth-child(3) {
  height: 21px;
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
}

.brand-title small {
  margin-left: 7px;
  color: var(--t3);
  font-family: var(--f-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.company {
  padding-left: 16px;
  border-left: 1px solid var(--border);
  color: var(--t2);
  font-size: 13px;
}

.company b {
  color: var(--t1);
  font-weight: 600;
}

.saved-label {
  color: var(--t3);
  font-family: var(--f-mono);
  font-size: 11px;
}

.app-layout {
  padding-top: var(--top-h);
}

.sidebar {
  position: fixed;
  top: var(--top-h);
  bottom: 0;
  left: 0;
  width: var(--sidebar-w);
  height: auto;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
}

.sidebar-brand {
  padding: 0 10px 8px;
  border: 0;
  color: var(--t3);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-nav {
  padding: 0;
}

.nav-item {
  border: 0;
  border-radius: 9px;
  font-size: 13.5px;
}

.nav-item.active {
  background: linear-gradient(
    90deg,
    rgba(201, 162, 75, 0.14),
    rgba(201, 162, 75, 0.03)
  );
  border-color: transparent;
}

.main-content {
  margin-left: var(--sidebar-w);
}

.page {
  align-items: stretch;
  max-width: 1200px;
  margin: 0 auto;
  padding: 26px 28px 80px;
}

h1 {
  font-family: var(--f-display);
  font-size: 25px;
  letter-spacing: 0;
}

.card {
  border-color: var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
}

.card-top {
  background: transparent;
}

.card-top-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.settings-sync-btn {
  width: auto;
  height: 42px;
  margin: 0;
  padding: 0 18px;
  flex: 0 0 auto;
}

.settings-sync-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.settings-sync-status {
  font-size: 13px;
  color: var(--t2);
  margin-bottom: 14px;
}

.settings-sync-status:empty {
  display: none;
}

.settings-sync-status.ok {
  color: var(--good, #2e7d32);
}

.settings-sync-status.error {
  color: var(--bad, #c62828);
}

.text-input,
.text-select,
.text-area,
.search-input-row,
.cal-card,
.tz-row,
.member-slot-block,
.slot-btn,
.review-item {
  background: var(--bg3);
  border-color: var(--border-md);
}

#pageSettings > .page:not(.settings-page) {
  display: none;
}

#pageAuth {
  display: none !important;
}

.btn-primary.compact,
.btn-secondary.compact {
  width: auto;
  min-width: 130px;
  margin: 0;
}

.analytics-page,
.settings-page {
  gap: 18px;
}

.analytics-toolbar,
.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.analytics-filterbar {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.analytics-filterbar label {
  display: grid;
  gap: 5px;
  color: var(--t3);
  font-family: var(--f-mono);
  font-size: 9px;
  text-transform: uppercase;
}

.analytics-filterbar .text-input {
  width: 142px;
  height: 36px;
  padding: 7px 10px;
}

#analyticsDateBasis {
  width: 190px;
}

.analytics-filterbar .btn-primary,
.analytics-filterbar .btn-secondary {
  min-width: 92px;
  height: 36px;
}

.analytics-count-mode {
  display: flex;
  height: 36px;
  padding: 3px;
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  background: var(--bg3);
}

.analytics-count-mode button {
  min-width: 58px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--t3);
  font-size: 11px;
  cursor: pointer;
}

.analytics-count-mode button.active {
  background: var(--gold-dim);
  color: var(--gold);
}

.analytics-freshness {
  color: var(--t3);
  font-family: var(--f-mono);
  font-size: 10px;
}

.analytics-freshness::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
}

.metric-card[data-analytics-metric],
.metric-link {
  cursor: pointer;
}

.metric-card[data-analytics-metric]:hover {
  background: var(--bg3);
}

.metric-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--gold);
  font: inherit;
  font-weight: 700;
}

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

.analytics-chart-legend {
  display: flex;
  gap: 14px;
  color: var(--t2);
  font-size: 11px;
}

.analytics-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.analytics-chart-legend i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.analytics-chart-legend .lead {
  background: var(--gold);
}

.analytics-chart-legend .appointment {
  background: var(--green);
}

.analytics-volume-chart {
  position: relative;
  min-height: 280px;
}

.analytics-volume-chart .u-wrap {
  font-family: var(--f-body);
}

.analytics-chart-empty {
  min-height: 260px;
  display: grid;
  place-items: center;
  color: var(--t3);
}

.analytics-chart-tooltip {
  position: absolute;
  z-index: 10;
  padding: 9px 12px;
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  background: #0a0c0b;
  color: var(--t1);
  font-size: 12px;
  line-height: 1.55;
  pointer-events: none;
}

.analytics-chart-tooltip strong,
.analytics-chart-tooltip span {
  display: block;
}

.analytics-chart-tooltip strong {
  color: var(--gold);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
}

.metric-card {
  padding: 16px;
  background: var(--bg2);
}

.metric-card span {
  display: block;
  color: var(--t3);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  color: var(--t1);
  font-family: var(--f-display);
  font-size: 30px;
}

.metric-card small {
  color: var(--t2);
}

.analytics-grid,
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
}

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

.insight-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  padding: 16px;
}

.insight-panel h3 {
  margin-bottom: 12px;
  color: var(--t2);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.insight-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(120px, 1.4fr) 54px;
  gap: 10px;
  align-items: center;
  margin-bottom: 9px;
  color: var(--t2);
  font-size: 12px;
}

.insight-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg3);
}

.insight-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.table-wrap {
  overflow-x: auto;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.analytics-table th,
.analytics-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.analytics-table .negative {
  color: var(--error);
}

.analytics-table .positive {
  color: var(--green);
}

.analytics-table th {
  color: var(--t3);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.analytics-grid {
  grid-template-columns: 1fr;
}

.analytics-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.analytics-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.compact-select {
  width: 142px;
  height: 36px;
}

.analytics-drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 1200;
  visibility: hidden;
  background: rgba(0, 0, 0, 0.58);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.analytics-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1201;
  width: min(520px, 100vw);
  overflow-y: auto;
  border-left: 1px solid var(--border-md);
  background: var(--bg2);
  visibility: hidden;
  transform: translateX(100%);
  transition:
    transform 0.22s ease,
    visibility 0s linear 0.22s;
}

.analytics-drawer.open {
  visibility: visible;
  transform: translateX(0);
  transition-delay: 0s;
}

.analytics-drawer-scrim.open {
  visibility: visible;
  opacity: 1;
}

.analytics-drawer header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}

.analytics-drawer header span,
.analytics-drawer header p {
  color: var(--t3);
  font-family: var(--f-mono);
  font-size: 10px;
}

.analytics-drawer header h2 {
  margin: 6px 0;
  color: var(--t1);
  font-family: var(--f-display);
  font-size: 25px;
}

.analytics-drawer header button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  background: var(--bg3);
  color: var(--t1);
  font-size: 22px;
  cursor: pointer;
}

.analytics-drawer-body {
  padding: 14px 22px 28px;
}

.analytics-proof-record {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.analytics-proof-record strong,
.analytics-proof-record span,
.analytics-proof-record small {
  display: block;
}

.analytics-proof-record strong {
  color: var(--t1);
}

.analytics-proof-record span {
  margin-top: 4px;
  color: var(--t2);
  font-size: 12px;
}

.analytics-proof-record small {
  margin-top: 6px;
  color: var(--t3);
  font-family: var(--f-mono);
  font-size: 10px;
}

.goal-input {
  width: 74px;
  height: 32px;
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  background: var(--bg3);
  color: var(--t1);
  padding: 6px 8px;
  font-family: var(--f-body);
}

.rate-bar-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  color: var(--t2);
  font-size: 12px;
}

.rate-bars {
  position: relative;
  height: 18px;
  border-radius: 99px;
  background: var(--bg3);
  overflow: hidden;
}

.rate-bars i,
.rate-bars b {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
}

.rate-bars i {
  background: rgba(201, 162, 75, 0.45);
}

.rate-bars b {
  background: var(--green);
  opacity: 0.82;
}

.settings-tabs {
  display: flex;
  gap: 18px;
  border-bottom: 1px solid var(--border);
}

.settings-tab {
  padding: 10px 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--t2);
  cursor: pointer;
}

.settings-tab.active {
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 700;
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: block;
}

.card-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.mapping-table-scroll {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-color: var(--border-hi) transparent;
  scrollbar-width: thin;
}

.mapping-table {
  --mapping-columns: minmax(170px, 1fr) minmax(210px, 1.25fr) 84px 92px
    minmax(210px, 1.25fr) 78px 72px 88px minmax(150px, 0.9fr) 30px;
  display: grid;
  min-width: 1320px;
  gap: 7px;
}

.mapping-group-header,
.mapping-column-header,
.mapping-row {
  display: grid;
  grid-template-columns: var(--mapping-columns);
  gap: 8px;
  align-items: center;
}

.mapping-group-header {
  padding: 0 8px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.mapping-group-header span:nth-child(1) {
  grid-column: 1;
}

.mapping-group-header span:nth-child(2) {
  grid-column: 2 / 4;
}

.mapping-group-header span:nth-child(3) {
  grid-column: 4 / 6;
}

.mapping-group-header span:nth-child(4) {
  grid-column: 6 / 10;
}

.mapping-group-header span:nth-child(5) {
  grid-column: 10;
}

.mapping-column-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  color: var(--t3);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.mapping-row {
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.mapping-row .text-input,
.mapping-row .text-select {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  font-size: 12px;
}

.mapping-layout-cell {
  display: block;
  min-width: 0;
  transition: opacity 0.15s ease;
}

.mapping-row:not(.is-visible-field) .mapping-layout-cell {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.map-check {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--t2);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.map-check input[type='checkbox'] {
  appearance: none;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1px solid var(--border-md);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.035);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.map-check input[type='checkbox']::after {
  content: '';
  width: 8px;
  height: 4px;
  border-left: 2px solid #111;
  border-bottom: 2px solid #111;
  transform: rotate(-45deg) scale(0);
  transform-origin: center;
  transition: transform 0.12s ease;
}

.map-check input[type='checkbox']:checked {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.14);
}

.map-check input[type='checkbox']:checked::after {
  transform: rotate(-45deg) scale(1);
}

.map-check input[type='checkbox']:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.24);
}

.map-check:hover {
  color: var(--t1);
}

.map-check:hover input[type='checkbox'] {
  border-color: var(--border-hi);
}

.map-check--center {
  justify-content: center;
}

.map-check--center span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-mapping-anchor {
  display: none;
}

.mapped-core-field {
  min-width: 0;
}

.map-remove:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.zip-settings-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
}

.zip-settings-grid.zip-settings-simple {
  grid-template-columns: minmax(0, 520px);
}

.zip-map-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #101313;
}

.zip-map {
  position: relative;
  min-height: 360px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(
      circle at 50% 52%,
      rgba(79, 179, 160, 0.14),
      transparent 38%
    ),
    #0b0e0d;
  background-size:
    42px 42px,
    42px 42px,
    auto,
    auto;
}

.zip-map.leaflet-container {
  background: #0b0e0d;
}

.zip-map .leaflet-tile-pane {
  filter: brightness(0.55) saturate(0.55) hue-rotate(145deg);
}

.zip-leaflet-label {
  border: 1px solid var(--border-md);
  border-radius: 999px;
  background: rgba(21, 25, 26, 0.92);
  color: var(--t1);
  padding: 4px 8px;
  box-shadow: none;
  font: 600 11px var(--f-body);
}

.zip-map::before {
  content: 'Service Area';
  position: absolute;
  left: 18px;
  top: 16px;
  color: var(--t3);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.zip-map-point {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 76px;
  padding: 7px 8px;
  border: 1px solid var(--border-md);
  border-radius: 999px;
  background: rgba(21, 25, 26, 0.92);
  color: var(--t2);
  cursor: pointer;
}

.zip-map-point strong {
  display: block;
  color: var(--t1);
  font-size: 12px;
}

.zip-map-point span {
  display: block;
  font-size: 10px;
}

.zip-map-point.active {
  border-color: var(--gold);
  background: var(--gold);
  color: #171307;
}

.zip-map-point.active strong {
  color: #171307;
}

.zip-selected-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 12px;
  border-top: 1px solid var(--border);
}

.zip-chip {
  border: 1px solid var(--border-md);
  border-radius: 999px;
  background: var(--bg3);
  color: var(--t2);
  padding: 5px 9px;
  cursor: pointer;
}

.map-toggle-all {
  padding: 6px 10px;
  border: 1px solid var(--border-md);
  border-radius: 999px;
  background: var(--bg3);
  color: var(--t2);
  font-size: 10px;
  cursor: pointer;
}

.dynamic-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dynamic-field.full,
.dynamic-field-grid > .field-width-100 {
  grid-column: 1 / -1;
}

.dynamic-field-grid > .field-width-50 {
  grid-column: auto;
}

.dynamic-field-grid:empty {
  display: none;
}

@media (max-width: 920px) {
  .main-content {
    margin-left: 0;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    margin-top: var(--top-h);
  }

  .app-layout {
    display: block;
    padding-top: 0;
  }

  .analytics-grid,
  .analytics-breakdown-grid,
  .settings-grid,
  .zip-settings-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .analytics-toolbar {
    flex-direction: column;
  }

  .analytics-filterbar {
    width: 100%;
    justify-content: flex-start;
  }

  .topbar {
    gap: 8px;
  }

  .company,
  .saved-label {
    display: none;
  }
}

#reauth-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  background: #b91c1c;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

#reauth-banner-btn {
  padding: 4px 14px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 4px;
  background: transparent;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

#reauth-banner-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Booking operations workspace: keep navigation available without taking
   permanent horizontal space from the seven-day dispatch board. */
.sidebar {
  position: fixed;
  top: var(--top-h);
  bottom: 0;
  left: 0;
  width: var(--sidebar-w);
  height: auto;
  margin: 0;
  transform: translateX(calc(-100% - 2px));
  transition: transform 180ms ease;
  box-shadow: 14px 0 34px rgba(0, 0, 0, 0.34);
  z-index: 80;
}

body.sidebar-open .sidebar {
  transform: translateX(0);
}

.main-content {
  margin-left: 0;
}

.sidebar-toggle {
  position: fixed;
  left: 12px;
  bottom: 16px;
  z-index: 82;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(201, 162, 75, 0.48);
  border-radius: 50%;
  color: #111;
  background: var(--gold);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.34);
  cursor: pointer;
  transition:
    left 180ms ease,
    transform 180ms ease,
    background 150ms ease;
}

.sidebar-toggle span {
  display: block;
  font: 600 27px/1 var(--f-body);
  transform: translateX(1px);
}

.sidebar-toggle:hover {
  background: var(--gold-hi);
}

body.sidebar-open .sidebar-toggle {
  left: calc(var(--sidebar-w) - 19px);
  transform: rotate(180deg);
}

body.board-mode-active .page {
  max-width: none;
  padding-right: 18px;
  padding-left: 18px;
}

body.board-mode-active .availability-board,
body.board-mode-active .incoming-call-tray {
  width: 100%;
}

body.board-mode-active .booking-switch-row {
  width: min(1144px, calc(100% - 20px));
  margin-right: auto;
  margin-left: auto;
}

.board-dispatch-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

.board-dispatch-table th:first-child,
.board-dispatch-table td:first-child {
  width: 172px;
  min-width: 172px;
  max-width: 172px;
}

.board-dispatch-table th:not(:first-child),
.board-dispatch-table td:not(:first-child) {
  width: 210px;
  min-width: 210px;
  max-width: 210px;
}

.board-dispatch-table .slot-pill {
  width: 100%;
}

#stgUserSelector {
  position: relative;
  z-index: 20;
  margin-bottom: 14px;
}

/* Let the absolutely-positioned user dropdown escape the card instead of being
   clipped by the card's overflow:hidden, and stack above the following cards. */
.card:has(.user-selector) {
  overflow: visible;
  position: relative;
  z-index: 20;
}

.user-selector {
  position: relative;
}

.user-selector-trigger {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  color: var(--t1);
  background: var(--bg3);
  list-style: none;
  cursor: pointer;
}

.user-selector-trigger::-webkit-details-marker {
  display: none;
}

.user-selector-trigger strong {
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
}

.user-selector-chevron {
  color: var(--t2);
  font-size: 20px;
  transform: rotate(0deg);
  transition: transform 150ms ease;
}

.user-selector[open] .user-selector-chevron {
  transform: rotate(45deg);
}

.user-selector-panel {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  z-index: 40;
  padding: 10px;
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  background: #111514;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
}

.user-selector-options {
  height: 310px;
  margin-top: 8px;
  overflow-y: auto;
}

.user-selector-option {
  min-height: 45px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--t1);
  cursor: pointer;
}

.user-selector-option:last-child {
  border-bottom: 0;
}

.user-selector-option:hover {
  background: rgba(201, 162, 75, 0.08);
}

.user-selector-option img,
.user-selector-option i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  object-fit: cover;
  color: #111;
  background: var(--gold);
  font-size: 10px;
  font-style: normal;
}

.user-selector-option strong,
.user-selector-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-selector-option strong {
  font-size: 12px;
  font-weight: 600;
}

.user-selector-option small {
  margin-top: 2px;
  color: var(--t3);
  font-size: 10px;
}

@media (max-width: 680px) {
  body.board-mode-active .page {
    padding-right: 10px;
    padding-left: 10px;
  }

  body.board-mode-active .booking-switch-row {
    width: calc(100% - 36px);
  }

  .sidebar-toggle {
    bottom: 12px;
  }

  .user-selector-trigger {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .user-selector-chevron {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .sidebar-toggle,
  .user-selector-chevron {
    transition: none;
  }
}

/* Keep final operational states after the legacy availability-board rules. */
.preference-time-controls.invalid .text-input {
  border-color: rgba(205, 91, 69, 0.72);
}

.scheduling-preferences-head .preference-error {
  color: var(--red);
}

.board-user-filter span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body .slot-pill {
  border-radius: 8px;
}

body .slot-pill.free {
  border-color: rgba(79, 179, 160, 0.42);
  color: var(--teal);
  background: rgba(79, 179, 160, 0.05);
}

body .slot-pill.booked {
  border-color: rgba(76, 175, 106, 0.72);
  color: #e9fff4;
  background: rgba(76, 175, 106, 0.18);
  box-shadow: inset 3px 0 0 rgba(76, 175, 106, 0.82);
}

body .slot-pill.busy {
  border-color: rgba(108, 158, 232, 0.42);
  color: #b8c8de;
  background: rgba(108, 158, 232, 0.09);
  box-shadow: none;
}

body .slot-pill.proposed {
  border-color: rgba(201, 162, 75, 0.72);
  color: #f0d58d;
  background: repeating-linear-gradient(
    135deg,
    rgba(201, 162, 75, 0.18) 0,
    rgba(201, 162, 75, 0.18) 7px,
    rgba(12, 13, 13, 0.42) 7px,
    rgba(12, 13, 13, 0.42) 14px
  );
  box-shadow: none;
}

body .board-status.free {
  color: var(--teal);
  border-color: rgba(79, 179, 160, 0.48);
  background: var(--teal-dim);
}

body .board-status.booked {
  color: #e9fff4;
  border-color: rgba(76, 175, 106, 0.65);
  background: rgba(76, 175, 106, 0.34);
}

body .board-status.busy {
  color: #c0d0e5;
  border-color: rgba(108, 158, 232, 0.44);
  background: var(--blue-dim);
}

body .board-status.proposed {
  color: #ecd18b;
  border-color: rgba(201, 162, 75, 0.62);
  background: var(--amber-dim);
}

body .slot-pill.has-actions:hover {
  border-color: rgba(201, 162, 75, 0.86);
  box-shadow: none;
}

body .slot-pill-actions {
  border-color: rgba(201, 162, 75, 0.86);
  background: #111514;
}

body .slot-pill-actions button {
  letter-spacing: 0;
  transition:
    color 140ms ease,
    background 140ms ease;
}

body .slot-pill-actions .reserve-action:hover {
  color: #f1d991;
  background: var(--amber-dim);
}

body .slot-pill-actions .schedule-action,
body .slot-pill-actions .reschedule-action {
  color: #111;
  background: var(--gold);
}

body .slot-pill-actions .schedule-action:hover,
body .slot-pill-actions .reschedule-action:hover {
  color: #111;
  background: var(--gold-hi);
}

body .slot-pill-actions .confirm-action {
  color: #0b1915;
  background: var(--teal);
}

body .slot-pill-actions .confirm-action:hover {
  background: #66c8b6;
}

body .slot-pill-actions .cancel-action {
  color: var(--red);
  background: transparent;
}

body .slot-pill-actions .cancel-action:hover {
  color: #fff2ef;
  background: var(--red-dim);
}
