*{ box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: #050309;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  color: #e8e2f5;
  overflow: hidden;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulseGlow { 0%,100% { opacity: .5; } 50% { opacity: 1; } }

/* Range inputs */
input[type=range] {
  -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 99px;
  background: rgba(255,255,255,0.13);
  outline: none; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: #c084fc; box-shadow: 0 0 10px #c084fc; cursor: pointer; border: 2px solid #16102a;
}
input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #c084fc; box-shadow: 0 0 10px #c084fc; cursor: pointer; border: 2px solid #16102a;
}

.stage {
  position: fixed; inset: 0; overflow: hidden;
  background: radial-gradient(120% 120% at 50% 38%, #110c20 0%, #0a0715 46%, #050309 100%);
}
#space { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
#globe { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; z-index: 1; }
.vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(86% 86% at 50% 50%, transparent 60%, rgba(4,2,9,0.42) 100%);
  z-index: 2;
}

/* Hover label */
.hover-label {
  position: absolute; top: 0; left: 0; pointer-events: none; opacity: 0;
  transition: opacity .12s; font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; letter-spacing: 0.03em; padding: 4px 9px; border-radius: 8px;
  background: rgba(16,11,28,0.92); border: 1px solid rgba(192,132,252,0.45);
  color: #f0e9ff; white-space: nowrap; z-index: 40; box-shadow: 0 4px 18px rgba(0,0,0,0.55);
}

/* Headline */
.headline { position: absolute; top: 26px; left: 30px; z-index: 20; pointer-events: none; max-width: 46vw; }
.headline-eyebrow { display: flex; align-items: center; gap: 10px; }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: #c084fc; box-shadow: 0 0 14px #c084fc; animation: pulseGlow 2.4s ease-in-out infinite; }
.eyebrow-text { font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase; color: #a99fc6; font-family: 'IBM Plex Mono', monospace; }
.headline-title { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; margin-top: 9px; line-height: 1.08; }
.headline-note { font-size: 11.5px; color: #7f76a0; margin-top: 8px; font-family: 'IBM Plex Mono', monospace; }

/* Glass panels */
.panel {
  position: absolute; z-index: 20; padding: 16px; border-radius: 18px;
  background: rgba(17,12,29,0.72);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(180,150,240,0.13); box-shadow: 0 18px 50px rgba(0,0,0,0.45);
}
.panel-left { top: 154px; left: 24px; width: 246px; }
.panel-right { top: 154px; right: 24px; width: 250px; }
.panel-detail { right: 24px; bottom: 106px; width: 250px; z-index: 25; background: rgba(17,12,29,0.86); border-color: rgba(192,132,252,0.3); box-shadow: 0 18px 50px rgba(0,0,0,0.5); }

.panel-label { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: #948ab0; font-family: 'IBM Plex Mono', monospace; margin-bottom: 12px; }
.panel-label.mt { margin: 18px 0 9px; }

/* Model list */
.model-list { display: flex; flex-direction: column; }
.model-row {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 12px;
  cursor: pointer; transition: all .15s; margin-bottom: 5px;
  background: transparent; border: 1px solid rgba(255,255,255,0.03);
}
.model-row:hover { background: rgba(192,132,252,0.08); }
.model-row.active { background: rgba(192,132,252,0.14); border-color: rgba(192,132,252,0.4); }
.model-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.model-text { min-width: 0; }
.model-name { font-size: 13px; font-weight: 600; color: #d9d2ea; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-row.active .model-name { color: #f4eeff; }
.model-tag { font-size: 10.5px; color: #8a80a8; letter-spacing: 0.02em; font-family: 'IBM Plex Mono', monospace; white-space: nowrap; }
.model-count { margin-left: auto; font-size: 12px; color: #9990b6; font-family: 'IBM Plex Mono', monospace; font-weight: 600; }

/* Stats */
.stat-row { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.06); }
.stat { flex: 1; }
.stat-vol { margin-top: 10px; }
.stat-num { font-size: 20px; font-weight: 700; color: #f2ecff; font-family: 'IBM Plex Mono', monospace; }
.stat-num.accent { color: #c084fc; }
.stat-cap { font-size: 10px; color: #8a80a8; letter-spacing: 0.06em; text-transform: uppercase; }

/* Segmented controls */
.seg { display: flex; gap: 6px; background: rgba(0,0,0,0.28); padding: 4px; border-radius: 12px; }
.seg-opt {
  flex: 1 1 0; text-align: center; padding: 7px 4px; border-radius: 9px; font-size: 11.5px;
  cursor: pointer; letter-spacing: 0.03em; font-weight: 600; user-select: none; transition: all .15s ease;
  background: transparent; color: #948ab0; border: 1px solid rgba(255,255,255,0.04);
}
.seg-opt.active { background: rgba(192,132,252,0.16); color: #f1e9ff; border: 1px solid rgba(192,132,252,0.55); }

.range.full { width: 100%; }
.range-note { font-size: 11px; color: #a99fc4; margin-top: 8px; font-family: 'IBM Plex Mono', monospace; }

.region-key { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 12px; }
.region-item { display: flex; align-items: center; gap: 6px; }
.region-dot { width: 9px; height: 9px; border-radius: 50%; }
.region-name { font-size: 10.5px; color: #b0a7cc; font-family: 'IBM Plex Mono', monospace; }

/* Detail card */
.detail-cont { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: #8a80a8; font-family: 'IBM Plex Mono', monospace; }
.detail-name { font-size: 18px; font-weight: 700; margin-top: 3px; line-height: 1.15; }
.detail-status { font-size: 11px; color: #b7addb; margin-top: 5px; }
.detail-none { margin-top: 12px; font-size: 12px; color: #8a80a8; font-style: italic; }
.detail-routes { margin-top: 14px; display: flex; flex-direction: column; gap: 11px; }
.route-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.route-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.route-name { font-size: 12px; color: #e2dbf3; font-weight: 600; }
.route-vol { margin-left: auto; font-size: 11px; color: #b0a7cc; font-family: 'IBM Plex Mono', monospace; }
.route-track { height: 5px; border-radius: 3px; background: rgba(255,255,255,0.07); overflow: hidden; }
.route-bar { height: 100%; border-radius: 3px; }

/* Control bar */
.controlbar {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px;
  background: rgba(17,12,29,0.82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(180,150,240,0.14); box-shadow: 0 18px 50px rgba(0,0,0,0.5); max-width: calc(100vw - 32px);
}
.toggle {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 11px;
  font-size: 12px; font-weight: 600; cursor: pointer; letter-spacing: 0.03em; user-select: none; transition: all .15s;
  background: rgba(255,255,255,0.03); color: #a99fc4; border: 1px solid rgba(255,255,255,0.07);
}
.toggle.active { background: rgba(192,132,252,0.18); color: #f3ecff; border: 1px solid rgba(192,132,252,0.5); }
.toggle-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; display: inline-block; }
.speed { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.speed-cap { font-size: 10px; letter-spacing: 0.1em; color: #8a80a8; text-transform: uppercase; }
.speed-range { width: 80px; }
.speed-val { font-size: 11px; color: #b0a7cc; font-family: 'IBM Plex Mono', monospace; width: 28px; }
.divider { width: 1px; height: 24px; background: rgba(255,255,255,0.1); }
.zoom-btn {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 10px;
  cursor: pointer; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); color: #cdc4e6; font-size: 19px; user-select: none;
}
.reset-btn { padding: 8px 14px; border-radius: 11px; cursor: pointer; font-size: 12px; font-weight: 600; letter-spacing: 0.03em; color: #a99fc4; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); }

/* Live status chip */
.livechip {
  position: absolute; top: 26px; right: 26px; z-index: 30;
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 12px;
  background: rgba(17,12,29,0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(180,150,240,0.13); font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: #a99fc4;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #6b6486; }
.live-dot.on { background: #4ade80; box-shadow: 0 0 10px #4ade80; animation: pulseGlow 2.4s ease-in-out infinite; }
.live-dot.stale { background: #fbbf24; box-shadow: 0 0 10px #fbbf24; }
.live-dot.refreshing { background: #c084fc; box-shadow: 0 0 12px #c084fc; animation: pulseGlow 0.8s ease-in-out infinite; }
.refresh { cursor: pointer; color: #c084fc; text-decoration: underline; text-underline-offset: 2px; }
.refresh:hover { color: #e0c8ff; }
.refresh.busy { opacity: .55; pointer-events: none; }

/* Overlays */
.loading {
  position: absolute; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; background: radial-gradient(circle at 50% 45%, #110c20, #050309);
}
.loading[hidden] { display: none; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(192,132,252,0.25); border-top-color: #c084fc; animation: spin .9s linear infinite; }
.loading-text { font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase; color: #8a80a8; font-family: 'IBM Plex Mono', monospace; }
.errorbox { gap: 10px; }
.err-title { font-size: 16px; font-weight: 700; color: #f0e9ff; }
.err-msg { font-size: 12px; color: #f472b6; font-family: 'IBM Plex Mono', monospace; }
.err-hint { font-size: 12px; color: #948ab0; max-width: 420px; text-align: center; line-height: 1.5; }
.err-hint code { color: #c084fc; background: rgba(192,132,252,0.1); padding: 1px 5px; border-radius: 5px; }

/* Small screens: let panels stack over the globe without overflowing */
@media (max-width: 720px) {
  .headline { max-width: 60vw; }
  .headline-title { font-size: 20px; }
  .panel-left, .panel-right { width: 190px; top: 120px; }
  .panel-left { left: 12px; } .panel-right { right: 12px; }
  .livechip { top: auto; bottom: 74px; right: 12px; }
}

/* Availability detail rows */
.route.flagship { padding: 8px; margin: 0 -8px 2px; border-radius: 12px; background: rgba(192,132,252,0.10); border: 1px solid rgba(192,132,252,0.45); box-shadow: 0 0 18px rgba(192,132,252,0.18); }
.latest-badge { font-family: 'IBM Plex Mono', monospace; font-size: 8.5px; letter-spacing: 0.14em; color: #1a1030; background: linear-gradient(90deg,#e0c8ff,#c084fc); padding: 2px 6px; border-radius: 999px; font-weight: 700; }
.route.muted { opacity: 0.5; }
.route.muted .route-dot { box-shadow: none; filter: grayscale(0.3); }
.route-reason { margin-left: auto; font-size: 10.5px; font-style: italic; color: #8a80a8; font-family: 'IBM Plex Mono', monospace; }
.detail-est { margin-top: 10px; font-size: 9.5px; color: #6f6690; font-family: 'IBM Plex Mono', monospace; line-height: 1.4; }
