/* 
   Hantavirus Intelligence - Global Surveillance 2026
   Design System: Premium iOS-inspired Matte (Dark/Light)
   Final Refinement & Cleanup
*/

@import url('https://fonts.googleapis.com/css2?family=SF+Pro+Display:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Dark Theme (Default) */
  --bg-color: #0b0d10;
  --header-bg: rgba(19, 22, 27, 0.86);
  --sidebar-bg: #15191f;
  --card-bg: #20262e;
  --card-bg-soft: #1a2027;
  --text-primary: #ffffff;
  --text-secondary: #a0a8b3;
  --border-color: rgba(255, 255, 255, 0.12);
  --accent-blue: #0a84ff;
  --accent-red: #ff453a;
  --accent-yellow: #ffd60a;
  --accent-green: #32d74b;
  --accent-teal: #22d3c5;
  --shadow-color: rgba(0, 0, 0, 0.5);
  
  --header-h: 64px;
  --ribbon-h: 38px;
  --sidebar-w: 380px;
  --panel-w: 420px;
  
  --font-main: 'SF Pro Display', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body.theme-light {
  --bg-color: #f2f2f7;
  --header-bg: rgba(255, 255, 255, 0.8);
  --sidebar-bg: #ffffff;
  --card-bg: #ffffff;
  --card-bg-soft: #f8fafc;
  --text-primary: #000000;
  --text-secondary: #636366;
  --border-color: rgba(0, 0, 0, 0.1);
  --accent-blue: #007aff;
  --accent-red: #ff3b30;
  --accent-yellow: #ffcc00;
  --accent-green: #34c759;
  --shadow-color: rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.theme-dark {
  color-scheme: dark;
}

body.theme-light {
  color-scheme: light;
}

/* ── Header ── */
.main-header {
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
  gap: 16px;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo i {
  font-size: 28px;
  color: var(--accent-red);
  filter: drop-shadow(0 0 8px rgba(255, 69, 58, 0.3));
}

.logo-text h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
}

.logo-text span {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.live-badge {
  background: rgba(255, 69, 58, 0.1);
  color: var(--accent-red);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 69, 58, 0.2);
}

.pulse {
  width: 6px;
  height: 6px;
  background: var(--accent-red);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-red);
  animation: pulse-anim 2s infinite ease-in-out;
}

@keyframes pulse-anim {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
  100% { opacity: 1; transform: scale(1); }
}

.lang-picker {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.2s;
}

.lang-picker:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.select-modern {
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  color-scheme: dark;
}

body.theme-light .select-modern {
  color-scheme: light;
}

.select-modern option {
  background: var(--card-bg);
  color: var(--text-primary);
}

.select-modern:hover {
  border-color: var(--text-secondary);
}

.select-modern:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.1);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

/* ── Status Ribbon ── */
.status-ribbon {
  height: var(--ribbon-h);
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 999;
}

.ribbon-content {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.ribbon-sources {
  display: flex;
  gap: 6px;
}

.source-tag {
  background: color-mix(in srgb, var(--card-bg) 80%, transparent);
  padding: 2px 8px;
  border-radius: 5px;
  font-weight: 700;
  font-size: 9px;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.middle-text {
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0;
}

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

/* ── App Body ── */
.app-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 900;
  box-shadow: 10px 0 30px rgba(0,0,0,0.1);
}

.sidebar-search {
  padding: 20px 16px 16px;
}

.search-wrapper {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border-color);
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-wrapper:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.1);
}

.search-wrapper i.fa-search {
  color: var(--text-secondary);
  font-size: 14px;
}

.search-wrapper input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 400;
  outline: none;
  width: 100%;
}

.search-wrapper input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.btn-clear {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

.search-wrapper input:not(:placeholder-shown) ~ .btn-clear {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

.btn-clear:hover {
  background: var(--accent-red);
  color: white;
}

.segmented-control {
  padding: 0 16px 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.tab-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 10px 4px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
  box-shadow: 0 4px 12px rgba(10, 132, 255, 0.3);
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 30px;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-pane.active {
  display: block;
}

/* ── KPI Grid ── */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.kpi-card {
  background: linear-gradient(180deg, var(--card-bg), var(--card-bg-soft));
  padding: 16px 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border-color);
  transition: transform 0.2s, background 0.2s;
}

.kpi-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent-blue) 45%, var(--border-color));
}

.kpi-card i {
  font-size: 24px;
  color: var(--accent-blue);
  opacity: 0.9;
  width: 28px;
  text-align: center;
}

.kpi-data {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-bottom: 2px;
}

.kpi-value {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
}

/* ── Charts & Lists ── */
.stat-strip {
  background: var(--card-bg-soft);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  padding: 12px 20px;
  margin-bottom: 24px;
}

.stat-item {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.stat-item strong {
  color: var(--text-primary);
  margin-right: 4px;
}

.view-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  background: var(--card-bg-soft);
}

.view-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  letter-spacing: 0.02em;
}

.view-btn:first-child {
  border-right: 1px solid var(--border-color);
}

.view-btn.active {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(10, 132, 255, 0.3);
}

.filter-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.filter-chips::-webkit-scrollbar { display: none; }

.chip {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.chip:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.chip.active {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
  box-shadow: 0 4px 10px rgba(10, 132, 255, 0.3);
}

.chart-block h3, .list-section h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-left: 4px;
}

.chart-container {
  height: 200px;
  background: var(--card-bg);
  border-radius: 8px;
  padding: 20px;
  border: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.data-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-item {
  background: var(--card-bg-soft);
  padding: 14px 16px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.list-item.clickable:hover {
  background: var(--card-bg);
  border-color: var(--accent-blue);
  transform: translateX(2px);
}

.list-item-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.list-item-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
}

.list-item-sub {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.list-item-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-red);
}

/* ── Map View ── */
.map-view {
  flex: 1;
  position: relative;
}

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

.map-controls {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 1000;
}

.ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(44, 44, 46, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  padding: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

body.theme-light .ctrl-group {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.map-ctrl-btn {
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 18px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.map-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.map-ctrl-btn.active {
  background: var(--accent-blue);
  color: white;
  box-shadow: 0 4px 12px rgba(10, 132, 255, 0.4);
}

.map-legend {
  position: absolute;
  bottom: 30px;
  right: 24px;
  background: rgba(44, 44, 46, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  padding: 14px 18px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red { background: var(--accent-red); box-shadow: 0 0 10px var(--accent-red); }
.dot.blue { background: var(--accent-blue); box-shadow: 0 0 10px var(--accent-blue); }
.dot.yellow { background: var(--accent-yellow); box-shadow: 0 0 10px var(--accent-yellow); }

/* ── Cookie Banner ── */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 900px;
  background: rgba(28, 28, 30, 0.85);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--border-color);
  padding: 20px 30px;
  border-radius: 24px;
  z-index: 4000;
  display: flex;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  width: 100%;
}

.banner-content p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  font-weight: 500;
}

.banner-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--accent-blue);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #0071e3;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(10, 132, 255, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-text-link {
  background: transparent;
  border: none;
  color: var(--accent-blue);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s;
}

.btn-text-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* ── Detail Panel (Slide-out) ── */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.detail-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.detail-panel {
  position: fixed;
  top: 16px;
  bottom: 16px;
  right: -500px;
  width: var(--panel-w);
  background: var(--sidebar-bg);
  border-radius: 24px;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transition: right 0.6s cubic-bezier(0.19, 1, 0.22, 1);
  z-index: 3001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-overlay.active .detail-panel {
  right: 16px;
}

.dp-header {
  padding: 24px;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dp-header h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dp-content {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

/* ── Marker Clusters ── */
.marker-cluster {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.marker-cluster div {
  width: 32px;
  height: 32px;
  margin: 4px;
  text-align: center;
  border-radius: 50%;
  font: 12px var(--font-main);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.marker-cluster-small div { background: var(--accent-green); }
.marker-cluster-medium div { background: var(--accent-yellow); color: #000; }
.marker-cluster-large div { background: var(--accent-red); }

/* ── Guide & Components ── */
.guide-section { margin-bottom: 32px; }
.syndrome-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.syndrome-card { 
  background: var(--card-bg); 
  padding: 16px; 
  border-radius: 16px; 
  border: 1px solid var(--border-color);
}
.syndrome-card h4 { color: var(--accent-red); margin-bottom: 8px; font-weight: 700; }
.syndrome-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.4; margin-bottom: 12px; }
.symptom-list { list-style: none; font-size: 11px; }
.symptom-list li { margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.symptom-list li::before { content: "•"; color: var(--accent-red); font-weight: 900; }

.prevention-checklist {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.check-item { font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 12px; }
.check-item i { color: var(--accent-green); font-size: 14px; }

.timeline-visual { border-left: 2px solid var(--border-color); padding-left: 20px; margin-left: 8px; display: flex; flex-direction: column; gap: 24px; }
.timeline-point { position: relative; }
.timeline-point::before { content: ""; position: absolute; left: -27px; top: 4px; width: 12px; height: 12px; background: var(--accent-blue); border-radius: 50%; border: 3px solid var(--bg-color); box-shadow: 0 0 8px rgba(10,132,255,0.4); }
.point-title { display: block; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.point-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

/* ── Badges ── */
.badge-risk { padding: 3px 10px; border-radius: 6px; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.risk-critical { background: rgba(255, 69, 58, 0.15); color: #ff453a; border: 1px solid rgba(255, 69, 58, 0.2); }
.risk-high { background: rgba(255, 159, 10, 0.15); color: #ff9f0a; border: 1px solid rgba(255, 159, 10, 0.2); }
.risk-moderate { background: rgba(10, 132, 255, 0.15); color: #0a84ff; border: 1px solid rgba(10, 132, 255, 0.2); }
.risk-low { background: rgba(34, 211, 197, 0.15); color: var(--accent-teal); border: 1px solid rgba(34, 211, 197, 0.22); }
.badge-source {
  color: var(--accent-teal);
  font-weight: 800;
  letter-spacing: 0;
}

.alert-desc,
.strain-info-text {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 8px;
}

.sources-grouped {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.source-group {
  background: var(--card-bg-soft);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.source-group h5 {
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
}

.source-group a {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.source-group a:hover {
  color: var(--accent-blue);
}

/* ── Scrollbars ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ── Utilities ── */
.clickable { cursor: pointer; }
.rtl { direction: rtl; }
.rtl .header-left, .rtl .header-right { flex-direction: row-reverse; }
.rtl .logo-text { text-align: right; }
.rtl .kpi-card { flex-direction: row-reverse; }
.rtl .list-item { flex-direction: row-reverse; }
.rtl .list-item-main { text-align: right; }
.rtl .dp-header { flex-direction: row-reverse; }
.rtl .detail-panel { right: auto; left: -500px; transition: left 0.6s cubic-bezier(0.19, 1, 0.22, 1); }
.rtl.detail-overlay.active .detail-panel { left: 16px; right: auto; }

@media (max-width: 1100px) {
  :root {
    --sidebar-w: 340px;
    --panel-w: min(420px, calc(100vw - 32px));
  }

  .main-header {
    padding: 0 16px;
  }

  .header-left,
  .header-right {
    gap: 12px;
  }

  .filter-picker {
    max-width: 180px;
  }

  .select-modern {
    width: 100%;
  }
}

/* ── Screenshot-aligned desktop shell ── */
@media (min-width: 821px) {
  :root {
    --header-h: 52px;
    --ribbon-h: 28px;
    --sidebar-w: 320px;
  }

  .main-header {
    padding: 0 24px;
  }

  .header-left,
  .header-right {
    gap: 16px;
  }

  .logo {
    gap: 10px;
  }

  .logo i {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 69, 58, 0.35);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 69, 58, 0.14);
    font-size: 16px;
  }

  .logo-text h1 {
    font-size: 18px;
  }

  .logo-text span {
    font-size: 11px;
    letter-spacing: 0;
    text-transform: none;
  }

  .live-badge {
    border: 0;
    border-radius: 999px;
    background: var(--accent-red);
    color: #fff;
    padding: 3px 9px;
    font-size: 11px;
  }

  .pulse {
    display: none;
  }

  .select-modern,
  .lang-picker,
  .btn-icon {
    min-height: 30px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.05);
    font-size: 12px;
  }

  .btn-icon {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  #export-csv {
    width: auto;
    padding: 0 13px;
    gap: 8px;
  }

  #export-csv::after {
    content: "Export CSV";
    font-size: 12px;
    font-weight: 700;
  }

  .status-ribbon {
    padding: 0 24px;
  }

  .ribbon-content {
    font-size: 11px;
  }

  .source-tag {
    border-radius: 4px;
    padding: 2px 7px;
    background: rgba(10, 132, 255, 0.14);
    color: var(--accent-blue);
    border-color: rgba(10, 132, 255, 0.35);
  }

  .sidebar {
    background: #030405;
  }

  .sidebar-search {
    padding: 12px 12px 14px;
  }

  .search-wrapper {
    border-radius: 8px;
    padding: 11px 12px;
    background: rgba(255, 255, 255, 0.12);
  }

  .segmented-control {
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding: 0;
    border-bottom: 1px solid var(--border-color);
  }

  .tab-btn {
    min-width: 53px;
    margin: 0;
    padding: 8px 0 10px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 12px;
  }

  .tab-btn.active,
  .tab-btn:hover {
    background: transparent;
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    box-shadow: none;
  }

  .sidebar-scroll {
    padding: 16px 16px 30px;
  }

  .kpi-grid {
    gap: 0;
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.055);
  }

  .kpi-card {
    min-height: 78px;
    border: 0;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    background: transparent;
    padding: 14px 12px;
  }

  .kpi-card:nth-child(2n) {
    border-right: 0;
  }

  .kpi-card:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .kpi-card:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.04);
  }

  .kpi-card i {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(10, 132, 255, 0.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
  }

  .kpi-value {
    font-size: 26px;
  }

  .stat-strip {
    margin-bottom: 16px;
    padding: 12px 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.055);
  }

  .stat-item {
    flex: 1;
    border-right: 1px solid var(--border-color);
    text-align: center;
  }

  .stat-item:last-child {
    border-right: 0;
  }

  .filter-chips {
    margin-bottom: 18px;
  }

  .chip {
    border-radius: 999px;
    padding: 7px 12px;
    background: rgba(255, 255, 255, 0.06);
  }

  .chart-block h3,
  .list-section h3 {
    margin-bottom: 10px;
    font-size: 11px;
    letter-spacing: 0.08em;
  }

  .chart-container {
    height: 170px;
    margin-bottom: 18px;
    border-radius: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.055);
  }

  .map-controls {
    top: 12px;
    right: 12px;
    gap: 8px;
  }

  .ctrl-group {
    border-radius: 8px;
    gap: 4px;
  }

  .map-ctrl-btn {
    width: 36px;
    height: 36px;
    border-radius: 7px;
    font-size: 14px;
  }

  .map-legend {
    right: 16px;
    bottom: 16px;
    border-radius: 8px;
    padding: 12px 14px;
  }
}

/* Professional surveillance UI pass */
:root {
  --bg-color: #07090c;
  --header-bg: #101318;
  --sidebar-bg: #090b0f;
  --card-bg: #151922;
  --card-bg-soft: #10141b;
  --text-primary: #f5f7fb;
  --text-secondary: #8c96a5;
  --border-color: rgba(255, 255, 255, 0.10);
  --accent-blue: #1683ff;
  --accent-red: #ff4d4f;
  --accent-yellow: #f5a524;
  --accent-green: #22c55e;
  --accent-teal: #14b8a6;
  --header-h: 56px;
  --ribbon-h: 28px;
  --sidebar-w: 344px;
  --panel-w: 440px;
}

body {
  background: var(--bg-color);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.theme-light {
  --bg-color: #f4f6f8;
  --header-bg: #ffffff;
  --sidebar-bg: #ffffff;
  --card-bg: #ffffff;
  --card-bg-soft: #f8fafc;
  --text-primary: #111827;
  --text-secondary: #667085;
  --border-color: rgba(17, 24, 39, 0.10);
}

.main-header {
  height: var(--header-h);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
}

.header-left,
.header-right {
  gap: 14px;
}

.logo {
  gap: 10px;
}

.logo i {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 77, 79, 0.35);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 77, 79, 0.12);
  color: var(--accent-red);
  font-size: 15px;
  filter: none;
}

.logo-text h1 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.1;
}

.logo-text span {
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
}

.live-badge {
  border: 0;
  border-radius: 999px;
  background: var(--accent-red);
  color: #fff;
  padding: 4px 9px;
  font-size: 11px;
  letter-spacing: 0;
}

.pulse {
  display: none;
}

.select-modern,
.lang-picker,
.btn-icon {
  min-height: 32px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.045);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 650;
}

.lang-picker {
  padding: 0 12px;
}

.btn-icon {
  width: 34px;
  height: 34px;
  font-size: 14px;
}

#export-csv {
  width: auto;
  padding: 0 13px;
  gap: 8px;
  color: var(--accent-blue);
  border-color: rgba(22, 131, 255, 0.38);
  background: rgba(22, 131, 255, 0.10);
}

#export-csv::after {
  content: "Export CSV";
  font-size: 12px;
  font-weight: 700;
}

.status-ribbon {
  height: var(--ribbon-h);
  background: #14171c;
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
}

body.theme-light .status-ribbon {
  background: #f8fafc;
}

.ribbon-content {
  font-size: 11px;
}

.ribbon-sources {
  align-items: center;
}

.source-tag {
  border-radius: 4px;
  padding: 2px 7px;
  background: rgba(22, 131, 255, 0.12);
  border-color: rgba(22, 131, 255, 0.28);
  color: #5dadef;
  letter-spacing: 0;
}

.middle-text {
  color: var(--accent-yellow);
  font-weight: 750;
}

.ribbon-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

#sync-timestamp {
  color: var(--text-secondary);
  font-size: 10px;
}

.app-body {
  min-height: 0;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  box-shadow: 16px 0 36px rgba(0, 0, 0, 0.30);
}

.sidebar-search {
  padding: 14px 12px 12px;
}

.search-wrapper {
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid var(--border-color);
  padding: 0 12px;
}

.search-wrapper input {
  font-size: 14px;
}

.segmented-control {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 0;
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  min-width: max-content;
  flex: 1 0 auto;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  padding: 9px 8px 10px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 650;
}

.tab-btn.active,
.tab-btn:hover {
  background: transparent;
  color: var(--accent-blue);
  border-color: var(--accent-blue);
  box-shadow: none;
  transform: none;
}

.sidebar-scroll {
  padding: 16px;
}

.kpi-grid {
  gap: 0;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--card-bg-soft);
}

.kpi-card {
  min-height: 78px;
  border: 0;
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  background: transparent;
  padding: 14px 12px;
  gap: 12px;
}

.kpi-card:nth-child(2n) {
  border-right: 0;
}

.kpi-card:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.kpi-card:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.035);
}

.kpi-card i {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(22, 131, 255, 0.13);
  color: var(--accent-blue);
  font-size: 15px;
}

.kpi-card:nth-child(2) i,
.kpi-card:nth-child(6) i {
  background: rgba(255, 77, 79, 0.13);
  color: var(--accent-red);
}

.kpi-card:nth-child(3) i {
  background: rgba(245, 165, 36, 0.13);
  color: var(--accent-yellow);
}

.kpi-card:nth-child(5) i {
  background: rgba(20, 184, 166, 0.13);
  color: var(--accent-teal);
}

.kpi-label {
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.kpi-value {
  color: var(--text-primary);
  font-size: 25px;
  font-weight: 760;
  line-height: 1;
}

.stat-strip {
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--card-bg-soft);
  padding: 12px 8px;
}

.stat-item {
  flex: 1;
  border-right: 1px solid var(--border-color);
  text-align: center;
  font-size: 10px;
  line-height: 1.25;
}

.stat-item:last-child {
  border-right: 0;
}

.filter-chips {
  margin-bottom: 18px;
}

.chip {
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.055);
  font-size: 12px;
}

.chip.active {
  background: rgba(22, 131, 255, 0.16);
  border-color: var(--accent-blue);
  color: #d7ebff;
  box-shadow: none;
}

.chart-block h3,
.list-section h3,
.guide-section h3 {
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.chart-container,
.list-item,
.syndrome-card,
.prevention-checklist,
.source-group,
/* ── Myths ── */
.myths-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 2px 0;
}

.myth-card {
  display: flex;
  gap: 14px;
  padding: 18px 16px;
  border-radius: 12px;
  background: var(--card-bg-soft);
  border: 1px solid var(--border-color);
  transition: all 0.25s ease;
}

.myth-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: var(--card-bg);
  transform: translateX(3px);
}

.myth-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
}

.myth-card:nth-child(odd) .myth-icon {
  background: linear-gradient(135deg, rgba(255, 77, 79, 0.15), rgba(255, 77, 79, 0.05));
  color: var(--accent-red);
  border: 1px solid rgba(255, 77, 79, 0.15);
}

.myth-card:nth-child(even) .myth-icon {
  background: linear-gradient(135deg, rgba(50, 215, 75, 0.15), rgba(50, 215, 75, 0.05));
  color: var(--accent-green);
  border: 1px solid rgba(50, 215, 75, 0.15);
}

.myth-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.myth-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 8px;
}

.myth-text .myth-label {
  background: rgba(255, 77, 79, 0.12);
  color: #ff6b6b;
}

.fact-text .fact-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 8px;
  background: rgba(50, 215, 75, 0.12);
  color: #4cd964;
}

.myth-text {
  font-size: 13px;
  font-weight: 450;
  color: var(--text-primary);
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.fact-text {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.55;
  letter-spacing: 0;
  /* Make "Fact" clearly distinct from "Myth" for readability. */
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-left: 0;
}

.chart-container {
  height: 168px;
  margin-bottom: 18px;
  padding: 12px;
}

.data-list {
  gap: 8px;
}

.list-item {
  padding: 12px;
}

.list-item.clickable:hover {
  border-color: rgba(22, 131, 255, 0.44);
  background: var(--card-bg);
  transform: none;
}

.list-item-title {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 650;
}

.list-item-sub,
.alert-desc,
.strain-info-text {
  color: var(--text-secondary);
  font-size: 11px;
}

.list-item-value {
  color: var(--accent-blue);
  font-size: 18px;
}

#map {
  background: #0a0d11;
}

.map-view::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02), inset 18px 0 40px rgba(0,0,0,0.24);
  z-index: 500;
}

.map-controls {
  top: 12px;
  right: 12px;
  gap: 8px;
}

.ctrl-group {
  gap: 4px;
  border-radius: 10px;
  background: rgba(16, 19, 24, 0.78);
  border: 1px solid var(--border-color);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
}

.map-ctrl-btn {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  font-size: 14px;
}

.map-ctrl-btn.active {
  background: rgba(22, 131, 255, 0.92);
  box-shadow: none;
}

.map-legend {
  right: 16px;
  bottom: 16px;
  border-radius: 10px;
  background: rgba(16, 19, 24, 0.82);
  padding: 12px 14px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
}

.legend-item {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ── Map Tooltip ── */
.leaflet-tooltip.map-tooltip {
  font-family: var(--font-main);
  font-size: 12px;
  line-height: 1.4;
}

/* ── Map Stats Panel (outbreak mode) ── */
.map-stats-panel {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1000;
  background: rgba(16, 19, 24, 0.92);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 16px;
  min-width: 200px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  display: none;
}

.map-stats-panel.visible {
  display: block;
}

.map-stats-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-red);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.map-stats-header i {
  font-size: 14px;
}

.map-stats-grid {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.map-stat-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 10px 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.map-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-blue);
  line-height: 1;
}

.map-stat-deaths {
  color: var(--accent-red);
}

.map-stat-cfr {
  color: var(--accent-yellow);
  font-size: 18px;
}

.map-stat-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-top: 4px;
}

.map-stats-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  font-size: 9px;
  color: var(--text-secondary);
}

.map-stats-source {
  font-weight: 600;
  color: var(--accent-teal);
}

.map-stats-updated {
  font-weight: 500;
}

body.theme-light .map-stats-panel {
  background: rgba(255, 255, 255, 0.95);
}

.cookie-banner {
  border-radius: 0;
  bottom: 0;
  width: 100%;
  max-width: none;
  background: rgba(16, 19, 24, 0.96);
  padding: 18px 40px;
}

.banner-content {
  max-width: 1200px;
  margin: 0 auto;
}

.btn-primary,
.btn-secondary {
  border-radius: 999px;
  padding: 10px 18px;
}

@media (max-width: 820px) {
  :root {
    --header-h: auto;
    --ribbon-h: auto;
    --sidebar-w: 100%;
  }

  .main-header {
    padding: 12px 14px;
  }

  .header-right {
    gap: 8px;
  }

  .status-ribbon {
    padding: 9px 14px;
  }

  .ribbon-meta {
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  .sidebar-scroll {
    padding: 14px;
  }
}

@media (max-width: 520px) {
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .kpi-card:nth-child(2n) {
    border-right: 0;
  }

  .kpi-card:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

/* ── BitOPS-style polish pass ───────────────────────────── */
:root {
  --bg-color: #0f0f10;
  --header-bg: #161616;
  --sidebar-bg: #13161b;
  --card-bg: #1c1c1c;
  --card-bg-soft: #17191d;
  --text-primary: #efefef;
  --text-secondary: #a0a0a0;
  --border-color: rgba(255, 255, 255, 0.10);
  --accent-blue: #8b8bff;
  --accent-red: #e5484d;
  --accent-yellow: #f0a446;
  --accent-green: #45a663;
  --accent-teal: #14b8a6;
  --sidebar-w: 360px;
  --panel-w: 420px;
}

body.theme-light {
  --bg-color: #f5f4f0;
  --header-bg: #ffffff;
  --sidebar-bg: #ffffff;
  --card-bg: #ffffff;
  --card-bg-soft: #f7f6f2;
  --text-primary: #1a1a1a;
  --text-secondary: #5c5c5c;
  --border-color: rgba(0, 0, 0, 0.10);
}

body {
  background: var(--bg-color);
}

.main-header,
.status-ribbon,
.sidebar,
.detail-panel {
  border-radius: 0;
}

.main-header {
  height: 56px;
  padding: 0 20px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
}

.status-ribbon {
  height: 30px;
  padding: 0 20px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
}

.select-modern,
.lang-picker,
.btn-icon,
.btn-primary,
.btn-secondary {
  border-radius: 8px;
}

.select-modern,
.lang-picker {
  min-height: 32px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
}

.btn-icon {
  width: 34px;
  height: 34px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
}

.btn-primary,
.btn-secondary {
  padding: 10px 14px;
  font-size: 13px;
}

.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
}

.sidebar-search {
  padding: 14px 12px 12px;
}

.search-wrapper {
  height: 38px;
  border-radius: 8px;
  background: var(--card-bg-soft);
}

.segmented-control {
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  border-radius: 6px 6px 0 0;
  box-shadow: none;
}

.kpi-grid,
.chart-container,
.list-item,
.syndrome-card,
.prevention-checklist,
.source-group,
.myth-card,
.stat-strip,
.alert-card,
.detail-section {
  border-radius: 10px;
}

.kpi-grid,
.chart-container,
.stat-strip {
  background: var(--card-bg-soft);
  border: 1px solid var(--border-color);
}

.kpi-card {
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
}

.list-item {
  padding: 12px 14px;
  background: var(--card-bg-soft);
}

.list-item.clickable:hover {
  transform: none;
  background: var(--card-bg);
  border-color: var(--border-color);
}

.list-item-title {
  font-size: 14px;
}

.btn-text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-blue);
  text-transform: none;
  letter-spacing: 0;
}

.btn-text-link:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.alert-card {
  align-items: flex-start;
  gap: 10px;
}

.alert-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.alert-card-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.alert-card-source,
.alert-card-date,
.alert-card-sub {
  font-size: 10px;
  line-height: 1.2;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.alert-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.alert-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.alert-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.detail-overlay {
  background: rgba(0, 0, 0, 0.24);
}

.detail-panel {
  top: 12px;
  bottom: 12px;
  right: -460px;
  width: min(420px, calc(100vw - 24px));
  background: var(--sidebar-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.42);
}

.detail-overlay.active .detail-panel {
  right: 12px;
}

.dp-header {
  padding: 14px 16px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
}

.dp-header h2 {
  font-size: 16px;
}

.dp-content {
  padding: 16px;
}

.detail-report {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.detail-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-source {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-title {
  font-size: 20px;
  line-height: 1.15;
  font-weight: 700;
  margin: 0 0 4px;
}

.detail-subtitle {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.detail-description {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.detail-metrics .metric-card {
  padding: 12px;
  border-radius: 10px;
  background: var(--card-bg-soft);
  border: 1px solid var(--border-color);
}

.metric-label {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.metric-value {
  font-size: 20px;
  line-height: 1;
}

.metric-blue { color: var(--accent-blue); }
.metric-red { color: var(--accent-red); }
.metric-yellow { color: var(--accent-yellow); }

.detail-section {
  padding: 12px;
  background: var(--card-bg-soft);
  border: 1px solid var(--border-color);
}

.detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detail-chip {
  padding: 2px 8px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--card-bg);
}

.detail-section-body p {
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.detail-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-mini-label {
  display: block;
  margin-bottom: 3px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.detail-mini-grid strong {
  font-size: 11px;
  color: var(--text-primary);
  word-break: break-word;
}

.detail-list {
  display: grid;
  gap: 8px;
}

.detail-list-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text-primary);
}

.detail-list-item i {
  margin-top: 2px;
  color: var(--accent-green);
}

.detail-list-item .fa-circle-info {
  color: var(--accent-blue);
}

.detail-actions {
  display: flex;
  gap: 8px;
}

.detail-map-btn,
.detail-export-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
}

.detail-map-btn {
  background: var(--card-bg-soft);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.detail-map-btn:hover {
  background: var(--card-bg);
}

.map-controls {
  top: 12px;
  right: 12px;
  gap: 10px;
}

.ctrl-group {
  border-radius: 10px;
  background: rgba(17, 17, 18, 0.78);
  border: 1px solid var(--border-color);
}

.map-ctrl-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.map-legend {
  right: 12px;
  bottom: 12px;
  border-radius: 10px;
  background: rgba(17, 17, 18, 0.82);
}

@media (max-width: 820px) {
  .detail-panel {
    width: calc(100vw - 16px);
    right: -100vw;
  }

  .detail-overlay.active .detail-panel {
    right: 8px;
  }

  .detail-metrics {
    grid-template-columns: 1fr;
  }

  .detail-actions {
    flex-direction: column;
  }
}

/* ── Mobile Optimization ─────────────────────────────── */
@media (max-width: 820px) {
  :root {
    --sidebar-w: 100%;
    --header-h: auto;
    --ribbon-h: auto;
    --panel-w: calc(100vw - 16px);
  }

  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
    font-size: 15px;
  }

  .main-header {
    padding: 10px 14px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-left { gap: 10px; }
  .header-right { gap: 6px; }

  .logo i { font-size: 22px; width: 28px; }
  .logo-text h1 { font-size: 15px; }
  .logo-text span { font-size: 9px; }

  .live-badge { font-size: 9px; padding: 2px 8px; }

  .select-modern {
    font-size: 11px;
    padding: 5px 10px;
    min-height: 28px;
    max-width: 140px;
  }

  .lang-picker {
    font-size: 11px;
    min-height: 28px;
    padding: 0 10px;
  }

  .btn-icon {
    width: 30px;
    height: 30px;
    font-size: 13px;
    min-height: 30px;
  }

  .status-ribbon { padding: 8px 14px; }
  .ribbon-content { flex-direction: column; gap: 6px; }
  .ribbon-meta { flex-wrap: wrap; gap: 6px 10px; }
  .middle-text { font-size: 10px; }

  .app-body {
    flex-direction: column;
    overflow: visible;
  }

  .sidebar {
    width: 100%;
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .sidebar-search { padding: 10px 10px 8px; }
  .search-wrapper { height: 34px; padding: 0 10px; }
  .search-wrapper input { font-size: 13px; }

  .segmented-control {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .segmented-control::-webkit-scrollbar { display: none; }

  .tab-btn {
    font-size: 11px;
    padding: 7px 6px 8px;
    white-space: nowrap;
    flex: 0 0 auto;
    min-width: max-content;
  }

  .sidebar-scroll { padding: 12px; }

  .kpi-grid {
    gap: 6px;
    margin-bottom: 12px;
  }

  .kpi-card {
    padding: 10px 10px;
    min-height: 60px;
    gap: 8px;
  }

  .kpi-card i {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .kpi-label { font-size: 8px; }
  .kpi-value { font-size: 18px; }

  .stat-strip {
    padding: 8px 6px;
    margin-bottom: 12px;
    flex-direction: column;
    gap: 4px;
  }

  .stat-item {
    font-size: 9px;
    text-align: left;
    border-right: none;
    padding: 2px 0;
  }

  .view-toggle { margin-bottom: 8px; }
  .view-btn { font-size: 10px; padding: 6px 8px; }

  .filter-chips { margin-bottom: 12px; gap: 6px; }
  .chip { font-size: 10px; padding: 5px 10px; }

  .chart-block h3, .list-section h3 { font-size: 10px; }
  .chart-container { height: 140px; margin-bottom: 12px; padding: 8px; }

  .data-list { gap: 6px; }
  .list-item { padding: 10px 10px; }
  .list-item-title { font-size: 12px; }
  .list-item-sub { font-size: 10px; }
  .list-item-value { font-size: 14px; }

  .map-view { min-height: 50vh; }

  .map-controls {
    top: 8px;
    right: 8px;
    gap: 6px;
  }

  .ctrl-group { gap: 2px; border-radius: 8px; }
  .map-ctrl-btn { width: 32px; height: 32px; font-size: 13px; border-radius: 6px; }

  .map-legend {
    right: 8px;
    bottom: 8px;
    padding: 8px 10px;
    border-radius: 8px;
  }

  .map-legend .legend-item { font-size: 9px; gap: 6px; }
  .legend-item .dot { width: 7px; height: 7px; }

  .map-stats-panel {
    top: 8px;
    left: 8px;
    padding: 10px 12px;
    min-width: 160px;
  }

  .map-stats-header { font-size: 10px; margin-bottom: 8px; padding-bottom: 6px; }
  .map-stats-grid { gap: 6px; }
  .map-stat-card { padding: 6px 4px; }
  .map-stat-value { font-size: 16px; }
  .map-stat-label { font-size: 7px; }
  .map-stats-footer { font-size: 8px; }

	  .myths-container { gap: 8px; }
	  .myth-card { padding: 12px 12px; gap: 10px; }
	  .myth-icon { width: 30px; height: 30px; font-size: 13px; }
	  .myth-text { font-size: 11.5px; }
	  .fact-text { font-size: 10.5px; margin-top: 8px; padding-top: 8px; }
	  .myth-label, .fact-text .fact-label { font-size: 7.5px; padding: 1px 6px; }

  .cookie-banner {
    bottom: 8px;
    width: calc(100% - 16px);
    padding: 12px 14px;
    border-radius: 10px;
  }

  .banner-content { gap: 10px; }
  .banner-content p { font-size: 11px; }
  .btn-primary, .btn-secondary { padding: 8px 14px; font-size: 12px; }

  .detail-panel { top: 8px; bottom: 8px; border-radius: 12px; }

  .syndrome-grid { grid-template-columns: 1fr; }
  .sources-grouped { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 4px; }
  .kpi-card { padding: 8px 8px; min-height: 52px; }
  .kpi-value { font-size: 16px; }
  .kpi-card i { width: 24px; height: 24px; font-size: 11px; }

  .map-view { min-height: 40vh; }

  .map-controls { top: 6px; right: 6px; gap: 4px; }
  .ctrl-group { padding: 2px; }
  .map-ctrl-btn { width: 28px; height: 28px; font-size: 11px; }

  .map-legend { padding: 6px 8px; }
  .map-legend .legend-item { font-size: 8px; }

  .map-stats-panel {
    top: 6px;
    left: 6px;
    padding: 8px 10px;
    min-width: 130px;
  }
  .map-stats-header { font-size: 9px; margin-bottom: 6px; }
  .map-stat-value { font-size: 14px; }
  .map-stat-card { padding: 4px 3px; }

	  .myth-card { padding: 10px 10px; gap: 8px; }
	  .myth-icon { width: 26px; height: 26px; font-size: 11px; }
	  .myth-text { font-size: 11px; }
	  .fact-text { font-size: 10px; margin-top: 7px; padding-top: 7px; }
	  .myth-label, .fact-text .fact-label { font-size: 7px; padding: 1px 5px; }

  .main-header { padding: 8px 10px; }
  .header-left { gap: 6px; }
  .logo-text h1 { font-size: 13px; }
  .logo i { font-size: 18px; width: 24px; height: 24px; }

  .segmented-control { gap: 0; }
  .tab-btn { font-size: 10px; padding: 6px 4px; }

  .sidebar-scroll { padding: 8px; }
  .list-item { padding: 8px 8px; }
  .list-item-title { font-size: 11px; }
}
