:root {
  --bg: #070b16;
  --bg2: #0c1326;
  --panel: #101a33;
  --line: #22315c;
  --ink: #eef3ff;
  --muted: #93a3c7;
  --accent: #4cc9f0;
  --gold: #f2b705;
  --danger: #ff4d4d;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scrollbar-color: var(--line) var(--bg); }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 80% -10%, #16224a 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #31448a; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app { max-width: none; margin: 0; padding: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: none; margin: 0; padding: 6px 12px; min-height: 0;
}
.brand { display: flex; gap: 8px; align-items: center; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 22px; height: 22px; border-radius: 7px; flex: none;
  background: conic-gradient(from 200deg, #ff4d4d, #ff9f1c, #ffd60a, #4cc9f0, #7b2ff7, #ff4d4d);
  box-shadow: 0 0 14px #4cc9f055;
}
.brand-text { display: flex; gap: 8px; align-items: baseline; line-height: 1.1; }
.brand-text strong { font-size: 14px; letter-spacing: 0.2px; white-space: nowrap; }
.brand-text small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 44vw; }
.topnav { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #35e08a; box-shadow: 0 0 8px #35e08a; animation: pulse 2s infinite; }
.live-dot.paused { background: var(--gold); box-shadow: 0 0 8px var(--gold); animation: none; }
@keyframes pulse { 50% { opacity: 0.45; } }
.banner {
  background: #3d1405; border: 1px solid #a34a12; border-radius: 8px;
  padding: 6px 12px; font-size: 13px; margin: 6px 12px 0;
}
.layout { display: flex; align-items: stretch; height: calc(100dvh - 88px); min-height: 480px; background: #04060e; }
.scene-wrap { position: relative; flex: 1 1 auto; min-width: 0; height: 100%; overflow: hidden; background: #04060e; }
.scene-wrap canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.map-top {
  position: absolute; top: 8px; left: 8px; right: 8px; z-index: 6;
  display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
  pointer-events: none;
}
.map-top-left, .map-top-right {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: #060b18d9; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 8px; pointer-events: auto; backdrop-filter: blur(8px);
}
.map-top-right { font-size: 12px; color: var(--muted); }
.num { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.num input[type="number"] {
  width: 52px; background: #0d152b; border: 1px solid var(--line); color: var(--ink);
  border-radius: 8px; padding: 3px 6px; font-size: 12px; font-weight: 700;
}
.num input[type="number"]:focus { border-color: var(--accent); outline: none; }
.check-inline { cursor: pointer; }
.check-inline input { accent-color: var(--accent); width: 14px; height: 14px; }
.mini-stats { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mini-stats b { color: var(--ink); }
.mini-stats .sep { opacity: 0.5; margin: 0 2px; }
.btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: 12px; cursor: pointer;
  letter-spacing: 0.3px; text-transform: uppercase;
}
.btn-lines[aria-pressed="true"] { background: #0e3a4d; border-color: var(--accent); box-shadow: 0 0 14px #4cc9f055; }
.btn-historic[aria-pressed="true"] { background: #3d2c05; border-color: var(--gold); box-shadow: 0 0 14px #f2b70555; }
.btn-ghost { background: transparent; }
.btn-ghost[aria-pressed="true"] { border-color: var(--accent); background: #0e3a4d; }
.tooltip {
  position: absolute; pointer-events: none; z-index: 7; max-width: 240px;
  background: #060b18f2; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; font-size: 13px; line-height: 1.4;
}
.tooltip strong { display: block; }
.tooltip small { color: var(--muted); }
.scene-hint {
  position: absolute; left: 10px; bottom: 44px; font-size: 11px; color: var(--muted);
  background: #060b18aa; padding: 3px 10px; border-radius: 999px; pointer-events: none; z-index: 5;
}
.depth-legend {
  position: absolute; right: 10px; bottom: 44px; display: flex; align-items: center; gap: 6px;
  font-size: 10px; color: var(--muted); background: #060b18aa; padding: 3px 10px; border-radius: 999px; z-index: 5;
}
.depth-legend i { display: block; width: 70px; height: 7px; border-radius: 6px;
  background: linear-gradient(90deg, #ff4d4d, #ff9f1c, #ffd60a, #4cc9f0, #7b2ff7); }
.esri-credit {
  position: absolute; right: 10px; bottom: 8px; z-index: 5;
  font-size: 10px; color: rgba(150,170,215,0.75);
  background: #060b18aa; padding: 2px 8px; border-radius: 999px; pointer-events: none;
}
.modebar {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 8px; z-index: 5;
  display: flex; gap: 10px; align-items: center; padding: 4px 14px; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 999px; background: #060b18d9;
  font-size: 12px; color: var(--muted); backdrop-filter: blur(8px);
}
.mode-label { color: var(--ink); font-weight: 700; }
.drawer {
  flex: none; width: 322px; position: static; z-index: auto;
  background: #080e20; border-left: 1px solid var(--line);
  padding: 10px; overflow-y: auto;
}
.drawer.hidden { display: none; }
.drawer h2 { font-size: 13px; margin: 2px 2px 8px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); }
.quake-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.quake-row {
  display: flex; gap: 8px; align-items: center; background: #0d152bcc;
  border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; cursor: pointer;
}
.quake-row:hover, .quake-row.active { border-color: var(--accent); }
.quake-row .mag {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 9px; font-weight: 800; font-size: 13px; background: #182a5e; font-variant-numeric: tabular-nums;
}
.quake-row .qmain { display: grid; flex: 1; min-width: 0; }
.quake-row .qmain strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.quake-row .qmain small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quake-row .qtime { color: var(--muted); font-size: 11px; flex: none; }
.about-mini { margin-top: 10px; font-size: 12px; color: var(--muted); }
.about-mini summary { cursor: pointer; font-weight: 700; color: var(--ink); font-size: 12px; }
.footer { max-width: none; margin: 0; padding: 5px 12px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.footer p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) {
  .layout { flex-direction: column; height: auto; min-height: 0; }
  .scene-wrap { height: calc(100dvh - 210px); min-height: 420px; flex: none; }
  .drawer { width: auto; max-height: 38dvh; border-left: none; border-top: 1px solid var(--line); }
  .brand-text small { display: none; }
  .map-top { top: 6px; left: 6px; right: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}
