@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  /* Color Palette - Premium Matte Dark Theme */
  --bg-primary: #0a0c10;      /* Deep Obsidian */
  --bg-card: #151821;         /* Solid Slate Charcoal */
  --bg-input: #1e2330;        /* Slightly lighter background for forms */
  --border-matte: #2a3142;    /* Crisp solid border */
  --text-main: #f9fafb;       /* High-contrast crisp white */
  --text-muted: #9ca3af;      /* Muted secondary gray */
  --text-dark: #111827;       /* Dark text for badges */
  
  /* Status Colors */
  --color-safe: #10b981;      /* Emerald Green */
  --color-warning: #f59e0b;   /* Amber Orange */
  --color-danger: #ef4444;    /* Crimson Red */
  --color-neutral: #4b5563;   /* Slate Gray */

  --font-family: 'Outfit', 'Inter', sans-serif;
  --transition-speed: 0.25s;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* Full-Screen 2D Map Container */
#map-2d-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

/* Force precise bullseye / targeting cursor over the map */
#map-2d-container,
#map-2d-container * {
  cursor: crosshair !important;
}

/* Floating Bottom Dashboard - unified Info Row & Street View */
.bottom-dashboard {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 320px;
  background-color: rgba(21, 24, 33, 0.9); /* More premium, solid-matte dark theme backdrop */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-matte);
  border-left: none;
  border-right: none;
  border-bottom: none;
  border-radius: 16px 16px 0 0; /* Rounded top-only corners for clean docking layout */
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
  pointer-events: auto;
  box-sizing: border-box;
}

/* Unified Horizontal Info Row on top of Street View */
.info-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* Symmetrical absolute grid centering */
  align-items: center;
  height: 60px;
  min-height: 60px;
  border-bottom: 1px solid var(--border-matte);
  padding: 0 20px;
  box-sizing: border-box;
  background-color: rgba(10, 12, 16, 0.4);
}

/* Info cells inside the single-row dashboard */
.info-cell {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.info-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

#bottom-clearance-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.06em;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.info-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.info-value.highlight {
  font-size: 1.15rem;
  color: var(--color-safe); /* Default safe color, dynamically adjusted in JS */
}

.clearance-val-container {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.info-unit {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Custom Status Dot and Text Cell */
.status-cell {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-matte);
  border-radius: 30px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-speed);
}

.status-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--text-muted); /* Neutral grey dot */
  display: inline-block;
}

.status-text-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Status colors map to the dot and badge border */
.status-cell.safe {
  border-color: rgba(16, 185, 129, 0.5);
  background-color: rgba(16, 185, 129, 0.1);
}
.status-cell.safe .status-indicator-dot {
  background-color: var(--color-safe) !important;
}

.status-cell.warning {
  border-color: rgba(245, 158, 11, 0.5);
  background-color: rgba(245, 158, 11, 0.1);
}
.status-cell.warning .status-indicator-dot {
  background-color: var(--color-warning) !important;
}

.status-cell.danger {
  border-color: rgba(239, 68, 68, 0.5);
  background-color: rgba(239, 68, 68, 0.1);
}
.status-cell.danger .status-indicator-dot {
  background-color: var(--color-danger) !important;
}

.status-cell.unknown {
  border-color: rgba(156, 163, 175, 0.35) !important;
  background-color: rgba(156, 163, 175, 0.08) !important;
}
.status-cell.unknown .status-indicator-dot {
  background-color: #6b7280 !important;
  box-shadow: 0 0 6px rgba(107, 114, 128, 0.5);
}
.status-cell.unknown .info-label {
  color: var(--text-muted) !important;
}
.status-cell.unknown .info-value {
  color: var(--text-muted) !important;
}

/* Style info-label and info-value inside any status-cell */
.status-cell .info-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.05em;
  margin: 0;
}

.status-cell .info-value {
  font-weight: 700;
  font-size: 1.15rem;
}

/* Shoulder display group containing the cards and road perspective */
.shoulder-display-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Symmetrical telemetry layout groups inside bottom dashboard */
.route-mp-group {
  display: flex;
  align-items: center;
  gap: 24px;
  justify-self: start; /* Bulletproof grid alignment to the far left */
}

.route-mp-group .info-cell {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.route-mp-group .info-label {
  font-size: 0.85rem; /* Reduced size */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.route-mp-group .info-value.large {
  font-size: 1.0rem; /* Reduced size */
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.01em;
}

/* Central prominent placement and wider card proportions */
.shoulder-display-group.central {
  display: flex;
  align-items: center;
  gap: 18px; /* Spacious separation around 3D road perspective */
  justify-self: center; /* Absolute mathematical viewport centering */
}

.status-cell.wide-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  padding: 4px 18px !important; /* Tightened padding for crisp vertical stack inside 60px row */
  min-width: 220px; /* Fits fully spelled-out Left Shoulder and Right Shoulder text */
  box-sizing: border-box;
}

.status-header-row {
  display: flex;
  align-items: center;
  gap: 8px; /* Clean spacing between safety dot and label */
}

.status-cell.wide-cell .info-label {
  font-size: 1.0rem; /* Increased relative to route info */
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-cell.wide-cell .info-value {
  font-family: var(--font-family); /* Explicitly match font family */
  font-size: 1.4rem; /* Increased size for prominence */
  font-weight: 700;
  letter-spacing: 0.01em;
}

.clearance-val-container {
  padding-left: 16px; /* Precision alignment directly below start of the label text */
  display: flex;
  align-items: baseline;
  gap: 4px;
}

/* Far Right Grouping */
.source-close-group {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-self: end; /* Bulletproof grid alignment to the far right */
}

/* 3D Road Perspective Visual Divider */
.road-perspective-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 40px;
  perspective: 100px; /* Essential for 3D depth perception */
  position: relative;
}

.perspective-road {
  width: 36px;
  height: 32px;
  background: #111827; /* Deep asphalt slate */
  border-left: 2px solid rgba(255, 255, 255, 0.5); /* Crisp white solid left shoulder line */
  border-right: 2px solid rgba(255, 255, 255, 0.5); /* Crisp white solid right shoulder line */
  transform: rotateX(45deg); /* Angle back into 3D horizon */
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8), 0 4px 10px rgba(0, 0, 0, 0.4);
  border-radius: 3px;
}

.road-dashed-line {
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 100%;
  border-left: 2px dashed rgba(255, 255, 255, 0.6); /* Static, crisp white center lane line */
  transform: translateX(-50%);
}

/* Close Button on the top right of Street View */
.streetview-close-btn-bottom {
  background: rgba(10, 12, 16, 0.6);
  color: var(--text-main);
  border: 1px solid var(--border-matte);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed);
}

.streetview-close-btn-bottom:hover {
  background-color: var(--color-danger);
  border-color: var(--color-danger);
  color: white;
}

/* Floating Autocomplete Search Box */
.search-hud {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 10;
  width: 360px;
  pointer-events: auto;
}

/* Custom styled search card around the autocomplete element */
.search-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-matte);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.search-card h3 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Custom styled standard search input */
.search-input {
  width: 100%;
  background-color: var(--bg-input);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.9rem;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-matte);
  box-sizing: border-box;
  outline: none;
  transition: border-color var(--transition-speed);
}

.search-input:focus {
  border-color: var(--color-safe);
}

/* Vertical Right Sidebar HUD Dock - Floating Premium HUD Card */
.console-dock {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 320px;
  height: auto;
  max-height: calc(100vh - 48px);
  background-color: rgba(21, 24, 33, 0.85); /* Semi-transparent charcoal card */
  backdrop-filter: blur(12px);                 /* State-of-the-art frosted glass look! */
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-matte);
  border-radius: 16px;
  z-index: 10;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  gap: 24px;
  pointer-events: auto;
  box-sizing: border-box;
  overflow-y: auto;
}

/* Individual Columns inside Vertical Sidebar Dock */
.console-column {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: auto;
  box-sizing: border-box;
}

.brand-col {
  gap: 6px;
}


/* Header Branding */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.brand-icon {
  width: 24px;
  height: 24px;
  background-color: var(--color-safe);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--bg-primary);
}

.sidebar-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.sidebar-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Compact Credentials Button styling */
.config-btn {
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-matte);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-top: 12px;
  transition: background-color var(--transition-speed);
}

.config-btn:hover {
  background-color: var(--border-matte);
}

/* Configuration Slide-Out Panel from Right Sidebar */
.config-drawer {
  position: absolute;
  top: 24px;
  right: -340px; /* Start hidden to the right */
  width: 300px;
  height: auto;
  max-height: calc(100vh - 48px);
  background-color: rgba(21, 24, 33, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-matte);
  border-radius: 16px;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  padding: 20px;
  z-index: 20;
  transition: right var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.config-drawer.active {
  right: 360px; /* Slides out perfectly to the left of the 320px floating sidebar with a 16px gap! */
}

/* Matte Status Card */
.status-card {
  border-radius: 8px;
  border: 1px solid var(--border-matte);
  overflow: hidden;
  transition: border-color var(--transition-speed);
}

.status-header {
  padding: 16px;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dark);
  background-color: var(--color-neutral);
  transition: background-color var(--transition-speed);
}

.status-body {
  padding: 16px;
  background-color: var(--bg-input);
  text-align: center;
}

.status-description {
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.4;
}

/* Status variants */
.status-card.safe { border-color: var(--color-safe); }
.status-card.safe .status-header { background-color: var(--color-safe); color: var(--bg-primary); }

.status-card.warning { border-color: var(--color-warning); }
.status-card.warning .status-header { background-color: var(--color-warning); color: var(--bg-primary); }

.status-card.danger { border-color: var(--color-danger); }
.status-card.danger .status-header { background-color: var(--color-danger); color: var(--text-main); }

.status-card.unknown { border-color: var(--text-main); }
.status-card.unknown .status-header { background-color: var(--text-main); color: var(--bg-primary); }

.status-card.neutral { border-color: var(--border-matte); }
.status-card.neutral .status-header { background-color: var(--color-neutral); color: var(--text-main); }

/* Controls Section */
.controls-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.control-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Custom Matte Segmented Switch for Breakdown Side */
.segmented-control {
  display: flex;
  background-color: var(--bg-input);
  border: 1px solid var(--border-matte);
  border-radius: 6px;
  overflow: hidden;
  padding: 3px;
}

@keyframes active-pop {
  0% { transform: scale(0.92); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1.0); }
}

.segmented-option {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--transition-speed);
  user-select: none;
}

.segmented-option:hover:not(.active) {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.05);
}

.segmented-option:active {
  transform: scale(0.95);
}

.segmented-option.active {
  background-color: #4f46e5;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.45);
  animation: active-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes flash-recalc-pulse {
  0% { transform: scale(0.94); filter: brightness(1.5); }
  50% { transform: scale(1.06); filter: brightness(1.2); }
  100% { transform: scale(1.0); filter: brightness(1.0); }
}

.flash-recalc {
  animation: flash-recalc-pulse 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Custom Switch Toggle for Guardrail */
.switch-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-input);
  border: 1px solid var(--border-matte);
  border-radius: 6px;
  padding: 12px;
}

.switch-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.switch-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
}

.switch-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.switch-input {
  display: none;
}

.switch-slider {
  width: 44px;
  height: 24px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-matte);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.switch-slider::before {
  content: '';
  width: 16px;
  height: 16px;
  background-color: var(--text-muted);
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform var(--transition-speed), background-color var(--transition-speed);
}

.switch-input:checked + .switch-slider {
  background-color: var(--color-danger);
}

.switch-input:checked + .switch-slider::before {
  transform: translateX(20px);
  background-color: var(--text-main);
}

/* Segment Specifications Panel */
.specs-panel {
  background-color: var(--bg-input);
  border: 1px solid var(--border-matte);
  border-radius: 8px;
  padding: 16px;
}

.specs-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.source-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 700;
  background-color: var(--border-matte);
  color: var(--text-main);
  text-transform: uppercase;
}

.source-badge.live {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border-matte);
}

.source-badge.none {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border-matte);
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.spec-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.spec-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.spec-full-width {
  grid-column: span 2;
  border-top: 1px solid var(--border-matte);
  padding-top: 8px;
  margin-top: 4px;
}

/* Advanced Configuration Accordion */
.accordion {
  border: 1px solid var(--border-matte);
  border-radius: 8px;
  overflow: hidden;
}

.accordion-header {
  background-color: var(--bg-input);
  padding: 12px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.accordion-header::after {
  content: '▼';
  font-size: 0.65rem;
  transition: transform var(--transition-speed);
}

.accordion.open .accordion-header::after {
  transform: rotate(180deg);
}

.accordion-content {
  display: none;
  padding: 16px;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-matte);
  flex-direction: column;
  gap: 12px;
}

.accordion.open .accordion-content {
  display: flex;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form-input {
  background-color: var(--bg-input);
  border: 1px solid var(--border-matte);
  border-radius: 4px;
  padding: 8px 12px;
  font-family: var(--font-family);
  font-size: 0.8rem;
  color: var(--text-main);
  width: 100%;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-safe);
}

.btn-primary {
  background-color: var(--color-safe);
  color: var(--bg-primary);
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.btn-primary:hover {
  background-color: #34d399;
}

/* Custom Cursor-Linked Side Selection Popup/Modal */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  background-color: rgba(0, 0, 0, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-matte);
  border-radius: 8px;
  width: 320px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  padding: 16px;
  animation: modalReveal 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalReveal {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-main);
  text-align: center;
}

.modal-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 16px;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-modal {
  background-color: var(--bg-input);
  border: 1px solid var(--border-matte);
  border-radius: 6px;
  padding: 10px 14px;
  font-family: var(--font-family);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-speed);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-modal::after {
  content: '→';
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform var(--transition-speed);
}

.btn-modal:hover {
  background-color: var(--border-matte);
  border-color: var(--text-muted);
}

.btn-modal:hover::after {
  transform: translateX(4px);
  color: var(--text-main);
}

/* Quick Loading spinner */
.loader-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(10, 12, 16, 0.7);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-matte);
  border-top-color: var(--color-safe);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
}

/* Welcome Overlay when no API key is entered */
.welcome-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-primary);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.welcome-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-matte);
  border-radius: 12px;
  max-width: 480px;
  width: 100%;
  padding: 32px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.welcome-card-header {
  text-align: center;
}

.welcome-logo {
  width: 48px;
  height: 48px;
  background-color: var(--color-safe);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--bg-primary);
  margin-bottom: 12px;
}

.welcome-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.welcome-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.welcome-help {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  border-top: 1px solid var(--border-matte);
  padding-top: 12px;
}

/* Premium CDN Rate-Limit Warning Banner inside Street View Frame */
.pano-cdn-warning {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(20, 24, 35, 0.96);
  border: 1px solid var(--border-matte);
  border-left: 4px solid var(--color-warning);
  border-radius: 8px;
  padding: 10px 16px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: calc(100% - 48px);
  max-width: 680px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85);
  pointer-events: auto;
  z-index: 100;
  box-sizing: border-box;
}

.pano-cdn-warning .warning-icon {
  color: var(--color-warning);
  font-size: 1.25rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pano-cdn-warning .warning-text {
  color: var(--text-main);
  font-size: 0.75rem;
  line-height: 1.4;
  font-family: var(--font-body);
}

/* Floating Map Basemap Toggle Button */
.basemap-toggle-btn {
  position: absolute;
  bottom: 24px; /* Default bottom-right positioning */
  right: 24px;
  z-index: 50; /* Sits above searchHUD and other overlays gracefully */
  background: rgba(10, 12, 16, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-matte);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-speed); /* Dynamic smooth sliding! */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  user-select: none;
}

/* Slide smoothly above the 320px bottom-dashboard when open */
.basemap-toggle-btn.dashboard-active {
  bottom: 344px; /* 320px dashboard height + 24px margin */
}

.basemap-toggle-btn:hover {
  background: rgba(15, 18, 25, 0.95);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.basemap-toggle-btn:active {
  transform: translateY(1px);
}

.basemap-toggle-btn.active-satellite {
  background: rgba(79, 70, 229, 0.9); /* Premium Indigo highlight when Satellite is active */
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 15px rgba(79, 70, 229, 0.4);
}

.basemap-toggle-btn.active-satellite:hover {
  background: rgba(79, 70, 229, 1.0);
}

.basemap-toggle-btn .basemap-icon-svg {
  color: var(--text-main);
  transition: transform var(--transition-speed);
}

.basemap-toggle-btn:hover .basemap-icon-svg {
  transform: scale(1.1);
}

.basemap-toggle-btn .basemap-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-main);
  font-family: var(--font-body);
}
