      /* --- Material 3 inspired CSS variables (light blue base) --- */
      :root {
        --md-sys-primary: #51aef2;
        /* light blue */
        --md-sys-on-primary: #ffffff;
        --md-sys-surface: #ffffff;
        --md-sys-on-surface: #0b1220;
        --md-sys-background: #f6fbff;
        --md-radius: 18px;
        --md-elevation-1: 0 1px 2px rgba(11, 18, 32, 0.06), 0 1px 3px rgba(11, 18, 32, 0.08);
      }

      @media (prefers-color-scheme: dark) {
        :root {
          --md-sys-primary: #7fc9ff;
          --md-sys-on-primary: #002034;
          --md-sys-surface: #081018;
          --md-sys-on-surface: #e6f6ff;
          --md-sys-background: #06121a;
        }

        body {
          background: var(--md-sys-background);
          color: var(--md-sys-on-surface);
        }
      }

      html,
      body {
        height: 100%;
        margin: 0;
        font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
        background: var(--md-sys-background);
        color: var(--md-sys-on-surface);
      }

      /* Header */
      .app-header {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.6rem 1rem;
        background: transparent;
        position: sticky;
        top: 0;
        z-index: 1100;
      }

      .logo-title {
        font-weight: 700;
        font-size: 1.05rem;
        letter-spacing: 0.3px;
      }

      .logo-tagline {
        font-size: 0.78rem;
        color: rgba(11, 18, 32, 0.6);
      }

      @media (prefers-color-scheme: dark) {
        .logo-tagline {
          color: rgba(230, 246, 255, 0.7);
        }
      }

      /* Map container as the main focus */
      .map-wrap {
        padding: 1rem;
      }

      #oldmap {
        width: 100%;
        height: calc(100vh - 160px);
        /* header + padding + bottom toolbar space */
        border-radius: calc(var(--md-radius) - 4px);
        box-shadow: var(--md-elevation-1);
        overflow: hidden;
        border: 1px solid rgba(11, 18, 32, 0.06);
      }

      #map {
        width: 100%;
        height: calc(var(--vh, 100vh) - var(--footer-h, 72px) - var(--header-h, 64px));
        border-radius: calc(var(--md-radius) - 4px);
        box-shadow: var(--md-elevation-1);
        overflow: hidden;
        border: 1px solid rgba(111, 118, 132, 1.06);
      }

      /* Bottom toolbar */
      .bottom-toolbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: 72px;
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding: env(safe-area-inset-bottom) 0.5rem;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.98));
        border-top-left-radius: 14px;
        border-top-right-radius: 14px;
        box-shadow: 0 -6px 24px rgba(11, 18, 32, 0.06);
        z-index: 1200;
        backdrop-filter: blur(6px);
      }

      @media (prefers-color-scheme: dark) {
        .bottom-toolbar {
          background: linear-gradient(180deg, rgba(5, 12, 18, 0.75), rgba(5, 12, 18, 0.9));
        }
      }

      .tb-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        font-size: 11px;
        color: var(--md-sys-on-surface);
        text-decoration: none;
        border: none;
        background: transparent;
      }

      .tb-btn .material-symbols-outlined {
        font-size: 22px;
        color: var(--md-sys-primary);
      }

      /* Offcanvas menu header */
      .offcanvas-start .offcanvas-header {
        background: linear-gradient(90deg, rgba(81, 174, 242, 0.12), rgba(81, 174, 242, 0.06));
        border-bottom: 1px solid rgba(11, 18, 32, 0.04);
      }

      .menu-logo {
        font-weight: 800;
        color: var(--md-sys-primary);
      }

      .offcanvas-start {
        z-index: 1300;
        opacity: 0.1;
        transition: opacity 150ms ease-in-out, var(--bs-offcanvas-transition);
      }

      .offcanvas-start.show {
        z-index: 1300;
        opacity: 1;
      }

      /* Small UI helpers */
      .chip {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.25rem 0.6rem;
        border-radius: 999px;
        background: rgba(81, 174, 242, 0.08);
        color: var(--md-sys-on-surface);
        font-size: 0.85rem;
        border: 1px solid rgba(81, 174, 242, 0.08);
      }

      .offcanvas-copyright {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 12px;
        text-align: center;
        font-size: 0.92rem;
        color: #7fc9ff;
        opacity: 0.85;
        padding: 4px 0;
        background: none;
        pointer-events: none;
      }

      .offcanvas-body {
        position: relative;
        min-height: 320px;
        /* ensure enough height for copyright */
        padding-bottom: 40px;
        /* space for copyright */
      }

      /* Popup content small */
      .dist-popup .title {
        font-weight: 700;
        margin-bottom: 4px;
      }

      .dist-popup .meta {
        font-size: 0.85rem;
        color: rgba(11, 18, 32, 0.6);
      }

      /* Make the leaflet controls fit material style a bit */
      .leaflet-control {
        border-radius: 10px;
      }

      /* Responsive tweaks */
      @media (min-width: 768px) {
        #map {
          height: calc(100vh - 120px);
        }

        .map-wrap {
          padding: 1.5rem 2rem;
          padding-bottom: 110px;
        }
      }

      .leaflet-popup-content,
      .leaflet-popup-content *,
      .dist-img-wrap,
      .dist-img {
        transition: height 0.3s ease !important;
        /* smooth height change */
        overflow: hidden;
        /* crop the extra height */
      }

      .dist-popup-full {
        max-width: 260px;
        line-height: 1.35;
      }

      .leaflet-bottom.leaflet-right {
        scale: 0.75;
        opacity: 0.6;
      }

      .leaflet-top.leaflet-left {
        scale: 0.5;
        opacity: 0.6;
        left: -10px;
        top: -20px;
      }

      .dist-img-wrap {
        margin: 6px 0;
        position: relative;
      }

      .dist-img {
        width: 100%;
        border-radius: 6px;
        object-fit: cover;
      }

      .attrib {
        font-size: 10px;
        color: #888;
        margin-top: 2px;
      }

      #loadingOverlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(11, 18, 32, 1);
        color: #fff;
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 5000;
        transition: opacity 0.3s ease;
      }

      #loadingOverlay.hidden {
        opacity: 0;
        pointer-events: none;
      }

      .loader {
        text-align: center;
        width: 280px;
      }

      .spinner {
        width: 50px;
        height: 50px;
        border: 5px solid rgba(255, 255, 255, 0.2);
        border-top-color: #51aef2;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin: 0 auto 12px auto;
      }

      @keyframes spin {
        0% {
          transform: rotate(0deg);
        }

        100% {
          transform: rotate(360deg);
        }
      }

      .loading-text {
        font-size: 1rem;
        font-weight: 500;
        margin-bottom: 8px;
      }

      .progress-container {
        width: 100%;
        height: 10px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 5px;
        overflow: hidden;
      }

      #progressBar {
        width: 0%;
        height: 100%;
        background: #51aef2;
        transition: width 0.2s ease;
      }



      
/* Fancy Label that appears near the marker */
.marker-label {
    background: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-family: sans-serif;
    font-weight: bold;
    font-size: 12px;
    position: absolute;
    top: -25px;
    white-space: nowrap;
    border: 2px solid #2A93EE;
}

.fancy-marker {
    filter: drop-shadow(0px 4px 4px rgba(0,0,0,0.25));
    transition: transform 0.2s ease-out;
}

.fancy-marker:hover {
    transform: translateY(-5px) scale(1.1);
    z-index: 999 !important;
}

.marker-svg {
    width: 35px;
    height: 45px;
}

/* Container for the whole marker */
.user-location-container {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Pushes text to the left of the dot */
    width: auto !important;
    height: auto !important;
}
/* The main container */
.user-marker-container {
    display: flex;
    align-items: center;
    background: transparent;
    width: auto !important;
}

/* The Blue Dot - Always visible */
.user-dot {
    width: 14px;
    height: 14px;
    background: #2A93EE;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(42, 147, 238, 0.8);
    flex-shrink: 0;
    z-index: 2;
     transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
   
}

/* The Label - Hidden/Collapsed by default */
.location-label {
    background: white;
    color: #2C3E50;
    font-family: sans-serif;
    font-weight: bold;
    font-size: 12px;
    
    /* Animation properties */
    max-width: 0;
    opacity: 0;
    padding: 0;
    margin-left: -7px; /* Pulls it "under" the dot initially */
    white-space: nowrap;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    border-radius: 20px;
    border: 1.5px solid #2A93EE;
    
    z-index: 1;
    line-height:6px;
  color:#b7b9bb;
}

/* Expanded State */
.label-visible .location-label {
    max-width: 150px; /* Large enough to fit text */
    opacity: 1;
    padding-top: 4px;
    padding-right: 10px;
    padding-bottom: 4px;
    padding-left: 24px;
    margin-left: -22px; 
    border-width:1.5px;
   box-shadow: -1px 0px 8px rgba(42, 147, 238, 1);
  line-height:16px;
  color:#1577cd;
}

.label-visible .user-dot {
    width: 14px;
    height: 14px;
    background: #2A93EE;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0px rgba(42, 147, 238, 0.8);
    flex-shrink: 0;
    z-index: 2;
}


.expanding-marker {
    display: flex !important;
    align-items: center;
    width: auto !important;
    height: 46px !important;
    filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.3));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* The SVG Shield/Bubble remains the anchor */
.marker-svg-container {
    width: 36px;
    height: 46px;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

/* The Expandable Content Area */
.marker-content {
    background: white;
    height: 51px;
    display: flex;
    align-items: center;
    border-radius: 25px 25px 25px 25px;
    margin-left: -39px;
    padding-left: 4px;
    margin-bottom: 22px;
    border: 2px solid var(--marker-color);
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: all 0.4s ease;
    z-index: 2;
}


.label-visible .marker-svg-container svg text{
    display:none;
}

/* Expanded State */
.label-visible .marker-content {
    max-width: 250px;
    opacity: 1;
    padding-right: 15px;
}

/* Text Styling */
.marker-text-box {
    display: flex;
    flex-direction: column;
    margin-left: 8px;
}

.marker-name {
    font-weight: bold;
    font-size: 14px;
    color: #333;
    line-height: 1.1;
}

.marker-subtitle {
    font-size: 10px;
    color: #666;
    max-width:99%;
    overflow:hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The Logo Image */

.leaflet-container .leaflet-marker-pane .marker-content .marker-logo img,
.leaflet-container .leaflet-shadow-pane .marker-content .marker-logo  img,
.leaflet-container .leaflet-tile-pane .marker-content .marker-logo img,


.marker-content .marker-logo {
   height:36px!important;
   width:36px!important;
   border-radius:50%;

   
    border: 1px solid #eee;
    z-index: 4;
    position: relative;
}