/* ============================================
   SkyKharkiv Map v3.0 — Tactical Minimalism
   Complete UI override
   ============================================ */

/* ===== DESIGN TOKENS ===== */
:root {
  --accent: #00ffa3;
  --accent-dim: rgba(0, 255, 163, 0.12);
  --accent-glow: rgba(0, 255, 163, 0.3);
  --danger: #ff3b5c;
  --danger-dim: rgba(255, 59, 92, 0.12);
  --warning: #ffb347;
  --info: #5cb8ff;
  --surface: rgba(10, 14, 20, 0.82);
  --surface-solid: #0a0e14;
  --surface-hover: rgba(0, 255, 163, 0.06);
  --border: rgba(255, 255, 255, 0.07);
  --border-accent: rgba(0, 255, 163, 0.18);
  --text: #f0f4ff;
  --text-dim: rgba(200, 210, 230, 0.5);
  --blur: 16px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --font-ui: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* compat with old code referencing these */
  --panel-bg: var(--surface);
  --panel-text: var(--text);
  --btn-primary: var(--accent);
  --btn-success: var(--accent);
  --btn-muted: #1d2732;
  --btn-danger: var(--danger);
  --route-main: #00ffa3;
  --route-shadow: #020409;
  --glow: drop-shadow(0 0 0.6px #ffb347) drop-shadow(0 0 3px #ffb347) brightness(1.05) contrast(1.05);
  --map-overlay-br: brightness(1.06) contrast(1.05);
  --card-bg: rgba(11, 17, 24, 0.92);
  --card-border: var(--border-accent);
  --card-hover: var(--surface-hover);
  --card-active: var(--accent-dim);
}

/* ===== BASE ===== */
html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  background: #050710;
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#map {
  position: relative;
  width: 100vw; height: 100vh;
}

/* Remove old radar grid */
#map::before {
  content: "" !important;
  position: absolute; inset: 0;
  pointer-events: none;
  background: none !important;
  background-image: none !important;
  opacity: 0 !important;
  z-index: 8;
}

/* Softer vignette */
#map::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, transparent 0%, transparent 60%, rgba(0,0,0,0.3) 100%);
  z-index: 5;
}

.leaflet-pane,
.leaflet-control-container {
  position: relative;
  z-index: 9;
}

/* statusBar removed — replaced by #hudInfoPanel */

#topHint { display: none !important; }

/* ===== RIGHT TOOLBAR ===== */
.toolbar {
  position: fixed;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
  animation: slide-in-right 0.5s var(--spring) both;
}

.tb-btn {
  width: 46px; height: 46px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: all 0.2s var(--spring);
  position: relative;
  line-height: 1;
}
.tb-icon { font-size: 16px; line-height: 1; flex-shrink: 0; }
.tb-label { font: 600 7px/1 var(--font-ui); opacity: 0.55; letter-spacing: 0.02em; white-space: nowrap; pointer-events: none; }
.tb-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-accent);
  transform: scale(1.08);
}
.tb-btn:active { transform: scale(0.94); }

.tb-btn.tb-danger:hover {
  background: var(--danger-dim);
  border-color: rgba(255, 59, 92, 0.25);
}

.tb-sep {
  width: 24px; height: 1px;
  background: var(--border);
  margin: 3px 0;
}

/* Tooltip on hover — slides from right */
.tb-btn[title]::after {
  content: attr(title);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  color: var(--text);
  font: 500 11px/1 var(--font-ui);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 10;
}
.tb-btn[title]:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Hide old HUD completely */
.hud-buttons { display: none !important; }
.hud-handle { display: none !important; }
.quick-shot { display: none !important; }

/* ===== TARGET DOCK (bottom) — always visible ===== */
.menu-wrap {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
}

.menu-fab { display: none !important; }

.menu-panel {
  position: static !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: none !important;
  transition: none;
}

.menu-title { display: none; }

.menu {
  display: flex !important;
  gap: 2px;
  padding: 5px 6px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  max-width: 90vw;
  overflow-x: auto;
  scrollbar-width: none;
  /* override old grid */
  grid-auto-flow: unset;
  grid-auto-columns: unset;
  max-height: none;
  animation: fade-in-up 0.5s var(--spring) both;
  animation-delay: 0.1s;
}
.menu::-webkit-scrollbar { display: none; }

.menu-item {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 4px 3px;
  min-width: 44px !important;
  width: 48px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s var(--spring);
  position: relative;
  /* reset old grid layout */
  grid-template-columns: unset;
  grid-template-rows: unset;
}
.menu-item:hover {
  background: var(--surface-hover);
  border-color: var(--border-accent);
  transform: translateY(-4px) scale(1.05);
}
.menu-item.selected {
  background: var(--accent-dim);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0, 255, 163, 0.12);
  transform: translateY(-4px) scale(1.05);
}

.menu-item img {
  width: 24px !important; height: 24px !important;
  border-radius: 6px;
  grid-row: unset;
  transition: transform 0.2s var(--spring);
}
.menu-item:hover img { transform: scale(1.1); }

.menu-name {
  font: 500 7.5px/1.1 var(--font-ui) !important;
  text-align: center;
  opacity: 0.6;
  color: var(--text);
  transition: opacity 0.2s;
}
.menu-item:hover .menu-name,
.menu-item.selected .menu-name { opacity: 1; }

.menu-meta {
  font: 500 6px/1 var(--font-mono) !important;
  opacity: 0.35;
  text-transform: none;
  color: var(--accent);
}

/* Type color accents — clean approach */
.menu-item.type-shahed, .menu-item.type-shaheds { box-shadow: none; }
.menu-item.type-rocket, .menu-item.type-kab { box-shadow: none; }
.menu-item.type-orlan, .menu-item.type-zala, .menu-item.type-supercam { box-shadow: none; }
.menu-item.type-невідомий, .menu-item.type-gerbera { box-shadow: none; }

.menu-item.type-shahed .menu-name, .menu-item.type-shaheds .menu-name { color: #ffb347; }
.menu-item.type-rocket .menu-name, .menu-item.type-kab .menu-name { color: #ff8a96; }
.menu-item.type-orlan .menu-name, .menu-item.type-zala .menu-name, .menu-item.type-supercam .menu-name { color: #9be0ff; }
.menu-item.type-невідомий .menu-name, .menu-item.type-gerbera .menu-name { color: #c7ffd9; }

.menu-item.selected.type-shahed, .menu-item.selected.type-shaheds { border-color: #ffb347; box-shadow: 0 0 12px rgba(255,179,71,0.15); }
.menu-item.selected.type-rocket, .menu-item.selected.type-kab { border-color: #ff8a96; box-shadow: 0 0 12px rgba(255,138,150,0.15); }
.menu-item.selected.type-orlan, .menu-item.selected.type-zala, .menu-item.selected.type-supercam { border-color: #9be0ff; box-shadow: 0 0 12px rgba(155,224,255,0.15); }

/* ===== BASEMAP SWITCHER ===== */
.basemap-switcher {
  position: absolute;
  left: 12px; top: 76px;
  z-index: 1100;
}
.bm-fab {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  backdrop-filter: blur(var(--blur));
  color: var(--text);
  box-shadow: var(--shadow);
  transition: all 0.2s;
}
.bm-fab:hover {
  border-color: var(--border-accent);
  background: var(--surface-hover);
}
.bm-panel {
  position: absolute;
  left: 0; top: 50px;
  transform: translateY(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  background: var(--surface);
  backdrop-filter: blur(var(--blur));
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  min-width: 220px;
  max-width: 280px;
}
.basemap-switcher.open .bm-panel,
.basemap-switcher:hover .bm-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.bm-title {
  font: 500 10px/1 var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.4;
  margin: 0 0 6px 4px;
}
.bm-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.bm-item {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.15s;
  font: 400 12px/1.1 var(--font-ui);
  color: var(--text);
  min-width: auto; flex: unset;
}
.bm-item:hover {
  background: var(--surface-hover);
  border-color: var(--border-accent);
  transform: translateY(-1px);
}
.bm-item.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.bm-name { font-weight: 600; font-size: 12px; }
.bm-sub { font-size: 10px; opacity: 0.4; }

/* ===== STREAM TOGGLE (above menu dock) ===== */
.stream-toggle {
  position: fixed;
  left: 12px; bottom: 76px;
  z-index: 1200;
  height: 38px;
  padding: 0 14px 0 12px;
  display: flex !important;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(var(--blur));
  color: var(--text);
  font: 600 11px/1 var(--font-ui);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  /* override old grid */
  width: auto !important;
  min-height: auto;
  grid-template-columns: unset;
}
.stream-toggle:hover {
  border-color: var(--border-accent);
}
.stream-toggle:active { transform: scale(0.97); }

.stream-toggle-title {
  font-size: 11px;
  line-height: 1;
}

.stream-toggle-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 59, 92, 0.25);
  background: rgba(255, 59, 92, 0.08);
  font: 700 9px/1 var(--font-ui);
  letter-spacing: 0.08em;
  color: var(--danger);
  height: auto; min-width: auto;
}
.stream-toggle.active .stream-toggle-meta {
  border-color: rgba(0, 255, 163, 0.25);
  background: rgba(0, 255, 163, 0.08);
  color: var(--accent);
}
.stream-toggle.active .stream-toggle-meta::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

/* ===== COORDINATE BOX ===== */
.coord-box {
  display: none !important;
}

/* ===== DRONE ELEMENTS ===== */
.rszo-tag {
  background: var(--surface);
  color: var(--text);
  border: 1px solid rgba(255, 59, 92, 0.35);
  border-radius: 8px;
  padding: 2px 8px;
  font: 600 10px/1 var(--font-ui);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: var(--shadow);
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
.drone-info {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px 8px;
  font: 500 11px/1 var(--font-mono);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.drone-label {
  font-size: 10px; padding: 1px 4px; border-radius: 4px;
  background: rgba(255,255,255,0.55);
  color: #ff3; text-shadow: 0 0 3px #000;
  pointer-events: none; opacity: 0; transition: .15s;
}
.drone-label.light {
  background: rgba(0,0,0,0.55); color: #fff; text-shadow: 0 0 2px #f33;
}
.leaflet-marker-icon { filter: var(--glow); }
.leaflet-overlay-pane canvas { filter: var(--map-overlay-br); }

/* ===== SNAP MODE ===== */
body.snap .leaflet-control-layers { display: none !important; }
body.snap #topHint,
body.snap #cropBtn,
body.snap #coordsBtn,
body.snap #saveBtn,
body.snap #clearBtn,
body.snap #adminBtn,
body.snap #quickShotBtn,
body.snap .basemap-switcher,
body.snap .menu-wrap,
body.snap #miniWrap,
body.snap .coord-box,
body.snap .toolbar,
body.snap .stream-toggle,
body.snap #changelogBtn,
body.snap #styleBtn,
body.snap #stylePopup,
body.snap #helpBtn { visibility: hidden !important; }
body.snap .hud-buttons { display: none !important; }

/* ===== RECORDING MASK ===== */
#recordMask {
  display: none; position: fixed; inset: 0; z-index: 15000;
  background: rgba(0,0,0,0.65); color: #fff;
  font: 16px/1.4 var(--font-ui);
  align-items: center; justify-content: center;
  text-align: center; padding: 20px; pointer-events: all;
}
body.recording::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 4px #ff0033; z-index: 14000;
}

/* ===== PREVIEW MODAL ===== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  backdrop-filter: blur(16px);
}
.modal {
  background: var(--surface-solid);
  color: var(--text);
  max-width: 640px;
  width: min(96vw, 640px);
  max-height: 92vh;
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 0 0 1px var(--border), var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.preview-area {
  display: flex; align-items: center; justify-content: center;
  background: #000; border-radius: 14px;
  max-height: 60vh; overflow: hidden;
  border: 1px solid var(--border);
}
.preview-area img, .preview-area video { max-width: 100%; max-height: 58vh; }

.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 6px; }
.row input[type="text"] {
  flex: 1; padding: 10px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.3);
  color: var(--text);
  font: 13px var(--font-ui);
  transition: border-color 0.2s;
}
.row input[type="text"]:focus { outline: none; border-color: var(--accent); }
.row input[type="text"]::placeholder { color: var(--text-dim); }

.row .btn {
  min-width: 120px; padding: 10px 16px;
  border: none; border-radius: var(--radius-pill);
  font: 600 13px var(--font-ui);
  cursor: pointer; letter-spacing: 0.03em;
  text-transform: uppercase; transition: all 0.2s;
  box-shadow: none;
}
.btn-gray {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-gray:hover { background: rgba(255,255,255,0.1); }
.btn-blue {
  background: var(--accent);
  color: #0a0e14;
  border: none;
}
.btn-blue:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 255, 163, 0.3);
}
.btn-blue:active, .btn-gray:active { transform: translateY(1px); }

.hint {
  opacity: 0.5;
  font: 500 11px/1.3 var(--font-ui);
  letter-spacing: 0.02em;
  text-transform: none;
}

/* ===== AUTH DIALOG ===== */
.auth-backdrop {
  position: fixed; inset: 0;
  background: rgba(5, 7, 16, 0.88);
  display: flex; align-items: center; justify-content: center;
  z-index: 100000;
  backdrop-filter: blur(24px);
}
.auth-dialog {
  background: var(--surface-solid);
  color: var(--text);
  max-width: 92vw; width: 380px;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 0 0 1px var(--border), var(--shadow-lg);
  display: flex; flex-direction: column; gap: 16px;
}
.auth-dialog h3 {
  margin: 0;
  font: 700 22px/1.2 var(--font-ui);
  letter-spacing: -0.01em;
  text-transform: none;
}
.auth-dialog small {
  opacity: 0.45;
  font: 500 12px/1 var(--font-ui);
  letter-spacing: 0.01em;
  text-transform: none;
}
.auth-dialog input {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.3);
  color: var(--text);
  font: 16px var(--font-mono);
  transition: border-color 0.2s;
}
.auth-dialog input:focus { outline: none; border-color: var(--accent); }
.auth-dialog input::placeholder { color: var(--text-dim); }

.auth-actions { display: flex; gap: 10px; justify-content: flex-end; }
.auth-btn {
  min-width: 110px; padding: 10px 18px;
  border: none; border-radius: var(--radius-sm);
  font: 600 13px var(--font-ui);
  cursor: pointer; letter-spacing: 0.02em;
  text-transform: uppercase; transition: all 0.2s;
  box-shadow: none;
}
.auth-btn.ok {
  background: var(--accent); color: #0a0e14;
}
.auth-btn.ok:hover {
  box-shadow: 0 4px 16px rgba(0, 255, 163, 0.3);
  transform: translateY(-1px);
}
.auth-btn.cancel {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--border);
}
.auth-btn.cancel:hover { background: rgba(255,255,255,0.1); }
.auth-err { color: var(--danger); font: 500 12px/1.2 var(--font-ui); display: none; }

@keyframes shake {
  10%,90%{transform:translateX(-1px)}
  20%,80%{transform:translateX(2px)}
  30%,50%,70%{transform:translateX(-4px)}
  40%,60%{transform:translateX(4px)}
}
.shake { animation: shake .35s; }

/* ===== STYLE SWITCHER BUTTON (themed) ===== */
#styleBtn {
  position: fixed; top: 8px; right: 48px; z-index: 1100;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(var(--blur));
  color: var(--text); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}
#styleBtn:hover { border-color: var(--border-accent); }

#stylePopup {
  display: none;
  position: fixed; top: 46px; right: 10px; z-index: 11000;
  width: 280px; max-height: calc(100vh - 60px); overflow-y: auto;
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
#stylePopup.visible { display: block; }

/* ===== CHANGELOG ===== */
#changelogBtn {
  position: fixed; bottom: 130px; left: 12px; z-index: 10001;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(var(--blur));
  color: var(--text); font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}
#changelogBtn:hover {
  border-color: var(--border-accent); transform: scale(1.05);
}

#changelogOverlay {
  display: none; position: fixed; inset: 0; z-index: 100002;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(8px);
  align-items: center; justify-content: center; padding: 16px;
}
#changelogOverlay.open { display: flex; }

#changelogModal {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text); width: 100%; max-width: 640px; max-height: 85vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
#changelogModal .cl-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
#changelogModal .cl-header h2 {
  margin: 0; font: 700 18px/1.3 var(--font-ui);
  color: var(--accent);
  display: flex; align-items: center; gap: 8px;
}
#changelogModal .cl-close {
  background: none; border: none; color: var(--text-dim);
  font-size: 22px; cursor: pointer;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; transition: all 0.2s;
}
#changelogModal .cl-close:hover { background: rgba(255,255,255,0.08); color: #fff; }
#changelogModal .cl-body {
  overflow-y: auto; padding: 8px 24px 24px; flex: 1;
  -webkit-overflow-scrolling: touch;
}
#changelogModal .cl-body::-webkit-scrollbar { width: 4px; }
#changelogModal .cl-body::-webkit-scrollbar-thumb { background: rgba(0,255,163,0.15); border-radius: 2px; }

.cl-group { margin-bottom: 20px; }
.cl-group-title {
  font: 600 12px/1 var(--font-ui); color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin: 0 0 10px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 6px;
}
.cl-item {
  padding: 8px 12px; margin-bottom: 4px;
  background: rgba(255,255,255,0.015); border-radius: var(--radius-sm);
  border-left: 2px solid var(--border-accent); transition: background 0.2s;
}
.cl-item:hover { background: rgba(0,255,163,0.03); }
.cl-item-title { font: 600 13px/1.4 var(--font-ui); color: var(--text); margin-bottom: 2px; }
.cl-item-desc { font: 400 12px/1.5 var(--font-ui); color: var(--text-dim); }
.cl-version {
  text-align: center; padding: 12px 0 6px;
  font: 500 11px/1 var(--font-ui); color: rgba(255,255,255,0.15); letter-spacing: 0.06em;
}

@media(max-width:480px){
  #changelogModal { max-height: 90vh; border-radius: 14px; }
  #changelogModal .cl-header { padding: 16px 16px 12px; }
  #changelogModal .cl-header h2 { font-size: 15px; }
  #changelogModal .cl-body { padding: 6px 16px 20px; }
  .cl-item { padding: 6px 10px; }
  .cl-item-title { font-size: 12px; }
  .cl-item-desc { font-size: 11px; }
}

/* ===== ANIMATIONS ===== */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; transform: scale(1.3); }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateY(-50%) translateX(20px); }
  to { opacity: 1; transform: translateY(-50%) translateX(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== MOBILE ===== */
@media (max-width: 640px) {
  .toolbar { right: 8px; padding: 6px; gap: 2px; }
  .tb-btn { width: 40px; height: 42px; font-size: 14px; }
  .tb-btn[title]::after { display: none; }
  .tb-label { font-size: 6px; }

  .basemap-switcher { left: 8px; top: 76px; }
  .bm-fab { width: 36px; height: 36px; font-size: 18px; }

  .menu-item { width: 40px; min-width: 40px !important; padding: 3px 3px 2px; }
  .menu-item img { width: 22px !important; height: 22px !important; }
  .menu-name { font-size: 6.5px !important; }
  .menu-meta { display: none; }

  .stream-toggle { bottom: 68px; left: 8px; }
  #changelogBtn { bottom: 120px; left: 8px; width: 34px; height: 34px; }
}

@media (hover: none) and (pointer: coarse) {
  .tb-btn[title]::after { display: none; }
  .stream-toggle-title { display: block !important; font-size: 10px; }
  .stream-toggle { width: auto; min-width: 160px; height: 44px; padding: 0 10px; grid-template-columns: 1fr auto; align-items: center; }
  .stream-toggle-meta { min-width: 44px; height: 20px; padding: 0 6px; font-size: 8px; }
}

/* ===== LEAFLET CONTROL OVERRIDES ===== */
.leaflet-control-scale-line {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  backdrop-filter: blur(8px);
  border-radius: 4px;
}
.leaflet-control-zoom a {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
  font-family: var(--font-ui) !important;
  backdrop-filter: blur(var(--blur));
  transition: all 0.15s;
}
.leaflet-control-zoom a:hover {
  background: var(--surface-hover) !important;
  color: var(--accent) !important;
}

/* Zoom controls — top-left, above basemap switcher */
.leaflet-top.leaflet-left {
  top: 10px !important;
}

/* Stream config panel restyle */
#streamConfigPanel {
  border-radius: var(--radius) !important;
  border-color: var(--border) !important;
  background: var(--surface) !important;
  backdrop-filter: blur(var(--blur));
  font-family: var(--font-ui) !important;
}


/* ================================================================
   THEME PRESETS — Override CSS variables per body class
   ================================================================ */

/* ──────────────────────────────────────────────────────────
   THEME: ARCTIC COMMAND — Light tactical
   ────────────────────────────────────────────────────────── */
body.theme-arctic {
  --accent: #2563eb;
  --accent-dim: rgba(37, 99, 235, 0.10);
  --accent-glow: rgba(37, 99, 235, 0.25);
  --danger: #ef4444;
  --danger-dim: rgba(239, 68, 68, 0.10);
  --warning: #f59e0b;
  --info: #0ea5e9;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #f8fafc;
  --surface-hover: rgba(37, 99, 235, 0.06);
  --border: rgba(0, 0, 0, 0.08);
  --border-accent: rgba(37, 99, 235, 0.20);
  --text: #1e293b;
  --text-dim: rgba(71, 85, 105, 0.6);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
  --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius: 16px;
  --radius-sm: 12px;
  --blur: 20px;

  --panel-bg: var(--surface);
  --panel-text: var(--text);
  --btn-primary: var(--accent);
  --btn-success: #16a34a;
  --btn-muted: #e2e8f0;
  --btn-danger: var(--danger);
  --route-main: #2563eb;
  --route-shadow: rgba(0,0,0,0.1);
  --glow: drop-shadow(0 0 1px rgba(37,99,235,0.4)) brightness(1.02);
  --map-overlay-br: brightness(1.02) contrast(1.02);
  --card-bg: rgba(255, 255, 255, 0.92);
  --card-border: var(--border-accent);
  --card-hover: var(--surface-hover);
  --card-active: var(--accent-dim);
}
body.theme-arctic .menu-item.type-shahed .menu-name,
body.theme-arctic .menu-item.type-shaheds .menu-name { color: #d97706; }
body.theme-arctic .menu-item.type-rocket .menu-name,
body.theme-arctic .menu-item.type-kab .menu-name { color: #dc2626; }
body.theme-arctic .menu-item.type-orlan .menu-name,
body.theme-arctic .menu-item.type-zala .menu-name,
body.theme-arctic .menu-item.type-supercam .menu-name { color: #0284c7; }
body.theme-arctic .menu-item.selected.type-shahed,
body.theme-arctic .menu-item.selected.type-shaheds { border-color: #d97706; }
body.theme-arctic .menu-item.selected.type-rocket,
body.theme-arctic .menu-item.selected.type-kab { border-color: #dc2626; }
body.theme-arctic .leaflet-marker-icon { filter: drop-shadow(0 1px 3px rgba(0,0,0,0.2)) brightness(1.02); }
body.theme-arctic .auth-backdrop { background: rgba(248, 250, 252, 0.92); }
body.theme-arctic .auth-dialog { background: #ffffff; box-shadow: 0 0 0 1px rgba(0,0,0,0.06), 0 20px 60px rgba(0,0,0,0.12); }
body.theme-arctic .stream-toggle-meta {
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.06);
  color: var(--danger);
}
body.theme-arctic .stream-toggle.active .stream-toggle-meta {
  border-color: rgba(22, 163, 106, 0.2);
  background: rgba(22, 163, 106, 0.06);
  color: #16a34a;
}


/* ──────────────────────────────────────────────────────────
   THEME: WARZONE SAND — Military tactical
   ────────────────────────────────────────────────────────── */
body.theme-warzone {
  --accent: #f59e0b;
  --accent-dim: rgba(245, 158, 11, 0.12);
  --accent-glow: rgba(245, 158, 11, 0.3);
  --danger: #ef4444;
  --danger-dim: rgba(239, 68, 68, 0.12);
  --warning: #fbbf24;
  --info: #a3e635;
  --surface: rgba(26, 31, 22, 0.90);
  --surface-solid: #1a1f16;
  --surface-hover: rgba(245, 158, 11, 0.08);
  --border: rgba(245, 158, 11, 0.12);
  --border-accent: rgba(245, 158, 11, 0.30);
  --text: #e8e4d9;
  --text-dim: rgba(200, 190, 170, 0.55);
  --shadow: 0 6px 28px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 14px 44px rgba(0, 0, 0, 0.55);
  --font-ui: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 4px;
  --radius-sm: 2px;
  --radius-pill: 2px;
  --blur: 8px;

  --panel-bg: var(--surface);
  --panel-text: var(--text);
  --btn-primary: var(--accent);
  --btn-success: #a3e635;
  --btn-muted: #2a3024;
  --btn-danger: var(--danger);
  --route-main: #f59e0b;
  --route-shadow: #0a0c08;
  --glow: drop-shadow(0 0 0.8px #f59e0b) drop-shadow(0 0 3px #f59e0b) brightness(1.04) contrast(1.06);
  --map-overlay-br: brightness(1.04) contrast(1.06) sepia(0.08);
  --card-bg: rgba(26, 31, 22, 0.95);
  --card-border: var(--border-accent);
  --card-hover: var(--surface-hover);
  --card-active: var(--accent-dim);
}
body.theme-warzone .toolbar {
  border: 2px solid var(--border-accent);
  border-radius: var(--radius);
}
body.theme-warzone .tb-btn { border-radius: var(--radius-sm); font-size: 16px; }
body.theme-warzone .menu {
  border: 2px solid var(--border-accent);
  border-radius: var(--radius);
}
body.theme-warzone .menu-item { border-radius: var(--radius-sm); }
body.theme-warzone .menu-name { text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
body.theme-warzone .menu-item.type-shahed .menu-name,
body.theme-warzone .menu-item.type-shaheds .menu-name { color: #fbbf24; }
body.theme-warzone .menu-item.type-rocket .menu-name,
body.theme-warzone .menu-item.type-kab .menu-name { color: #f87171; }
body.theme-warzone .menu-item.type-orlan .menu-name,
body.theme-warzone .menu-item.type-zala .menu-name,
body.theme-warzone .menu-item.type-supercam .menu-name { color: #a3e635; }
body.theme-warzone .stream-toggle { border-radius: var(--radius); border-width: 2px; }
body.theme-warzone .basemap-switcher .bm-fab { border-radius: var(--radius-sm); border-width: 2px; }
body.theme-warzone #changelogBtn { border-radius: var(--radius-sm); border-width: 2px; }
body.theme-warzone .leaflet-control-zoom a { border-radius: 2px !important; }


/* ──────────────────────────────────────────────────────────
   THEME: NEON OPS — Cyberpunk
   ────────────────────────────────────────────────────────── */
body.theme-neon {
  --accent: #ff2d7b;
  --accent-dim: rgba(255, 45, 123, 0.12);
  --accent-glow: rgba(255, 45, 123, 0.35);
  --danger: #ff0040;
  --danger-dim: rgba(255, 0, 64, 0.12);
  --warning: #ffea00;
  --info: #00e5ff;
  --surface: rgba(15, 10, 26, 0.88);
  --surface-solid: #0f0a1a;
  --surface-hover: rgba(255, 45, 123, 0.08);
  --border: rgba(255, 45, 123, 0.10);
  --border-accent: rgba(255, 45, 123, 0.30);
  --text: #f0e8ff;
  --text-dim: rgba(200, 180, 230, 0.5);
  --shadow: 0 8px 32px rgba(100, 0, 60, 0.3);
  --shadow-lg: 0 16px 48px rgba(100, 0, 60, 0.4);
  --font-ui: 'Rajdhani', 'Orbitron', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --blur: 18px;

  --panel-bg: var(--surface);
  --panel-text: var(--text);
  --btn-primary: var(--accent);
  --btn-success: #00e5ff;
  --btn-muted: #1a1028;
  --btn-danger: var(--danger);
  --route-main: #ff2d7b;
  --route-shadow: #0a0510;
  --glow: drop-shadow(0 0 1px #ff2d7b) drop-shadow(0 0 4px #ff2d7b) brightness(1.06) contrast(1.08);
  --map-overlay-br: brightness(1.04) contrast(1.06) saturate(1.1);
  --card-bg: rgba(15, 10, 26, 0.95);
  --card-border: var(--border-accent);
  --card-hover: var(--surface-hover);
  --card-active: var(--accent-dim);
}
body.theme-neon .toolbar {
  border-color: rgba(255, 45, 123, 0.15);
  box-shadow: 0 0 24px rgba(255, 45, 123, 0.08), var(--shadow);
}
body.theme-neon .tb-btn:hover {
  box-shadow: 0 0 12px rgba(255, 45, 123, 0.25);
}
body.theme-neon .menu {
  border-color: rgba(0, 229, 255, 0.12);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.06), var(--shadow);
}
body.theme-neon .menu-item:hover {
  border-color: rgba(0, 229, 255, 0.3);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.15);
}
body.theme-neon .menu-item.selected {
  border-color: #00e5ff;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.25);
  background: rgba(0, 229, 255, 0.08);
}
body.theme-neon .menu-item.type-shahed .menu-name,
body.theme-neon .menu-item.type-shaheds .menu-name { color: #ffea00; text-shadow: 0 0 4px rgba(255,234,0,0.3); }
body.theme-neon .menu-item.type-rocket .menu-name,
body.theme-neon .menu-item.type-kab .menu-name { color: #ff2d7b; text-shadow: 0 0 4px rgba(255,45,123,0.3); }
body.theme-neon .menu-item.type-orlan .menu-name,
body.theme-neon .menu-item.type-zala .menu-name,
body.theme-neon .menu-item.type-supercam .menu-name { color: #00e5ff; text-shadow: 0 0 4px rgba(0,229,255,0.3); }
body.theme-neon .stream-toggle { border-color: rgba(255, 45, 123, 0.2); }
body.theme-neon .stream-toggle.active .stream-toggle-meta {
  border-color: rgba(0, 229, 255, 0.3);
  background: rgba(0, 229, 255, 0.08);
  color: #00e5ff;
}
body.theme-neon .stream-toggle.active .stream-toggle-meta::before {
  background: #00e5ff;
  box-shadow: 0 0 10px #00e5ff;
}
body.theme-neon .auth-dialog { box-shadow: 0 0 0 1px rgba(255,45,123,0.15), 0 0 60px rgba(255,45,123,0.1), var(--shadow-lg); }
body.theme-neon .btn-blue { background: linear-gradient(135deg, #ff2d7b, #00e5ff); color: #0f0a1a; }
body.theme-neon .btn-blue:hover { box-shadow: 0 6px 24px rgba(255, 45, 123, 0.35); }


/* ──────────────────────────────────────────────────────────
   THEME: SLATE OPS — Warm neutral dark
   ────────────────────────────────────────────────────────── */
body.theme-slate {
  --accent: #e8724a;
  --accent-dim: rgba(232, 114, 74, 0.12);
  --accent-glow: rgba(232, 114, 74, 0.25);
  --danger: #ef4444;
  --danger-dim: rgba(239, 68, 68, 0.12);
  --warning: #fbbf24;
  --info: #60a5fa;
  --surface: rgba(30, 30, 34, 0.92);
  --surface-solid: #1e1e22;
  --surface-hover: rgba(232, 114, 74, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(232, 114, 74, 0.22);
  --text: #e8e6e3;
  --text-dim: rgba(200, 195, 190, 0.5);
  --shadow: 0 6px 28px rgba(0, 0, 0, 0.30);
  --shadow-lg: 0 14px 44px rgba(0, 0, 0, 0.40);
  --font-ui: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 16px;
  --radius-sm: 12px;
  --blur: 14px;

  --panel-bg: var(--surface);
  --panel-text: var(--text);
  --btn-primary: var(--accent);
  --btn-success: #34d399;
  --btn-muted: #2a2a2e;
  --btn-danger: var(--danger);
  --route-main: #e8724a;
  --route-shadow: #12100e;
  --glow: drop-shadow(0 0 0.6px #e8724a) drop-shadow(0 0 3px #e8724a) brightness(1.04) contrast(1.04);
  --map-overlay-br: brightness(1.04) contrast(1.04) saturate(0.95);
  --card-bg: rgba(30, 30, 34, 0.95);
  --card-border: var(--border-accent);
  --card-hover: var(--surface-hover);
  --card-active: var(--accent-dim);
}
body.theme-slate .toolbar {
  border-radius: var(--radius);
  border-color: rgba(255,255,255,0.06);
  background: rgba(30, 30, 34, 0.95);
}
body.theme-slate .menu {
  background: rgba(30, 30, 34, 0.95);
  border-color: rgba(255,255,255,0.06);
  border-radius: var(--radius);
}
body.theme-slate .menu-item.type-shahed .menu-name,
body.theme-slate .menu-item.type-shaheds .menu-name { color: #fbbf24; }
body.theme-slate .menu-item.type-rocket .menu-name,
body.theme-slate .menu-item.type-kab .menu-name { color: #fb7185; }
body.theme-slate .menu-item.type-orlan .menu-name,
body.theme-slate .menu-item.type-zala .menu-name,
body.theme-slate .menu-item.type-supercam .menu-name { color: #60a5fa; }
body.theme-slate .stream-toggle.active .stream-toggle-meta {
  border-color: rgba(52, 211, 153, 0.25);
  background: rgba(52, 211, 153, 0.06);
  color: #34d399;
}
body.theme-slate .stream-toggle.active .stream-toggle-meta::before {
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
}
body.theme-slate .btn-blue { background: var(--accent); color: #1e1e22; }
body.theme-slate .btn-blue:hover { box-shadow: 0 6px 20px rgba(232, 114, 74, 0.3); }


/* ================================================================
   LAYOUT PRESETS — 6 radically different HUD styles
   Each preset changes SHAPE, SIZE, ANIMATION, HOVER and POSITION
   ================================================================ */

/* ================================================================
   EXTRA ANIMATIONS used by layouts
   ================================================================ */
@keyframes scanline {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}
@keyframes hex-pulse {
  0%, 100% { filter: drop-shadow(0 0 2px var(--accent-glow)); }
  50%      { filter: drop-shadow(0 0 8px var(--accent-glow)); }
}
@keyframes float-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes cinema-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes orbit-in {
  from { opacity: 0; transform: translate(-50%, -50%) rotate(var(--a)) translate(0, 0) rotate(calc(-1 * var(--a))); }
  to   { opacity: 1; transform: translate(-50%, -50%) rotate(var(--a)) translate(0, calc(-1 * var(--ring))) rotate(calc(-1 * var(--a))); }
}
@keyframes sidebar-slide {
  from { transform: translateX(-100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}


/* ████████████████████████████████████████████████████████████████
   1. LAYOUT: COMMAND — Military grid command center
   Grid of square target tiles, scan-line FX, sharp edges, uppercase
   ████████████████████████████████████████████████████████████████ */

/* statusBar removed from command preset */

/* Menu: 4-column grid of square tiles */
body.layout-command .menu-wrap {
  position: fixed !important;
  bottom: 14px !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  transform: translateX(-50%) !important;
  z-index: 1100 !important;
}
body.layout-command .menu-panel {
  position: static !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
body.layout-command .menu {
  display: grid !important;
  grid-template-columns: repeat(6, 1fr) !important;
  grid-auto-rows: auto !important;
  flex-direction: unset !important;
  gap: 4px !important;
  padding: 8px !important;
  border-radius: 0 !important;
  border: 2px solid rgba(0, 255, 80, 0.2) !important;
  background: rgba(5, 12, 5, 0.92) !important;
  max-width: none !important;
  width: auto !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  max-height: none !important;
  backdrop-filter: blur(8px) !important;
}
body.layout-command .menu-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 46px !important;
  min-width: 46px !important;
  height: 46px !important;
  border-radius: 0 !important;
  border: 1px solid rgba(0, 255, 80, 0.12) !important;
  background: rgba(0, 20, 0, 0.4) !important;
  padding: 2px !important;
  gap: 1px !important;
  position: relative !important;
  transition: all 0.15s ease !important;
  cursor: pointer !important;
}
/* Crosshair corners on hover */
body.layout-command .menu-item::before,
body.layout-command .menu-item::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  width: 10px !important; height: 10px !important;
  border-color: transparent !important;
  border-style: solid !important;
  border-width: 0 !important;
  transition: border-color 0.2s !important;
  pointer-events: none !important;
}
body.layout-command .menu-item::before {
  top: -1px !important; left: -1px !important;
  border-top-width: 2px !important;
  border-left-width: 2px !important;
}
body.layout-command .menu-item::after {
  bottom: -1px !important; right: -1px !important;
  border-bottom-width: 2px !important;
  border-right-width: 2px !important;
}
body.layout-command .menu-item:hover::before,
body.layout-command .menu-item:hover::after {
  border-color: #00ff50 !important;
}
body.layout-command .menu-item:hover {
  background: rgba(0, 255, 80, 0.08) !important;
  border-color: rgba(0, 255, 80, 0.35) !important;
  transform: none !important;
}
body.layout-command .menu-item.selected {
  background: rgba(0, 255, 80, 0.12) !important;
  border-color: #00ff50 !important;
  box-shadow: inset 0 0 12px rgba(0, 255, 80, 0.1) !important;
  transform: none !important;
}
body.layout-command .menu-item img {
  width: 24px !important; height: 24px !important;
  border-radius: 0 !important;
}
body.layout-command .menu-name {
  font-size: 6px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}
body.layout-command .menu-meta {
  display: none !important;
}

/* Toolbar: horizontal, squared */
body.layout-command .toolbar {
  position: fixed !important;
  top: 60px !important;
  right: 14px !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
  flex-direction: row !important;
  padding: 4px 6px !important;
  border-radius: 0 !important;
  border: 2px solid rgba(0, 255, 80, 0.2) !important;
  background: rgba(5, 12, 5, 0.92) !important;
  gap: 2px !important;
  animation: none !important;
}
body.layout-command .tb-btn {
  width: 38px !important; height: 38px !important;
  border-radius: 0 !important;
  font-size: 16px !important;
}
body.layout-command .tb-btn:hover {
  background: rgba(0, 255, 80, 0.12) !important;
  border-color: rgba(0, 255, 80, 0.4) !important;
  transform: none !important;
}
body.layout-command .tb-sep {
  width: 1px !important; height: 28px !important;
  background: rgba(0, 255, 80, 0.15) !important;
}
body.layout-command .tb-btn[title]::after {
  display: none !important;
}

/* HUD panel below status bar */
body.layout-command #hudInfoPanel {
  top: 54px !important;
}

/* Stream toggle: squared military badge */
body.layout-command .stream-toggle {
  position: fixed !important;
  top: 60px !important;
  left: 14px !important;
  right: auto !important;
  bottom: auto !important;
  border-radius: 0 !important;
  border: 2px solid rgba(0, 255, 80, 0.2) !important;
  background: rgba(5, 12, 5, 0.92) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  font-weight: 700 !important;
}
body.layout-command .stream-toggle-meta {
  border-radius: 2px !important;
}

body.layout-command .basemap-switcher {
  position: fixed !important;
  left: 14px !important;
  top: 110px !important;
}
body.layout-command .bm-fab {
  border-radius: 0 !important;
  border: 2px solid rgba(0, 255, 80, 0.2) !important;
  background: rgba(5, 12, 5, 0.92) !important;
}
body.layout-command .bm-panel {
  border-radius: 0 !important;
}
body.layout-command .bm-item {
  border-radius: 0 !important;
}
body.layout-command .leaflet-top.leaflet-left {
  top: 56px !important;
  left: 190px !important;
}
body.layout-command #changelogBtn {
  position: fixed !important;
  right: 14px !important; bottom: 14px !important;
  left: auto !important;
  border-radius: 0 !important;
  border: 2px solid rgba(0, 255, 80, 0.2) !important;
  background: rgba(5, 12, 5, 0.92) !important;
}

/* ████████████████████████████████████████████████████████████████
   2. LAYOUT: HEX — Hexagonal honeycomb
   Hex-shaped items, hex toolbar, organic sci-fi glow
   ████████████████████████████████████████████████████████████████ */

body.layout-hex .menu-wrap {
  position: fixed !important;
  bottom: 14px !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  transform: translateX(-50%) !important;
}
body.layout-hex .menu-panel {
  position: static !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
body.layout-hex .menu {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  flex-direction: row !important;
  gap: 4px !important;
  padding: 10px 8px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  max-width: 460px !important;
  width: auto !important;
  overflow: visible !important;
  max-height: none !important;
}
body.layout-hex .menu-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 50px !important;
  min-width: 50px !important;
  height: 48px !important;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%) !important;
  background: var(--surface) !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 8px 2px 4px !important;
  gap: 1px !important;
  cursor: pointer !important;
  transition: all 0.25s ease !important;
  position: relative !important;
  margin-top: 0 !important;
  animation: hex-pulse 3s ease-in-out infinite !important;
  animation-delay: calc(var(--idx, 0) * 0.2s) !important;
}
/* Hex offset removed — clean grid */
body.layout-hex .menu-item:nth-child(odd) {
  margin-top: 0 !important;
}
body.layout-hex .menu-item:nth-child(even) {
  margin-top: 0 !important;
}
body.layout-hex .menu-item:hover {
  background: var(--accent-dim) !important;
  transform: scale(1.12) !important;
  filter: drop-shadow(0 0 12px var(--accent-glow)) !important;
  animation: none !important;
}
body.layout-hex .menu-item.selected {
  background: var(--accent-dim) !important;
  filter: drop-shadow(0 0 16px var(--accent-glow)) !important;
  transform: scale(1.08) !important;
  animation: none !important;
}
body.layout-hex .menu-item img {
  width: 22px !important; height: 22px !important;
  border-radius: 0 !important;
  filter: drop-shadow(0 0 3px rgba(255,255,255,0.3)) !important;
}
body.layout-hex .menu-name {
  font-size: 7px !important;
  text-align: center !important;
  font-weight: 600 !important;
  line-height: 1 !important;
}
body.layout-hex .menu-meta {
  display: none !important;
}

/* Toolbar: hex buttons */
body.layout-hex .toolbar {
  position: fixed !important;
  right: 14px !important;
  top: 50% !important;
  bottom: auto !important;
  left: auto !important;
  transform: translateY(-50%) !important;
  flex-direction: column !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 0 !important;
  gap: 4px !important;
  animation: none !important;
}
body.layout-hex .tb-btn {
  width: 46px !important; height: 52px !important;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%) !important;
  background: var(--surface) !important;
  border: none !important;
  border-radius: 0 !important;
  font-size: 17px !important;
  backdrop-filter: blur(var(--blur)) !important;
  transition: all 0.2s ease !important;
}
body.layout-hex .tb-btn:hover {
  background: var(--accent-dim) !important;
  transform: scale(1.15) !important;
  filter: drop-shadow(0 0 8px var(--accent-glow)) !important;
}
body.layout-hex .tb-sep {
  display: none !important;
}
body.layout-hex .tb-btn[title]::after {
  display: none !important;
}

/* Stream toggle: hex */
body.layout-hex .stream-toggle {
  position: fixed !important;
  left: 14px !important; bottom: 90px !important;
  right: auto !important; top: auto !important;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%) !important;
  border: none !important;
  border-radius: 0 !important;
  width: 64px !important; height: 72px !important;
  padding: 14px 6px !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 4px !important;
  text-align: center !important;
}
body.layout-hex .stream-toggle-title {
  font-size: 8px !important;
  letter-spacing: 0.08em !important;
}
body.layout-hex .stream-toggle-meta {
  padding: 2px 6px !important;
  font-size: 7px !important;
  border: none !important;
  border-radius: 4px !important;
}

body.layout-hex .basemap-switcher {
  position: fixed !important;
  left: 14px !important;
  top: 76px !important;
}
body.layout-hex .bm-fab {
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%) !important;
  border: none !important;
  border-radius: 0 !important;
  width: 46px !important; height: 52px !important;
}
body.layout-hex .leaflet-top.leaflet-left {
  top: 10px !important;
}
body.layout-hex #changelogBtn {
  position: fixed !important;
  left: 14px !important; bottom: 180px !important;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%) !important;
  border: none !important;
  border-radius: 0 !important;
  width: 40px !important; height: 46px !important;
}

/* ████████████████████████████████████████████████████████████████
   3. LAYOUT: ORBITAL — Semicircle arc at bottom
   Targets arranged in 150° arc, hugging the bottom edge
   ████████████████████████████████████████████████████████████████ */

body.layout-orbital .menu-wrap {
  position: fixed !important;
  bottom: 10px !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  transform: translateX(-50%) !important;
  width: auto !important;
  height: auto !important;
}
/* Show the fab button as orbital toggle */
body.layout-orbital .menu-fab {
  display: flex !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  border: 1px solid var(--border-accent) !important;
  background: var(--surface) !important;
  backdrop-filter: blur(var(--blur)) !important;
  font-size: 18px !important;
  z-index: 1200 !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}
body.layout-orbital .menu-fab::after {
  content: "🎯" !important;
  font-size: 16px !important;
}

/* Panel hidden by default, shown on .open */
body.layout-orbital .menu-panel {
  position: absolute !important;
  bottom: 50px !important;
  left: 50% !important;
  transform: translateX(-50%) scale(0.4) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
body.layout-orbital .menu-wrap.open .menu-panel {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateX(-50%) scale(1) !important;
}

body.layout-orbital .menu {
  display: block !important;
  flex-direction: unset !important;
  position: relative !important;
  --ring: clamp(90px, 12vw, 140px) !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  overflow: visible !important;
  max-height: none !important;
  max-width: none !important;
}
body.layout-orbital .menu-item {
  position: absolute !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  background: var(--surface) !important;
  border: 1px solid var(--border-accent) !important;
  backdrop-filter: blur(var(--blur)) !important;
  padding: 2px !important;
  gap: 0px !important;
  cursor: pointer !important;
  top: 50% !important; left: 50% !important;
  --a: 0deg;
  transform: translate(-50%, -50%) rotate(var(--a)) translate(0, calc(-1 * var(--ring))) rotate(calc(-1 * var(--a))) !important;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
  animation: orbit-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both !important;
  animation-delay: calc(var(--d, 0) * 0.04s) !important;
}
/* Distribute across 180° arc with wider spacing */
body.layout-orbital .menu-item:nth-child(1)  { --a: -82deg;  --d: 0; }
body.layout-orbital .menu-item:nth-child(2)  { --a: -67deg;  --d: 1; }
body.layout-orbital .menu-item:nth-child(3)  { --a: -52deg;  --d: 2; }
body.layout-orbital .menu-item:nth-child(4)  { --a: -37deg;  --d: 3; }
body.layout-orbital .menu-item:nth-child(5)  { --a: -22deg;  --d: 4; }
body.layout-orbital .menu-item:nth-child(6)  { --a: -7deg;   --d: 5; }
body.layout-orbital .menu-item:nth-child(7)  { --a: 8deg;    --d: 6; }
body.layout-orbital .menu-item:nth-child(8)  { --a: 23deg;   --d: 7; }
body.layout-orbital .menu-item:nth-child(9)  { --a: 38deg;   --d: 8; }
body.layout-orbital .menu-item:nth-child(10) { --a: 53deg;   --d: 9; }
body.layout-orbital .menu-item:nth-child(11) { --a: 68deg;   --d: 10; }
body.layout-orbital .menu-item:nth-child(12) { --a: 83deg;   --d: 11; }

body.layout-orbital .menu-item:hover {
  transform: translate(-50%, -50%) rotate(var(--a)) translate(0, calc(-1 * var(--ring) - 6px)) rotate(calc(-1 * var(--a))) scale(1.15) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 14px var(--accent-glow), 0 4px 16px rgba(0,0,0,0.4) !important;
}
body.layout-orbital .menu-item.selected {
  border-color: var(--accent) !important;
  background: var(--accent-dim) !important;
  box-shadow: 0 0 18px var(--accent-glow) !important;
  transform: translate(-50%, -50%) rotate(var(--a)) translate(0, calc(-1 * var(--ring) - 3px)) rotate(calc(-1 * var(--a))) scale(1.08) !important;
}
body.layout-orbital .menu-item img {
  width: 22px !important; height: 22px !important;
  border-radius: 50% !important;
}
body.layout-orbital .menu-name {
  display: none !important;
}
body.layout-orbital .menu-meta { display: none !important; }

/* Toolbar: right side, vertical (not in the arc center) */
body.layout-orbital .toolbar {
  position: fixed !important;
  right: 12px !important;
  top: 50% !important;
  bottom: auto !important;
  left: auto !important;
  transform: translateY(-50%) !important;
  flex-direction: column !important;
  padding: 6px !important;
  border-radius: var(--radius) !important;
  gap: 2px !important;
  animation: none !important;
}
body.layout-orbital .tb-btn {
  width: 36px !important; height: 36px !important;
  font-size: 15px !important;
}
body.layout-orbital .tb-sep { width: 24px !important; height: 1px !important; }
body.layout-orbital .tb-btn[title]::after { display: none !important; }

body.layout-orbital .stream-toggle {
  position: fixed !important;
  left: 14px !important; bottom: 76px !important;
  right: auto !important; top: auto !important;
}
body.layout-orbital .leaflet-top.leaflet-left {
  top: 10px !important;
}
body.layout-orbital .basemap-switcher {
  position: fixed !important;
  left: 14px !important; top: 76px !important;
}
body.layout-orbital #changelogBtn {
  position: fixed !important;
  left: 14px !important; bottom: 130px !important;
}

   4. LAYOUT: SIDEBAR — Full-height left panel dashboard
   All controls inside a sidebar, app-like feel
   ████████████████████████████████████████████████████████████████ */

body.layout-sidebar::before {
  content: "" !important;
  display: block !important;
  position: fixed !important;
  top: 0 !important; left: 0 !important; bottom: 0 !important;
  width: 260px !important;
  background: var(--surface-solid) !important;
  border-right: 1px solid var(--border) !important;
  z-index: 1050 !important;
  animation: sidebar-slide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both !important;
  pointer-events: none !important;
}

/* Menu: wide rows in sidebar */
body.layout-sidebar .menu-wrap {
  position: fixed !important;
  top: 56px !important;
  left: 0 !important;
  bottom: 60px !important;
  right: auto !important;
  width: 260px !important;
  transform: none !important;
  z-index: 1100 !important;
  overflow: hidden !important;
}
body.layout-sidebar .menu-panel {
  position: static !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  height: 100% !important;
  transform: none !important;
}
body.layout-sidebar .menu {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  padding: 8px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  border-radius: 0 !important;
  max-width: none !important;
  width: auto !important;
  max-height: calc(100vh - 130px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  animation: none !important;
}
body.layout-sidebar .menu-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  min-width: 100% !important;
  height: auto !important;
  padding: 10px 12px !important;
  gap: 12px !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}
body.layout-sidebar .menu-item:hover {
  background: var(--surface-hover) !important;
  border-color: var(--border-accent) !important;
  transform: none !important;
  padding-left: 16px !important;
}
body.layout-sidebar .menu-item.selected {
  background: var(--accent-dim) !important;
  border-color: var(--accent) !important;
  border-left: 3px solid var(--accent) !important;
  transform: none !important;
}
body.layout-sidebar .menu-item img {
  width: 32px !important; height: 32px !important;
  border-radius: 8px !important;
  flex-shrink: 0 !important;
}
body.layout-sidebar .menu-name {
  font-size: 12px !important;
  font-weight: 600 !important;
  text-align: left !important;
  opacity: 0.9 !important;
}
body.layout-sidebar .menu-meta {
  display: block !important;
  font-size: 9px !important;
  text-align: left !important;
  opacity: 0.4 !important;
  margin-top: 2px !important;
}

/* Toolbar at bottom of sidebar */
body.layout-sidebar .toolbar {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: auto !important;
  top: auto !important;
  width: 260px !important;
  transform: none !important;
  flex-direction: row !important;
  justify-content: center !important;
  padding: 10px 12px !important;
  border-radius: 0 !important;
  border-top: 1px solid var(--border) !important;
  border-right: 1px solid var(--border) !important;
  border-bottom: none !important;
  border-left: none !important;
  background: var(--surface-solid) !important;
  box-shadow: none !important;
  gap: 4px !important;
  animation: none !important;
}
body.layout-sidebar .tb-btn {
  width: 36px !important; height: 36px !important;
  border-radius: var(--radius-sm) !important;
}
body.layout-sidebar .tb-sep {
  width: 1px !important; height: 24px !important;
}
body.layout-sidebar .tb-btn[title]::after { display: none !important; }

/* Stream toggle: outside sidebar, bottom-left of map area */
body.layout-sidebar .stream-toggle {
  position: fixed !important;
  bottom: 76px !important;
  left: 272px !important;
  right: auto !important;
  top: auto !important;
  width: auto !important;
  justify-content: center !important;
  border-radius: var(--radius-sm) !important;
}

body.layout-sidebar .basemap-switcher {
  position: fixed !important;
  left: 272px !important;
  top: 76px !important;
}
body.layout-sidebar #changelogBtn {
  position: fixed !important;
  left: 272px !important;
  bottom: 130px !important;
}
body.layout-sidebar .leaflet-top.leaflet-left {
  left: 268px !important;
  top: 10px !important;
}

/* Push map content right */
body.layout-sidebar #map {
  margin-left: 260px !important;
  width: calc(100vw - 260px) !important;
}


/* ████████████████████████████████████████████████████████████████
   5. LAYOUT: CINEMA — Ultra minimal, reveal on hover
   Nearly invisible HUD, filmstrip menu from bottom, max map view
   ████████████████████████████████████████████████████████████████ */

/* Menu: filmstrip from bottom edge */
body.layout-cinema .menu-wrap {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  top: auto !important;
  width: 100% !important;
  transform: none !important;
  z-index: 1100 !important;
}
body.layout-cinema .menu-panel {
  position: static !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
body.layout-cinema .menu {
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
  gap: 0 !important;
  padding: 0 !important;
  background: rgba(0, 0, 0, 0.7) !important;
  border: none !important;
  border-top: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  max-width: 100vw !important;
  width: 100% !important;
  overflow-x: auto !important;
  max-height: none !important;
  transform: translateY(100%) !important;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s !important;
  opacity: 0 !important;
  animation: none !important;
}
body.layout-cinema .menu-wrap:hover .menu,
body.layout-cinema .menu:hover {
  transform: translateY(0) !important;
  opacity: 1 !important;
}
/* Hover zone at the bottom of the screen */
body.layout-cinema .menu-wrap::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  bottom: 0 !important; left: 0 !important; right: 0 !important;
  height: 40px !important;
  pointer-events: auto !important;
  z-index: 1 !important;
}

body.layout-cinema .menu-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: auto !important;
  min-width: 64px !important;
  height: auto !important;
  padding: 12px 10px 8px !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  border-right: 1px solid rgba(255,255,255,0.04) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  gap: 4px !important;
}
body.layout-cinema .menu-item:hover {
  background: rgba(255,255,255,0.08) !important;
  transform: none !important;
}
body.layout-cinema .menu-item.selected {
  background: rgba(255,255,255,0.12) !important;
  box-shadow: inset 0 -3px 0 var(--accent) !important;
  transform: none !important;
}
body.layout-cinema .menu-item img {
  width: 28px !important; height: 28px !important;
  border-radius: 4px !important;
  transition: transform 0.2s !important;
}
body.layout-cinema .menu-item:hover img {
  transform: scale(1.15) !important;
}
body.layout-cinema .menu-name {
  font-size: 8px !important;
  opacity: 0.6 !important;
}
body.layout-cinema .menu-meta {
  display: block !important;
  font-size: 6px !important;
  opacity: 0.3 !important;
}

/* Toolbar: tiny dots on right, expand on hover */
body.layout-cinema .toolbar {
  position: fixed !important;
  right: 10px !important;
  top: 50% !important;
  bottom: auto !important;
  left: auto !important;
  transform: translateY(-50%) !important;
  flex-direction: column !important;
  padding: 4px !important;
  gap: 3px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  opacity: 0.3 !important;
  transition: opacity 0.3s, background 0.3s, padding 0.3s !important;
  animation: none !important;
  border-radius: var(--radius) !important;
}
body.layout-cinema .toolbar:hover {
  opacity: 1 !important;
  background: var(--surface) !important;
  backdrop-filter: blur(var(--blur)) !important;
  border: 1px solid var(--border) !important;
  padding: 8px !important;
}
body.layout-cinema .tb-btn {
  width: 10px !important; height: 10px !important;
  border-radius: 50% !important;
  background: var(--text) !important;
  font-size: 0 !important;
  opacity: 0.4 !important;
  transition: all 0.25s ease !important;
  overflow: hidden !important;
  border: none !important;
}
body.layout-cinema .toolbar:hover .tb-btn {
  width: 40px !important; height: 40px !important;
  border-radius: var(--radius-sm) !important;
  background: transparent !important;
  font-size: 17px !important;
  opacity: 1 !important;
  border: 1px solid var(--border) !important;
}
body.layout-cinema .tb-sep {
  display: none !important;
}
body.layout-cinema .toolbar:hover .tb-sep {
  display: block !important;
  width: 24px !important; height: 1px !important;
}
body.layout-cinema .tb-btn[title]::after { display: none !important; }

/* Stream toggle: semi-transparent */
body.layout-cinema .stream-toggle {
  position: fixed !important;
  left: 12px !important; bottom: 76px !important;
  right: auto !important; top: auto !important;
  opacity: 0.2 !important;
  transition: opacity 0.3s !important;
  border-color: transparent !important;
  background: rgba(0,0,0,0.3) !important;
  box-shadow: none !important;
}
body.layout-cinema .stream-toggle:hover {
  opacity: 1 !important;
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
body.layout-cinema .stream-toggle.active {
  opacity: 0.7 !important;
}

body.layout-cinema .basemap-switcher {
  position: fixed !important;
  right: 10px !important;
  left: auto !important;
  top: 10px !important;
  opacity: 0.25 !important;
  transition: opacity 0.3s !important;
}
body.layout-cinema .basemap-switcher:hover {
  opacity: 1 !important;
}
body.layout-cinema .leaflet-top.leaflet-left {
  top: 44px !important;
}
body.layout-cinema #changelogBtn {
  position: fixed !important;
  left: 12px !important; bottom: 130px !important;
  opacity: 0.2 !important;
  transition: opacity 0.3s !important;
}
body.layout-cinema #changelogBtn:hover {
  opacity: 1 !important;
}


/* ████████████████████████████████████████████████████████████████
   6. LAYOUT: FLOAT — Individual floating glass cards
   No containers, each element is a separate floating island
   ████████████████████████████████████████████████████████████████ */

/* Menu: individual floating circles */
body.layout-float .menu-wrap {
  position: fixed !important;
  bottom: 20px !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  transform: translateX(-50%) !important;
}
body.layout-float .menu-panel {
  position: static !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
body.layout-float .menu {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 12px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  border-radius: 0 !important;
  max-width: 90vw !important;
  width: auto !important;
  overflow-x: auto !important;
  max-height: none !important;
  scrollbar-width: none !important;
  animation: none !important;
}

body.layout-float .menu-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  backdrop-filter: blur(20px) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3) !important;
  padding: 2px !important;
  gap: 0px !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  animation: float-bob 3s ease-in-out infinite !important;
  animation-delay: calc(var(--d, 0) * 0.25s) !important;
}
body.layout-float .menu-item:nth-child(1)  { --d: 0; }
body.layout-float .menu-item:nth-child(2)  { --d: 1; }
body.layout-float .menu-item:nth-child(3)  { --d: 2; }
body.layout-float .menu-item:nth-child(4)  { --d: 3; }
body.layout-float .menu-item:nth-child(5)  { --d: 4; }
body.layout-float .menu-item:nth-child(6)  { --d: 5; }
body.layout-float .menu-item:nth-child(7)  { --d: 6; }
body.layout-float .menu-item:nth-child(8)  { --d: 7; }
body.layout-float .menu-item:nth-child(9)  { --d: 8; }
body.layout-float .menu-item:nth-child(10) { --d: 9; }
body.layout-float .menu-item:nth-child(11) { --d: 10; }
body.layout-float .menu-item:nth-child(12) { --d: 11; }

body.layout-float .menu-item:hover {
  transform: translateY(-8px) scale(1.18) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 12px 36px rgba(0,0,0,0.35), 0 0 20px var(--accent-glow) !important;
  animation: none !important;
}
body.layout-float .menu-item.selected {
  border-color: var(--accent) !important;
  background: var(--accent-dim) !important;
  box-shadow: 0 0 28px var(--accent-glow), 0 8px 28px rgba(0,0,0,0.3) !important;
  transform: translateY(-4px) scale(1.1) !important;
  animation: none !important;
}
body.layout-float .menu-item img {
  width: 24px !important; height: 24px !important;
  border-radius: 50% !important;
}
body.layout-float .menu-name {
  display: none !important;
}
body.layout-float .menu-meta {
  display: none !important;
}
body.layout-float .menu-item:hover .menu-name {
  display: none !important;
}
body.layout-float .menu-meta { display: none !important; }

/* Toolbar: floating individual buttons */
body.layout-float .toolbar {
  position: fixed !important;
  right: 14px !important;
  top: 50% !important;
  bottom: auto !important;
  left: auto !important;
  transform: translateY(-50%) !important;
  flex-direction: column !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 0 !important;
  gap: 10px !important;
  animation: none !important;
}
body.layout-float .tb-btn {
  width: 44px !important; height: 44px !important;
  border-radius: 50% !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  backdrop-filter: blur(20px) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25) !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
body.layout-float .tb-btn:hover {
  transform: scale(1.2) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 16px var(--accent-glow), 0 6px 20px rgba(0,0,0,0.3) !important;
}
body.layout-float .tb-sep { display: none !important; }
body.layout-float .tb-btn[title]::after { display: none !important; }

body.layout-float .stream-toggle {
  position: fixed !important;
  left: 14px !important; bottom: 76px !important;
  right: auto !important; top: auto !important;
  border-radius: 24px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25) !important;
  backdrop-filter: blur(20px) !important;
  animation: float-bob 5s ease-in-out infinite !important;
}

body.layout-float .basemap-switcher {
  position: fixed !important;
  left: 14px !important; top: 76px !important;
}
body.layout-float .bm-fab {
  border-radius: 50% !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25) !important;
}
body.layout-float .leaflet-top.leaflet-left {
  top: 10px !important;
}
body.layout-float #changelogBtn {
  position: fixed !important;
  left: 14px !important; bottom: 130px !important;
  border-radius: 50% !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25) !important;
}


/* ================================================================
   RESPONSIVE: TABLET (641px – 1024px)
   ================================================================ */
@media (min-width: 641px) and (max-width: 1024px) {

  /* COMMAND tablet */
  body.layout-command .menu {
    grid-template-columns: repeat(4, 1fr) !important;
  }
  body.layout-command .menu-item {
    width: 42px !important; min-width: 42px !important; height: 42px !important;
  }
  body.layout-command .toolbar {
    top: 56px !important;
  }

  /* HEX tablet */
  body.layout-hex .menu-item {
    width: 46px !important; min-width: 46px !important; height: 52px !important;
  }
  body.layout-hex .menu { max-width: 440px !important; }

  /* ORBITAL tablet */
  body.layout-orbital .menu { --ring: clamp(70px, 10vw, 110px) !important; }
  body.layout-orbital .menu-item {
    width: 36px !important; min-width: 36px !important; height: 36px !important;
  }
  body.layout-orbital .menu-item img { width: 18px !important; height: 18px !important; }
  body.layout-orbital .toolbar { right: 8px !important; top: 50% !important; bottom: auto !important; transform: translateY(-50%) !important; }

  /* SIDEBAR tablet */
  body.layout-sidebar::before { width: 220px !important; }
  body.layout-sidebar .menu-wrap { width: 220px !important; }
  body.layout-sidebar .toolbar { width: 220px !important; }
  body.layout-sidebar .stream-toggle { left: 232px !important; width: auto !important; }
  body.layout-sidebar #map { margin-left: 220px !important; width: calc(100vw - 220px) !important; }
  body.layout-sidebar .basemap-switcher { left: 232px !important; }
  body.layout-sidebar #changelogBtn { left: 232px !important; }
  body.layout-sidebar .leaflet-top.leaflet-left { left: 228px !important; }
  body.layout-sidebar .menu-item { padding: 8px 10px !important; }
  body.layout-sidebar .menu-item img { width: 28px !important; height: 28px !important; }
  body.layout-sidebar .menu-name { font-size: 11px !important; }

  /* FLOAT tablet */
  body.layout-float .menu-item {
    width: 40px !important; min-width: 40px !important; height: 40px !important;
  }
  body.layout-float .menu { gap: 8px !important; }
  body.layout-float .menu-item img { width: 24px !important; height: 24px !important; }
}


/* ================================================================
   RESPONSIVE: MOBILE (≤640px)
   ================================================================ */
@media (max-width: 640px) {

  /* COMMAND mobile */
  body.layout-command .menu {
    grid-template-columns: repeat(4, 1fr) !important;
    padding: 6px !important;
  }
  body.layout-command .menu-item {
    width: 40px !important; min-width: 40px !important; height: 40px !important;
  }
  body.layout-command .menu-item img { width: 20px !important; height: 20px !important; }
  body.layout-command .menu-name { font-size: 5px !important; }
  body.layout-command .toolbar {
    top: 48px !important;
    right: 8px !important;
    padding: 3px 4px !important;
  }
  body.layout-command .tb-btn { width: 32px !important; height: 32px !important; font-size: 14px !important; }
  body.layout-command .stream-toggle {
    top: 48px !important; left: 8px !important;
    height: 32px !important;
    font-size: 9px !important;
    padding: 0 8px !important;
  }
  body.layout-command .basemap-switcher { top: 92px !important; left: 8px !important; }
  body.layout-command .bm-fab { width: 34px !important; height: 34px !important; }

  /* HEX mobile */
  body.layout-hex .menu { max-width: 320px !important; gap: 4px 2px !important; padding: 10px 6px !important; }
  body.layout-hex .menu-item {
    width: 42px !important; min-width: 42px !important; height: 48px !important;
    padding: 8px 2px 4px !important;
  }
  body.layout-hex .menu-item:nth-child(even) { margin-top: 10px !important; }
  body.layout-hex .menu-item img { width: 18px !important; height: 18px !important; }
  body.layout-hex .menu-name { font-size: 5.5px !important; }
  body.layout-hex .toolbar { right: 8px !important; }
  body.layout-hex .tb-btn {
    width: 38px !important; height: 42px !important;
  }
  body.layout-hex .stream-toggle {
    width: 60px !important; height: 68px !important;
    padding: 14px 6px !important;
    left: 8px !important; bottom: 82px !important;
  }
  body.layout-hex .stream-toggle-title { font-size: 6px !important; }
  body.layout-hex .basemap-switcher { left: 8px !important; top: 76px !important; }

  /* ORBITAL mobile */
  body.layout-orbital .menu { --ring: clamp(60px, 16vw, 100px) !important; }
  body.layout-orbital .menu-item {
    width: 32px !important; min-width: 32px !important; height: 32px !important;
  }
  body.layout-orbital .menu-item img { width: 18px !important; height: 18px !important; }
  body.layout-orbital .toolbar {
    right: 6px !important; top: 50% !important; bottom: auto !important;
    transform: translateY(-50%) !important;
    padding: 3px !important;
  }
  body.layout-orbital .tb-btn { width: 32px !important; height: 32px !important; font-size: 14px !important; }

  /* SIDEBAR mobile: becomes bottom sheet */
  body.layout-sidebar::before {
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important; right: 0 !important;
    width: 100% !important;
    height: 55vh !important;
    border-right: none !important;
    border-top: 1px solid var(--border) !important;
    animation-name: cinema-in !important;
  }
  body.layout-sidebar .menu-wrap {
    top: auto !important;
    bottom: 50px !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(55vh - 108px) !important;
  }
  body.layout-sidebar .menu {
    max-height: calc(55vh - 120px) !important;
    flex-direction: column !important;
  }
  body.layout-sidebar .menu-item {
    padding: 8px 12px !important;
    gap: 10px !important;
  }
  body.layout-sidebar .menu-item img { width: 26px !important; height: 26px !important; }
  body.layout-sidebar .menu-name { font-size: 11px !important; }
  body.layout-sidebar .toolbar {
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    border-right: none !important;
    border-top: 1px solid var(--border) !important;
    padding: 8px !important;
  }
  body.layout-sidebar .stream-toggle {
    bottom: auto !important;
    top: 8px !important;
    left: 8px !important;
    width: auto !important;
  }
  body.layout-sidebar #map {
    margin-left: 0 !important;
    width: 100vw !important;
    height: 45vh !important;
  }
  body.layout-sidebar .leaflet-top.leaflet-left { left: 0 !important; top: 50px !important; }
  body.layout-sidebar .basemap-switcher { left: 8px !important; top: auto !important; bottom: calc(55vh + 8px) !important; }
  body.layout-sidebar #changelogBtn { left: auto !important; right: 8px !important; bottom: calc(55vh + 8px) !important; }

  /* CINEMA mobile */
  body.layout-cinema .menu-item {
    min-width: 52px !important;
    padding: 8px 6px 6px !important;
  }
  body.layout-cinema .menu-item img { width: 22px !important; height: 22px !important; }
  body.layout-cinema .menu-name { font-size: 6.5px !important; }
  body.layout-cinema .toolbar {
    right: 6px !important;
    padding: 3px !important;
  }
  body.layout-cinema .stream-toggle {
    left: 6px !important; bottom: 68px !important;
    height: 30px !important;
    font-size: 9px !important;
    padding: 0 8px !important;
  }
  body.layout-cinema .basemap-switcher { right: 6px !important; top: 6px !important; }

  /* FLOAT mobile */
  body.layout-float .menu { gap: 8px !important; }
  body.layout-float .menu-item {
    width: 38px !important; min-width: 38px !important; height: 38px !important;
    animation: none !important;
  }
  body.layout-float .menu-item img { width: 20px !important; height: 20px !important; }
  body.layout-float .toolbar {
    right: 8px !important;
    gap: 6px !important;
  }
  body.layout-float .tb-btn {
    width: 36px !important; height: 36px !important;
  }
  body.layout-float .stream-toggle {
    left: 8px !important; bottom: 68px !important;
    animation: none !important;
  }
  body.layout-float .basemap-switcher { left: 8px !important; top: 76px !important; }
  body.layout-float .bm-fab { width: 36px !important; height: 36px !important; }
}

/* ================================================================
   TOUCH: hide tooltips on coarse pointer for all layouts
   ================================================================ */
@media (hover: none) and (pointer: coarse) {
  body[class*="layout-"] .tb-btn[title]::after { display: none !important; }
}
