@font-face { font-family: "IBM Plex Mono"; src: url("/static/vendor/fonts/ibm-plex-mono-400.ttf") format("truetype"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/static/vendor/fonts/ibm-plex-mono-500.ttf") format("truetype"); font-style: normal; font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/static/vendor/fonts/ibm-plex-mono-600.ttf") format("truetype"); font-style: normal; font-weight: 600; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("/static/vendor/fonts/plus-jakarta-500.ttf") format("truetype"); font-style: normal; font-weight: 500; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("/static/vendor/fonts/plus-jakarta-600.ttf") format("truetype"); font-style: normal; font-weight: 600; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("/static/vendor/fonts/plus-jakarta-700.ttf") format("truetype"); font-style: normal; font-weight: 700; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("/static/vendor/fonts/plus-jakarta-800.ttf") format("truetype"); font-style: normal; font-weight: 800; font-display: swap; }

:root {
  --navy-950: #071521;
  --navy-900: #0b1d2b;
  --navy-800: #102b3c;
  --blue-700: #145f86;
  --blue-600: #0f7eae;
  --cyan-500: #12b8cf;
  --cyan-300: #66ddeb;
  --ink: #12212c;
  --muted: #667b89;
  --line: #dbe6ec;
  --surface: #ffffff;
  --canvas: #f3f7f9;
  --shadow: 0 16px 44px rgba(3, 27, 43, .14);
  --shadow-soft: 0 8px 24px rgba(3, 27, 43, .09);
  --header-h: 68px;
  --filter-w: 318px;
  --events-w: 370px;
  --sans: "Plus Jakarta Sans", "Noto Sans CJK SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; color: var(--ink); background: var(--canvas); }
body { font-family: var(--sans); overflow: hidden; }
button, input, select { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-header {
  position: fixed; inset: 0 0 auto 0; z-index: 900;
  height: var(--header-h); padding: 0 18px 0 20px;
  display: grid; grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr);
  align-items: center; color: #fff;
  background: linear-gradient(110deg, var(--navy-950), var(--navy-900) 62%, #0b2637);
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 5px 22px rgba(3, 18, 29, .22);
}
.brand { display: inline-flex; align-items: center; gap: 11px; width: fit-content; color: inherit; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--cyan-300); background: rgba(18, 184, 207, .12); border: 1px solid rgba(102, 221, 235, .25); }
.brand-mark svg { width: 27px; }
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { font-size: 18px; letter-spacing: -.03em; }
.brand-copy small { margin-top: 5px; font: 500 10px var(--mono); letter-spacing: .08em; color: #9db2c0; }
.page-nav { align-self: stretch; display: flex; align-items: center; gap: 4px; padding: 6px; }
.nav-button { height: 42px; min-width: 98px; padding: 0 17px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; color: #9fb3c0; background: transparent; font-size: 13px; font-weight: 700; transition: .18s ease; }
.nav-button svg { width: 18px; }
.nav-button:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav-button.active { color: #fff; background: rgba(18, 184, 207, .16); box-shadow: inset 0 0 0 1px rgba(102, 221, 235, .2); }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 13px; }
.data-status { display: flex; align-items: center; gap: 7px; color: #aac0cd; font: 500 10px var(--mono); }
.data-status i { width: 7px; height: 7px; border-radius: 50%; background: #35dda0; box-shadow: 0 0 0 4px rgba(53, 221, 160, .1); }
.data-status b { font-weight: 500; color: #718c9c; }
.language-toggle { display: flex; padding: 3px; border: 1px solid rgba(255, 255, 255, .13); border-radius: 9px; background: rgba(255, 255, 255, .04); }
.language-toggle button { height: 28px; min-width: 42px; padding: 0 8px; border: 0; border-radius: 6px; color: #8fa8b7; background: transparent; font-size: 11px; font-weight: 700; }
.language-toggle button.active { color: var(--navy-950); background: var(--cyan-300); }

.filter-panel {
  position: fixed; z-index: 700; left: 0; top: var(--header-h); bottom: 0; width: var(--filter-w);
  padding: 24px 22px 20px; display: flex; flex-direction: column; overflow-y: auto; background: rgba(255, 255, 255, .97);
  border-right: 1px solid var(--line); box-shadow: 8px 0 28px rgba(10, 40, 57, .08);
  scrollbar-width: thin; scrollbar-color: #c7d6dd transparent;
}
.panel-title-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.eyebrow { display: block; margin-bottom: 6px; color: var(--blue-600); font: 700 9px var(--mono); letter-spacing: .18em; text-transform: uppercase; }
.panel-title-row h2, .event-panel-header h2 { margin: 0; color: var(--navy-900); font-size: 20px; letter-spacing: -.035em; }
.icon-text-button { display: flex; align-items: center; gap: 5px; padding: 6px 0; border: 0; color: var(--muted); background: transparent; font-size: 11px; }
.icon-text-button:hover { color: var(--blue-600); }
.icon-text-button svg { width: 14px; }
.field { display: grid; gap: 7px; margin-bottom: 15px; color: #536c7b; font-size: 11px; font-weight: 700; }
.field input, .field select, .input-shell { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #f8fbfc; outline: none; transition: .18s ease; }
.field input, .field select { padding: 0 12px; }
.field input:focus, .field select:focus, .input-shell:focus-within { border-color: var(--cyan-500); background: #fff; box-shadow: 0 0 0 3px rgba(18, 184, 207, .1); }
.multi-select { position:relative; min-width:0; }
.multi-select-toggle { width:100%; height:42px; padding:0 11px 0 12px; display:flex; align-items:center; justify-content:space-between; gap:8px; border:1px solid var(--line); border-radius:10px; color:var(--ink); background:#f8fbfc; text-align:left; transition:.18s ease; }
.multi-select-toggle:hover, .multi-select.open .multi-select-toggle { border-color:var(--cyan-500); background:#fff; box-shadow:0 0 0 3px rgba(18,184,207,.1); }
.multi-select-toggle span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; font-weight:600; }
.multi-select-toggle svg { width:15px; flex:0 0 auto; color:#708793; transition:transform .18s ease; }
.multi-select.open .multi-select-toggle svg { transform:rotate(180deg); }
.multi-select-menu { position:relative; z-index:1; width:100%; margin-top:6px; max-height:294px; overflow:hidden; border:1px solid #cbdde4; border-radius:11px; background:#fff; box-shadow:0 10px 24px rgba(8,40,57,.12); }
.multi-select-menu[hidden] { display:none; }
.multi-option-list { max-height:248px; padding:4px; overflow-y:auto; scrollbar-width:thin; scrollbar-color:#c6d8df transparent; }
.multi-option { min-height:36px; padding:7px 9px; display:flex; align-items:center; gap:9px; border-radius:8px; color:#526b78; cursor:pointer; font-size:10px; font-weight:650; }
.multi-option:hover { background:#edf6f8; color:var(--navy-900); }
.multi-option-all { margin:4px; border-bottom:1px solid var(--line); border-radius:8px 8px 3px 3px; color:var(--blue-700); }
.multi-option input { width:15px; height:15px; flex:0 0 auto; margin:0; padding:0; border:0; box-shadow:none; accent-color:var(--cyan-500); }
.multi-option i { width:8px; height:8px; flex:0 0 auto; border-radius:50%; background:var(--option-color); }
.multi-option b { margin-left:auto; color:#8da0aa; font:500 8px var(--mono); }
.input-shell { display: flex; align-items: center; padding-left: 12px; }
.input-shell svg { flex: 0 0 auto; width: 17px; color: #8ca0ac; }
.input-shell input { height: 39px; border: 0; background: transparent; box-shadow: none !important; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.primary-action { width: 100%; height: 44px; margin-top: 2px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 11px; color: #fff; background: linear-gradient(105deg, var(--blue-600), #119cb9); box-shadow: 0 9px 20px rgba(15, 126, 174, .22); font-size: 12px; font-weight: 800; transition: .18s ease; }
.primary-action:hover { transform: translateY(-1px); filter: brightness(1.04); }
.primary-action svg { width: 16px; }
.filter-context { margin: 20px 0; padding: 14px 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.filter-context div + div { padding-left: 15px; border-left: 1px solid var(--line); }
.filter-context span { display: block; color: var(--muted); font-size: 9px; }
.filter-context strong { display: block; margin-top: 5px; font: 600 13px var(--mono); color: var(--navy-900); }
.mini-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; color: var(--muted); font-size: 10px; font-weight: 700; }
.mini-heading b { color: var(--blue-600); font: 600 10px var(--mono); }
.timeline { height: 54px; display: flex; align-items: flex-end; gap: 1px; }
.timeline i { flex: 1; min-width: 1px; border-radius: 2px 2px 0 0; background: linear-gradient(to top, var(--blue-600), var(--cyan-300)); opacity: .82; transition: .15s ease; }
.timeline i:hover { opacity: 1; background: var(--cyan-500); }
.timeline-axis { display: flex; justify-content: space-between; margin-top: 6px; color: #8b9da8; font: 500 9px var(--mono); }
.contact-card { position: sticky; z-index: 3; bottom: -20px; margin-top: auto; padding: 15px 0 20px; display: grid; gap: 5px; border-top: 1px solid var(--line); color: #708692; background: rgba(255,255,255,.98); box-shadow: 0 -10px 18px rgba(255,255,255,.94); font-style: normal; font-size: 9px; line-height: 1.55; }
.contact-card strong { color: var(--navy-900); font-size: 11px; letter-spacing: -.01em; }
.contact-card strong span { margin-left: 4px; color: var(--blue-600); font: 600 9px var(--mono); }
.contact-card a { width: fit-content; color: var(--blue-700); text-decoration: none; }
.contact-card a:hover { color: var(--cyan-500); text-decoration: underline; }
.contact-card p { margin: 2px 0 0; }
html[lang="zh-CN"] .contact-en, html[lang="en"] .contact-zh { display: none; }

.view-shell { position: fixed; inset: var(--header-h) 0 0 var(--filter-w); }
.app-view { display: none; width: 100%; height: 100%; }
.app-view.active { display: block; }
.map-view { width:100%; height:100%; grid-template-columns:minmax(0,1fr) var(--events-w); background:#d9e6e9; }
.map-view.active { display:grid; }
.map-stage, #map { position: relative; width: 100%; height: 100%; min-width:0; min-height:0; background: #d9e6e9; }
.map-stage { overflow:hidden; }
.leaflet-container { font-family: var(--sans); }
.leaflet-control-attribution { border-radius: 7px 0 0 0; font-size: 9px !important; }
.leaflet-control-zoom { margin: 0 18px 18px 0 !important; border: 0 !important; box-shadow: var(--shadow-soft) !important; }
.leaflet-control-zoom a { width: 34px !important; height: 34px !important; line-height: 32px !important; border-color: var(--line) !important; color: var(--navy-900) !important; }
.hazard-marker { border: 2px solid rgba(255,255,255,.92); border-radius: 50%; box-shadow: 0 2px 7px rgba(0,0,0,.3); }
.cluster-marker { display: grid; place-items: center; border: 1.5px solid rgba(255,255,255,.92); border-radius: 50%; color: #fff; background: rgba(15,126,174,.78); box-shadow: 0 3px 11px rgba(4,43,62,.22); font: 700 9px var(--mono); backdrop-filter: blur(3px); }
.cluster-marker.hot { background: rgba(211,105,66,.82); }
.cluster-singleton { width:11px; height:11px; border:2px solid rgba(255,255,255,.94); border-radius:50%; box-shadow:0 2px 7px rgba(4,43,62,.25); }
.leaflet-tooltip.hazard-tooltip { width: 196px; max-width: 196px; padding: 8px 10px; white-space: normal; border: 0; border-radius: 9px; color: #d9e8ee; background: rgba(7,21,33,.92); box-shadow: 0 7px 20px rgba(4,25,38,.23); }
.leaflet-tooltip.hazard-tooltip::before { border-top-color: rgba(7,21,33,.92); }
.hazard-tooltip-meta { display:block; color:var(--cyan-300); font:600 8px var(--mono); letter-spacing:.02em; }
.hazard-tooltip-title { margin-top:4px; display:-webkit-box; overflow:hidden; -webkit-box-orient:vertical; -webkit-line-clamp:2; font-size:10px; line-height:1.35; }
.leaflet-tooltip.cluster-tooltip { max-width: 165px; padding: 6px 9px; white-space: nowrap; border: 0; border-radius: 8px; color: #fff; background: rgba(7,21,33,.86); box-shadow: 0 5px 15px rgba(4,25,38,.2); font: 600 8px var(--mono); }
.leaflet-tooltip.cluster-tooltip::before { border-top-color: rgba(7,21,33,.86); }

.map-metrics { position: absolute; z-index: 500; top: 18px; left: 50%; transform: translateX(-50%); display: grid; grid-template-columns: repeat(4, minmax(96px, 1fr)); width: min(570px, calc(100% - 40px)); border: 1px solid rgba(255,255,255,.7); border-radius: 14px; background: rgba(7, 21, 33, .91); color: #fff; box-shadow: var(--shadow); backdrop-filter: blur(16px); overflow: hidden; }
.map-metrics article { position: relative; min-height: 66px; padding: 13px 17px; display: grid; align-content: center; }
.map-metrics article + article::before { content: ""; position: absolute; left: 0; top: 15px; bottom: 15px; width: 1px; background: rgba(255,255,255,.12); }
.map-metrics span { color: #91a9b8; font-size: 9px; font-weight: 700; }
.map-metrics strong { margin-top: 4px; font: 600 18px var(--mono); }
.map-metrics small { position: absolute; right: 12px; bottom: 13px; color: var(--cyan-300); font: 600 8px var(--mono); }
.basemap-switch { position: absolute; z-index: 510; left: 18px; bottom: 20px; display: flex; padding: 4px; border: 1px solid rgba(255,255,255,.7); border-radius: 12px; background: rgba(255,255,255,.94); box-shadow: var(--shadow-soft); backdrop-filter: blur(10px); }
.basemap-switch button { height: 36px; padding: 0 11px; display: flex; align-items: center; gap: 6px; border: 0; border-radius: 8px; color: #647b89; background: transparent; font-size: 10px; font-weight: 700; }
.basemap-switch button svg { width: 15px; }
.basemap-switch button.active { color: #fff; background: var(--navy-900); }
.map-status { position: absolute; z-index: 520; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(12px); padding: 9px 13px; display: flex; align-items: center; gap: 8px; border-radius: 20px; color: #fff; background: rgba(7,21,33,.86); opacity: 0; pointer-events: none; transition: .2s ease; font-size: 10px; }
.map-status.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.spinner { width: 11px; height: 11px; border: 2px solid rgba(255,255,255,.3); border-top-color: var(--cyan-300); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.map-legend { position:absolute; z-index:500; right:58px; bottom:20px; width:238px; padding:11px; border:1px solid rgba(255,255,255,.78); border-radius:12px; background:rgba(255,255,255,.95); box-shadow:var(--shadow-soft); backdrop-filter:blur(10px); transition:width .18s ease,padding .18s ease; }
.map-legend.collapsed { width:142px; padding:8px 9px; }
.legend-title-row { margin-bottom:8px; display:flex; align-items:center; justify-content:space-between; gap:8px; }
.map-legend.collapsed .legend-title-row { margin-bottom:0; }
.legend-title { color:var(--muted); font-size:9px; font-weight:800; }
.legend-actions { display:flex; align-items:center; gap:4px; }
.legend-toggle-all { padding:3px 6px; border:0; border-radius:6px; color:var(--blue-700); background:#e7f5f8; font-size:8px; font-weight:800; }
.legend-collapse { width:23px; height:23px; padding:0; display:grid; place-items:center; border:0; border-radius:6px; color:#607985; background:#edf4f6; transition:.16s ease; }
.legend-collapse:hover { color:var(--navy-900); background:#dfecef; }
.legend-collapse svg { width:13px; transition:transform .18s ease; }
.map-legend.collapsed .legend-collapse svg { transform:rotate(180deg); }
.map-legend.collapsed .legend-toggle-all, .map-legend.collapsed .legend-grid { display:none; }
.legend-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px 6px; }
.legend-item { min-width:0; height:26px; padding:3px 4px; display:flex; align-items:center; gap:5px; border-radius:6px; color:#516975; cursor:pointer; font-size:8px; }
.legend-item:hover { background:#eaf4f6; color:var(--navy-900); }
.legend-item input { width:13px; height:13px; flex:0 0 auto; margin:0; accent-color:var(--cyan-500); }
.legend-item i { width:7px; height:7px; flex:0 0 auto; border-radius:50%; }
.legend-item span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.event-panel { position: relative; z-index: 510; width:100%; height:100%; min-width:0; min-height:0; display: grid; grid-template-rows: auto auto auto minmax(0,1fr); border:0; border-left:1px solid var(--line); border-radius:0; background:#f9fcfd; box-shadow:-8px 0 24px rgba(8,40,57,.08); overflow: hidden; }
.event-panel-body { min-width:0; min-height:0; display:grid; grid-template-rows:minmax(0,3fr) minmax(0,2fr); overflow:hidden; }
.event-panel-header { padding: 18px 19px 14px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.event-panel-header h2 { font-size: 18px; }
.result-badge { padding: 6px 9px; border-radius: 20px; color: var(--blue-700); background: #e2f5f8; font: 600 10px var(--mono); }
.event-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 0 12px 12px; gap: 7px; border-bottom: 1px solid var(--line); }
.event-tabs[hidden] { display:none; }
.event-tab { position: relative; min-width: 0; height: 43px; padding: 6px 5px; display: grid; place-items: center; gap: 2px; border: 1px solid transparent; border-radius: 9px; color: #6b818e; background: #f0f5f7; transition: .18s ease; }
.event-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; font-weight: 800; }
.event-tab b { font: 600 9px var(--mono); }
.event-tab:hover { color: var(--navy-900); background: #e8f1f4; }
.event-tab.active { color: var(--blue-700); border-color: #9bdbe5; background: #e7f8fa; box-shadow: inset 0 -2px 0 var(--cyan-500); }
.event-tab.urgent b { color: #e34d58; }
.event-tab.recent b { color: #ef8a2f; }
.event-tab.has-live::after { content:""; position:absolute; right:6px; top:6px; width:6px; height:6px; border-radius:50%; background:#f04455; box-shadow:0 0 0 0 rgba(240,68,85,.5); animation:livePulse 1.35s infinite; }
.search-mode-bar { min-height:50px; padding:9px 13px; display:flex; align-items:center; gap:8px; border-bottom:1px solid var(--line); color:var(--navy-900); background:#e8f8fa; font-size:10px; font-weight:800; }
.search-mode-bar[hidden] { display:none; }
.search-mode-bar b { color:var(--blue-700); font:600 10px var(--mono); }
.search-mode-bar button { margin-left:auto; padding:6px 8px; border:1px solid #a9dbe3; border-radius:7px; color:var(--blue-700); background:#fff; font-size:8px; font-weight:800; }
@keyframes livePulse { 70% { box-shadow:0 0 0 7px rgba(240,68,85,0); } 100% { box-shadow:0 0 0 0 rgba(240,68,85,0); } }
.event-list { padding: 7px 10px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #c6d8df transparent; }
.event-list.auto-scrolling { background:linear-gradient(#f9fcfd 0,#f9fcfd 94%,rgba(232,242,246,.72) 100%); }
.event-card { width: 100%; padding: 14px 11px 14px 12px; display: grid; grid-template-columns: 4px minmax(0,1fr); column-gap: 12px; border: 0; border-radius: 12px; text-align: left; background: transparent; transition: .16s ease; }
.event-card:hover { background: #edf5f7; }
.event-card.selected { background:#e4f4f7; box-shadow:inset 0 0 0 1px #a6d9e2; }
.event-card.recent-24 { background: linear-gradient(90deg,rgba(240,68,85,.09),transparent 72%); }
.event-card.recent-month { background: linear-gradient(90deg,rgba(241,139,45,.09),transparent 72%); }
.event-card-accent { grid-row: 1 / span 5; width: 4px; border-radius: 3px; background: var(--event-color); }
.event-card.recent-24 .event-card-accent { background:#f04455; box-shadow:0 0 0 3px rgba(240,68,85,.1); }
.event-card.recent-month .event-card-accent { background:#ef8a2f; }
.event-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.event-year { color:#8296a1; font:600 9px var(--mono); letter-spacing:.04em; }
.taxon-chip { max-width: 170px; padding: 3px 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 10px; color: var(--event-color); background: color-mix(in srgb, var(--event-color) 12%, white); font-size: 8px; font-weight: 800; }
.event-card-core { margin-top:9px; display:grid; grid-template-columns:54px minmax(0,1fr); align-items:stretch; gap:11px; }
.event-calendar { min-height:58px; padding:7px 5px 6px; display:grid; place-items:center; align-content:center; border:1px solid color-mix(in srgb,var(--event-color) 28%,white); border-radius:11px; color:var(--event-color); background:color-mix(in srgb,var(--event-color) 8%,white); }
.event-calendar b { font-size:10px; line-height:1; }
.event-calendar strong { margin-top:4px; color:var(--navy-900); font:800 20px/1 var(--mono); letter-spacing:-.06em; }
.event-place { min-width:0; display:grid; align-content:center; }
.event-place small,.event-casualty small { margin-bottom:4px; color:#7c929e; font-size:8px; font-weight:800; letter-spacing:.12em; }
.event-place strong { display:-webkit-box; overflow:hidden; -webkit-box-orient:vertical; -webkit-line-clamp:2; color:var(--navy-900); font-size:15px; font-weight:800; line-height:1.3; letter-spacing:-.025em; }
.event-casualty { margin-top:9px; padding:9px 10px; display:grid; border:1px solid rgba(211,67,82,.18); border-radius:10px; background:rgba(240,68,85,.065); }
.event-casualty span { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 14px; }
.event-casualty b { display:flex; align-items:baseline; gap:5px; color:#b83f4d; }
.event-casualty em { font-size:9px; font-style:normal; font-weight:800; }
.event-casualty strong { font:800 18px/1 var(--mono); letter-spacing:-.04em; }
.event-card h3 { margin:9px 0 0; overflow:hidden; color:#657b88; font-size:9px; font-weight:700; line-height:1.4; text-overflow:ellipsis; white-space:nowrap; }
.event-meta { display: flex; align-items: center; gap: 6px; color: #718692; font-size: 9px; }
.event-meta svg { width: 12px; }
.empty-state { padding: 50px 18px; text-align: center; color: var(--muted); font-size: 11px; }
.skeleton-card { height: 86px; margin: 8px 2px; border-radius: 11px; background: linear-gradient(90deg,#edf2f4,#f8fafb,#edf2f4); background-size: 200% 100%; animation: skeleton 1.3s infinite; }
@keyframes skeleton { to { background-position: -200% 0; } }
.pagination { height: 50px; display: flex; align-items: center; justify-content: center; gap: 15px; border-top: 1px solid var(--line); color: var(--muted); font: 500 10px var(--mono); }
.pagination button { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.pagination button:disabled { opacity: .35; cursor: default; }
.pagination svg { width: 14px; }

.stats-view { overflow-y: auto; background: var(--canvas); }
.stats-content { width: min(1420px, calc(100% - 64px)); margin: 0 auto; padding: 40px 0 26px; }
.stats-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.stats-hero h1 { margin: 0; color: var(--navy-900); font-size: clamp(28px, 3vw, 42px); letter-spacing: -.045em; }
.stats-hero p { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.stats-updated { min-width: 230px; padding: 12px 16px; border-left: 3px solid var(--cyan-500); color: var(--muted); background: #fff; box-shadow: var(--shadow-soft); }
.stats-updated span { display: block; font-size: 9px; }
.stats-updated strong { display: block; margin-top: 5px; font: 600 11px var(--mono); color: var(--navy-900); }
.stats-kpis { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 16px; }
.stats-kpis article { min-height: 112px; padding: 18px; display: flex; align-items: center; gap: 14px; border: 1px solid #e4ecef; border-radius: 15px; background: #fff; box-shadow: 0 6px 19px rgba(9,43,60,.05); }
.kpi-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; }
.kpi-icon svg { width: 19px; }
.kpi-icon.blue { color:#167caf; background:#e6f3f9; }.kpi-icon.cyan { color:#0ea7b9; background:#e4f8f9; }.kpi-icon.violet { color:#7359c7; background:#f0edfb; }.kpi-icon.orange { color:#d47734; background:#fcf0e5; }
.stats-kpis article > div { min-width: 0; }
.stats-kpis span:not(.kpi-icon) { display: block; color: var(--muted); font-size: 9px; font-weight: 700; }
.stats-kpis strong { display: block; margin: 5px 0 3px; font: 600 22px var(--mono); color: var(--navy-900); }
.stats-kpis small { display: block; color: #9babb4; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.chart-card { min-height: 350px; padding: 20px; border: 1px solid #e2ebef; border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(8,40,57,.055); }
.chart-card.chart-wide { grid-column: 1 / -1; min-height: 390px; }
.chart-card.chart-tall { min-height: 430px; }
.chart-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.chart-heading span:first-child { color: var(--blue-600); font: 700 8px var(--mono); letter-spacing: .14em; }
.chart-heading h2 { margin: 5px 0 0; color: var(--navy-900); font-size: 16px; letter-spacing: -.025em; }
.chart-note { color: #91a2ac !important; font: 500 8px var(--mono) !important; letter-spacing: 0 !important; }
.chart-canvas { position: relative; height: 270px; }
.chart-canvas.tall { height: 300px; }
.chart-canvas.country-chart { height: 350px; }
.quality-bars { display: grid; gap: 15px; padding-top: 10px; }
.quality-row-head { display: flex; justify-content: space-between; margin-bottom: 6px; color: #526b78; font-size: 10px; }
.quality-row-head b { font: 600 9px var(--mono); color: var(--navy-900); }
.quality-track { height: 8px; border-radius: 4px; background: #e9f0f3; overflow: hidden; }
.quality-fill { height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg,var(--blue-600),var(--cyan-300)); }
.stats-footer { padding: 24px 2px 0; display: flex; justify-content: space-between; color: #8295a0; font: 500 9px var(--mono); }
.analysis-section { margin-top: 54px; scroll-margin-top: 90px; }
.analysis-heading { margin-bottom: 18px; padding: 0 3px 17px; display:flex; align-items:flex-end; justify-content:space-between; gap:30px; border-bottom:1px solid #d8e5ea; }
.analysis-heading > div { position:relative; padding-left:58px; }
.section-index { position:absolute; left:0; top:1px; color:#c4d5dc; font:700 34px var(--mono); letter-spacing:-.08em; }
.analysis-heading h2 { margin:0; color:var(--navy-900); font-size:24px; letter-spacing:-.04em; }
.analysis-heading p { max-width:440px; margin:0; color:var(--muted); font-size:11px; line-height:1.65; text-align:right; }
.analysis-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.mini-chart-card { min-width:0; min-height:315px; padding:17px; border:1px solid #e2ebef; border-radius:15px; background:#fff; box-shadow:0 7px 21px rgba(8,40,57,.05); }
.mini-chart-card h3 { margin:0 0 13px; color:var(--navy-900); font-size:12px; letter-spacing:-.02em; }
.mini-chart { position:relative; height:255px; }

.recent-map-marker { position:relative; width:18px; height:18px; border:3px solid #fff; border-radius:50%; background:#ef8a2f; box-shadow:0 3px 13px rgba(164,73,11,.45); }
.recent-map-marker.live { background:#f04455; box-shadow:0 3px 14px rgba(200,29,49,.48); animation:markerBeat 1.25s ease-out infinite; }
.recent-map-marker.live::after { content:""; position:absolute; inset:-8px; border:2px solid rgba(240,68,85,.7); border-radius:50%; animation:markerRing 1.25s ease-out infinite; }
@keyframes markerBeat { 50% { transform:scale(1.16); } }
@keyframes markerRing { from { transform:scale(.55); opacity:1; } to { transform:scale(1.75); opacity:0; } }

.event-detail-pane { min-height:0; overflow-y:auto; border-top:1px solid #cbdde4; background:#fff; scrollbar-width:thin; scrollbar-color:#c6d8df transparent; }
.detail-pane-kicker { position:sticky; z-index:2; top:0; padding:9px 14px; border-bottom:1px solid var(--line); color:var(--blue-700); background:rgba(247,251,252,.96); backdrop-filter:blur(8px); font:700 8px var(--mono); letter-spacing:.12em; text-transform:uppercase; }
.detail-empty { min-height:170px; padding:30px 22px; display:grid; place-items:center; text-align:center; color:#8296a1; font-size:10px; line-height:1.6; }
.event-detail { min-height:100%; }
.detail-hero { padding: 17px 15px 15px; color: #fff; background: linear-gradient(125deg,var(--navy-950),var(--navy-800)); }
.detail-hero .taxon-chip { display: inline-block; margin-bottom: 9px; color: var(--cyan-300); background: rgba(102,221,235,.12); }
.detail-hero h2 { margin: 0; font-size: 15px; line-height: 1.35; letter-spacing: -.025em; }
.detail-hero p { margin: 7px 0 0; color: #a9becb; font: 500 8px var(--mono); line-height:1.5; }
.detail-body { padding: 14px 15px 22px; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin-bottom: 14px; }
.detail-grid div { min-width:0; padding: 9px; border-radius: 8px; background: #f2f7f9; }
.detail-grid span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 8px; }
.detail-grid strong { display:block; overflow-wrap:anywhere; font-size: 9px; line-height:1.45; }
.detail-section { padding-top: 12px; border-top: 1px solid var(--line); }
.detail-section + .detail-section { margin-top: 13px; }
.detail-section h3 { margin: 0 0 8px; font-size: 10px; }
.detail-section p { margin: 0; color: #516976; font-size: 9px; line-height: 1.65; }
.detail-grid-row { padding: 7px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); color: #58707d; font-size: 9px; }
.detail-grid-row b { color: var(--navy-900); font: 600 9px var(--mono); }
.source-list { display: grid; gap: 8px; }
.source-link { padding: 10px 12px; display: flex; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--blue-700); text-decoration: none; font-size: 10px; }
.source-link:hover { border-color: var(--cyan-500); background: #f2fbfc; }
.source-link span { color: var(--muted); font: 500 8px var(--mono); }
.toast { position: fixed; z-index: 1200; left: 50%; bottom: 28px; transform: translate(-50%,18px); padding: 10px 16px; border-radius: 20px; color: #fff; background: var(--navy-900); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s ease; font-size: 10px; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 1180px) {
  :root { --filter-w: 282px; --events-w: 328px; }
  .app-header { grid-template-columns: 1fr auto 1fr; }
  .data-status { display: none; }
  .map-metrics { left: 16px; transform: none; width: calc(100% - 32px); }
  .map-legend { display: none; }
  .stats-kpis { grid-template-columns: repeat(2,1fr); }
  .analysis-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

@media (max-width: 820px) {
  body { overflow: auto; }
  :root { --header-h: 60px; }
  .app-header { grid-template-columns: 1fr auto; padding: 0 12px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-copy small { display: none; }
  .page-nav { position: fixed; z-index: 950; left: 50%; bottom: 10px; transform: translateX(-50%); height: 52px; padding: 5px; border: 1px solid rgba(255,255,255,.13); border-radius: 15px; background: rgba(7,21,33,.94); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
  .nav-button { min-width: 104px; height: 42px; }
  .header-actions { grid-column: 2; }
  .filter-panel { top: var(--header-h); bottom: auto; width: 100%; height: auto; max-height: none; padding: 14px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 10px; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); box-shadow: 0 8px 20px rgba(8,34,49,.08); }
  .panel-title-row, .filter-context, .mini-trend { display: none; }
  .contact-card { display: none; }
  .field, .field-pair { margin: 0; }
  .search-field { grid-column: 1 / -1; }
  .field-pair { grid-column: 1 / -1; }
  .primary-action { margin: 0; }
  .view-shell { position: relative; inset: auto; margin-top: calc(var(--header-h) + 220px); height: calc(100vh - var(--header-h) - 220px); min-height: 520px; }
  .map-metrics { display: none; }
  .map-view.active { display:grid; grid-template-columns:1fr; grid-template-rows:minmax(300px,56%) minmax(230px,44%); }
  .event-panel { grid-row:2; width:100%; height:100%; border-left:0; border-top:1px solid var(--line); box-shadow:0 -8px 20px rgba(8,40,57,.08); }
  .event-panel-header { display:none; }
  .event-tabs { padding:6px 8px; }
  .event-tab { height:34px; }
  .event-panel-header .eyebrow { display: none; }
  .event-panel-header h2 { font-size: 14px; }
  .event-panel-body { grid-template:1fr / minmax(270px,42%) minmax(360px,1fr); overflow-x:auto; }
  .event-list { display: block; overflow:auto; }
  .event-card { width:100%; }
  .event-detail-pane { border-top:0; border-left:1px solid #cbdde4; }
  .basemap-switch { left: 8px; bottom: 12px; }
  .map-status { bottom: 16px; }
  .stats-view { overflow: visible; }
  .stats-content { width: calc(100% - 24px); padding: 20px 0 90px; }
  .stats-hero { align-items: flex-start; flex-direction: column; }
  .stats-updated { width: 100%; }
  .stats-kpis, .chart-grid { grid-template-columns: 1fr; }
  .chart-card.chart-wide { grid-column: auto; }
  .analysis-heading { align-items:flex-start; flex-direction:column; gap:9px; }
  .analysis-heading p { padding-left:58px; text-align:left; }
  .analysis-grid { grid-template-columns:1fr; }
}

@media (max-width: 520px) {
  .brand-copy strong { font-size: 16px; }
  .language-toggle button { min-width: 38px; padding: 0 5px; }
  .filter-panel { grid-template-columns: 1fr 1fr; }
  .field > span { display: none; }
  .view-shell { margin-top: calc(var(--header-h) + 202px); height: calc(100vh - var(--header-h) - 202px); }
  .basemap-switch button { width: 38px; padding: 0; justify-content: center; }
  .basemap-switch button span { display: none; }
  .stats-kpis { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stats-kpis article { min-height: 122px; padding: 13px; align-items: flex-start; flex-direction: column; gap: 9px; }
  .chart-card { padding: 15px; min-height: 330px; }
  .chart-canvas { height: 250px; }
  .stats-footer { flex-direction: column; gap: 7px; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
}
