/* =============================================================================
   Operator console polish pass (surface only)
   Hierarchy, density, attention language, map stage, cards, drawer, mobile.
   Does not change intelligence semantics or data layer.
   ============================================================================= */

:root {
  --of-space-1: 4px;
  --of-space-2: 8px;
  --of-space-3: 12px;
  --of-space-4: 16px;
  --of-space-5: 20px;
  --of-space-6: 24px;
  --of-type-xs: 10px;
  --of-type-sm: 11px;
  --of-type-md: 13px;
  --of-type-lg: 15px;
  --of-type-xl: 18px;
  --of-type-display: 20px;
  --of-ease: 180ms ease;
  --of-ease-fast: 140ms ease;
  --of-topbar-height: 52px;
  --of-sev-critical: var(--of-red);
  --of-sev-high: var(--of-orange);
  --of-sev-medium: var(--of-amber);
  --of-sev-low: var(--of-blue);
  --of-conf-high: var(--of-green);
  --of-conf-mid: var(--of-cyan);
  --of-conf-low: var(--of-text-faint);
  --of-change-new: var(--of-green);
  --of-change-updated: var(--of-amber);
  --of-conn: var(--of-violet);
  --of-record-event: var(--of-cyan);
  --of-record-lead: #7dd3fc;
  --of-record-observation: var(--of-amber);
  --topbar-height: var(--of-topbar-height);
}

/* ----- transitions baseline ----- */
button,
.event-card,
.dashboard-tab,
.filter-item,
.preset-chip,
.v2-connection-row,
.v2-detail-link,
.drawer,
.icon-btn,
.map-toolbar button,
.map-toolbar select,
.floating-controls button {
  transition:
    background-color var(--of-ease),
    border-color var(--of-ease),
    color var(--of-ease),
    box-shadow var(--of-ease),
    transform var(--of-ease-fast),
    opacity var(--of-ease);
}

/* ----- 1. Top command bar: thinner, clearer hierarchy ----- */
.topbar {
  min-height: var(--of-topbar-height);
  height: var(--of-topbar-height);
  padding: 0 var(--of-space-4);
  gap: var(--of-space-3);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--of-panel-strong) 88%, #000), var(--of-panel-glass));
  border-bottom: 1px solid color-mix(in srgb, var(--of-cyan) 18%, var(--of-border));
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.brand {
  gap: var(--of-space-2);
  flex: 0 0 auto;
}

.brand-mark {
  width: 28px;
  height: 28px;
  font-size: 11px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--of-cyan) 10%, transparent);
}

.brand div {
  font-size: 12px;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.brand div span {
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--of-text-faint);
  text-transform: uppercase;
}

.dashboard-nav {
  padding: 0;
  gap: 4px;
}

.dashboard-tab {
  height: 30px;
  padding: 0 10px;
  font-size: var(--of-type-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 6px;
  border-color: transparent;
  background: transparent;
  color: var(--of-text-muted);
}

.dashboard-tab:hover {
  color: var(--of-text);
  background: rgba(255, 255, 255, 0.04);
  border-color: color-mix(in srgb, var(--of-border) 80%, transparent);
}

.dashboard-tab.active {
  border-color: color-mix(in srgb, var(--of-cyan) 45%, var(--of-border));
  background: color-mix(in srgb, var(--of-cyan) 14%, transparent);
  color: var(--of-cyan);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--of-cyan);
}

.global-search {
  flex: 1 1 min(360px, 28vw);
  max-width: 440px;
}

.global-search input {
  height: 32px;
  padding: 0 12px;
  font-size: var(--of-type-sm);
  border-radius: 8px;
  background: color-mix(in srgb, var(--of-bg) 70%, var(--of-panel-strong));
  border-color: color-mix(in srgb, var(--of-border) 90%, transparent);
}

.global-search input:focus {
  border-color: var(--of-cyan);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--of-cyan) 22%, transparent);
}

.topbar-actions {
  gap: var(--of-space-2);
  flex: 0 0 auto;
}

.status,
.feed-age {
  font-size: var(--of-type-xs);
  font-family: var(--of-mono);
  color: var(--of-text-muted);
}

.status i {
  width: 6px;
  height: 6px;
}

.mode-toggle {
  font-size: var(--of-type-xs);
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--of-text-faint);
}

.mode-toggle:hover {
  border-color: var(--of-border);
  color: var(--of-text-muted);
}

.mode-toggle input {
  width: 14px;
  height: 14px;
}

.tools-menu summary {
  height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  font-size: var(--of-type-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 6px;
  border-color: color-mix(in srgb, var(--of-border) 80%, transparent);
  background: rgba(255, 255, 255, 0.03);
  color: var(--of-text-muted);
}

.tools-menu summary:hover {
  color: var(--of-text);
  border-color: color-mix(in srgb, var(--of-cyan) 35%, var(--of-border));
}

.tools-menu div {
  top: 36px;
  width: 200px;
  padding: 6px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--of-panel) 98%, #000);
}

.icon-btn {
  height: 30px;
  min-width: 30px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 6px;
  border-color: color-mix(in srgb, var(--of-border) 80%, transparent);
  background: rgba(255, 255, 255, 0.03);
  color: var(--of-text-muted);
}

.icon-btn:hover,
.icon-btn:focus-visible {
  color: var(--of-cyan);
  border-color: color-mix(in srgb, var(--of-cyan) 40%, var(--of-border));
  outline: none;
}

/* Secondary chrome: de-emphasize diagnostics path in main nav on small widths via order already */

/* ----- 2. Attention / color language ----- */
.severity-tag {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.event-card .severity-tag {
  box-shadow: none;
}

.confidence {
  color: var(--of-conf-mid);
  font-family: var(--of-mono);
}

.quality-row span {
  font-family: var(--of-mono);
  letter-spacing: 0.02em;
}

/* Change / new emphasis (when classes present) */
.event-card.is-new,
.event-card[data-change="new"] {
  box-shadow: inset 3px 0 0 var(--of-change-new);
}

.event-card.is-updated,
.event-card[data-change="updated"] {
  box-shadow: inset 3px 0 0 var(--of-change-updated);
}

.v2-command-stat-hot {
  box-shadow: 0 0 12px color-mix(in srgb, var(--of-amber) 18%, transparent);
}

.v2-threat-critical {
  animation: none;
}

/* ----- 3. Map stage presence ----- */
.map-stage {
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(8, 28, 40, 0.35), transparent 70%),
    #050d14;
}

.map-stage::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 500;
  box-shadow:
    inset 0 0 80px rgba(0, 0, 0, 0.45),
    inset 0 0 1px color-mix(in srgb, var(--of-cyan) 12%, transparent);
}

.map-toolbar {
  top: 12px;
  left: 12px;
  gap: 6px;
  padding: 6px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--of-panel-glass) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--of-cyan) 14%, var(--of-border));
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  max-width: min(720px, calc(100% - 24px));
}

.map-toolbar button,
.map-toolbar select {
  height: 30px;
  padding: 0 10px;
  font-size: var(--of-type-xs);
  border-radius: 6px;
  border-color: color-mix(in srgb, var(--of-border) 85%, transparent);
  background: rgba(0, 0, 0, 0.28);
  color: var(--of-text);
  box-shadow: none;
}

.map-toolbar button:hover,
.map-toolbar select:hover {
  border-color: color-mix(in srgb, var(--of-cyan) 40%, var(--of-border));
  color: var(--of-cyan);
}

.legend {
  bottom: 14px;
  left: 14px;
  padding: 10px 12px;
  font-size: var(--of-type-xs);
  border-radius: 10px;
  background: color-mix(in srgb, var(--of-panel-glass) 94%, transparent);
  border: 1px solid color-mix(in srgb, var(--of-border) 90%, transparent);
  backdrop-filter: blur(10px);
  color: var(--of-text-muted);
  max-width: min(220px, 42vw);
}

.legend-row {
  margin: 4px 0;
  gap: 8px;
}

.floating-controls {
  left: 12px;
  top: 58px;
  bottom: auto;
  right: auto;
  max-width: calc(100% - 24px);
  gap: 6px;
}

.floating-controls button {
  height: 32px;
  padding: 0 11px;
  font-size: var(--of-type-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 8px;
  background: color-mix(in srgb, var(--of-panel-glass) 94%, transparent);
  border-color: color-mix(in srgb, var(--of-border) 85%, transparent);
  color: var(--of-text-muted);
  backdrop-filter: blur(8px);
}

.floating-controls button:hover,
.floating-controls button:focus-visible {
  color: var(--of-text);
  border-color: color-mix(in srgb, var(--of-cyan) 40%, var(--of-border));
  outline: none;
}

.map-toggle {
  right: 14px;
  bottom: 14px;
  height: 32px;
  padding: 0 12px;
  font-size: var(--of-type-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 8px;
  background: color-mix(in srgb, var(--of-panel-glass) 94%, transparent);
  border-color: color-mix(in srgb, var(--of-border) 85%, transparent);
  color: var(--of-text-muted);
}

.map-toggle.active {
  background: color-mix(in srgb, var(--of-cyan) 18%, transparent);
  color: var(--of-cyan);
  border-color: color-mix(in srgb, var(--of-cyan) 45%, var(--of-border));
  font-weight: 700;
}

/* ----- 4. Event feed + cards + drawer ----- */
.event-panel,
.drawer-right {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--of-panel-strong) 40%, transparent), transparent 120px),
    var(--of-panel);
}

.panel-head {
  padding: 12px 14px 10px;
  gap: 10px;
  border-bottom-color: color-mix(in srgb, var(--of-cyan) 12%, var(--of-border));
  background: color-mix(in srgb, var(--of-panel) 97%, #000);
}

.eyebrow {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--of-cyan);
  font-weight: 700;
}

.panel-head h1 {
  font-size: var(--of-type-xl);
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 2px 0 0;
  line-height: 1.2;
}

.feed-controls {
  gap: 5px;
  min-width: 0;
}

.feed-controls select,
.feed-controls button {
  height: 28px;
  padding: 0 8px;
  font-size: 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  border-color: color-mix(in srgb, var(--of-border) 85%, transparent);
}

.drawer-close {
  margin: 8px 14px 0;
  height: 28px;
  padding: 0 10px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--of-text-faint);
  border-color: transparent;
  background: transparent;
}

.drawer-close:hover {
  color: var(--of-text);
  border-color: var(--of-border);
}

.event-search {
  padding: 10px 14px;
}

.event-search input {
  height: 34px;
  padding: 0 12px;
  font-size: var(--of-type-sm);
  border-radius: 8px;
}

.event-list {
  padding: 8px 10px 14px;
}

.event-card {
  position: relative;
  padding: 11px 12px 12px;
  margin-bottom: 6px;
  border: 1px solid color-mix(in srgb, var(--of-border) 88%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--of-panel-strong) 55%, transparent);
  transition:
    border-color var(--of-ease),
    background var(--of-ease),
    box-shadow var(--of-ease),
    transform var(--of-ease-fast);
}

.event-card:hover {
  background: color-mix(in srgb, var(--of-panel-strong) 88%, #000);
  border-color: color-mix(in srgb, var(--of-cyan) 22%, var(--of-border));
  transform: translateY(-1px);
}

.event-card.is-selected,
.event-card[aria-current="true"] {
  border-color: color-mix(in srgb, var(--of-cyan) 55%, var(--of-border));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--of-cyan) 10%, transparent), transparent 40%),
    color-mix(in srgb, var(--of-panel-strong) 92%, #000);
  box-shadow:
    inset 3px 0 0 var(--of-cyan),
    0 0 0 1px color-mix(in srgb, var(--of-cyan) 18%, transparent);
}

/* Record kind visual grammar (official event vs lead vs observation) */
.event-card.record-event {
  border-left: 3px solid color-mix(in srgb, var(--of-record-event) 70%, transparent);
}

.event-card.record-discovery-lead {
  border-left: 3px solid color-mix(in srgb, var(--of-record-lead) 80%, transparent);
  background: color-mix(in srgb, var(--of-record-lead) 4%, color-mix(in srgb, var(--of-panel-strong) 55%, transparent));
}

.event-card.record-observation {
  border-left: 3px solid color-mix(in srgb, var(--of-record-observation) 75%, transparent);
  background: color-mix(in srgb, var(--of-record-observation) 4%, color-mix(in srgb, var(--of-panel-strong) 55%, transparent));
}

.record-kind {
  font-size: 9px;
  font-family: var(--of-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  border-color: color-mix(in srgb, var(--of-border) 90%, transparent);
  color: var(--of-text-faint);
}

.record-event .record-kind {
  color: var(--of-record-event);
  border-color: color-mix(in srgb, var(--of-record-event) 35%, var(--of-border));
}

.record-discovery-lead .record-kind {
  color: var(--of-record-lead);
  border-color: color-mix(in srgb, var(--of-record-lead) 40%, var(--of-border));
}

.record-observation .record-kind {
  color: var(--of-record-observation);
  border-color: color-mix(in srgb, var(--of-record-observation) 40%, var(--of-border));
}

.event-meta {
  gap: 6px;
  font-size: 9px;
  letter-spacing: 0.04em;
}

.event-card h2 {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  margin: 7px 0 4px;
  color: var(--of-text);
}

.event-card p,
.consumer-card-line {
  font-size: 11px;
  color: var(--of-text-muted);
  line-height: 1.45;
}

.consumer-card-line {
  margin: 4px 0 6px;
}

.category-pill {
  font-weight: 700;
}

.fact-chip,
.source-row span {
  font-size: 9px;
  font-family: var(--of-mono);
}

.event-detail-button,
.mini-source-link {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.group-header {
  padding: 8px 10px;
  margin: 4px 0 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  font-size: 12px;
}

.group-header small {
  font-size: 9px;
  font-family: var(--of-mono);
}

/* Detail drawer as investigation surface */
.event-detail-drawer-host:not([hidden]) {
  display: block;
  padding: 10px 12px 0;
}

.v2-event-detail {
  margin-bottom: 10px;
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 32px rgba(0, 0, 0, 0.28);
}

.v2-detail-title {
  font-size: 16px;
  font-weight: 700;
}

.v2-detail-summary {
  font-size: 12px;
  line-height: 1.55;
}

.v2-command-bar {
  padding: 10px 11px;
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.v2-command-situation {
  font-size: 11px;
  line-height: 1.4;
  margin-bottom: 6px;
}

.v2-command-stats {
  gap: 5px;
  margin-bottom: 6px;
}

.v2-command-stat {
  padding: 6px 3px;
}

.v2-command-stat-value {
  font-size: 15px;
}

.v2-shell {
  gap: 10px;
  margin-bottom: 10px;
}

.v2-card {
  padding: 8px 10px;
}

.v2-card-value {
  font-size: 17px;
}

/* ----- Latest intelligence (dark console, not light cards) ----- */
.latest-intelligence {
  gap: 10px;
}

.latest-storyline {
  border: 1px solid color-mix(in srgb, var(--of-border) 90%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--of-panel-strong) 70%, transparent);
  padding: 12px;
  color: var(--of-text);
}

.latest-storyline h2 {
  margin: 6px 0;
  font-size: 13px;
  color: var(--of-text);
}

.latest-storyline p {
  margin: 4px 0;
  color: var(--of-text-muted);
  font-size: 11px;
}

.latest-storyline-meta {
  color: var(--of-text-faint);
  font-size: 10px;
  font-family: var(--of-mono);
}

.latest-gap {
  color: var(--of-amber);
  font-size: 11px;
}

/* ----- Left drawer density ----- */
.sidebar.left-panel,
.drawer-left {
  padding: 12px 12px 18px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--of-panel-strong) 35%, transparent), transparent 100px),
    var(--of-panel);
}

.sidebar section {
  margin-bottom: 14px;
}

.section-title {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--of-text-faint);
  margin-bottom: 8px;
}

.filter-item {
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--of-panel-strong) 80%, #000);
  border-color: color-mix(in srgb, var(--of-border) 85%, transparent);
  font-weight: 600;
}

.filter-item span {
  font-size: 12px;
}

.stats-grid article {
  padding: 9px 10px;
  border-radius: 8px;
}

.stats-grid strong {
  font-size: 16px;
  font-family: var(--of-mono);
}

.method-note {
  padding: 10px 11px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--of-panel-strong) 70%, transparent);
}

.method-note strong {
  font-size: 11px;
  color: var(--of-text);
}

.method-note p {
  font-size: 10px;
  line-height: 1.5;
}

.preset-chip {
  padding: 6px 10px;
  font-size: 10px;
  border-radius: 999px;
}

/* ----- 5. Empty / loading / focus / polish ----- */
.empty {
  padding: 28px 18px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--of-text-muted);
  border: 1px dashed color-mix(in srgb, var(--of-border) 90%, transparent);
  border-radius: 10px;
  margin: 8px;
  background: rgba(0, 0, 0, 0.12);
}

.map-health,
.feed-error {
  border-radius: 10px;
  backdrop-filter: blur(8px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
.event-card:focus-visible,
.filter-item:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--of-cyan) 75%, #fff);
  outline-offset: 2px;
}

/* Light theme residual balance */
:root.light .map-stage::after {
  box-shadow: inset 0 0 60px rgba(20, 40, 55, 0.08);
}

:root.light .event-card {
  background: #fff;
}

:root.light .latest-storyline {
  background: #fff;
  color: var(--of-text);
}

/* ----- Mobile / tablet intentional layout ----- */
@media (max-width: 900px) {
  .topbar {
    height: auto;
    min-height: var(--of-topbar-height);
    padding: 8px 10px;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .app-shell {
    grid-template: auto minmax(0, 1fr) / 1fr;
  }

  .drawer {
    top: auto;
  }

  .drawer-right.open {
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
  }

  .map-toolbar {
    max-width: calc(100% - 20px);
  }

  .floating-controls {
    top: auto;
    bottom: 12px;
    left: 10px;
  }

  .floating-controls button {
    min-height: 40px;
  }

  .panel-head {
    align-items: flex-start;
  }

  .feed-controls {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .brand div span {
    display: none;
  }

  .dashboard-tab {
    height: 28px;
    padding: 0 8px;
  }

  .map-stage::after {
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35);
  }

  .legend {
    display: none;
  }

  .event-card h2 {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  button,
  .event-card,
  .dashboard-tab,
  .filter-item,
  .preset-chip,
  .v2-connection-row,
  .v2-detail-link,
  .drawer,
  .icon-btn,
  .map-toolbar button,
  .map-toolbar select,
  .floating-controls button {
    transition: none !important;
  }

  .event-card:hover {
    transform: none;
  }
}

/* =============================================================================
   Usability overhaul layer — hierarchy, view context, map primacy, density
   ============================================================================= */

.view-section-hidden,
[hidden].view-section-hidden {
  display: none !important;
}

/* Quieter surfaces: elevation via tone, fewer heavy borders */
body {
  --of-surface-0: #050b12;
  --of-surface-1: #0a121a;
  --of-surface-2: #0e1822;
  --of-surface-3: #13202c;
  --of-accent-1: var(--of-cyan);
  --of-accent-2: var(--of-amber);
}

body.view-chokepoints .filter-item,
body.view-latest-intelligence .tracking-panel {
  /* safety net if JS misses a section */
}

/* Primary: map stage takes visual weight */
.right-drawer-open .map-stage,
.left-drawer-open .map-stage {
  transition: margin var(--of-ease);
}

.map-stage {
  background:
    radial-gradient(ellipse 85% 70% at 50% 45%, rgba(14, 36, 52, 0.55), transparent 68%),
    linear-gradient(180deg, #061018 0%, #050b12 100%);
}

.map-stage::after {
  box-shadow:
    inset 0 0 120px rgba(0, 0, 0, 0.55),
    inset 0 0 1px rgba(62, 224, 200, 0.08);
}

/* Secondary chrome: drawers are quieter than map */
.drawer-left,
.sidebar.left-panel {
  background: var(--of-surface-1);
  border-right: 1px solid rgba(36, 57, 71, 0.85);
  box-shadow: none;
}

.drawer-right,
.event-panel {
  background: var(--of-surface-1);
  border-left: 1px solid rgba(36, 57, 71, 0.85);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.18);
}

/* Tertiary: method notes / source walls quieter */
.method-note,
.source-note,
.sources-status-panel {
  opacity: 0.92;
  border-color: rgba(36, 57, 71, 0.7);
}

.view-chrome .section-title {
  color: var(--of-text);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.view-chrome .panel-help {
  margin-top: 4px;
  color: var(--of-text-faint);
}

/* Feed head cleaner */
.panel-head {
  background: var(--of-surface-2);
  padding: 14px 14px 12px;
}

.panel-head h1 {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.feed-controls select,
.feed-controls button {
  background: var(--of-surface-0);
  border-color: rgba(36, 57, 71, 0.95);
}

/* Cards: denser, calmer, clearer selection */
.event-list {
  padding: 10px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.12));
}

.event-card {
  background: var(--of-surface-2);
  border-color: rgba(36, 57, 71, 0.75);
  box-shadow: none;
}

.event-card:hover {
  background: var(--of-surface-3);
  transform: none;
  border-color: color-mix(in srgb, var(--of-cyan) 28%, var(--of-border));
}

.event-card.is-selected {
  background: color-mix(in srgb, var(--of-cyan) 8%, var(--of-surface-2));
}

/* Chokepoint filter grid polish */
.chokepoint-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.chokepoint-controls label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--of-text-faint);
  margin: 8px 0 4px;
}

.chokepoint-controls input,
.chokepoint-controls select {
  width: 100%;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--of-border);
  background: var(--of-surface-0);
  color: var(--of-text);
  padding: 0 10px;
  font-size: 12px;
}

/* Top bar more terminal-like */
.topbar {
  background: #070f16;
  border-bottom: 1px solid rgba(36, 57, 71, 0.95);
}

.dashboard-tab.active {
  background: color-mix(in srgb, var(--of-cyan) 10%, transparent);
  color: var(--of-cyan);
}

/* Floating controls less noisy */
.floating-controls button {
  background: rgba(7, 15, 22, 0.88);
  color: var(--of-text-muted);
  border-color: rgba(36, 57, 71, 0.9);
  text-transform: none;
  letter-spacing: 0.01em;
  font-weight: 600;
}

.map-toolbar {
  background: rgba(7, 15, 22, 0.9);
  border-color: rgba(36, 57, 71, 0.95);
}

/* Detail drawer investigation surface */
.v2-event-detail,
.event-detail-drawer-host:not([hidden]) > * {
  border-color: rgba(62, 224, 200, 0.18);
}

/* Mobile: intentional stack, not broken chrome */
@media (max-width: 900px) {
  .drawer-right {
    background: var(--of-surface-1);
  }

  .panel-head h1 {
    font-size: 16px;
  }

  .floating-controls {
    gap: 4px;
  }

  .floating-controls button {
    font-size: 10px;
    padding: 0 8px;
  }

  body.view-chokepoints .map-toolbar {
    max-width: calc(100% - 16px);
  }
}

/* Reduce competing accent: prefer cyan + amber only for hot states */
.filter-item.active {
  box-shadow: inset 3px 0 var(--category);
}

.preset-chip.active {
  background: color-mix(in srgb, var(--of-cyan) 16%, transparent);
  color: var(--of-cyan);
  border-color: color-mix(in srgb, var(--of-cyan) 45%, var(--of-border));
  font-weight: 700;
}

/* Empty states calmer */
.empty {
  border-style: solid;
  border-color: rgba(36, 57, 71, 0.8);
  background: var(--of-surface-2);
}

/* =============================================================================
   Phase 6 — feed density, Advanced chrome, change badges, map primacy
   ============================================================================= */

/* Feed controls: primary always visible; advanced secondary row */
.panel-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

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

.feed-hide-btn {
  margin: 0 !important;
  flex: 0 0 auto;
  height: 28px;
  padding: 0 10px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--of-text-faint);
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
}

.feed-hide-btn:hover {
  color: var(--of-text);
  border-color: var(--of-border);
}

.feed-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.feed-controls-primary,
.feed-controls-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  min-width: 0;
}

.feed-controls-secondary {
  grid-template-columns: 1fr 1fr auto;
}

.feed-controls select,
.feed-controls button {
  min-width: 0;
  width: 100%;
  height: 30px;
  font-size: 11px;
}

.feed-controls-secondary button {
  width: auto;
  padding: 0 10px;
  white-space: nowrap;
}

/* Standard mode: quieter chrome */
.standard-mode .advanced-only {
  display: none !important;
}

.standard-mode .method-note.source-note,
.standard-mode #sourcesStatusPanel,
.standard-mode .provider-health-panel,
.standard-mode .count-debug {
  display: none !important;
}

.standard-mode .v2-shell .v2-provider-health,
.standard-mode .v2-legend {
  opacity: 0.95;
}

.standard-mode .tools-menu summary {
  opacity: 0.85;
}

.standard-mode .dashboard-tab[href="/diagnostics"] {
  display: none;
}

.standard-mode .event-card {
  padding: 10px 11px;
}

.standard-mode .event-card h2 {
  font-size: 13px;
  margin: 6px 0 4px;
}

.standard-mode .quality-row {
  display: none;
}

/* Advanced still available but denser */
.advanced-mode .feed-controls-secondary {
  display: grid;
}

/* Change badges on cards */
.change-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--of-mono);
}

.change-badge-new {
  color: var(--of-green, #4fd18a);
  border-color: color-mix(in srgb, var(--of-green, #4fd18a) 45%, transparent);
  background: color-mix(in srgb, var(--of-green, #4fd18a) 12%, transparent);
}

.change-badge-updated {
  color: var(--of-amber, #f0b84a);
  border-color: color-mix(in srgb, var(--of-amber, #f0b84a) 45%, transparent);
  background: color-mix(in srgb, var(--of-amber, #f0b84a) 12%, transparent);
}

.event-card.is-new {
  box-shadow: inset 3px 0 0 var(--of-green, #4fd18a);
}

.event-card.is-updated {
  box-shadow: inset 3px 0 0 var(--of-amber, #f0b84a);
}

.event-card.is-selected.is-new,
.event-card.is-selected.is-updated {
  box-shadow:
    inset 3px 0 0 var(--of-cyan),
    0 0 0 1px color-mix(in srgb, var(--of-cyan) 18%, transparent);
}

/* Map marker change rings (if not already strong) */
.event-marker-new {
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--of-green, #4fd18a) 55%, transparent),
    0 4px 12px rgba(0, 0, 0, 0.45) !important;
}

.event-marker-updated {
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--of-amber, #f0b84a) 50%, transparent),
    0 4px 12px rgba(0, 0, 0, 0.45) !important;
}

/* Map primacy: slightly larger stage presence when right drawer open */
@media (min-width: 901px) {
  .right-drawer-open .map-stage {
    /* keep map dominant; drawer is secondary chrome */
  }

  .drawer-right {
    width: min(360px, 32vw);
    min-width: 300px;
  }

  .right-drawer-open .map-stage {
    margin-right: min(360px, 32vw);
  }
}

/* Instant-feeling tab chrome */
.dashboard-tab {
  transition: color 120ms ease, background 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.dashboard-tab:active {
  transform: translateY(1px);
}

/* Reduce left panel noise further */
.sidebar section {
  margin-bottom: 12px;
}

.standard-mode .tracking-panel label {
  min-height: 40px;
  padding: 6px 9px;
}

@media (max-width: 900px) {
  .feed-controls-primary {
    grid-template-columns: 1fr 1fr;
  }

  .feed-controls-secondary {
    grid-template-columns: 1fr;
  }

  .panel-head-main {
    align-items: center;
  }
}

/* =============================================================================
   Phase 7 â€” operator console visual jump
   Dark elevation, map primacy, less panel competition, secondary-page parity
   ============================================================================= */

:root {
  --of-bg: #03080e;
  --of-bg-grid: #050c14;
  --of-panel: #081018;
  --of-panel-strong: #0c1824;
  --of-panel-glass: rgba(6, 14, 22, 0.92);
  --of-border: #1a2e3c;
  --of-border-hot: #2f5a6c;
  --of-text: #e8f4fa;
  --of-text-muted: #7f9aab;
  --of-text-faint: #5a7384;
  --of-cyan: #2fe0c8;
  --of-cyan-soft: #4fd4a8;
  --of-shadow: 0 20px 56px rgba(0, 0, 0, 0.62);
  --of-glow-cyan: 0 0 22px rgba(47, 224, 200, 0.22);
  --of-elev-1: 0 1px 0 rgba(255, 255, 255, 0.04);
  --of-elev-2: 0 8px 28px rgba(0, 0, 0, 0.4);
  --of-elev-3: 0 16px 48px rgba(0, 0, 0, 0.55);
  --bg: var(--of-bg);
  --panel: var(--of-panel);
  --panel2: var(--of-panel-strong);
  --line: var(--of-border);
  --text: var(--of-text);
  --muted: var(--of-text-muted);
  --accent: var(--of-cyan-soft);
  --shadow: var(--of-shadow);
}

body {
  --of-surface-0: #03080e;
  --of-surface-1: #071018;
  --of-surface-2: #0b1520;
  --of-surface-3: #101e2c;
  background: var(--of-surface-0);
  color: var(--of-text);
}

/* Depth without muddy flat panels */
body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 90% 50% at 50% -10%, rgba(47, 224, 200, 0.045), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(47, 100, 180, 0.04), transparent 50%);
}

.app-shell,
.source-shell {
  position: relative;
  z-index: 1;
}

/* Top bar: terminal strip */
.topbar {
  background: linear-gradient(180deg, #0a141e 0%, #060e16 100%);
  border-bottom: 1px solid rgba(47, 224, 200, 0.12);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5), var(--of-elev-1);
  backdrop-filter: blur(12px);
}

.brand-mark {
  border-color: color-mix(in srgb, var(--of-cyan) 55%, transparent);
  color: var(--of-cyan);
  box-shadow: inset 0 0 12px rgba(47, 224, 200, 0.12);
}

.dashboard-tab {
  color: var(--of-text-faint);
  border: 1px solid transparent;
}

.dashboard-tab:hover {
  color: var(--of-text);
  background: rgba(255, 255, 255, 0.03);
}

.dashboard-tab.active {
  color: var(--of-cyan);
  background: color-mix(in srgb, var(--of-cyan) 9%, transparent);
  border-color: color-mix(in srgb, var(--of-cyan) 28%, transparent);
  box-shadow: inset 0 -2px 0 var(--of-cyan);
}

/* Map is the stage â€” stronger vignette, quieter chrome */
.map-stage {
  background:
    radial-gradient(ellipse 95% 75% at 50% 48%, rgba(12, 40, 58, 0.5), transparent 62%),
    radial-gradient(circle at 50% 100%, rgba(0, 0, 0, 0.45), transparent 45%),
    linear-gradient(180deg, #041018 0%, #02060b 100%) !important;
}

.map-stage::after {
  box-shadow:
    inset 0 0 140px rgba(0, 0, 0, 0.65),
    inset 0 0 2px rgba(47, 224, 200, 0.1) !important;
}

/* Drawers: recede, single elevation edge, no competing boxes */
.drawer-left,
.sidebar.left-panel {
  background: rgba(5, 12, 18, 0.96) !important;
  border-right: 1px solid rgba(26, 46, 60, 0.9) !important;
  box-shadow: none !important;
}

.drawer-right,
.event-panel {
  background: rgba(5, 12, 18, 0.97) !important;
  border-left: 1px solid rgba(26, 46, 60, 0.9) !important;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35) !important;
}

/* Collapse visual competition from sticky method/source walls */
.method-note,
.source-note,
.sources-status-panel,
.layer-summary {
  background: rgba(0, 0, 0, 0.2) !important;
  border-color: rgba(26, 46, 60, 0.65) !important;
  box-shadow: none !important;
}

.stats-grid article {
  background: var(--of-surface-2);
  border: 1px solid rgba(26, 46, 60, 0.75);
  box-shadow: none;
}

.filter-item {
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(26, 46, 60, 0.7);
}

.filter-item:hover {
  border-color: color-mix(in srgb, var(--of-cyan) 30%, var(--of-border));
}

/* Floating map chrome: glass pills, not opaque boxes */
.map-toolbar,
.legend,
.floating-controls button,
.map-toggle {
  background: rgba(4, 12, 18, 0.82) !important;
  border-color: rgba(47, 224, 200, 0.14) !important;
  backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: var(--of-elev-2);
}

.map-toolbar button,
.map-toolbar select {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(26, 46, 60, 0.85);
}

.map-toolbar button:hover,
.floating-controls button:hover,
.map-toggle:hover {
  color: var(--of-cyan);
  border-color: color-mix(in srgb, var(--of-cyan) 40%, transparent);
}

.map-toggle.active {
  background: color-mix(in srgb, var(--of-cyan) 16%, rgba(4, 12, 18, 0.9)) !important;
  color: var(--of-cyan);
  border-color: color-mix(in srgb, var(--of-cyan) 50%, transparent) !important;
  box-shadow: var(--of-glow-cyan);
}

/* Cards: dense console density */
.event-card {
  background: var(--of-surface-2) !important;
  border: 1px solid rgba(26, 46, 60, 0.8) !important;
  border-radius: 8px;
  box-shadow: none !important;
}

.event-card:hover {
  background: var(--of-surface-3) !important;
  border-color: color-mix(in srgb, var(--of-cyan) 32%, var(--of-border)) !important;
}

.event-card.is-selected,
.event-card[aria-current="true"] {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--of-cyan) 12%, transparent), transparent 50%),
    var(--of-surface-3) !important;
  border-color: color-mix(in srgb, var(--of-cyan) 50%, var(--of-border)) !important;
  box-shadow: inset 3px 0 0 var(--of-cyan) !important;
}

.event-card.is-new,
.event-card[data-change="new"] {
  box-shadow: inset 3px 0 0 var(--of-change-new) !important;
}

.event-card.is-updated,
.event-card[data-change="updated"] {
  box-shadow: inset 3px 0 0 var(--of-change-updated) !important;
}

.panel-head {
  background: linear-gradient(180deg, #0c1822, #081018) !important;
  border-bottom: 1px solid rgba(47, 224, 200, 0.1);
}

.eyebrow {
  color: var(--of-cyan);
  text-shadow: 0 0 12px rgba(47, 224, 200, 0.25);
}

/* Standard mode: hide advanced chrome hard */
.standard-mode .advanced-only,
body:not(.advanced-mode) .advanced-only,
.standard-mode .v2-connections-panel,
.standard-mode .sources-status-panel details,
.standard-mode .tracking-panel .advanced-tracking {
  display: none !important;
}

.standard-mode .osint-dashboard-v2 {
  opacity: 0.95;
}

.standard-mode .v2-shell {
  gap: 8px;
}

/* v2 dashboard quieter */
.v2-card,
.v2-command-bar {
  background: var(--of-surface-2);
  border-color: rgba(26, 46, 60, 0.85);
  box-shadow: none;
}

.v2-card-value {
  font-family: var(--of-mono);
  color: var(--of-text);
}

/* Reduce overlap: left drawer content spacing */
.sidebar section + section {
  border-top: 1px solid rgba(26, 46, 60, 0.45);
  padding-top: 10px;
}

.section-title {
  color: var(--of-text-faint);
  font-size: 10px;
  letter-spacing: 0.14em;
}

/* Scrollbars (webkit) denser console feel */
.drawer-left::-webkit-scrollbar,
.drawer-right::-webkit-scrollbar,
.event-list::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.drawer-left::-webkit-scrollbar-thumb,
.drawer-right::-webkit-scrollbar-thumb,
.event-list::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(47, 224, 200, 0.18);
  border-radius: 99px;
}

/* Focus ring single accent */
:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--of-cyan) 80%, #fff) !important;
  outline-offset: 2px;
}

/* ----- Secondary pages (Countries / Sources / Diagnostics) ----- */
body.source-explorer-page,
body.countries-page,
body.diagnostics-page {
  background: var(--of-surface-0);
  color: var(--of-text);
}

body.source-explorer-page .source-shell,
body.countries-page .source-shell,
body.diagnostics-page .source-shell {
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(47, 224, 200, 0.04), transparent 55%),
    var(--of-surface-0);
}

body.source-explorer-page .source-header,
body.countries-page .source-header,
body.diagnostics-page .source-header {
  min-height: 52px;
  padding: 10px 18px;
  background: linear-gradient(180deg, #0a141e, #060e16);
  border-bottom: 1px solid rgba(47, 224, 200, 0.12);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

body.source-explorer-page .source-links a,
body.countries-page .source-links a,
body.diagnostics-page .source-links a,
body.source-explorer-page .source-actions a {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(26, 46, 60, 0.9);
  color: var(--of-text-muted);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

body.source-explorer-page .source-links a:hover,
body.countries-page .source-links a:hover,
body.source-explorer-page .source-links a[aria-current="page"] {
  color: var(--of-cyan);
  border-color: color-mix(in srgb, var(--of-cyan) 40%, transparent);
  background: color-mix(in srgb, var(--of-cyan) 10%, transparent);
  font-weight: 700;
}

body.source-explorer-page .source-controls,
body.countries-page .source-controls {
  border-bottom-color: rgba(26, 46, 60, 0.8);
}

body.source-explorer-page .source-status-row,
body.countries-page .source-status-row,
body.source-explorer-page .source-detail,
body.countries-page .source-detail,
body.source-explorer-page .source-summary,
body.countries-page .source-summary {
  background: var(--of-surface-2);
  border: 1px solid rgba(26, 46, 60, 0.85);
  border-radius: 10px;
  box-shadow: none;
}

body.countries-page .country-score-header {
  background: var(--of-surface-2);
  border-bottom: 1px solid rgba(26, 46, 60, 0.85);
  color: var(--of-text-faint);
}

body.countries-page .country-score-row,
body.countries-page .country-summary-card {
  background: var(--of-surface-2);
  border: 1px solid rgba(26, 46, 60, 0.75);
  border-radius: 8px;
}

body.countries-page .country-score-row:hover {
  border-color: color-mix(in srgb, var(--of-cyan) 30%, var(--of-border));
}

body.source-explorer-page input,
body.source-explorer-page select,
body.countries-page input,
body.countries-page select,
body.diagnostics-page input,
body.diagnostics-page select {
  background: var(--of-surface-0);
  border: 1px solid rgba(26, 46, 60, 0.95);
  color: var(--of-text);
  border-radius: 8px;
}

body.source-explorer-page button,
body.countries-page button,
body.diagnostics-page button {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(26, 46, 60, 0.95);
  color: var(--of-text-muted);
  border-radius: 8px;
}

body.source-explorer-page button:hover,
body.countries-page button:hover {
  color: var(--of-cyan);
  border-color: color-mix(in srgb, var(--of-cyan) 40%, transparent);
}

/* Diagnostics denser tables */
body.diagnostics-page table,
.diagnostics-page .diag-table {
  border-collapse: collapse;
  width: 100%;
}

body.diagnostics-page th,
body.diagnostics-page td {
  border-bottom: 1px solid rgba(26, 46, 60, 0.7);
  padding: 8px 10px;
  font-size: 12px;
}

body.diagnostics-page th {
  color: var(--of-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}

/* Leaflet control glass (map primacy) */
.leaflet-control-zoom a,
.leaflet-bar a {
  background: rgba(4, 12, 18, 0.9) !important;
  color: var(--of-text-muted) !important;
  border-color: rgba(26, 46, 60, 0.9) !important;
}

.leaflet-control-zoom a:hover {
  color: var(--of-cyan) !important;
}

.leaflet-control-attribution {
  background: rgba(4, 12, 18, 0.75) !important;
  color: var(--of-text-faint) !important;
  font-size: 10px !important;
}

/* Light theme residual â€” do not break */
:root.light {
  --of-bg: #e8f0f4;
  --of-panel: #ffffff;
  --of-panel-strong: #edf3f6;
  --of-border: #c9d7de;
  --of-text: #10212c;
  --of-text-muted: #536b78;
  --of-text-faint: #6f8592;
}

:root.light body::before {
  display: none;
}

:root.light .map-stage {
  background: #d8e4ec !important;
}

@media (max-width: 900px) {
  .drawer-right,
  .event-panel {
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.5) !important;
  }

  .map-toolbar {
    max-width: calc(100% - 16px);
  }
}

/* =============================================================================
   Phase 9 â€” map visual grammar polish (chrome + markers + declutter)
   Spec: docs/wayfinder-61-map-visual-grammar.md
   ============================================================================= */

/* Compact floating legend â€” decode only, not a second dashboard */
.legend {
  bottom: 14px !important;
  left: 14px !important;
  max-width: min(200px, 38vw) !important;
  max-height: min(42vh, 280px);
  overflow: auto;
  padding: 8px 10px !important;
  font-size: 10px !important;
  line-height: 1.35;
  background: rgba(4, 12, 18, 0.86) !important;
  border: 1px solid rgba(47, 224, 200, 0.14) !important;
  border-radius: 10px !important;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  color: var(--of-text-muted, #7f9aab);
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 3px 0 !important;
}

.legend-row .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--category, var(--of-cyan, #2fe0c8));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.legend-row .dot.record-dot {
  border-radius: 2px;
  background: #7dd3fc;
}

.chokepoint-legend-dot {
  background: #f6c453 !important;
  border-radius: 2px !important;
}

.legend-hint {
  font-size: 9px !important;
  color: var(--of-text-faint, #5a7384) !important;
  font-style: italic;
  margin: 2px 0 4px !important;
  padding-left: 16px;
}

/* Map toolbar: single strip, less boxy */
.map-toolbar {
  top: 10px !important;
  left: 10px !important;
  gap: 4px !important;
  padding: 5px !important;
  max-width: min(640px, calc(100% - 20px)) !important;
  background: rgba(4, 12, 18, 0.84) !important;
  border: 1px solid rgba(47, 224, 200, 0.12) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42) !important;
}

.map-toolbar button,
.map-toolbar select {
  height: 28px !important;
  font-size: 10px !important;
  padding: 0 8px !important;
}

/* Floating controls sit under toolbar, never stacked over legend */
.floating-controls {
  left: 10px !important;
  top: 52px !important;
  bottom: auto !important;
  gap: 4px !important;
  max-width: min(320px, calc(100% - 20px));
}

.floating-controls button {
  height: 28px !important;
  font-size: 10px !important;
  padding: 0 9px !important;
  background: rgba(4, 12, 18, 0.84) !important;
  border-color: rgba(26, 46, 60, 0.9) !important;
}

.map-toggle {
  right: 12px !important;
  bottom: 52px !important;
  height: 28px !important;
  font-size: 10px !important;
  background: rgba(4, 12, 18, 0.84) !important;
}

/* Leaflet chrome quieter */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4) !important;
  margin-right: 12px !important;
  margin-bottom: 12px !important;
}

.leaflet-control-zoom a {
  width: 30px !important;
  height: 30px !important;
  line-height: 30px !important;
  background: rgba(4, 12, 18, 0.88) !important;
  color: var(--of-text-muted, #8eacbc) !important;
  border: 1px solid rgba(26, 46, 60, 0.95) !important;
}

.leaflet-control-zoom a:hover {
  color: var(--of-cyan, #2fe0c8) !important;
  border-color: rgba(47, 224, 200, 0.35) !important;
}

.leaflet-control-attribution {
  background: rgba(4, 12, 18, 0.72) !important;
  color: var(--of-text-faint, #5a7384) !important;
  font-size: 9px !important;
  max-width: min(48vw, 320px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Event markers â€” hierarchy, color-blind assist via ring weight */
.event-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--marker, #2fe0c8);
  border: 2px solid rgba(5, 12, 18, 0.85);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--marker, #2fe0c8) 55%, transparent);
}

.event-marker.record-marker {
  border-radius: 2px;
  width: 11px;
  height: 11px;
  opacity: 0.88;
}

.event-marker-selected {
  width: 14px;
  height: 14px;
  border-color: #2fe0c8;
  box-shadow:
    0 0 0 2px rgba(47, 224, 200, 0.55),
    0 0 14px rgba(47, 224, 200, 0.35);
}

.event-marker-new {
  box-shadow:
    0 0 0 2px rgba(79, 209, 138, 0.65),
    0 0 10px rgba(79, 209, 138, 0.25);
}

.event-marker-updated {
  box-shadow:
    0 0 0 2px rgba(240, 184, 74, 0.6),
    0 0 10px rgba(240, 184, 74, 0.22);
}

.event-marker-cluster {
  box-shadow: 0 0 0 2px rgba(47, 224, 200, 0.4);
}

.event-marker-dimmed {
  opacity: 0.22 !important;
  filter: grayscale(0.35);
}

/* MarkerCluster badges â€” dense console, not candy */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background: rgba(47, 224, 200, 0.18) !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background: rgba(8, 18, 26, 0.92) !important;
  color: #eaf6fc !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  border: 1px solid rgba(47, 224, 200, 0.35) !important;
}

/* Reduce left-drawer visual competition against map */
.drawer-left .method-note,
.sidebar .method-note {
  font-size: 10px;
  opacity: 0.85;
}

.standard-mode .drawer-left .sources-status-panel,
.standard-mode .drawer-left .layer-summary {
  display: none;
}

/* Map health / feed error less shouty */
.map-health,
.feed-error {
  max-width: min(360px, calc(100% - 24px));
  background: rgba(8, 14, 20, 0.92) !important;
  border: 1px solid rgba(240, 184, 74, 0.35) !important;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

/* Mobile: legend optional, controls stack cleanly */
@media (max-width: 900px) {
  .legend {
    max-width: min(160px, 42vw) !important;
    max-height: 28vh;
    bottom: 56px !important;
  }

  .floating-controls {
    top: auto !important;
    bottom: 12px !important;
    left: 8px !important;
  }

  .map-toggle {
    bottom: 12px !important;
  }
}

@media (max-width: 520px) {
  .legend {
    display: none !important;
  }
}

/* Prefer reduced motion: no marker pulse if any */
@media (prefers-reduced-motion: reduce) {
  .event-marker-selected,
  .event-marker-new,
  .event-marker-updated {
    transition: none;
  }
}
