/* ── CivicSense — Mobile-First Styles ── */

:root {
  --bg-primary: #FFFFFF;
  --bg-secondary: #F1F5F9;
  --bg-tertiary: #F8FAFC;
  --border: #E2E8F0;
  --border-subtle: #F1F5F9;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-dim: #CBD5E1;
  --accent: #0D9488;
  --accent-dark: #0F766E;
  --accent-light: #CCFBF1;
  --accent-bg: #F0FDFA;
  --amber: #F59E0B;
  --amber-light: #FEF3C7;
  --slate-900: #0F172A;
  --slate-800: #1E293B;
  --slate-700: #334155;
  --red: #DC2626;
  --red-light: #FEF2F2;
  --orange: #EA580C;
  --yellow: #D97706;
  --green: #16A34A;
  --green-light: #F0FDF4;
  --blue: #2563EB;
  --blue-light: #EFF6FF;
  --purple: #7C3AED;
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.06);
  --shadow-md: 0 4px 12px rgba(15,23,42,0.08);
  --shadow-lg: 0 8px 30px rgba(15,23,42,0.12);
  --shadow-float: 0 8px 24px rgba(15,23,42,0.18);
  --shadow-sheet: 0 -4px 24px rgba(15,23,42,0.1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-height: 100dvh;
}

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

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

button, select, input, textarea {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  font-family: inherit;
}

/* ── Layout ── */
#app {
  width: 100%;
  height: var(--app-height, 100dvh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
  background: var(--bg-primary);
}

/* ── Header ── */
#app-header {
  padding: calc(max(var(--safe-top), 8px) + 4px) 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 10;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  position: relative;
}
#app-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 60%, var(--amber) 100%);
}

.logo { height: 22px; display: block; }

.version-tag {
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  text-transform: uppercase;
}
.version-tag:active { background: var(--border); }

/* ── Filter Bar ── */
#filter-bar {
  padding: 8px 16px 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 12;
}

.filter-select {
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  min-width: 0;
  flex: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.filter-select:focus { outline: none; border-color: var(--accent); background-color: var(--accent-bg); }

.view-toggle {
  display: flex;
  background: var(--slate-900);
  border-radius: 999px;
  padding: 3px;
  flex-shrink: 0;
  margin-left: auto;
}

.view-btn {
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.view-btn.active {
  background: #fff;
  color: var(--slate-900);
}

/* ── Main Content ── */
#main-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.view-panel { display: none; width: 100%; height: 100%; }
.view-panel.active { display: block; }

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

/* Reserve space at the bottom of the list view for the floating bar */
#list-view .report-list { padding-bottom: calc(80px + var(--safe-bottom)); }

/* ── Map Overlay Stats ── */
.map-overlay {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--slate-900);
  border-radius: 999px;
  padding: 8px 16px;
  box-shadow: var(--shadow-float);
  display: flex;
  gap: 14px;
  align-items: center;
  z-index: 5;
  border: 1px solid rgba(255,255,255,0.08);
}
.stat { display: flex; align-items: baseline; gap: 5px; }
.stat-value {
  font-size: 16px;
  font-weight: 800;
  font-family: 'DM Mono', monospace;
  color: var(--amber);
}
.stat-value.orange { color: var(--accent-light); font-size: 13px; font-weight: 700; }
.stat-label {
  font-size: 9px;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.stat-divider { width: 1px; height: 14px; background: rgba(255,255,255,0.15); }

/* ── List View ── */
.report-list {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.report-list-item {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.1s;
}
.report-list-item:active { background: var(--bg-secondary); }

.report-list-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid;
  flex-shrink: 0;
}
.report-list-icon .count {
  font-weight: 800;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
}

.report-list-info { flex: 1; min-width: 0; }
.report-list-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.report-list-meta {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.report-list-right { text-align: right; flex-shrink: 0; }

/* ── Bottom Bar (floating pill) ── */
#bottom-bar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(max(var(--safe-bottom), 12px) + 8px);
  background: var(--slate-900);
  border-radius: 999px;
  padding: 8px 8px 8px 18px;
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 16;
  box-shadow: var(--shadow-float), 0 0 0 1px rgba(255,255,255,0.06) inset;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Hide floating bar while a sheet/modal is open so it doesn't occlude content */
body.overlay-open #bottom-bar {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.btn-primary {
  flex: 1;
  height: 48px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(13,148,136,0.45);
  transition: transform 0.1s, background 0.15s;
  order: 2;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary svg { width: 18px; height: 18px; stroke-width: 3; }

.btn-secondary {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  flex-shrink: 0;
  color: rgba(255,255,255,0.85);
  order: 1;
}
.btn-secondary:active { transform: scale(0.94); background: rgba(255,255,255,0.08); }
.btn-secondary svg { width: 20px; height: 20px; }

.count-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--amber);
  color: var(--slate-900);
  font-size: 9px;
  font-weight: 800;
  font-family: 'DM Mono', monospace;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--slate-900);
}
.count-badge:empty { display: none; }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 10px;
  font-weight: 600;
}
.badge-open { background: var(--red-light); color: #B91C1C; }
.badge-in_progress { background: #FFF7ED; color: #C2410C; }
.badge-resolved { background: var(--green-light); color: #15803D; }
.badge-severity {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Overlay / Backdrop ── */
.overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}
.overlay-backdrop-dim { background: rgba(0,0,0,0.3); backdrop-filter: blur(4px); }
.overlay-backdrop-center { align-items: center; padding: 24px; }

/* ── Bottom Sheet ── */
.sheet {
  width: 100%;
  max-width: 500px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(92vh - env(safe-area-inset-top, 0px));
  animation: slideUp 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.sheet-handle {
  display: flex;
  justify-content: center;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 0 4px;
  flex-shrink: 0;
}
.sheet-handle-bar {
  width: 36px;
  height: 4px;
  border-radius: 4px;
  background: var(--text-dim);
}

.sheet-header {
  padding: 0 20px 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-subtle);
}
.sheet-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.sheet-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.sheet-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.sheet-close {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
}
.sheet-close:active { background: var(--bg-secondary); }

/* ── Modal (centered) ── */
.modal {
  background: #fff;
  border-radius: 16px;
  max-width: 340px;
  width: 100%;
  overflow: hidden;
  animation: fadeIn 0.3s ease-out;
}

/* ── Card ── */
.card {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

/* ── Form Elements ── */
.form-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.form-label .required { color: var(--red); }
.form-label .error-text { font-size: 11px; font-weight: 600; color: var(--red); text-transform: none; letter-spacing: 0; }

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-dim); }
.form-input.error { border: 2px solid var(--red); background: var(--red-light); }

.form-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  resize: none;
  font-family: inherit;
  min-height: 80px;
}
.form-textarea:focus { border-color: var(--accent); }

.form-select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  font-size: 14px;
  color: var(--text-primary);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ── Photo Capture ── */
.photo-area {
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: all 0.15s;
}
.photo-area-empty {
  height: 120px;
  background: var(--bg-secondary);
  border: 2px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.photo-area-empty.error { border-color: var(--red); background: var(--red-light); }
.photo-area-preview {
  height: 200px;
  background: #000;
}
.photo-area-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-retake {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: #fff;
  font-weight: 500;
}

/* ── Category Chips ── */
.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.category-chip {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.category-chip.active {
  border-width: 2px;
}
.category-chip svg { width: 14px; height: 14px; }

/* ── Severity Selector ── */
.severity-option {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.15s;
  margin-bottom: 6px;
}
.severity-option.active { border-width: 2px; }
.severity-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 2px;
  flex-shrink: 0;
  transition: all 0.15s;
}
.severity-label { font-size: 13px; font-weight: 600; }
.severity-desc { font-size: 11px; color: var(--text-dim); margin-top: 2px; line-height: 1.4; }

/* ── Submit Button ── */
.btn-submit {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.1s;
}
.btn-submit:active { transform: scale(0.98); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Action Buttons ── */
.btn-action {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  border: 2px solid;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.1s;
}
.btn-action:active { transform: scale(0.98); }
.btn-action svg { width: 16px; height: 16px; }

.btn-upvote { border-color: var(--accent-light); background: var(--accent-bg); color: var(--accent-dark); }
.btn-upvote.voted { border-color: #BBF7D0; background: var(--green-light); color: var(--green); }

.btn-resolve { background: var(--slate-900); color: #fff; border-color: var(--slate-900); box-shadow: 0 4px 14px rgba(15,23,42,0.3); }
.btn-share-wa { background: #25D366; color: #fff; border-color: #25D366; box-shadow: 0 4px 14px rgba(37,211,102,0.25); }

/* ── Share Icons ── */
.share-row {
  display: flex;
  justify-content: center;
  gap: 16px;
}
.share-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s;
}
.share-btn:active { transform: scale(0.95); }

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  gap: 8px;
  padding: 12px 20px;
}
.stats-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.stats-grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.stat-card {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 12px;
  text-align: center;
}
.stat-card-value {
  font-size: 20px;
  font-weight: 800;
  font-family: 'DM Mono', monospace;
}
.stat-card-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Rep Card ── */
.rep-card {
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  margin-bottom: 6px;
}
.rep-card:active { background: var(--bg-secondary); }
.rep-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.rep-info { flex: 1; min-width: 0; }
.rep-name { font-size: 14px; font-weight: 600; }
.rep-role { font-size: 12px; color: var(--text-muted); }
.rep-party { font-weight: 700; }

/* ── Leaderboard ── */
.lb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.1s;
}
.lb-item:active { background: var(--bg-secondary); }
.lb-rank {
  font-size: 14px;
  font-weight: 800;
  font-family: 'DM Mono', monospace;
  width: 24px;
  text-align: right;
  flex-shrink: 0;
}
.lb-bar-bg { height: 4px; border-radius: 4px; background: var(--border-subtle); overflow: hidden; margin-top: 4px; }
.lb-bar-fill { height: 100%; border-radius: 4px; }
.lb-count {
  font-size: 12px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  color: var(--text-secondary);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Section Headers ── */
.section-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
  margin-bottom: 8px;
}

/* ── Ward Detect Card ── */
.ward-detect {
  padding: 12px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.ward-detect.detected { background: var(--green-light); border: 1px solid #BBF7D0; }
.ward-detect.detecting { background: var(--bg-secondary); border: 1px solid var(--border); }

/* ── Info Banner ── */
.info-banner {
  padding: 12px;
  border-radius: 12px;
  display: flex;
  gap: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.info-banner svg { flex-shrink: 0; margin-top: 2px; }

/* ── Onboarding Modal ── */
.onboarding-content { padding: 24px; }
.onboarding-content h2 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.onboarding-content p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 4px; }
.onboarding-stats { font-size: 10px; color: var(--text-dim); text-align: center; margin-top: 16px; }
.onboarding-cta { font-size: 10px; color: var(--text-dim); text-align: center; margin-top: 12px; }

/* ── About Sheet ── */
.about-body { padding: 20px; }
.about-body p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px; }
.about-body strong { color: var(--text-primary); }

/* ── Anonymous Badge ── */
.anon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--green);
}
.anon-badge svg { width: 12px; height: 12px; }

/* ── Report Photo ── */
.report-photo {
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}
.report-photo img { width: 100%; height: 100%; object-fit: cover; }
.report-photo .photo-empty { display: flex; flex-direction: column; gap: 4px; align-items: center; color: #9CA3AF; font-size: 12px; }

/* Before / Fixed pair (resolved reports) */
.report-photo-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.photo-frame {
  position: relative;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-frame-label {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.photo-frame-label-fixed { background: rgba(13, 148, 136, 0.92); }

/* ── Loading State ── */
.loading-screen {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.loading-screen .logo { animation: pulse 1.5s ease-in-out infinite; }
.loading-text { font-size: 14px; color: var(--text-muted); font-weight: 500; }

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  text-align: center;
  padding: 32px;
}
.empty-state-icon { font-size: 40px; opacity: 0.3; }
.empty-state-text { font-size: 14px; color: var(--text-muted); }

/* ── MapLibre Overrides ── */
.maplibregl-map { font-family: 'DM Sans', sans-serif !important; }
.maplibregl-ctrl-attrib-button { display: none !important; }
.maplibregl-ctrl-attrib { font-size: 8px !important; opacity: 0.3; background: transparent !important; }
.maplibregl-ctrl-bottom-right {
  bottom: calc(max(var(--safe-bottom), 12px) + 80px) !important;
  right: 16px !important;
}
.maplibregl-ctrl-group {
  border-radius: 12px !important;
  box-shadow: var(--shadow-md) !important;
  border: 1px solid var(--border) !important;
  overflow: hidden;
}
.maplibregl-ctrl-group button { width: 40px !important; height: 40px !important; }
.maplibregl-ctrl-geolocate {
  border-radius: 12px !important;
  box-shadow: var(--shadow-md) !important;
  border: 1px solid var(--border) !important;
  width: 40px !important;
  height: 40px !important;
}
.maplibregl-popup-content { background: transparent !important; box-shadow: none !important; padding: 0 !important; }
.maplibregl-popup-tip { display: none !important; }
.maplibregl-popup-close-button { display: none !important; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-dim); border-radius: 3px; }

/* ── Animations ── */
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.spinner-dark {
  border-color: rgba(0,0,0,0.1);
  border-top-color: var(--text-muted);
}
