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

:root {
  --topnav-h: 52px;
  --sidebar-w: 300px;
  --detail-w: 370px;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface2: #f2f2f0;
  --border: #e8e8e5;
  --border2: #d8d8d4;
  --text-1: #111110;
  --text-2: #555552;
  --text-3: #999994;
  --accent: #1a6ef5;
  --accent-lt: #e8f0fe;
  --green: #16a34a;
  --green-lt: #dcfce7;
  --red: #dc2626;
  --red-lt: #fee2e2;
  --amber: #d97706;
  --amber-lt: #fef3c7;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.14), 0 4px 12px rgba(0,0,0,.08);
  --font: 'DM Sans', system-ui, -apple-system, sans-serif;
  --mono: 'DM Mono', monospace;
  --trans: 0.18s ease;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── TOPBAR / TOPNAV ── */
nav.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topnav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 16px;
  z-index: 1300;
  box-shadow: var(--shadow-sm);
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.topnav-icon,
.topnav-logo {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  object-fit: contain;
  flex-shrink: 0;
}
.topnav-name { font-size: 15px; font-weight: 700; color: var(--text-1); letter-spacing: -0.3px; }

.topnav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.topnav-link {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  color: var(--text-3);
  text-decoration: none;
  background: transparent;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: background var(--trans), color var(--trans);
}

.topnav-link:hover { background: var(--surface2); color: var(--text-1); }
.topnav-link.active { background: var(--accent-lt); color: var(--accent); font-weight: 600; }

.chat-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  background: var(--red);
  color: #ffffff;
  margin-left: 5px;
  line-height: 1;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  vertical-align: middle;
}

@keyframes chat-shake {
  0% { transform: translate(0, 0) rotate(0deg); }
  20% { transform: translate(-2px, 0) rotate(-4deg); }
  40% { transform: translate(2px, 0) rotate(4deg); }
  60% { transform: translate(-2px, 0) rotate(-3deg); }
  80% { transform: translate(2px, 0) rotate(3deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.topnav-link.shake-notify {
  animation: chat-shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
  color: var(--red) !important;
  font-weight: 700 !important;
}

.topnav-food-link {
  color: #b45309 !important;
  font-weight: 700 !important;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.topnav-food-link.flash-notify {
  animation: chat-shake 0.7s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
  color: #d97706 !important;
}

.food-pulse-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-radius: 10px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
  animation: food-badge-pulse 1.4s infinite;
  vertical-align: middle;
}

@keyframes food-badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
  50% { box-shadow: 0 0 7px 3px rgba(245, 158, 11, 0.6); }
}

.topnav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.loc-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.loc-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  flex-shrink: 0;
}

.loc-indicator.found {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-lt);
}

.loc-indicator.denied {
  background: var(--red);
}

.loc-status {
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
  font-weight: 500;
}

#auth-msg {
  font-size: 12px;
  font-weight: 500;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-bar-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-bar-inputs input {
  width: 110px;
  padding: 6px 9px;
  font-size: 12px;
  font-family: var(--font);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-1);
  outline: none;
  transition: border-color var(--trans);
}

.auth-bar-inputs input:focus {
  border-color: var(--accent);
}

.btn-primary-sm {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--trans);
  white-space: nowrap;
}

.btn-primary-sm:hover { background: #1559cc; }

.btn-secondary-sm {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
  background: var(--surface2);
  color: var(--text-1);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--trans);
  white-space: nowrap;
}

.btn-secondary-sm:hover { background: var(--border); }

.btn-text-sm {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px 6px;
  font-family: var(--font);
  transition: color var(--trans);
}

.btn-text-sm:hover { color: var(--accent); }

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  transition: transform var(--trans);
}

.avatar-button:hover { transform: scale(1.05); }

.avatar-image {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* ── APP LAYOUT ── */
.app-layout {
  display: flex;
  height: calc(100vh - var(--topnav-h));
  margin-top: var(--topnav-h);
  overflow: hidden;
  position: relative;
}

/* ── LEFT SIDEBAR ── */
aside.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--trans), opacity var(--trans), transform var(--trans);
  z-index: 1100;
  box-shadow: var(--shadow-sm);
}

aside.sidebar.collapsed {
  width: 0;
  opacity: 0;
  pointer-events: none;
}

.sidebar-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  background: var(--surface);
}

.sidebar-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: -0.2px;
}

.btn-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-2);
  transition: all var(--trans);
  flex-shrink: 0;
}

.btn-icon:hover { background: var(--border); color: var(--text-1); }

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.sb-section {
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border);
}

.sb-section:last-child { border-bottom: none; }

.sb-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
  display: block;
}

/* ── SEARCH BOX ── */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-ico {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  z-index: 1;
}

#search {
  width: 100%;
  padding: 9px 32px 9px 32px;
  font-size: 13px;
  font-family: var(--font);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-1);
  outline: none;
  transition: border-color var(--trans), background var(--trans);
}

#search:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 2px var(--accent-lt);
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}

.search-clear-btn:hover { color: var(--text-1); }

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  max-height: 250px;
  overflow-y: auto;
  z-index: 1500;
}

.search-result-item {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background var(--trans);
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--accent-lt); }
.search-result-title { font-weight: 600; color: var(--text-1); }
.search-result-sub { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── BUTTON LOCATE ── */
.btn-locate-sidebar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-1);
  cursor: pointer;
  transition: all var(--trans);
}

.btn-locate-sidebar:hover {
  background: var(--accent-lt);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── TYPE FILTERS ── */
.type-filter-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.type-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--trans);
  user-select: none;
}

.type-filter-row:hover { background: var(--surface2); }

.type-filter-label-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
}

.type-filter-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.type-filter-count {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--mono);
}

/* ── HOURS & DAYS FILTER ── */
.filter-scope-note {
  font-size: 10px;
  color: var(--text-3);
  font-style: italic;
  margin-bottom: 10px;
  padding: 4px 8px;
  background: var(--surface2);
  border-radius: 6px;
  border-left: 2px solid var(--border);
}

.open-now-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  color: var(--text-1);
  transition: all var(--trans);
  margin-bottom: 12px;
}

.open-now-btn:hover {
  border-color: var(--green);
  background: var(--green-lt);
  color: var(--green);
}

.open-now-btn.active {
  background: var(--green-lt);
  border-color: var(--green);
  color: var(--green);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
  flex-shrink: 0;
  transition: all var(--trans);
}

.open-now-btn.active .pulse-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.25);
  animation: dot-pulse 2s infinite;
}

@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.25); }
  50% { box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.12); }
}

.day-grid {
  margin-bottom: 12px;
}

.day-grid-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 7px;
}

.day-pills {
  display: flex;
  gap: 4px;
}

.day-pill {
  flex: 1;
  padding: 7px 0;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font);
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  color: var(--text-2);
  transition: all var(--trans);
  text-align: center;
}

.day-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-lt);
}

.day-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.time-filter {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 4px;
}

.time-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.time-filter-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.time-clear {
  font-size: 11px;
  font-family: var(--font);
  font-weight: 600;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.time-clear:hover {
  color: var(--red);
}

.time-display {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.time-chip {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--text-1);
  flex: 1;
  text-align: center;
}

.time-chip.active {
  border-color: var(--accent);
  color: var(--accent);
}

.time-arrow {
  color: var(--text-3);
  font-size: 12px;
}

.range-track-wrap {
  position: relative;
  height: 36px;
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.range-track-bg, .range-track-fill {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  border-radius: 4px;
  pointer-events: none;
}

.range-track-bg {
  left: 0;
  right: 0;
  background: var(--border);
}

.range-track-fill {
  background: var(--accent);
}

.range-slider {
  position: absolute;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  outline: none;
  height: 36px;
  margin: 0;
}

.range-slider.range-from { z-index: 3; }
.range-slider.range-to   { z-index: 4; }

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  border: 2.5px solid var(--accent);
  box-shadow: var(--shadow-sm);
  cursor: grab;
  pointer-events: all;
}

.range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  border: 2.5px solid var(--accent);
  cursor: grab;
  pointer-events: all;
}

.range-slider::-moz-range-track { background: transparent; }

.time-tick-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-3);
  padding: 0 2px;
}

.reset-filters-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
  padding: 9px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  background: none;
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--trans);
}

.reset-filters-btn:hover, .reset-filters-btn.has-filters {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-lt);
  border-style: solid;
}

/* ── PILL TOGGLES & OPTIONS ── */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.option-label {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}

.pill-toggle {
  position: relative;
  width: 38px;
  height: 22px;
}

.pill-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.pill-thumb {
  position: absolute;
  inset: 0;
  background: var(--border2);
  border-radius: 20px;
  cursor: pointer;
  transition: background var(--trans);
}

.pill-thumb::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--trans);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.pill-toggle input:checked + .pill-thumb {
  background: var(--accent);
}

.pill-toggle input:checked + .pill-thumb::after {
  transform: translateX(16px);
}

.amenity-count-text {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 12px;
}

.sidebar-action-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-sidebar-action {
  width: 100%;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-1);
  cursor: pointer;
  text-align: left;
  transition: all var(--trans);
}

.btn-sidebar-action:hover {
  background: var(--accent-lt);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sidebar-action.is-food-active {
  background: var(--amber-lt) !important;
  border-color: var(--amber) !important;
  color: #b45309 !important;
  animation: food-flash-pulse 1.4s infinite ease-in-out;
  font-weight: 700;
}

@keyframes food-flash-pulse {
  0%, 100% {
    background: var(--amber-lt);
    border-color: var(--amber);
    box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.45);
  }
  50% {
    background: #fef3c7;
    border-color: #d97706;
    box-shadow: 0 0 10px 4px rgba(217, 119, 6, 0.55);
    color: #92400e;
  }
}

/* ── MAP AREA ── */
.map-wrap {
  flex: 1;
  position: relative;
  height: 100%;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
}

.btn-floating-sidebar {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1000;
  width: 36px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-1);
  transition: all var(--trans);
}

.btn-floating-sidebar:hover {
  background: var(--surface2);
}

.btn-locate-fab {
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  width: 40px;
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-1);
  transition: transform var(--trans), box-shadow var(--trans);
}

.btn-locate-fab:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-lg);
}

/* ── RIGHT DETAIL PANEL ── */
aside.detail-panel {
  width: 0;
  flex-shrink: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1200;
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  box-shadow: var(--shadow-lg);
  max-width: 100vw;
}

aside.detail-panel.open {
  width: var(--detail-w);
}

.dp-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-shrink: 0;
  background: var(--surface);
}

.dp-back {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-2);
  flex-shrink: 0;
  margin-top: 2px;
  transition: all var(--trans);
}

.dp-back:hover { background: var(--border); color: var(--text-1); }

.dp-title-wrap { flex: 1; min-width: 0; }

.dp-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.3;
  word-break: break-word;
  margin-bottom: 4px;
}

.dp-meta-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.dp-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--accent-lt);
  color: var(--accent);
}

.dp-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  padding: 0 16px;
}

.dp-tab {
  flex: 1;
  padding: 11px 6px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  color: var(--text-3);
  transition: all var(--trans);
  white-space: nowrap;
  margin-bottom: -1px;
}

.dp-tab:hover { color: var(--text-1); }
.dp-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.dp-body {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

.dp-body::-webkit-scrollbar { width: 4px; }
.dp-body::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.dp-tab-pane { display: none; }
.dp-tab-pane.active { display: block; }

.dp-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.dp-section:last-child { border-bottom: none; }

.dp-field-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 5px;
  display: block;
}

.dp-field-value {
  font-size: 13px;
  color: var(--text-1);
  line-height: 1.5;
}

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

.dp-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  color: var(--text-1);
  text-decoration: none;
  transition: all var(--trans);
}

.dp-nav-btn:hover {
  background: var(--accent-lt);
  border-color: var(--accent);
  color: var(--accent);
}

.dp-favorite-btn {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans);
  margin-top: 6px;
}

.dp-favorite-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.dp-favorite-btn.is-active {
  background: #fff4d6;
  border-color: #f2c94c;
  color: #8a6700;
}

/* ── NEARBY TAB ── */
.nearby-header {
  padding: 10px 16px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}

.nearby-list { display: flex; flex-direction: column; }

.nearby-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--trans);
  user-select: none;
}

.nearby-card:last-child { border-bottom: none; }
.nearby-card:hover { background: var(--surface2); }
.nearby-icon { font-size: 20px; line-height: 1; flex-shrink: 0; }
.nearby-info { flex: 1; min-width: 0; }
.nearby-name { font-size: 13px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nearby-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.nearby-dist { font-size: 12px; font-weight: 700; color: var(--accent); flex-shrink: 0; }
.nearby-empty { padding: 40px 16px; text-align: center; color: var(--text-3); font-size: 13px; }

/* ── REVIEWS TAB ── */
.rv-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px 18px;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}

.rv-hero-emoji { font-size: 42px; line-height: 1; }
.rv-hero-type { font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-3); }

.rv-rating-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  margin-top: 6px;
  width: 100%;
}

.rv-rating-big { font-size: 34px; font-weight: 700; color: var(--text-1); line-height: 1; }
.rv-rating-left { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.rv-stars { font-size: 16px; color: #f59e0b; letter-spacing: 1px; }
.rv-count { font-size: 11px; color: var(--text-3); }
.rating-histo { display: flex; flex-direction: column; gap: 3px; }
.rating-histo-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) 20px; align-items: center; gap: 6px; }
.rating-histo-label { font-size: 11px; color: var(--text-3); font-weight: 500; text-align: right; }
.rating-histo-bar-wrap { height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.rating-histo-bar { height: 100%; background: #f59e0b; border-radius: 3px; }
.rating-histo-count { font-size: 11px; color: var(--text-3); text-align: right; font-family: var(--mono); }

.rv-review-card {
  margin: 10px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.rv-review-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.rv-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.rv-reviewer { font-size: 13px; font-weight: 600; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-review-stars { font-size: 12px; color: #f59e0b; letter-spacing: 1px; margin-top: 1px; }
.rv-review-date { font-size: 11px; color: var(--text-3); white-space: nowrap; margin-left: auto; }
.rv-review-text { font-size: 13px; color: var(--text-2); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.rv-review-photo { margin-top: 8px; width: 100%; max-height: 200px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: block; }

.review-form-box {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.review-form-title { font-size: 12px; font-weight: 700; color: var(--text-1); margin-bottom: 8px; }
.review-textarea {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--font);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-1);
  outline: none;
  resize: vertical;
  min-height: 50px;
  line-height: 1.4;
}

.review-textarea:focus { border-color: var(--accent); }

/* ── HOVER TOOLTIP ── */
#amenity-hover-tooltip {
  position: fixed;
  z-index: 9000;
  pointer-events: auto;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  max-width: 280px;
  display: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  font-family: var(--font);
  overflow: hidden;
}

#amenity-hover-tooltip .tt-hdr {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
}

#amenity-hover-tooltip .tt-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  margin: 0 0 4px;
  line-height: 1.3;
}

#amenity-hover-tooltip .tt-type {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--accent-lt);
  color: var(--accent);
}

#amenity-hover-tooltip .tt-body { padding: 6px 12px 4px; }
#amenity-hover-tooltip .tt-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

#amenity-hover-tooltip .tt-row:last-child { border-bottom: none; }
#amenity-hover-tooltip .tt-lbl { color: var(--text-3); flex-shrink: 0; font-weight: 500; }
#amenity-hover-tooltip .tt-val { color: var(--text-1); text-align: right; line-height: 1.3; }
#amenity-hover-tooltip .tt-hint {
  padding: 6px 12px 8px;
  font-size: 11px;
  color: var(--text-3);
  font-style: italic;
  text-align: center;
}

/* ── MODALS ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.modal-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 380px;
  padding: 28px 24px;
  position: relative;
  animation: modal-in 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-modal-card {
  max-width: 440px;
  max-height: 85vh;
  overflow-y: auto;
}

@keyframes modal-in {
  from { transform: translateY(16px) scale(0.97); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover { color: var(--text-1); background: var(--border); }
.modal-brand { font-size: 32px; text-align: center; margin-bottom: 4px; }
.modal-title { font-size: 17px; font-weight: 700; text-align: center; color: var(--text-1); margin-bottom: 16px; }

.profile-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 16px;
}

.profile-tab-btn {
  flex: 1;
  padding: 7px 4px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-3);
  transition: all var(--trans);
}

.profile-tab-btn.active {
  background: var(--surface);
  color: var(--text-1);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.avatar-picker-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.avatar-preview {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  background: #f0f4fc;
}

.avatar-upload-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-lt);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.form-group {
  margin-bottom: 10px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 4px;
  display: block;
}

.form-input {
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  font-family: var(--font);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-1);
  outline: none;
}

.form-input.disabled {
  background: var(--border);
  cursor: not-allowed;
  color: var(--text-3);
}

.form-textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  font-family: var(--font);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-1);
  outline: none;
  min-height: 56px;
  resize: vertical;
}

.btn-primary {
  width: 100%;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--trans);
}

.btn-primary:hover { background: #1559cc; }

.status-msg {
  font-size: 12px;
  text-align: center;
  margin: 4px 0 8px;
}

.profile-items-list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-list-card {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

/* ── CHAT PANEL ── */
.chat-panel {
  position: fixed;
  right: 18px;
  top: 68px;
  width: min(380px, calc(100vw - 36px));
  height: 500px;
  max-height: calc(100vh - 90px);
  padding: 16px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 1400;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.chat-header-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-secondary-xs {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.btn-icon-xs {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-3);
  padding: 0 4px;
}

.chat-channel-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font);
  font-size: 13px;
  background: var(--surface2);
  color: var(--text-1);
}

.new-chat-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-subhead {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
}

.form-input-sm {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--font);
}

.new-group-row { display: flex; gap: 6px; }

.user-search-results {
  max-height: 100px;
  overflow-y: auto;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.user-search-item {
  padding: 6px 8px;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
}

.user-search-item:hover { background: var(--accent-lt); }

.chat-messages-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-message {
  padding: 8px 10px;
  font-size: 13px;
  background: var(--surface2);
  border-radius: 8px;
  word-break: break-word;
}

.chat-input-form {
  display: flex;
  gap: 6px;
  margin-top: auto;
}

.chat-input-field {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--font);
}

/* ── LEAFLET CUSTOM STYLES ── */
.bike-cluster-wrapper { background: transparent; border: 0; }
.bike-cluster {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid #fff;
  color: #fff;
  background: #f08a24;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--mono);
}
.bike-cluster-small { background: #f08a24; }
.bike-cluster-medium { width: 46px; height: 46px; background: #e66f17; }
.bike-cluster-large { width: 52px; height: 52px; background: #c94e0a; }

.amenity-emoji-marker { background: transparent; border: 0; }
.amenity-emoji-marker span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--marker-color, #1a6ef5);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  font-size: 16px;
  transition: transform var(--trans);
}

.amenity-emoji-marker span:hover {
  transform: rotate(-45deg) scale(1.15);
}

.amenity-emoji-marker b {
  transform: rotate(45deg);
  font-weight: 400;
}

.hover-pin-bright {
  filter: drop-shadow(0 0 6px rgba(234, 179, 8, 0.9));
}

[hidden] { display: none !important; }
