:root {
  color-scheme: light;
  --ino: #1f3288;
  --paper: #eef0f4;
  --paper-raised: #f7f8fa;
  --paper-inset: #e4e7ee;
  --bg-card-hover: #eef1f7;
  --ink: #182242;
  --ink-70: #535e7b;
  --ink-45: #7a849c;
  --ink-25: #b4bac8;
  --rule: #d8dce6;
  --rule-strong: #b8bfcf;
  --signal: var(--ino);
  --signal-soft: rgba(31, 50, 136, 0.14);
  --cat-earthquake: #8a6a2f;
  --cat-flood: #2e7186;
  --cat-cyclone: #3f5e8c;
  --cat-wildfire: #c24a33;
  --cat-volcano: #a6642b;
  --cat-drought: #8c7a45;
  --cat-winter_storm: #5a6f9c;
  --cat-weather: #4e8894;
  --cat-power: #b5762a;
  --cat-water: #2e7186;
  --cat-factory: #94476b;
  --cat-logistics: #6e7580;
  --cat-other: #6e7580;
  --site: #2a7a8c;
  --match: #c47a22;
  --shadow-sm: 0 1px 0 rgba(24, 34, 66, 0.06);
  --shadow-md: 0 2px 8px rgba(24, 34, 66, 0.1);
  --radius-sm: 2px;
  --radius-md: 3px;
  --sea: #d5dae2;
  --hairline: rgba(24, 34, 66, 0.07);
  --grid-major: rgba(31, 50, 136, 0.05);
  --grid-minor: rgba(24, 34, 66, 0.035);
  --tile-filter: saturate(0.7) sepia(0.04) contrast(0.98) hue-rotate(198deg);
  --font-display: "Archivo", "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-main: "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --hdr-h: 60px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #141821;
  --paper-raised: #1a2030;
  --paper-inset: #10141c;
  --bg-card-hover: #222a3c;
  --ink: #e8eaf2;
  --ink-70: #aeb6cc;
  --ink-45: #858eab;
  --ink-25: #4a5166;
  --rule: #2a3348;
  --rule-strong: #3a4660;
  --signal: #6b82d6;
  --signal-soft: rgba(107, 130, 214, 0.18);
  --sea: #0f131c;
  --hairline: rgba(232, 234, 242, 0.08);
  --grid-major: rgba(107, 130, 214, 0.06);
  --grid-minor: rgba(232, 234, 242, 0.03);
  --tile-filter: saturate(0.55) brightness(0.78) hue-rotate(198deg);
  --shadow-sm: 0 1px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.45);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

@media (min-width: 1301px) {
  body { height: 100vh; overflow: hidden; }
}

::selection { background: var(--ino); color: #fff; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--paper-inset); }
::-webkit-scrollbar-thumb {
  background: var(--ink-25);
  border: 3px solid var(--paper-inset);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-45); }

svg {
  display: inline-block;
  vertical-align: middle;
  max-width: 100%;
  flex-shrink: 0;
}
.card-title svg,
.refresh-btn svg,
.theme-toggle svg,
.event-meta svg { width: 12px; height: 12px; }

.bg-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid-major) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-major) 1px, transparent 1px),
    linear-gradient(to right, var(--grid-minor) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-minor) 1px, transparent 1px);
  background-size: 280px 280px, 280px 280px, 56px 56px, 56px 56px;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

.site-header { animation: rise 0.4s both; }
.map-header { animation: rise 0.45s 0.08s both; }
.sidebar-right .feed-header { animation: rise 0.45s 0.12s both; }
.sidebar-left .card:nth-child(1) { animation: rise 0.5s 0.1s both; }
.sidebar-left .card:nth-child(2) { animation: rise 0.5s 0.16s both; }
.sidebar-left .card:nth-child(3) { animation: rise 0.5s 0.22s both; }
.sidebar-left .card:nth-child(4) { animation: rise 0.5s 0.28s both; }
.sidebar-left .card:nth-child(5) { animation: rise 0.5s 0.34s both; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--paper-raised);
  border-bottom: 1px solid var(--rule-strong);
}
.site-header::after {
  content: "";
  display: block;
  height: 2px;
  background: linear-gradient(var(--paper) 1px, var(--rule) 1px);
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  pointer-events: none;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 10px 20px;
  padding: 7px 16px;
  min-height: var(--hdr-h);
  flex-wrap: wrap;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 20px;
  border-right: 1px solid var(--rule);
  align-self: stretch;
  flex-shrink: 0;
}

.logo-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--ino);
  color: #fff;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--radius-sm);
}

.logo-text { display: flex; flex-direction: column; }
.logo-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
}
.logo-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-45);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--paper-inset);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.nav-tab {
  border: 0;
  background: transparent;
  color: var(--ink-70);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: 1px;
  cursor: pointer;
}
.nav-tab:hover { color: var(--ink); }
.nav-tab.active {
  background: var(--ino);
  color: #fff;
  font-weight: 600;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.stat-pill {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-45);
}
.stat-pill #totalCount {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.pulse-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
  align-self: center;
}
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid var(--signal);
  animation: ping 2.2s cubic-bezier(0, 0.4, 0.6, 1) infinite;
}
@keyframes ping {
  0% { transform: scale(1); opacity: 0.8; }
  70%, 100% { transform: scale(2.6); opacity: 0; }
}
.last-updated {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-45);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.date-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}
.date-input-group { display: flex; flex-direction: column; gap: 3px; }
.date-input-group label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-45);
}
.date-input, .search-input {
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.date-input:hover, .search-input:hover { border-color: var(--ink-45); }
.date-input:focus, .search-input:focus {
  border-color: var(--signal);
  outline: none;
  box-shadow: 0 0 0 3px var(--signal-soft);
}
select.date-input {
  cursor: pointer;
  padding-right: 24px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-45) 50%),
    linear-gradient(135deg, var(--ink-45) 50%, transparent 50%);
  background-position: calc(100% - 13px) 55%, calc(100% - 8px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.date-presets {
  display: flex;
  align-self: flex-end;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--paper-raised);
}
.preset-btn {
  background: transparent;
  border: none;
  border-right: 1px solid var(--rule);
  color: var(--ink-70);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  padding: 6px 11px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}
.preset-btn:last-child { border-right: none; }
.preset-btn:hover { background: var(--bg-card-hover); color: var(--ink); }
.preset-btn.active {
  background: var(--ino);
  color: #fff;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 16px;
  border-left: 1px solid var(--rule);
  align-self: stretch;
  flex-shrink: 0;
}

.auto-refresh-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
}
.auto-refresh-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: relative;
  width: 28px;
  height: 15px;
  background: var(--paper-inset);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink-45);
  transition: transform 0.15s ease, background 0.15s;
}
.auto-refresh-toggle input:checked + .toggle-slider {
  background: var(--ino);
  border-color: var(--ino);
}
.auto-refresh-toggle input:checked + .toggle-slider::before {
  transform: translateX(13px);
  background: #fff;
}
.toggle-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-70);
  white-space: nowrap;
}

.theme-toggle, .refresh-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  color: var(--ink-70);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.theme-toggle:hover, .refresh-btn:hover {
  border-color: var(--ino);
  color: var(--ino);
}
.refresh-btn {
  border-color: var(--ino);
  color: var(--ino);
}
.refresh-btn:hover {
  background: var(--ino);
  color: #fff;
}
.refresh-btn.spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.theme-toggle .icon-moon { display: inline-block; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: inline-block; }

.main-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr) 316px;
  gap: 0;
  flex: 1 1 0%;
  min-height: 0;
  overflow: hidden;
}
.main-layout[hidden] { display: none !important; }

.sidebar-left, .sidebar-right {
  background: var(--paper-raised);
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sidebar-left {
  overflow-y: auto;
  border-right: 1px solid var(--rule-strong);
}
.sidebar-right {
  overflow: hidden;
  border-left: 1px solid var(--rule-strong);
}

.card {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  padding: 14px 16px;
}
.card:last-child { border-bottom: none; }

.card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-45);
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper-raised);
  padding: 10px 0 8px;
  margin-top: -14px;
  margin-bottom: 8px;
}
.card-title svg { opacity: 0.55; }

.seo-content h1.card-title {
  font-family: var(--font-display);
  font-size: 17px !important;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--ink) !important;
  line-height: 1.25;
  align-items: flex-start;
  position: static;
  margin-top: 0;
  padding-top: 0;
}
.seo-content h1.card-title svg {
  margin-top: 4px;
  color: var(--signal);
  opacity: 1;
}
.seo-content h2 {
  font-family: var(--font-mono) !important;
  font-size: 9px !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-45) !important;
  margin: 12px 0 4px !important;
  font-weight: 500;
}
.seo-content p {
  font-size: 12.5px !important;
  line-height: 1.55;
  color: var(--ink-70);
}
.seo-content strong { color: var(--ink); font-weight: 600; }

.category-filters, .source-filters { display: flex; flex-wrap: wrap; gap: 5px; }

.cat-filter {
  --cat-color: var(--ink-45);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--cat-color);
  color: var(--ink-70);
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.cat-filter:hover { background: var(--bg-card-hover); color: var(--ink); }
.cat-filter.active {
  background: var(--ino);
  color: #fff;
  border-color: var(--ino);
  border-left-color: var(--cat-color);
  font-weight: 500;
}
.cat-count, .src-count {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--ink-45);
  font-variant-numeric: tabular-nums;
}
.cat-filter.active .cat-count { color: rgba(255, 255, 255, 0.72); }

.src-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  color: var(--ink-45);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s, opacity 0.12s;
  white-space: nowrap;
}
.src-filter:hover { border-color: var(--ino); color: var(--ink); }
.src-filter.active {
  background: var(--ino);
  border-color: var(--ino);
  color: #fff;
}
.src-filter.src-empty { opacity: 0.45; }
.src-filter.active .src-count { color: rgba(255, 255, 255, 0.75); }

.counter-list {
  display: flex;
  flex-direction: column;
  max-height: 226px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}
.counter-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 10px;
  padding: 6px 0 7px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
}
.counter-item:last-child { border-bottom: none; }
.counter-item:hover .counter-label { color: var(--ink); }
.counter-item:hover .counter-bar-fill { background: var(--signal); opacity: 0.9; }
.counter-item.active .counter-label { color: var(--ino); font-weight: 600; }
.counter-number {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-25);
  font-variant-numeric: tabular-nums;
}
.counter-label {
  font-size: 12.5px;
  color: var(--ink-70);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.12s;
  min-width: 0;
}
.counter-value {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.counter-bar {
  grid-column: 2 / -1;
  height: 2px;
  background: var(--paper-inset);
  border-radius: 1px;
  margin-top: 2px;
  overflow: hidden;
}
.counter-bar-fill {
  height: 100%;
  background: var(--ink-45);
  transition: width 0.2s, background 0.12s;
}

.map-section {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  overflow: hidden;
  min-height: 0;
}
.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-raised);
  flex-wrap: wrap;
}
.map-header h2 {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-45);
  font-weight: 500;
}
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-70);
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.legend-dot.site { background: var(--site); }
.legend-dot.match { background: var(--match); }

.map-canvas {
  flex: 1 1 auto;
  min-height: 280px;
  background: var(--sea);
}
.map-canvas .leaflet-container {
  width: 100%;
  height: 100%;
  background: var(--sea);
  font: inherit;
}
.map-canvas .leaflet-tile { filter: var(--tile-filter); }
.map-canvas .leaflet-control-zoom a {
  background: var(--paper-raised) !important;
  color: var(--ink) !important;
  border-color: var(--rule-strong) !important;
  width: 28px !important;
  height: 28px !important;
  line-height: 28px !important;
  border-radius: var(--radius-sm) !important;
}
.event-marker {
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 4px rgba(24, 34, 66, 0.28);
}
.event-marker.selected {
  box-shadow: 0 0 0 3px var(--signal-soft), 0 1px 6px rgba(24, 34, 66, 0.35);
}
.site-marker {
  border-radius: 50%;
  background: var(--site);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(42, 122, 140, 0.25);
}
.site-marker.matched {
  background: var(--match);
  box-shadow: 0 0 0 2px rgba(196, 122, 34, 0.25);
}

.timeline-strip {
  flex-shrink: 0;
  background: var(--paper-raised);
  border-top: 1px solid var(--rule-strong);
  padding: 8px 16px 10px;
}
.timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.timeline-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-45);
}
.timeline-clear {
  border: 0;
  background: transparent;
  color: var(--ino);
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
}
.timeline-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 52px;
  overflow-x: auto;
}
.timeline-bar {
  flex: 1 0 10px;
  min-width: 8px;
  max-width: 28px;
  background: var(--paper-inset);
  border: 0;
  border-radius: 1px 1px 0 0;
  cursor: pointer;
  position: relative;
  padding: 0;
  transition: background 0.12s;
}
.timeline-bar .fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--ino);
  opacity: 0.72;
  border-radius: 1px 1px 0 0;
}
.timeline-bar:hover .fill,
.timeline-bar.active .fill { opacity: 1; }
.timeline-bar.active { outline: 1px solid var(--ino); }
.timeline-bar .tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper-raised);
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 3px 6px;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  z-index: 2;
}
.timeline-bar:hover .tip { display: block; }

.feed-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  background: var(--paper-raised);
  z-index: 5;
}
.feed-header h3 {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-45);
  font-weight: 500;
}
.feed-count {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.event-feed {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.event-card {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  background: var(--paper-raised);
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 11px 14px 12px 17px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: background 0.12s;
}
.event-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--card-accent, var(--ink-45));
  opacity: 0.8;
}
.event-card:hover { background: var(--bg-card-hover); }
.event-card[aria-current="true"] {
  background: var(--signal-soft);
}
.event-card[aria-current="true"]::before {
  width: 4px;
  opacity: 1;
  background: var(--ino);
}
.event-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}
.event-kind {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--card-accent, var(--ink-45));
}
.event-ago {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-45);
  white-space: nowrap;
}
.event-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}
.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 11.5px;
  color: var(--ink-70);
}
.event-meta .match-pill {
  color: var(--match);
  font-weight: 600;
}

.event-detail {
  flex: 0 0 auto;
  max-height: 42%;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 2px solid var(--rule-strong);
  box-shadow: 0 -6px 16px rgba(24, 34, 66, 0.06);
  padding: 14px;
  background: var(--paper);
  z-index: 2;
}
.event-detail[hidden] { display: none !important; }
.event-detail h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}
.fact {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 12px;
}
.fact dt { color: var(--ink-45); }
.fact dd { margin: 0; overflow-wrap: anywhere; }
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.detail-actions a, .detail-actions button {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ino);
  border: 1px solid var(--rule-strong);
  background: var(--paper-raised);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.detail-actions a:hover, .detail-actions button:hover {
  border-color: var(--ino);
  background: var(--signal-soft);
}
.site-hit {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.site-hit strong { display: block; margin-bottom: 3px; }
.site-hit .muted { color: var(--ink-70); }
.production { color: #a84419; }

.search-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-45);
  margin-bottom: 6px;
}
.search-input { width: 100%; }

.empty-state {
  padding: 28px 18px;
  text-align: center;
  color: var(--ink-45);
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 2000;
  background: var(--ink);
  color: var(--paper-raised);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}
.toast[hidden] { display: none !important; }

@media (max-width: 1500px) {
  .main-layout { grid-template-columns: 248px minmax(0, 1fr) 292px; }
  .last-updated { display: none; }
}

@media (max-width: 1300px) {
  .header-inner { padding: 10px 14px; gap: 12px; }
  .logo-group { border-right: none; padding-right: 0; }
  .date-selector { order: 3; width: 100%; margin-left: 0; }
  .header-actions { border-left: none; padding-left: 0; margin-left: auto; }
  .main-layout { height: auto; overflow: visible; flex: 0 0 auto; }
  .sidebar-left, .sidebar-right { overflow: visible; }
}

@media (max-width: 1080px) {
  .main-layout {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "map map" "right left";
    height: auto;
  }
  .map-section { grid-area: map; height: 58vh; min-height: 400px; }
  .sidebar-right {
    grid-area: right;
    border-left: none;
    border-right: 1px solid var(--rule-strong);
  }
  .sidebar-left { grid-area: left; border-right: none; }
  .counter-list { max-height: none; }
}

@media (max-width: 720px) {
  .site-nav { order: 2; width: 100%; }
  .nav-tab { flex: 1; justify-content: center; }
  .main-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "map" "right" "left";
  }
  .sidebar-right { border-right: none; border-bottom: 1px solid var(--rule-strong); }
  .header-stats { width: 100%; }
  .date-presets { width: 100%; }
  .preset-btn { flex: 1; text-align: center; }
  .map-section { height: 50vh; min-height: 330px; }
}
