/* ── Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --surface: rgba(20, 24, 36, 0.92);
  --surface-solid: #14182a;
  --border: rgba(255,255,255,0.10);
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --online: #22c55e;
  --offline: #6b7280;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --glass: rgba(15, 17, 27, 0.82);
  --glass-border: rgba(255,255,255,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Light mode variables ────────────────────────────────────────── */
:root[data-theme="light"] {
  --bg: #f0f4f8;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --border: rgba(0,0,0,0.10);
  --text: #1e293b;
  --text-muted: #64748b;
  --glass: rgba(240, 244, 248, 0.88);
  --glass-border: rgba(0,0,0,0.10);
  --shadow: 0 8px 32px rgba(0,0,0,0.12);
}

/* OS-level light preference (no manual override stored yet) */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) {
    --bg: #f0f4f8;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-solid: #ffffff;
    --border: rgba(0,0,0,0.10);
    --text: #1e293b;
    --text-muted: #64748b;
    --glass: rgba(240, 244, 248, 0.88);
    --glass-border: rgba(0,0,0,0.10);
    --shadow: 0 8px 32px rgba(0,0,0,0.12);
  }
}

/* Light-mode specific overrides for elements that use hard-coded rgba whites */
:root[data-theme="light"] .field input,
:root[data-theme="light"] .field select,
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) .field input,
  :root:not([data-theme="dark"]):not([data-theme="light"]) .field select { background: rgba(0,0,0,0.05); }
}

:root[data-theme="light"] .field input,
:root[data-theme="light"] .field select { background: rgba(0,0,0,0.05); }

:root[data-theme="light"] .vehicle-item,
:root[data-theme="light"] .admin-item,
:root[data-theme="light"] .activity-summary { background: rgba(0,0,0,0.04); }

:root[data-theme="light"] .vehicle-item:hover { background: rgba(0,0,0,0.07); }

:root[data-theme="light"] .btn-icon { background: rgba(0,0,0,0.07); }
:root[data-theme="light"] .btn-icon:hover { background: rgba(0,0,0,0.12); }

:root[data-theme="light"] .btn-sm { background: rgba(0,0,0,0.07); }
:root[data-theme="light"] .btn-sm:hover { background: rgba(0,0,0,0.13); }

:root[data-theme="light"] .admin-nav-btn { background: rgba(0,0,0,0.06); }
:root[data-theme="light"] .admin-nav-btn:hover { background: rgba(0,0,0,0.11); }

:root[data-theme="light"] #login-screen {
  background: linear-gradient(135deg, #e2eaf4 0%, #dce8f5 100%);
}

:root[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); }
:root[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

:root[data-theme="light"] .poi-table td { border-bottom-color: rgba(0,0,0,0.06); }
:root[data-theme="light"] .poi-table tr:hover td { background: rgba(0,0,0,0.04); }

/* Duplicate for OS media query */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) .field input,
  :root:not([data-theme="dark"]):not([data-theme="light"]) .field select { background: rgba(0,0,0,0.05); }
  :root:not([data-theme="dark"]):not([data-theme="light"]) .vehicle-item,
  :root:not([data-theme="dark"]):not([data-theme="light"]) .admin-item,
  :root:not([data-theme="dark"]):not([data-theme="light"]) .activity-summary { background: rgba(0,0,0,0.04); }
  :root:not([data-theme="dark"]):not([data-theme="light"]) .vehicle-item:hover { background: rgba(0,0,0,0.07); }
  :root:not([data-theme="dark"]):not([data-theme="light"]) .btn-icon { background: rgba(0,0,0,0.07); }
  :root:not([data-theme="dark"]):not([data-theme="light"]) .btn-icon:hover { background: rgba(0,0,0,0.12); }
  :root:not([data-theme="dark"]):not([data-theme="light"]) .btn-sm { background: rgba(0,0,0,0.07); }
  :root:not([data-theme="dark"]):not([data-theme="light"]) .btn-sm:hover { background: rgba(0,0,0,0.13); }
  :root:not([data-theme="dark"]):not([data-theme="light"]) .admin-nav-btn { background: rgba(0,0,0,0.06); }
  :root:not([data-theme="dark"]):not([data-theme="light"]) .admin-nav-btn:hover { background: rgba(0,0,0,0.11); }
  :root:not([data-theme="dark"]):not([data-theme="light"]) #login-screen {
    background: linear-gradient(135deg, #e2eaf4 0%, #dce8f5 100%);
  }
  :root:not([data-theme="dark"]):not([data-theme="light"]) ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); }
  :root:not([data-theme="dark"]):not([data-theme="light"]) ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }
  :root:not([data-theme="dark"]):not([data-theme="light"]) .poi-table td { border-bottom-color: rgba(0,0,0,0.06); }
  :root:not([data-theme="dark"]):not([data-theme="light"]) .poi-table tr:hover td { background: rgba(0,0,0,0.04); }
}

/* ── Logo theme variants ─────────────────────────────────────────── */
/*
 * logo-dark  = version designed for dark backgrounds (e.g. white/light lettering)
 * logo-light = version designed for light backgrounds (e.g. dark lettering)
 *
 * Default (no data-theme set, OS prefers dark): show dark logo.
 * OS prefers light (no override): show light logo.
 * data-theme="dark":  show dark logo.
 * data-theme="light": show light logo.
 */

/* Base: dark logo visible, light logo hidden */
.logo-dark  { display: block; }
.logo-light { display: none;  }

/* OS-level light preference with no manual override */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) .logo-dark  { display: none;  }
  :root:not([data-theme="dark"]):not([data-theme="light"]) .logo-light { display: block; }
}

/* Manual overrides */
:root[data-theme="light"] .logo-dark  { display: none;  }
:root[data-theme="light"] .logo-light { display: block; }
:root[data-theme="dark"]  .logo-dark  { display: block; }
:root[data-theme="dark"]  .logo-light { display: none;  }


.theme-toggle {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  cursor: pointer;
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.theme-toggle:hover { background: rgba(255,255,255,0.14); }
:root[data-theme="light"] .theme-toggle,
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) .theme-toggle { background: rgba(0,0,0,0.07); }
  :root:not([data-theme="dark"]):not([data-theme="light"]) .theme-toggle:hover { background: rgba(0,0,0,0.13); }
}
:root[data-theme="light"] .theme-toggle { background: rgba(0,0,0,0.07); }
:root[data-theme="light"] .theme-toggle:hover { background: rgba(0,0,0,0.13); }

html, body { height: 100%; overflow: hidden; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; }

/* ── Screens ─────────────────────────────────────────────────────── */
.screen { position: fixed; inset: 0; }
.hidden { display: none !important; }

/* ── Login ───────────────────────────────────────────────────────── */
#login-screen {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f1117 0%, #1a1f35 100%);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo img { height: 48px; max-width: 260px; width: auto; display: block; margin: 0 auto; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.field input, .field select { width: 100%; background: rgba(255,255,255,0.06); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; color: var(--text); font-size: 0.9rem; transition: border-color 0.2s; }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field input::placeholder { color: var(--text-muted); }

.btn-primary { display: block; width: 100%; background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm); padding: 12px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: background 0.2s; margin-top: 8px; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary.full-width { margin-top: 12px; }
.btn-link { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.82rem; margin-top: 8px; width: 100%; text-align: center; padding: 4px; }
.btn-link:hover { color: var(--text); }

.error-msg { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #f87171; border-radius: var(--radius-sm); padding: 8px 12px; margin-top: 8px; font-size: 0.82rem; }
.info-msg { background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.3); color: #93c5fd; border-radius: var(--radius-sm); padding: 8px 12px; margin-top: 8px; font-size: 0.82rem; }

/* ── Map ─────────────────────────────────────────────────────────── */
#map { position: absolute; inset: 0; }
.maplibregl-ctrl-bottom-right { bottom: 80px; }

/* ── Glass pane ──────────────────────────────────────────────────── */
.glass-pane {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ── Summary pane ────────────────────────────────────────────────── */
.summary-pane {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;   /* stack vertically */
  align-items: center;      /* center everything */
  z-index: 10;
  max-width: calc(100vw - 40px);
  padding: 12px 16px;
  gap: 12px;
}

.summary-logo {
  width: 100%;              /* logo takes full row */
  display: flex;
  justify-content: center;
}
.summary-body {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.summary-time { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; white-space: nowrap; }
.summary-stats { display: flex; gap: 16px; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-val { font-size: 1.1rem; font-weight: 700; }
.stat-lbl { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat.online .stat-val { color: var(--online); }

.btn-icon { background: rgba(255,255,255,0.08); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; cursor: pointer; color: var(--text); transition: background 0.2s; display: flex; align-items: center; justify-content: center; }
.btn-icon:hover { background: rgba(255,255,255,0.14); }
.btn-icon svg { width: 18px; height: 18px; }

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100;
}

.sidebar {
  position: fixed; top: 0; right: 0; bottom: 0; width: 380px;
  background: var(--surface-solid);
  border-left: 1px solid var(--border);
  z-index: 101;
  display: flex; flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,0.4);
  transition: transform 0.25s ease;
}

/* ── Drag handle (mobile only) ───────────────────────────────────── */
.sidebar-drag-handle {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 10px 0 6px;
  cursor: ns-resize;
  touch-action: none;
  flex-shrink: 0;
  -webkit-user-select: none;
  user-select: none;
}
.sidebar-drag-pill {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 2px;
}

/* ── Mobile: bottom sheet ────────────────────────────────────────── */
@media (max-width: 480px) {
  /* Overlay sits behind the sheet but doesn't dim — map stays visible */
  .sidebar-overlay { background: transparent; pointer-events: none; }

  .sidebar {
    top: auto;
    left: 0;
    right: 0;
    width: 100%;
    height: 50vh;
    min-height: 64px;
    max-height: 95vh;
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.4);
  }

  .sidebar-drag-handle { display: flex; }
}

.sidebar-header {
  display: flex; align-items: stretch; border-bottom: 1px solid var(--border); flex-shrink: 0;
}

.sidebar-tabs { display: flex; flex: 1; }
.tab-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 12px 4px; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-muted); cursor: pointer; transition: all 0.2s; font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.tab-btn svg { width: 18px; height: 18px; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.sidebar-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0 16px; font-size: 1.1rem; }
.sidebar-close:hover { color: var(--text); }

.sidebar-content { flex: 1; overflow-y: auto; }
.tab-content { padding: 16px; }

.sidebar-footer { border-top: 1px solid var(--border); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }

/* ── Lang selector ───────────────────────────────────────────────── */
.lang-selector { display: flex; gap: 4px; }
.lang-btn { background: rgba(255,255,255,0.06); border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; color: var(--text-muted); cursor: pointer; font-size: 0.72rem; font-weight: 700; transition: all 0.2s; }
.lang-btn:hover, .lang-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.login-lang { justify-content: center; margin-top: 20px; }

/* ── Vehicle list ────────────────────────────────────────────────── */
.search-bar { margin-bottom: 12px; }
.search-bar input { width: 100%; background: rgba(255,255,255,0.06); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 14px; color: var(--text); font-size: 0.85rem; }
.search-bar input:focus { outline: none; border-color: var(--accent); }

.vehicle-list { display: flex; flex-direction: column; gap: 8px; }
.vehicle-item {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; transition: all 0.15s;
}
.vehicle-item:hover { background: rgba(255,255,255,0.08); border-color: var(--accent); }
.vehicle-item.online { border-left: 3px solid var(--online); }
.vehicle-item.offline { border-left: 3px solid var(--offline); }

.vehicle-icon-sm {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.vehicle-icon-sm.online { background: var(--accent); }
.vehicle-icon-sm.offline { background: var(--offline); }
.vehicle-icon-sm svg { width: 20px; height: 20px; color: #fff; fill: #fff; }

.vehicle-info { flex: 1; min-width: 0; }
.vehicle-label { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vehicle-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.vehicle-speed { font-size: 0.8rem; font-weight: 600; flex-shrink: 0; }
.speed-badge { background: rgba(59,130,246,0.2); color: var(--accent); padding: 2px 8px; border-radius: 12px; }

/* ── Vehicle popup ───────────────────────────────────────────────── */
.vehicle-popup {
  position: absolute; bottom: 100px; left: 50%; transform: translateX(-50%);
  width: 280px; background: var(--surface-solid);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  z-index: 50; padding: 16px;
}

.popup-close { position: absolute; top: 10px; right: 10px; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; line-height: 1; }
.popup-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.popup-vehicle-icon { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.popup-vehicle-icon.online { background: var(--accent); }
.popup-vehicle-icon.offline { background: var(--offline); }
.popup-vehicle-icon svg { width: 24px; height: 24px; fill: #fff; }
.popup-label { font-weight: 700; font-size: 1rem; }
.popup-status { font-size: 0.75rem; margin-top: 2px; }
.popup-status.online { color: var(--online); }
.popup-status.offline { color: var(--offline); }

.popup-body { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.popup-row { display: flex; justify-content: space-between; font-size: 0.82rem; }
.popup-row span { color: var(--text-muted); }

/* ── Activity ────────────────────────────────────────────────────── */
.activity-controls { margin-bottom: 16px; }
.date-range { display: flex; align-items: center; gap: 8px; }
.date-range input { flex: 1; min-width: 0; font-size: 0.78rem; padding: 8px 10px; }

.quick-range { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.quick-range .btn-sm { flex: 1; min-width: 0; text-align: center; font-size: 0.72rem; padding: 5px 6px; }

.activity-summary { background: rgba(255,255,255,0.04); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 16px; }
.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 0.85rem; }
.stat-row span { color: var(--text-muted); }

.playback-controls { margin-bottom: 16px; }
.playback-controls input[type=range] { width: 100%; accent-color: var(--accent); margin-bottom: 10px; }
.playback-row { display: flex; align-items: center; gap: 8px; }
.playback-time { font-size: 0.8rem; color: var(--text-muted); flex: 1; font-variant-numeric: tabular-nums; }

.btn-sm { background: rgba(255,255,255,0.08); border: 1px solid var(--border); border-radius: 6px; padding: 5px 12px; color: var(--text); cursor: pointer; font-size: 0.78rem; font-weight: 600; transition: background 0.2s; }
.btn-sm:hover { background: rgba(255,255,255,0.15); }
.btn-sm.danger { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.3); color: #f87171; }
.btn-sm.danger:hover { background: rgba(239,68,68,0.25); }

.poi-table-wrap { margin-top: 8px; }
.poi-table-wrap h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px; }
.poi-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.poi-table th { color: var(--text-muted); font-weight: 600; padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--border); }
.poi-table td { padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.poi-table tr:hover td { background: rgba(255,255,255,0.04); }

/* ── Admin section ───────────────────────────────────────────────── */
.pending-alert { background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3); border-radius: var(--radius-sm); padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 0.85rem; color: #fcd34d; }
.badge { background: var(--warning); color: #000; border-radius: 12px; padding: 2px 8px; font-size: 0.72rem; font-weight: 700; }

.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-nav-btn { background: rgba(255,255,255,0.06); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 14px; color: var(--text-muted); cursor: pointer; font-size: 0.8rem; font-weight: 600; transition: all 0.2s; }
.admin-nav-btn:hover { color: var(--text); background: rgba(255,255,255,0.12); }
.admin-nav-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.admin-list { display: flex; flex-direction: column; gap: 8px; }
.admin-item { background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.admin-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.admin-item-title { font-weight: 600; font-size: 0.9rem; }
.admin-item-meta { font-size: 0.75rem; color: var(--text-muted); }
.admin-item-actions { display: flex; gap: 6px; flex-shrink: 0; margin-left: 8px; }

.add-btn { display: flex; align-items: center; gap: 6px; background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.3); border-radius: var(--radius-sm); padding: 8px 14px; color: var(--accent); cursor: pointer; font-size: 0.82rem; font-weight: 600; margin-bottom: 12px; width: 100%; justify-content: center; transition: all 0.2s; }
.add-btn:hover { background: rgba(59,130,246,0.25); }

/* ── Status dot ──────────────────────────────────────────────────── */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.online { background: var(--online); box-shadow: 0 0 6px var(--online); }
.dot.offline { background: var(--offline); }

/* ── Modal ───────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal-card { background: var(--surface-solid); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 28px; width: 100%; max-width: 440px; box-shadow: var(--shadow); max-height: 90vh; overflow-y: auto; }
.modal-card h3 { font-size: 1.1rem; margin-bottom: 16px; font-weight: 700; }
.modal-actions { display: flex; gap: 8px; margin-top: 20px; justify-content: flex-end; }

/* ── Map marker custom ───────────────────────────────────────────── */
.map-vehicle-marker {
  position: relative;
  width: 36px;
  height: 36px;
  cursor: pointer;
  /* Critical: arrow overflows visually but must not affect layout measurement */
  overflow: visible;
  contain: layout;
}

.marker-circle {
  position: absolute;
  inset: 0;                     /* fills the 40×40 wrapper exactly */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.25);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  transition: transform 0.3s ease, background 0.3s ease;
}
.marker-circle.online  { background: var(--accent); }
.marker-circle.offline { background: var(--offline); }
.marker-circle:hover   { transform: scale(1.1); }
.marker-circle svg     { width: 22px; height: 22px; fill: white; }

/* Arrow is now fully owned by JS buildArrow(), no CSS geometry needed */
.marker-arrow {
  position: absolute;
  pointer-events: none;
  /* transform is set entirely by JS */
}
.marker-arrow-inner { display: none; } /* legacy, no longer used */

/* ── Scrollbar ───────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ── Playback marker ─────────────────────────────────────────────── */
.playback-marker { pointer-events: none; }

/* ── Tooltip ─────────────────────────────────────────────────────── */
.tooltip { position: absolute; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; font-size: 0.75rem; pointer-events: none; white-space: nowrap; z-index: 200; }