/* ── Marker icons ── */
.quake-marker { background: transparent !important; border: none !important; }
.marker-core {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.6);
  box-shadow: 0 0 8px currentColor;
}
.latest-marker {
  width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle, #00ff88 30%, transparent 70%);
  border: 2px solid #00ff88;
  box-shadow: 0 0 16px #00ff88, 0 0 32px #00ff8855;
  animation: latestPulse 1.4s ease-in-out infinite;
}
@keyframes latestPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.7; }
}
.strongest-marker {
  width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle, #ff00ff 30%, transparent 70%);
  border: 2px solid #ff00ff;
  box-shadow: 0 0 16px #ff00ff, 0 0 32px #ff00ff55;
  animation: latestPulse 1.4s ease-in-out infinite;
}
.deep-marker {
  width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle, #7b1fa2 30%, transparent 70%);
  border: 2px solid #ce93d8;
  box-shadow: 0 0 14px #7b1fa2;
}
.deleted-marker-wrap {
  width: 20px; height: 20px; position: relative;
}
.deleted-marker-circle {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid #ff3131; background: rgba(255,49,49,0.15);
}
.deleted-marker-x {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
  color: #ff3131; font-size: 13px; line-height: 1;
}
/* Popup extras */
.popup-deleted-badge {
  display: inline-block; background: #b71c1c; color: #fff;
  font-size: 10px; padding: 2px 6px; border-radius: 3px; margin-bottom: 4px;
}
.popup-felt { margin: 4px 0; }
.popup-feltit-btn {
  display: inline-block; margin: 4px 0;
  color: #00ff88; font-size: 11px; text-decoration: none;
}
.popup-feltit-btn:hover { text-decoration: underline; }
:root {
  --sidebar-w: 320px;
  --event-w: 340px;
  --topbar-h: 52px;
  --muted: #6b7a8f;
  --amber: #ff9800;
  --deleted: #ff3131;
}
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  overflow: hidden; background: #0a0e17; color: #c8d4e8;
  font-family: 'Share Tech Mono', monospace;
}
#main {
  display: flex;
  height: calc(100vh - var(--topbar-h));
  width: 100%;
  position: relative;
  overflow: hidden;
}
#topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; background: #0d121c;
  border-bottom: 1px solid rgba(0,255,136,0.25);
  gap: 10px;
}
#topbar .logo {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 14px;
  white-space: nowrap;
}
.weather-center { font-size: 12px; white-space: nowrap; flex: 1; text-align: center; }
.status-bar { display: flex; gap: 12px; font-size: 11px; white-space: nowrap; }
#sidebar {
  width: var(--sidebar-w); flex-shrink: 0; overflow-y: auto;
  background: #0b1019; border-right: 1px solid rgba(0,255,136,0.2);
  padding: 12px; box-sizing: border-box;
}
#eventPanel {
  width: var(--event-w); flex-shrink: 0;
  display: flex; flex-direction: column;
  background: #0b1019; border-left: 1px solid rgba(0,255,136,0.2);
}
#content { flex: 1; display: flex; flex-direction: column; position: relative; min-width: 0; }
#map { flex: 1; width: 100%; height: 100%; min-height: 200px; }
.sidebar-section-title { font-size: 12px; letter-spacing: 1px; margin-bottom: 10px; color: #00ff88; }
.search-section { margin-bottom: 14px; }
.search-label { font-size: 11px; color: var(--muted); display: block; margin-bottom: 4px; }
.search-box { display: flex; gap: 6px; }
.search-box input {
  flex: 1; background: #0a0e17; border: 1px solid rgba(0,255,136,0.3);
  color: #c8d4e8; padding: 6px 8px; font-family: inherit; font-size: 12px;
}
.search-box button, #refreshBtn {
  background: #00ff88; color: #0a0e17; border: none;
  padding: 6px 10px; font-family: inherit; font-size: 11px; font-weight: bold; cursor: pointer;
}
#refreshBtn { width: 100%; margin-top: 6px; }
.event-box, .strongest-box, .legend-box, .deep-box, .deleted-box, .cluster-box {
  background: rgba(0,0,0,0.25); border: 1px solid rgba(0,255,136,0.15);
  border-radius: 6px; padding: 10px; margin-bottom: 12px; font-size: 12px;
}
.event-box strong, .strongest-box strong, .cluster-box strong { color: #00ff88; display: block; margin-bottom: 4px; }
.cluster-item { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.cluster-region { font-weight: bold; color: #00e5ff; font-size: 12px; }
.cluster-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.legend-row { display: flex; align-items: center; gap: 8px; margin: 3px 0; font-size: 11px; }
.legend-swatch { width: 14px; height: 14px; border-radius: 3px; }
.legend-swatch-x { width: 14px; text-align: center; color: var(--deleted); }
.status-badge { font-weight: bold; letter-spacing: 0.5px; }
.status-badge.reviewed, .status-badge.best { color: #00ff88; }
.status-badge.preliminary, .status-badge.automatic { color: var(--amber); }
.status-badge.deleted { color: var(--deleted); }
.status-badge.unknown { color: var(--muted); }
.content-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 12px; background: #0d121c; border-bottom: 1px solid rgba(0,255,136,0.2);
  font-size: 11px;
}
.result-count { color: #00ff88; }
#footer {
  display: flex; justify-content: space-between; padding: 4px 10px;
  background: #0d121c; border-top: 1px solid rgba(0,255,136,0.2); font-size: 10px;
}
#eventPanel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border-bottom: 1px solid rgba(0,255,136,0.2);
}
#eventPanel-title { font-size: 12px; color: #00ff88; }
.sort-btn {
  background: none; border: 1px solid rgba(0,255,136,0.3); color: #00ff88;
  font-family: inherit; font-size: 10px; padding: 3px 8px; cursor: pointer; margin-left: 4px;
}
.sort-btn.active { background: #00ff88; color: #0a0e17; }
#eventList { flex: 1; overflow-y: auto; }
#eventPanel-footer {
  display: flex; justify-content: space-between; padding: 6px 10px;
  border-top: 1px solid rgba(0,255,136,0.2); font-size: 11px;
}
.eq-row {
  display: flex; gap: 10px; padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer; transition: background 0.15s;
}
.eq-row:hover { background: rgba(0,255,136,0.06); }
.eq-row.eq-latest { background: rgba(0,255,136,0.1); }
.eq-row.eq-strongest { background: rgba(255,0,255,0.08); }
.eq-row.eq-deleted { opacity: 0.55; }
.eq-row.eq-new { animation: newPulse 1.5s ease; }
@keyframes newPulse {
  0%, 100% { background: transparent; }
  50% { background: rgba(0,255,136,0.2); }
}
.eq-mag { font-size: 18px; font-weight: bold; min-width: 36px; text-align: center; }
.eq-place { font-size: 12px; }
.eq-meta { font-size: 10px; color: var(--muted); margin-top: 2px; }
.eq-status { display: flex; align-items: center; gap: 4px; font-size: 10px; margin-top: 2px; }
.status-dot-sm { width: 6px; height: 6px; border-radius: 50%; }
.eq-status.is-reviewed .status-dot-sm, .eq-status.is-best .status-dot-sm { background: #00ff88; box-shadow: 0 0 5px #00ff88; }
.eq-status.is-automatic .status-dot-sm, .eq-status.is-preliminary .status-dot-sm { background: var(--amber); }
.eq-status.is-deleted .status-dot-sm { background: var(--deleted); }
.eq-badge { font-size: 9px; padding: 1px 4px; border-radius: 3px; margin-left: 4px; }
.eq-badge-deep { background: #7b1fa2; color: #fff; }
.eq-badge-deleted { background: #b71c1c; color: #fff; }
#loading {
  position: absolute; inset: 0; background: rgba(10,14,23,0.85);
  display: none; align-items: center; justify-content: center; z-index: 50;
}
.loader-text { color: #00ff88; font-size: 14px; letter-spacing: 2px; }
/* Flash */
#newEventFlash { position: fixed; inset: 0; pointer-events: none; z-index: 9998; opacity: 0; transition: opacity 0.2s; }
#newEventFlash.active { background: rgba(0,255,136,0.25); opacity: 1; }
#newEventFlash.mega-active { background: rgba(255,30,30,0.45); opacity: 1; }
/* Mega banner */
#megaquake-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  background: linear-gradient(180deg, #8b0000, #c00); color: #fff;
  padding: 16px 20px; text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  animation: megaSlide 0.4s ease;
}
@keyframes megaSlide { from { transform: translateY(-100%); } to { transform: translateY(0); } }
#megaquake-banner .mega-title { font-size: 22px; font-weight: bold; letter-spacing: 2px; margin-bottom: 6px; }
#megaquake-banner .mega-details { font-size: 16px; margin-bottom: 12px; }
#megaquake-banner .mega-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
#megaquake-banner .mega-btn {
  background: #fff; color: #8b0000; border: none; padding: 8px 16px;
  font-family: inherit; font-size: 13px; font-weight: bold; border-radius: 4px; cursor: pointer; text-decoration: none;
}
#megaquake-banner .mega-btn.close { background: transparent; color: #fff; border: 1px solid #fff; }
/* Mobile */
.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 90; }
.mobile-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; height: 56px;
  background: #0d121c; border-top: 1px solid rgba(0,255,136,0.3);
  z-index: 100; justify-content: space-around; align-items: center;
}
.mobile-nav button {
  background: none; border: none; color: #00ff88;
  font-family: inherit; font-size: 11px; display: flex; flex-direction: column;
  align-items: center; gap: 2px; cursor: pointer; min-width: 64px;
}
.mobile-nav button.active { color: #fff; text-shadow: 0 0 8px #00ff88; }
@media (max-width: 900px) {
  #sidebar, #eventPanel {
    position: fixed; top: var(--topbar-h); bottom: 56px; z-index: 95;
    width: min(340px, 88vw); transition: transform 0.28s ease;
  }
  #sidebar { left: 0; transform: translateX(-105%); }
  #sidebar.open { transform: translateX(0); }
  #eventPanel { right: 0; transform: translateX(105%); }
  #eventPanel.open { transform: translateX(0); }
  .mobile-overlay { display: block; opacity: 0; pointer-events: none; }
  .mobile-overlay.visible { opacity: 1; pointer-events: auto; }
  .mobile-nav { display: flex; }
  #main { height: calc(100vh - var(--topbar-h) - 56px); }
  .status-bar { display: none; }
}