:root {
  --bg: #0a0f0d;
  --surface: #111a15;
  --surface2: #172010;
  --accent: #39ff7a;
  --accent-dim: #1a7a3a;
  --text: #e8f5ec;
  --text-muted: #6b8f74;
  --red: #ff4757;
  --amber: #ffa502;
  --offline: #444;
  --header-h: 56px;
  --statusbar-h: 44px;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  overscroll-behavior: none;
}

/* ── Header ── */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
  border-bottom: 1px solid #1f2e22;
}

.logo {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.hamburger {
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  border-radius: 8px;
  transition: background 0.15s;
}
.hamburger:active { background: var(--surface2); }

/* ── Map ── */
#map {
  position: fixed;
  top: var(--header-h);
  bottom: var(--statusbar-h);
  left: 0; right: 0;
}

/* ── Status bar ── */
.status-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--statusbar-h);
  background: var(--surface);
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid #1f2e22;
  z-index: 1000;
}

/* ── Panel overlay ── */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.panel-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Watchlist panel ── */
.watchlist-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-height: 70vh;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  z-index: 1200;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}
.watchlist-panel.open { transform: translateY(0); }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid #1f2e22;
}

.panel-title {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  color: var(--text);
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.close-btn:active { background: var(--surface2); }

/* ── Watchlist items ── */
.watchlist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #1a2a1e;
}

.watchlist-name {
  font-size: 14px;
  color: var(--text);
  flex: 1;
  margin-right: 12px;
}

.remove-btn {
  background: none;
  border: 1px solid var(--offline);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.remove-btn:active {
  border-color: var(--red);
  color: var(--red);
}

.empty-state {
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  line-height: 1.5;
}

/* ── Leaflet overrides ── */
.leaflet-container { background: #0d1a10; }

.leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6) !important;
  border: 1px solid #1f2e22 !important;
  padding: 0 !important;
}
.leaflet-popup-tip { background: var(--surface) !important; }
.leaflet-popup-content { margin: 0 !important; }

/* ── Station popup ── */
.popup-content {
  padding: 16px;
  min-width: 220px;
}

.popup-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.evse-count {
  margin-left: auto;
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 4px;
}

.popup-name {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 14px;
}

.watch-btn {
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #0a0f0d;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}
.watch-btn:active { opacity: 0.8; }
.watch-btn.watching {
  background: var(--surface2);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
}
