:root {
  --bg: #0a0f14;
  --surface: #111820;
  --border: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #10b981;
  --accent-dim: #059669;
  --danger: #f87171;
  --font: "Sora", system-ui, sans-serif;
  --mono: "JetBrains Mono", monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }
.header {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 0.75rem; }
.logo-track {
  width: 4px; height: 36px; background: linear-gradient(180deg, var(--accent), var(--accent-dim));
  border-radius: 2px;
}
.brand h1 { font-size: 1.1rem; font-weight: 600; }
.tagline { font-size: 0.7rem; color: var(--muted); font-family: var(--mono); }
.nav-tabs { display: flex; gap: 0.25rem; flex: 1; }
.nav-tab {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  padding: 0.45rem 0.9rem; border-radius: 6px; cursor: pointer; font-family: var(--font); font-size: 0.85rem;
}
.nav-tab:hover { color: var(--text); border-color: var(--border); }
.nav-tab.active { color: var(--accent); border-color: var(--accent); background: rgba(16,185,129,0.08); }
.last-update { font-size: 0.75rem; color: var(--muted); font-family: var(--mono); margin-left: auto; }
main { position: relative; height: calc(100vh - 64px); }
.view { display: none; height: 100%; overflow: auto; padding: 1rem; }
.view.active { display: block; }
#view-map { padding: 0; position: relative; }
.map { width: 100%; height: 100%; background: #0d1117; }
.map-stats {
  position: absolute; top: 1rem; left: 1rem; z-index: 1000;
  display: flex; gap: 0.5rem;
}
.stat-card {
  background: rgba(17,24,32,0.92); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.6rem 1rem; cursor: pointer; text-align: left;
  color: var(--text); font-family: var(--font);
}
.stat-card.stat-info { cursor: default; }
.stat-value { display: block; font-size: 1.4rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.7rem; color: var(--muted); }
.btn-suggest-oem {
  position: absolute; top: 1rem; right: 1rem; z-index: 1000;
  background: var(--accent); color: #042f1a; border: none; padding: 0.55rem 1rem;
  border-radius: 6px; font-weight: 600; cursor: pointer; font-family: var(--font);
}
.btn-suggest-oem:hover { background: var(--accent-dim); color: #fff; }
.oem-marker { background: transparent; border: none; }
.pin {
  width: 14px; height: 14px; background: var(--accent); border: 2px solid #064e3b;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg); margin: -7px 0 0 -7px;
  box-shadow: 0 0 8px rgba(16,185,129,0.5);
}
.oem-panel {
  position: fixed; top: 64px; right: 0; width: min(420px, 100vw); height: calc(100vh - 64px);
  background: var(--surface); border-left: 1px solid var(--border); z-index: 2000;
  overflow-y: auto; padding: 1.25rem; transition: transform 0.2s;
}
.oem-panel.hidden { transform: translateX(100%); pointer-events: none; }
.panel-close {
  position: absolute; top: 0.5rem; right: 0.75rem; background: none; border: none;
  color: var(--muted); font-size: 1.5rem; cursor: pointer;
}
.panel h2 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.panel .meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 1rem; }
.panel section { margin-bottom: 1rem; }
.panel h4 { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); margin-bottom: 0.35rem; }
.panel p, .panel a { font-size: 0.9rem; line-height: 1.5; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.btn-secondary {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  padding: 0.45rem 0.85rem; border-radius: 6px; cursor: pointer; font-size: 0.8rem;
}
.btn-primary {
  background: var(--accent); color: #042f1a; border: none;
  padding: 0.5rem 1rem; border-radius: 6px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block;
}
.view-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.news-stats { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.75rem; font-family: var(--mono); }
.filters { display: flex; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: center; }
.filters select, .input {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 0.4rem 0.6rem; border-radius: 6px; font-family: var(--font);
}
.news-list { list-style: none; }
.news-item {
  border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin-bottom: 0.75rem;
  background: var(--surface);
}
.news-item.read { opacity: 0.65; }
.news-item h3 { font-size: 1rem; margin-bottom: 0.35rem; }
.news-item h3 a { color: var(--text); text-decoration: none; }
.news-item h3 a:hover { color: var(--accent); }
.news-item .oem-tag { font-size: 0.75rem; color: var(--accent); }
.news-item .date { font-size: 0.75rem; color: var(--muted); font-family: var(--mono); }
.news-actions { margin-top: 0.5rem; }
.events-layout { display: grid; grid-template-columns: 280px 1fr; gap: 1.5rem; }
@media (max-width: 768px) { .events-layout { grid-template-columns: 1fr; } }
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.cal-header button { background: var(--surface); border: 1px solid var(--border); color: var(--text); width: 32px; height: 32px; border-radius: 4px; cursor: pointer; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; font-size: 0.75rem; }
.cal-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 4px; position: relative; }
.cal-day.has-event { background: rgba(16,185,129,0.15); color: var(--accent); font-weight: 600; }
.cal-day.other-month { color: var(--muted); opacity: 0.4; }
.events-list { list-style: none; }
.event-item { border-left: 3px solid var(--accent); padding: 0.75rem 1rem; margin-bottom: 0.75rem; background: var(--surface); border-radius: 0 8px 8px 0; }
.event-item h3 { font-size: 1rem; }
.event-oems { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.event-oem-tag { font-size: 0.7rem; background: rgba(16,185,129,0.12); color: var(--accent); padding: 0.15rem 0.45rem; border-radius: 4px; }
.locked-card {
  max-width: 420px; margin: 4rem auto; text-align: center; padding: 2.5rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.lock-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.locked-card h2 { margin-bottom: 0.75rem; }
.locked-card p { color: var(--muted); margin-bottom: 1.25rem; }
.modal { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.modal-box { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; width: min(400px, 92vw); max-height: 90vh; overflow-y: auto; }
.modal-lg { width: min(520px, 92vw); }
.modal-box h3 { margin-bottom: 1rem; }
.field { margin-bottom: 0.75rem; }
.field label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.25rem; }
.field input, .field textarea, .field select {
  width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 0.5rem; border-radius: 6px; font-family: var(--font);
}
.field textarea { min-height: 80px; resize: vertical; }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }
.oem-list-items { list-style: none; max-height: 50vh; overflow-y: auto; margin: 0.75rem 0; }
.oem-list-items li { padding: 0.5rem; border-bottom: 1px solid var(--border); cursor: pointer; }
.oem-list-items li:hover { background: rgba(16,185,129,0.08); }
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--accent); color: var(--text);
  padding: 0.85rem 1.25rem; border-radius: 8px; z-index: 4000; max-width: 90vw;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.toast.hidden { display: none; }
.leaflet-container { background: #0d1117; font-family: var(--font); }
.leaflet-tooltip { background: var(--surface) !important; border: 1px solid var(--border) !important; color: var(--text) !important; }
.leaflet-control-zoom { display: none !important; }

.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
  background: rgba(17, 24, 32, 0.92);
  border-top: 1px solid var(--border);
  color: var(--muted);
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.footer-sep { opacity: 0.4; }

.consent-bar {
  position: fixed;
  bottom: 2.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 950;
  max-width: min(520px, 94vw);
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.consent-bar.hidden { display: none; }
.consent-bar p { font-size: 0.8rem; color: var(--muted); margin: 0; flex: 1 1 200px; line-height: 1.4; }
.consent-bar p a { color: var(--accent); }
.consent-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

#view-map.view.active { padding-bottom: 2rem; }
