:root {
  color-scheme: dark;
  --bg: #060a12;
  --panel: rgba(7, 13, 23, 0.92);
  --panel-strong: rgba(11, 20, 34, 0.96);
  --panel-soft: rgba(17, 30, 47, 0.72);
  --border: #1b3655;
  --border-hi: #2290bd;
  --cyan: #29d4f5;
  --cyan-dim: #1a8aaa;
  --green: #22d97a;
  --red: #f04060;
  --orange: #f08030;
  --amber: #f0c030;
  --purple: #9060f0;
  --blue: #3080f0;
  --text: #c8dde8;
  --text-hi: #eef8ff;
  --text-dim: #6b8da4;
  --muted: #91a9b8;
  --shadow: 0 18px 52px rgba(0, 0, 0, 0.45);
  --radius: 6px;
  --topbar: 54px;
  --statusbar: 42px;
  --sidebar: 318px;
  --detail: 342px;
  --font-mono: "Courier New", Consolas, monospace;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font-sans);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(41, 212, 245, 0.12), transparent 38rem),
    linear-gradient(135deg, #050913 0%, #08121f 46%, #0d1116 100%);
  color: var(--text);
  font-size: 13px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

#loader {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-content: center;
  gap: 14px;
  background: radial-gradient(circle at 50% 46%, rgba(41, 212, 245, 0.12), rgba(6, 10, 18, 0.98) 48%);
  text-align: center;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

body.ready #loader {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loader-logo {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5vw, 4.8rem);
  font-weight: 900;
  letter-spacing: 0.18em;
  text-shadow: 0 0 28px rgba(41, 212, 245, 0.55);
}

.loader-logo span,
#logo span {
  color: var(--red);
}

.loader-sub,
.loader-status {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.loader-track {
  width: min(420px, 78vw);
  height: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.loader-track span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--red));
  animation: loaderSweep 1.25s ease-in-out infinite;
}

@keyframes loaderSweep {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(260%);
  }
}

.map {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #030913;
}

.leaflet-map,
.leaflet-container {
  width: 100%;
  height: 100%;
  background: #030913 !important;
  font: inherit;
}

.leaflet-control-attribution,
.leaflet-control-zoom {
  display: none !important;
}

.leaflet-pane .leaflet-tile {
  filter: brightness(0.58) saturate(0.18) hue-rotate(185deg) contrast(1.18);
}

.leaflet-pane,
.leaflet-top,
.leaflet-bottom {
  z-index: 6;
}

.event-map-icon {
  border: 0;
  background: transparent;
}

.dot-marker {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--marker-size);
  height: var(--marker-size);
  border: 2px solid rgba(238, 248, 255, 0.82);
  border-radius: 50%;
  color: #03111d;
  background: var(--marker-color);
  box-shadow:
    0 0 0 5px color-mix(in srgb, var(--marker-color) 18%, transparent),
    0 0 18px color-mix(in srgb, var(--marker-color) 72%, transparent);
  transform: translateZ(0);
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease,
    border-color 0.14s ease;
}

.dot-marker span {
  font-family: var(--font-mono);
  font-size: clamp(7px, calc(var(--marker-size) / 4), 10px);
  font-weight: 950;
  line-height: 1;
}

.dot-marker:hover,
.dot-marker.selected {
  border-color: #ffffff;
  box-shadow:
    0 0 0 8px color-mix(in srgb, var(--marker-color) 24%, transparent),
    0 0 30px color-mix(in srgb, var(--marker-color) 88%, transparent);
  transform: scale(1.22);
}

.dot-marker.critical::after,
.dot-marker.selected::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid var(--marker-color);
  border-radius: 50%;
  animation: markerPulse 1.8s ease-out infinite;
}

@keyframes markerPulse {
  70% {
    opacity: 0;
    transform: scale(1.65);
  }
  100% {
    opacity: 0;
  }
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  border: 1px solid var(--border-hi);
  color: var(--text);
  background: rgba(7, 13, 23, 0.96);
  box-shadow: var(--shadow);
}

.leaflet-popup-content {
  margin: 11px;
}

.leaflet-popup-close-button {
  color: var(--text-dim) !important;
}

.map-popup {
  display: grid;
  gap: 7px;
  min-width: 230px;
  max-width: 300px;
}

.map-popup-title {
  color: var(--text-hi);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.map-popup-summary {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.38;
}

.map-popup-row {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 8px;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 10px;
}

.map-popup-row .k {
  color: var(--text-dim);
  text-transform: uppercase;
}

.map-popup-row .v {
  color: var(--text);
}

.map-popup a {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
}

.ops-map-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.ops-map-canvas:active {
  cursor: grabbing;
}

#map-grid,
#vignette,
#scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#map-grid {
  z-index: 1;
  background-image:
    linear-gradient(rgba(41, 212, 245, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(41, 212, 245, 0.04) 1px, transparent 1px);
  background-size: 80px 80px;
}

#vignette {
  z-index: 2;
  background: radial-gradient(ellipse 86% 82% at 50% 52%, transparent 36%, rgba(4, 8, 16, 0.74) 100%);
}

#scanlines {
  z-index: 3;
  opacity: 0.28;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0, 0, 0, 0.22) 3px, rgba(0, 0, 0, 0.22) 4px);
}

.bracket {
  position: fixed;
  z-index: 12;
  width: 28px;
  height: 28px;
  pointer-events: none;
}

.bracket::before,
.bracket::after {
  content: "";
  position: absolute;
  background: var(--cyan);
  opacity: 0.58;
}

.bracket::before {
  width: 2px;
  height: 100%;
}

.bracket::after {
  width: 100%;
  height: 2px;
}

.bracket.tl {
  top: 14px;
  left: 14px;
}

.bracket.tr {
  top: 14px;
  right: 14px;
  transform: scaleX(-1);
}

.bracket.bl {
  bottom: 14px;
  left: 14px;
  transform: scaleY(-1);
}

.bracket.br {
  right: 14px;
  bottom: 14px;
  transform: scale(-1);
}

#topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  height: var(--topbar);
  min-width: 0;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(7, 11, 20, 0.98) 0%, rgba(7, 11, 20, 0.82) 100%);
  backdrop-filter: blur(14px);
}

#logo {
  flex: 0 0 auto;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-shadow: 0 0 20px rgba(41, 212, 245, 0.55);
  white-space: nowrap;
}

.nav-pills {
  display: flex;
  gap: 4px;
  min-width: 0;
}

.nav-pill,
.hud-button,
.mini-button,
.ctrl-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  background: rgba(8, 16, 28, 0.72);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    background 0.16s ease;
}

.nav-pill {
  min-width: 58px;
  min-height: 28px;
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.nav-pill:hover,
.nav-pill.active,
.hud-button:hover,
.mini-button:hover,
.ctrl-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(41, 212, 245, 0.12);
}

.top-chips {
  display: flex;
  gap: 6px;
  margin-left: auto;
  min-width: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 29px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-soft);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.chip strong {
  color: var(--text-hi);
  font-size: 12px;
}

.chip span:last-child {
  color: var(--text-dim);
  font-size: 10px;
  text-transform: uppercase;
}

.dot,
.pulse,
.source-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px currentColor;
}

.dot.cyan {
  color: var(--cyan);
}

.dot.red {
  color: var(--red);
  background: var(--red);
}

.dot.green {
  color: var(--green);
  background: var(--green);
}

.hud-button {
  min-height: 32px;
  padding: 0 13px;
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 800;
}

.nav-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

#clock {
  flex: 0 0 auto;
  min-width: 86px;
  font-family: var(--font-mono);
  line-height: 1.3;
  text-align: right;
}

#clock .time {
  color: var(--cyan);
  font-size: 15px;
  font-weight: 900;
}

#clock .date {
  color: var(--text-dim);
  font-size: 10px;
}

.hud-panel {
  position: fixed;
  z-index: 35;
  border-color: var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

#sidebar {
  top: var(--topbar);
  bottom: var(--statusbar);
  left: 0;
  display: flex;
  width: var(--sidebar);
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid var(--border);
  transition: transform 0.24s ease;
}

body.sidebar-collapsed #sidebar {
  transform: translateX(calc(-1 * var(--sidebar)));
}

#sidebarToggle {
  position: fixed;
  top: calc(var(--topbar) + 50%);
  left: var(--sidebar);
  z-index: 44;
  width: 22px;
  height: 64px;
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--cyan);
  background: var(--panel-strong);
  transition: left 0.24s ease;
}

body.sidebar-collapsed #sidebarToggle {
  left: 0;
}

.section {
  border-bottom: 1px solid var(--border);
}

.section.feed-section {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  flex: 1;
}

.section-head,
.detail-top,
.threat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head {
  min-height: 38px;
  padding: 9px 14px;
}

.section-title,
.detail-card-title,
.threat-title {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-meta,
.feed-badge,
.feed-count,
.updated-time {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
}

.section-body {
  display: grid;
  gap: 10px;
  padding: 0 14px 12px;
}

.search-box {
  display: grid;
  gap: 6px;
}

.search-box span,
.select-grid label > span {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.search-box input,
select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-hi);
  background: rgba(255, 255, 255, 0.045);
  outline: 0;
}

.search-box input {
  padding: 0 10px;
}

select {
  padding: 0 8px;
}

.search-box input:focus,
select:focus {
  border-color: var(--cyan-dim);
  box-shadow: 0 0 0 2px rgba(41, 212, 245, 0.08);
}

.select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.category-toggles {
  display: grid;
  gap: 5px;
  max-height: min(34vh, 300px);
  overflow: auto;
  padding-right: 4px;
}

.category-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.category-toggle:hover,
.category-toggle.active {
  border-color: color-mix(in srgb, var(--category-color) 72%, var(--border));
  color: var(--text-hi);
  background: color-mix(in srgb, var(--category-color) 12%, transparent);
}

.category-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--category-color);
  box-shadow: 0 0 9px var(--category-color);
}

.category-toggle span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.mini-button {
  min-height: 24px;
  padding: 0 9px;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
}

.switch-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--text);
  cursor: pointer;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-visual {
  position: relative;
  width: 36px;
  height: 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.switch-visual::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-dim);
  transition:
    left 0.16s ease,
    background 0.16s ease;
}

.switch-row input:checked + .switch-visual {
  border-color: var(--cyan);
  background: rgba(41, 212, 245, 0.22);
}

.switch-row input:checked + .switch-visual::after {
  left: 20px;
  background: var(--cyan);
}

.switch-row strong {
  display: block;
  font-size: 12px;
}

.switch-row small {
  display: block;
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 10px;
}

.button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.secondary-button {
  min-width: 0;
  padding: 0 8px;
  color: var(--text-dim);
  font-size: 11px;
}

.event-list {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 0;
  overflow: auto;
  padding: 0 10px 12px 14px;
}

.event-card {
  display: grid;
  gap: 7px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid var(--category-color);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  text-align: left;
}

.event-card:hover,
.event-card.selected {
  border-color: color-mix(in srgb, var(--category-color) 76%, var(--border));
  background: color-mix(in srgb, var(--category-color) 14%, rgba(255, 255, 255, 0.05));
  transform: translateY(-1px);
}

.event-card h3 {
  margin: 0;
  color: var(--text-hi);
  font-size: 12px;
  line-height: 1.35;
}

.event-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.42;
}

.badge-row,
.event-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.event-meta {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
}

.severity-badge,
.category-badge,
.source-badge,
.legend-chip,
.feed-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
  white-space: nowrap;
}

.severity-badge {
  border-color: transparent;
  color: #07101a;
  background: var(--severity-color);
}

.category-badge {
  color: var(--category-color);
  background: color-mix(in srgb, var(--category-color) 12%, transparent);
  border-color: color-mix(in srgb, var(--category-color) 50%, var(--border));
}

.source-badge {
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.035);
}

.feed-badge.live {
  color: var(--green);
  border-color: rgba(34, 217, 122, 0.4);
}

#detail-panel {
  top: var(--topbar);
  right: 0;
  bottom: var(--statusbar);
  display: flex;
  width: var(--detail);
  min-width: 0;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding: 12px;
  border-left: 1px solid var(--border);
}

.detail-top {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.detail-top h1 {
  margin: 4px 0 0;
  color: var(--text-hi);
  font-size: 17px;
  line-height: 1.2;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.pulse {
  display: inline-block;
  background: var(--amber);
  animation: pulse 1.7s infinite;
}

.status-pill.online .pulse {
  background: var(--green);
}

.status-pill.warning .pulse {
  background: var(--amber);
}

.status-pill.error .pulse {
  background: var(--red);
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 9px rgba(41, 212, 245, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(41, 212, 245, 0);
  }
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-card {
  display: grid;
  place-items: center;
  min-height: 66px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  text-align: center;
}

button.stat-card:hover {
  border-color: var(--cyan);
  background: rgba(41, 212, 245, 0.1);
}

.stat-card strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 19px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-card #updatedTime {
  font-size: 12px;
  line-height: 1.25;
  white-space: normal;
}

.stat-card span {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.threat-block,
.detail-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.threat-pct {
  color: var(--amber);
  font-family: var(--font-mono);
  font-weight: 900;
}

.threat-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.threat-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--amber), var(--red));
  box-shadow: 0 0 16px rgba(240, 192, 48, 0.45);
  transition: width 0.26s ease;
}

.threat-ticks {
  display: flex;
  justify-content: space-between;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 9px;
}

.overview-text,
.watchlist,
.hotspot-list,
.source-health {
  display: grid;
  gap: 7px;
}

.overview-line,
.watch-item,
.hotspot-item,
.source-item,
.selected-event {
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.16);
  font-size: 11px;
  line-height: 1.45;
}

.watch-item {
  border-left: 3px solid var(--category-color);
}

.watch-item button {
  padding: 0;
  border: 0;
  color: var(--text-hi);
  background: transparent;
  text-align: left;
  font-weight: 800;
  line-height: 1.35;
}

.watch-item small,
.hotspot-item small,
.source-item small {
  color: var(--text-dim);
}

.hotspot-item strong,
.source-item strong,
.selected-event h4 {
  color: var(--text-hi);
}

.source-item {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.source-light {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px rgba(240, 64, 96, 0.7);
}

.source-light.ok {
  background: var(--green);
  box-shadow: 0 0 12px rgba(34, 217, 122, 0.7);
}

.selected-event h4,
.selected-event p {
  margin: 0;
}

.selected-event a {
  color: var(--cyan);
  font-weight: 800;
  text-decoration: none;
}

.empty-state {
  color: var(--text-dim);
  font-size: 11px;
}

.map-legend {
  position: fixed;
  right: calc(var(--detail) + 12px);
  bottom: calc(var(--statusbar) + 50px);
  left: calc(var(--sidebar) + 34px);
  z-index: 24;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}

.legend-chip {
  color: var(--text);
  background: rgba(7, 13, 23, 0.84);
}

#map-controls {
  position: fixed;
  right: calc(var(--detail) + 14px);
  top: calc(var(--topbar) + 14px);
  z-index: 30;
  display: grid;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(7, 13, 23, 0.82);
  backdrop-filter: blur(12px);
}

.ctrl-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  color: var(--text-hi);
  font-family: var(--font-mono);
  font-weight: 900;
}

.ctrl-btn.wide {
  width: 38px;
  border-radius: 999px;
  font-size: 10px;
}

.ctrl-sep {
  display: block;
  width: 22px;
  height: 1px;
  margin: 2px auto;
  background: var(--border);
}

#coord-bar {
  position: fixed;
  bottom: calc(var(--statusbar) + 10px);
  left: 50%;
  z-index: 28;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  background: rgba(7, 13, 23, 0.86);
  font-family: var(--font-mono);
  font-size: 11px;
  transform: translateX(-50%);
  pointer-events: none;
}

#statusbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 52;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  height: var(--statusbar);
  min-width: 0;
  gap: 14px;
  padding: 0 14px;
  border-top: 1px solid var(--border);
  background: rgba(7, 11, 20, 0.96);
  backdrop-filter: blur(14px);
}

.live-badge {
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.live-badge span {
  color: var(--text-dim);
  font-weight: 400;
}

.ticker-wrap {
  min-width: 0;
  overflow: hidden;
}

.ticker-inner {
  display: inline-flex;
  gap: 36px;
  min-width: 100%;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
  animation: ticker 34s linear infinite;
}

@keyframes ticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.status-dots {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
}

.source-dot {
  display: inline-block;
  background: var(--red);
}

.source-dot.ok {
  background: var(--green);
}

.ops-map-tooltip {
  position: absolute;
  z-index: 620;
  display: grid;
  gap: 4px;
  width: min(270px, calc(100% - 28px));
  padding: 10px 11px;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(7, 13, 23, 0.95);
  box-shadow: var(--shadow);
  pointer-events: none;
}

.ops-map-tooltip strong {
  color: var(--text-hi);
  font-size: 12px;
  line-height: 1.25;
}

.ops-map-tooltip span {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.ops-map-tooltip small {
  color: var(--text-dim);
  font-size: 10px;
}

.map-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 650;
  max-width: 260px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  background: rgba(7, 13, 23, 0.88);
  text-align: center;
  transform: translate(-50%, -50%);
}

.toast {
  position: fixed;
  right: calc(var(--detail) + 18px);
  bottom: calc(var(--statusbar) + 18px);
  z-index: 1100;
  max-width: 360px;
  padding: 11px 13px;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  color: var(--text-hi);
  background: rgba(7, 13, 23, 0.96);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

body.loading #refreshBtn {
  opacity: 0.62;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 99px;
  background: #264763;
  background-clip: content-box;
}

@media (max-width: 1220px) {
  :root {
    --sidebar: 292px;
    --detail: 308px;
  }

  .top-chips .chip span:last-child {
    display: none;
  }

  #logo {
    font-size: 15px;
  }

  .nav-pill {
    min-width: 46px;
    padding: 0 8px;
  }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  #topbar {
    position: sticky;
    flex-wrap: wrap;
    height: auto;
    min-height: var(--topbar);
    padding: 9px 10px;
  }

  .map {
    position: fixed;
    min-height: 100vh;
  }

  #sidebar,
  #detail-panel {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    z-index: 40;
    width: calc(100% - 20px);
    margin: 10px;
    border: 1px solid var(--border);
  }

  #sidebar {
    margin-top: 74vh;
  }

  #sidebarToggle,
  #map-controls,
  #coord-bar {
    display: none;
  }

  .map-legend {
    right: 10px;
    bottom: calc(var(--statusbar) + 10px);
    left: 10px;
  }

  #statusbar {
    grid-template-columns: auto 1fr;
  }

  .status-dots {
    display: none;
  }
}

@media (max-width: 640px) {
  .top-chips {
    width: 100%;
    margin-left: 0;
  }

  .chip {
    flex: 1;
    justify-content: center;
  }

  #clock {
    display: none;
  }

  .select-grid,
  .button-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  #statusbar {
    grid-template-columns: 1fr;
    justify-items: center;
    height: auto;
    min-height: var(--statusbar);
    padding: 8px 10px;
  }

  .ticker-wrap {
    width: 100%;
  }
}
