﻿/*
  US Motorsport Club Database - MRC CI-adapted styles
  Loaded after /css/styles.css (MRC main). This file handles the database app UI.
  MRC CI rules applied: Exo 2 font, border-radius: 0, MRC accent colors.
*/

/* ── Color & token overrides for database app ── */
:root {
  --db-ink:        #171b21;
  --db-panel:      #ffffff;
  --db-muted:      #66717d;
  --db-line:       #d9dee5;
  --db-soft:       #f4f6f8;
  --db-header:     #06091e;   /* MRC nav dark navy */
  --db-header-2:   #0d1638;   /* slightly lighter dark navy */
  --db-accent:     #08a7e1;   /* MRC accent-hi (cyan-blue) */
  --db-operations: #173a63;
  --db-planning:   #d9822b;
  --db-shadow:     0 18px 45px rgba(22, 28, 35, 0.13);
}

/* ── Force MRC nav to always show dark on database pages ── */
#page-db .site-header,
#page-db-detail .site-header {
  background: rgba(6, 9, 30, 0.96) !important;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}

/* ── Body: push content below fixed MRC nav ── */
#page-db,
#page-db-detail {
  padding-top: var(--nav-h, 70px);
}

/* ── Index page: sticky footer - no white space below ── */
#page-db {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ── Database main content area ── */
#page-db main,
#page-db #db-main {
  flex: 1;
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0 34px;
}

/* ── DB Hero ── */
.db-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, var(--db-header) 0%, #0a1840 55%, #071232 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.db-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 80% 50%, rgba(8, 167, 225, 0.1) 0%, transparent 70%),
    radial-gradient(ellipse 50% 80% at 10% 80%, rgba(23, 58, 99, 0.45) 0%, transparent 60%);
  pointer-events: none;
}

.db-hero .container { position: relative; z-index: 1; }

.db-hero-content {
  padding-top: var(--sp-12, 3rem);
  padding-bottom: var(--sp-10, 2.5rem);
  max-width: 820px;
}

.db-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.db-hero-lead {
  max-width: 640px;
  color: rgba(255,255,255,0.56);
  font-size: 1rem;
  line-height: 1.75;
}

/* ── App header (simplified - search + view toggle only) ── */
.app-header {
  position: relative;
  z-index: 850;
  color: var(--db-ink);
  background: #fff;
  border-bottom: 1px solid var(--db-line);
}

.header-inner {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 14px 0;
}

/* ── Controls panel ── */
.controls-panel { display: grid; gap: 12px; }

.top-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: end;
}

/* kept for backward-compat; no longer rendered */
.view-button.is-active {
  color: var(--db-ink);
  background: #fff;
}

.search-field {
  display: grid;
  gap: 6px;
  color: var(--db-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.search-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--db-line);
  border-radius: 0;
  color: var(--db-ink);
  background: var(--db-soft);
  outline: none;
  font-family: inherit;
  font-size: 1rem;
}

.search-field input::placeholder { color: var(--db-muted); text-transform: none; }
.search-field input:focus { border-color: var(--db-accent); box-shadow: 0 0 0 3px rgba(8, 167, 225, 0.2); }

.filters-panel {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.07);
}

.filters-panel summary {
  min-height: 38px;
  padding: 9px 12px;
  color: #f4f7fb;
  font-weight: 800;
  list-style-position: inside;
  cursor: pointer;
}

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

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: start;
  margin: 0;
  padding: 0;
  border: 0;
}

.filter-group legend {
  width: 100%;
  margin-bottom: 2px;
  color: #dce3eb;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.offering-group { grid-column: span 2; }

.filter-choice,
.segmented-control label {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 31px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0;
  color: #f4f7fb;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.84rem;
  cursor: pointer;
}

.filter-choice input,
.segmented-control input { width: 15px; height: 15px; accent-color: var(--db-accent); }

.segmented-control { display: flex; flex-wrap: wrap; gap: 8px; }
.planned-toggle { margin-top: 2px; }

/* ── Status dots (circles by design) ── */
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
}
.operations { background: var(--db-operations); }
.planning   { background: var(--db-planning); }

/* ── Summary strip - hidden per design ── */
.summary-strip { display: none; }
#qualityNote { display: none; }
.summary-actions { display: none; }

.text-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--db-line);
  border-radius: 0;
  color: var(--db-ink);
  background: #fff;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.primary-button {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: var(--db-accent);
  font-weight: 750;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(8, 167, 225, 0.25);
}

/* ── View shells ── */
.view-shell { position: relative; }
.view-shell[hidden] { display: none; }

/* ── Map + sidebar split layout ── */
.map-with-sidebar {
  display: flex;
  align-items: stretch;
  height: clamp(360px, 50dvh, 560px);
  border: 1px solid var(--db-line);
  box-shadow: var(--db-shadow);
  overflow: hidden;
}

.map-column {
  position: relative;
  flex: 0 0 66.666%;
  min-width: 0;
}

.map-canvas {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #dce3e8;
  box-shadow: none;
}

/* ── Sidebar list ── */
.sidebar-list {
  flex: 0 0 33.333%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-left: 1px solid var(--db-line);
  background: #fff;
}

.sidebar-entry {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 11px 13px;
  border: 0;
  border-bottom: 1px solid var(--db-line);
  color: inherit;
  background: #fff;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
}
.sidebar-entry:hover,
.sidebar-entry:focus-visible { outline: none; background: #f4f8fb; }
.sidebar-entry.is-active { background: #e8f5fc; }

.sidebar-entry-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.25;
  color: var(--db-ink);
}
.sidebar-entry-location {
  display: block;
  font-size: 0.78rem;
  color: var(--db-muted);
}
.sidebar-entry-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.73rem;
  color: var(--db-muted);
  margin-top: 1px;
}

.map-actions {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  max-width: calc(100% - 32px);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(32, 40, 49, 0.12);
  border-radius: 0;
  color: #343c45;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(18, 23, 30, 0.14);
  font-size: 0.84rem;
  font-weight: 700;
}
.legend span { display: inline-flex; gap: 7px; align-items: center; }

/* ── Club list ── */
.club-list { display: grid; gap: 10px; margin-bottom: 28px; }

.club-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  width: 100%;
  min-height: 76px;
  padding: 16px 18px;
  border: 1px solid var(--db-line);
  border-radius: 0;
  color: inherit;
  background: var(--db-panel);
  text-align: left;
  box-shadow: 0 6px 20px rgba(22, 28, 35, 0.06);
  cursor: pointer;
  font-family: inherit;
}
.club-card:hover,
.club-card:focus-visible {
  border-color: rgba(8, 167, 225, 0.5);
  outline: none;
  box-shadow: 0 10px 28px rgba(22, 28, 35, 0.11);
}
.club-card strong { display: block; margin-bottom: 4px; font-size: 1.02rem; }
.club-card span span { color: var(--db-muted); }

.list-status {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--db-line);
  border-radius: 50%;
  background: #fff;
}

.status-chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--db-line);
  border-radius: 0;
  color: #343c45;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}
.access-chip { color: #202831; background: #f5f7f9; }

/* ── Empty state ── */
.empty-state {
  display: grid;
  place-items: center;
  gap: 16px;
  min-height: 320px;
  padding: 38px;
  border: 1px solid var(--db-line);
  border-radius: 0;
  background: #fff;
  text-align: center;
  box-shadow: var(--db-shadow);
}
.empty-state[hidden] { display: none; }
.empty-state h2 { margin: 0; font-size: 1.15rem; }

/* ── Map markers (circular by design) ── */
.club-marker {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}
.club-marker::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}
.marker-cluster {
  border: 3px solid #fff;
  background: rgba(0, 51, 76, 0.88);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}
.marker-cluster div { color: #fff; background: transparent; font-weight: 800; }

/* ── Leaflet popup ── */
.club-popup .leaflet-popup-content-wrapper { border-radius: 0; }
.club-popup .leaflet-popup-content { width: 340px; margin: 0; }

.popup-card { padding: 16px; }
.popup-header {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}
.logo-fallback,
.logo-image {
  width: 58px;
  height: 58px;
  border-radius: 0;
  object-fit: contain;
  background: var(--db-header);
}
.logo-image + .logo-fallback { display: none; }
.logo-fallback {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
}
.logo-fallback.is-visible { display: grid; }
.popup-title { margin: 0 0 4px; color: var(--db-ink); font-size: 1.08rem; line-height: 1.25; }
.popup-location { margin: 0 0 8px; color: var(--db-muted); }
.popup-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.website-link { display: inline-flex; color: var(--db-accent); font-weight: 750; text-decoration: none; }
.website-link:hover { text-decoration: underline; }
.website-link.is-muted { color: var(--db-muted); }
.popup-section { padding: 11px 0; border-top: 1px solid var(--db-line); }
.popup-section h3 { margin: 0 0 8px; color: var(--db-ink); font-size: 0.78rem; text-transform: uppercase; }
.detail-grid { display: grid; gap: 7px; }
.detail-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; color: var(--db-muted); }
.detail-row strong { color: var(--db-ink); font-weight: 750; text-align: right; }
.detail-row strong.detail-empty,
.detail-empty { color: var(--db-muted); font-weight: 400; font-style: italic; font-size: 0.82em; }
.fee-note { margin: 8px 0 0; color: var(--db-muted); font-size: 0.78rem; line-height: 1.35; }
.amenities-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

/* ── Load error ── */
.load-error {
  margin: 28px auto;
  padding: 24px;
  border: 1px solid #f0c8c4;
  border-radius: 0;
  color: #7a2119;
  background: #fff3f2;
  max-width: 800px;
}

/* ── Preview panel (right-side slide-in) ── */
.preview-panel {
  position: fixed;
  z-index: 1200;
  top: 0;
  right: 0;
  width: min(430px, 100%);
  height: 100vh;
  overflow: auto;
  border-left: 1px solid var(--db-line);
  background: #fff;
  box-shadow: -18px 0 40px rgba(12, 18, 25, 0.18);
}
.preview-panel[hidden] { display: none; }
.preview-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: rgba(0, 0, 0, .46);
  font-size: 1.5rem;
  cursor: pointer;
}
.preview-media { position: relative; min-height: 220px; background: #202831; overflow: hidden; }
.preview-media img,
.amenity-detail-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-media img { aspect-ratio: 16 / 10; }
.image-placeholder {
  display: grid;
  place-items: center;
  min-height: 220px;
  color: #dce3eb;
  font-weight: 800;
}
.slide-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: rgba(17, 23, 30, 0.72);
  font-size: 1.6rem;
  cursor: pointer;
}
.slide-button.previous { left: 10px; }
.slide-button.next     { right: 10px; }
.slide-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; gap: 6px; justify-content: center; }
.slide-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.55); }
.slide-dots .is-active { background: #fff; }
.preview-body { display: grid; gap: 16px; padding: 18px; }
.preview-title-row { display: grid; grid-template-columns: 58px 1fr; gap: 12px; align-items: start; }
.preview-title-row h2 { margin: 0 0 4px; font-size: 1.25rem; }
.preview-title-row p  { margin: 0 0 8px; color: var(--db-muted); }
.preview-section { padding-top: 14px; border-top: 1px solid var(--db-line); }
.preview-section h3,
.detail-section h2 { margin: 0 0 10px; }
.detail-link { text-align: center; text-decoration: none; }
.link-amenity { color: inherit; text-decoration: none; }
.link-amenity:hover { color: var(--db-accent); }
.list-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
.detail-mini-link { color: var(--db-accent); font-size: .82rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.preview-actions { display: flex; justify-content: center; align-items: center; width: 100%; padding-top: 4px; text-align: center; }
.preview-actions .detail-link { display: inline-flex; min-width: 190px; justify-content: center; align-items: center; margin: 0 auto; }

/* ── Amenity symbols (small status circles) ── */
.amenity { display: flex; gap: 7px; align-items: center; min-height: 28px; color: var(--db-ink); font-size: 0.84rem; }
.amenity-symbol {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: #6d747c;
  font-size: 0.72rem;
  font-weight: 800;
}
.amenity-symbol.yes     { background: #2f7d54; }
.amenity-symbol.no      { background: #9aa3ad; }
.amenity-symbol.planned {
  width: auto;
  min-width: 58px;
  padding: 0 7px;
  border-radius: 0;
  color: #7a470d;
  background: #ffe1bb;
  font-size: 0.68rem;
}
.amenity-symbol.unknown { background: #6d747c; }

/* ── Detail page ── */
.detail-page { background: #f3f5f7; }
.detail-root { width: 100%; margin: 0; padding: 0; }

.detail-hero {
  min-height: 430px;
  color: #fff;
  background: var(--db-header);
}
.detail-hero-inner {
  width: min(1400px, calc(100% - 4rem));
  margin: 0 auto;
  padding: 28px 0 54px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  margin-bottom: 96px;
  padding: 0;
  border: 0;
  color: var(--db-accent);
  background: transparent;
  font-weight: 400;
  font-size: 0.9rem;
  text-decoration: none;
}
.back-link:hover,
.back-link:focus-visible {
  outline: none;
  text-decoration: underline;
}

.detail-identity {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  max-width: 1180px;
}
.detail-identity-text { flex: 1; min-width: 0; }
.detail-identity h1 { margin: 0; font-size: clamp(2.3rem, 5.4vw, 5rem); line-height: .98; color: #fff; }
.detail-identity p  { margin: 10px 0 12px; color: #e3e8ee; font-size: 1.04rem; }
.detail-identity .detail-location { color: var(--db-accent); margin: 8px 0 12px; }
.detail-identity .logo-image,
.detail-identity .logo-fallback {
  display: block;
  width: 76px;
  height: 76px;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.12);
  border-radius: 0;
}
.detail-identity .logo-image + .logo-fallback { display: none; }
.detail-official {
  flex-shrink: 0;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: var(--db-accent);
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(8, 167, 225, 0.3);
  transition: background 0.15s;
}
.detail-official:hover,
.detail-official:focus-visible {
  outline: none;
  background: #07a3db;
}

/* ── Profile nav (detail page internal nav) ── */
.profile-nav {
  position: sticky;
  top: var(--nav-h, 70px);
  z-index: 800;
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 10px 20px;
  border-bottom: 1px solid var(--db-line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
}
.profile-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 0;
  color: #2d3640;
  font-size: .84rem;
  font-weight: 800;
  text-decoration: none;
}
.profile-nav a:hover,
.profile-nav a:focus-visible {
  outline: none;
  color: var(--db-accent);
  background: #f5f7f9;
}

/* ── Detail bands ── */
.detail-band { border-top: 1px solid rgba(23,27,33,.08); background: #fff; }
.detail-band:nth-of-type(odd) { background: #f7f8fa; }
.detail-content { width: min(1400px, calc(100% - 4rem)); margin: 0 auto; padding: 34px 0; }
.detail-content h2 { margin: 0 0 16px; color: #151a20; font-size: clamp(1.45rem, 2.2vw, 2rem); line-height: 1.08; }
.detail-overview .detail-content { display: flex; flex-direction: column; gap: 24px; }
.profile-intro { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 0; align-items: stretch; }
.profile-intro--no-image { grid-template-columns: 1fr; }
.profile-intro .track-layout-figure { position: relative; margin: 0; min-height: 220px; max-height: 440px; background: transparent; overflow: hidden; }
.profile-intro .track-layout-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.profile-intro .track-layout-placeholder { min-height: 220px; }

.overview-copy p,
.section-heading p,
.detail-note { max-width: 780px; margin: 0; color: var(--db-muted); font-size: 1rem; line-height: 1.65; }

.quick-facts,
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.quick-fact,
.metric-card {
  min-height: 94px;
  padding: 16px;
  border: 1px solid var(--db-line);
  border-radius: 0;
  background: #fff;
}
.quick-fact span,
.metric-card span,
.amenity-line span { display: block; margin-bottom: 8px; color: var(--db-muted); font-size: .73rem; font-weight: 850; text-transform: uppercase; }
.quick-fact strong,
.metric-card strong { display: block; color: var(--db-ink); font-size: 1.18rem; line-height: 1.18; }

.offering-card { position: relative; }
.offering-card[data-tooltip] { cursor: help; }
.offering-card[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 16px; right: 16px;
  bottom: calc(100% + 10px);
  z-index: 5;
  display: block;
  padding: 9px 10px;
  border-radius: 0;
  color: #fff;
  background: #202831;
  box-shadow: 0 10px 22px rgba(22,28,35,.2);
  font-size: .82rem;
  font-weight: 750;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .16s ease, transform .16s ease;
}
.offering-card[data-tooltip]:hover::after,
.offering-card[data-tooltip]:focus-within::after { opacity: 1; transform: translateY(0); }

.detail-two-column { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 24px; align-items: start; }
.pricing-panel {
  position: sticky;
  top: 24px;
  padding: 22px;
  border: 1px solid var(--db-line);
  border-radius: 0;
  background: #fbfcfd;
  box-shadow: 0 10px 28px rgba(22,28,35,.08);
}
.pricing-panel h2 { font-size: 1.35rem; }

/* ── Gallery carousel ── */
.gallery-carousel { display: grid; gap: 12px; }
.gallery-main { position: relative; margin: 0; background: #202831; overflow: hidden; aspect-ratio: 16 / 9; }
.gallery-main-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gallery-main.is-broken .gallery-main-img { opacity: 0; }
.gallery-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 10px 14px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
  font-size: .78rem;
  line-height: 1.4;
}
.gallery-strip-wrap { display: flex; align-items: center; gap: 8px; }
.gallery-strip-viewport { flex: 1; overflow: hidden; min-width: 0; }
.gallery-strip { display: flex; gap: 8px; transition: transform 0.25s ease; }
.gallery-thumb {
  flex: 0 0 120px;
  width: 120px;
  height: 75px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 0;
  background: #202831;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}
.gallery-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.gallery-thumb.is-active { border-color: var(--db-accent); }
.gallery-thumb:hover:not(.is-active) { border-color: rgba(8, 167, 225, 0.45); }
.gallery-thumb.is-broken { opacity: 0.35; }
.gallery-nav-btn {
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 75px;
  border: 1px solid var(--db-line);
  border-radius: 0;
  color: var(--db-ink);
  background: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.gallery-nav-btn:hover:not(:disabled) { border-color: var(--db-accent); color: var(--db-accent); }
.gallery-nav-btn:disabled { opacity: 0.3; cursor: default; }
.compact-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.detail-track .metric-card { background: #fff; }
.detail-note { margin-top: 18px; padding: 16px 18px; border-left: 4px solid var(--db-accent); background: #fff; }
.section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 18px; }

/* ── Profile infobox ── */
.profile-infobox { border: 1px solid var(--db-line); border-radius: 0; background: #fff; box-shadow: 0 10px 26px rgba(22,28,35,.07); overflow: hidden; }
.profile-intro .profile-infobox { border: 1px solid var(--db-line); box-shadow: none; }
.profile-infobox h2 { margin: 0; padding: 16px 18px; border-bottom: 1px solid var(--db-line); font-size: 1.15rem; background: #f7f8fa; }
.info-row { display: grid; grid-template-columns: minmax(110px, .42fr) minmax(0, 1fr); gap: 12px; padding: 12px 18px; border-bottom: 1px solid #edf0f3; }
.info-row:last-child { border-bottom: 0; }
.info-row span { color: var(--db-muted); font-size: .75rem; font-weight: 850; text-transform: uppercase; }
.info-row strong { color: var(--db-ink); line-height: 1.35; }
.membership-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ── Amenity tabs ── */
.amenity-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 14px; }
.amenity-tab {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--db-line);
  border-radius: 0;
  color: #2d3640;
  background: #fff;
  font-weight: 850;
  font-family: inherit;
  cursor: pointer;
}
.amenity-tab:hover,
.amenity-tab:focus-visible { outline: none; border-color: rgba(8, 167, 225, 0.5); color: var(--db-accent); }
.amenity-tab.is-active  { color: #fff; border-color: var(--db-accent); background: var(--db-accent); }
.amenity-tab.is-disabled,
.amenity-tab:disabled  { color: #9aa3ad; border-color: #e4e8ed; background: #eef1f4; cursor: not-allowed; opacity: .72; }

.amenity-panel-shell { display: grid; }
.amenity-panel {
  position: relative;
  grid-area: 1 / 1;
  visibility: hidden;
  pointer-events: none;
  min-height: 260px;
  padding: 22px;
  border: 1px solid var(--db-line);
  border-radius: 0;
  background: #fff;
  box-shadow: 0 10px 24px rgba(22,28,35,.07);
}
.amenity-panel.is-active { visibility: visible; pointer-events: auto; }
.amenity-anchor { position: absolute; top: -86px; width: 1px; height: 1px; overflow: hidden; }

/* Text-only amenity body (no image available) */
.amenity-text-body { padding: 4px 0 8px; display: flex; flex-direction: column; gap: 14px; max-width: 680px; }
.amenity-text-stat { display: inline-flex; align-items: baseline; gap: 10px; background: var(--db-soft); border-left: 3px solid var(--db-accent); padding: 10px 16px; align-self: start; }
.amenity-text-stat-val { font-size: 1.25rem; font-weight: 800; color: var(--db-ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.amenity-text-stat-lbl { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--db-muted); }
.amenity-text-note { font-size: 0.95rem; line-height: 1.68; color: #2c3540; margin: 0; }
.amenity-text-empty { font-size: 0.9rem; color: var(--db-muted); margin: 0; font-style: italic; }

/* Consolidated amenity summary (no amenity images across any group) */
.amenity-consolidated { display: flex; flex-direction: column; }
.amenity-consolidated-row { display: grid; grid-template-columns: 180px 1fr; gap: 12px 28px; padding: 18px 0; border-bottom: 1px solid var(--db-line); align-items: start; }
.amenity-consolidated-row:first-child { border-top: 1px solid var(--db-line); }
.amenity-consolidated-label { font-size: 0.67rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--db-muted); padding-top: 3px; }
.amenity-consolidated-content { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 600px) {
  .amenity-consolidated-row { grid-template-columns: 1fr; gap: 6px; }
}
.amenity-panel-heading { display: flex; gap: 16px; align-items: start; justify-content: space-between; margin-bottom: 18px; }
.amenity-panel-heading h3 { margin: 0 0 6px; font-size: 1.35rem; line-height: 1.15; }
.amenity-panel-heading p  { max-width: 720px; margin: 0; color: var(--db-muted); line-height: 1.55; }
.amenity-panel-body { display: grid; gap: 18px; align-items: stretch; }
.amenity-panel-body.has-image { grid-template-columns: minmax(360px, .95fr) minmax(360px, 1.05fr); }
.amenity-panel-media,
.amenity-panel-media--placeholder { position: relative; margin: 0; border-radius: 0; overflow: hidden; aspect-ratio: 4 / 3; }
.amenity-panel-media { background: #202831; }
.amenity-panel-media--placeholder { background: var(--db-soft); display: flex; align-items: center; justify-content: center; }
.amenity-panel-media--placeholder .image-placeholder { min-height: 0; width: 100%; }
.amenity-panel-image { display: none; width: 100%; height: 100%; object-fit: cover; }
.amenity-panel-image.is-active { display: block; }

/* ── Amenity pills ── */
.amenity-pill { flex: 0 0 auto; min-height: 28px; padding: 5px 10px; border-radius: 0; font-size: .72rem; font-weight: 850; }
.amenity-pill.yes     { color: #145637; background: #dff2e8; }
.amenity-pill.no      { color: #5c6570; background: #edf0f3; }
.amenity-pill.planned { color: #7a470d; background: #ffe5c2; }
.amenity-pill.unclear { color: #4b5561; background: #e5e9ee; }

/* ── Facility cards ── */
.facility-card-grid { display: grid; gap: 12px; align-content: start; }
.facility-card { padding: 18px; border: 1px solid var(--db-line); border-radius: 0; background: #fbfcfd; }
.facility-status-row { display: flex; gap: 14px; align-items: start; justify-content: space-between; }
.facility-status-row .amenity-pill { margin-top: 2px; }
.facility-label { display: block; margin-bottom: 5px; color: var(--db-muted); font-size: .73rem; font-weight: 850; text-transform: uppercase; }
.facility-status-row strong { display: block; color: var(--db-ink); font-size: 1.45rem; line-height: 1; }
/* ── Compact facility card (Karting & experiences) ── */
.facility-card--compact { padding: 12px 16px; }
.facility-compact-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.facility-compact-label { color: var(--db-ink); font-weight: 750; font-size: 0.95rem; }
.facility-card--compact .amenity-lines { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e9edf2; }
.status-icon {
  flex: 0 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 900;
}
.status-icon.yes     { background: #dff2e8; color: #145637; }
.status-icon.no      { background: #edf0f3; color: #9aa3ad; }
.status-icon.planned { background: #ffe5c2; color: #7a470d; }
.status-icon.unclear { background: #e5e9ee; color: #4b5561; }

/* ── Amenity lines ── */
.amenity-lines { display: grid; gap: 11px; }
.amenity-line { display: grid; grid-template-columns: minmax(110px, .44fr) minmax(0, 1fr); gap: 12px; align-items: baseline; }
.amenity-line span { margin: 0; }
.amenity-line strong { color: #252b33; font-size: .95rem; line-height: 1.42; }

/* ── Detail page: eyebrow override ── */
.detail-hero .eyebrow { color: #b3dff5; font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 8px; }

/* ── Amenity image caption ── */
.amenity-image-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 8px 12px;
  color: #fff;
  background: rgba(0,0,0,.55);
  font-size: .75rem;
}

/* ── Filter bar ── */
.filter-bar {
  background: #fff;
}

.filter-bar-inner {
  display: flex;
  flex-direction: column;
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
}

.filter-bar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 10px 0;
}

.filter-bar-row--offerings {
  border-top: 1px solid var(--db-line);
  padding-top: 8px;
  padding-bottom: 10px;
}

.filter-bar-row--primary .filter-reset-btn {
  margin-left: auto;
}

.filter-chips-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.filter-chips-label {
  color: var(--db-muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 2px;
  white-space: nowrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--db-line);
  border-radius: 0;
  color: #2d3640;
  background: #f6f8fa;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, color 0.14s;
  white-space: nowrap;
}

.filter-chip:hover { border-color: var(--db-accent); color: var(--db-accent); }

.filter-chip input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--db-accent);
}

.filter-chip:has(input:checked) {
  border-color: var(--db-accent);
  color: #fff;
  background: var(--db-accent);
}

.filter-chip:has(input:checked) .status-dot { border: 1.5px solid rgba(255,255,255,0.6); }

.filter-bar-divider {
  width: 1px;
  height: 24px;
  background: var(--db-line);
  flex-shrink: 0;
}

/* Offerings dropdown */
.filter-offering-dropdown {
  position: relative;
}

.filter-offering-dropdown[open] .filter-chip-btn {
  border-color: var(--db-accent);
  color: var(--db-accent);
}

.filter-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--db-line);
  border-radius: 0;
  color: #2d3640;
  background: #f6f8fa;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

.filter-chip-btn::-webkit-details-marker { display: none; }
.filter-chip-btn::after { content: " ▾"; font-size: 0.65rem; }

.filter-offering-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 900;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 420px;
  padding: 14px;
  border: 1px solid var(--db-line);
  border-radius: 0;
  background: #fff;
  box-shadow: 0 12px 32px rgba(18, 24, 32, 0.14);
}

.filter-offering-panel .filter-group { margin: 0; padding: 0; border: 0; }
.filter-offering-panel .filter-group legend {
  width: 100%;
  margin-bottom: 6px;
  color: var(--db-muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.filter-offering-panel .filter-choice,
.filter-offering-panel .segmented-control label {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--db-line);
  border-radius: 0;
  color: #2d3640;
  background: #f6f8fa;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.filter-offering-panel .filter-choice input,
.filter-offering-panel .segmented-control input { width: 14px; height: 14px; accent-color: var(--db-accent); }
.filter-offering-panel .segmented-control { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-offering-panel .planned-toggle { margin-top: 4px; }

.filter-reset-btn {
  margin-left: auto;
  color: var(--db-muted);
  border-color: transparent;
  background: transparent;
  font-weight: 700;
}
.filter-reset-btn:hover { color: var(--db-ink); border-color: var(--db-line); background: #f6f8fa; }

/* ── Membership tier comparison (synced from source) ── */
.membership-access-summary { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.membership-access-badge { min-width: 150px; padding: 9px 11px; border: 1px solid var(--db-line); border-radius: 0; background: #fff; }
.membership-access-badge span { display: block; margin-bottom: 4px; color: var(--db-muted); font-size: .68rem; font-weight: 850; text-transform: uppercase; }
.membership-access-badge strong { color: var(--db-ink); font-size: .95rem; }
.membership-access-badge.yes { border-color: #cfe6d8; background: #f2fbf6; }
.membership-access-badge.no { color: #66717d; background: #f2f4f6; }
.membership-access-badge.planned { border-color: #f1d2aa; background: #fff8ee; }
.membership-access-badge.unclear { color: var(--db-muted); background: #f5f7f9; }

.membership-comparison-stack { display: grid; gap: 18px; }
.membership-comparison-card { border: 1px solid var(--db-line); border-radius: 0; background: #fff; box-shadow: 0 8px 22px rgba(22,28,35,.05); overflow: hidden; }
.membership-comparison-header { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(360px, 1.3fr); gap: 18px; align-items: center; padding: 18px 20px; border-bottom: 1px solid #e8edf2; background: #fbfcfd; }
.membership-category-label { display: block; margin-bottom: 6px; color: var(--db-accent); font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.membership-comparison-header h3 { margin: 0; font-size: 1.22rem; line-height: 1.2; }
.membership-range-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.membership-range-item { min-height: 68px; padding: 12px 14px; border: 1px solid #dfe5eb; border-radius: 0; background: #fff; }
.membership-range-item span { display: block; margin-bottom: 4px; color: var(--db-muted); font-size: .68rem; font-weight: 850; text-transform: uppercase; }
.membership-range-item strong { display: block; color: var(--db-ink); font-size: 1.08rem; line-height: 1.25; }
.membership-table { display: grid; }
.membership-table-row { display: grid; grid-template-columns: minmax(180px, 1.1fr) minmax(130px, .7fr) minmax(130px, .7fr); gap: 16px; align-items: center; min-height: 54px; padding: 12px 20px; border-bottom: 1px solid #edf0f3; }
.membership-table.has-notes .membership-table-row { grid-template-columns: minmax(170px, 1fr) minmax(120px, .62fr) minmax(120px, .62fr) minmax(220px, 1.2fr); }
.membership-table-row:last-child { border-bottom: 0; }
.membership-table-head { min-height: 42px; background: #fafbfc; }
.membership-table-head span { margin: 0; display: block; color: var(--db-muted); font-size: .68rem; font-weight: 850; text-transform: uppercase; }
.membership-table-row strong { color: var(--db-ink); font-size: .98rem; }
.membership-table-row span { color: #252b33; line-height: 1.35; }
.membership-table-row span:last-child { color: var(--db-muted); }
.compact-note { margin-top: 0; }

/* ── Filter: incl. planned toggle ── */
.filter-planned-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  color: var(--db-muted);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.filter-planned-toggle input {
  width: 14px;
  height: 14px;
  accent-color: var(--db-accent);
  cursor: pointer;
}

/* ── Fixed KPI strip ── */
.db-kpi-strip {
  background: #fff;
}

.db-kpi-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
}

.db-kpi-inner--single {
  display: flex;
  justify-content: center;
  align-items: center;
}

.db-kpi-divider {
  width: 1px;
  height: 64px;
  background: var(--db-line);
  flex-shrink: 0;
}

.db-kpi-card {
  padding: 26px 28px;
  text-align: center;
}

.db-kpi-number {
  display: block;
  font-size: clamp(2.2rem, 3.8vw, 3.2rem);
  font-weight: 800;
  color: var(--db-ink);
  line-height: 1;
  letter-spacing: -0.04em;
}

.db-kpi-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--db-muted);
  margin-top: 8px;
}

.db-kpi-label--top {
  margin-top: 0;
  margin-bottom: 14px;
}

.db-kpi-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--db-muted);
  margin-top: 5px;
}

.db-kpi-sub span {
  font-weight: 700;
  color: var(--db-ink);
}

.db-kpi-access-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.db-kpi-access-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.db-kpi-access-item span {
  display: block;
  font-size: clamp(1.4rem, 2.6vw, 2.1rem);
  font-weight: 800;
  color: var(--db-ink);
  line-height: 1;
  letter-spacing: -0.03em;
}

.db-kpi-access-item em {
  font-style: normal;
  font-size: 0.66rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--db-muted);
}

/* ── KPI hint text ── */
.db-kpi-hint {
  background: #fff;
  padding: 9px 0;
  text-align: center;
}

.db-kpi-hint p {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  font-size: 0.79rem;
  color: var(--db-muted);
  line-height: 1.5;
}

.db-kpi-hint strong {
  font-weight: 700;
  color: var(--db-ink);
}

/* ── Dynamic KPI section ── */
.db-dynamic-kpis {
  margin-top: 22px;
}

.db-dkpi-match {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 10px 0;
  font-size: 0.82rem;
  color: var(--db-muted);
  border-bottom: 1px solid var(--db-line);
  margin-bottom: 20px;
}

#dkpiMatchCount {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--db-ink);
  letter-spacing: -0.02em;
}

.db-dkpi-section {
  margin-bottom: 24px;
}

.db-dkpi-section-title {
  display: inline-block;
  margin: 0 0 12px;
  padding-bottom: 7px;
  border-bottom: 2px solid var(--db-accent);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--db-ink);
}

.db-dkpi-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--db-line);
}

.db-dkpi-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 16px;
  background: transparent;
  border-right: 1px solid var(--db-line);
}

.db-dkpi-grid .db-dkpi-card:last-child { border-right: none; }

/* Membership fee groups */
.db-dkpi-mem-wrap {
  display: flex;
  border-top: 1px solid var(--db-line);
}

.db-dkpi-mem-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.db-dkpi-mem-group + .db-dkpi-mem-group {
  border-left: 1px solid var(--db-line);
}

.db-dkpi-group-hdr {
  position: relative;
  padding: 9px 0;
  text-align: center;
}

.db-dkpi-group-hdr::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--db-line);
}

.db-dkpi-group-hdr-text {
  position: relative;
  display: inline-block;
  background: #fff;
  padding: 0 12px;
  font-size: 0.64rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--db-muted);
}

.db-dkpi-group-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 1;
}

.db-dkpi-group-cards .db-dkpi-card {
  align-items: center;
  text-align: center;
  border-right: 1px solid var(--db-line);
}

.db-dkpi-group-cards .db-dkpi-card:last-child { border-right: none; }

.db-dkpi-num {
  display: block;
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 800;
  color: var(--db-ink);
  line-height: 1;
  letter-spacing: -0.03em;
}

.db-dkpi-num--currency {
  font-size: clamp(1rem, 1.8vw, 1.4rem);
  letter-spacing: -0.02em;
}

.db-dkpi-lbl {
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--db-muted);
}

.db-dkpi-note {
  font-size: 0.7rem;
  color: var(--db-muted);
  font-style: italic;
  margin-top: 1px;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .membership-comparison-header { grid-template-columns: 1fr; }
  .membership-access-summary { justify-content: flex-start; }
}

@media (max-width: 900px) {
  .db-kpi-card { padding: 20px 16px; }
  .db-dkpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .db-dkpi-mem-wrap { flex-direction: column; }
  .db-dkpi-mem-group + .db-dkpi-mem-group { border-left: none; border-top: 1px solid var(--db-line); }
  .detail-two-column { grid-template-columns: 1fr; }
  .pricing-panel { position: static; }
  .compact-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-intro  { grid-template-columns: 1fr; }
  .profile-intro .track-layout-img { height: auto; max-height: 260px; }
  .membership-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .amenity-panel-body.has-image { grid-template-columns: 1fr; }
  .amenity-panel-media,
  .amenity-panel-media--placeholder { aspect-ratio: 3 / 2; }
  .membership-access-summary { justify-content: flex-start; }
  .membership-range-strip { grid-template-columns: 1fr; }
  .membership-access-badge { min-width: 0; }
}

@media (max-width: 640px) {
  .header-inner { width: min(100% - 24px, 1440px); padding: 12px 0; }
  #page-db main { width: min(100% - 24px, 1440px); }
  .filter-bar-inner { width: min(100% - 24px, 1440px); }
  .db-kpi-inner { grid-template-columns: 1fr; }
  .db-kpi-inner > .db-kpi-divider { display: none; }
  .db-kpi-card { padding: 18px 20px; border-bottom: 1px solid var(--db-line); }
  .db-kpi-card:last-child { border-bottom: 0; }
  .db-dkpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .db-hero-content { padding-top: 1.5rem; padding-bottom: 1.25rem; }
  .db-hero h1 { font-size: clamp(1.6rem, 6vw, 2rem); }
  .db-hero-lead { font-size: 0.92rem; }
  /* summary-strip hidden */
  .membership-comparison-header { padding: 16px; grid-template-columns: 1fr; }
  .membership-table, .membership-table.has-notes { gap: 10px; padding: 12px; }
  .membership-table-head { display: none; }
  .membership-table-row, .membership-table.has-notes .membership-table-row { display: grid; grid-template-columns: 1fr; gap: 6px; min-height: 0; padding: 14px; border: 1px solid #e4e9ef; border-radius: 0; }
  .membership-table-row span::before { display: block; margin-bottom: 2px; color: var(--db-muted); font-size: .68rem; font-weight: 850; text-transform: uppercase; }
  .membership-table-row span:nth-child(2)::before { content: "Initiation fee"; }
  .membership-table-row span:nth-child(3)::before { content: "Annual dues"; }
  .membership-table-row span:nth-child(4)::before { content: "Notes"; }
  /* on mobile: stack map above sidebar */
  .map-with-sidebar { flex-direction: column; height: auto; }
  .map-column { flex: none; height: clamp(260px, 45dvh, 400px); }
  .sidebar-list { flex: none; height: 220px; border-left: 0; border-top: 1px solid var(--db-line); }
  .map-actions { right: 10px; bottom: 10px; justify-content: stretch; }
  .legend { width: 100%; }
  .club-card { grid-template-columns: 1fr auto; gap: 10px; }
  .club-popup .leaflet-popup-content { width: 284px; }
  .popup-header { grid-template-columns: 48px 1fr; }
  .logo-fallback,
  .logo-image { width: 48px; height: 48px; }
  .amenities-grid { grid-template-columns: 1fr; }
  .preview-panel {
    top: auto;
    bottom: 0;
    width: 100%;
    height: min(82vh, 720px);
    border-left: 0;
    border-top: 1px solid var(--db-line);
    border-radius: 0;
  }
  .detail-hero-inner,
  .detail-content { width: min(100% - 24px, 1400px); }
  .detail-hero   { min-height: 520px; }
  .back-link     { margin-bottom: 74px; }
  .detail-identity { flex-wrap: wrap; align-items: flex-start; gap: 12px; }
  .detail-identity h1 { font-size: 2.25rem; }
  .detail-identity .logo-image,
  .detail-identity .logo-fallback { width: 58px; height: 58px; }
  .detail-official { align-self: auto; min-width: 100%; justify-content: center; margin-top: 4px; }
  .quick-facts,
  .metric-grid,
  .compact-metrics,
  .amenity-block-grid { grid-template-columns: 1fr; }
  .gallery-main { aspect-ratio: 4 / 3; }
  .gallery-thumb { flex: 0 0 84px; width: 84px; height: 56px; }
  .gallery-nav-btn { height: 56px; }
  .profile-nav { justify-content: flex-start; overflow-x: auto; }
  .profile-nav a { flex: 0 0 auto; }
  .membership-metrics { grid-template-columns: 1fr; }
  .amenity-panel { padding: 16px; }
  .amenity-panel-heading { display: grid; }
}


/* ══════════════════════════════════════════════════════════════
   ADMIN PAGE STYLES
   Loaded on /us-club-database/admin only (body.admin-page).
   MRC DB-CI applied: Exo 2, --db-* token palette, blue accent.
   ══════════════════════════════════════════════════════════════ */

/* ── Admin CSS variable bridge ─────────────────────────────── */
body.admin-page {
  --ink:    var(--db-ink);
  --muted:  var(--db-muted);
  --line:   var(--db-line);
  --accent: var(--db-accent);
  --shadow: 0 10px 28px rgba(22, 28, 35, 0.1);
  background: #eef1f4;
}

/* ── Button overrides for admin (MRC blue instead of red) ──── */
body.admin-page .primary-button {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: var(--db-accent);
  font-family: inherit;
  font-weight: 750;
  box-shadow: 0 8px 18px rgba(8, 167, 225, 0.22);
  cursor: pointer;
}
body.admin-page .primary-button:hover { background: #07a3db; }
body.admin-page .text-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--db-line);
  border-radius: 0;
  color: var(--db-ink);
  background: #fff;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}
body.admin-page .text-button:hover { border-color: #b5c0cc; background: #f7f9fa; }

/* ── Admin header ──────────────────────────────────────────── */
.admin-header { position: static; }
.admin-header-inner { grid-template-columns: 1fr auto; align-items: center; }
.admin-nav { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
.admin-link.is-light { min-height: 40px; background: rgba(255,255,255,.08); }

/* ── Admin main & toolbar ──────────────────────────────────── */
.admin-main { padding-top: 20px; }
.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}
.admin-search { display: grid; gap: 6px; color: var(--muted); font-size: .76rem; font-weight: 800; text-transform: uppercase; }
.admin-search input,
.club-form input,
.club-form select,
.club-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: #fff;
  outline: none;
  font-family: inherit;
}
.admin-search input { min-height: 44px; padding: 0 13px; }
.club-form input, .club-form select { min-height: 42px; padding: 0 11px; }
.club-form textarea { padding: 10px 11px; resize: vertical; }
.admin-search input:focus,
.club-form input:focus,
.club-form select:focus,
.club-form textarea:focus {
  border-color: rgba(8, 167, 225, 0.7);
  box-shadow: 0 0 0 3px rgba(8, 167, 225, 0.12);
}
.admin-status { margin: 0; color: var(--muted); font-weight: 700; text-align: right; }
.admin-toolbar-actions { display: flex; gap: 10px; align-items: center; }
.admin-toolbar-actions select {
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  font-family: inherit;
}

/* ── Toast notification ────────────────────────────────────── */
.save-toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 2000;
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 16px;
  border: 1px solid transparent;
  border-radius: 0;
  box-shadow: 0 14px 34px rgba(22,28,35,.2);
  font-weight: 800;
}
.save-toast[hidden] { display: none; }
.save-toast.is-success { border-color: #9ec9ad; color: #174b2b; background: #edf8f1; }
.save-toast.is-warning { border-color: #e9c787; color: #6d470d; background: #fff8e8; }
.save-toast.is-error   { border-color: #efb3ad; color: #7a2119; background: #fff3f2; }
@media (max-width: 640px) {
  .save-toast { right: 16px; bottom: 16px; left: 16px; max-width: none; }
}

/* ── Save button states ────────────────────────────────────── */
.club-form.has-unsaved-changes #saveButton { box-shadow: 0 0 0 3px rgba(8, 167, 225, 0.22); }
#saveButton:disabled { cursor: wait; opacity: .72; }

/* ── Two-panel admin layout ────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.admin-list-panel,
.editor-panel {
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  box-shadow: 0 10px 28px rgba(22,28,35,.08);
}
.admin-list-panel { max-height: calc(100vh - 190px); overflow: auto; }

/* ── Club list ─────────────────────────────────────────────── */
.admin-list { display: grid; gap: 1px; }
.admin-entry {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 78px;
  padding: 13px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  background: #fff;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.admin-entry:hover,
.admin-entry:focus-visible,
.admin-entry.is-active { outline: none; background: #e8f5fc; }
.admin-entry strong { font-size: .96rem; }
.admin-entry span, .admin-entry small { color: var(--muted); }
.admin-entry.is-archived { opacity: .45; }
.admin-entry.is-archived strong::after { content: " [Archived]"; font-size: .75em; font-weight: 400; color: var(--muted); }

/* ── Editor panel / form ───────────────────────────────────── */
.editor-panel { padding: 20px; }
.club-form { display: grid; gap: 18px; }
.form-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.form-heading h2 { margin: 0; font-size: 1.35rem; }
.eyebrow.dark { color: var(--accent); }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.danger-button { color: #8c261f; border-color: #efc4bf; background: #fff6f5; }
.danger-button:hover { background: #fdecea; }

/* ── Form grid ─────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.club-form label { display: grid; gap: 6px; color: var(--muted); font-size: .76rem; font-weight: 800; text-transform: uppercase; }
.wide-field { grid-column: span 3; }

/* ── Login panel ───────────────────────────────────────────── */
.login-panel { display: grid; place-items: center; min-height: 56vh; }
.login-panel[hidden], #adminApp[hidden] { display: none !important; }
.login-form {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  box-shadow: var(--shadow);
}
.login-form h2 { margin: 0; }
.login-form label { display: grid; gap: 6px; color: var(--muted); font-size: .76rem; font-weight: 800; text-transform: uppercase; }
.login-form input {
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  font-family: inherit;
}

/* ── Tabs ──────────────────────────────────────────────────── */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.tab-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}
.tab-button.is-active { color: #fff; border-color: var(--accent); background: var(--accent); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ── Admin mini-map ────────────────────────────────────────── */
.admin-map {
  height: 260px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  overflow: hidden;
  background: #dce3e8;
}
.form-warning { min-height: 20px; margin: 8px 0 0; color: #8c261f; font-weight: 750; }
.form-hint {
  margin: 0 0 12px;
  padding: 11px 12px;
  border: 1px solid #dfe6ee;
  border-radius: 0;
  color: #4f5b68;
  background: #f8fafb;
  font-size: .86rem;
  line-height: 1.45;
}

/* ── Membership package editor ─────────────────────────────── */
.membership-package-editor { display: grid; gap: 12px; margin-top: 16px; }
.package-editor-heading {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fbfcfd;
}
.package-editor-heading h3 { margin: 0 0 4px; font-size: 1rem; }
.package-editor-heading p  { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.4; }
.membership-package-fields { display: grid; gap: 10px; }
.membership-package-row {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}
.package-row-title { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.package-row-title strong { font-size: .92rem; }

/* ── Amenity editor cards ──────────────────────────────────── */
.amenity-editor-stack { display: grid; gap: 16px; }
.amenity-editor-card {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 0;
}
.amenity-editor-card legend { padding: 0 6px; color: var(--ink); font-weight: 800; }

/* ── Image editor ──────────────────────────────────────────── */
.image-fields { display: grid; gap: 10px; margin-bottom: 12px; }
.image-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 150px;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #f8fafb;
}
.image-row.is-hero {
  border-color: rgba(8, 167, 225, .42);
  background: #e8f5fc;
  box-shadow: 0 0 0 3px rgba(8, 167, 225, .08);
}
.image-thumb {
  display: grid;
  place-items: center;
  width: 112px;
  height: 82px;
  border: 1px solid #d8dee6;
  border-radius: 0;
  color: var(--muted);
  background: #202831;
  overflow: hidden;
  font-size: .78rem;
  font-weight: 800;
  text-align: center;
}
.image-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-thumb.is-empty { background: #eef1f4; }
.image-main-fields,
.image-rights-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.image-main-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; align-items: start; }
.image-main-fields > label:first-child,
.image-main-fields > label:last-child { grid-column: 1 / -1; }
.image-main-fields > label:nth-child(2),
.image-main-fields > label:nth-child(3) { grid-column: span 1; min-width: 0; }
.image-main-fields input[type="url"],
.image-main-fields input[type="file"] { width: 100%; min-width: 0; }
.image-rights-details { grid-column: 2 / 4; border-top: 1px solid #e8edf2; padding-top: 8px; }
.image-rights-details summary { color: var(--muted); cursor: pointer; font-size: .76rem; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.image-rights-details[open] summary { margin-bottom: 8px; color: var(--ink); }
.image-rights-details--row { align-self: start; }
.image-rights-form-grid { margin-top: 8px; }
.upload-field small { display: block; margin-top: 4px; color: var(--muted); font-size: .72rem; font-weight: 500; line-height: 1.4; }
.upload-field input[type="file"] { padding: 8px; background: #fff; }
.image-admin-grid > .image-rights-details { grid-column: 1 / -1; }
.image-actions { display: grid; gap: 8px; align-content: start; justify-items: stretch; }
.wide-image-field { grid-column: span 2; }
.hero-check {
  min-height: 40px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px !important;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: #2d3640;
  background: #fff;
  text-align: center;
  cursor: pointer;
}
.hero-check input { position: absolute; opacity: 0; pointer-events: none; }
.hero-check span { font-size: .78rem; font-weight: 850; text-transform: none; }
.image-row.is-hero .hero-check { color: #fff; border-color: var(--accent); background: var(--accent); }
.image-admin-grid { margin-top: 14px; }

/* ── Responsive: admin ─────────────────────────────────────── */
@media (max-width: 900px) {
  .admin-header-inner,
  .admin-toolbar,
  .admin-layout,
  .form-grid { grid-template-columns: 1fr; }
  .admin-status { text-align: left; }
  .admin-list-panel { max-height: 360px; }
  .wide-field { grid-column: auto; }
  .form-heading { align-items: flex-start; flex-direction: column; }
  .image-row,
  .image-main-fields,
  .image-rights-fields { grid-template-columns: 1fr; }
  .image-rights-details { grid-column: auto; }
  .wide-image-field { grid-column: auto; }
}
@media (max-width: 640px) {
  .admin-main { padding-top: 14px; }
}

/* ── Track layout figure (inside overview grid) ──────────── */
.track-layout-figure {
  position: relative;
  width: 100%;
  margin: 0;
  background: var(--db-soft);
  overflow: hidden;
  line-height: 0;
}

.track-layout-img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  object-position: center;
}

.track-layout-placeholder {
  display: none;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--db-muted);
  font-size: 0.85rem;
  font-style: italic;
  line-height: 1.4;
  text-align: center;
}

.track-layout-figure.is-placeholder .track-layout-placeholder { display: flex; }

.track-layout-figure { cursor: zoom-in; }
.track-layout-figure.is-placeholder { cursor: default; }
.track-zoom-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  cursor: zoom-in;
  transition: background 0.15s;
}
.track-zoom-btn:hover { background: rgba(0, 0, 0, 0.68); }
.track-layout-figure.is-placeholder .track-zoom-btn { display: none; }

.track-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.track-lightbox[hidden] { display: none; }
.track-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: zoom-out;
}
.track-lightbox-inner {
  position: relative;
  z-index: 1;
  max-width: min(90vw, 1200px);
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.track-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
.track-lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0;
  color: #fff;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.15s;
}
.track-lightbox-close:hover { background: rgba(255, 255, 255, 0.15); }

/* ── Track layout image switcher ── */
.track-layout-switcher {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
  z-index: 1;
}
.track-switcher-thumb {
  width: 60px;
  height: 44px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.5);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}
.track-switcher-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.track-switcher-thumb.is-active { border-color: var(--db-accent); }
.track-switcher-thumb:hover:not(.is-active) { border-color: rgba(255, 255, 255, 0.7); }

/* ── Admin image toggle ───────────────────────────────────── */
.admin-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--db-muted);
  cursor: pointer;
  white-space: nowrap;
}
.admin-toggle-row input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

/* ── Form divider ─────────────────────────────────────────── */
.form-divider { border: none; border-top: 1px solid var(--db-line); margin: 18px 0; }
