/* ================================================================
   DCBarMap — Design System Tokens
   ================================================================ */
:root {
  /* ---- Color palette ---- */
  --blue-50:  #EEF3FF;
  --blue-100: #DCE6FF;
  --blue-200: #B9CDFF;
  --blue-300: #8AAAFF;
  --blue-400: #5786FF;
  --blue-500: #2F6BFF;
  --blue-600: #1E54E8;
  --blue-700: #173FB0;
  --blue-800: #122F82;

  --teal-50:  #E6F7F5;
  --teal-100: #C9EDE9;
  --teal-200: #97DBD4;
  --teal-400: #2BA59C;
  --teal-500: #14938F;
  --teal-600: #0E7472;
  --teal-700: #0B5755;

  --amber-50:  #FFF4E5;
  --amber-100: #FFE6C2;
  --amber-500: #F5821F;
  --amber-700: #A8520A;

  --green-50:  #E7F8F0;
  --green-100: #C6EFD9;
  --green-500: #1FA968;
  --green-700: #11663E;

  --ink-900: #11151C;
  --ink-800: #1B212B;
  --ink-700: #2C333D;
  --ink-600: #434C58;
  --ink-500: #5A6472;
  --ink-400: #8A93A2;
  --ink-300: #C2C8D2;
  --ink-200: #E2E6EC;
  --ink-100: #F0F2F5;
  --ink-50:  #F7F8FA;
  --white:   #FFFFFF;

  --night-900: #0B0E14;
  --night-800: #12161F;
  --night-700: #1B212D;
  --night-600: #283041;

  /* ---- Semantic aliases ---- */
  --surface-card:    var(--white);
  --surface-sunken:  var(--ink-100);
  --surface-overlay: rgba(17, 21, 28, 0.55);

  --text-primary:   var(--ink-900);
  --text-secondary: var(--ink-500);
  --text-muted:     var(--ink-400);
  --text-inverse:   var(--white);
  --text-link:      var(--blue-600);

  --border-subtle:  var(--ink-100);
  --border-default: var(--ink-200);
  --border-strong:  var(--ink-300);

  --accent:       var(--blue-500);
  --accent-hover: var(--blue-600);
  --accent-soft:  var(--blue-50);
  --focus-ring:   rgba(47, 107, 255, 0.45);

  --chip-vibe-bg:      var(--teal-100);
  --chip-vibe-text:    var(--teal-700);
  --chip-popular-bg:   var(--amber-100);
  --chip-popular-text: var(--amber-700);
  --chip-new-bg:       var(--green-100);
  --chip-new-text:     var(--green-700);
  --chip-fsq-bg:       var(--ink-100);
  --chip-fsq-text:     var(--ink-600);

  /* ---- Typography ---- */
  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-sans:    'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-ui:      var(--font-sans);
  --font-data:    var(--font-mono);

  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  --text-xs:   12px;
  --text-sm:   13px;
  --text-base: 15px;
  --text-md:   17px;
  --text-lg:   20px;
  --text-xl:   24px;

  --tracking-tight: -0.02em;
  --tracking-snug:  -0.01em;
  --tracking-caps:   0.08em;

  /* ---- Spacing (4px grid) ---- */
  --space-1:  2px;
  --space-2:  4px;
  --space-3:  8px;
  --space-4:  12px;
  --space-5:  16px;
  --space-6:  20px;
  --space-7:  24px;
  --space-8:  32px;

  /* ---- Radii ---- */
  --radius-xs:   6px;
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-pill: 999px;

  /* ---- Shadows ---- */
  --shadow-xs: 0 1px 2px rgba(17, 21, 28, 0.06);
  --shadow-sm: 0 1px 2px rgba(17, 21, 28, 0.06), 0 1px 3px rgba(17, 21, 28, 0.10);
  --shadow-md: 0 4px 12px rgba(17, 21, 28, 0.10), 0 2px 4px rgba(17, 21, 28, 0.06);
  --shadow-lg: 0 12px 32px rgba(17, 21, 28, 0.16), 0 4px 8px rgba(17, 21, 28, 0.08);
  --shadow-xl: 0 24px 60px rgba(17, 21, 28, 0.22);
  --glow-accent: 0 0 0 3px rgba(47, 107, 255, 0.18);

  /* ---- Layout ---- */
  --panel-width: 400px;

  /* ---- Motion ---- */
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast:  120ms;
  --dur-base:  200ms;
  --dur-slow:  320ms;

  /* ---- Z-index ---- */
  --z-panel:    100;
  --z-topbar:   200;
  --z-dropdown: 300;
  --z-toast:    500;

  /* ---- Legacy aliases (unchanged JS references) ---- */
  --bg-surface:        rgba(255, 255, 255, 0.95);
  --bg-surface-strong: var(--white);
  --hover-bg:          var(--surface-sunken);
  --border:            var(--border-default);
  --shadow-card:       var(--shadow-sm);
  --shadow-elevated:   var(--shadow-lg);
  --radius:            var(--radius-lg);
  --accent-soft-teal:  var(--teal-100);
}

/* ================================================================
   Reset & base
   ================================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ================================================================
   Night mode — override semantic tokens
   ================================================================ */
[data-night] {
  --surface-card:    var(--night-700);
  --surface-page:    var(--night-800);
  --surface-sunken:  var(--night-900);
  --text-primary:    rgba(255, 255, 255, 0.92);
  --text-secondary:  rgba(255, 255, 255, 0.62);
  --text-muted:      rgba(255, 255, 255, 0.42);
  --border-default:  var(--night-600);
  --border-subtle:   #1B212D;
  --border-strong:   var(--night-600);
  --accent-soft:     rgba(47, 107, 255, 0.18);
  color-scheme: dark;
}
[data-night] .logo-text  { fill: rgba(255, 255, 255, 0.92); }
[data-night] .logo-accent { fill: var(--accent); }

/* ================================================================
   App shell — full-height flex layout
   ================================================================ */
#app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Top bar ── */
#TopBar {
  height: 64px;
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: 0 var(--space-7);
  background: var(--surface-card);
  border-bottom: 1px solid var(--border-default);
  box-shadow: var(--shadow-sm);
  z-index: var(--z-topbar);
}

.TopBarLogo {
  flex: none;
  display: flex;
  align-items: center;
  text-decoration: none;
}

#TopBarFilters {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.NightModeBtn {
  margin-left: auto;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: none;
  border: 1.5px solid var(--border-default);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease-standard),
              border-color var(--dur-fast) var(--ease-standard),
              color var(--dur-fast) var(--ease-standard);
}
.NightModeBtn:hover {
  background: var(--surface-sunken);
  border-color: var(--accent);
  color: var(--accent);
}
.NightModeBtn .icon-sun  { display: none; }
[data-night] .NightModeBtn .icon-moon { display: none; }
[data-night] .NightModeBtn .icon-sun  { display: block; }

/* ── Custom zoom controls ── */
.MapZoomControls {
  position: fixed;
  bottom: 1.5rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: var(--z-panel);
}
.ZoomBtn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--surface-card);
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: var(--weight-bold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-fast) var(--ease-standard),
              background var(--dur-fast) var(--ease-standard);
}
.ZoomBtn:hover  { box-shadow: var(--shadow-md); background: var(--surface-sunken); }
.ZoomBtn:active { transform: scale(0.92); }

/* ── Content area ── */
#content-area {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* ================================================================
   Map canvas (flex child)
   ================================================================ */
#map {
  flex: 1;
  min-width: 0;
  height: 100%;
}

/* ================================================================
   Search bar
   ================================================================ */
.SearchBox {
  width: 100%;
}

.SearchInput {
  width: 100%;
  background: var(--surface-card);
  border: 1.5px solid var(--border-default);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-pill);
  padding: 0.65rem 1.25rem;
  font-size: var(--text-base);
  font-family: var(--font-sans);
  color: var(--text-primary);
  outline: none;
  transition: box-shadow var(--dur-fast) var(--ease-standard),
              border-color var(--dur-fast) var(--ease-standard);
}

.SearchInput:focus {
  box-shadow: var(--shadow-md), var(--glow-accent);
  border-color: var(--accent);
}

.SearchInput::placeholder {
  color: var(--text-muted);
}

/* ================================================================
   Filter row
   ================================================================ */
.VibeSelectBox,
.HoodSelectBox {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 170px;
}

/* ── Open Now switch ── */
.OpenNowSwitch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--space-5);
  height: 46px;
  cursor: pointer;
  user-select: none;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  white-space: nowrap;
}

.OpenNowInput {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.OpenNowTrack {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  background: var(--ink-300);
  border-radius: 12px;
  transition: background var(--dur-fast) var(--ease-standard);
}

.OpenNowThumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform var(--dur-fast) var(--ease-standard);
}

.OpenNowInput:checked + .OpenNowTrack {
  background: var(--accent);
}

.OpenNowInput:checked + .OpenNowTrack .OpenNowThumb {
  transform: translateX(20px);
}

/* ── Dropdown trigger buttons (two-line style with leading icon + chevron) ── */
.VibeSelected,
.HoodSelected {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
  height: 46px;
  background: var(--surface-card);
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: box-shadow var(--dur-fast) var(--ease-standard),
              border-color var(--dur-fast) var(--ease-standard),
              background var(--dur-fast) var(--ease-standard);
}

.dropdown-icon { flex-shrink: 0; }

.dropdown-chevron {
  flex-shrink: 0;
  margin-left: auto;
  transition: transform var(--dur-fast) var(--ease-standard);
}

/* rotate chevron when open */
.VibeSelectBox.open .dropdown-chevron,
.HoodSelectBox.open .dropdown-chevron { transform: rotate(180deg); }

.dropdown-labels {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.VibeSelected:hover,
.HoodSelected:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.VibeSelected.has-selection,
.HoodSelected.has-selection {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.dropdown-eyebrow {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1;
}

.dropdown-value {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  line-height: 1.2;
  margin-top: 2px;
}

/* ── Dropdown panels ── */
.VibeOptions,
.HoodOptions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  z-index: var(--z-dropdown);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  padding: 0 var(--space-2);
  transition: max-height var(--dur-base) var(--ease-out),
              opacity var(--dur-fast) var(--ease-standard),
              transform var(--dur-base) var(--ease-out),
              padding var(--dur-base) var(--ease-out);
}

.VibeOptions.active,
.HoodOptions.active {
  max-height: 70vh;
  opacity: 1;
  transform: translateY(0);
  padding: var(--space-2);
  overflow-y: auto;
}

/* Visually hidden radio inputs */
.Radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.VibeOptionsIndividual,
.HoodOptionsIndividual {
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-standard);
}

.VibeOptionsIndividual:hover,
.HoodOptionsIndividual:hover {
  background-color: var(--surface-sunken);
}

.VibeOptionsIndividual label,
.HoodOptionsIndividual label {
  display: block;
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  color: var(--text-primary);
  font-size: var(--text-base);
  font-family: var(--font-sans);
  border-radius: var(--radius-sm);
}

.Radio:checked + label {
  color: var(--accent);
  font-weight: var(--weight-semibold);
  background: var(--accent-soft);
}

.VibeClear {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: var(--space-2) var(--space-4);
  margin-bottom: var(--space-1);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  font-family: var(--font-sans);
  color: var(--accent);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.VibeClear:hover {
  background: var(--surface-sunken);
}

/* ================================================================
   Hover tooltip
   ================================================================ */
#MarkerNameTip {
  position: fixed;
  z-index: var(--z-toast);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  font-family: var(--font-sans);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity var(--dur-fast) var(--ease-standard),
              transform var(--dur-fast) var(--ease-standard);
  white-space: nowrap;
}

#MarkerNameTip[aria-hidden="false"] {
  opacity: 1;
  transform: translateY(0);
}

/* ================================================================
   Bar panel (always-visible left sidebar)
   ================================================================ */
/* ── Panel collapse wrapper ── */
#PanelWrapper {
  position: relative;
  flex: none;
  display: flex;
  height: 100%;
}

#PanelToggle {
  position: absolute;
  top: 50%;
  left: var(--panel-width);
  transform: translateY(-50%);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 56px;
  padding: 0;
  background: var(--surface-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: left var(--dur-base) var(--ease-out),
              background var(--dur-fast) var(--ease-standard),
              color var(--dur-fast) var(--ease-standard);
}
#PanelToggle:hover { background: var(--surface-sunken); color: var(--text-primary); }
#PanelToggle svg { transition: transform var(--dur-base) var(--ease-out); }
#PanelWrapper.collapsed #PanelToggle { left: 0; }
#PanelWrapper.collapsed #PanelToggle svg { transform: scaleX(-1); }

#BarPanel {
  width: var(--panel-width);
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--surface-card);
  border-right: 1px solid var(--border-default);
  height: 100%;
  box-shadow: var(--shadow-md);
  z-index: var(--z-panel);
  overflow: hidden;
  transition: margin-left var(--dur-base) var(--ease-out);
}
#PanelWrapper.collapsed #BarPanel { margin-left: calc(-1 * var(--panel-width)); }

/* Browse mode: search/filter visible, back button hidden */
#BarPanel[data-mode="browse"] .BarPanelClose { display: none; }

/* Detail mode: search/filter hidden, back button visible */
#BarPanel[data-mode="detail"] .PanelBrowseHeader { display: none; }

/* ── Panel browse header (search + open now) ── */
.PanelBrowseHeader {
  flex: none;
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-card);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ── Back button (detail mode) ── */
.BarPanelClose {
  flex: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-standard),
              color var(--dur-fast) var(--ease-standard);
}

.BarPanelClose:hover {
  background: var(--surface-sunken);
  color: var(--text-primary);
}

.BarPanelBody {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* ── Hero wrap + bottom-left overlay ── */
.BarPanelHeroWrap {
  position: relative;
}

.HeroOverlayBL {
  position: absolute;
  bottom: var(--space-3);
  left: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.HeroBadge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1;
  backdrop-filter: blur(6px);
}
.HeroBadge--hot { background: var(--chip-popular-bg); color: var(--chip-popular-text); }
.HeroBadge--new { background: var(--chip-new-bg);     color: var(--chip-new-text); }

.HeroVibeChip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.88);
  color: var(--teal-700);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1;
  backdrop-filter: blur(6px);
}

/* ── Hero image / placeholder ── */
.BarPanelHero {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--surface-sunken);
}

.BarPanelHero.BarPanelHero--placeholder {
  background: linear-gradient(160deg, var(--night-700) 0%, var(--night-900) 100%);
  position: relative;
}

.BarPanelHero.BarPanelHero--placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232F6BFF' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'><path d='M5 3h14l-7 9v6h3v2H9v-2h3v-6L5 3z'/></svg>");
  background-size: 48px 48px;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.35;
}

/* ── Panel content ── */
.BarPanelContent {
  padding: var(--space-5) var(--space-6) var(--space-6);
}

.BarPanelTitle {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}

.BarPanelDescription {
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: var(--space-5);
}

.BarPanelVibes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

/* Vibe chips — teal */
.BarPanelVibeChip {
  font-size: var(--text-xs);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--chip-vibe-bg);
  color: var(--chip-vibe-text);
  font-weight: var(--weight-medium);
  font-family: var(--font-sans);
}

/* Badge chips — Popular (amber) and New (green) */
.BarPanelBadge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-weight: var(--weight-semibold);
  font-family: var(--font-sans);
}

.BarPanelBadge--hot {
  background: var(--chip-popular-bg);
  color: var(--chip-popular-text);
}

.BarPanelBadge--new {
  background: var(--chip-new-bg);
  color: var(--chip-new-text);
}

/* Secondary chip row — community-suggested vibes + FSQ tags */
.BarPanelSecondaryChips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-2);
}

/* FSQ category chips — neutral (also used standalone if needed) */
.BarPanelCategories {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-2);
  margin-bottom: var(--space-5);
}

.BarPanelCategoryChip {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--chip-fsq-bg);
  color: var(--chip-fsq-text);
  font-weight: var(--weight-medium);
  font-family: var(--font-sans);
  border: 1.5px solid transparent;
}

/* Open/closed inline badge */
.OpenBadge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  margin-left: var(--space-3);
  vertical-align: 1px;
  font-family: var(--font-sans);
}

.OpenBadge--open {
  background: var(--chip-new-bg);
  color: var(--chip-new-text);
}

.OpenBadge--closed {
  background: #FEE2E2;
  color: #991B1B;
}

/* Meta table — hours, address, phone, website */
.BarPanelMeta {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-5);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.BarPanelMeta dt {
  color: var(--text-muted);
  font-weight: var(--weight-medium);
  font-family: var(--font-sans);
}

.BarPanelMeta dd {
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  word-break: break-word;
}

.BarPanelMeta a {
  color: var(--accent);
  text-decoration: none;
}

.BarPanelMeta a:hover {
  text-decoration: underline;
}

.BarPanelCredit {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.4;
  font-family: var(--font-sans);
}

/* ================================================================
   Map legend
   ================================================================ */
#map-legend {
  position: fixed;
  bottom: 1.5rem;
  left: calc(var(--panel-width) + 1rem);
  transition: left var(--dur-base) var(--ease-out);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-4) var(--space-5);
  z-index: var(--z-panel);
  min-width: 165px;
}

body.panel-collapsed #map-legend { left: 1rem; }

.legend-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  font-family: var(--font-sans);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  padding: 6px var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: background var(--dur-fast) var(--ease-standard),
              opacity var(--dur-fast) var(--ease-standard);
}

.legend-item:last-child {
  margin-bottom: 0;
}

.legend-item:hover {
  background: var(--surface-sunken);
}

.legend-item--active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: var(--weight-semibold);
}

.legend-icon {
  width: 18px;
  height: 29px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ================================================================
   Mobile
   ================================================================ */
@media (max-width: 600px) {
  #TopBar {
    padding: 0 var(--space-4);
    gap: var(--space-3);
  }

  #TopBarFilters {
    gap: var(--space-2);
  }

  .VibeSelected,
  .HoodSelected {
    min-width: 120px;
  }

  #BarPanel {
    width: 280px;
  }

  #PanelToggle {
    left: 280px;
  }
  #PanelWrapper.collapsed #BarPanel { margin-left: -280px; }

  #map-legend {
    bottom: 1rem;
    left: calc(280px + 0.5rem);
  }
  body.panel-collapsed #map-legend {
    left: 0.5rem;
  }

  .BarPanelHero {
    height: 140px;
  }

  .VibeOptions.active,
  .HoodOptions.active {
    max-height: 50vh;
  }
}

/* ================================================================
   Browse panel
   ================================================================ */
.BrowsePanelHeader {
  padding: var(--space-5) var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: var(--surface-card);
  z-index: 1;
}

.BrowsePanelTitle {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  letter-spacing: var(--tracking-tight);
}

.BrowsePanelSubtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-1);
  font-family: var(--font-sans);
}

.BrowseEmpty {
  padding: var(--space-8) var(--space-6);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
  font-family: var(--font-sans);
}

.BrowseList {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
}

.BrowseItem {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-card);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  width: 100%;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--dur-base) var(--ease-standard), transform var(--dur-base) var(--ease-standard), border-color var(--dur-base) var(--ease-standard);
}

.BrowseItem:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.BrowseItemPhoto {
  position: relative;
  height: 132px;
  flex: none;
  overflow: hidden;
  background: linear-gradient(135deg, var(--night-700) 0%, var(--night-900) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.BrowseItemImg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.BrowseItemFlags {
  position: absolute;
  bottom: var(--space-2);
  left: var(--space-2);
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.BrowseItemFlag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 99px;
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

.BrowseItemFlag--hot  { background: var(--chip-popular-bg);  color: var(--chip-popular-text); }
.BrowseItemFlag--new  { background: var(--chip-new-bg);      color: var(--chip-new-text);     }
.BrowseItemFlag--vibe { background: rgba(255,255,255,0.88);  color: var(--teal-700); backdrop-filter: blur(6px); }

.BrowseItemMeta {
  flex: 1;
  min-width: 0;
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.BrowseItemName {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.BrowseItemHood {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  color: var(--text-muted);
}

.BrowseItemDesc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-sans);
}

.BrowseItemChips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  align-items: center;
}

/* ================================================================
   Vibe voting
   ================================================================ */
.VibeVoteChip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--chip-vibe-bg);
  color: var(--chip-vibe-text);
  font-weight: var(--weight-medium);
  font-family: var(--font-sans);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-standard),
              border-color var(--dur-fast) var(--ease-standard),
              transform var(--dur-fast) var(--ease-standard);
}

.VibeVoteChip:hover {
  border-color: var(--teal-500);
  transform: translateY(-1px);
}

.VibeVoteChip.voted {
  background: var(--teal-600);
  color: #fff;
  border-color: var(--teal-600);
}

.VibeVoteCount {
  font-size: 10px;
  font-weight: var(--weight-bold);
  background: rgba(0, 0, 0, 0.14);
  border-radius: var(--radius-pill);
  padding: 0 5px;
  min-width: 18px;
  text-align: center;
  line-height: 1.7;
}

.VibeVoteChip.voted .VibeVoteCount {
  background: rgba(255, 255, 255, 0.25);
}

/* Suggested (community-submitted) vibes — grey default, grey voted */
.VibeVoteChip--suggested {
  background: var(--chip-fsq-bg);
  color: var(--chip-fsq-text);
  border-color: transparent;
}
.VibeVoteChip--suggested:hover {
  border-color: var(--ink-400);
  color: var(--ink-700);
  transform: translateY(-1px);
}
.VibeVoteChip--suggested.voted {
  background: var(--ink-500);
  color: #fff;
  border-color: var(--ink-500);
}
.VibeVoteChip--suggested.voted .VibeVoteCount {
  background: rgba(255, 255, 255, 0.25);
}

/* ================================================================
   Comments section
   ================================================================ */
.CommentsSection {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-5) var(--space-6) var(--space-7);
}

.CommentsTitle {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.CommentsList {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.CommentItem {
  display: flex;
  gap: var(--space-3);
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}
.CommentBody { flex: 1; min-width: 0; }

.CommentText {
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: var(--space-1);
  font-family: var(--font-sans);
  word-break: break-word;
}

.CommentMeta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.CommentSortBar {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

.CommentSortBtn {
  height: 28px;
  padding: 0 var(--space-3);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-pill);
  background: transparent;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}

.CommentSortBtn.active,
.CommentSortBtn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.CommentEmpty {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-style: italic;
  padding: var(--space-3) 0 var(--space-5);
  font-family: var(--font-sans);
}

.CommentForm {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-2);
}

.CommentFormMeta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
}

.CommentInput {
  width: 100%;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--surface-card);
  resize: vertical;
  min-height: 72px;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-standard),
              box-shadow var(--dur-fast) var(--ease-standard);
}

.CommentInput:focus {
  border-color: var(--accent);
  box-shadow: var(--glow-accent);
}

.CommentInput::placeholder {
  color: var(--text-muted);
}

.CommentSubmit {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-standard);
}

.CommentSubmit:hover {
  background: var(--accent-hover);
}
.CommentSubmit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Form error message ── */
.FormError {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: rgba(229, 72, 77, 0.1);
  color: var(--danger);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

/* ── Community loading states ── */
.CommunityLoading {
  padding: var(--space-2) 0;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}
.VibeLoading {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-style: italic;
  margin: 0;
}

/* ── Comment vote rail ── */
.CommentVoteRail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
  padding-top: 1px;
}
.CommentVoteBtn {
  background: none;
  border: none;
  font-size: 9px;
  cursor: pointer;
  color: var(--teal-500);
  padding: 2px 4px;
  border-radius: var(--radius-xs);
  line-height: 1;
  transition: color var(--dur-fast) var(--ease-standard),
              background var(--dur-fast) var(--ease-standard);
}
.CommentVoteBtn[data-dir="-1"] { color: #E04444; }
.CommentVoteBtn:hover  { background: var(--border-subtle); opacity: 0.8; }
.CommentVoteBtn.active { color: var(--teal-600); font-weight: var(--weight-bold); }
.CommentVoteBtn[data-dir="-1"].active { color: #C03030; }
.CommentScore {
  font-size: 10px;
  font-family: var(--font-data);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  min-width: 16px;
  text-align: center;
  line-height: 1.4;
}
.CommentScore.pos { color: var(--accent); }
.CommentScore.neg { color: #E04444; }

/* ================================================================
   Star ratings
   ================================================================ */
.StarRating {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0 var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-3);
}
.StarDisplay {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}
.StarAvg {
  font-family: var(--font-data);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--amber-500);
}
.StarCount {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-sans);
}
.StarInput { display: flex; gap: 1px; }
.StarBtn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--ink-300);
  padding: 1px 2px;
  line-height: 1;
  transition: color var(--dur-fast) var(--ease-standard),
              transform var(--dur-fast) var(--ease-standard);
}
.StarBtn:hover, .StarBtn--active { color: var(--amber-500); }
.StarBtn:hover { transform: scale(1.2); }

/* ================================================================
   Suggest a vibe
   ================================================================ */
.SuggestVibeBtn {
  display: inline-flex;
  align-items: center;
  margin-top: var(--space-3);
  background: none;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-standard),
              color var(--dur-fast) var(--ease-standard);
}
.SuggestVibeBtn:hover { border-color: var(--accent); color: var(--accent); }
.SuggestVibeForm {
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.SuggestVibeForm:not([hidden]) { display: flex; }
.SuggestVibeInput {
  flex: 1;
  min-width: 0;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--surface-card);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-standard),
              box-shadow var(--dur-fast) var(--ease-standard);
}
.SuggestVibeInput:focus { border-color: var(--accent); box-shadow: var(--glow-accent); }
.SuggestVibeInput::placeholder { color: var(--text-muted); }
.SuggestVibeSubmit {
  flex: none;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-standard);
}
.SuggestVibeSubmit:hover { background: var(--accent-hover); }

/* ── "Show all vibes" button ── */
.VibeShowAllBtn {
  display: inline-flex;
  align-items: center;
  margin-top: var(--space-2);
  background: none;
  border: none;
  padding: 0;
  font-size: var(--text-xs);
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  color: var(--accent);
  cursor: pointer;
  gap: 4px;
  transition: color var(--dur-fast) var(--ease-standard);
}
.VibeShowAllBtn:hover { color: var(--accent-hover); }

/* ── Vibe "all vibes" centered overlay modal ── */
.VibeModalScrim {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--surface-overlay);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}
.VibeModalScrim.open { opacity: 1; }

.VibeModalCard {
  width: min(480px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
}
.VibeModalScrim.open .VibeModalCard {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.VibeModalHeader {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.VibeModalHeaderText {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  flex: 1;
}
.VibeModalEyebrow {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--teal-600);
}
.VibeModalBarName {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.VibeModalMeta {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.VibeModalClose {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.VibeModalClose:hover { background: var(--surface-sunken); color: var(--text-primary); }

.VibeModalBody {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.VibeModalSection {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.VibeModalSectionLabel {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-muted);
}
.VibeModalChips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.VibeModalFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.VibeModalHint {
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.VibeModalDoneBtn {
  height: 42px;
  padding: 0 18px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-standard);
}
.VibeModalDoneBtn:hover { background: var(--accent-hover); }
