/* ==========================================================================
   AriaMaps (آریا مپ) - Modern Map Style System & WebGPU Accelerated Theme
   ========================================================================== */

:root {
  --primary-color: #1a73e8;
  --primary-hover: #1557b0;
  --primary-bg-light: #e8f0fe;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-muted: #70757a;
  --surface-bg: #ffffff;
  --surface-border: #dadce0;
  --surface-elevated: #ffffff;
  --traffic-fast: #188038;
  --traffic-med: #e37400;
  --traffic-slow: #d93025;
  --hud-bg-dark: #137333;
  --hud-bg-bottom: #202124;
  --shadow-1: 0 1px 2px rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  --shadow-2: 0 2px 6px rgba(60,64,67,0.3), 0 1px 2px rgba(60,64,67,0.15);
  --shadow-3: 0 4px 12px rgba(60,64,67,0.25);
  --font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-round: 24px;
  --radius-full: 9999px;
  --z-map: 1;
  --z-webgpu: 2;
  --z-controls: 10;
  --z-panels: 20;
  --z-hud: 30;
  --z-modal: 40;
  --z-toast: 50;
}

/* Complete Dark Theme Design Tokens */
[data-theme="dark"] {
  --primary-color: #8ab4f8;
  --primary-hover: #aecbfa;
  --primary-bg-light: #1f3760;
  --text-primary: #e8eaed;
  --text-secondary: #9aa0a6;
  --text-muted: #80868b;
  --surface-bg: #202124;
  --surface-border: #3c4043;
  --surface-elevated: #2d2e30;
  --shadow-1: 0 1px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.4);
  --shadow-2: 0 2px 6px rgba(0,0,0,0.6);
  --shadow-3: 0 4px 12px rgba(0,0,0,0.7);
}

[data-theme="dark"] body,
[data-theme="dark"] html {
  background-color: #121212;
  color: var(--text-primary);
}

/* Accessibility: Focus Ring */
:focus-visible {
  outline: 2px solid var(--primary-color) !important;
  outline-offset: 2px !important;
}

/* Accessibility: Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* RTL Support */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-family);
  background-color: #e5e3df;
  color: var(--text-primary);
  user-select: none;
}

/* App Container */
.app-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Map Container */
.map-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-map);
}

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

/* Hide standard MapLibre default controls */
.maplibregl-ctrl-bottom-right,
.maplibregl-ctrl-bottom-left {
  display: none !important;
}

/* WebGPU High-Performance Canvas Overlay */
.webgpu-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: var(--z-webgpu);
}

/* --------------------------------------------------------------------------
   Floating Panels & Common Components
   -------------------------------------------------------------------------- */
.floating-panel {
  position: absolute;
  z-index: var(--z-panels);
  transition: transform 0.25s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.2s ease;
}

.top-left-panel {
  top: 12px;
  left: 12px;
  width: 392px;
  max-width: calc(100vw - 24px);
}

[dir="rtl"] .top-left-panel {
  left: auto;
  right: 12px;
}

.hidden {
  display: none !important;
}

/* Buttons & Icons */
.icon-btn {
  background: transparent;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background-color 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.icon-btn:hover {
  background-color: rgba(60,64,67,0.08);
  color: var(--text-primary);
}

.icon-btn.blue-icon {
  color: var(--primary-color);
}

.icon-btn.blue-icon:hover {
  background-color: var(--primary-bg-light);
}

.search-primary-btn {
  color: var(--primary-color);
}

.shadow-btn {
  background: var(--surface-bg);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: box-shadow 0.2s ease, background 0.15s ease, transform 0.1s ease;
}

.shadow-btn:hover {
  box-shadow: var(--shadow-2);
  background-color: #f8f9fa;
}

.shadow-btn:active {
  transform: scale(0.97);
}

/* --------------------------------------------------------------------------
   Top Search Box
   -------------------------------------------------------------------------- */
.search-box-card {
  display: flex;
  align-items: center;
  background: var(--surface-bg);
  height: 48px;
  border-radius: var(--radius-round);
  box-shadow: var(--shadow-2);
  padding: 0 8px;
  transition: box-shadow 0.2s ease, border-radius 0.2s ease;
}

.search-box-card:focus-within {
  box-shadow: var(--shadow-3);
}

.search-input-wrapper {
  flex: 1;
  padding: 0 6px;
  overflow: hidden;
}

.search-input-wrapper input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  background: transparent;
}

.search-input-wrapper input::placeholder {
  color: var(--text-muted);
}

.search-divider {
  width: 1px;
  height: 24px;
  background-color: var(--surface-border);
  margin: 0 4px;
}

/* --------------------------------------------------------------------------
   Autocomplete Dropdown
   -------------------------------------------------------------------------- */
.search-dropdown {
  background: var(--surface-bg);
  margin-top: 4px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  max-height: 380px;
  overflow-y: auto;
  padding: 8px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  gap: 14px;
}

.dropdown-item:hover {
  background-color: #f1f3f4;
}

.dropdown-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f3f4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.dropdown-item-details {
  flex: 1;
  min-width: 0;
}

.dropdown-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-item-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.item-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 12px;
  margin-right: 6px;
  vertical-align: middle;
}

.tag-intersection {
  background: rgba(147, 51, 234, 0.12);
  color: #7e22ce;
  border: 1px solid rgba(147, 51, 234, 0.25);
}

.tag-plate {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* --------------------------------------------------------------------------
   Category Chips Bar
   -------------------------------------------------------------------------- */
.category-chips-bar {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding: 2px 2px 8px 2px;
  scrollbar-width: none;
}

.category-chips-bar::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(60,64,67,0.15);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  flex-shrink: 0;
}

.chip:hover {
  background-color: #f8f9fa;
  box-shadow: var(--shadow-1);
}

.chip:active {
  transform: scale(0.96);
}

.chip.active {
  background-color: var(--primary-bg-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* --------------------------------------------------------------------------
   Directions Panel
   -------------------------------------------------------------------------- */
.directions-panel {
  top: 12px;
  left: 12px;
  width: 392px;
  max-width: calc(100vw - 24px);
  background: var(--surface-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

[dir="rtl"] .directions-panel {
  left: auto;
  right: 12px;
}

.directions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #f1f3f4;
}

.directions-modes {
  display: flex;
  gap: 4px;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-round);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.mode-btn:hover {
  background: rgba(60,64,67,0.06);
}

.mode-btn.active {
  background: var(--primary-bg-light);
  color: var(--primary-color);
}

.directions-inputs {
  display: flex;
  padding: 12px;
  gap: 10px;
}

.input-pins {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 12px;
  width: 18px;
}

.pin-origin {
  width: 10px;
  height: 10px;
  border: 2.5px solid var(--text-secondary);
  border-radius: 50%;
}

.pin-dots {
  width: 2px;
  height: 22px;
  border-left: 2px dotted #bdc1c6;
  margin: 4px 0;
}

.pin-dest {
  width: 10px;
  height: 10px;
  background-color: #d93025;
  border-radius: 50%;
}

.input-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.route-input-wrap {
  display: flex;
  align-items: center;
  background: #f1f3f4;
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  height: 38px;
  transition: background-color 0.15s ease;
}

.route-input-wrap:focus-within {
  background: #e8eaed;
}

.route-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
}

.input-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
}

.input-icon-btn:hover {
  background: rgba(0,0,0,0.08);
  color: var(--text-primary);
}

/* Route Summary Card */
.route-summary-card {
  padding: 14px 16px;
  border-top: 1px solid #e8eaed;
  background: #fafafa;
}

.route-metric-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 12px;
}

.route-duration {
  font-size: 24px;
  font-weight: 700;
  color: var(--traffic-fast);
}

.route-distance {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.route-traffic-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--traffic-fast);
}

.traffic-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--traffic-fast);
}

.traffic-dot.orange { background: var(--traffic-med); }
.traffic-dot.red { background: var(--traffic-slow); }

.route-action-row {
  display: flex;
  gap: 10px;
}

.nav-start-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-round);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(26,115,232,0.4);
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.nav-start-btn:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 6px rgba(26,115,232,0.5);
}

.outline-action-btn {
  background: #ffffff;
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: var(--radius-round);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}

.outline-action-btn:hover {
  background: #f1f3f4;
  color: var(--text-primary);
}

/* Turn-by-Turn Steps */
.route-steps-container {
  margin-top: 14px;
  max-height: 260px;
  overflow-y: auto;
  border-top: 1px solid #dadce0;
  padding-top: 8px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px solid #f1f3f4;
  font-size: 13px;
}

.step-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.step-text {
  flex: 1;
  color: var(--text-primary);
  line-height: 1.4;
}

.step-dist {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   Place Card / POI Details
   -------------------------------------------------------------------------- */
.place-card {
  top: 12px;
  left: 12px;
  width: 392px;
  max-width: calc(100vw - 24px);
  background: var(--surface-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  max-height: 85vh;
  overflow-y: auto;
}

[dir="rtl"] .place-card {
  left: auto;
  right: 12px;
}

.place-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
  z-index: 5;
}

[dir="rtl"] .place-close-btn {
  right: auto;
  left: 8px;
}

.place-hero-image {
  height: 180px;
  background: linear-gradient(135deg, #2b5876, #4e4376);
  position: relative;
  background-size: cover;
  background-position: center;
}

.place-hero-badge {
  position: absolute;
  bottom: 12px;
  left: 14px;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

.place-source-badge {
  position: absolute;
  bottom: 12px;
  right: 14px;
  background: #10b981;
  color: #ffffff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

.place-info-body {
  padding: 16px;
}

.place-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.place-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.place-ratings-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  flex-wrap: wrap;
}

.place-score {
  font-weight: 700;
  color: #e37400;
}

.stars {
  color: #fbbc04;
  letter-spacing: 1px;
}

.rating-count {
  color: var(--text-muted);
}

.place-status-open {
  color: var(--traffic-fast);
  font-weight: 600;
}

.place-action-buttons {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.place-action-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 8px 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary-color);
  transition: background-color 0.15s ease;
}

.place-action-pill:hover {
  background: #f8f9fa;
}

.place-action-pill.primary {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #ffffff;
}

.place-action-pill.primary:hover {
  background: var(--primary-hover);
}

.place-details-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid #f1f3f4;
  padding-top: 14px;
}

.place-detail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--text-primary);
  padding: 4px 0;
}

.place-detail-item .item-text {
  flex: 1;
  word-break: break-word;
  line-height: 1.5;
}

.item-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--bg-hover, #f1f3f4);
  border: 1px solid var(--border-color, #dadce0);
  border-radius: 6px;
  font-size: 11px;
  font-family: inherit;
  color: var(--text-secondary, #5f6368);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.item-copy-btn:hover {
  background: rgba(26, 115, 232, 0.1);
  color: #1a73e8;
  border-color: #1a73e8;
}

.item-copy-btn.copied {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

.item-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Turn-by-Turn Live Navigation HUD (Driving Mode)
   -------------------------------------------------------------------------- */
.nav-hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: var(--z-hud);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
}

.hud-top-bar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--hud-bg-dark);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}

.hud-maneuver-box {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hud-maneuver-icon {
  font-size: 36px;
  background: rgba(255,255,255,0.2);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hud-distance-to-turn {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.hud-street-name {
  font-size: 15px;
  opacity: 0.92;
  margin-top: 2px;
}

.hud-circle-btn {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.25);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.hud-circle-btn:hover {
  background: rgba(255,255,255,0.4);
}

.hud-bottom-bar {
  pointer-events: auto;
  background: var(--hud-bg-bottom);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  box-shadow: 0 -2px 14px rgba(0,0,0,0.35);
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hud-trip-metrics {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.hud-eta {
  font-size: 24px;
  font-weight: 700;
  color: #34a853;
}

.hud-duration-remaining {
  font-size: 15px;
  font-weight: 600;
}

.hud-distance-remaining {
  font-size: 14px;
  color: #9aa0a6;
}

.hud-speedometer {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.12);
  padding: 4px 12px;
  border-radius: var(--radius-md);
}

.speed-val {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
}

.speed-unit {
  font-size: 10px;
  color: #9aa0a6;
  text-transform: uppercase;
}

.hud-exit-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #d93025;
  color: #ffffff;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(217,48,37,0.4);
}

/* --------------------------------------------------------------------------
   Bottom Right Controls
   -------------------------------------------------------------------------- */
.bottom-right-controls {
  position: absolute;
  right: 12px;
  bottom: 34px;
  z-index: var(--z-controls);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

[dir="rtl"] .bottom-right-controls {
  right: auto;
  left: 12px;
}

.map-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.zoom-btn-cluster {
  display: flex;
  flex-direction: column;
  width: 40px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.cluster-btn {
  background: transparent;
  border: none;
  height: 36px;
  font-size: 20px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cluster-btn:hover {
  background-color: #f1f3f4;
  color: var(--text-primary);
}

.cluster-divider {
  height: 1px;
  background-color: var(--surface-border);
  margin: 0 4px;
}

/* --------------------------------------------------------------------------
   Bottom Left Layer Switcher
   -------------------------------------------------------------------------- */
.bottom-left-panel {
  position: absolute;
  bottom: 34px;
  left: 12px;
  z-index: var(--z-controls);
}

[dir="rtl"] .bottom-left-panel {
  left: auto;
  right: 12px;
}

.layers-preview-btn {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 4px;
}

.layer-thumb-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/4/6/10') center/cover;
  opacity: 0.85;
}

.layers-label {
  position: relative;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

.layers-popup {
  position: absolute;
  bottom: 70px;
  left: 0;
  width: 280px;
  background: var(--surface-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-3);
  padding: 14px;
  z-index: var(--z-modal);
}

[dir="rtl"] .layers-popup {
  left: auto;
  right: 0;
}

.layers-popup-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.layer-types-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.layer-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: #f8f9fa;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.layer-type-card.active {
  border-color: var(--primary-color);
  background: var(--primary-bg-light);
  color: var(--primary-color);
}

.layer-preview-icon {
  width: 52px;
  height: 40px;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
}

.streets-icon {
  background: #f0ede5;
  border: 1px solid #dcdad5;
}

.satellite-icon {
  background: url('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/4/6/10') center/cover;
}

.dark-icon {
  background: #242f3e;
}

.outdoors-icon {
  background: #d8ebd4;
}

.layer-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
}

.layer-toggle-row input {
  display: none;
}

.toggle-switch {
  width: 36px;
  height: 20px;
  background-color: #bdc1c6;
  border-radius: 10px;
  position: relative;
  transition: background-color 0.2s ease;
  order: 2;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.layer-toggle-row input:checked + .toggle-switch {
  background-color: var(--primary-color);
}

.layer-toggle-row input:checked + .toggle-switch::after {
  transform: translateX(16px);
}

/* --------------------------------------------------------------------------
   Footer Bar & WebGPU Status
   -------------------------------------------------------------------------- */
.map-footer-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 26px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
  border-top: 1px solid rgba(0,0,0,0.06);
  z-index: var(--z-controls);
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 11px;
  color: var(--text-secondary);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #188038;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #188038;
  animation: pulse 1.6s infinite ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.status-spacer {
  flex: 1;
}

.lang-switch-wrap {
  margin-right: 14px;
}

[dir="rtl"] .lang-switch-wrap {
  margin-right: 0;
  margin-left: 14px;
}

.lang-btn {
  background: transparent;
  border: 1px solid var(--surface-border);
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
}

.lang-btn:hover {
  background: #f1f3f4;
}

.coords-display {
  margin-right: 14px;
  font-family: monospace;
}

/* --------------------------------------------------------------------------
   Right-Click Context Menu
   -------------------------------------------------------------------------- */
.context-menu {
  position: absolute;
  background: var(--surface-bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-3);
  padding: 6px 0;
  z-index: var(--z-modal);
  min-width: 190px;
}

.context-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.context-item:hover {
  background-color: #f1f3f4;
}

.context-icon {
  font-size: 16px;
  width: 20px;
}

.context-divider {
  height: 1px;
  background-color: #f1f3f4;
  margin: 4px 0;
}

/* --------------------------------------------------------------------------
   Side Drawer & Backdrop
   -------------------------------------------------------------------------- */
.side-drawer {
  position: absolute;
  top: 0;
  left: 0;
  width: 320px;
  height: 100%;
  background: var(--surface-bg);
  z-index: var(--z-modal);
  box-shadow: var(--shadow-3);
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}

[dir="rtl"] .side-drawer {
  left: auto;
  right: 0;
}

.side-drawer.hidden {
  transform: translateX(-100%);
  display: flex !important;
  pointer-events: none;
}

[dir="rtl"] .side-drawer.hidden {
  transform: translateX(100%);
}

.drawer-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: calc(var(--z-modal) - 1);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #f1f3f4;
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-icon {
  font-size: 28px;
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
}

.brand-tagline {
  font-size: 11px;
  color: var(--text-muted);
}

.drawer-menu-list {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-round);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.15s ease;
  margin-bottom: 2px;
}

.drawer-link:hover {
  background: #f1f3f4;
}

.drawer-link.active {
  background: var(--primary-bg-light);
  color: var(--primary-color);
}

.drawer-icon {
  font-size: 18px;
}

.drawer-divider {
  height: 1px;
  background: #f1f3f4;
  margin: 12px 8px;
}

.drawer-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 14px;
  letter-spacing: 0.5px;
}

.city-shortcut-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s ease;
}

[dir="rtl"] .city-shortcut-btn {
  text-align: right;
}

.city-shortcut-btn:hover {
  background: #f1f3f4;
}

/* Toast */
.toast {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: #323232;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-round);
  font-size: 13px;
  box-shadow: var(--shadow-3);
  z-index: var(--z-toast);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* --------------------------------------------------------------------------
   Mobile Responsiveness
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .top-left-panel,
  .directions-panel {
    width: calc(100% - 20px);
    left: 10px;
    right: 10px;
  }

  .place-card {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 44vh;
    border-radius: 20px 20px 0 0;
    margin: 0;
    z-index: 100;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
    border-bottom: none;
    overflow-y: auto;
  }

  .sheet-drag-handle {
    display: block;
    width: 40px;
    height: 4px;
    background: var(--surface-border);
    border-radius: 2px;
    margin: 8px auto 4px auto;
  }

  /* Accessible touch targets >= 44x44px */
  .icon-btn,
  .cluster-btn,
  .map-btn,
  .place-action-pill,
  .mode-btn,
  .hud-circle-btn,
  .hud-exit-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .hud-top-bar, .hud-bottom-bar {
    max-width: 100%;
  }

  .bottom-left-panel {
    bottom: 34px;
  }

  .coords-display {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Developer Search Debug HUD (Ctrl+Shift+D)
   -------------------------------------------------------------------------- */
.debug-hud {
  position: absolute;
  top: 75px;
  left: 16px;
  right: auto;
  width: 440px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
  z-index: 1200;
  overflow-y: auto;
  font-family: var(--font-fa), -apple-system, sans-serif;
  direction: rtl;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.debug-hud.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px) scale(0.97);
}

.debug-hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(30, 41, 59, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.debug-hud-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #38bdf8;
}

.debug-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  display: inline-block;
  animation: pulse-hud 2s infinite;
}

@keyframes pulse-hud {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.debug-hud-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.debug-shortcut-hint {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-family: monospace;
  direction: ltr;
}

.debug-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.debug-close-btn:hover {
  color: #ffffff;
}

.debug-hud-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.debug-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.debug-label {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

.debug-value {
  font-size: 12px;
  background: rgba(0, 0, 0, 0.35);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  word-break: break-word;
}

.debug-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.debug-grid-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30, 41, 59, 0.5);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.debug-sublabel {
  font-size: 11px;
  color: #94a3b8;
}

.debug-tag {
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
}

.debug-tag.highlight-tag {
  color: #38bdf8;
  font-weight: 700;
}

.debug-tag.plate-tag {
  color: #fbbf24;
  font-weight: 700;
  background: rgba(251, 191, 36, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
}

.debug-tag.speed-tag {
  color: #34d399;
  font-weight: 700;
  font-family: monospace;
  direction: ltr;
}

.debug-candidates-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
}

.debug-cand-item {
  background: rgba(0, 0, 0, 0.25);
  padding: 4px 8px;
  border-radius: 4px;
  color: #94a3b8;
  border-right: 2px solid #38bdf8;
}

/* ==========================================================================
   Canonical Map Marker & Pin Drop System
   ========================================================================== */
.maplibregl-marker {
  z-index: 60 !important;
}

.aria-canonical-marker {
  width: 34px;
  height: 48px;
  display: block;
  z-index: 9999 !important;
  cursor: pointer;
  pointer-events: auto;
  will-change: transform;
}

.aria-pin-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.aria-pin-svg {
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
  transform-origin: 50% 100%;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.aria-canonical-marker:hover .aria-pin-svg {
  transform: scale(1.15) translateY(-5px);
}

.aria-pin-shadow {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 6px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 75%);
  border-radius: 50%;
  pointer-events: none;
}

.marker-bounce .aria-pin-svg {
  animation: ariaPinDrop 0.38s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes ariaPinDrop {
  0% {
    transform: translateY(-45px) scale(0.5);
    opacity: 0;
  }
  60% {
    transform: translateY(2px) scale(1.06);
    opacity: 1;
  }
  80% {
    transform: translateY(-4px) scale(0.98);
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Instant micro-pulse status badge */
.lookup-pulse {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: #1a73e8;
  background: #e8f0fe;
  padding: 2px 8px;
  border-radius: 12px;
  animation: pulseFade 1.2s infinite alternate;
}

@keyframes pulseFade {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* Telegram WebApp & Bot Integration Styles */
.tg-mode-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  background: rgba(30, 41, 59, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 28px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  max-width: 90vw;
  animation: slideDownBanner 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownBanner {
  from {
    transform: translate(-50%, -24px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

.tg-banner-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tg-banner-icon {
  font-size: 16px;
}

.tg-banner-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.tg-banner-close:hover {
  color: #ffffff;
}

/* Origin and Destination Quick Pills */
.place-action-pill.origin-pill {
  border: 1px solid #16a34a;
  color: #16a34a;
  background: #f0fdf4;
}

.place-action-pill.origin-pill:hover {
  background: #dcfce7;
}

.place-action-pill.dest-pill {
  border: 1px solid #dc2626;
  color: #dc2626;
  background: #fef2f2;
}

.place-action-pill.dest-pill:hover {
  background: #fee2e2;
}

.place-action-pill.tg-pill {
  background: linear-gradient(135deg, #0088cc, #00aced);
  color: #ffffff;
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 136, 204, 0.35);
}

.place-action-pill.tg-pill:hover {
  background: linear-gradient(135deg, #007ab8, #009ad6);
}

/* Full Width Telegram Action Button */
.tg-full-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #0088cc, #00b4d8);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 136, 204, 0.35);
  transition: all 0.2s ease;
}

.tg-full-action-btn:hover {
  background: linear-gradient(135deg, #0077b6, #0096c7);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 136, 204, 0.45);
}

/* Directions Dropdown Autocomplete */
#directions-dropdown {
  position: relative;
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  border-radius: 12px;
  margin-top: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Map Markers for Origin (A) and Destination (B) */
.aria-route-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  cursor: pointer;
}

.aria-route-marker-badge {
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.35);
  border: 2px solid #ffffff;
}

.aria-route-marker-badge span {
  transform: rotate(45deg);
}

.aria-route-marker.origin .aria-route-marker-badge {
  background: #16a34a;
}

.aria-route-marker.destination .aria-route-marker-badge {
  background: #dc2626;
}

.aria-route-marker-label {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.95);
  padding: 2px 6px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   Address Correction & Plate Registration Modal
   -------------------------------------------------------------------------- */
.correction-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  direction: rtl;
}

.correction-modal.hidden {
  display: none !important;
}

.correction-modal-card {
  background: var(--surface-primary, #ffffff);
  color: var(--text-primary, #202124);
  width: 100%;
  max-width: 460px;
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

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

.correction-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, #e8eaed);
}

.correction-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.close-modal-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-secondary, #5f6368);
  padding: 4px 8px;
}

.correction-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.correction-subtitle {
  margin: 0 0 4px 0;
  font-size: 12.5px;
  color: var(--text-secondary, #5f6368);
  line-height: 1.5;
}

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

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #202124);
}

.form-control {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #dadce0);
  background: var(--surface-secondary, #f8f9fa);
  font-family: inherit;
  font-size: 13px;
  color: inherit;
  outline: none;
}

.form-control:focus {
  border-color: #1a73e8;
  background: #ffffff;
}

.btn-submit-correction {
  background: #1a73e8;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s;
}

.btn-submit-correction:hover {
  background: #1557b0;
}

.corr-status-msg {
  padding: 10px;
  border-radius: 8px;
  font-size: 12.5px;
  text-align: center;
  font-weight: 600;
}

.corr-status-msg.success {
  background: #e6f4ea;
  color: #137333;
}

.corr-status-msg.error {
  background: #fce8e6;
  color: #c5221f;
}

/* --------------------------------------------------------------------------
   Accessibility & Semantic Helpers
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* --------------------------------------------------------------------------
   Search Input Loading Spinner
   -------------------------------------------------------------------------- */
.search-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(26, 115, 232, 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: aria-spin 0.75s linear infinite;
  margin-left: 8px;
  flex-shrink: 0;
}

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

/* --------------------------------------------------------------------------
   Transit / Feature Coming Soon Badge
   -------------------------------------------------------------------------- */
.mode-badge-soon {
  font-size: 10px;
  font-weight: 600;
  background: var(--primary-bg-light);
  color: var(--primary-color);
  border-radius: 10px;
  padding: 1px 6px;
  margin-right: 4px;
}

/* --------------------------------------------------------------------------
   Authentic Spatial Metadata Tags & Hero Banner
   -------------------------------------------------------------------------- */
.place-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px 0;
}

.place-meta-pill {
  font-size: 11.5px;
  padding: 4px 10px;
  background: var(--surface-elevated);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  border-radius: 14px;
  font-weight: 500;
}

.place-hero-banner {
  height: 68px;
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  display: flex;
  align-items: center;
  padding: 0 16px;
  position: relative;
  border-radius: 16px 16px 0 0;
}

.place-hero-icon {
  font-size: 26px;
  margin-left: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-drag-handle {
  display: none;
  width: 38px;
  height: 4px;
  background: var(--surface-border);
  border-radius: 2px;
  margin: 8px auto 4px auto;
}

/* --------------------------------------------------------------------------
   Saved Places Modal
   -------------------------------------------------------------------------- */
.saved-places-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.saved-places-modal.hidden {
  display: none !important;
}

.saved-modal-card {
  background: var(--surface-bg);
  color: var(--text-primary);
  border-radius: 16px;
  width: 440px;
  max-width: 100%;
  max-height: 80vh;
  box-shadow: var(--shadow-3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--surface-border);
}

.saved-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--surface-border);
}

.saved-modal-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.saved-modal-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.saved-place-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-elevated);
  border: 1px solid var(--surface-border);
}

.saved-place-info {
  flex: 1;
  min-width: 0;
  padding-left: 8px;
}

.saved-place-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-place-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-place-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.saved-action-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--surface-border);
  background: var(--surface-bg);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.saved-action-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.saved-action-btn.del-btn:hover {
  border-color: #d93025;
  background: #fce8e6;
  color: #d93025;
}

/* --------------------------------------------------------------------------
   Dark Mode Component Specifics
   -------------------------------------------------------------------------- */
[data-theme="dark"] .search-box-card,
[data-theme="dark"] .search-dropdown,
[data-theme="dark"] .floating-panel,
[data-theme="dark"] .side-drawer,
[data-theme="dark"] .map-footer-bar,
[data-theme="dark"] .layers-popup,
[data-theme="dark"] .context-menu,
[data-theme="dark"] .correction-modal-card {
  background: var(--surface-bg);
  color: var(--text-primary);
  border-color: var(--surface-border);
}

[data-theme="dark"] .search-box-card input,
[data-theme="dark"] .route-input-wrap input,
[data-theme="dark"] .form-control {
  background: var(--surface-elevated);
  color: var(--text-primary);
  border-color: var(--surface-border);
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .context-item:hover,
[data-theme="dark"] .drawer-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .map-btn,
[data-theme="dark"] .zoom-btn-cluster,
[data-theme="dark"] .layers-preview-btn {
  background: var(--surface-bg);
  color: var(--text-primary);
  border: 1px solid var(--surface-border);
}

[data-theme="dark"] .chip {
  background: var(--surface-bg);
  color: var(--text-primary);
  border-color: var(--surface-border);
}

[data-theme="dark"] .chip:hover,
[data-theme="dark"] .chip.active {
  background: var(--primary-bg-light);
  color: var(--primary-color);
  border-color: var(--primary-color);
}



/* SnappBox destination mode keeps AriaMaps' search and map engine, while the
   order fields stay in the focused destination workflow. */
body.telegram-destination-mode {
  overflow: hidden;
  background: #f5f7f9;
}

body.telegram-destination-mode #tg-mode-banner,
body.telegram-destination-mode #menu-btn,
body.telegram-destination-mode #directions-toggle-btn,
body.telegram-destination-mode .search-divider,
body.telegram-destination-mode #category-chips,
body.telegram-destination-mode #directions-panel,
body.telegram-destination-mode #place-card,
body.telegram-destination-mode #nav-hud,
body.telegram-destination-mode .map-controls,
body.telegram-destination-mode .bottom-left-panel,
body.telegram-destination-mode .map-footer-bar,
body.telegram-destination-mode #context-menu,
body.telegram-destination-mode #side-drawer,
body.telegram-destination-mode #drawer-backdrop,
body.telegram-destination-mode #debug-hud,
body.telegram-destination-mode #correction-modal,
body.telegram-destination-mode #saved-places-modal,
body.telegram-destination-mode #toast,
body.telegram-destination-mode #webgpu-canvas {
  display: none !important;
}

body.telegram-destination-mode .app-container,
body.telegram-destination-mode #main-map-area,
body.telegram-destination-mode #map {
  height: 100dvh;
  min-height: 100dvh;
}

body.telegram-destination-mode #search-panel {
  position: fixed;
  inset: max(12px, env(safe-area-inset-top)) 12px auto 12px;
  width: auto;
  max-width: none;
  z-index: 1300;
}

body.telegram-destination-mode .search-box-card {
  min-height: 52px;
  border: 1px solid #dfe5e9;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(23, 33, 43, .16);
}

body.telegram-destination-mode #search-input {
  font-family: Vazirmatn, Tahoma, Arial, sans-serif;
  font-size: 16px;
}

.telegram-map-credit {
  display: none;
}

body.telegram-destination-mode .telegram-map-credit {
  position: fixed;
  z-index: 1240;
  inset-inline-start: 8px;
  bottom: calc(54dvh + 6px);
  display: block;
  direction: ltr;
  padding: 3px 6px;
  border-radius: 6px;
  color: #34404a;
  background: rgba(255, 255, 255, .9);
  font: 500 9px/1.3 Arial, sans-serif;
  box-shadow: 0 1px 4px rgba(23, 33, 43, .16);
}

.telegram-destination-panel {
  position: fixed;
  z-index: 1250;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: 54dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  color: #17212b;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 22px rgba(23, 33, 43, .16);
  font-family: Vazirmatn, Tahoma, Arial, sans-serif;
}

.telegram-selected-location {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
}

.telegram-field-label,
.telegram-form-field span {
  color: #56626d;
  font-size: 12px;
  font-weight: 500;
}

#telegram-selected-address {
  color: #17212b;
  font-size: 14px;
  line-height: 1.8;
  font-weight: 600;
}

.telegram-customer-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.telegram-form-field {
  display: grid;
  gap: 5px;
}

.telegram-form-field-wide {
  grid-column: 1 / -1;
}

.telegram-form-field b {
  color: #b42318;
}

.telegram-form-field input {
  width: 100%;
  height: 46px;
  padding: 0 11px;
  color: #17212b;
  background: #fff;
  border: 1px solid #d7dee3;
  border-radius: 12px;
  outline: none;
  font: 400 16px Vazirmatn, Tahoma, Arial, sans-serif;
}

.telegram-form-field input:focus {
  border-color: #168f3f;
  box-shadow: 0 0 0 3px rgba(22, 143, 63, .12);
}

.telegram-form-field input::placeholder {
  color: #65717d;
}

.telegram-form-error {
  margin: 10px 0 0;
  color: #b42318;
  font-size: 12px;
  line-height: 1.7;
}

.telegram-confirm-destination {
  position: sticky;
  bottom: 0;
  width: 100%;
  min-height: 50px;
  margin-top: 12px;
  color: #fff;
  background: #22a447;
  border: 0;
  border-radius: 12px;
  font: 700 15px Vazirmatn, Tahoma, Arial, sans-serif;
  cursor: pointer;
}

.telegram-confirm-destination:focus-visible {
  outline: 3px solid rgba(22, 143, 63, .28);
  outline-offset: 2px;
}

.telegram-confirm-destination:disabled {
  cursor: wait;
  opacity: .58;
}

@media (min-width: 720px) {
  .telegram-destination-panel {
    right: 16px;
    bottom: 16px;
    left: auto;
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100dvh - 96px);
    border-radius: 16px;
  }

  body.telegram-destination-mode #search-panel {
    right: 16px;
    left: auto;
    width: min(420px, calc(100vw - 32px));
  }
}
