/* ==========================================================================
   tikirinda.xyz - PZ Map (Build 42+)
   Ultra-modern Dark Glassmorphic UI System
   Unified Architecture for Mobile & Desktop
   ========================================================================== */

:root {
  --bg-black: #08090b;
  --glass: rgba(14, 18, 28, 0.72);
  --glass-solid: rgba(15, 19, 30, 0.85);
  --glass-elevated: rgba(16, 21, 32, 0.82);
  --glass-drawer: rgba(14, 17, 24, 0.88);
  --glass-card: rgba(22, 28, 44, 0.65);
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-border-strong: rgba(255, 255, 255, 0.30);
  --glass-hover: rgba(255, 255, 255, 0.12);
  --text-main: #ffffff;
  --text-muted: #b0b8c4;
  --text-dim: #7a828e;
  --accent-orange: #f97316;
  --accent-orange-hover: #ea580c;
  --accent-orange-glow: rgba(249, 115, 22, 0.4);
  --accent-basement: #ef4444;
  --accent-basement-glow: rgba(239, 68, 68, 0.45);
  --radius-squircle: 12px;
  --radius-card: 16px;
  --radius-pill: 999px;
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  --shadow-glow: 0 0 20px rgba(249, 115, 22, 0.25);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-black);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Glassmorphism Surface Utility */
.glass {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  transition: background 0.2s var(--ease-smooth), border-color 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth);
}

.glass:hover {
  border-color: var(--glass-border-strong);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   MAP VIEWPORT & CANVAS LAYERS
   ========================================================================== */
#map-viewport {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
  background: #000;
}

#vector-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 2;
  transition: opacity 0.3s var(--ease-smooth), visibility 0.3s var(--ease-smooth);
}

#vector-layer.hidden-layer {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#map {
  width: 100%;
  height: 100%;
  display: block;
}

#satellite-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #0c0e11;
  z-index: 1;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-smooth), visibility 0.3s var(--ease-smooth);
  overflow: hidden;
}

#satellite-layer.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  z-index: 3;
}

#satellite-layer iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #0c0e11;
}

/* Hide legacy elements from 2D engine if still present */
#drawer, #toolbar, #mapkey, #status, #uipop {
  display: none !important;
}


/* ==========================================================================
   FLOATING GLASS UI OVERLAY
   ========================================================================== */
#ui-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none !important;
  z-index: 10;
}

/* Explicitly enable pointer events ONLY on interactive UI containers */
.top-left-bar,
.sidebar-trigger-btn,
.sidebar-drawer.open,
.save-location-drawer,
.top-right-bar,
.floor-control-capsule,
.bottom-right-bar,
.map-legend-floating,
.custom-context-menu,
.context-menu,
.modal-dialog {
  pointer-events: auto !important;
}

.sidebar-drawer:not(.open) {
  pointer-events: none !important;
}

/* --------------------------------------------------------------------------
   Top-Left Bar: Brand Squircle Capsule + Buttons
   -------------------------------------------------------------------------- */
.top-left-bar {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 20;
}

/* Squircle border radius (12px) matching 't' logo icon - extended to 300px */
.site-brand-capsule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 300px;
  max-width: calc(100vw - 32px);
  height: 48px;
  padding: 0 12px;
  border-radius: var(--radius-squircle);
  gap: 8px;
  position: relative;
  z-index: 50;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(249, 115, 22, 0.16);
  border: 1px solid rgba(249, 115, 22, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px var(--accent-orange-glow);
  flex-shrink: 0;
  transition: transform 0.25s var(--ease-smooth);
}

.site-brand-capsule:hover .brand-icon {
  transform: scale(1.05);
}

.brand-icon img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.brand-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: #fff;
  white-space: nowrap;
}

.b42-badge {
  font-size: 10px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-orange), #ea580c);
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 0 10px var(--accent-orange-glow);
}

.brand-right-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.brand-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.brand-action-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.brand-divider {
  width: 1px;
  height: 20px;
  background: var(--glass-border);
  margin: 0 1px;
}

/* Language Module inside Brand Capsule (position: static so dropdown can align with .site-brand-capsule) */
.lang-module {
  position: static;
  display: flex;
}

/* All languages from satellite map are available in 2D mode as well */
.lang-opt-satellite-only {
  display: flex !important;
}

.lang-trigger-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}

.lang-trigger-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}



.flag-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.lang-chevron {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s var(--ease-smooth);
}

.lang-module.open .lang-chevron {
  transform: rotate(180deg);
}

/* Dropdown opens to the right, then extends downwards without overlapping menus or buttons */
.lang-dropdown {
  position: absolute;
  top: 0;
  left: calc(100% + 10px);
  min-width: 140px;
  border-radius: var(--radius-squircle);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-6px);
  transition: all 0.22s var(--ease-smooth);
  z-index: 1000;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%), var(--glass-elevated);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.lang-module.open .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto !important;
}

.lang-opt-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
}

.lang-opt-item:hover {
  background: var(--glass-hover);
  color: #fff;
}

.lang-opt-item.active {
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent-orange);
  font-weight: 600;
}

.lang-name {
  flex: 1;
}

.lang-code {
  font-size: 11px;
  opacity: 0.6;
}

/* Glass Square Button (40x40px squircle matching layer toggle) */
.glass-square-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.2s var(--ease-smooth);
  flex-shrink: 0;
  box-sizing: border-box;
}

.glass-square-btn:hover {
  border-color: var(--glass-border-strong);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.glass-square-btn:active {
  transform: scale(0.95);
}

/* Isometric Toggle Button - Icon Switching (2D Ortho vs Isometric Diamond) */
#btnIsoToggle .iso-icon-ortho {
  display: block;
}

#btnIsoToggle .iso-icon-iso {
  display: none;
}

#btnIsoToggle.active .iso-icon-ortho {
  display: none;
}

#btnIsoToggle.active .iso-icon-iso {
  display: block;
}

/* Button appearance remains unchanged (frosted glass) when active */
#btnIsoToggle.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), var(--glass);
  border-color: var(--glass-border);
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
}

#btnIsoToggle.active:hover {
  border-color: var(--glass-border-strong);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-emoji {
  font-size: 18px;
}

/* Dark theme toggle button only visible in 2D mode */
body.satellite-active #btnDarkTheme {
  display: none !important;
}

#btnDarkTheme .theme-icon-moon {
  display: inline-block;
  color: #94a3b8;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.25s ease;
}

#btnDarkTheme .theme-icon-sun {
  display: none;
  color: #f59e0b;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.25s ease;
}

#btnDarkTheme:hover .theme-icon-moon {
  color: #f1f5f9;
  transform: rotate(-18deg) scale(1.08);
}

#btnDarkTheme:hover .theme-icon-sun {
  color: #fbbf24;
  transform: rotate(45deg) scale(1.08);
}

/* When dark theme is active: show Sun icon (to switch to light), hide Moon icon */
body.theme-dark #btnDarkTheme .theme-icon-moon,
#btnDarkTheme.active .theme-icon-moon {
  display: none;
}

body.theme-dark #btnDarkTheme .theme-icon-sun,
#btnDarkTheme.active .theme-icon-sun {
  display: inline-block;
}

body.theme-dark #btnDarkTheme,
#btnDarkTheme.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

body.theme-dark #btnDarkTheme:hover,
#btnDarkTheme.active:hover {
  background: rgba(245, 158, 11, 0.24);
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.3);
}

/* --------------------------------------------------------------------------
   Unified Dark Glass Sidebar
   -------------------------------------------------------------------------- */
.sidebar-drawer {
  position: fixed;
  top: calc(max(16px, env(safe-area-inset-top)) + 48px + 10px);
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: 300px;
  max-width: calc(100vw - 32px);
  border-radius: var(--radius-squircle);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  transform: translateX(calc(-100% - 32px));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s var(--ease-smooth), opacity 0.22s ease;
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.sidebar-drawer.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto !important;
}

/* Floating Sidebar Open Button (Aligned with X under the 't' logo) */
.sidebar-trigger-btn {
  position: fixed;
  top: calc(max(16px, env(safe-area-inset-top)) + 48px + 10px + 12px);
  left: calc(max(16px, env(safe-area-inset-left)) + 12px);
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  transition: all 0.2s var(--ease-smooth);
}

.sidebar-trigger-btn:hover {
  border-color: var(--glass-border-strong);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

body.sidebar-open .sidebar-trigger-btn {
  display: none !important;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden !important;
  padding: 0;
  gap: 0;
}

/* Pinned Top Area: Header & Search (Stays permanently fixed at the top when scrolling) */
.sidebar-pinned-top {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 10px 12px;
  background: transparent !important;
  border-bottom: 1px solid var(--glass-border);
  z-index: 5;
}

/* Scrollable Content Area: Town Quick Select & All Sections */
.sidebar-scrollable-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 10px 10px 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(249, 115, 22, 0.45) rgba(255, 255, 255, 0.04);
}

/* Custom Scrollbar - Clearly visible, sleek, orange-accented */
.sidebar-scrollable-content::-webkit-scrollbar,
.sidebar-inner::-webkit-scrollbar {
  width: 6px;
}

.sidebar-scrollable-content::-webkit-scrollbar-track,
.sidebar-inner::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  margin: 6px 0;
}

.sidebar-scrollable-content::-webkit-scrollbar-thumb,
.sidebar-inner::-webkit-scrollbar-thumb {
  background: rgba(249, 115, 22, 0.45);
  border-radius: 8px;
  border: 1px solid rgba(249, 115, 22, 0.25);
  transition: all 0.2s ease;
}

.sidebar-scrollable-content::-webkit-scrollbar-thumb:hover,
.sidebar-inner::-webkit-scrollbar-thumb:hover {
  background: var(--accent-orange);
  box-shadow: 0 0 10px var(--accent-orange-glow);
}

/* Header row inside sidebar drawer */
.sidebar-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 32px;
}

.sidebar-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.04);
}

.sidebar-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  margin-left: auto;
  padding-right: 2px;
}

.sidebar-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(249, 115, 22, 0.2);
  border: 1px solid rgba(249, 115, 22, 0.4);
  color: var(--accent-orange);
  padding: 2px 6px;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Search Box */
.sidebar-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 10px;
  font-size: 14px;
  color: var(--text-dim);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.sidebar-search-box:focus-within .search-icon {
  color: var(--accent-orange);
}

.search-input {
  width: 100%;
  height: 32px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  padding: 0 28px 0 32px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  letter-spacing: 0.2px;
  transition: all 0.2s ease;
}

.search-input::placeholder {
  color: var(--text-dim);
  font-size: 12px;
}

.search-input:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.search-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-orange);
  box-shadow: 0 0 10px var(--accent-orange-glow);
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.search-clear-btn:hover {
  color: #fff;
}

/* Town Quick Selector (Right below search) */
.town-quick-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.town-quick-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2px;
}

.sub-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

.sub-count {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-orange);
  background: rgba(249, 115, 22, 0.15);
  padding: 1px 6px;
  border-radius: 10px;
}

.town-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  overflow: visible !important;
  max-height: none !important;
}

.town-grid::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.town-chip-btn {
  height: 33px;
  min-height: 33px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  padding: 3px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s var(--ease-smooth);
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.town-chip-btn:hover {
  background: rgba(249, 115, 22, 0.16);
  border-color: rgba(249, 115, 22, 0.45);
  transform: translateY(-1px);
}

.town-chip-btn:active {
  transform: scale(0.98);
}

.town-chip-name {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.town-chip-coords {
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.1;
  color: #8c95a3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 2px 0;
}

/* Sidebar Sections - Open & Unboxed (Aynı hızlı kasaba seçimi gibi açıkta duran) */
.sidebar-section {
  display: flex;
  flex-direction: column;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 2px !important;
  gap: 6px;
}

.section-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.15s ease;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  user-select: none;
}

.section-header:hover {
  color: #fff;
  background: transparent !important;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  color: var(--accent-orange);
}

.section .chevron,
.sidebar-section .chevron {
  transition: transform 0.22s var(--ease-smooth);
  color: var(--text-dim);
  flex-shrink: 0;
}

.sidebar-section.open .chevron {
  transform: rotate(180deg);
  color: var(--accent-orange);
}

.section-body {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 6px 0;
}

.sidebar-section.open .section-body {
  display: flex;
}

/* Feature Toggle Row */
.toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 6px;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  font-size: 12.5px;
  transition: background 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  transform: translateX(2px);
}

.toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s ease;
}

.toggle input[type="checkbox"]:checked {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  box-shadow: 0 0 8px var(--accent-orange-glow);
  transform: scale(1.06);
}

.toggle input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 4px;
  width: 3.5px;
  height: 7px;
  border: 2px solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.toggle-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}

.toggle-label {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  font-size: 12px;
  font-weight: 500;
}

.toggle-hint {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 1px;
}

/* POI Filter System */
.poi-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 4px 8px 18px;
  margin-bottom: 4px;
}

.poi-filter-actions {
  color: var(--text-dim);
  flex-basis: 100%;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px 2px;
  font-size: 10.5px;
  display: flex;
}

.poi-filter-actions button {
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  font: inherit;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 10.5px;
  transition: all 0.15s ease;
}

.poi-filter-actions button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.poi-cat-btn {
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #8c95a3;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10.5px;
  transition: all 0.14s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.poi-cat-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.poi-cat-btn.on {
  border-color: var(--poi-c);
  color: #fff;
  background: color-mix(in srgb, var(--poi-c) 22%, transparent);
  box-shadow: 0 0 6px color-mix(in srgb, var(--poi-c) 30%, transparent);
}

.poi-filter-icon {
  color: var(--poi-c);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Heat Legends */
.heat-legend {
  color: var(--text-dim);
  align-items: center;
  gap: 8px;
  padding: 4px 8px 6px 26px;
  font-size: 10px;
  display: flex;
}

.heat-bar {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, #2b6cb0, #48bb78, #ecc94b, #e53e3e);
}

.heat-bar.forage-bar {
  background: linear-gradient(90deg, #718096, #48bb78, #38a169, #22543d);
}

/* Keyboard Hints */
.kbd-rows {
  color: var(--text-muted);
  gap: 6px;
  padding: 6px 8px;
  font-size: 11.5px;
  display: grid;
}

.kbd-rows div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kbd-rows kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10.5px;
  font-family: 'JetBrains Mono', monospace;
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Saved Places List */
.saved-places-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.empty-saved-note {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
  padding: 6px 0;
}

.saved-place-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.saved-place-item:hover {
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.3);
}

.saved-place-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.saved-place-sym {
  font-size: 14px;
}

.saved-place-name {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-place-coords {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-orange);
  margin-left: 4px;
}

.saved-place-del {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  font-size: 12px;
  transition: color 0.15s ease;
}

.saved-place-del:hover {
  color: #ef4444;
}

/* Help Section Content */
.help-content {
  gap: 10px;
}

.help-shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.help-shortcut-row kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  padding: 2px 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #fff;
}

.help-info-text {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-top: 4px;
}

/* Sidebar Backdrop - Completely disabled to prevent map blur and click blocking */
.sidebar-backdrop {
  display: none !important;
  pointer-events: none !important;
}

/* --------------------------------------------------------------------------
   Top-Right Controls: Layer Switcher & Isometric View
   -------------------------------------------------------------------------- */
.top-right-bar {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  z-index: 20;
}

/* Layer Switcher Capsule (Icon-Only, 40px height matching isometric button) */
.layer-toggle-capsule {
  display: flex;
  align-items: center;
  padding: 3px;
  border-radius: 10px;
  gap: 3px;
  height: 40px;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.25s var(--ease-smooth);
}

.layer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  flex-shrink: 0;
  overflow: hidden;
  padding: 0;
  box-sizing: border-box;
}

.layer-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.layer-btn.active {
  background: rgba(249, 115, 22, 0.22);
  border-color: rgba(249, 115, 22, 0.55);
  color: var(--accent-orange);
  box-shadow: 0 0 12px var(--accent-orange-glow);
}

.layer-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* Auto-collapse of inactive layer button to save space - Exact 40px x 40px when collapsed */
.layer-toggle-capsule.collapsed {
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  gap: 0 !important;
  padding: 3px !important;
  justify-content: center;
}

.layer-toggle-capsule.collapsed .layer-btn:not(.active) {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: 0 !important;
}

.layer-toggle-capsule.collapsed .layer-btn.active {
  width: 32px !important;
  height: 32px !important;
  margin: 0 !important;
}

.layer-toggle-capsule.collapsed:hover,
.layer-toggle-capsule.expanded {
  width: 77px !important;
  min-width: 77px !important;
  max-width: 77px !important;
  gap: 3px !important;
  padding: 3px !important;
}

.layer-toggle-capsule.collapsed:hover .layer-btn:not(.active),
.layer-toggle-capsule.expanded .layer-btn:not(.active) {
  display: flex !important;
  width: 32px !important;
  height: 32px !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Isometric view button visible only in 2D mode */
body.satellite-active #btnIsoToggle {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Floating Map Legend Card (Top-Right, Compact & Sleek)
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   Top-Center Horizontal Map Legend Capsule
   -------------------------------------------------------------------------- */
.map-legend-floating,
#mapLegendCard {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  bottom: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  width: auto;
  border-radius: var(--radius-pill);
  padding: 0 10px 0 16px;
  box-sizing: border-box;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  pointer-events: auto !important;
  user-select: none;
  z-index: 50;
  white-space: nowrap;
  max-width: calc(100vw - 300px);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  animation: fadeInPop 0.2s var(--ease-smooth);
}

.map-legend-floating::-webkit-scrollbar,
#mapLegendCard::-webkit-scrollbar {
  display: none;
}

.map-legend-floating .legend-items,
#mapLegendCard .legend-items {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.map-legend-floating .mk-row,
#mapLegendCard .mk-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.map-legend-floating .sw,
#mapLegendCard .sw {
  width: 22px;
  height: 11px;
  border-radius: 2px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.45);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

body.theme-dark .map-legend-floating .sw,
body.theme-dark #mapLegendCard .sw {
  border-color: rgba(255, 255, 255, 0.22);
}

.map-legend-floating .sw-label,
.map-legend-floating .mk-row span:last-child,
#mapLegendCard .sw-label,
#mapLegendCard .mk-row span:last-child {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-main);
  white-space: nowrap;
  line-height: 1;
}

.map-legend-floating .legend-close-btn,
#mapLegendCard .legend-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s ease;
  line-height: 1;
  flex-shrink: 0;
  margin-left: 6px;
}

.map-legend-floating .legend-close-btn:hover,
#mapLegendCard .legend-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
}

@media (max-width: 1200px) {
  .map-legend-floating,
  #mapLegendCard {
    max-width: calc(100vw - 220px);
  }
}

@media (max-width: 768px) {
  .map-legend-floating {
    top: calc(max(12px, env(safe-area-inset-top)) + 44px + 8px);
    max-width: calc(100vw - 24px);
    height: 36px;
    padding: 0 6px 0 10px;
    gap: 8px;
  }
  .map-legend-floating .legend-items {
    gap: 10px;
  }
  .map-legend-floating .sw {
    width: 18px;
    height: 9px;
  }
  .map-legend-floating .sw-label,
  .map-legend-floating .mk-row span:last-child {
    font-size: 10px;
  }
  .map-legend-floating .legend-close-btn {
    width: 18px;
    height: 18px;
    font-size: 9px;
  }
}

/* --------------------------------------------------------------------------
   Right-Center: Floor Control Capsule (Squircle, Satellite Mode Only)
   -------------------------------------------------------------------------- */
.floor-control-capsule {
  position: absolute;
  top: 50%;
  right: max(16px, env(safe-area-inset-right));
  transform: translateY(-50%);
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px;
  border-radius: var(--radius-squircle);
  width: 48px;
  gap: 8px;
  z-index: 300;
  overflow: visible !important;
}

body.satellite-active .floor-control-capsule {
  display: flex;
}

.floor-btn {
  width: 38px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.floor-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.floor-badge {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: var(--accent-orange);
  text-shadow: 0 0 12px var(--accent-orange-glow);
  min-height: 24px;
  min-width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  border-radius: 7px;
  padding: 2px 4px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.floor-badge:hover,
.floor-badge.menu-active {
  background: rgba(249, 115, 22, 0.18);
  border-color: rgba(249, 115, 22, 0.5);
  box-shadow: 0 0 14px rgba(249, 115, 22, 0.35);
  transform: scale(1.08);
}

/* Dynamic color shift when in basement levels */
.floor-badge.basement-level {
  color: var(--accent-basement) !important;
  text-shadow: 0 0 14px var(--accent-basement-glow) !important;
}

.floor-divider {
  width: 26px;
  height: 1px;
  background: var(--glass-border);
}

.floor-btn-all {
  width: 38px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 9.5px;
  letter-spacing: -0.2px;
  white-space: nowrap;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.floor-btn-all:hover, .floor-btn-all.active {
  background: rgba(249, 115, 22, 0.2);
  border-color: var(--accent-orange);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Left-Opening Floor Picker Dropdown Menu
   -------------------------------------------------------------------------- */
.floor-dropdown-menu {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(12px) scale(0.96);
  width: 254px;
  border-radius: var(--radius-squircle, 16px);
  background: linear-gradient(135deg, rgba(20, 24, 32, 0.97) 0%, rgba(12, 15, 22, 0.99) 100%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), 0 0 24px rgba(0, 0, 0, 0.4);
  display: none;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s var(--ease-smooth);
  z-index: 600;
  overflow: hidden;
}

.floor-dropdown-menu.open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0) scale(1);
}

.floor-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.floor-dropdown-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.floor-dropdown-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}

.floor-dropdown-count {
  font-family: 'Inter', sans-serif;
  font-size: 9.5px;
  color: var(--text-dim);
  font-weight: 500;
}

.floor-dropdown-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-dim);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
  transition: all 0.15s ease;
}

.floor-dropdown-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.floor-dropdown-list {
  padding: 6px 9px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: visible;
}

.floor-grid-label {
  font-family: 'Inter', sans-serif;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 2px 1px;
  user-select: none;
}

.floor-chip-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3.5px;
}

.floor-chip {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  transition: all 0.12s ease;
  letter-spacing: 0.1px;
}

/* Ground Floor Row */
.floor-ground-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0;
}

.floor-ground-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.35), transparent);
}

.floor-chip-ground-prominent {
  min-width: 52px;
  height: 24px;
  font-size: 11px;
  letter-spacing: 0.3px;
}

/* Color Coding for Chips */
.floor-chip.chip-all {
  background: rgba(168, 85, 247, 0.16);
  border-color: rgba(168, 85, 247, 0.4);
  color: #c084fc;
}

.floor-chip.chip-all:hover {
  background: rgba(168, 85, 247, 0.32);
  border-color: #c084fc;
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.45);
}

.floor-chip.chip-upper {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.3);
  color: #38bdf8;
}

.floor-chip.chip-upper:hover {
  background: rgba(14, 165, 233, 0.26);
  border-color: #38bdf8;
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.4);
}

.floor-chip.chip-ground {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.floor-chip.chip-ground:hover {
  background: rgba(16, 185, 129, 0.32);
  border-color: #34d399;
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.45);
}

.floor-chip.chip-basement {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.floor-chip.chip-basement:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: #f87171;
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.floor-chip.chip-deep-basement {
  background: rgba(185, 28, 28, 0.22);
  border-color: rgba(220, 38, 38, 0.45);
  color: #fca5a5;
}

.floor-chip.chip-deep-basement:hover {
  background: rgba(185, 28, 28, 0.38);
  border-color: #fca5a5;
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.5);
}

/* Active Highlight States */
.floor-chip.active {
  border-color: #fff !important;
  color: #fff !important;
  font-weight: 800;
  transform: scale(1.08);
  z-index: 2;
}

.floor-chip.chip-all.active {
  background: rgba(168, 85, 247, 0.5) !important;
  border-color: #e9d5ff !important;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.65) !important;
}

.floor-chip.chip-ground.active {
  background: rgba(16, 185, 129, 0.5) !important;
  border-color: #a7f3d0 !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.65) !important;
}

.floor-chip.chip-upper.active {
  background: rgba(14, 165, 233, 0.45) !important;
  border-color: #bae6fd !important;
  box-shadow: 0 0 14px rgba(14, 165, 233, 0.65) !important;
}

.floor-chip.chip-basement.active,
.floor-chip.chip-deep-basement.active {
  background: rgba(239, 68, 68, 0.45) !important;
  border-color: #fecaca !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.65) !important;
}


/* --------------------------------------------------------------------------
   Bottom-Right: Zoom Controls Capsule & Fit Whole Map Button
   -------------------------------------------------------------------------- */
.bottom-right-bar {
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  right: max(16px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  z-index: 20;
}

.zoom-controls-capsule {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 10px;
  padding: 3px;
  width: 40px;
  box-sizing: border-box;
  gap: 2px;
}

.zoom-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: var(--text-main);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 7px;
  transition: all 0.15s ease;
}

.zoom-btn:hover {
  background: rgba(249, 115, 22, 0.18);
  color: var(--accent-orange);
}

.zoom-btn:active {
  transform: scale(0.92);
}

.zoom-divider {
  width: 22px;
  height: 1px;
  background: var(--glass-border);
  margin: 1px 0;
}

/* Square Fit Map Button (Icon-Only, 40x40px matching zoom capsule and top-right buttons) */
.fit-map-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--accent-orange);
  transition: all 0.2s var(--ease-smooth);
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 0;
}

.fit-map-btn:hover {
  border-color: rgba(249, 115, 22, 0.55);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 14px var(--accent-orange-glow);
  transform: translateY(-1px);
  color: #fff;
}

.fit-map-btn:active {
  transform: scale(0.95);
}

.fit-map-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}


/* --------------------------------------------------------------------------
   Unified Right-Click Context Menu (Matches Satellite View Exactly)
   -------------------------------------------------------------------------- */
.context-menu {
  position: fixed;
  z-index: 1200;
  background: var(--panel, #111318f0);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.22));
  min-width: 190px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65);
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  animation: fadeInPop 0.12s var(--ease-smooth);
}

.context-coords {
  color: #9aa0a8;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 4px;
  padding: 6px 10px 8px;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Inter', -apple-system, sans-serif;
  letter-spacing: 0.3px;
}

.context-menu button {
  width: 100%;
  color: #e8eaed;
  text-align: left;
  cursor: pointer;
  background: transparent;
  border: none;
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 500;
  display: block;
  transition: background 0.12s ease, color 0.12s ease;
}

.context-menu button:hover {
  background: rgba(199, 62, 62, 0.22);
  color: #ffffff;
}

.context-menu button:active {
  transform: scale(0.98);
}

/* 2D Measuring Tool Overlay & Tip */
.measure-overlay-2d {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none !important;
  z-index: 1250;
}

.measure-tip-2d {
  position: fixed;
  z-index: 1300;
  background: rgba(14, 22, 33, 0.94);
  color: #4bc0c0;
  border: 1px solid #4bc0c0;
  font-weight: 700;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 7px;
  pointer-events: none;
  font-family: 'Inter', -apple-system, sans-serif;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  animation: fadeInPop 0.1s var(--ease-smooth);
}

/* --------------------------------------------------------------------------
   Unified Right-Click Context Menu
   -------------------------------------------------------------------------- */
.context-menu {
  position: absolute;
  z-index: 1200;
  background: var(--glass, rgba(14, 18, 28, 0.88));
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.16));
  border-radius: var(--radius-squircle, 12px);
  padding: 6px;
  min-width: 195px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.context-coords {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-muted, #b0b8c4);
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 4px;
  padding: 6px 8px 7px 10px;
  font-size: 12px;
  font-weight: 700;
}

.context-coords-text {
  flex: 1;
  white-space: nowrap;
  color: var(--accent-orange, #f97316);
}

.ctx-header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.context-menu .ctx-icon-btn,
.ctx-save-icon-btn,
.ctx-link-icon-btn {
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  max-width: 26px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 7px !important;
  color: var(--text-muted, #b0b8c4) !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  transition: all 0.16s ease !important;
}

.context-menu .ctx-icon-btn svg,
.ctx-save-icon-btn svg,
.ctx-link-icon-btn svg {
  display: block !important;
  pointer-events: none !important;
}

.context-menu .ctx-link-icon-btn:hover {
  background: rgba(56, 189, 248, 0.22) !important;
  border-color: rgba(56, 189, 248, 0.65) !important;
  color: #38bdf8 !important;
  transform: translateY(-1px) scale(1.06) !important;
  box-shadow: 0 3px 10px rgba(56, 189, 248, 0.3) !important;
}

.context-menu .ctx-save-icon-btn:hover {
  background: rgba(249, 115, 22, 0.22) !important;
  border-color: rgba(249, 115, 22, 0.65) !important;
  color: #f97316 !important;
  transform: translateY(-1px) scale(1.06) !important;
  box-shadow: 0 3px 10px rgba(249, 115, 22, 0.3) !important;
}

.context-menu .ctx-icon-btn:active {
  transform: translateY(0) scale(0.95) !important;
}

.context-menu button:not(.ctx-icon-btn):not(.ctx-save-icon-btn):not(.ctx-link-icon-btn) {
  width: 100%;
  color: var(--text-main, #e2e8f0);
  text-align: left;
  cursor: pointer;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.context-menu button:not(.ctx-icon-btn):not(.ctx-save-icon-btn):not(.ctx-link-icon-btn):hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: translateX(2px);
}

/* --------------------------------------------------------------------------
   Floating Save Location Drawer (Positioned at bottom-right of sidebar)
   -------------------------------------------------------------------------- */
.save-location-drawer {
  position: fixed;
  pointer-events: auto !important;
  left: calc(max(16px, env(safe-area-inset-left)) + 300px + 10px);
  bottom: max(16px, env(safe-area-inset-bottom));
  width: 270px;
  max-width: calc(100vw - 32px);
  border-radius: var(--radius-squircle, 12px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 100%), var(--glass, rgba(14, 18, 28, 0.88));
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.16));
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  z-index: 120;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: saveDrawerIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, left 0.28s ease;
}

.save-location-drawer * {
  pointer-events: auto;
}

body:not(.sidebar-open) .save-location-drawer {
  left: max(16px, env(safe-area-inset-left));
}

@media (max-width: 1360px) {
  .save-location-drawer {
    bottom: 64px; /* Elevates above the bottom-center coordinate floater */
  }
}

@media (max-width: 768px) {
  .save-location-drawer {
    left: 14px !important;
    right: 14px !important;
    width: auto !important;
    bottom: 64px !important;
  }
}

@keyframes saveDrawerIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.save-drawer-inner {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.save-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.save-drawer-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.save-drawer-glow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-orange);
  box-shadow: 0 0 8px var(--accent-orange-glow);
}

.save-drawer-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.2px;
}

.save-drawer-close-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.save-drawer-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.save-drawer-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.save-coords-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 10px;
}

.save-coords-pin {
  color: var(--accent-orange);
  display: flex;
  align-items: center;
}

.save-coords-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-orange);
  flex: 1;
}

.save-floor-tag {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 4px;
}

.save-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.save-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

.save-input-wrap {
  position: relative;
  width: 100%;
}

.save-input {
  width: 100%;
  height: 34px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  padding: 0 10px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  transition: all 0.18s ease;
  user-select: text;
}

.save-input:focus {
  outline: none;
  border-color: var(--accent-orange);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.25);
}

.save-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* Save Textarea */
.save-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  padding: 8px 10px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
  min-height: 54px;
  transition: all 0.18s ease;
  user-select: text;
}

.save-textarea:focus {
  outline: none;
  border-color: var(--accent-orange);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.25);
}

.save-textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* Icon Dropdown Menu */
.icon-dropdown-wrap {
  position: relative;
  width: 100%;
}

.icon-dropdown-trigger {
  width: 100%;
  height: 38px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.icon-dropdown-trigger:hover,
.icon-dropdown-wrap.open .icon-dropdown-trigger {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
}

.icon-dropdown-preview {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.icon-preview-badge {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-preview-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-dropdown-chevron {
  color: var(--text-dim);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.icon-dropdown-wrap.open .icon-dropdown-chevron {
  transform: rotate(180deg);
}

.icon-dropdown-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: rgba(18, 22, 28, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 0, 0, 0.5);
  max-height: 200px;
  overflow-y: auto;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 3px;
  z-index: 100;
}

.icon-dropdown-wrap.open .icon-dropdown-menu {
  display: flex;
}

.icon-dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-dropdown-item:hover,
.icon-dropdown-item.active {
  background: rgba(255, 255, 255, 0.09);
}

.icon-dropdown-item.active {
  border: 1px solid rgba(249, 115, 22, 0.35);
}

.icon-item-label {
  font-size: 12px;
  color: var(--text-main);
  font-weight: 500;
}

.save-drawer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 4px;
}

.save-btn-sec {
  height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.save-btn-sec:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.save-btn-pri {
  height: 30px;
  padding: 0 14px;
  border-radius: 6px;
  background: var(--accent-orange);
  border: none;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 0 10px var(--accent-orange-glow);
  transition: all 0.18s ease;
}

.save-btn-pri:hover {
  background: var(--accent-orange-hover);
  box-shadow: 0 0 14px var(--accent-orange-glow);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Saved Places Section in Sidebar
   -------------------------------------------------------------------------- */
.saved-places-actions-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 0 2px;
}

.saved-action-btn {
  flex: 1;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s var(--ease-smooth);
}

.saved-action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.saved-action-btn.add-btn:hover {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
  background: rgba(249, 115, 22, 0.12);
}

.saved-action-btn.edit-btn.active {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.saved-places-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.saved-loc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 8px 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s var(--ease-smooth);
  position: relative;
  overflow: hidden;
}

.saved-loc-row:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateX(2px);
}

.saved-loc-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.saved-loc-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.3);
  color: var(--accent-orange);
  flex-shrink: 0;
}

.saved-loc-icon.home, .icon-preview-badge.home {
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.3);
  color: var(--accent-orange);
}

.saved-loc-icon.loot, .icon-preview-badge.loot {
  background: rgba(91, 141, 217, 0.15);
  border: 1px solid rgba(91, 141, 217, 0.3);
  color: #60a5fa;
}

.saved-loc-icon.weapon, .icon-preview-badge.weapon {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.saved-loc-icon.gas, .icon-preview-badge.gas {
  background: rgba(224, 123, 57, 0.15);
  border: 1px solid rgba(224, 123, 57, 0.3);
  color: #fb923c;
}

.saved-loc-icon.medical, .icon-preview-badge.medical {
  background: rgba(75, 192, 192, 0.15);
  border: 1px solid rgba(75, 192, 192, 0.3);
  color: #34d399;
}

.saved-loc-icon.vehicle, .icon-preview-badge.vehicle {
  background: rgba(147, 197, 253, 0.15);
  border: 1px solid rgba(147, 197, 253, 0.3);
  color: #93c5fd;
}

.saved-loc-icon.food, .icon-preview-badge.food {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.saved-loc-icon.water, .icon-preview-badge.water {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}

.saved-loc-icon.generator, .icon-preview-badge.generator {
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.3);
  color: #facc15;
}

.saved-loc-icon.tool, .icon-preview-badge.tool {
  background: rgba(167, 139, 250, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.3);
  color: #a78bfa;
}

.saved-loc-icon.danger, .icon-preview-badge.danger {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.saved-loc-icon.star, .icon-preview-badge.star {
  background: rgba(250, 204, 21, 0.18);
  border: 1px solid rgba(250, 204, 21, 0.35);
  color: #facc15;
}

.saved-loc-icon.pin, .icon-preview-badge.pin {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #c084fc;
}

.saved-loc-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.saved-loc-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-loc-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
}

.saved-loc-note {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 2px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.saved-loc-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  flex-shrink: 0;
  margin-left: 6px;
}

.saved-loc-row:hover .saved-loc-actions,
.saved-loc-row.active .saved-loc-actions {
  opacity: 1;
  pointer-events: auto;
}

.saved-loc-action-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.saved-loc-action-btn.edit-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #94a3b8;
}

.saved-loc-action-btn.edit-btn:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.45);
  color: #60a5fa;
  transform: scale(1.1);
}

.saved-loc-action-btn.del-btn {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.saved-loc-action-btn.del-btn:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
  transform: scale(1.1);
}

.empty-saved-note {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  padding: 14px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Toast Notification
   -------------------------------------------------------------------------- */
.copy-toast {
  display: none !important;
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(18, 22, 28, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--accent-orange);
  color: #fff;
  padding: 10px 22px;
  border-radius: var(--radius-squircle);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0,0,0,0.6), 0 0 20px var(--accent-orange-glow);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s var(--ease-smooth);
  z-index: 400;
  pointer-events: none !important;
}

.copy-toast.show {
  display: block !important;
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* --------------------------------------------------------------------------
   Floating Bottom-Center Coords Chip HUD (2D Vector Mode)
   -------------------------------------------------------------------------- */
.coords-chip {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.coords-chip .coords-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.2px;
}

.coords-chip .coords-cell {
  color: var(--text-dim);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
}

body.satellite-active .coords-chip {
  display: none !important;
}

@media (hover: none) {
  .coords-chip {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   Saved Location Target Ping Marker (2D Vector Mode)
   -------------------------------------------------------------------------- */
.target-ping-marker {
  position: absolute;
  width: 32px;
  height: 32px;
  margin-left: -16px;
  margin-top: -16px;
  border-radius: 50%;
  border: 3px solid #c73e3e;
  background: rgba(199, 62, 62, 0.22);
  box-shadow: 0 0 18px rgba(199, 62, 62, 0.8), inset 0 0 8px rgba(199, 62, 62, 0.4);
  pointer-events: none;
  z-index: 999;
  animation: targetPingPulse 1.2s ease-out infinite;
  display: none;
}

@keyframes targetPingPulse {
  0% {
    transform: scale(0.85);
    opacity: 1;
  }
  50% {
    transform: scale(1.25);
    opacity: 0.55;
  }
  100% {
    transform: scale(0.85);
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   Animations & Media Queries
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes fadeInPop {
  from { opacity: 0; transform: scale(0.95) translateY(4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Mobile & Touch Layout Adjustments */
@media (max-width: 768px) {
  .site-brand-capsule {
    height: 44px;
    padding: 0 10px 0 8px;
    gap: 8px;
  }
  
  .brand-text {
    font-size: 14px;
  }

  .glass-square-btn {
    width: 40px;
    height: 40px;
  }

  .sidebar-trigger-btn {
    top: calc(12px + 44px + 8px);
    left: 20px;
    width: 32px;
    height: 32px;
  }

  .sidebar-drawer {
    width: calc(100vw - 24px);
    left: 12px;
    top: 12px;
    bottom: 12px;
  }

  .top-right-bar {
    top: 12px;
    right: 12px;
  }

  .layer-toggle-capsule {
    height: 40px;
    min-height: 40px;
  }

  .layer-btn {
    width: 32px;
    height: 32px;
    padding: 0;
  }


  .bottom-right-bar {
    bottom: 12px;
    right: 12px;
  }

  .floor-control-capsule {
    right: 12px;
    width: 42px;
    padding: 8px 3px;
  }

  .floor-btn {
    width: 34px;
    height: 30px;
  }

  .floor-dropdown-menu {
    right: calc(100% + 8px);
    width: 232px;
  }

  .lang-dropdown {
    /* On mobile, open downwards below capsule */
    top: calc(100% + 8px);
    left: auto;
    right: 0;
    transform: translateY(-6px);
  }

  .lang-module.open .lang-dropdown {
    transform: translateY(0);
  }
}

/* =========================================================================
   SATELLITE-ONLY SIDEBAR CONTROLS (Hidden in 2D mode, visible in Satellite mode)
   ========================================================================= */
body:not(.satellite-active) .satellite-only-feature,
body:not(.satellite-active) .satellite-only-section,
body:not(.satellite-active) .satellite-only-divider {
  display: none !important;
}

body.satellite-active .satellite-only-section {
  display: block !important;
}

body.satellite-active .sidebar-divider.satellite-only-divider {
  display: block !important;
}

/* =========================================================================
   2D VECTOR MARKERS OVERLAY (Player Spawns & Vehicle Spawns)
   ========================================================================= */
.vector-markers-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 25;
  overflow: hidden;
}

.vector-map-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  z-index: 30;
  transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease;
}

.vector-map-pin:hover {
  transform: translate(-50%, -108%) scale(1.16);
  z-index: 60;
}

.vector-map-pin .pin-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-solid, #14161b);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-sizing: border-box;
  font-family: inherit;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.15s ease;
}

.vector-map-pin .pin-icon-wrap {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-solid, #14161b);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-sizing: border-box;
  font-family: inherit;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.15s ease;
}

/* Authentic Satellite-Parity Player Spawn Chip */
.vector-map-pin.pin-player-spawn .pin-badge,
.vector-map-pin.pin-player-spawn .pin-icon-wrap {
  background: var(--panel-solid, #14161b);
  color: #4bc0c0;
  border: 2px solid #4bc0c0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.75), 0 0 10px rgba(75, 192, 192, 0.45);
  font-size: 14px;
}

/* Authentic Satellite-Parity Vehicle Spawn Chip */
.vector-map-pin.pin-vehicle-spawn .pin-badge,
.vector-map-pin.pin-vehicle-spawn .pin-icon-wrap {
  background: var(--panel-solid, #14161b);
  color: #5fb0e8;
  border: 2px solid #5fb0e8;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.75), 0 0 10px rgba(95, 176, 232, 0.45);
  font-size: 13px;
}

.vector-map-pin .pin-label,
.vector-map-pin .pin-label-card {
  margin-top: 3px;
  background: rgba(10, 14, 22, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 2px 8px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

.vector-map-pin.pin-player-spawn .pin-label,
.vector-map-pin.pin-player-spawn .pin-label-card {
  border-color: rgba(75, 192, 192, 0.45);
}

.vector-map-pin.pin-vehicle-spawn .pin-label,
.vector-map-pin.pin-vehicle-spawn .pin-label-card {
  border-color: rgba(95, 176, 232, 0.45);
}

/* Sidebar Toggle Icon Styling */
.toggle-icon-wrap {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  box-sizing: border-box;
  transition: transform 0.14s ease;
}

.toggle:hover .toggle-icon-wrap {
  transform: scale(1.1);
}

.toggle-icon-wrap svg {
  display: block;
}
