:root {
  color-scheme: light;
  accent-color: #6b112c;
  --bg: #f8f5ef;
  --bg-glow: radial-gradient(circle at top right, rgba(212, 166, 74, 0.16), transparent 46%),
             radial-gradient(circle at top left, rgba(107, 17, 44, 0.06), transparent 40%);
  --surface: #ffffff;
  --surface-soft: #f5efe6;
  --surface-tint: #fcfaf6;
  --text: #211618;
  --muted: #5f504e;
  --border: #e4d8c7;
  --border-gold: #c99d44;
  --accent: #6b112c;
  --accent-soft: #f9edf1;
  --gold: #b8862d;
  --gold-bright: #e3bc68;
  --gold-soft: #fbf4e4;
  --royal-header: linear-gradient(135deg, #3a0818 0%, #5b1028 54%, #430a1c 100%);
  --avail: #0d6e63;
  --avail-bg: #e7f6f4;
  --avail-border: #149685;
  --booked: #b91c1c;
  --booked-solid: #be123c;
  --booked-bg: #fff1f2;
  --booked-border: #e11d48;
  --pill-bg: #fef4dd;
  --pill-text: #8c4406;
  --radius: 16px;
  --shadow: 0 4px 18px rgba(42, 16, 24, 0.06);
  --shadow-hover: 0 10px 26px rgba(58, 8, 24, 0.13);
}

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

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-block-size: 100dvb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  background-image: var(--bg-glow);
  color: var(--text);
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
}

.cust-header {
  background: var(--royal-header);
  color: #ffffff;
  border-bottom: 2px solid var(--gold-bright);
  box-shadow: 0 4px 18px rgba(42, 8, 19, 0.18);
}

.cust-header-inner {
  max-inline-size: 1280px;
  margin-inline: auto;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.cust-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-inline-size: 0;
}

.brand-dot {
  inline-size: 11px;
  block-size: 11px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(227, 188, 104, 0.28);
  flex-shrink: 0;
}

.cust-brand h1 {
  margin: 0;
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.cust-tagline {
  margin: 0.1rem 0 0;
  font-size: 0.82rem;
  color: #f3e6d3;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(110, 231, 183, 0.45);
  color: #d1fae5;
}

.live-dot {
  inline-size: 7px;
  block-size: 7px;
  border-radius: 50%;
  background: #34d399;
}

.live-pill.offline {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(252, 211, 77, 0.5);
  color: #fef3c7;
}

.live-pill.offline .live-dot {
  background: #fbbf24;
}

.cust-main {
  max-inline-size: 1280px;
  margin-inline: auto;
  padding: 1.05rem 1rem 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.date-finder {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.05rem 1.1rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0.55rem;
  z-index: 15;
}

.finder-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-block-end: 0.9rem;
}

.finder-head h2 {
  margin: 0;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: 1.14rem;
  font-weight: 700;
  color: var(--accent);
}

.finder-sub {
  margin: 0.22rem 0 0;
  font-size: 0.87rem;
  color: var(--muted);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid rgba(184, 134, 45, 0.25);
  font-size: 0.82rem;
  font-weight: 650;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.legend-swatch {
  inline-size: 13px;
  block-size: 13px;
  border-radius: 4px;
  border: 2px solid transparent;
}

.legend-item.available .legend-swatch {
  background: var(--avail-bg);
  border-color: var(--avail-border);
}

.legend-item.booked .legend-swatch {
  background: var(--booked-solid);
  border-color: var(--booked);
}

.finder-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr)) minmax(180px, 1.3fr) auto;
  gap: 0.78rem;
  align-items: end;
}

.date-field,
.search-field {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  min-inline-size: 0;
}

.date-field label,
.search-field label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}

.date-field input,
.search-field input {
  inline-size: 100%;
  min-block-size: 44px;
  padding: 0.5rem 0.78rem;
  border-radius: 11px;
  border: 1.5px solid var(--border);
  background: var(--surface-tint);
  color: var(--text);
  font: inherit;
  font-size: 0.94rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.date-field input:focus,
.search-field input:focus {
  border-color: var(--gold);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(184, 134, 45, 0.16);
}

.date-field input:focus-visible,
.search-field input:focus-visible {
  outline: 3px solid #0b57d0;
  outline-offset: 2px;
}

.date-field input:user-invalid {
  border-color: var(--booked);
}

.btn-clear {
  min-block-size: 44px;
  padding: 0.5rem 1rem;
  border-radius: 11px;
  border: 1.5px solid var(--border-gold);
  background: var(--gold-soft);
  color: var(--accent);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-clear:hover {
  background: #f5e6c5;
}

.finder-summary {
  margin-block-start: 0.8rem;
  font-size: 0.87rem;
  font-weight: 650;
  color: var(--muted);
}

.finder-error {
  margin-block-start: 0.65rem;
  padding: 0.58rem 0.8rem;
  border-radius: 10px;
  background: var(--booked-bg);
  border: 1px solid var(--booked-border);
  color: var(--booked);
  font-size: 0.86rem;
  font-weight: 650;
}

.cust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.05rem;
}

.cust-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.cust-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.cust-card.is-available {
  border: 2px solid var(--avail-border);
  background: var(--surface);
}

.cust-card.is-booked {
  border: 2px solid var(--booked-border);
  background: var(--booked-bg);
}

.card-photo-btn {
  position: relative;
  display: block;
  inline-size: 100%;
  padding: 0;
  border: 0;
  background: var(--surface-soft);
  cursor: zoom-in;
}

.card-photo-btn img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.cust-card.is-booked .card-photo-btn img {
  filter: saturate(0.72);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  align-self: flex-start;
}

.status-badge.booked {
  background: var(--booked-solid);
  color: #ffffff;
}

.status-badge.available {
  background: var(--avail-bg);
  color: var(--avail);
  border: 1px solid var(--avail-border);
}

.card-body {
  padding: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 0.52rem;
  flex: 1;
}

.card-title-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.card-code {
  display: inline-block;
  align-self: flex-start;
  padding: 0.14rem 0.5rem;
  border-radius: 7px;
  background: var(--accent-soft);
  border: 1px solid rgba(107, 17, 44, 0.14);
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--accent);
}

.cust-card.is-booked .card-code {
  background: #ffe4e6;
  color: #9f1239;
}

.card-title {
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.dates-section-label {
  font-size: 0.74rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.cust-card.is-booked .dates-section-label {
  color: var(--booked);
}

.dates-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  flex-wrap: balance;
  gap: 0.35rem;
}

.date-pill {
  padding: 0.24rem 0.54rem;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--pill-bg);
  color: var(--pill-text);
  border: 1px solid rgba(184, 134, 45, 0.22);
}

.date-pill.conflict {
  background: var(--booked-solid);
  border-color: var(--booked-solid);
  color: #ffffff;
}

.no-bookings-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--avail);
  font-weight: 650;
}

.empty-state {
  grid-column: 1 / -1;
  background: var(--surface);
  border: 1.5px dashed var(--border-gold);
  border-radius: var(--radius);
  padding: 2.4rem 1rem;
  text-align: center;
  color: var(--muted);
  font-weight: 650;
}

/* Lightbox Dialog */
.zoom-dialog {
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: 18px;
  padding: 0;
  max-inline-size: min(94vw, 540px);
  inline-size: 100%;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 56px rgba(34, 8, 17, 0.3);
}

.zoom-dialog::backdrop {
  background: rgba(30, 8, 16, 0.68);
  backdrop-filter: blur(3px);
}

.zoom-card {
  padding: 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.78rem;
}

.zoom-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
}

.zoom-head h2 {
  margin: 0;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: 1.2rem;
  color: var(--accent);
}

.zoom-sub {
  margin: 0.15rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.btn-zoom-close {
  min-inline-size: 38px;
  min-block-size: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-tint);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}

.zoom-media img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  max-block-size: 65dvh;
  object-fit: contain;
  border-radius: 12px;
  background: var(--surface-soft);
}

.zoom-status-banner {
  padding: 0.58rem 0.78rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 750;
}

.zoom-status-banner.booked {
  background: var(--booked-solid);
  color: #ffffff;
}

.zoom-status-banner.available {
  background: var(--avail-bg);
  color: var(--avail);
  border: 1px solid var(--avail-border);
}

.zoom-dates-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

@media (max-width: 760px) {
  .date-finder {
    position: static;
  }

  .finder-controls {
    grid-template-columns: 1fr 1fr;
  }

  .search-field,
  .finder-actions {
    grid-column: 1 / -1;
  }

  .btn-clear {
    inline-size: 100%;
  }

  .cust-grid {
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
    gap: 0.78rem;
  }

  .card-body {
    padding: 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .cust-header,
  .date-finder,
  .cust-card,
  .zoom-dialog {
    border: 1px solid CanvasText;
  }

  .cust-card.is-booked,
  .cust-card.is-available {
    outline: 2px solid Highlight;
  }
}
