/* ============================================================
   css/browse.css  —  All styles for browse.html
   REQUIREMENTS.md §2.1 frozen IDs respected throughout.
   ============================================================ */

:root {
  --primary:   #667eea;
  --secondary: #764ba2;
  --success:   #51cf66;
  --danger:    #ff6b6b;
  --dark:      #1a202c;
  --light:     #f5f7fb;
  --border:    #e1e8f0;
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
  /* Demo Polish Variables */
  --chrono-purple: #8a2be2;
  --chrono-gold: #f59e0b;
  --chrono-gold-light: #fbbf24;
  --text-primary: #ffffff;
}

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

/* MOBILE OPTIMIZATION: Prevent iOS auto-zoom on form inputs */
input, select, textarea {
  font-size: 16px !important;
}

html, body {
  height: 100dvh;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--light);
  color: var(--dark);
  display: flex;
  flex-direction: column;
  overscroll-behavior-y: none;
}
/* Override ArcGIS default fonts with system sans-serif */
.esri-popup__main-container,
.esri-widget {
  font-family: "Inter", system-ui, -apple-system, sans-serif !important;
}

/* ArcGIS Search Widget — constrain width so it doesn't crowd the map on small screens */
.esri-search { max-width: min(320px, 55vw); }
/* Search suggestions dropdown must appear above other map overlays */
.esri-search__suggestions-menu { z-index: 25 !important; }

/* TID-UI-ZFIX: ArcGIS Popup must float above the .topbar (z-index:100) */
.esri-popup { z-index: 110 !important; }
.esri-popup__main-container { z-index: 110 !important; }
.esri-ui-top-center,
.esri-ui-top-left,
.esri-ui-top-right { z-index: 101; }

/* HEADER */
.topbar { flex-shrink: 0; background: var(--dark); color: #fff; border-bottom: 1px solid rgba(255,255,255,0.1); z-index: 100; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.brand-logo-img { height: 40px; width: auto; object-fit: contain; }
.topbar nav ul { list-style: none; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.topbar nav a { color: rgba(255,255,255,0.8); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.topbar nav a:hover, .topbar nav a.nav-active { color: #fff; font-weight: 600; }

/* WELCOME BADGE — injected by auth.js as #welcomeUserItem inside nav ul */
.topbar nav ul #welcomeUserItem {
  display: inline-flex;
  align-items: center;
  background: rgba(167, 139, 250, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 20px;
  padding: 4px 12px;
  white-space: nowrap;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #a78bfa;
  font-weight: 600;
}

.btn-link { background: none; border: none; color: rgba(255,255,255,0.8); font-size: 0.9rem; cursor: pointer; padding: 4px 2px; transition: color 0.2s; font-family: inherit; min-height: 44px; }
.btn-link:hover { color: #fff; }
.btn-accent { background: var(--primary); border: none; color: #fff; font-size: 0.85rem; font-weight: 600; cursor: pointer; padding: 6px 14px; border-radius: 8px; transition: opacity 0.2s; font-family: inherit; min-height: 44px; }
.btn-accent:hover { opacity: 0.88; }

/* NEIGHBORHOOD HEADER BADGE — topbar indicator, updated by setNeighborhoodHeaderBadge() */
.neighborhood-header-badge {
  display: none;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  background: #667eea;
  padding: 4px 12px;
  border-radius: 9999px;
  border: 2px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.neighborhood-header-badge.visible { display: inline-flex; align-items: center; }

/* VIBE GLOW — Thriving neighborhood animation (>80% Chill + Family).
   Uses box-shadow + border-color only — no dimension changes → zero layout shift. */
@keyframes vibe-glow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6); border-color: var(--chrono-gold); }
  50%       { box-shadow: 0 0 8px 3px rgba(245, 158, 11, 0.25); border-color: var(--chrono-gold-light); }
}
.neighborhood-header-badge.vibe-glow-active {
  border-color: var(--chrono-gold);
  animation: vibe-glow-pulse 2s ease-in-out infinite;
}

/* FOUNDING NEIGHBOR VIP BADGE — persistent gold badge for beta testers */
.founding-neighbor-badge {
  display: none;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--chrono-gold);
  background: rgba(245, 158, 11, 0.12);
  border: 2px solid var(--chrono-gold);
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

/* BETA FEEDBACK FAB — floating action button (position managed by .chrono-float-tray on browse page) */
.beta-feedback-fab {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  right: 20px;
  z-index: 510;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.45);
  transition: opacity 0.2s, transform 0.15s;
  min-height: 44px;
  white-space: nowrap;
}
.beta-feedback-fab:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}
.beta-feedback-fab:active {
  transform: translateY(0);
}

/* APP CONTAINER */
.app-container { flex: 1 1 0; min-height: 0; display: flex; overflow: hidden; }

/* MAP */
/* #REQ-9-FIX: z-index:1 establishes a stacking context on the map-wrapper so that
   .map-controls (z-index:20 inside) always render above the .side-panel (no z-index),
   resolving the interaction-blocking conflict with the 24-Hour Vibe Timeline and
   Private Group Feed when they share the same root stacking context. */
.map-wrapper { flex: 1 1 0; position: relative; z-index: 1; background: #e8ecf0; min-height: 0; overscroll-behavior-y: none; }
#map { width: 100%; height: 100%; min-height: 400px; }
.map-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.85); font-size: 0.95rem; color: #555; z-index: 5; pointer-events: none; }
.map-flyout { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: rgba(255,255,255,0.97); padding: 8px 18px; border-radius: 20px; font-size: 13px; font-weight: 500; box-shadow: 0 2px 12px rgba(0,0,0,0.18); display: none; z-index: 10; max-width: 90%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-flyout.show { display: block; }

/* GLASS INFO PANEL — glassmorphism floating overlay shown on map click */
.glass-info-panel {
  display: none;
  position: absolute;
  bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  left: 20px;
  min-width: 260px;
  max-width: min(360px, calc(100% - 40px));
  min-height: auto; /* Issue 6: was 300px — let content determine height */
  background: rgba(15, 42, 66, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 18px 20px 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
  z-index: 22;
  color: #fff;
}
.glass-info-panel.show { display: block; }
.glass-panel-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-family: inherit;
  min-height: 28px;
}
.glass-panel-close:hover { background: rgba(255, 255, 255, 0.28); }
.glass-panel-address {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
  padding-right: 24px;
  line-height: 1.35;
}
.glass-panel-count {
  font-size: 0.78rem;
  opacity: 0.8;
  margin-bottom: 8px;
}
.glass-panel-comments {
  font-size: 0.78rem;
  opacity: 0.85;
  line-height: 1.5;
  max-height: 120px; /* Issue 6: increased from 80px to accommodate longer wrapped snippets */
  overflow-y: auto;
}
.glass-panel-comments::-webkit-scrollbar { width: 6px; }
.glass-panel-comments::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 4px; }
.glass-panel-comments::-webkit-scrollbar-track { background: transparent; }
.glass-panel-comments { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.3) transparent; }

/* MAP CONTROLS - PROGRESSIVE MAP MODES (3-WAY TOGGLE) */
/* z-index raised 10→20 (2/19 fix): ensures buttons stay above ArcGIS UI widgets */
.map-controls { position: absolute; top: 16px; right: 16px; z-index: 20; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.map-mode-toggle { display: flex; gap: 4px; background: #0f2a42; border-radius: 50px; padding: 4px; box-shadow: 0 2px 12px rgba(0,0,0,0.25); position: relative; }
.map-mode-btn { background: transparent; border: none; padding: 8px 12px; border-radius: 40px; font-size: 12px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease; color: #a8c8da; font-family: inherit; min-height: 44px; min-width: 44px; }
.map-mode-btn:hover { background: rgba(76, 161, 174, 0.15); color: #d0eaf0; }
.map-mode-btn.active { background: #4ca1ae; color: #fff; border-radius: 40px; box-shadow: 0 2px 8px rgba(76, 161, 174, 0.4); }
.map-mode-btn .btn-icon { font-size: 16px; }
.map-mode-btn .btn-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }

/* CHOROPLETH TOGGLE — hidden for beta launch; restore by uncommenting in browse.html + these rules
.choropleth-toggle { background: rgba(255,255,255,0.97); border-radius: 10px; padding: 6px 14px; box-shadow: 0 2px 12px rgba(0,0,0,0.15); width: 100%; justify-content: center; color: #555; }
.choropleth-toggle.active { background: #4ca1ae; color: #fff; border-radius: 10px; box-shadow: 0 2px 8px rgba(76, 161, 174, 0.4); }
*/

/* FILTER CHIPS — category filter row below map mode controls */
.map-filters-container { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.filter-chip { background: rgba(15, 42, 66, 0.8); border: none; color: #fff; font-size: 11px; font-weight: 600; padding: 6px 12px; border-radius: 50px; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease; font-family: inherit; min-height: 30px; white-space: nowrap; pointer-events: auto; position: relative; z-index: 10; }
.filter-chip:hover { transform: scale(1.05); background: rgba(76, 161, 174, 0.35); }
.filter-chip.active-filter { background: #4ca1ae; box-shadow: 0 0 8px rgba(76, 161, 174, 0.5); }
/* TID-EPIC-04 / TID-032: Min-star density slider */
.density-slider-container { display: flex; align-items: center; gap: 8px; margin-top: 4px; background: rgba(15, 42, 66, 0.95); padding: 6px 12px; border-radius: 50px; }
.density-slider-label { font-size: 11px; font-weight: 600; color: #fff; white-space: nowrap; min-width: 60px; }
.density-slider { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 4px; background: rgba(76,161,174,0.35); outline: none; cursor: pointer; width: 100px; accent-color: #4ca1ae; }

/* CONTEXT-BAR-DISABLED: restore when themes are built */
/*
/* LIFE FIT CONTEXT CONTROLS (Epic 30) — pill-shaped floating panel, bottom-center of map */
.map-context-controls {
  position: absolute;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 21;
  display: flex;
  gap: 2px;
  background: rgba(15, 42, 66, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 50px;
  padding: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  max-width: calc(100% - 32px);
  overflow-x: auto;
  white-space: nowrap;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.map-context-controls::-webkit-scrollbar { display: none; }
.ctx-btn {
  background: transparent;
  border: none;
  padding: 7px 11px;
  border-radius: 40px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #a8c8da;
  font-family: inherit;
  min-height: 44px;
  min-width: 44px;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}
.ctx-btn:hover { background: rgba(76, 161, 174, 0.2); color: #d0eaf0; }
.ctx-btn.active { background: #4ca1ae; color: #fff; box-shadow: 0 2px 8px rgba(76, 161, 174, 0.4); }
.ctx-btn-icon { font-size: 15px; }
.ctx-btn-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.ctx-btn-lock { font-size: 10px; opacity: 0.7; }
.ctx-btn-lock.hidden { display: none; }
*/
/* END CONTEXT-BAR-DISABLED */

/* SIDE PANEL */
.side-panel { width: 340px; max-width: 340px; flex-shrink: 0; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: rgba(13, 17, 23, 0.6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-left: 1px solid rgba(255,255,255,0.1); padding-bottom: env(safe-area-inset-bottom, 20px); }
.side-panel-header { padding: 18px 20px 12px; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; flex-shrink: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.side-panel-header h2 { font-size: 1.15rem; margin-bottom: 3px; width: 100%; }
.side-panel-header p { font-size: 0.82rem; opacity: 0.85; width: 100%; }
/* ── Sidebar User Status Card (Fix 13) ─────────────────────────────────── */
.sidebar-user-status { padding: 10px 16px; background: rgba(99,102,241,0.12); border-bottom: 1px solid rgba(99,102,241,0.2); flex-shrink: 0; }
.sus-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.sus-name { font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,0.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.sus-tier { font-size: 0.72rem; background: rgba(167,139,250,0.22); color: #a78bfa; border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.sus-xp-row { margin-bottom: 0; }
.sus-xp-label { font-size: 0.72rem; color: rgba(255,255,255,0.6); white-space: nowrap; flex-shrink: 0; }
.sus-xp-bar-track { flex: 1; height: 5px; background: rgba(255,255,255,0.12); border-radius: 3px; overflow: hidden; margin-left: 8px; }
.sus-xp-bar-fill { height: 100%; background: linear-gradient(90deg, #6366f1, #a78bfa); border-radius: 3px; transition: width 0.4s ease; }
.side-panel-content { padding: 20px; flex: 1 1 0; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; overscroll-behavior: contain; }
.side-panel-content::-webkit-scrollbar { width: 4px; }
.side-panel-content::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.5); border-radius: 4px; }
.side-panel-content::-webkit-scrollbar-track { background: transparent; }
/* ── Sidebar glass contrast: ensure readable text on the dark translucent background ── */
.side-panel .side-panel-content { color: rgba(255,255,255,0.88); }
.side-panel .accordion-header { color: rgba(255,255,255,0.9); }
.side-panel .accordion-header:hover { color: #fff; }
.side-panel .accordion-section { border-bottom-color: rgba(255,255,255,0.1); }
.side-panel .divider { border-top-color: rgba(255,255,255,0.1); }
.side-panel .comments-label { color: rgba(255,255,255,0.7); }
.side-panel .prop-address { color: rgba(255,255,255,0.95); }
.side-panel .meta { color: rgba(255,255,255,0.55); }
.side-panel .vibe-summary { color: rgba(255,255,255,0.65); }
.side-panel .vibe-card { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.12); }
.side-panel .density-slider-label { color: rgba(255,255,255,0.8); }

/* TID-QA-002: Left sidebar data hierarchy — margin spacing only (parent is block, not flex) */
.side-panel .prop-address { margin-bottom: 4px; }
.side-panel .meta         { margin-bottom: 8px; }

/* Clamp comment preview text */
.side-panel #reviews li .review-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.75);
}

/* TID-QA-009: Admin banner — fixed 30px strip at viewport top */
#admin-mode-banner {
  position: fixed !important;
  top: 0 !important;
  left: 0;
  right: 0;
  height: 30px;
  line-height: 30px;
  z-index: 10001 !important;
  padding: 0 12px !important;
}
/* TID-QA-009: When the admin banner is fixed at top, push the entire body down 30px
   so the topbar and app content start below the banner, preventing overlap/clipping.
   The topbar remains in normal flex flow (no sticky/fixed) so the app-container
   fills exactly the remaining viewport height without any hidden or clipped top content. */
body.admin-banner-active {
  padding-top: 30px;
}
body.admin-banner-active .topbar {
  position: relative;
  margin-top: 0;
  z-index: 1000;
}
body.admin-banner-active #mapWrapper,
body.admin-banner-active .map-wrapper { margin-top: 0 !important; }
body.admin-banner-active .app-container { margin-top: 0 !important; }
body.admin-banner-active #map { margin-top: 0 !important; }
.divider { margin: 18px 0; border: none; border-top: 1px solid var(--border); }

/* RESET LAYOUT BUTTON — top of sidebar, expands all accordions + closes glass panel */
.btn-reset-layout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  min-height: 32px;
  transition: background 0.2s;
}
.btn-reset-layout:hover { background: rgba(255, 255, 255, 0.28); }

/* ACCORDION SECTIONS — collapsible sidebar widgets */
.accordion-section { border-bottom: 1px solid var(--border); }
.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  padding: 12px 0;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--dark);
  cursor: pointer;
  text-align: left;
  min-height: 44px;
  transition: color 0.2s;
}
.accordion-header:hover { color: var(--primary); }
.accordion-chevron {
  font-size: 10px;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}
.accordion-section.collapsed .accordion-chevron { transform: rotate(180deg); }
.accordion-body {
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  max-height: 600px;
  opacity: 1;
}
.accordion-section.collapsed .accordion-body {
  max-height: 0;
  opacity: 0;
}
.comments-container { overflow-y: auto !important; overscroll-behavior: contain !important; }
/* ── Epic 35: Global Scroll Override ─────────────────────────────────────── */
.main-container { overflow-y: auto !important; height: auto !important; min-height: 100vh; }
.left-panel, .right-panel { overflow-y: auto !important; overscroll-behavior: contain !important; pointer-events: auto !important; padding-bottom: 50px; }

/* TIME SLIDER */
.time-slider-wrapper { margin-bottom: 4px; }
.time-display { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.time-value { font-size: 2rem; font-weight: 800; color: var(--primary); line-height: 1; }
.vibe-summary { font-size: 1rem; font-weight: 500; color: #888; }
.slider-container { margin-bottom: 12px; }
.time-slider { width: 100%; accent-color: var(--primary); cursor: pointer; }

/* NEIGHBORHOOD CONTEXT BANNER — shown near the rating bar after reverse geocode */
.neighborhood-context {
  margin: 8px 0 12px;
  padding: 8px 14px;
  background: #667eea;
  color: #ffffff;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* #CORE-MAP-RECOVERY: <h2> inside neighborhood-context (seedNeighborhoodBanner / updateNeighborhoodContext) */
.neighborhood-context-h2 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

/* TID-QA-R3-FIX10: Persistent neighborhood badge — stays visible, doesn't fade like the banner */
.current-neighborhood-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding: 7px 14px;
  background: rgba(102, 126, 234, 0.18);
  border: 1px solid rgba(102, 126, 234, 0.35);
  color: #ffffff;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.current-neighborhood-badge:empty { display: none !important; }

/* ── GLOW & WIGGLE ANIMATION (§4.4 Interaction Standard) ───────────────
   Applied to .vibe-card and .btn-action on hover to make the UI feel
   "alive". A subtle rotation + vivid purple glow fires on mouseenter.   */
@keyframes wiggle {
  0%   { transform: rotate(0deg); }
  20%  { transform: rotate(-3deg); }
  40%  { transform: rotate(3deg); }
  60%  { transform: rotate(-2deg); }
  80%  { transform: rotate(2deg); }
  100% { transform: rotate(0deg); }
}

/* VIBE CARDS */
.vibe-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; margin-bottom: 4px; }
.vibe-card {
  background: var(--light); border-radius: 10px; padding: 10px 12px;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: default;
}
.vibe-card:hover {
  animation: wiggle 0.45s ease;
  box-shadow: 0 0 15px rgba(138, 43, 226, 0.6);
}
.vibe-header { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-weight: 600; font-size: 0.85rem; }
.vibe-emoji { font-size: 1.1rem; }
.vibe-bar { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.vibe-bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.vibe-intensity { font-size: 0.75rem; color: #888; }

/* MISSION BUTTON — chrono-pulse-star: golden-orange breathing glow + wiggle */
@keyframes chrono-pulse-star {
  0%, 100% { box-shadow: 0 0 8px 3px rgba(245, 158, 11, 0.45); }
  50%       { box-shadow: 0 0 18px 8px rgba(251, 100, 10, 0.7); }
}
@keyframes star-wiggle {
  0%,  100% { transform: rotate(0deg) scale(1); }
  15%        { transform: rotate(-4deg) scale(1.03); }
  30%        { transform: rotate(4deg) scale(1.03); }
  45%        { transform: rotate(-3deg) scale(1.01); }
  60%        { transform: rotate(3deg) scale(1.01); }
  75%        { transform: rotate(-1deg) scale(1); }
}
.btn-mission {
  width: 100%; display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 14px 16px; border-radius: 12px;
  border: none; background: #162d42; color: #fff;
  font-family: inherit; font-weight: 700; font-size: 0.95rem;
  cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
  animation: chrono-pulse-star 2.5s infinite ease-in-out, star-wiggle 3s infinite ease-in-out;
}
.btn-mission:hover {
  transform: translateY(-2px) scale(1.02);
  animation: chrono-pulse-star 1.1s infinite ease-in-out, star-wiggle 0.7s infinite ease-in-out;
  box-shadow: 0 0 28px 10px rgba(251, 100, 10, 0.85), 0 6px 20px rgba(0,0,0,0.25);
}
.btn-mission:active {
  transform: scale(0.98);
  box-shadow: 0 0 8px 3px rgba(245, 158, 11, 0.45);
}
.mission-icon { font-size: 1.4rem; line-height: 1; }
.mission-label { font-size: 0.95rem; }

/* ACTION HUB */
.action-hub { margin-bottom: 4px; }
.action-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: #999; margin-bottom: 6px; }
.action-hint { font-size: 0.8rem; color: #aaa; font-style: italic; margin-bottom: 10px; }
.action-hub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* @keyframes spin — used by .btn-action::before gradient border */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.btn-action {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; padding: 14px 8px; border-radius: 12px; border: none; font-family: inherit;
  font-weight: 700; font-size: 0.82rem; cursor: pointer;
  position: relative; overflow: hidden; z-index: 1;
  background: #0a2235;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.15s;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12); color: #fff; line-height: 1.2; text-align: center;
}
/* Spinning rainbow gradient border — permanently visible */
.btn-action::before {
  content: '';
  position: absolute;
  width: 150%; height: 150%;
  top: -25%; left: -25%;
  background: conic-gradient(from 0deg, #ff0000, #ff8000, #ffff00, #00ff00, #00bfff, #8000ff, #ff0080, #ff0000);
  animation: spin 3s linear infinite;
  opacity: 1;
  z-index: -2;
}
/* Inner core — masks the centre of the gradient so only a border shows */
.btn-action::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: #0a2235;
  border-radius: 10px;
  z-index: -1;
}
.btn-action:disabled { opacity: 0.38; cursor: not-allowed; box-shadow: none; transform: none; animation: none; }
/* Faster spinner + lift on enabled hover */
.btn-action:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
}
.btn-action:not(:disabled):hover::before { animation-duration: 0.8s; }
@media (prefers-reduced-motion: reduce) {
  .btn-action::before { animation: none; }
}
.btn-action:not(:disabled):active { transform: translateY(0); box-shadow: 0 2px 6px rgba(0,0,0,0.14); }
.btn-action-icon { font-size: 1.5rem; line-height: 1; position: relative; z-index: 2; }
.btn-action-label { font-size: 0.78rem; position: relative; z-index: 2; }
.btn-vibe { background: #0a2235; }
.btn-rate { background: #0a2235; }

/* LOCATION SECTION */
.prop-address { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; line-height: 1.4; word-break: break-word; }
.meta { font-size: 0.8rem; color: #888; margin-bottom: 12px; }
.comments-label { font-size: 0.85rem; font-weight: 600; color: #555; margin-bottom: 8px; }
#reviews {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(99,102,241,0.6) rgba(99,102,241,0.08);
  padding-right: 4px;
  min-height: 0;
}
#reviews::-webkit-scrollbar { width: 5px; }
#reviews::-webkit-scrollbar-track { background: rgba(99,102,241,0.08); border-radius: 4px; }
#reviews::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.6); border-radius: 4px; }
#reviews::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.85); }
#reviews li { background: var(--light); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 0.85rem; line-height: 1.45; }

/* FOOTER */
.browse-footer { flex-shrink: 0; background: var(--dark); color: rgba(255,255,255,0.7); font-size: 0.82rem; border-top: 1px solid rgba(255,255,255,0.08); padding-bottom: env(safe-area-inset-bottom, 20px); }
.foot-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 20px; }
.foot-brand { color: rgba(255,255,255,0.85); font-weight: 600; }
.foot-links { display: flex; gap: 16px; }
.foot-links a, .foot-social a { color: rgba(255,255,255,0.65); text-decoration: none; transition: color 0.18s; }
.foot-links a:hover, .foot-social a:hover { color: #fff; }
.foot-social { display: flex; gap: 12px; font-size: 1.1rem; }

/* MODAL BASE */
.modal-bg { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 9000; align-items: center; justify-content: center; }
.modal-bg.show { display: flex; }
.modal-card { background: #fff; border-radius: 16px; padding: 28px 28px 24px; width: min(440px, 92vw); box-shadow: var(--shadow-lg); position: relative; }
.modal-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.modal-topbar h3 { font-size: 1.1rem; font-weight: 700; color: var(--dark); }
/* Premium modal title for Rate this Location */
.modal-title-premium { font-size: 1.35rem !important; font-weight: 800 !important; color: var(--dark) !important; letter-spacing: -0.01em; }
.modal-title-star { color: #f59e0b; font-size: 1.4rem; }
.modal-close-btn { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: #888; padding: 4px 6px; border-radius: 6px; transition: background 0.18s; min-width: 44px; min-height: 44px; }
.modal-close-btn:hover { background: var(--light); }
.modal-address { font-size: 0.85rem; color: #666; margin-bottom: 16px; line-height: 1.4; min-height: 1.4em; word-break: break-word; }

/* Rate Location modal — wider and scrollable */
#modalBG .modal-card { width: min(520px, 94vw); max-height: 90vh; overflow-y: auto; }
#modalBG .vibe-reach-wrapper { margin: 8px 0 6px; }

/* Modal vibe type selector */
.modal-vibe-section { margin: 8px 0; }
.modal-vibe-toggle {
  width: 100%; text-align: left; background: var(--light); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; font-family: inherit; color: var(--dark); transition: background 0.18s;
  display: flex; align-items: center; gap: 6px;
}
.modal-vibe-toggle:hover { background: #ede9fb; }
.modal-vibe-body { padding-top: 8px; }
.modal-vibe-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.modal-vibe-btns .one-tap-btn { padding: 12px 8px; font-size: 1.1rem; }
.modal-vibe-btns .one-tap-btn.vibe-btn--selected { outline: 3px solid #fff; box-shadow: 0 0 0 4px var(--primary); }


/* Stars — larger and with tooltip support */
.modal-stars { display: flex; gap: 10px; margin-bottom: 6px; justify-content: center; }
.modal-stars span {
  font-size: 2.8rem; cursor: pointer; color: #d1d5db;
  transition: color 0.15s, transform 0.18s;
  user-select: none; position: relative; min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
}
.modal-stars span:hover, .modal-stars span.selected { color: #f59e0b; transform: scale(1.18); }
/* Star tooltip */
.modal-stars span[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; background: rgba(30,30,40,0.92); color: #fff;
  font-size: 0.72rem; font-weight: 600; padding: 4px 9px; border-radius: 6px;
  pointer-events: none; z-index: 100; letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
/* Star hint text */
.modal-star-hint {
  text-align: center; font-size: 0.78rem; color: #999; margin-bottom: 12px;
  min-height: 1.1em; transition: color 0.2s;
}
#commentBox { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-family: inherit; font-size: 0.9rem; resize: vertical; min-height: 80px; outline: none; transition: border-color 0.2s; margin-bottom: 8px; }
#commentBox:focus { border-color: var(--primary); }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-submit-btn { flex: 1; padding: 11px; border: none; border-radius: 10px; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; font-weight: 700; font-size: 0.95rem; cursor: pointer; transition: opacity 0.2s; min-height: 44px; }
.modal-submit-btn:hover { opacity: 0.9; }
.modal-cancel-btn { padding: 11px 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--light); font-size: 0.9rem; cursor: pointer; transition: background 0.18s; min-height: 44px; }
.modal-cancel-btn:hover { background: #ede9fb; }

/* ── TID-VIBE-RADIUS: Vibe Reach slider ── */
.vibe-reach-wrapper {
  margin: 12px 0 10px;
}
.vibe-reach-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}
.vibe-reach-label strong {
  font-size: 0.78rem;
  color: var(--primary);
}
.vibe-radius-slider {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}
.vibe-reach-notches {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: #aaa;
  margin-top: 3px;
  padding: 0 2px;
}

/* QUICK VIBE MODAL */
.vibe-modal-card { width: min(400px, 92vw); }
.vibe-modal-prompt { font-size: 0.88rem; color: #666; margin-bottom: 18px; line-height: 1.4; }
.one-tap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.one-tap-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px 10px; border-radius: 14px; border: none; font-family: inherit; font-size: 1.4rem; font-weight: 700; cursor: pointer; transition: transform 0.15s, box-shadow 0.2s; box-shadow: 0 3px 10px rgba(0,0,0,0.1); color: #fff; }
.one-tap-btn span { font-size: 0.85rem; font-weight: 600; }
.one-tap-btn:hover { animation: wiggle 0.45s ease; transform: translateY(-3px) scale(1.03); box-shadow: 0 0 15px rgba(138, 43, 226, 0.6), 0 8px 20px rgba(0,0,0,0.18); }
.one-tap-btn:active { transform: scale(0.97); animation: none; }
.one-tap-chill    { background: linear-gradient(135deg, #51cf66, #2f9e44); }
.one-tap-social   { background: linear-gradient(135deg, #667eea, #764ba2); }
.one-tap-active   { background: linear-gradient(135deg, #f59e0b, #d97706); }
.one-tap-family   { background: linear-gradient(135deg, #FFD93D, #e6a817); color: #1a202c; }

/* QUICK-RATE STEP 2 */
.vibe-selected-label { font-size: 1.05rem; font-weight: 700; text-align: center; margin-bottom: 16px; color: var(--primary); }
.vibe-intensity-row { margin: 0 0 18px; }
.vibe-intensity-label { display: block; font-size: 0.88rem; color: #888; margin-bottom: 8px; }
.vibe-intensity-slider { width: 100%; accent-color: var(--primary); cursor: pointer; }
.vibe-submit-btn { display: block; width: 100%; padding: 14px; font-size: 1rem; font-weight: 700; margin-bottom: 12px; border-radius: 14px; }
.vibe-optional-toggle { text-align: center; margin-bottom: 8px; }
.vibe-optional-toggle a { font-size: 0.8rem; color: var(--primary); opacity: 0.75; text-decoration: none; }
.vibe-optional-toggle a:hover { opacity: 1; text-decoration: underline; }
.vibe-comment-area { width: 100%; box-sizing: border-box; margin-top: 4px; margin-bottom: 10px; padding: 10px; border-radius: 10px; border: 1px solid rgba(102,126,234,0.3); background: rgba(102,126,234,0.06); color: inherit; font-family: inherit; font-size: 16px; resize: vertical; }
.vibe-back-btn { background: none; border: none; color: #888; font-size: 0.82rem; cursor: pointer; padding: 4px 0; display: block; margin: 4px auto 0; }
.vibe-back-btn:hover { color: var(--primary); }

/* MISSION MODAL */
.mission-modal-card { width: min(420px, 92vw); }
.mission-content {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 16px 0;
}
.mission-icon-large {
  font-size: 4rem; line-height: 1; margin-bottom: 16px;
}
.mission-title {
  font-size: 1.4rem; font-weight: 700; color: var(--dark);
  margin-bottom: 10px;
}
.mission-desc {
  font-size: 0.95rem; color: #666; line-height: 1.5;
  margin-bottom: 18px; max-width: 90%;
}
.mission-xp {
  font-size: 2rem; font-weight: 800; color: #51cf66;
  text-shadow: 0 2px 8px rgba(81, 207, 102, 0.4);
  margin-bottom: 10px;
}
.mission-snap-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.mission-modal-card .field-label {
  align-self: flex-start;
  font-size: 0.82rem;
  font-weight: 600;
  color: #4b5563;
}
.impact-uploader {
  width: 100%;
  margin-top: 12px;
  text-align: left;
}
.impact-uploader-input { display: none; }
.impact-uploader-dropzone {
  margin-top: 8px;
  border: 1px dashed rgba(102, 126, 234, 0.55);
  background: linear-gradient(135deg, rgba(102,126,234,0.08), rgba(118,75,162,0.08));
  border-radius: 12px;
  min-height: 64px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #374151;
  font-size: 0.84rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.impact-uploader-dropzone:hover,
.impact-uploader-dropzone:focus,
.impact-uploader-dropzone.impact-uploader-dropzone--active {
  border-color: #7c3aed;
  background: linear-gradient(135deg, rgba(124,58,237,0.14), rgba(16,185,129,0.12));
  outline: none;
}
.impact-photo-preview-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
}
.impact-photo-preview-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #111827;
  min-height: 70px;
  border: 1px solid rgba(148, 163, 184, 0.4);
}
.impact-photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.impact-photo-preview-meta {
  font-size: 0.72rem;
  color: #e5e7eb;
  padding: 6px;
  line-height: 1.2;
}
.impact-photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  border: none;
  background: rgba(17, 24, 39, 0.88);
  color: #fff;
  border-radius: 999px;
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: 0.8rem;
}
.impact-validation-hint {
  display: block;
  margin-top: 6px;
  color: #b45309;
}
.impact-heic-hint { margin-top: 6px; }
.impact-flow-status {
  display: none;
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  font-size: 0.82rem;
  line-height: 1.35;
}
.impact-flow-status.impact-flow-status--info {
  display: block;
  color: #1e40af;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
}
.impact-flow-status.impact-flow-status--success {
  display: block;
  color: #065f46;
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.38);
}
.impact-flow-status.impact-flow-status--error {
  display: block;
  color: #991b1b;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.36);
}
.modal-submit-btn.is-busy {
  opacity: 0.82;
  cursor: wait;
}
.impact-duplicate-warning {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
  color: #7c2d12;
  font-size: 0.82rem;
}
.impact-duplicate-warning .modal-submit-btn { margin-top: 8px; }
/* Spinner */
.mission-spinner {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 24px 0; gap: 14px;
}
@keyframes mission-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.mission-spinner-ring {
  width: 48px; height: 48px; border-radius: 50%;
  border: 5px solid #e5e7eb;
  border-top-color: #f59e0b;
  animation: mission-spin 0.8s linear infinite;
}
.mission-spinner-text {
  font-size: 0.9rem; color: #555;
}
/* Success state */
.mission-success {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 20px 0; gap: 10px;
}
.mission-success-icon { font-size: 3.5rem; line-height: 1; }
.mission-success-msg  {
  font-size: 1.3rem; font-weight: 800; color: #15803d;
  text-align: center;
}
/* Completed Daily Mission button */
.btn-mission--complete {
  opacity: 0.6; cursor: not-allowed;
  animation: none !important;
  box-shadow: none !important;
}

/* FEEDBACK MODAL */
.feedback-modal-card { width: min(460px, 92vw); }
.feedback-prompt {
  font-size: 0.9rem; color: #666; line-height: 1.5;
  margin-bottom: 16px;
}
#feedbackBox {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font-family: inherit; font-size: 0.9rem;
  resize: vertical; min-height: 120px; outline: none;
  transition: border-color 0.2s; box-sizing: border-box;
}
#feedbackBox:focus { border-color: var(--primary); }
/* TID-058: char counter below feedback box */
.char-counter { font-size: 0.78rem; color: #9ca3af; text-align: right; margin-top: 4px; margin-bottom: 8px; }
/* TID-060: REQ/INC type selector in feedback modal */
.feedback-type-row { display: flex; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.feedback-type-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.88rem; font-weight: 500; cursor: pointer; color: #374151;
  padding: 7px 14px; border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px; transition: border-color 0.15s, background 0.15s;
}
.feedback-type-label:has(input:checked) { border-color: var(--primary, #667eea); background: #f0f4ff; }
.feedback-type-label input[type="radio"] { accent-color: var(--primary, #667eea); }

/* PERIOD THEME */
body[data-period="morning"]    { --period-accent: #f6ad55; }
body[data-period="afternoon"]  { --period-accent: #4299e1; }
body[data-period="evening"]    { --period-accent: #667eea; }
body[data-period="late-night"] { --period-accent: #553c9a; }

/* ── PULSE ANIMATION (for empty state button attention) ──────────────── */
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7); }
  50%  { box-shadow: 0 0 0 10px rgba(102, 126, 234, 0); }
  100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0); }
}

.btn-action.pulse {
  animation: pulse 2s infinite;
}

/* ── TOAST NOTIFICATION ────────────────────────────────────────────────── */
.toast-notification {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  background: linear-gradient(135deg, var(--chrono-purple), #6b21a8);
  color: var(--text-primary);
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(138, 43, 226, 0.4);
  z-index: 10000;
  transition: transform 0.4s ease-in-out;
  max-width: 90vw;
  text-align: center;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
}

/* TID-GHOST-PILL: Hide the toast container when it has no content and is not active */
.toast-notification:not(.show):empty {
  display: none !important;
}

/* ── MOBILE SAFETY (screens < 768px) ──────────────────────────────────── */
@media (max-width: 767px) {
  /* Mobile stacking: map on top, sidebar below — fixes vertical scroll on small screens */
  .app-container {
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .map-wrapper {
    height: 55vw;
    min-height: 320px;
    flex: 0 0 auto;
  }
  .side-panel {
    width: 100%;
    flex: 1 1 auto;
    overflow-y: auto;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  /* Ensure sidebar buttons don't touch bottom edge */
  .action-hub {
    margin-bottom: 20px;
  }
  
  .btn-mission {
    margin-bottom: 20px;
  }
  
  /* Ensure sidebar content has bottom padding for ArcGIS zoom widgets */
  .side-panel-content {
    padding-bottom: 56px;
  }
  
  /* Adjust map mode toggle to avoid overlapping zoom widgets */
  .map-controls {
    top: 80px; /* Move down to avoid ArcGIS zoom widgets */
    right: 10px;
  }

  /* Map mode buttons: wrap to 2-column grid on small screens */
  .map-mode-toggle {
    flex-wrap: wrap;
    border-radius: 12px;
    max-width: calc(100vw - 32px);
  }
  .map-mode-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    justify-content: center;
  }

  /* Action Hub buttons: wrap gracefully on small screens */
  .action-hub-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .btn-action {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
  }

  /* Life Fit context controls: reduce bottom offset to fit compact map height */
  .map-context-controls {
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100% - 16px);
  }
  .ctx-btn-label {
    display: none; /* hide labels on small screens; icons remain */
  }
}

/* ── EVENTS SECTION ──────────────────────────────────────────────────── */
.events-section {
  padding: 0 4px;
}

/* ── CHECKOUT MODAL ──────────────────────────────────────────────────── */
.checkout-modal-card {
  max-width: 360px;
  text-align: center;
}

.checkout-btn-gpay,
.checkout-btn-card {
  padding: 14px 24px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  min-width: 130px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.checkout-btn-gpay {
  background: #000;
  color: #fff;
}

.checkout-btn-card {
  background: #1f7ae0;
  color: #fff;
}

.checkout-btn-gpay:hover { filter: brightness(1.2); }
.checkout-btn-card:hover { filter: brightness(1.1); }

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

/* ── CHECKOUT MODAL STATE PANELS ─────────────────────────────────────── */
.checkout-panel       { text-align: center; }
.checkout-panel-icon  { font-size: 2rem; margin-bottom: 12px; }
.checkout-price       { font-size: 2rem; font-weight: 900; color: #4ca1ae; margin-bottom: 24px; }
.checkout-plan-name   { font-size: 1.05rem; margin-bottom: 6px; }
.checkout-pay-row     { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.checkout-cancel-btn  { background: none; border: none; color: rgba(255,255,255,0.4); cursor: pointer; font-size: 0.85rem; margin-top: 16px; }
.checkout-spinner     { text-align: center; padding: 32px 0; }
.checkout-spinner-icon{ font-size: 2rem; animation: spin 1s linear infinite; display: inline-block; }
.checkout-spinner-msg { margin-top: 12px; color: rgba(255,255,255,0.8); }
.checkout-success     { text-align: center; padding: 32px 0; }
.checkout-success-icon{ font-size: 3rem; margin-bottom: 12px; }
.checkout-success-h   { color: #51cf66; margin-bottom: 8px; }
.checkout-success-msg { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.events-upgrade-msg   { font-size: 0.82rem; color: rgba(255,255,255,0.5); margin: 4px 0 0; }
.events-upgrade-btn   { background: none; border: none; color: #4ca1ae; cursor: pointer; font-size: 0.82rem; font-weight: 700; padding: 0; }

/* Hide ArcGIS Auto-Login Popups */
.esri-identity-modal,
.esri-component-modal,
.esri-id-box,
iframe[src*="arcgis.com"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ── INLINE REVIEW EDIT (Task 1) ─────────────────────────────────────────── */
.review-item--owned .review-display {
  display: block;
  cursor: pointer;
  position: relative;
  padding-bottom: 4px;
  outline: none;
}
.review-item--owned .review-display:hover,
.review-item--owned .review-display:focus {
  background: rgba(102, 126, 234, 0.18);
  border-radius: 6px;
}
/* TID-QA-R2-HOVER: Dark sidebar hover fix — #f0f4ff is unreadable on dark bg */
.side-panel .review-item--owned .review-display:hover,
.right-panel .review-item--owned .review-display:focus,
.side-panel .review-item--owned .review-display:focus {
  background: rgba(102, 126, 234, 0.18) !important;
  border-radius: 6px;
}
.review-edit-hint {
  display: block;
  font-size: 0.72rem;
  color: #9b59b6;
  margin-top: 4px;
  opacity: 0.75;
}
/* Review metadata: user ID + timestamp */
.review-meta { margin-top: 4px; font-size: 0.72rem; color: #888; }
.review-user-id { font-weight: 600; color: #667eea; }
.review-timestamp { color: #aaa; }
/* TID-007: Non-owned review rich card */
.review-rating-num { font-size: 0.78rem; color: #aaa; margin-left: 2px; }
.review-bonus-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
/* Fix 14: Thumbs up / down vote row on reviews */
.review-vote-row { display: flex; gap: 6px; margin-top: 6px; }
.review-vote-btn { background: none; border: 1px solid rgba(255,255,255,0.15); border-radius: 6px; padding: 2px 8px; font-size: 0.78rem; color: rgba(255,255,255,0.55); cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.review-vote-btn:hover { background: rgba(99,102,241,0.15); color: rgba(255,255,255,0.85); border-color: rgba(99,102,241,0.4); }
.review-vote-btn.vote-active { background: rgba(99,102,241,0.22); color: #a78bfa; border-color: #6366f1; font-weight: 600; }
/* Rich card base for all review items (scoped to reviews lists) */
#reviews li.review-item, .right-panel li.review-item, .side-panel li.review-item {
  background: linear-gradient(135deg, rgba(102,126,234,0.07) 0%, rgba(118,75,162,0.06) 100%);
  border: 1px solid rgba(102,126,234,0.2);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(102,126,234,0.08);
  transition: box-shadow 0.18s;
  list-style: none;
}
#reviews li.review-item:hover, .right-panel li.review-item:hover, .side-panel li.review-item:hover {
  box-shadow: 0 4px 14px rgba(102,126,234,0.18);
}
/* Owned review badge */
.review-owned-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border-radius: 10px;
  padding: 2px 8px;
  margin-bottom: 4px;
}
.review-bonus-tags .attr-badge { font-size: 0.68rem; padding: 2px 7px; border-radius: 10px; background: rgba(102,126,234,0.15); color: #a5b4fc; border: 1px solid rgba(102,126,234,0.25); white-space: nowrap; }
.review-edit-form { padding-top: 6px; }
.review-star-row { display: flex; gap: 6px; margin-bottom: 8px; }
.review-inline-star {
  font-size: 1.5rem; cursor: pointer; color: #d1d5db;
  transition: color 0.15s, transform 0.12s;
  user-select: none;
}
.review-inline-star.active { color: #f59e0b; }
.review-inline-star:hover  { transform: scale(1.2); color: #f59e0b; }
.review-edit-textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-family: inherit; font-size: 0.85rem;
  resize: vertical; min-height: 60px; outline: none;
  transition: border-color 0.2s; margin-bottom: 8px;
}
.review-edit-textarea:focus { border-color: var(--primary); }
.review-edit-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.review-save-btn, .review-cancel-btn, .review-delete-btn {
  padding: 6px 12px; border-radius: 7px; border: none;
  font-size: 0.8rem; font-weight: 600; cursor: pointer;
  /* min-height: 44px — Apple touch target minimum per §Mobile baseline */
  font-family: inherit; min-height: 44px; transition: opacity 0.18s;
}
.review-save-btn   { background: var(--primary); color: #fff; }
.review-cancel-btn { background: var(--light); border: 1px solid var(--border); }
.review-delete-btn { background: #fee2e2; color: var(--danger); }
.review-save-btn:hover, .review-delete-btn:hover { opacity: 0.85; }

/* TID-QA-007: Make owned review edit hint and buttons visible in dark sidebar */
.side-panel .review-item--owned {
  background: rgba(102, 126, 234, 0.12) !important;
  border: 1px solid rgba(102, 126, 234, 0.3) !important;
  border-radius: 8px;
  padding: 8px !important;
  cursor: pointer;
}
.side-panel .review-edit-hint {
  color: rgba(102, 126, 234, 0.9) !important;
  font-size: 0.72rem;
  display: block;
  margin-top: 4px;
}
.side-panel .review-save-btn {
  background: #667eea !important;
  color: #fff !important;
}
.side-panel .review-cancel-btn {
  background: rgba(255,255,255,0.15) !important;
  color: rgba(255,255,255,0.85) !important;
}
.side-panel .review-delete-btn {
  background: rgba(239,68,68,0.2) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239,68,68,0.35) !important;
}

/* TID-QA-007b: Non-owned reviews in dark sidebar */
.side-panel #reviews li {
  color: rgba(255,255,255,0.88) !important;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 6px 8px;
}
/* TID-QA-009: Fix edit form dark background in right sidebar Recent Comments */
.right-panel .review-edit-form,
#recent-comments-list .review-edit-form,
.side-panel .review-edit-form {
  background: transparent;
}
.right-panel .review-edit-textarea,
#recent-comments-list .review-edit-textarea,
.side-panel .review-edit-textarea {
  background: rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  caret-color: #fff;
}
.right-panel .review-edit-textarea::placeholder,
#recent-comments-list .review-edit-textarea::placeholder,
.side-panel .review-edit-textarea::placeholder {
  color: rgba(255, 255, 255, 0.4) !important;
}
.right-panel .review-edit-textarea:focus,
#recent-comments-list .review-edit-textarea:focus,
.side-panel .review-edit-textarea:focus {
  border-color: rgba(102, 126, 234, 0.7) !important;
  outline: none;
}
/* Right panel owned review highlight and buttons */
.right-panel .review-item--owned {
  background: rgba(102, 126, 234, 0.12) !important;
  border: 1px solid rgba(102, 126, 234, 0.3) !important;
  border-radius: 8px;
  padding: 8px !important;
  cursor: pointer;
}
.right-panel .review-save-btn {
  background: #667eea !important;
  color: #fff !important;
}
.right-panel .review-cancel-btn {
  background: rgba(255,255,255,0.15) !important;
  color: rgba(255,255,255,0.85) !important;
}
.right-panel .review-delete-btn {
  background: rgba(239,68,68,0.2) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239,68,68,0.35) !important;
}
/* Inline star row in dark context */
.right-panel .review-inline-star,
#recent-comments-list .review-inline-star,
.side-panel .review-inline-star {
  color: rgba(255,255,255,0.3) !important;
}
.right-panel .review-inline-star.active,
#recent-comments-list .review-inline-star.active,
.side-panel .review-inline-star.active {
  color: #f59e0b !important;
}

/* ── GROUP POST MODAL — polished SaaS finish (#CORE-MAP-RECOVERY) ───────────── */
#groupPostModal {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.5);
}

#groupPostModal .modal-card {
  border-radius: 24px;
  border-top: 4px solid var(--chrono-purple);
  box-shadow: 0 0 0 1px rgba(138, 43, 226, 0.12),
              0 24px 64px rgba(0, 0, 0, 0.28),
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
  background: linear-gradient(160deg, #fff 0%, #fdf8ff 100%);
}

#groupPostModal .modal-topbar h3 {
  color: var(--chrono-purple);
  letter-spacing: 0.01em;
}

/* Post textarea: border-bottom only + focus glow animation */
@keyframes groupPostFocusGlow {
  from { box-shadow: none; }
  to   { box-shadow: 0 4px 16px rgba(138, 43, 226, 0.2); }
}

#groupPostBox {
  width: 100%;
  border: none;
  border-bottom: 2px solid var(--border);
  border-radius: 0;
  padding: 12px 6px;
  font-family: inherit;
  font-size: 0.95rem;
  resize: none;
  outline: none;
  background: transparent;
  transition: border-color 0.25s;
  min-height: 120px;
  line-height: 1.6;
}

#groupPostBox:focus {
  border-bottom-color: var(--chrono-purple);
  animation: groupPostFocusGlow 0.3s ease forwards;
}

#groupPostModal .modal-submit-btn {
  background: linear-gradient(135deg, var(--chrono-purple), #6b21a8);
}
#groupPostModal .modal-submit-btn:hover {
  opacity: 0.88;
}

/* ── PRIVATE GROUP FEED (Task 2) ─────────────────────────────────────────── */
.group-feed-section { padding: 0 4px; }
.group-feed-header  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.feed-post-btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; border: none; border-radius: 8px; padding: 5px 12px;
  font-size: 0.8rem; font-weight: 700; cursor: pointer; font-family: inherit;
  min-height: 32px; transition: opacity 0.18s;
}
.feed-post-btn:hover { opacity: 0.88; }

.feed-item {
  background: var(--light); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
  font-size: 0.83rem; line-height: 1.45;
}
.feed-item--pending { border-color: #f59e0b; background: #fffbeb; }
.feed-item-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.feed-author { font-weight: 700; font-size: 0.82rem; color: #555; }
.feed-pending-badge {
  font-size: 0.72rem; background: #fef3c7; color: #92400e;
  border: 1px solid #f59e0b; border-radius: 10px; padding: 1px 8px;
}
.feed-content { margin: 4px 0 6px; color: var(--dark); }
.feed-meeting-link {
  display: inline-block; margin: 4px 0 6px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; text-decoration: none; border-radius: 8px;
  padding: 5px 12px; font-size: 0.8rem; font-weight: 700;
  transition: opacity 0.18s;
}
.feed-meeting-link:hover { opacity: 0.88; }
.feed-item-footer { color: #aaa; }
.feed-admin-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.feed-approve-btn, .feed-reject-btn {
  padding: 4px 10px; border-radius: 6px; border: none;
  font-size: 0.78rem; font-weight: 600; cursor: pointer; font-family: inherit; min-height: 28px;
}
.feed-approve-btn { background: #d1fae5; color: #065f46; }
.feed-reject-btn  { background: #fee2e2; color: #991b1b; }
.feed-approved-mine { font-size: 0.78rem; color: #065f46; font-weight: 600; }
.feed-owner-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.feed-edit-btn, .feed-delete-btn {
  padding: 4px 10px; border-radius: 6px; border: none;
  font-size: 0.78rem; font-weight: 600; cursor: pointer; font-family: inherit; min-height: 28px;
}
.feed-edit-btn   { background: #dbeafe; color: #1e40af; }
.feed-delete-btn { background: #fee2e2; color: #991b1b; }
.feed-edit-btn:hover, .feed-delete-btn:hover { opacity: 0.85; }
.feed-empty { font-size: 0.82rem; color: #aaa; font-style: italic; padding: 8px 0; }
/* Approval lifecycle UI */
.feed-approval-info {
  display: flex; align-items: flex-start; gap: 6px;
  background: #fef9ec; border: 1px solid #f59e0b; border-radius: 8px;
  padding: 8px 10px; margin: 6px 0; font-size: 0.78rem; color: #78350f;
  line-height: 1.4;
}
.feed-approval-icon { flex-shrink: 0; font-size: 0.85rem; }
.feed-approval-progress { font-size: 0.75rem; color: #92400e; font-weight: 700; align-self: center; }
.feed-approval-queue-banner {
  background: #fef3c7; border: 1px solid #f59e0b; border-radius: 8px;
  padding: 8px 12px; margin-bottom: 10px; font-size: 0.82rem; color: #78350f;
}

/* ── TOWN HALL MODAL (Task 2) ────────────────────────────────────────────── */
.th-field-group { margin-bottom: 14px; }
.th-field-group label {
  display: block; font-size: 0.82rem; font-weight: 600; color: #555; margin-bottom: 5px;
}
.th-input {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; font-family: inherit; font-size: 0.9rem;
  outline: none; transition: border-color 0.2s;
}
.th-input:focus { border-color: var(--primary); }
.th-rule-badge {
  display: inline-block; background: #ede9fb; color: #7c3aed;
  font-size: 0.7rem; font-weight: 700; border-radius: 10px;
  padding: 1px 8px; margin-left: 6px; vertical-align: middle;
}
.th-hint { font-size: 0.75rem; color: #999; margin-top: 4px; display: block; }

/* ── SNAPSHOT BUTTON (Task 3) ────────────────────────────────────────────── */
.btn-snapshot {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 14px; padding: 11px 16px; border-radius: 10px;
  border: 2px solid #667eea; background: #f0f4ff; color: #4338ca;
  font-family: inherit; font-size: 0.88rem; font-weight: 700;
  cursor: pointer; transition: background 0.18s, box-shadow 0.18s; min-height: 44px;
}
.btn-snapshot:hover {
  background: #e0e7ff;
  box-shadow: 0 0 12px rgba(102,126,234,0.35);
}
/* ── CRIME ANALYTICS SECTION ────────────────────────────────────────────── */
.crime-analytics-section { padding: 0 4px; }

.crime-summary {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px;
}
.crime-stat {
  font-size: 0.75rem; font-weight: 700; background: var(--light);
  border: 1px solid var(--border); border-radius: 6px; padding: 4px 9px;
  color: #555;
}
.crime-stat-high { color: var(--danger); border-color: var(--danger); }

.crime-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.crime-table {
  width: 100%; border-collapse: collapse; font-size: 0.78rem;
  min-width: 240px;
}
.crime-table thead th {
  background: var(--dark); color: #fff; padding: 7px 8px;
  text-align: left; font-size: 0.74rem; white-space: nowrap;
}
.crime-table tbody td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.crime-table tbody tr:last-child td { border-bottom: none; }
.crime-td-center { text-align: center; }
.severity-high   { color: var(--danger);  font-weight: 700; }
.severity-medium { color: #d97706;         font-weight: 700; }
.severity-low    { color: var(--success);  font-weight: 700; }

.crime-export-row { display: flex; gap: 8px; margin-top: 10px; }
.btn-export-csv, .btn-export-pdf {
  flex: 1; padding: 9px 8px; border: none; border-radius: 8px;
  font-family: inherit; font-size: 0.78rem; font-weight: 700;
  cursor: pointer; transition: opacity 0.2s; min-height: 44px;
}
.btn-export-csv { background: #059669; color: #fff; }
.btn-export-pdf { background: var(--danger); color: #fff; }
.btn-export-csv:hover, .btn-export-pdf:hover { opacity: 0.88; }

.crime-upgrade-msg { font-size: 0.82rem; color: #888; margin: 4px 0; }
.crime-upgrade-btn {
  background: none; border: none; color: var(--primary);
  cursor: pointer; font-size: 0.82rem; font-weight: 700; padding: 0;
}

/* ── LOCAL UPDATES FEED ──────────────────────────────────────────────────── */
.local-updates-section { padding: 0 4px; }

.lu-feed {
  max-height: 280px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}
.lu-feed::-webkit-scrollbar { width: 4px; }
.lu-feed::-webkit-scrollbar-thumb { background: rgba(102,126,234,0.35); border-radius: 4px; }

.lu-item {
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(102,126,234,0.2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.83rem;
  line-height: 1.45;
  box-shadow: 0 2px 8px rgba(102,126,234,0.08);
  transition: box-shadow 0.18s;
}
.lu-item:hover { box-shadow: 0 4px 14px rgba(102,126,234,0.18); }

/* TID-QA-R3-FIX3: Dark right-panel recent activity feed — override white review card bg */
.right-panel .review-item,
.side-panel .review-item,
.right-panel #reviews li,
.side-panel #reviews li {
  background: rgba(255, 255, 255, 0.07) !important;
  color: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}
.right-panel .review-item:hover,
.side-panel .review-item:hover,
.right-panel #reviews li:hover,
.side-panel #reviews li:hover {
  background: rgba(102, 126, 234, 0.18) !important;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.22) !important;
  color: rgba(255, 255, 255, 0.95) !important;
}
.right-panel .review-item *,
.side-panel .review-item *,
.right-panel #reviews li *,
.side-panel #reviews li * {
  color: rgba(255, 255, 255, 0.85) !important;
}
/* Preserve gold stars inside review items in dark panel */
.right-panel .review-item strong,
.side-panel .review-item strong,
.right-panel #reviews li strong,
.side-panel #reviews li strong,
.right-panel .review-item .review-stars,
.side-panel .review-item .review-stars,
.right-panel #reviews li .review-stars,
.side-panel #reviews li .review-stars {
  color: #fbbf24 !important;
}

.lu-item-header {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 5px; flex-wrap: wrap;
}
.lu-avatar { font-size: 1rem; line-height: 1; }
.lu-author { font-weight: 700; font-size: 0.82rem; color: #444; }
.lu-tag {
  font-size: 0.7rem; font-weight: 700;
  background: linear-gradient(135deg, rgba(102,126,234,0.15), rgba(118,75,162,0.15));
  color: var(--primary); border: 1px solid rgba(102,126,234,0.25);
  border-radius: 10px; padding: 1px 8px; margin-left: auto;
}
.lu-content { margin: 2px 0 6px; color: var(--dark); }
.lu-footer { font-size: 0.75rem; color: #aaa; }

.lu-locked {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 18px 12px; text-align: center;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px dashed rgba(102,126,234,0.3);
  border-radius: 12px;
}
.lu-lock-icon { font-size: 1.5rem; }
.lu-lock-msg { font-size: 0.82rem; color: #666; margin: 0; }
.lu-upgrade-btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; border: none; border-radius: 8px;
  padding: 7px 18px; font-family: inherit; font-size: 0.82rem;
  font-weight: 700; cursor: pointer; min-height: 36px;
  transition: opacity 0.18s;
}
.lu-upgrade-btn:hover { opacity: 0.88; }

/* ── VIBE TREND CHART ────────────────────────────────────────────────────── */
.vibe-trend-section  { margin-top: 16px; }
.vibe-trend-chart-wrapper { position: relative; height: 180px; }

/* ── NEWS TICKER ─────────────────────────────────────────────────────────── */
.news-ticker {
  flex-shrink: 0;
  background: rgba(10, 34, 53, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(76, 161, 174, 0.4);
  overflow: hidden;
  height: 36px;
  display: flex;
  align-items: center;
}
.ticker-inner {
  overflow: hidden;
  white-space: nowrap;
  flex: 1;
}
@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  animation: ticker-scroll 32s linear infinite;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0 24px;
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-sep { color: #4ca1ae; font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}

/* ── FEED LIKE / DISLIKE BUTTONS ─────────────────────────────────────────── */
.feed-reactions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.feed-react-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid rgba(76, 161, 174, 0.35);
  border-radius: 20px;
  background: rgba(76, 161, 174, 0.08);
  color: #555;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  min-height: 30px;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.15s;
}
.feed-react-btn:hover {
  background: rgba(76, 161, 174, 0.18);
  border-color: #4ca1ae;
  transform: translateY(-1px);
}
.feed-react-btn.active {
  background: rgba(76, 161, 174, 0.22);
  border-color: #4ca1ae;
  color: #4ca1ae;
}
.feed-react-count { min-width: 12px; text-align: center; }

/* ── LBR GLOBAL LOADER ───────────────────────────────────────────────────── */
/* Absolute overlay — never shifts layout or disrupts the 100dvh flex column */
#lbr-global-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: rgba(8, 20, 35, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: opacity 0.45s ease;
  opacity: 1;
}
#lbr-global-loader.lbr-loader--hidden {
  opacity: 0;
  pointer-events: none;
}

/* ── Stargate outer ring ── */
@keyframes lbr-stargate {
  0%   { transform: rotate(0deg);   box-shadow: 0 0 18px 4px #4ca1ae, 0 0 40px 8px rgba(76,161,174,0.4); }
  50%  { transform: rotate(180deg); box-shadow: 0 0 28px 8px #4ca1ae, 0 0 60px 16px rgba(76,161,174,0.7); }
  100% { transform: rotate(360deg); box-shadow: 0 0 18px 4px #4ca1ae, 0 0 40px 8px rgba(76,161,174,0.4); }
}
.lbr-ring-outer {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #4ca1ae;
  border-right-color: rgba(76, 161, 174, 0.35);
  box-shadow: 0 0 18px 4px #4ca1ae, 0 0 40px 8px rgba(76, 161, 174, 0.4);
  animation: lbr-stargate 1.6s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Inner ring (counter-rotates for Stargate depth) ── */
@keyframes lbr-stargate-inner {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}
.lbr-ring-inner {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-bottom-color: rgba(76, 161, 174, 0.6);
  border-left-color:   rgba(118, 75, 162, 0.6);
  animation: lbr-stargate-inner 2.4s linear infinite;
}

/* ── Cyberpunk "LBR_SYS" text ── */
@keyframes lbr-cyber-breathe {
  0%, 100% {
    text-shadow: 0 0 6px #4ca1ae, 0 0 14px rgba(76,161,174,0.5);
    letter-spacing: 0.28em;
    opacity: 0.85;
  }
  50% {
    text-shadow: 0 0 12px #4ca1ae, 0 0 30px rgba(76,161,174,0.8), 0 0 50px rgba(118,75,162,0.5);
    letter-spacing: 0.38em;
    opacity: 1;
  }
}
.lbr-text {
  font-family: "Inter", system-ui, monospace;
  font-size: 0.9rem;
  font-weight: 800;
  color: #4ca1ae;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  animation: lbr-cyber-breathe 2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .lbr-ring-outer  { animation: none; }
  .lbr-ring-inner  { animation: none; }
  .lbr-text        { animation: none; }
  .neighborhood-header-badge.vibe-glow-active { animation: none; }
}

/* ── SCREENSHOT MODE ─────────────────────────────────────────────────────────
   DEV-ONLY: Toggle via console — document.body.classList.toggle('screenshot-mode')
   Hides debug panels, dev borders, and focus rings for clean marketing shots.
   IMPORTANT: Always remove this class after taking screenshots to restore
   normal accessibility — focus indicators are required for keyboard users.
   ────────────────────────────────────────────────────────────────────────── */
.screenshot-mode *:focus { outline: none !important; box-shadow: none !important; }
.screenshot-mode [data-debug],
.screenshot-mode .debug-panel,
.screenshot-mode #map-debug,
.screenshot-mode #selfCheckResults { display: none !important; }

/* ── BETA GUARDIAN UPDATE OVERLAY (#updateOverlay) ──────────────────────────
   Full-screen frosted-glass overlay for hot-reload notifications (Epic 11).
   z-index 100000 ensures it renders above everything including ArcGIS UI.   */
#updateOverlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(10, 15, 30, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#updateOverlay.visible {
  display: flex;
}
.update-overlay-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  padding: 36px 40px;
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  color: #fff;
  text-align: center;
}
.update-overlay-img-wrap {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.update-overlay-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.update-overlay-img-fallback {
  font-size: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.update-overlay-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}
.update-overlay-subtitle {
  font-size: 1rem;
  opacity: 0.78;
  margin: 0;
  font-style: italic;
}
.update-overlay-timer {
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1;
  color: #fbbf24;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
  min-width: 80px;
}
.update-overlay-note {
  font-size: 0.82rem;
  opacity: 0.55;
  margin: 0;
}
@media (max-width: 480px) {
  .update-overlay-card { padding: 28px 20px; }
  .update-overlay-title { font-size: 1.05rem; }
  .update-overlay-timer { font-size: 3.5rem; }
}

/* ── Epic 37: Hide glitchy system-restart banners globally ── */
.system-restarting,
#restarting-modal,
[id*="restart"] { display: none !important; }

/* ── Epic 37: Map context controls — visible by default, hidden by .hide-ui toggle ── */

/* ── Epic 37: Rocky floating button — size, speech bubble ── */
#rocky-floating-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  position: relative;
}
#rocky-floating-btn::before {
  content: "Click me to help!";
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #ffffff;
  color: #1a202c;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  pointer-events: none;
  /* speech-bubble tail pointing right toward the button */
  filter: drop-shadow(2px 0 0 rgba(0,0,0,0.08));
}

/* ── TID-ERR-WIDGET: Suppress ArcGIS floating error panel widgets ── */
/* Hides the red/white error box that appears when a FeatureLayer fails to load.
   Wildcard BEM selectors cover new error-widget class variants in ArcGIS JS 4.29+.
   Scoped to bottom-right or esri-ui to avoid hiding valid popup / zoom controls. */
.esri-ui .esri-component.esri-widget--panel-error { display: none !important; }
.esri-error { display: none !important; }
.esri-error-message { display: none !important; }
.esri-ui-bottom-right .esri-component[class*="error"] { display: none !important; }
.esri-ui [class*="panel-error"] { display: none !important; }
.esri-ui [class*="--error"] { display: none !important; }

/* ── TID-GLASS-CTRL: Left-side glass control panel — organized column for
     Community badge, neighborhood badges, search widget, and zoom controls ── */
.glass-control-panel {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  max-width: 320px;
  pointer-events: auto;
}
.glass-control-panel .esri-search { max-width: 100%; width: 100%; }
.glass-control-panel .community-badge-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 700 0.82rem/1.2 "Inter", sans-serif;
  color: #ffffff;
  background: #667eea;
  padding: 4px 12px;
  border-radius: 9999px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  pointer-events: none;
}
.glass-control-panel .neighborhood-header-badge,
.glass-control-panel .founding-neighbor-badge {
  font-size: 0.72rem;
  padding: 3px 8px;
}
.glass-control-panel .badge-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── TID-HIDE-UI: Hide Map UI toggle ── */
.hide-ui-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 8px 16px;
  font: 600 0.78rem/1 "Inter", sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: background 0.2s, opacity 0.2s;
}
.hide-ui-btn:hover { background: rgba(255, 255, 255, 0.28); }

/* TID-HIDE-UI: Map-overlay toggle button — always on the map, never inside side-panel */
.hide-ui-map-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  background: rgba(13, 17, 23, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 9999px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px 18px;
  cursor: pointer;
  transition: background 0.2s;
}
.hide-ui-map-btn:hover { background: rgba(30,40,60,0.9); }
body.hide-ui .hide-ui-map-btn {
  display: inline-flex !important;
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  z-index: 99999 !important;
  pointer-events: auto !important;
}

/* When .hide-ui is active on body, hide chrome elements */
body.hide-ui .topbar,
body.hide-ui .glass-info-panel,
body.hide-ui .map-context-controls,
body.hide-ui .side-panel,
body.hide-ui .news-ticker,
body.hide-ui .browse-footer,
body.hide-ui .glass-control-panel,
body.hide-ui .map-controls,
body.hide-ui .beta-feedback-fab { display: none !important; }
/* In hide-ui mode, let the map fill the entire viewport */
body.hide-ui .app-container { height: 100dvh; }
body.hide-ui .map-wrapper { flex: 1 1 100%; }

/* ── reCAPTCHA — hide badge + error frame (domain mismatch on non-prod origins) ── */
/* TID-RECAPTCHA-HIDE-001 */
.grecaptcha-badge {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
/* Suppress "ERROR for site owner: Invalid domain for site key" iframe */
iframe[src*="recaptcha/api2/aframe"],
iframe[src*="recaptcha/enterprise/anchor"],
iframe[src*="recaptcha/enterprise/bframe"] {
  display: none !important;
}
/* Google injects a full-width div.rc-anchor-alert for site-key errors */
.rc-anchor-alert {
  display: none !important;
}

/* ── MAP LEGEND PANEL ────────────────────────────────────────────────────── */
.map-legend-panel {
  display: none;
  position: absolute;
  top: 130px;
  right: 12px;
  z-index: 50;
  background: rgba(15, 42, 66, 0.85);
  color: var(--text-primary, #e0e0e0);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 18px 20px 14px;
  width: auto;
  min-width: 260px;
  max-width: 300px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.45);
  font-family: 'Noto Sans', 'Inter', Arial, sans-serif;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.map-legend-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.map-legend-title {
  font-size: 15px;
  letter-spacing: 0.3px;
}
.map-legend-close {
  background: none;
  border: none;
  color: var(--text-primary, #e0e0e0);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.map-legend-close:hover { opacity: 1; }
.map-legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12.5px;
  line-height: 1.4;
}
.map-legend-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.map-legend-list li strong {
  white-space: nowrap;
  font-size: 12.5px;
}
.map-legend-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.map-legend-desc {
  color: rgba(255,255,255,0.55);
  font-size: 11px;
  margin-left: auto;
  text-align: right;
  white-space: normal;
  line-height: 1.4;
}
.map-legend-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.4);
  padding-top: 2px;
}
.map-legend-divider {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 6px 0 2px;
  padding: 0 !important;
  height: 0;
}
.map-legend-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
}
.map-legend-swatch--impact {
  background: rgba(22,163,74,0.85);
}
.map-legend-swatch--event {
  background: rgba(124,58,237,0.15);
}
.map-legend-swatch--home {
  background: transparent;
}

/* TID-GLASS-COMMENTS-FIX: Structured comment snippets in glass panel */
.glass-comment-snippet {
  padding: 2px 0;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal; /* Issue 6: was nowrap — allow long comments to wrap cleanly */
}
.glass-comment-snippet:last-child { border-bottom: none; }

/* ── TID-GLASS-PIN-ENRICH: Pin detail subsection ── */
.glass-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.15);
  margin: 10px 0 8px;
}
.glass-pin-stars {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.glass-pin-meta {
  font-size: 0.72rem;
  opacity: 0.75;
  margin-bottom: 6px;
}
.glass-pin-comment {
  font-size: 0.8rem;
  font-style: italic;
  opacity: 0.9;
  line-height: 1.4;
  margin-bottom: 8px;
}
.glass-pin-bonus {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}
/* feat(browse-ui): business details section beneath the bonus tags */
.glass-pin-business-info {
  margin-top: 8px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.5;
}
.glass-biz-desc {
  font-style: italic;
  opacity: 0.85;
  margin-bottom: 5px;
}
.glass-biz-row {
  margin-bottom: 3px;
}
.glass-biz-link {
  color: #7dd3fc;
  text-decoration: underline;
}
.glass-bonus-tag {
  background: rgba(76,161,174,0.25);
  border: 1px solid rgba(76,161,174,0.4);
  border-radius: 50px;
  font-size: 0.7rem;
  padding: 3px 8px;
  color: #fff;
}
.glass-pin-cta {
  width: 100%;
  padding: 9px 0;
  background: linear-gradient(135deg, #4ca1ae, #2c3e50);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.2s;
  min-height: 36px;
  font-family: inherit;
  margin-top: 8px;
  display: block;
}
.glass-pin-cta:hover { opacity: 0.88; }

/* ── Rating Modal Bonus Section ── */
.modal-bonus-section {
  margin-top: 12px;
  border: 1px solid rgba(76,161,174,0.25);
  border-radius: 12px;
  overflow: hidden;
}
.modal-bonus-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(76,161,174,0.08);
  border: none;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  color: #2c3e50;
  font-family: inherit;
  text-align: left;
  min-height: 40px;
}
.modal-bonus-toggle:hover { background: rgba(76,161,174,0.14); }
.bonus-xp-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 50px;
  font-weight: 700;
  margin-left: auto;
}
.bonus-chevron { font-size: 0.75rem; margin-left: 4px; }
.modal-bonus-body { padding: 12px 14px 14px; background: #fafafa; }
.bonus-question { margin-bottom: 12px; }
.bonus-question:last-child { margin-bottom: 0; }
.bonus-question-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.bonus-xp-mini {
  background: rgba(245,158,11,0.15);
  color: #d97706;
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 50px;
  font-weight: 700;
}
.bonus-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bonus-chip {
  padding: 5px 12px;
  border: 1px solid #d1d5db;
  border-radius: 50px;
  background: #fff;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
  color: #374151;
  min-height: 30px;
}
.bonus-chip:hover { border-color: #4ca1ae; background: rgba(76,161,174,0.06); }
.bonus-chip--active {
  background: linear-gradient(135deg, #4ca1ae, #2c3e50);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(76,161,174,0.35);
}

/* ── Density slider active state ── */
.density-slider-container--active {
  border: 1px solid rgba(76,161,174,0.7);
  box-shadow: 0 0 6px rgba(76,161,174,0.35);
}

/* ============================================================
   ULTRA-PLAN-C+ FIXES — Modular Architecture + 9 Regression Fixes
   All rules scoped to .browse-page where possible.
   TID-PLAN-C-PLUS · 2026-03-03
   ============================================================ */

/* Ultra-Plan C+ Layout Constants & Z-Index Hierarchy */
.browse-page {
  /* Layout Constants */
  --left-panel-width: 320px;
  --right-panel-width: 380px;
  --glass-thickness: blur(15px);

  /* Z-Index Hierarchy */
  --z-map: 1;
  --z-glass-info: 22;
  --z-sidebars: 25;
  --z-glass-ctrl: 26;
  --z-controls: 100;
  --z-topbar: 100;
  --z-admin: 150;
  --z-modals: 200;
  --z-overlay: 9999;
}

/* chrono-hidden utility — for JS class toggles instead of display:none inline */
body.browse-page .chrono-hidden { display: none !important; }

/* FIX-1: Right sidebar max-width, contrast, word-wrap */
.browse-page .side-panel {
  max-width: 380px;
  width: clamp(300px, 380px, 30vw);
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.browse-page .side-panel-content {
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* FIX-2: Admin bar z-index and bottom padding clearance */
.browse-page #admin-bar,
.browse-page .admin-bar {
  z-index: 150;
  position: relative;
}
.browse-page .app-container {
  padding-bottom: 0;
}
/* Ensure Action Hub doesn't overlap admin bar */
.browse-page .action-hub {
  margin-bottom: 8px;
}

/* FIX-3: Vibe cards scrollable container */
.browse-page .vibe-cards-scroll {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 280px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(99,102,241,0.5) transparent;
  padding-right: 4px;
}
.browse-page .vibe-cards-scroll::-webkit-scrollbar { width: 4px; }
.browse-page .vibe-cards-scroll::-webkit-scrollbar-thumb {
  background: rgba(99,102,241,0.5);
  border-radius: 4px;
}

/* FIX-6: Glass control panel z-index hardened — city identity always visible */
.browse-page .glass-control-panel {
  z-index: 26 !important;
  display: flex !important;
}
/* TID-QA-CITYICON: City slot — icon + city name side by side, no wrap */
.browse-page #mapCommunityBadgeSlot {
  display: flex !important;
  align-items: center;
  gap: 4px;
  visibility: visible !important;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.browse-page #neighborhoodHeaderBadge {
  display: inline-flex !important;
  min-width: 60px;
}

/* FIX-7: Feed coming-soon placeholder state */
.browse-page .feed-coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px dashed rgba(255,255,255,0.2);
  border-radius: 10px;
  color: rgba(255,255,255,0.65);
  font-size: 0.82rem;
  text-align: center;
  line-height: 1.5;
}
.browse-page .feed-coming-soon strong {
  color: rgba(255,255,255,0.9);
  font-size: 0.9rem;
}

/* FIX-8: Minimum 14px font-size across sidebar, high-contrast text */
.browse-page .side-panel-content,
.browse-page .side-panel-content p,
.browse-page .side-panel-content span,
.browse-page .side-panel-content li,
.browse-page .side-panel-content label,
.browse-page .side-panel-content .vibe-card-label,
.browse-page .side-panel-content .feed-coming-soon {
  font-size: max(14px, 0.875rem) !important;
  color: rgba(255, 255, 255, 0.9) !important;
}
/* Exception: badge pills and time-value can keep their own sizing */
.browse-page .side-panel-content .time-value { font-size: 2rem !important; }
.browse-page .side-panel-content .neighborhood-header-badge { font-size: 0.75rem !important; }

/* FIX-9: Prevent Action Hub / Timeline from squishing map on smaller viewports */
@media (min-width: 768px) and (max-width: 1100px) {
  .browse-page .side-panel {
    width: 300px;
    max-width: 300px;
    min-width: 260px;
  }
  .browse-page .map-wrapper {
    flex: 1 1 auto;
    min-width: 0;
  }
}
@media (orientation: portrait) and (min-width: 768px) {
  .browse-page .app-container {
    flex-direction: column;
  }
  .browse-page .map-wrapper {
    height: 50vh;
    flex: 0 0 auto;
  }
  .browse-page .side-panel {
    width: 100%;
    max-width: 100%;
    height: 50vh;
    overflow-y: auto;
  }
}

/* ============================================================
   PERFORMANCE & UI RESTORATION — 2026-03-03
   TID-PERF-001 / TID-UI-RESTORE
   ============================================================ */

/* Task 2a: Darker sidebar for legible white text */
.browse-page .side-panel {
  background: rgba(12, 14, 18, 0.88) !important;
  backdrop-filter: blur(18px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(160%) !important;
}
.browse-page .side-panel-content {
  color: rgba(255, 255, 255, 0.95) !important;
}

/* Rocky chat frame — ensure it opens above the orb, not over the map search */
.browse-page #rocky-chat-container {
  left: 20px !important;    /* TID-QA-006: was right: 20px — now opens from bottom-left orb */
  right: auto !important;
  bottom: 100px !important;
  max-width: min(340px, calc(100vw - 40px)) !important;
}

/* ── TID-050 / TID-QA-006: Unified Rocky + Beta Feedback floating tray — bottom-left ── */
/* Both elements share one visual row, Rocky on the left, Feedback to its right */
.chrono-float-tray {
  position: fixed;
  bottom: calc(95px + env(safe-area-inset-bottom, 0px)) !important; /* TID-QA-UI-RESTORE: lift above ArcGIS attribution + map controls */
  left: 20px !important;   /* TID-QA-006: was right: 20px */
  right: auto !important;
  z-index: 520;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none; /* children handle their own pointer events */
}
.chrono-float-tray > * {
  pointer-events: auto;
  flex-shrink: 0;
}
/* Override Rocky orb position — now managed by the tray; relative so #rocky-help-badge is anchored to it */
.chrono-float-tray #rocky-orb-container {
  position: relative !important;
  bottom: auto !important;
  right: auto !important;
  left: auto !important;
  z-index: auto !important;
}
/* Override Beta Feedback FAB position — now managed by the tray */
.chrono-float-tray .beta-feedback-fab {
  position: static !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  z-index: auto !important;
  margin-bottom: 4px;
}
/* In hide-ui mode, hide the tray too */
body.hide-ui .chrono-float-tray { display: none !important; }

/* TID-QA-006: Rocky speech bubble — centred above orb (orb container is position:relative) */
.chrono-float-tray #rocky-help-badge {
  position: absolute !important;
  bottom: calc(100% + 8px) !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) translateY(6px) !important;
  white-space: nowrap !important;
  min-width: 130px !important;
  width: max-content !important;
  text-align: center !important;
  line-height: 1.3 !important;
  font-size: 0.72rem !important;
}
.chrono-float-tray #rocky-help-badge.visible {
  transform: translateX(-50%) translateY(0) !important;
}
/* Tail points down from centre of badge */
.chrono-float-tray #rocky-help-badge::after {
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  border-top-color: rgba(14,165,233,0.55) !important;
}

/* TID-050: Rocky help badge — never squish text vertically */
#rocky-help-badge {
  white-space: nowrap !important;
  min-width: 130px !important;
  width: max-content !important;
  text-align: center !important;
}

/* TID-050: Recent comments list scrollable container */
#recent-comments-list {
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(102,126,234,0.4) transparent;
}
#recent-comments-list::-webkit-scrollbar { width: 4px; }
#recent-comments-list::-webkit-scrollbar-thumb {
  background: rgba(102,126,234,0.4);
  border-radius: 4px;
}

/* TID-QA-001: Left sidebar reviews list — fix white-on-white in dark sidebar context */
/* #recent-comments-list does not exist in the DOM; the actual list is #reviews in the left sidebar */
.side-panel #reviews li,
.right-panel #reviews li {
  background: rgba(255, 255, 255, 0.07) !important;
  color: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.side-panel #reviews li *,
.right-panel #reviews li * {
  color: rgba(255, 255, 255, 0.85) !important;
}

/* TID-QA-009: Preserve gold star color — must follow wildcard li * overrides */
.side-panel #reviews li strong,
.side-panel #reviews li .review-stars,
.side-panel #reviews li span.review-stars,
.right-panel #reviews li strong,
.right-panel #reviews li .review-stars,
.right-panel #reviews li span.review-stars { color: #fbbf24 !important; }

/* TID-QA-STARS: Restore gold star color — must override dark-theme wildcard li * rules */
.star-filled,
[class*="star-filled"],
.review-stars .star-filled,
.side-panel #reviews li .star-filled,
.right-panel #reviews li .star-filled {
  color: #ffc107 !important;
}

/* TID-QA-009: Right panel comment cards — dark theme text fix */
.right-panel .comment-card,
.right-panel #recent-comments-list li,
.right-panel #recent-comments-list > div {
  background: rgba(255, 255, 255, 0.07) !important;
  color: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px;
  padding: 8px 10px;
}
.right-panel .comment-card *,
.right-panel #recent-comments-list li *,
.right-panel #recent-comments-list > div * {
  color: rgba(255, 255, 255, 0.85) !important;
}
/* Preserve star gold color in right panel */
.right-panel .comment-card strong,
.right-panel #recent-comments-list li strong,
.right-panel #recent-comments-list .review-stars {
  color: #fbbf24 !important;
}

/* TID-QA-009: Lift float tray above news ticker + footer so it sits inside the map area */
/* position:relative establishes a stacking context so the fixed tray clips to the app container on browsers that support it */
.browse-page .app-container { position: relative; }
.browse-page .chrono-float-tray {
  bottom: calc(95px + env(safe-area-inset-bottom, 0px)) !important;
}

/* TID-050: High-contrast attribute badges for animal, safety, condition */
.attr-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  margin: 2px 4px 2px 0;
}
.attr-badge--animal {
  background: rgba(251,191,36,0.2);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.4);
}
.attr-badge--safety-safe {
  background: rgba(52,211,153,0.2);
  color: #34d399;
  border: 1px solid rgba(52,211,153,0.4);
}
.attr-badge--safety-risk {
  background: rgba(248,113,113,0.2);
  color: #f87171;
  border: 1px solid rgba(248,113,113,0.4);
}
.attr-badge--condition-excellent {
  background: rgba(52,211,153,0.2);
  color: #34d399;
  border: 1px solid rgba(52,211,153,0.4);
}
.attr-badge--condition-good {
  background: rgba(96,165,250,0.2);
  color: #60a5fa;
  border: 1px solid rgba(96,165,250,0.4);
}
.attr-badge--condition-fair {
  background: rgba(251,191,36,0.2);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.4);
}
.attr-badge--condition-poor {
  background: rgba(248,113,113,0.2);
  color: #f87171;
  border: 1px solid rgba(248,113,113,0.4);
}

/* TID-050: Rocky chat card size constraints per product spec */
#ai-oracle-card {
  max-width: min(360px, calc(100vw - 32px)) !important;
  min-width: min(360px, calc(100vw - 32px)) !important;
  max-height: min(600px, 85vh) !important;
  overflow: hidden !important;
}
#rocky-chat-frame {
  height: 100% !important;
  min-height: 480px !important;
  max-height: calc(min(600px, 85vh) - 72px) !important;
}

/* TID-QA-010: Bonus XP summary banner */
.bonus-xp-summary-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: linear-gradient(135deg, rgba(102,126,234,0.12), rgba(139,92,246,0.10));
  border: 1px solid rgba(102,126,234,0.3);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.bonus-xp-summary-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  line-height: 1;
}
.bonus-xp-summary-banner strong {
  font-size: 0.9rem;
  color: var(--primary, #667eea);
  display: block;
  margin-bottom: 2px;
}
.bonus-xp-summary-sub {
  font-size: 0.78rem;
  color: #6b7280;
  line-height: 1.4;
}

/* TID-ISSUE2: Glass pin detail section — visually prominent when showing pin info */
#glassPinDetail {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 8px;
}
.glass-bonus-tag {
  background: rgba(99,102,241,0.22);
  border: 1px solid rgba(99,102,241,0.45);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.78rem;
  color: #e0e7ff;
  display: inline-block;
  margin: 2px 3px 2px 0;
}
/* TID-GOOGLE-PLACES: Google ratings button inherits .glass-bonus-tag styling */
.glass-google-btn { cursor: pointer; font-style: normal; }
#glassPinStars { font-size: 1.05rem; letter-spacing: 2px; margin-bottom: 4px; }
#glassPinMeta  { font-size: 0.78rem; color: rgba(255,255,255,0.55); margin-bottom: 6px; }
#glassPinComment { font-style: italic; color: rgba(255,255,255,0.82); font-size: 0.88rem; margin-bottom: 8px; }

/* TID-QA-006: Rocky dismiss button — anchored to orb container */
#rocky-dismiss-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 1;
  line-height: 1;
  padding: 0;
}
#rocky-dismiss-btn:hover { background: #fff; color: #000; }
/* Dragging state for Rocky orb container */
#rocky-orb-container.dragging { cursor: grabbing !important; }
#rocky-orb-container { cursor: grab; }

/* ── EVENT GLASS PANEL (TID-TM-EVENTPANEL) ─────────────────────────────── */
.event-glass-panel {
  position: absolute;
  bottom: calc(120px + env(safe-area-inset-bottom, 0px)); /* 120px = map mode button bar + bottom nav clearance */
  left: 20px;
  min-width: 280px;
  max-width: min(400px, calc(100% - 40px));
  background: linear-gradient(135deg, rgba(10, 25, 60, 0.72) 0%, rgba(20, 10, 50, 0.68) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 200, 80, 0.22);
  border-radius: 18px;
  padding: 18px 20px 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(255,200,80,0.08);
  z-index: 23;
  color: #fff;
  font-family: inherit;
}
.event-glass-panel.show { display: block !important; }
.event-glass-close {
  position: absolute;
  top: 10px; right: 12px;
  background: rgba(255,255,255,0.12);
  border: none; color: #fff;
  font-size: 14px; line-height: 1;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  font-family: inherit;
  min-height: 28px;
}
.event-glass-close:hover { background: rgba(255,255,255,0.28); }
.event-glass-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  padding-right: 24px;
}
.event-glass-emoji {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}
.event-glass-title-block { flex: 1; min-width: 0; }
.event-glass-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: #FFD93D;
  word-break: break-word;
}
.event-glass-subtitle {
  font-size: 0.8rem;
  opacity: 0.75;
  margin-top: 3px;
}
.event-glass-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.25) transparent;
}
.event-glass-body::-webkit-scrollbar { width: 5px; }
.event-glass-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 4px; }
.event-glass-field {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.83rem;
  line-height: 1.4;
}
.event-glass-field-icon { flex-shrink: 0; font-size: 1rem; }
.event-glass-field-label {
  opacity: 0.55;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 4px;
}
.event-glass-field-value { color: rgba(255,255,255,0.92); }
.event-glass-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.12);
  margin: 10px 0;
}
.event-glass-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.event-glass-btn {
  flex: 1;
  min-width: 110px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: opacity 0.2s, transform 0.1s;
  font-family: inherit;
}
.event-glass-btn:active { transform: scale(0.97); }
.event-glass-btn--primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}
.event-glass-btn--primary:hover { opacity: 0.88; }
.event-glass-btn--secondary {
  background: rgba(102, 126, 234, 0.28);
  color: #a5b4fc;
  border: 1px solid rgba(102,126,234,0.35);
}
.event-glass-btn--secondary:hover { background: rgba(102,126,234,0.42); }

/* ── TID-IMPACT-PANEL: Impact Quest Glass Panel ────────────────────────────── */
.impact-glass-panel {
  position: absolute;
  bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  left: 20px;
  min-width: 280px;
  max-width: min(400px, calc(100% - 40px));
  background: linear-gradient(135deg, rgba(10, 40, 20, 0.78) 0%, rgba(30, 10, 60, 0.72) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 18px;
  padding: 18px 20px 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(34,197,94,0.08), 0 0 18px rgba(34,197,94,0.12);
  z-index: 23;
  color: #fff;
  font-family: inherit;
}
.impact-glass-panel.show { display: block !important; }
.impact-glass-close {
  position: absolute;
  top: 10px; right: 12px;
  background: rgba(255,255,255,0.12);
  border: none; color: #fff;
  font-size: 14px; line-height: 1;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  font-family: inherit;
  min-height: 28px;
}
.impact-glass-close:hover { background: rgba(255,255,255,0.28); }
.impact-glass-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding-right: 24px;
}
.impact-glass-emoji {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}
.impact-glass-title-block { flex: 1; min-width: 0; }
.impact-glass-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: #4ade80;
  word-break: break-word;
}
.impact-glass-upvote-pill {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 10px;
  background: rgba(34,197,94,0.18);
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #86efac;
}
.impact-glass-desc {
  font-size: 0.85rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.85);
  margin-bottom: 16px;
  max-height: 120px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.25) transparent;
}
.impact-glass-desc::-webkit-scrollbar { width: 5px; }
.impact-glass-desc::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 4px; }
.impact-glass-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.impact-glass-btn {
  flex: 1;
  min-width: 110px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: opacity 0.2s, transform 0.1s;
  font-family: inherit;
}
.impact-glass-btn:active { transform: scale(0.97); }
.impact-glass-btn--upvote {
  background: rgba(34, 197, 94, 0.25);
  color: #86efac;
  border: 1px solid rgba(34,197,94,0.4);
}
.impact-glass-btn--upvote:hover { background: rgba(34,197,94,0.4); }
.impact-glass-btn--upvote:disabled { opacity: 0.65; cursor: not-allowed; }
.impact-glass-btn--quest {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
}
.impact-glass-btn--quest:hover { opacity: 0.88; }

/* ── Neighbourhood Snapshot Grid (QA-SNAPSHOT-REFACTOR) ──────────────────────
   Clean uniform grid replacing bar-based vibe display for condition/upkeep.  */
.snapshot-section {
  margin: 14px 0 6px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.07));
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(99,102,241,0.08);
}
/* Snapshot section heading — use same system as comments-label but distinct */
.snapshot-section > .comments-label {
  font-size: 0.78rem;
  color: #a5b4fc;
  margin-bottom: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 800;
}
.snapshot-grid-inner { display: flex; flex-direction: column; gap: 10px; }
.snapshot-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.snapshot-row-label {
  font-size: 0.73rem;
  font-weight: 700;
  color: #c4b5fd;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.snapshot-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.snapshot-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 20px;
  background: rgba(139,92,246,0.18);
  border: 1px solid rgba(139,92,246,0.3);
  color: #e9d5ff;
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition: background 0.15s, border-color 0.15s;
}
.snapshot-chip:hover { background: rgba(139,92,246,0.32); border-color: rgba(139,92,246,0.55); }
.snapshot-chip--empty { color: rgba(255,255,255,0.3); font-weight: 400; border-style: dashed; background: transparent; }
.snapshot-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: rgba(99,102,241,0.4);
  font-size: 0.68rem;
  font-weight: 700;
  color: #c7d2fe;
}
.snapshot-meta {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.4);
  margin: 4px 0 0;
  text-align: right;
}

/* ── Groups Modal (Issue 8) ─────────────────────────────────────────────────── */
.groups-modal-card { width: min(500px, 94vw); max-height: 85vh; overflow-y: auto; }
.groups-create-section { margin-bottom: 8px; }
.groups-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.group-card {
  background: linear-gradient(135deg, rgba(102,126,234,0.07), rgba(118,75,162,0.05));
  border: 1px solid rgba(102,126,234,0.2); border-radius: 10px;
  padding: 10px 12px;
}
.group-name { font-size: 0.95rem; font-weight: 700; color: var(--dark); display: block; margin-bottom: 3px; }
.group-desc { font-size: 0.82rem; color: #555; margin: 0 0 4px; }
.group-meta { font-size: 0.72rem; color: #888; display: block; margin-bottom: 6px; }
.group-actions { display: flex; gap: 6px; }
.btn-small { padding: 5px 12px; border: none; border-radius: 7px; font-size: 0.8rem; font-weight: 600; cursor: pointer; font-family: inherit; background: var(--primary); color: #fff; min-height: 34px; }
.btn-groups { background: linear-gradient(135deg, #764ba2, #8a2be2) !important; }
.groups-loading, .groups-empty, .groups-error { font-size: 0.85rem; color: #888; padding: 12px 0; text-align: center; }

/* ── Townhall Modal (Issue 9) ───────────────────────────────────────────────── */
#townhallEventsModal .modal-card { width: min(500px, 94vw); max-height: 85vh; overflow-y: auto; }
.th-event-card {
  background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(217,119,6,0.05));
  border: 1px solid rgba(245,158,11,0.25); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px;
}
.th-event-title { font-weight: 700; font-size: 0.95rem; color: var(--dark); }
.th-event-meta  { font-size: 0.75rem; color: #888; margin: 3px 0 6px; }
.th-event-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.th-event-cal-btn { font-size: 0.78rem; padding: 4px 10px; background: #f59e0b; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; min-height: 32px; }

/* ── Analytics Admin Section (Issue 10) ────────────────────────────────────── */
.analytics-stats-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.analytics-stat-card {
  flex: 1; min-width: 100px; background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(118,75,162,0.08));
  border: 1px solid rgba(102,126,234,0.2); border-radius: 10px; padding: 12px; text-align: center;
}
.analytics-stat-num { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.analytics-stat-label { font-size: 0.72rem; color: #666; margin-top: 2px; }
.analytics-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.analytics-table th { background: rgba(102,126,234,0.1); padding: 6px 8px; text-align: left; font-weight: 700; border-bottom: 1px solid #e5e7eb; }
.analytics-table td { padding: 5px 8px; border-bottom: 1px solid #f3f4f6; vertical-align: top; }
