/* =========================================================
   GeoInsight — Earth Explorer  |  Styles
   ========================================================= */

:root {
  --bg-deep: #0f1729;
  --bg-panel: #1a2332;
  --bg-card: #1e293b;
  --bg-card-hover: #253348;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --text: #999;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border: #334155;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --panel-width: 400px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* ---------- Map ---------- */
#map {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.maplibregl-ctrl-attrib { font-size: 11px !important; }

/* ---------- Logo / Home Button ---------- */
#logo-home {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 16px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 40px;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
#logo-home:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: var(--accent);
  transform: scale(1.03);
}
#logo-home:active {
  transform: scale(0.97);
}

/* ---------- Globe Toggle ---------- */
.globe-toggle {
  position: fixed;
  top: 12px;
  left: 190px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 40px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.globe-toggle:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: var(--accent);
  transform: scale(1.03);
}
.globe-toggle:active {
  transform: scale(0.97);
}
.globe-toggle.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--accent);
  color: var(--accent-light);
}
.globe-toggle-icon {
  font-size: 16px;
  line-height: 1;
}
.globe-toggle-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.logo-icon {
  font-size: 20px;
  margin-right: 4px;
  line-height: 1;
  display: flex;
  align-items: center;
}
.logo-geo {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent-light), #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-insight {
  font-size: 18px;
  font-weight: 300;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1;
}

/* ---------- Click Hint ---------- */
#click-hint {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  color: var(--text);
  padding: 12px 28px;
  border-radius: 40px;
  font-size: 15px;
  font-weight: 500;
  z-index: 100;
  pointer-events: none;
  transition: opacity 0.6s ease;
  border: 1px solid var(--border);
}
#click-hint span { font-size: 20px; vertical-align: middle; margin-right: 4px; }
#click-hint.hidden { opacity: 0; }

/* ---------- Coordinate Display ---------- */
#coords-display {
  position: fixed;
  bottom: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  z-index: 100;
  border: 1px solid rgba(51, 65, 85, 0.5);
}

/* ---------- Data Attribution ---------- */
#data-attribution {
  position: fixed;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  color: var(--text-dim);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  z-index: 100;
  border: 1px solid rgba(51, 65, 85, 0.3);
}
#data-attribution a {
  color: var(--text-muted);
  text-decoration: none;
}
#data-attribution a:hover { color: var(--accent-light); }

/* ---------- Layer Controls ---------- */
.control-panel {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.control-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.control-toggle:hover { background: var(--bg-card); }

.control-content {
  margin-top: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 220px;
  display: none;
  animation: fadeSlideDown 0.2s ease;
}
.control-content.open { display: block; }

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.control-content h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 8px;
  margin-top: 12px;
}
.control-content h3:first-child { margin-top: 0; }

.layer-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.layer-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  font-size: 13px;
}
.layer-option:hover { background: var(--bg-card); }
.layer-option input { accent-color: var(--accent); }
.layer-label { user-select: none; }

/* ---------- Profile Panel ---------- */
.profile-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--panel-width);
  height: 100vh;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition);
  overflow: hidden;
}
.profile-panel.open { transform: translateX(0); }

.control-panel {
  transition: right var(--transition);
}
.control-panel.shifted {
  right: calc(var(--panel-width) + 12px);
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 10;
  line-height: 1;
}
.close-btn:hover { background: var(--danger); color: white; border-color: var(--danger); }

/* Profile Header */
#profile-header {
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#profile-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  padding-right: 30px;
}
.header-flag {
  display: inline-block;
  width: 24px;
  height: 18px;
  vertical-align: middle;
  margin-right: 4px;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  position: relative;
  top: -1px;
}
#profile-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: 'Fira Code', 'Cascadia Code', monospace;
}

/* Tabs */
#profile-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
#profile-tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 1;
  padding: 10px 6px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.tab:hover { color: var(--text); background: rgba(59, 130, 246, 0.05); }
.tab.active {
  color: var(--accent-light);
  border-bottom-color: var(--accent);
}

/* Tab Content */
#profile-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.tab-content {
  display: none;
  padding: 16px 20px;
  animation: fadeIn 0.3s ease;
}
.tab-content.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.placeholder-text {
  text-align: center;
  color: var(--text-dim);
  padding: 40px 20px;
  font-size: 14px;
}

/* ---------- Shared Card Styles ---------- */
.info-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(51, 65, 85, 0.4);
}
.info-card h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Sun direction toggle button */
.sun-dir-btn {
  font-size: 14px;
  line-height: 1;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: auto;
}
.sun-dir-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}
.sun-dir-btn.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent);
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-label {
  font-size: 11px;
  color: var(--text-dim);
}
.stat-value {
  font-size: 16px;
  font-weight: 600;
}
.stat-value.lg {
  font-size: 28px;
}

/* ---------- Overview Tab ---------- */
.overview-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.overview-hero .weather-icon { font-size: 48px; }
.overview-hero .temp {
  font-size: 36px;
  font-weight: 700;
}
.overview-hero .desc {
  font-size: 13px;
  color: var(--text-muted);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.3);
  font-size: 13px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row .label { color: var(--text-muted); }
.detail-row .value { font-weight: 500; }

/* ---------- Weather Tab ---------- */
.current-weather {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.current-weather .icon { font-size: 52px; }
.current-weather .temp-main {
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
}
.current-weather .feels-like {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.forecast-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.forecast-day {
  flex-shrink: 0;
  width: 80px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
  border: 1px solid rgba(51, 65, 85, 0.4);
  transition: border-color var(--transition);
}
.forecast-day:hover { border-color: var(--accent); }
.forecast-day.today { border-color: var(--accent); }
.forecast-day .day-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.forecast-day .day-icon { font-size: 24px; margin-bottom: 6px; }
.forecast-day .day-temps {
  font-size: 12px;
  font-weight: 600;
}
.forecast-day .day-temps .low {
  color: var(--text-dim);
  font-weight: 400;
}
.forecast-day .day-precip {
  font-size: 10px;
  color: var(--accent-light);
  margin-top: 4px;
}
.forecast-day .day-sun {
  font-size: 10px;
  color: #fbbf24;
  margin-top: 2px;
}

/* ---------- Air Quality Tab ---------- */
.aqi-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 16px;
}
.aqi-badge .aqi-label {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.9;
}

.aqi-good       { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.aqi-moderate    { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.aqi-sensitive   { background: rgba(249, 115, 22, 0.15); color: #f97316; }
.aqi-unhealthy   { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.aqi-very-unhealthy { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.aqi-hazardous   { background: rgba(127, 29, 29, 0.2); color: #fca5a5; }

.pollutant-bar {
  margin-bottom: 10px;
}
.pollutant-bar .bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}
.pollutant-bar .bar-header .name { color: var(--text-muted); }
.pollutant-bar .bar-header .val  { font-weight: 600; }
.pollutant-bar .bar-track {
  height: 6px;
  background: var(--bg-deep);
  border-radius: 3px;
  overflow: hidden;
}
.pollutant-bar .bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* ---------- Sun Chart Tab ---------- */
.sun-today {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.sun-stat {
  text-align: center;
  padding: 10px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}
.sun-stat .icon { font-size: 20px; margin-bottom: 4px; }
.sun-stat .time {
  font-size: 18px;
  font-weight: 700;
}
.sun-stat .label {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

#sun-chart-canvas {
  width: 100%;
  height: 220px;
  background: var(--bg-deep);
  border-radius: var(--radius-sm);
  cursor: crosshair;
}

#sun-chart-info {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  min-height: 36px;
}

/* ---------- Loading Spinner ---------- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Error State ---------- */
.error-msg {
  text-align: center;
  color: var(--danger);
  padding: 20px;
  font-size: 13px;
}

/* ---------- Earthquake Popup ---------- */
.quake-popup {
  font-family: system-ui, -apple-system, sans-serif;
  padding-right: 16px;
}
.quake-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}
.quake-mag {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: white;
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.quake-title h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 3px;
  line-height: 1.4;
  color: #111827;
}
.quake-time {
  font-size: 11px;
  color: #6b7280;
}
.quake-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quake-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 5px 0;
  gap: 12px;
}
.quake-row-label {
  color: #6b7280;
}
.quake-row-value {
  text-align: right;
  color: #1f2937;
}
.quake-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-light      { background: #dcfce7; color: #166534; }
.badge-moderate   { background: #fef9c3; color: #854d0e; }
.badge-strong     { background: #ffedd5; color: #9a3412; }
.badge-major      { background: #fee2e2; color: #991b1b; }
.badge-great      { background: #f3e8ff; color: #6b21a8; }
.badge-shallow    { background: #fee2e2; color: #991b1b; }
.badge-mid        { background: #ffedd5; color: #9a3412; }
.badge-intermediate { background: #fef9c3; color: #854d0e; }
.badge-deep       { background: #dcfce7; color: #166534; }
.quake-link {
  display: block;
  text-align: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
  font-size: 12px;
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}
.quake-link:hover {
  text-decoration: underline;
}

/* ---------- Buoy Popup ---------- */
.buoy-popup {
  padding-right: 16px;
}
.buoy-popup h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #111827;
}
.buoy-popup table td {
  padding: 4px 12px 4px 0;
  font-size: 13px;
}
.buoy-popup a {
  color: #3b82f6;
  text-decoration: none;
}
.buoy-popup a:hover {
  text-decoration: underline;
}

/* ---------- MapLibre Popup Overrides ---------- */
.maplibregl-popup {
  max-width: 420px !important;
  z-index: 400;
}
.maplibregl-popup-content {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.12);
  font-size: 13px;
  line-height: 1.5;
  min-width: 280px;
}
.maplibregl-popup-close-button {
  font-size: 22px;
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  border-radius: 50%;
  color: #6b7280;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  top: 8px;
  right: 8px;
  padding: 0;
  transition: all 0.15s ease;
  cursor: pointer;
}
.maplibregl-popup-close-button:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}
.maplibregl-popup-anchor-top .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
  border-bottom-color: #ffffff;
}
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
  border-top-color: #ffffff;
}
.maplibregl-popup-anchor-left .maplibregl-popup-tip {
  border-right-color: #ffffff;
}
.maplibregl-popup-anchor-right .maplibregl-popup-tip {
  border-left-color: #ffffff;
}

/* ---------- Earthquake Meta (timestamp + refresh) ---------- */
.eq-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.eq-meta.hidden { display: none; }

.eq-timestamp {
  font-size: 10px;
  color: var(--text-dim);
  font-family: 'Fira Code', 'Cascadia Code', monospace;
}

.eq-refresh-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 2px;
  line-height: 1;
  border-radius: 4px;
  transition: background 0.15s ease;
}
.eq-refresh-btn:hover {
  background: var(--bg-card);
}
.eq-refresh-btn.spinning {
  animation: spin 0.8s linear infinite;
}

/* ---------- Earthquakes Panel (glassy, collapsible) ---------- */
.eq-new-panel {
  position: fixed;
  bottom: 40px;
  left: 12px;
  z-index: 200;
  width: 320px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  overflow: hidden;
  animation: fadeSlideUp 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: box-shadow 0.4s ease;
}
.eq-new-panel.hidden { display: none; }

/* Animated glowing border for new earthquakes */
.eq-new-panel.has-new {
  border-color: transparent;
  background-clip: padding-box;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(239, 68, 68, 0.6),
    0 0 20px rgba(239, 68, 68, 0.2),
    0 0 40px rgba(239, 68, 68, 0.1);
  animation: eqBorderPulse 1.5s ease-in-out 3;
}

@keyframes eqBorderPulse {
  0%, 100% {
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.06),
      0 0 0 1px rgba(239, 68, 68, 0.3),
      0 0 10px rgba(239, 68, 68, 0.1);
  }
  50% {
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.06),
      0 0 0 2px rgba(239, 68, 68, 0.8),
      0 0 25px rgba(239, 68, 68, 0.3),
      0 0 50px rgba(239, 68, 68, 0.15);
  }
}

/* Collapsed state */
.eq-new-panel.collapsed .eq-new-body {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
}
.eq-new-panel .eq-new-body {
  max-height: 320px;
  opacity: 1;
  transition: max-height 0.3s ease, opacity 0.2s ease 0.1s;
}
.eq-new-panel.collapsed .eq-new-collapse svg {
  transform: rotate(-90deg);
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.eq-new-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}
.eq-new-panel.collapsed .eq-new-header {
  border-bottom: none;
}
.eq-new-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--warning);
}
.eq-new-count {
  font-size: 10px;
  font-weight: 700;
  background: var(--danger);
  color: white;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.4;
}
.eq-new-count.hidden { display: none; }

.eq-new-collapse {
  margin-left: auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.eq-new-collapse svg {
  transition: transform 0.3s ease;
}
.eq-new-collapse:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.eq-new-list {
  overflow-y: auto;
  max-height: 300px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.eq-new-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.eq-new-item:last-child { border-bottom: none; }
.eq-new-item:hover { background: rgba(255, 255, 255, 0.06); }

/* New EQ item entrance animation */
.eq-new-item.eq-item-new {
  animation: eqItemSlideIn 0.4s ease both;
}
@keyframes eqItemSlideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.eq-new-mag {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: white;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.eq-new-info {
  min-width: 0;
}
.eq-new-place {
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eq-new-detail {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
}

/* ---------- Custom MapLibre marker ---------- */
.location-marker {
  width: 24px;
  height: 24px;
  background: var(--accent);
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  cursor: pointer;
}
.location-marker-pulse {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.3);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  :root { --panel-width: 100vw; }

  .profile-panel {
    top: auto;
    bottom: 0;
    width: 100vw;
    height: 70vh;
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    transform: translateY(100%);
  }
  .profile-panel.open { transform: translateY(0); }
  .control-panel.shifted { right: 12px; }

  #profile-header { padding: 16px 16px 10px; }
  .tab-content { padding: 12px 16px; }

  .control-content { min-width: 180px; }

  #data-attribution { display: none; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .sun-today { grid-template-columns: 1fr 1fr 1fr; }
  .forecast-day { width: 70px; }
}
