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

body {
  background: #0d1117;
  color: #ffffff;
  font-family: 'SF Mono', 'Fira Code', monospace, sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Top bar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 48px;
  background: #161b22;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
  z-index: 1000;
}

.site-name {
  font-size: 14px;
  font-weight: bold;
  color: #00e676;
  letter-spacing: 0.5px;
}

.status-pill {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #8b949e;
  transition: background 0.3s, color 0.3s;
}

.status-pill.live {
  background: rgba(0, 230, 118, 0.12);
  color: #00e676;
}

/* ── Layout ── */
.main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.map-wrap {
  flex: 1;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
}

/* ── Legend (overlaid) ── */
.legend {
  position: absolute;
  bottom: 28px;
  left: 12px;
  z-index: 1000;
  background: rgba(13, 17, 23, 0.88);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  pointer-events: none;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.legend-item:last-child {
  margin-bottom: 0;
}

/* ── Status dots ── */
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-critical {
  background: #ef5350;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.dot-injured {
  background: #ffd600;
}

.dot-ok {
  background: #00e676;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 83, 80, 0.7); }
  50%       { box-shadow: 0 0 0 5px rgba(239, 83, 80, 0); }
}

/* ── Sidebar ── */
.sidebar {
  width: 280px;
  background: #161b22;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-header {
  padding: 12px 16px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #8b949e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.survivor-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

.survivor-list li {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  font-size: 13px;
  gap: 10px;
  border-left: 3px solid transparent;
}

.survivor-list li:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.survivor-list li.critical {
  border-left-color: rgba(239, 83, 80, 0.45);
}

.survivor-list .name {
  flex: 1;
}

.survivor-list .status-label {
  font-size: 11px;
  color: #8b949e;
  text-transform: capitalize;
}

.empty-state {
  color: #8b949e !important;
  font-size: 13px !important;
  padding: 24px 16px !important;
  border-left: none !important;
  background: none !important;
}

/* ── Map marker icons ── */
.marker-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-dot {
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  position: relative;
  z-index: 1;
}

.marker-pulse {
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
  animation: pulse-ring 1.5s ease-out infinite;
}

@keyframes pulse-ring {
  0%   { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .main {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: 200px;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }
}
