/* ============================================================
   GLOBAL MILITARY TRACKER — Dark Military Theme
   ============================================================ */

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

:root {
  --bg-primary:    #0a0a0f;
  --bg-secondary:  #0d1117;
  --bg-panel:      rgba(13, 17, 23, 0.92);
  --bg-panel-alt:  rgba(10, 10, 20, 0.88);
  --accent-red:    #ff4444;
  --accent-orange: #ff8800;
  --accent-gold:   #ffd700;
  --accent-green:  #00ff41;
  --accent-blue:   #00aaff;
  --text-primary:  #e0e0e0;
  --text-dim:      #7a8a9a;
  --text-bright:   #ffffff;
  --border-red:    rgba(255, 68, 68, 0.35);
  --border-dim:    rgba(255, 136, 0, 0.2);
  --font-mono:     'Courier New', 'Lucida Console', monospace;
  --font-ui:       'Courier New', monospace;
}

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-mono);
  overflow: hidden;
}

/* ============================================================
   MAP CONTAINER
   ============================================================ */

#map {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: #0a0a0a;
}

.leaflet-container {
  background: #0a0a0a;
}

/* ============================================================
   TOP NAVIGATION BAR
   ============================================================ */

#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-red);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Title + doomsday grouped together, pushed in from left edge */
#brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 8px;
  flex-shrink: 0;
}

#app-title {
  font-size: 1.47rem;
  font-weight: bold;
  color: var(--accent-red);
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(255, 68, 68, 0.7);
  white-space: nowrap;
  flex-shrink: 0;
}

#app-title span {
  color: var(--accent-orange);
}

/* ── Doomsday Clock ─────────────────────────────────────── */
#doomsday-clock {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  padding: 4px 10px;
  margin-left: 20px;
  border: 1px solid rgba(180, 0, 0, 0.45);
  border-radius: 2px;
  background: rgba(80, 0, 0, 0.3);
  flex-shrink: 0;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
  animation: doom-pulse 4s ease-in-out infinite;
}
#doomsday-clock:hover {
  background: rgba(120, 0, 0, 0.45);
  border-color: rgba(255, 40, 40, 0.7);
}
.doom-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.doom-time {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: bold;
  color: #ff3322;
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(255,50,30,0.9);
}
.doom-label {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  color: #cc4433;
  letter-spacing: 0.1em;
  line-height: 1.1;
}
@keyframes doom-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(180,0,0,0); }
  50%       { box-shadow: 0 0 8px 2px rgba(180,0,0,0.3); }
}

.divider {
  width: 1px;
  height: 32px;
  background: var(--border-red);
  flex-shrink: 0;
}

/* ============================================================
   RIGHT LAYERS PANEL
   ============================================================ */

#layers-panel {
  position: fixed;
  top: 54px;
  right: 0;
  width: 148px;
  bottom: 32px;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-red);
  z-index: 998;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 8px;
  overflow-y: auto;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.3s ease;
}

#layers-panel.collapsed {
  transform: translateX(148px);
}

#layers-panel::-webkit-scrollbar { width: 3px; }
#layers-panel::-webkit-scrollbar-thumb { background: var(--border-red); }

.layers-panel-title {
  font-size: 0.6rem;
  color: var(--accent-orange);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-dim);
  padding-bottom: 5px;
  flex-shrink: 0;
}

.layers-group-label {
  font-size: 0.52rem;
  color: var(--text-dim);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 6px;
  margin-bottom: 2px;
  flex-shrink: 0;
}

.layers-group-label.collapsible {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
}

.layers-group-label.collapsible:hover {
  color: var(--accent-orange);
}

.group-chevron {
  font-size: 0.45rem;
  transition: transform 0.2s ease;
}

.layers-group-label.collapsible.collapsed .group-chevron {
  transform: rotate(-90deg);
}

.layer-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.layer-group-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 3px;
}

.layer-group-content.collapsed {
  display: none;
}

#layers-panel .layer-btn,
#layers-panel #satellite-btn,
#layers-panel #btn-china-sat {
  width: 100%;
  text-align: left;
  padding: 5px 8px;
  font-size: 0.65rem;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#layers-panel-toggle {
  position: fixed;
  top: 64px;
  right: 148px;
  width: 22px;
  height: 50px;
  background: var(--bg-panel);
  border: 1px solid var(--border-red);
  border-right: none;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.7rem;
  transition: all 0.3s ease;
}
#layers-panel-toggle:hover { color: var(--accent-orange); }
#layers-panel-toggle.collapsed { right: 0; }

.layer-btn {
  padding: 5px 12px;
  border: 1px solid var(--border-red);
  background: rgba(255, 68, 68, 0.08);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

.layer-btn:hover {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
  background: rgba(255, 136, 0, 0.12);
}

.layer-btn.active {
  border-color: var(--accent-green);
  color: var(--accent-green);
  background: rgba(0, 255, 65, 0.1);
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.25);
}

.layer-btn.active-red {
  border-color: var(--accent-red);
  color: var(--accent-red);
  background: rgba(255, 68, 68, 0.12);
  box-shadow: 0 0 8px rgba(255, 68, 68, 0.3);
}

.layer-btn.active-gold {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background: rgba(255, 215, 0, 0.1);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.25);
}

/* ─── Search Bar ─────────────────────────────────────────── */

#search-container {
  position: relative;
  flex: 1;
  max-width: 320px;
  min-width: 140px;
}

#search-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 68, 68, 0.35);
  border-radius: 2px;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#search-input::placeholder {
  color: #555;
  letter-spacing: 0.04em;
}

#search-input:focus {
  border-color: rgba(255, 68, 68, 0.75);
  box-shadow: 0 0 6px rgba(255, 68, 68, 0.25);
}

#search-results {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: rgba(8, 10, 14, 0.97);
  border: 1px solid rgba(255, 68, 68, 0.35);
  border-radius: 2px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7);
  z-index: 2000;
  max-height: 340px;
  overflow-y: auto;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.1s;
}

.search-result:last-child { border-bottom: none; }

.search-result:hover,
.search-result.active {
  background: rgba(255, 68, 68, 0.1);
}

.search-badge {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: bold;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 2px;
  flex-shrink: 0;
  line-height: 1.6;
}

.search-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.search-label mark {
  background: rgba(255, 200, 0, 0.3);
  color: #ffd700;
  border-radius: 1px;
}

.search-sublabel {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  flex-shrink: 0;
}

.search-no-results {
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: #555;
  letter-spacing: 0.1em;
}

/* Right side of topbar */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  margin-left: auto;
}

#utc-clock {
  font-size: 0.75rem;
  color: var(--accent-green);
  letter-spacing: 2px;
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.5);
  white-space: nowrap;
}

#conn-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 1px;
}

#conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
  animation: pulse-green 2s infinite;
}

#conn-dot.offline {
  background: var(--accent-red);
  box-shadow: 0 0 6px var(--accent-red);
  animation: pulse-red 2s infinite;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes pulse-red {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ============================================================
   LEFT SIDE PANEL
   ============================================================ */

#side-panel {
  position: fixed;
  top: 54px;
  left: 0;
  width: 300px;
  bottom: 32px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-red);
  z-index: 999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.3s ease;
}

#side-panel.collapsed {
  transform: translateX(-300px);
}

#panel-toggle {
  position: fixed;
  top: 54px;
  left: 300px;
  width: 22px;
  height: 60px;
  background: var(--bg-panel);
  border: 1px solid var(--border-red);
  border-left: none;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.7rem;
  transition: all 0.3s ease;
}

#panel-toggle:hover { color: var(--accent-orange); }

#panel-toggle.collapsed { left: 0; }

/* ─── Panel resize handles ───────────────────────────────── */

.panel-resize-handle {
  height: 12px;
  background: transparent;
  border-top: 1px solid var(--border-dim);
  cursor: ns-resize;
  flex-shrink: 0;
  position: relative;
  transition: background 0.15s;
  z-index: 10;
}

.panel-resize-handle::after {
  content: '⠿';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-dim);
  font-size: 0.55rem;
  letter-spacing: 2px;
  transition: color 0.15s;
  pointer-events: none;
  user-select: none;
}

.panel-resize-handle:hover {
  background: rgba(255, 68, 68, 0.1);
}

.panel-resize-handle:hover::after {
  color: var(--accent-red);
}

/* Stats section */
.panel-section {
  border-bottom: 1px solid var(--border-dim);
  padding: 12px 14px;
  flex-shrink: 0;
}

.panel-section-title {
  font-size: 0.65rem;
  letter-spacing: 2px;
  color: var(--accent-orange);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.72rem;
}

.stat-label { color: var(--text-dim); }

.stat-value {
  color: var(--accent-green);
  font-weight: bold;
  text-shadow: 0 0 4px rgba(0, 255, 65, 0.4);
}

.stat-value.red { color: var(--accent-red); text-shadow: 0 0 4px rgba(255,68,68,0.4); }
.stat-value.gold { color: var(--accent-gold); text-shadow: 0 0 4px rgba(255,215,0,0.4); }
.stat-value.blue { color: var(--accent-blue); text-shadow: 0 0 4px rgba(0,170,255,0.4); }
.stat-value.orange { color: var(--accent-orange); text-shadow: 0 0 4px rgba(255,136,0,0.4); }

@keyframes stat-pulse {
  0%, 100% { opacity: 0.2; }
  50%       { opacity: 0.5; }
}

.stat-loading {
  display: inline-block;
  width: 22px;
  height: 8px;
  background: var(--text-dim);
  border-radius: 2px;
  animation: stat-pulse 1.4s ease-in-out infinite;
  vertical-align: middle;
}

/* Detail pane */
#detail-pane {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
}

#detail-close {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 4px 8px;
  background: transparent;
  border: 1px solid var(--border-dim);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-align: left;
}
#detail-close:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

#detail-pane::-webkit-scrollbar { width: 4px; }
#detail-pane::-webkit-scrollbar-track { background: transparent; }
#detail-pane::-webkit-scrollbar-thumb { background: var(--border-red); border-radius: 2px; }

.detail-placeholder {
  color: var(--text-dim);
  font-size: 0.68rem;
  line-height: 1.6;
  text-align: center;
  padding-top: 30px;
  letter-spacing: 1px;
}

#detail-content {
  font-size: 0.72rem;
  line-height: 1.7;
}

.detail-header {
  font-size: 0.85rem;
  color: var(--text-bright);
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-red);
  padding-bottom: 6px;
}

.detail-field {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.detail-key {
  color: var(--text-dim);
  min-width: 100px;
  flex-shrink: 0;
}

.detail-val { color: var(--text-primary); }
.detail-val.highlight { color: var(--accent-green); }
.detail-val.warn { color: var(--accent-red); }
.detail-val.gold { color: var(--accent-gold); }

/* VIP list */
#vip-list-section {
  border-top: 1px solid var(--border-dim);
  padding: 12px 14px;
  overflow-y: auto;
}

#vip-list-section::-webkit-scrollbar { width: 4px; }
#vip-list-section::-webkit-scrollbar-thumb { background: var(--border-red); border-radius: 2px; }

.vip-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,215,0,0.1);
  font-size: 0.68rem;
  cursor: pointer;
  transition: background 0.15s;
}

.vip-item:hover { background: rgba(255,215,0,0.05); }

.vip-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
}

.vip-status-dot.airborne {
  background: var(--accent-green);
  box-shadow: 0 0 4px var(--accent-green);
  animation: pulse-green 2s infinite;
}

.vip-status-dot.ground { background: var(--text-dim); }

.vip-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vip-name {
  color: var(--accent-gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vip-meta {
  font-size: 0.58rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vip-alt {
  color: var(--text-dim);
  white-space: nowrap;
  font-size: 0.62rem;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ============================================================
   BOTTOM STATUS BAR
   ============================================================ */

#mini-legend {
  position: absolute;
  bottom: 32px;
  left: 0;
  right: 0;
  height: 22px;
  background: rgba(5, 5, 12, 0.75);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 996;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 14px;
  font-size: 0.52rem;
  color: var(--text-dim);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
  overflow: hidden;
  pointer-events: none;
}

.ml-item {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ml-plane { font-size: 0.7rem; line-height: 1; }

.ml-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.ml-sep {
  width: 1px;
  height: 10px;
  background: rgba(255,255,255,0.1);
  margin: 0 10px;
  flex-shrink: 0;
}

#status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-dim);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 20px;
  font-size: 0.63rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  backdrop-filter: blur(8px);
}

.status-item {
  display: flex;
  gap: 6px;
  align-items: center;
}

.status-key { color: var(--text-dim); }
.status-val { color: var(--text-primary); }

#refresh-bar-container {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

#refresh-progress {
  width: 80px;
  height: 3px;
  background: rgba(255,68,68,0.15);
  border-radius: 2px;
  overflow: hidden;
}

#refresh-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-orange);
  transition: width 0.5s linear;
}

/* ============================================================
   LEGEND PANEL
   ============================================================ */

#legend {
  position: absolute;
  bottom: 42px;
  right: 162px;
  background: var(--bg-panel);
  border: 1px solid var(--border-red);
  padding: 8px 12px;
  z-index: 997;
  font-size: 0.65rem;
  min-width: 160px;
  backdrop-filter: blur(8px);
  cursor: pointer;
  user-select: none;
}

#legend-items {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

#legend.open #legend-items {
  max-height: 400px;
}

.legend-title {
  color: var(--accent-orange);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.62rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.legend-title::after {
  content: '▼';
  font-size: 0.5rem;
  transition: transform 0.3s ease;
  margin-left: 8px;
}

#legend.open .legend-title::after {
  transform: rotate(180deg);
}

.legend-divider {
  border: none;
  border-top: 1px solid var(--border-dim);
  margin: 5px 0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--text-dim);
}

.legend-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   NUCLEAR PULSE ANIMATION
   ============================================================ */

.nuclear-pulse {
  border-radius: 50%;
  animation: nuclearPulse 2s infinite;
  cursor: pointer;
}

@keyframes nuclearPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7),
                0 0 0 0 rgba(255, 68, 68, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 68, 68, 0.0),
                0 0 0 16px rgba(255, 68, 68, 0.0);
    transform: scale(1.1);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7),
                0 0 0 0 rgba(255, 68, 68, 0.4);
    transform: scale(1);
  }
}

/* ============================================================
   LEAFLET OVERRIDES
   ============================================================ */

.leaflet-popup-content-wrapper {
  background: var(--bg-panel) !important;
  border: 1px solid var(--border-red) !important;
  border-radius: 2px !important;
  color: var(--text-primary) !important;
  font-family: var(--font-mono) !important;
  font-size: 0.72rem !important;
  box-shadow: 0 0 20px rgba(255, 68, 68, 0.2) !important;
  backdrop-filter: blur(8px);
  max-width: 300px;
}

.leaflet-popup-tip {
  background: var(--bg-panel) !important;
}

.leaflet-popup-close-button {
  color: var(--accent-red) !important;
  font-size: 1rem !important;
}

.leaflet-popup-close-button:hover {
  color: var(--accent-orange) !important;
}

.popup-title {
  font-size: 0.85rem;
  color: var(--text-bright);
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-red);
  padding-bottom: 5px;
  font-weight: bold;
}

.popup-row {
  display: flex;
  gap: 8px;
  margin-bottom: 3px;
}

.popup-key { color: var(--text-dim); min-width: 80px; }
.popup-val { color: var(--text-primary); }
.popup-val.green { color: var(--accent-green); }
.popup-val.red { color: var(--accent-red); }
.popup-val.gold { color: var(--accent-gold); }
.popup-val.orange { color: var(--accent-orange); }

.popup-warning {
  margin-top: 8px;
  padding: 4px 6px;
  background: rgba(255, 68, 68, 0.12);
  border-left: 2px solid var(--accent-red);
  font-size: 0.65rem;
  color: var(--accent-red);
  letter-spacing: 0.5px;
}

.popup-source {
  margin-top: 6px;
  font-size: 0.6rem;
  color: var(--text-dim);
  font-style: italic;
}

/* Leaflet control overrides */
.leaflet-control-zoom a,
.leaflet-control-layers-toggle {
  background-color: var(--bg-panel) !important;
  border-color: var(--border-red) !important;
  color: var(--text-primary) !important;
}

.leaflet-control-zoom a:hover {
  background-color: rgba(255, 68, 68, 0.15) !important;
  color: var(--accent-red) !important;
}

.leaflet-control-layers {
  background: var(--bg-panel) !important;
  border: 1px solid var(--border-red) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-mono) !important;
  font-size: 0.7rem !important;
}

.leaflet-control-attribution {
  background: rgba(13,17,23,0.7) !important;
  color: var(--text-dim) !important;
  font-size: 0.55rem !important;
}

.leaflet-control-attribution a {
  color: var(--accent-orange) !important;
}

/* Dark tile filter applied via JS, but also available as class */
.dark-tiles {
  filter: brightness(0.6) invert(1) contrast(3) hue-rotate(200deg) saturate(0.3) brightness(0.7);
}

/* ============================================================
   AIRCRAFT ICON STYLES
   ============================================================ */

.aircraft-icon {
  background: transparent !important;
  border: none !important;
}

.aircraft-label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--text-primary);
  text-align: center;
  white-space: nowrap;
  margin-top: 1px;
  text-shadow: 1px 1px 2px #000, -1px -1px 2px #000;
}

/* ============================================================
   SHIP ICON STYLES
   ============================================================ */

.ship-icon-container {
  background: transparent !important;
  border: none !important;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ============================================================
   SETUP NOTICE
   ============================================================ */

#setup-notice {
  position: absolute;
  top: 64px;
  right: 170px; /* clear of layers panel */
  background: var(--bg-panel);
  border: 1px solid var(--accent-orange);
  padding: 10px 14px;
  z-index: 1001;
  font-size: 0.68rem;
  max-width: 280px;
  display: none;
}

#setup-notice.show { display: block; }

.notice-title {
  color: var(--accent-orange);
  font-size: 0.72rem;
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.notice-text {
  color: var(--text-dim);
  line-height: 1.6;
}

.notice-text a {
  color: var(--accent-blue);
  text-decoration: none;
}

.notice-close {
  float: right;
  cursor: pointer;
  color: var(--accent-red);
  font-size: 0.8rem;
  margin-left: 8px;
}

/* ============================================================
   SATELLITE TOGGLE
   ============================================================ */

#satellite-btn {
  padding: 5px 10px;
  border: 1px solid var(--border-dim);
  background: rgba(0,170,255,0.08);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 1px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.2s;
  white-space: nowrap;
}

#satellite-btn:hover,
#satellite-btn.active {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: rgba(0,170,255,0.12);
}

#btn-china-sat {
  padding: 5px 10px;
  border: 1px solid rgba(255,68,68,0.3);
  background: rgba(220,20,20,0.08);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.2s;
  white-space: nowrap;
}

#btn-china-sat:hover,
#btn-china-sat.active-red {
  border-color: var(--accent-red);
  color: var(--accent-red);
  background: rgba(220,20,20,0.15);
}

/* ============================================================
   SCROLLBAR GLOBAL
   ============================================================ */

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,68,68,0.3) transparent;
}

/* ============================================================
   LANDING OVERLAY
   ============================================================ */

#landing-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(5, 5, 12, 0.82);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

/* Scanline texture over the blurred map */
#landing-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 255, 65, 0.018) 3px,
    rgba(0, 255, 65, 0.018) 4px
  );
  pointer-events: none;
  z-index: 0;
}

#landing-panel { position: relative; z-index: 1; }
#landing-overlay.show { display: flex; }

#landing-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 480px;
  width: 90vw;
  padding: 36px 32px;
  background: rgba(13, 17, 23, 0.97);
  border: 1px solid rgba(255, 68, 68, 0.4);
  box-shadow: 0 0 60px rgba(255, 68, 68, 0.15), 0 0 120px rgba(255, 68, 68, 0.05);
  text-align: center;
}

.landing-logo {
  font-size: 2.6rem;
  font-weight: bold;
  color: var(--accent-red);
  letter-spacing: 8px;
  text-shadow: 0 0 30px rgba(255, 68, 68, 0.8);
}
.landing-logo span { color: var(--accent-orange); }

.landing-tagline {
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.landing-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,68,68,0.4), transparent);
}

.landing-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  text-align: left;
}

.landing-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.72rem;
  color: var(--text-primary);
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.lf-icon {
  font-size: 1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.landing-disclaimer {
  font-size: 0.58rem;
  color: #444;
  letter-spacing: 0.5px;
  line-height: 1.5;
  border-top: 1px solid #1a1a2a;
  padding-top: 10px;
  width: 100%;
}

#landing-enter {
  padding: 10px 32px;
  background: rgba(255, 68, 68, 0.12);
  border: 1px solid rgba(255, 68, 68, 0.6);
  color: var(--accent-red);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.2s;
  margin-top: 6px;
}
#landing-enter:hover {
  background: rgba(255, 68, 68, 0.25);
  border-color: var(--accent-red);
  color: #fff;
  box-shadow: 0 0 20px rgba(255, 68, 68, 0.3);
}

/* ============================================================
   RESPONSIVE — TABLET (768px)
   ============================================================ */

/* Mobile overlay — tap-to-close side panel */
#mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 998;
  cursor: pointer;
}
#mobile-overlay.active { display: block; }

@media (max-width: 768px) {
  /* Topbar */
  #topbar { padding: 0 10px; gap: 8px; }
  #app-title { font-size: 1.1rem; letter-spacing: 2px; }
  #doomsday-clock { display: none; }
  #feed-toggle { font-size: 0.6rem; padding: 4px 8px; }

  /* Search bar — shrink on tablet */
  #search-container { max-width: 200px; min-width: 100px; }
  #search-input { font-size: 0.6rem; padding: 4px 8px; }

  /* Side panel — collapsed by default */
  #side-panel { width: 260px; transform: translateX(-260px); }
  #side-panel.collapsed { transform: translateX(-260px); }
  #side-panel.open { transform: translateX(0); }
  #panel-toggle { left: 0; width: 28px; height: 70px; }
  #panel-toggle.collapsed { left: 0; }

  /* Layers panel — collapsed by default on mobile (JS handles initial state) */
  #layers-panel { width: 130px; }
  #layers-panel.collapsed { transform: translateX(130px); }
  #layers-panel-toggle { right: 130px; width: 28px; height: 70px; }
  #layers-panel-toggle.collapsed { right: 0; }

  /* Layer buttons — bigger touch targets */
  #layers-panel .layer-btn,
  #layers-panel #satellite-btn { padding: 8px 8px; }

  /* Status bar — simplify */
  #status-bar .status-item:nth-child(3) { display: none; }

  /* News feed — full width */
  #feed-panel { width: 100vw; right: -100vw; }
  #feed-panel.open { right: 0; }

  /* Legend */
  #legend { right: 144px; }
}

/* ============================================================
   RESPONSIVE — MOBILE (480px)
   ============================================================ */

@media (max-width: 480px) {
  /* Topbar */
  #topbar { padding: 0 8px; gap: 6px; height: 48px; }
  #topbar { padding: 0 6px; gap: 4px; height: 48px; }
  #app-title { font-size: 0.85rem; letter-spacing: 1px; }
  #brand-block { padding-left: 4px; gap: 6px; }
  #utc-clock { display: none; }
  #conn-label { display: none; }
  #feed-toggle { display: none; }
  /* Push button — icon only on small screens */
  #push-btn { font-size: 0.6rem; padding: 3px 5px; }
  #push-status { display: none; }

  /* Search bar — compact on mobile */
  #search-container { max-width: 130px; min-width: 70px; }
  #search-input { font-size: 0.58rem; padding: 4px 6px; }
  #search-results { max-height: 240px; }

  /* Side panel full-width, sits above overlay */
  #side-panel { width: 100vw; z-index: 999; top: 48px; bottom: 24px; }
  #side-panel.open { transform: translateX(0); }
  #panel-toggle { width: 32px; height: 80px; top: 48px; }

  /* Layers panel */
  #layers-panel { top: 48px; width: 120px; }
  #layers-panel-toggle { top: 58px; right: 120px; width: 32px; height: 80px; }
  #layers-panel-toggle.collapsed { right: 0; }

  /* Layer buttons — comfortable touch targets */
  #layers-panel .layer-btn,
  #layers-panel #satellite-btn { padding: 10px 8px; font-size: 0.6rem; }

  /* Status bar — minimal: hide all items, keep only refresh bar */
  #status-bar { font-size: 0.55rem; gap: 8px; padding: 0 8px; }
  #status-bar .status-item { display: none; }

  /* Legend — hide on mobile */
  #legend { display: none; }
  #mini-legend { display: none; }

  /* Help modal */
  #help-panel { width: 98vw; max-height: 92vh; }

  /* Landing page */
  #landing-panel { padding: 24px 18px; gap: 10px; }
  .landing-logo { font-size: 1.8rem; letter-spacing: 5px; }
  .landing-feature { font-size: 0.65rem; }
  #landing-enter { font-size: 0.7rem; padding: 8px 24px; }
}

/* ============================================================
   BUTTON STATE VARIANTS
   ============================================================ */

.layer-btn.active-orange {
  border-color: #ff6600;
  color: #ff6600;
  background: rgba(255,102,0,0.12);
  box-shadow: 0 0 8px rgba(255,102,0,0.25);
}

.layer-btn.active-green {
  border-color: var(--accent-green);
  color: var(--accent-green);
  background: rgba(0,255,65,0.08);
  box-shadow: 0 0 8px rgba(0,255,65,0.2);
}

/* ============================================================
   WARZONE STYLES
   ============================================================ */

.wz-popup {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-primary);
  min-width: 280px;
}

.wz-title {
  font-size: 0.88rem;
  font-weight: bold;
  color: #fff;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255,68,68,0.4);
  padding-bottom: 5px;
}

.wz-intensity {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.6rem;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  border-radius: 2px;
}
.wz-intensity.extreme { background: rgba(255,0,0,0.3); color: #ff4444; border: 1px solid #ff4444; }
.wz-intensity.high    { background: rgba(255,68,0,0.3); color: #ff6600; border: 1px solid #ff6600; }
.wz-intensity.medium  { background: rgba(255,136,0,0.25); color: #ff8800; border: 1px solid #ff8800; }
.wz-intensity.low     { background: rgba(255,200,0,0.2); color: #ffcc00; border: 1px solid #ffcc00; }

.wz-row {
  display: flex;
  gap: 8px;
  margin-bottom: 3px;
}

.wz-key {
  color: var(--text-dim);
  min-width: 70px;
  flex-shrink: 0;
}

.wz-desc {
  margin-top: 8px;
  color: #bbb;
  font-size: 0.66rem;
  line-height: 1.5;
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 6px;
}

.wz-sat-note {
  margin-top: 6px;
  color: #aaddff;
  font-size: 0.64rem;
  font-style: italic;
}

.wz-links {
  margin-top: 10px;
  border-top: 1px solid rgba(0,255,65,0.2);
  padding-top: 8px;
}

.wz-links-title {
  font-size: 0.6rem;
  color: var(--accent-green);
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.wz-link {
  display: block;
  padding: 4px 8px;
  margin-bottom: 3px;
  text-decoration: none;
  font-size: 0.65rem;
  border-radius: 2px;
  transition: background 0.15s;
}
.wz-link.nasa     { color: #4ad; background: rgba(0,100,200,0.15); border-left: 2px solid #4ad; }
.wz-link.sentinel { color: #6c6; background: rgba(0,150,100,0.15); border-left: 2px solid #6c6; }
.wz-link.planet   { color: #ca6; background: rgba(200,100,0,0.12); border-left: 2px solid #ca6; }
.wz-link:hover { filter: brightness(1.3); }

.wz-source {
  margin-top: 6px;
  font-size: 0.58rem;
  color: var(--text-dim);
  font-style: italic;
}

/* Warzone label text on map */
.wz-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: bold;
  padding: 2px 5px;
  border: 1px solid;
  background: rgba(0,0,0,0.6);
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: 0.5px;
  text-shadow: 0 0 6px currentColor;
}

/* Leaflet popup override for warzones */
.wz-leaflet-popup .leaflet-popup-content-wrapper {
  border-color: rgba(255,102,0,0.5) !important;
  box-shadow: 0 0 20px rgba(255,68,0,0.3) !important;
  max-width: 340px !important;
}

/* ============================================================
   WEBCAM STYLES
   ============================================================ */

.webcam-icon {
  cursor: pointer;
  transition: transform 0.2s;
}
.webcam-icon:hover { transform: scale(1.3); }

.webcam-icon.online  svg { filter: drop-shadow(0 0 5px #00ff41); }
.webcam-icon.offline svg { filter: drop-shadow(0 0 3px #888); }

@keyframes webcam-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
.webcam-blink { animation: webcam-blink 1.5s infinite; }

.webcam-popup {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-primary);
  min-width: 290px;
}

.webcam-popup-title {
  font-size: 0.85rem;
  font-weight: bold;
  color: #fff;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.webcam-popup-meta {
  color: var(--text-dim);
  font-size: 0.65rem;
  margin-bottom: 8px;
}

.webcam-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.webcam-dot.online  { background: var(--accent-green); box-shadow: 0 0 5px var(--accent-green); animation: pulse-green 2s infinite; }
.webcam-dot.offline { background: #888; }

.webcam-stream-container {
  margin-bottom: 8px;
  border: 1px solid rgba(0,255,65,0.2);
  background: #000;
  line-height: 0;
}

.webcam-stream-container iframe {
  display: block;
  width: 300px;
  height: 169px;
}

.webcam-no-stream {
  padding: 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.65rem;
  border: 1px dashed rgba(255,255,255,0.1);
  margin-bottom: 8px;
}

.webcam-popup-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.webcam-link {
  padding: 4px 8px;
  background: rgba(0,255,65,0.1);
  border: 1px solid rgba(0,255,65,0.3);
  color: var(--accent-green);
  text-decoration: none;
  font-size: 0.62rem;
  border-radius: 2px;
  transition: background 0.15s;
}
.webcam-link:hover { background: rgba(0,255,65,0.2); }

/* Leaflet popup override for webcams */
.webcam-leaflet-popup .leaflet-popup-content-wrapper {
  border-color: rgba(0,255,65,0.4) !important;
  box-shadow: 0 0 20px rgba(0,255,65,0.2) !important;
  max-width: 340px !important;
}

/* NASA satellite tiles */
.nasa-tiles {
  filter: saturate(1.2) contrast(1.1);
}

#nasa-toast {
  position: fixed;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(10,10,10,0.92);
  border: 1px solid #ff6600;
  color: #ff9900;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 6px 16px;
  border-radius: 2px;
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
#nasa-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   THREAT ALERT BANNER
   ============================================================ */

#alert-banner {
  position: absolute;
  top: 6px;
  left: 50%;
  z-index: 2000;
  transform: translateX(-50%);
  z-index: 2000;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(10,10,15,0.96);
  border: 1px solid #ff0000;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: nowrap;
  box-shadow: 0 0 30px rgba(255,0,0,0.4);
  animation: banner-slide-in 0.3s ease;
  max-width: 90vw;
}
#alert-banner.show { display: flex; }
#alert-banner.sev-critical { border-color: #ff0000; box-shadow: 0 0 40px rgba(255,0,0,0.6); }
#alert-banner.sev-high     { border-color: #ff4400; box-shadow: 0 0 30px rgba(255,68,0,0.5); }
#alert-banner.sev-medium   { border-color: #ff8800; box-shadow: 0 0 20px rgba(255,136,0,0.4); }

@keyframes banner-slide-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.alert-severity {
  font-weight: bold;
  letter-spacing: 1.5px;
  padding: 2px 7px;
  border-radius: 2px;
  font-size: 0.68rem;
}
.alert-severity.critical { background: rgba(255,0,0,0.25); color: #ff2222; border: 1px solid #ff0000; }
.alert-severity.high     { background: rgba(255,68,0,0.22); color: #ff5500; border: 1px solid #ff4400; }
.alert-severity.medium   { background: rgba(255,136,0,0.2); color: #ff9900; border: 1px solid #ff8800; }

.alert-type     { color: #ffaa00; font-weight: bold; font-size: 0.65rem; letter-spacing: 0.05em; }
.alert-callsign { color: #fff; font-weight: bold; }
.alert-category { color: #7cf; font-size: 0.65rem; }
.alert-msg      { color: #ccc; }
.alert-time     { color: var(--text-dim); font-size: 0.65rem; margin-left: auto; }
.alert-close    { color: var(--accent-red); cursor: pointer; margin-left: 8px; flex-shrink: 0; }

/* Alert history in side panel */
#alert-history { max-height: 180px; overflow-y: auto; }

.alert-empty {
  color: var(--text-dim);
  font-size: 0.65rem;
  padding: 8px 4px;
  font-style: italic;
}

.alert-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px 6px;
  margin-bottom: 3px;
  background: rgba(255,255,255,0.03);
  border-left: 2px solid transparent;
  font-size: 0.61rem;
  cursor: default;
}
.alert-item.sev-critical { border-color: #ff0000; background: rgba(255,0,0,0.04); }
.alert-item.sev-high     { border-color: #ff4400; background: rgba(255,68,0,0.04); }
.alert-item.sev-medium   { border-color: #ff8800; }

.alert-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.alert-item-type {
  color: #ff9900;
  font-weight: bold;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.alert-item.sev-critical .alert-item-type { color: #ff3333; }
.alert-item.sev-high     .alert-item-type { color: #ff6600; }

.alert-item-body {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
}
.alert-item-time { color: var(--text-dim); font-size: 0.57rem; }
.alert-item-call { color: #fff; font-weight: bold; }
.alert-item-cat  { color: #7cf; font-size: 0.57rem; opacity: 0.85; }
.alert-item-zone { color: #aaa; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.58rem; }

/* ============================================================
   NEWS FEED PANEL
   ============================================================ */

#feed-toggle {
  padding: 5px 10px;
  border: 1px solid rgba(0,170,255,0.35);
  background: rgba(0,170,255,0.08);
  color: var(--accent-blue);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 1px;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
#feed-toggle:hover,
#feed-toggle.open {
  background: rgba(0,170,255,0.15);
  border-color: var(--accent-blue);
  color: #fff;
}

#feed-panel {
  position: absolute;
  top: 54px;
  right: -508px;
  width: 360px;
  bottom: 32px;
  z-index: 1090;
  background: var(--bg-panel);
  border-left: 1px solid rgba(0,170,255,0.3);
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
  font-family: var(--font-mono);
}
#feed-panel.open { right: 148px; }

.feed-header {
  padding: 10px 12px 6px;
  border-bottom: 1px solid rgba(0,170,255,0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.feed-title-bar {
  color: var(--accent-blue);
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  font-weight: bold;
}

#feed-status {
  color: var(--text-dim);
  font-size: 0.6rem;
}

.feed-filters {
  display: flex;
  gap: 4px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(0,170,255,0.1);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.feed-filter-btn {
  padding: 3px 8px;
  border: 1px solid rgba(0,170,255,0.25);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
}
.feed-filter-btn:hover,
.feed-filter-btn.active {
  background: rgba(0,170,255,0.12);
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}

#feed-articles {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.feed-empty {
  color: var(--text-dim);
  font-size: 0.65rem;
  text-align: center;
  padding: 30px 10px;
  font-style: italic;
}

.feed-skeleton {
  padding: 8px 10px;
  margin-bottom: 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sk-badge, .sk-title, .sk-desc {
  border-radius: 2px;
  animation: stat-pulse 1.4s ease-in-out infinite;
  background: rgba(255,255,255,0.08);
}

.sk-badge  { width: 60px; height: 14px; }
.sk-title  { width: 100%; height: 11px; }
.sk-title.sk-title-short { width: 72%; }
.sk-desc   { width: 85%; height: 9px; opacity: 0.6; }

.feed-article {
  padding: 8px 10px;
  margin-bottom: 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.feed-article:hover {
  background: rgba(0,170,255,0.06);
  border-color: rgba(0,170,255,0.25);
}

.feed-article-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  gap: 6px;
}

.feed-source-badge {
  font-size: 0.58rem;
  padding: 2px 6px;
  border-radius: 2px;
  border: 1px solid;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.feed-date {
  color: var(--text-dim);
  font-size: 0.58rem;
  white-space: nowrap;
}

.feed-title {
  color: var(--text-primary);
  font-size: 0.68rem;
  line-height: 1.4;
  margin-bottom: 4px;
}

.feed-desc {
  color: var(--text-dim);
  font-size: 0.61rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   HELP BUTTON + MODAL
   ============================================================ */

#btn-help {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border-dim);
  background: rgba(255,136,0,0.08);
  color: var(--accent-orange);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: bold;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#btn-help:hover {
  background: rgba(255,136,0,0.2);
  border-color: var(--accent-orange);
  box-shadow: 0 0 8px rgba(255,136,0,0.4);
}

#help-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(0,0,0,0.7);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

#help-modal.open { display: flex; }

#help-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-red);
  box-shadow: 0 0 40px rgba(255,68,68,0.2);
  width: min(680px, 94vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
}

.help-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px 0 0;
  border-bottom: 1px solid var(--border-red);
  flex-shrink: 0;
}

.help-tabs {
  display: flex;
  gap: 0;
}

.help-tab {
  background: none;
  border: none;
  border-right: 1px solid var(--border-red);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  padding: 12px 18px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.15s;
}

.help-tab:hover {
  color: var(--accent-orange);
  background: rgba(255,136,0,0.06);
}

.help-tab.active {
  color: var(--accent-orange);
  background: rgba(255,136,0,0.1);
  border-bottom: 2px solid var(--accent-orange);
}

#help-close {
  background: none;
  border: none;
  color: var(--accent-red);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 2px 6px;
}
#help-close:hover { color: #fff; }

.help-body {
  overflow-y: auto;
  padding: 16px;
  font-size: 0.7rem;
  line-height: 1.6;
}

.help-section-title {
  color: var(--accent-orange);
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-dim);
  padding-bottom: 4px;
}

.help-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 4px;
}

.help-table tr { border-bottom: 1px solid rgba(255,255,255,0.04); }
.help-table td { padding: 4px 6px; vertical-align: top; }

.hk {
  color: var(--accent-green);
  white-space: nowrap;
  width: 160px;
  font-size: 0.65rem;
}

.help-table td:last-child { color: var(--text-dim); }
.help-table a { color: var(--accent-blue); text-decoration: none; }
.help-table a:hover { text-decoration: underline; }

.help-tip {
  color: var(--text-dim);
  font-size: 0.65rem;
  padding: 3px 0 3px 8px;
  border-left: 2px solid var(--border-dim);
  margin-bottom: 4px;
}

.help-tip code {
  color: var(--accent-green);
  background: rgba(0,255,65,0.08);
  padding: 1px 4px;
  border-radius: 2px;
  font-family: var(--font-mono);
}

.about-logo {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent-red);
  letter-spacing: 6px;
  text-shadow: 0 0 20px rgba(255,68,68,0.5);
  margin-bottom: 4px;
}

.about-logo span { color: var(--accent-orange); }

.about-tagline {
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.about-version {
  font-size: 0.6rem;
  color: var(--accent-green);
  letter-spacing: 1px;
  margin-bottom: 4px;
}

/* ============================================================
   BOOT OVERLAY
   ============================================================ */

#boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0a0a0f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  animation: boot-fadeout 0.6s ease 2.2s forwards;
  pointer-events: none;
}

@keyframes boot-fadeout {
  from { opacity: 1; }
  to   { opacity: 0; display: none; }
}

.boot-title {
  font-family: var(--font-mono);
  font-size: 2.4rem;
  font-weight: bold;
  color: var(--accent-red);
  letter-spacing: 8px;
  text-shadow: 0 0 30px rgba(255,68,68,0.7);
}

.boot-title span { color: var(--accent-orange); }

.boot-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 4px;
  text-transform: uppercase;
}

.boot-line {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent-green);
  letter-spacing: 2px;
  animation: boot-blink 0.8s step-end infinite;
}

@keyframes boot-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.boot-bar {
  width: 220px;
  height: 3px;
  background: rgba(255,68,68,0.15);
  border-radius: 2px;
  overflow: hidden;
}

.boot-fill {
  height: 100%;
  background: var(--accent-red);
  animation: boot-progress 1.8s ease-out forwards;
}

@keyframes boot-progress {
  0%   { width: 0%; }
  30%  { width: 35%; }
  60%  { width: 70%; }
  85%  { width: 88%; }
  100% { width: 100%; }
}

/* ============================================================
   GLOBAL INCIDENTS LAYER (GDELT)
   ============================================================ */

.incident-icon {
  background: transparent !important;
  border: none !important;
}

.incident-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: incident-pulse 2s ease-out infinite;
  cursor: pointer;
  opacity: 0.88;
}

.incident-emoji {
  font-size: 0.7rem;
  line-height: 1;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.8));
}

@keyframes incident-pulse {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0 currentColor; }
  50%  { transform: scale(1.08); box-shadow: 0 0 0 6px transparent; }
  100% { transform: scale(1);    box-shadow: 0 0 0 0 transparent; }
}

.incident-cluster {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(180, 30, 10, 0.85);
  border: 1px solid rgba(255, 80, 40, 0.7);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(255, 60, 20, 0.5);
}

/* ============================================================
   UKRAINE ALERT STRIKES LAYER
   ============================================================ */

.strike-icon {
  background: transparent !important;
  border: none !important;
}

.strike-pulse {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: strike-pulse 1.2s ease-out infinite;
  cursor: pointer;
}

.strike-inner {
  font-size: 0.9rem;
  line-height: 1;
  filter: drop-shadow(0 0 3px rgba(0,0,0,0.8));
}

@keyframes strike-pulse {
  0%   { box-shadow: 0 0 0 0 currentColor, 0 0 0 0 currentColor; opacity: 1; }
  70%  { box-shadow: 0 0 0 10px transparent, 0 0 0 20px transparent; opacity: 0.8; }
  100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
}

/* ============================================================
   EARTHQUAKE LAYER
   ============================================================ */

.quake-icon {
  background: transparent !important;
  border: none !important;
}

.quake-dot {
  border-radius: 50%;
  cursor: pointer;
  animation: quake-pulse 3s ease-out infinite;
  opacity: 0.85;
}

@keyframes quake-pulse {
  0%   { transform: scale(1);    opacity: 0.85; }
  50%  { transform: scale(1.15); opacity: 1;    }
  100% { transform: scale(1);    opacity: 0.85; }
}

/* ============================================================
   MILITARY BASES LAYER
   ============================================================ */

.base-icon {
  background: transparent !important;
  border: none !important;
}

.base-icon-inner {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  cursor: pointer;
  transition: transform 0.15s;
}

.base-icon-inner:hover { transform: scale(1.3); }

/* ============================================================
   PUSH NOTIFICATIONS BUTTON
   ============================================================ */

#push-btn {
  padding: 4px 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
#push-btn:hover {
  background: rgba(0,170,255,0.12);
  border-color: rgba(0,170,255,0.4);
  color: #00aaff;
}
#push-btn.push-active {
  background: rgba(0,170,255,0.12);
  border-color: rgba(0,170,255,0.5);
  color: #00aaff;
}

/* ============================================================
   CLICK-TO-FOLLOW
   ============================================================ */

.follow-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 6px 10px;
  background: rgba(0, 170, 255, 0.12);
  border: 1px solid rgba(0, 170, 255, 0.5);
  color: #00aaff;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.follow-btn:hover {
  background: rgba(0, 170, 255, 0.25);
  border-color: #00aaff;
}

#follow-banner {
  position: fixed;
  bottom: -48px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(10, 10, 20, 0.93);
  border: 1px solid rgba(0, 170, 255, 0.6);
  border-radius: 4px;
  box-shadow: 0 0 16px rgba(0, 170, 255, 0.3);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #00aaff;
  transition: bottom 0.25s ease;
  white-space: nowrap;
}
#follow-banner.active {
  bottom: 18px;
}
#follow-label {
  letter-spacing: 0.06em;
}
#follow-cancel {
  padding: 3px 8px;
  background: rgba(255, 68, 68, 0.15);
  border: 1px solid rgba(255, 68, 68, 0.5);
  color: #ff4444;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  cursor: pointer;
  transition: background 0.15s;
}
#follow-cancel:hover {
  background: rgba(255, 68, 68, 0.3);
}

/* ============================================================
   SPACE LAYER
   ============================================================ */

.layer-btn.active-blue {
  border-color: #00aaff;
  color: #00aaff;
  background: rgba(0,170,255,0.1);
  box-shadow: 0 0 8px rgba(0,170,255,0.25);
}
