
#map {
  position: fixed;
  left: 340px;
  top: var(--total-header-height);
  width: calc(100% - 340px);
  height: calc(100vh - var(--total-header-height));
  transition: left 0.3s ease, width 0.3s ease;
}
body.watch-active #map {
  left: 340px;
  top: var(--total-header-height);
  width: calc(100% - 340px - 380px);
  height: calc(100vh - var(--total-header-height));
}
body.chat-active #map {
  width: calc(100% - 340px - 400px);
}
body.chat-active.sidebar-collapsed #map {
  width: calc(100% - 400px);
}
body.chat-active.watch-active #map {
  width: calc(100% - 340px - 380px - 400px);
}
body.chat-active.watch-active.sidebar-collapsed #map {
  width: calc(100% - 380px - 400px);
}
body.profile-sidebar-open #map {
  width: calc(100% - 340px - 480px);
}
body.profile-sidebar-open.sidebar-collapsed #map {
  width: calc(100% - 480px);
}
body.chat-active.profile-sidebar-open #map {
  width: calc(100% - 340px - 480px - 400px);
}
body.chat-active.profile-sidebar-open.sidebar-collapsed #map {
  width: calc(100% - 480px - 400px);
}

#map .leaflet-top,
#map .leaflet-bottom {
  z-index: var(--z-leaflet);
}

#map .leaflet-control-container {
  z-index: var(--z-leaflet);
}


body.auth-required #map,
body.auth-required #filters-bar,
body.auth-required #control-sidebar {
  filter: blur(6px);
  pointer-events: none;
}

/* Auth Overlay */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 6, 8, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  backdrop-filter: blur(2px);
}

.auth-modal {
  background: linear-gradient(180deg, rgba(14, 14, 24, 0.99) 0%, rgba(10, 10, 16, 0.99) 100%);
  border: 1px solid rgba(130, 21, 44, 0.2);
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  padding: 36px;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.6), 0 0 80px rgba(130, 21, 44, 0.1), 0 0 0 1px rgba(255,255,255,0.03);
  animation: modalSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.auth-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.auth-close-btn:hover {
  color: #fff;
  background: rgba(130, 21, 44, 0.3);
}


#incident-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 320px;
  background: rgba(14, 14, 20, 0.96);
  border: 1px solid var(--color-border-primary);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  font-size: 13px;
  line-height: 1.4;
  z-index: var(--z-modal-content);
}

#incident-card.hidden {
  display: none;
}

#incident-card h2 {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

#incident-card .meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-meta);
  margin-bottom: 8px;
}

#incident-card .summary {
  margin-bottom: 10px;
  color: #d0d0d0;
}

#incident-card button,
#incident-card a.cta {
  display: inline-block;
  margin-top: 4px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--color-brand-red);
  background: var(--color-brand-red);
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

#incident-card a.cta:hover {
  background: var(--color-brand-red-hover);
  opacity: 1;
}

#incident-card button.close {
  float: right;
  background: transparent;
  border: none;
  color: #666b7a;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  margin: 0 0 6px 6px;
}

#incident-card button.close:hover {
  color: var(--color-text-primary);
}

#incident-card .badge-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

#incident-card .impact-badge,
#incident-card .category-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#incident-card .impact-badge {
  border: 1px solid;
}

#incident-card .impact-high {
  background: rgba(165, 32, 64, 0.15);
  border-color: rgba(165, 32, 64, 0.5);
  color: #F7D18F;
}

#incident-card .impact-medium {
  background: rgba(199, 74, 106, 0.15);
  border-color: rgba(199, 74, 106, 0.5);
  color: #c9a44a;
}

#incident-card .impact-low {
  background: rgba(212, 135, 154, 0.15);
  border-color: rgba(212, 135, 154, 0.5);
  color: #c9a44a;
}

#incident-card .category-badge {
  background: rgba(90, 90, 100, 0.2);
  border: 1px solid rgba(90, 90, 100, 0.4);
  color: #b4b8c4;
}

#incident-card .verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(130, 21, 44, 0.2);
  border: 1px solid rgba(130, 21, 44, 0.45);
  color: rgba(255,255,255,0.8);
}

#incident-card .source-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: var(--color-info-lighter);
}


.layers-legend-items {
  display: flex;
  flex-direction: column;
  gap: 0;
}

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

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

.legend-marker {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
}

.legend-label {
  font-size: 11px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

#top-countries-widget {
  position: absolute;
  bottom: 35px;
  left: 15px;
  background: rgba(14, 14, 20, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-border-primary);
  border-radius: 8px;
  padding: 10px 12px;
  z-index: var(--z-widget);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 220px;
}



#top-countries-widget.collapsed #top-countries-content {
  display: none;
}


.verified-toggle {
  font-size: 10px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.verified-toggle input {
  accent-color: var(--color-brand-gold);
}

#top-countries-list {
  max-height: 250px;
  overflow-y: auto;
}

#top-countries-list.loading {
  text-align: center;
  color: #9ca3af;
  font-size: 11px;
  padding: 10px 0;
}

.top-country-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(90, 90, 100, 0.15);
  cursor: pointer;
  transition: background 0.2s;
}

.top-country-item:hover {
  background: rgba(130, 21, 44, 0.1);
  margin: 0 -6px;
  padding: 6px;
  border-radius: 4px;
}

.top-country-item:last-child {
  border-bottom: none;
}

.country-rank {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--color-brand-red);
  min-width: 18px;
}

.country-name {
  flex: 1;
  font-size: 11px;
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #9ca3af;
  background: rgba(90, 90, 100, 0.2);
  padding: 2px 6px;
  border-radius: 3px;
}

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

.country-details {
  display: flex;
  gap: 4px;
  font-size: 9px;
}

.severity-high {
  color: var(--color-impact-critical);
  font-weight: 600;
}

.severity-med {
  color: var(--color-impact-medium);
}

.country-trend {
  font-size: 12px;
  font-weight: 700;
  min-width: 14px;
  text-align: center;
}

.ai-analysis-box {
  background: linear-gradient(135deg, rgba(130, 21, 44, 0.15), rgba(59, 130, 246, 0.1));
  border: 1px solid rgba(130, 21, 44, 0.3);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
}

.ai-analysis-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.ai-icon {
  font-size: 14px;
}

.ai-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-brand-red);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-analysis-text {
  font-size: 11px;
  line-height: 1.5;
  color: var(--color-text-secondary);
}


/* Asset map markers */
.asset-marker-icon {
  background: none !important;
  border: none !important;
}
.asset-marker-dot {
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
  transition: transform 0.15s ease;
}
.asset-marker-dot:hover {
  transform: scale(1.2);
}
.asset-popup-container .leaflet-popup-content-wrapper {
  background: #16161c;
  border: 1px solid rgba(65, 65, 75, 0.4);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  color: var(--color-text-heading);
}
.asset-popup-container .leaflet-popup-tip {
  background: #16161c;
  border: 1px solid rgba(65, 65, 75, 0.4);
}
.asset-popup-container .leaflet-popup-close-button {
  color: var(--color-text-dim);
}
.asset-popup-container .leaflet-popup-close-button:hover {
  color: #fff;
}
.asset-popup {
  padding: 4px 2px;
  font-family: inherit;
}
.asset-popup-header {
  display: flex; align-items: center; gap: 8px;
}
.asset-popup-header strong {
  font-size: 0.8rem; font-weight: 600; color: #f4f4f5;
}
.asset-popup-type {
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; padding: 2px 6px; border-radius: 4px;
}
.asset-type-blue,
.asset-type-building,
.asset-type-person,
.asset-type-organization,
.asset-type-church,
.asset-type-home,
.asset-type-school,
.asset-type-hospital,
.asset-type-office,
.asset-type-community_center,
.asset-type-warehouse {
  background: rgba(59, 130, 246, 0.15); color: var(--color-info-light);
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.asset-popup-addr {
  margin-top: 4px; font-size: 0.7rem; color: var(--color-text-muted);
}

/* AlertMedia incident styling */
.incident-item.source-alertmedia {
  border-left-color: var(--color-warning);
}
.am-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 1px 5px; border-radius: 3px; font-size: 0.5625rem; font-weight: 700;
  background: rgba(245, 158, 11, 0.2); color: var(--color-warning-gold);
  margin-right: 4px; letter-spacing: 0.3px; vertical-align: middle;
}

@media (max-width: 480px) {
  .fp-content { width: 100%; }
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.branding {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 6px;
}

.branding .logo {
  height: 28px;
  width: auto;
  filter: drop-shadow(0 0 6px rgba(130, 21, 44, 0.3));
}

.branding .logo-horizontal {
  height: 36px;
  max-height: 40px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(130, 21, 44, 0.3));
}

.branding .intelligence-text {
  font-family: var(--font-display);
  font-size: var(--text-px-16);
  font-weight: var(--weight-bold);
  color: #FFFFFF;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(130, 21, 44, 0.25);
}

.toggle-btn {
  background: rgba(90, 90, 100, 0.1);
  border: 1px solid rgba(90, 90, 100, 0.25);
  color: var(--color-text-secondary);
  margin-left: 8px;
  font-size: 16px;
  padding: 7px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  font-weight: 600;
}

.toggle-btn:hover {
  background: rgba(90, 90, 100, 0.2);
  border-color: rgba(90, 90, 100, 0.4);
  transform: translateY(-1px);
}

.verified-toggle-btn,
.risk-toggle-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(90, 90, 100, 0.1);
  border: 1px solid rgba(90, 90, 100, 0.25);
  color: #888;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  font-weight: 500;
  white-space: nowrap;
}

.toggle-label {
  font-size: 12px;
}

.verified-toggle-btn:hover,
.risk-toggle-btn:hover {
  background: rgba(90, 90, 100, 0.2);
  border-color: rgba(90, 90, 100, 0.4);
}

.verified-toggle-btn.active {
  background: rgba(250, 199, 97, 0.2);
  border-color: var(--color-brand-gold);
  color: var(--color-brand-gold);
  box-shadow: 0 0 8px rgba(250, 199, 97, 0.3);
}

.verified-toggle-btn.active:hover {
  background: rgba(250, 199, 97, 0.3);
}

.risk-toggle-btn.active {
  background: rgba(130, 21, 44, 0.3);
  border-color: var(--color-brand-red);
  color: #ffffff;
  box-shadow: 0 0 8px rgba(130, 21, 44, 0.4);
}

.risk-toggle-btn.active:hover {
  background: rgba(130, 21, 44, 0.4);
}

#map-controls-row {
  position: absolute;
  bottom: 35px;
  right: 15px;
  z-index: var(--z-widget);
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.layers-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(14, 14, 20, 0.95);
  border: 1px solid rgba(130, 21, 44, 0.3);
  color: var(--color-brand-red);
  border-radius: 8px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.layers-icon-btn:hover {
  background: rgba(130, 21, 44, 0.15);
  border-color: var(--color-brand-red);
}

.layers-icon-btn.active {
  background: rgba(130, 21, 44, 0.25);
  border-color: var(--color-brand-red);
  color: #c4364f;
}

.layers-dropdown {
  position: absolute;
  top: 44px;
  right: 0;
  background: rgba(14, 14, 20, 0.95);
  border: 1px solid var(--color-border-primary);
  border-radius: 8px;
  padding: 12px;
  min-width: 180px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  pointer-events: none;
}

.layers-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.layers-panel-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #888;
  margin-bottom: 10px;
  padding: 0 2px;
}

.layers-options {
  display: flex;
  gap: 8px;
}

.layers-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 4px;
  cursor: pointer;
  color: #aaa;
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.2s ease;
  flex: 1;
}

.layers-option:hover {
  border-color: rgba(90, 90, 100, 0.4);
  color: #ddd;
}

.layers-option.active {
  border-color: var(--color-brand-red);
  color: #fff;
}

.layers-option-preview {
  width: 68px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
}

.dark-preview {
  background: linear-gradient(135deg, #1a1a20 0%, #1a1a20 50%, #3a1520 100%);
  border: 1px solid rgba(90, 90, 100, 0.25);
}

.satellite-preview {
  background: linear-gradient(135deg, #2d5016 0%, #5a7a3a 30%, #3a6b4a 60%, #4a7a5a 100%);
  border: 1px solid rgba(90, 90, 100, 0.25);
}

.layers-panel-section {
  padding: 0;
}

.layers-panel-divider {
  height: 1px;
  background: rgba(90, 90, 100, 0.2);
  margin: 10px 0;
}

.layers-overlay-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.layers-overlay-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #ccc;
  transition: all 0.15s ease;
}

.layers-overlay-toggle:hover {
  background: rgba(90, 90, 100, 0.15);
  color: #fff;
}

.layers-overlay-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 34px;
  height: 18px;
  background: rgba(60, 60, 80, 0.8);
  border-radius: 9px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
  order: 3;
  margin-left: auto;
}

.layers-overlay-toggle input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #888;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.layers-overlay-toggle input[type="checkbox"]:checked {
  background: rgba(130, 21, 44, 0.7);
}

.layers-overlay-toggle input[type="checkbox"]:checked::after {
  left: 16px;
  background: #fff;
}

.layers-overlay-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  flex-shrink: 0;
}

.heatmap-icon-preview {
  background: radial-gradient(circle, #fbbf24 0%, #ef4444 40%, #b91c1c 65%, #4a0e8f 85%, transparent 100%);
}

.risk-icon-preview {
  background: linear-gradient(135deg, #4ade80 0%, #fbbf24 35%, #fb923c 65%, #dc2626 100%);
}

.verified-icon-preview {
  background: rgba(250, 199, 97, 0.2);
  border: 2px solid var(--color-brand-gold);
  box-sizing: border-box;
}

.mobile-verified-toggle {
  background: rgba(90, 90, 100, 0.1);
  border: 1px solid rgba(90, 90, 100, 0.25);
  color: var(--color-text-secondary);
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.mobile-verified-toggle.active {
  background: rgba(250, 199, 97, 0.2);
  border-color: var(--color-brand-gold);
  color: var(--color-brand-gold);
}

#search-input {
  min-width: 140px;
  max-width: 180px;
  background: transparent;
  border: 1px solid rgba(90, 90, 100, 0.25);
  border-radius: 4px;
  padding: 5px 8px;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-family: var(--font-body);
}

#search-input:focus {
  outline: none;
  border-color: rgba(130, 21, 44, 0.8);
  box-shadow: 0 0 0 2px rgba(130, 21, 44, 0.3);
}

#search-input::placeholder {
  color: #6b7280;
}

#time-filter,
#region-filter,
#impact-filter,
#category-filter,
#religion-filter {
  background: transparent;
  border: 1px solid rgba(90, 90, 100, 0.25);
  border-radius: 4px;
  padding: 5px 24px 5px 8px;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-family: var(--font-body);
  cursor: pointer;
  min-width: 100px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d4d4d8' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

#time-filter:hover,
#region-filter:hover,
#impact-filter:hover,
#category-filter:hover,
#religion-filter:hover {
  border-color: rgba(90, 90, 100, 0.4);
}

#time-filter:focus,
#region-filter:focus,
#impact-filter:focus,
#category-filter:focus,
#religion-filter:focus {
  outline: none;
  border-color: rgba(130, 21, 44, 0.8);
  box-shadow: 0 0 0 2px rgba(130, 21, 44, 0.3);
}

.category-multiselect-wrapper {
  position: relative;
  display: inline-block;
}

.category-filter-btn {
  background: transparent;
  border: 1px solid rgba(90, 90, 100, 0.25);
  border-radius: 4px;
  padding: 5px 24px 5px 8px;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-family: var(--font-body);
  cursor: pointer;
  min-width: 100px;
  text-align: left;
  white-space: nowrap;
}

.category-filter-btn:hover {
  border-color: rgba(90, 90, 100, 0.4);
}

.category-filter-btn.active {
  border-color: rgba(130, 21, 44, 0.8);
  box-shadow: 0 0 0 2px rgba(130, 21, 44, 0.3);
}

.cat-chevron {
  font-size: 10px;
  margin-left: 4px;
  opacity: 0.7;
}

.category-dropdown-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 280px;
  max-width: 360px;
  background: rgba(20, 20, 25, 0.98);
  border: 1px solid var(--color-border-primary);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  z-index: var(--z-overlay);
  backdrop-filter: blur(12px);
}

.category-dropdown-panel.hidden {
  display: none;
}

.cat-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(90, 90, 100, 0.2);
  font-size: 12px;
  font-weight: 600;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cat-clear-btn {
  background: none;
  border: none;
  color: var(--color-brand-red);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.cat-clear-btn:hover {
  background: rgba(130, 21, 44, 0.15);
}

.cat-checkbox-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 6px 0;
}

.cat-checkbox-list::-webkit-scrollbar {
  width: 4px;
}

.cat-checkbox-list::-webkit-scrollbar-thumb {
  background: rgba(90, 90, 100, 0.3);
  border-radius: 2px;
}

.cat-section-label {
  padding: 8px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.cat-checkbox-item {
  display: flex;
  align-items: center;
  padding: 5px 14px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 13px;
  color: var(--color-text-secondary);
  gap: 8px;
}

.cat-checkbox-item:hover {
  background: rgba(90, 90, 100, 0.1);
}

.cat-checkbox-item input[type="checkbox"] {
  accent-color: var(--color-brand-red);
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.cat-checkbox-item.locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.cat-checkbox-item.locked:hover {
  background: rgba(130, 21, 44, 0.05);
}

.cat-lock-icon {
  font-size: 11px;
  margin-left: auto;
  color: var(--color-brand-red);
}

.cat-badge-count {
  margin-left: 4px;
  background: var(--color-brand-red);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 600;
}

.mobile-cat-checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mobile-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--color-border-primary);
  border-radius: 16px;
  font-size: 12px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  background: transparent;
}

.mobile-cat-chip:hover {
  border-color: var(--color-border-accent-strong);
}

.mobile-cat-chip.selected {
  background: rgba(130, 21, 44, 0.2);
  border-color: var(--color-brand-red);
  color: #fff;
}

.mobile-cat-chip.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.mobile-cat-chip input[type="checkbox"] {
  display: none;
}

.stats-container {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: nowrap;
  margin-left: auto;
}

.stat-badge {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-variant-numeric: tabular-nums;
}

#incident-counter {
  color: var(--color-text-accent);
  background: rgba(130, 21, 44, 0.12);
  border: 1px solid rgba(130, 21, 44, 0.2);
}

.stat-badge.secondary {
  color: var(--color-text-label);
  background: rgba(90, 90, 100, 0.06);
  border: 1px solid rgba(90, 90, 100, 0.15);
  font-size: 11px;
  font-weight: 600;
}

.stat-badge.secondary:hover {
  background: rgba(90, 90, 100, 0.1);
  border-color: rgba(90, 90, 100, 0.25);
}

@media (max-width: 900px) {
  #filters-bar {
    gap: 8px;
  }
  
  #time-filter,
  #region-filter,
  #impact-filter,
  #category-filter,
  #religion-filter {
    min-width: 120px;
  }
}

@media (max-width: 600px) {
  #filters-bar {
    padding: 8px 10px;
  }
  
  #search-input {
    flex-basis: 100%;
    order: 10;
  }
  
  .stats-container {
    margin-left: 0;
    order: 11;
  }
  
  #control-sidebar {
    top: var(--total-header-height);
    max-height: calc(100vh - var(--total-header-height));
  }
}

@media (max-width: 400px) {
  #filters-bar {
    gap: 6px;
    padding: 6px 8px;
  }
  
  #time-filter,
  #region-filter,
  #impact-filter,
  #category-filter,
  #religion-filter {
    min-width: 100px;
    font-size: 12px;
  }
  
  #control-sidebar {
    top: var(--total-header-height);
    max-height: calc(100vh - var(--total-header-height));
    width: calc(100% - 20px);
  }
}

#control-sidebar {
  position: fixed;
  top: var(--total-header-height);
  left: 0;
  width: 340px;
  height: calc(100vh - var(--total-header-height));
  background: rgba(14, 14, 20, 0.98);
  backdrop-filter: blur(12px);
  border-right: 1px solid rgba(90, 90, 100, 0.3);
  z-index: var(--z-sidebar-high) !important;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#control-sidebar.collapsed {
  transform: translateX(-340px);
}
body.sidebar-collapsed #map {
  left: 0;
  width: 100%;
}
body.sidebar-collapsed.watch-active #map {
  left: 0;
  width: calc(100% - 380px);
}
body.sidebar-collapsed.chat-active #map {
  left: 0;
  width: calc(100% - 400px);
}
body.sidebar-collapsed.chat-active.watch-active #map {
  left: 0;
  width: calc(100% - 380px - 400px);
}
body.sidebar-collapsed.chat-active.profile-sidebar-open #map {
  left: 0;
  width: calc(100% - 480px - 400px);
}

.sidebar-close-btn {
  background: rgba(36, 36, 44, 0.5);
  border: 1px solid rgba(65, 65, 75, 0.5);
  color: var(--color-text-muted);
  width: 24px; height: 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.sidebar-close-btn:hover {
  background: rgba(130, 21, 44, 0.3);
  color: #fff;
}


#control-sidebar.hidden {
  display: none;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(130, 21, 44, 0.2);
  background: rgba(0, 0, 0, 0.15);
}

.sidebar-header h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-brand-red);
  font-family: var(--font-mono);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.close-btn {
  background: rgba(130, 21, 44, 0.1);
  border: 1px solid rgba(130, 21, 44, 0.4);
  color: var(--color-brand-red);
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1;
}

.close-btn:hover {
  background: rgba(130, 21, 44, 0.25);
  border-color: var(--color-brand-red);
  box-shadow: 0 0 8px rgba(130, 21, 44, 0.3);
  transform: scale(1.05);
}

#incident-list {
  overflow-y: auto;
  padding: 10px;
  flex: 1;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.incident-item {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(90, 90, 100, 0.15);
  border-left: 3px solid rgba(130, 21, 44, 0.5);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.incident-item:hover {
  border-color: rgba(90, 90, 100, 0.3);
  border-left-color: var(--color-brand-red);
  background: rgba(130, 21, 44, 0.1);
  transform: translateX(2px);
}

.incident-item-title {
  display: flex;
  align-items: flex-start;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 6px;
  line-height: 1.4;
}

.incident-item-meta {
  font-size: 11px;
  color: var(--color-text-meta);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}


.incident-item-age {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.incident-item-age.new {
  background: rgba(130, 21, 44, 0.3);
  color: #d4a574;
}

.incident-item-age.recent {
  background: rgba(130, 21, 44, 0.2);
  color: #c9986b;
}

.incident-item-age.old {
  background: rgba(130, 21, 44, 0.15);
  color: var(--color-text-meta);
}

.incident-item.impact-critical {
  border-left-color: var(--color-brand-red);
}

.incident-item.impact-high {
  border-left-color: #a52040;
}

.incident-item.impact-medium {
  border-left-color: #c74a6a;
}

.incident-item.impact-low {
  border-left-color: #c9a44a;
}

.incident-item.verified {
  border-color: rgba(130, 21, 44, 0.2);
}

.incident-item.verified.impact-critical {
  border-left-color: var(--color-brand-red);
}

.incident-item.verified.impact-high {
  border-left-color: #a52040;
}

.incident-item.verified.impact-medium {
  border-left-color: #c74a6a;
}

.incident-item.verified.impact-low {
  border-left-color: #c9a44a;
}

.incident-item.verified:hover {
  border-color: rgba(130, 21, 44, 0.35);
}

.verified-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  background: rgba(130, 21, 44, 0.55);
  border: 1px solid rgba(130, 21, 44, 0.7);
  border-radius: 50%;
  color: rgba(255,255,255,0.85);
  font-size: 0.5rem;
  font-weight: 700;
  margin-right: 6px;
  flex-shrink: 0;
}

/* Marker cluster styling */
.marker-cluster-small {
  background-color: rgba(90, 90, 100, 0.2);
  border: 1px solid var(--color-border-primary);
}
.marker-cluster-small div {
  background-color: rgba(140, 140, 160, 0.45);
}

.marker-cluster-medium {
  background-color: rgba(130, 21, 44, 0.2);
  border: 1px solid rgba(130, 21, 44, 0.35);
}
.marker-cluster-medium div {
  background-color: rgba(130, 21, 44, 0.5);
}

.marker-cluster-large {
  background-color: rgba(200, 30, 50, 0.25);
  border: 1px solid rgba(200, 30, 50, 0.4);
}
.marker-cluster-large div {
  background-color: rgba(200, 30, 50, 0.55);
}

.marker-cluster {
  background-clip: padding-box;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}
.marker-cluster:hover {
  transform: scale(1.1);
}

.marker-cluster div {
  width: 28px;
  height: 28px;
  margin-left: 6px;
  margin-top: 6px;
  text-align: center;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
}

.marker-cluster span {
  line-height: 28px;
  color: var(--color-text-heading);
}

.marker-cluster-donut {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 50%;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.marker-cluster-donut:hover {
  transform: scale(1.15);
  filter: brightness(1.2);
}
.marker-cluster-donut svg {
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

.marker-highlight-pulse {
  animation: markerPulseRing 0.6s ease-out 2 !important;
  overflow: visible !important;
  z-index: var(--z-modal) !important;
}
.marker-highlight-pulse::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid var(--pulse-color, #ef4444);
  animation: markerPulseExpand 0.6s ease-out 2;
  pointer-events: none;
  box-shadow: 0 0 12px var(--pulse-color, #ef4444);
  width: 14px;
  height: 14px;
}
@keyframes markerPulseExpand {
  0% {
    width: 14px;
    height: 14px;
    opacity: 1;
    border-width: 3px;
    box-shadow: 0 0 8px var(--pulse-color, #ef4444);
  }
  100% {
    width: 50px;
    height: 50px;
    opacity: 0;
    border-width: 1px;
    box-shadow: 0 0 0 transparent;
  }
}
@keyframes markerPulseRing {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Category marker icons - remove default Leaflet styling */
.category-marker {
  background: none !important;
  border: none !important;
}

.category-marker svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Position Leaflet zoom controls below filter bar on the right */
.leaflet-top.leaflet-left {
  left: auto !important;
  right: 15px;
  top: 120px;
}


/* Risk overlay tooltip styling */
.risk-tooltip {
  background: rgba(14, 14, 20, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--color-border-primary);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-text-secondary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

