      :root {
        --bg: #f0f4f8;
        --surface: #ffffff;
        --surface2: #e8eef4;
        --border: #c8d8e8;
        --accent: #0077a8;
        --accent2: #e07b30;
        --green: #1a9e92;
        --text: #1a2b3c;
        --muted: #5a7a96;
      }
      * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
      }
      html,
      body {
        height: 100%;
        height: 100dvh;
        font-family: "Segoe UI", system-ui, sans-serif;
        background: var(--bg);
        color: var(--text);
        overflow: hidden;
      }
      /* Prevent mobile browsers from painting blue tap flash overlays. */
      button,
      #mall-view,
      #mall-canvas-wrap,
      #mv-pop,
      #popover {
        -webkit-tap-highlight-color: transparent;
      }

      /* ── Header ── */
      #header {
        height: 56px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: center;
        padding: 0 20px;
        gap: 20px;
        z-index: 1000;
        position: relative;
      }
      #logo {
        display: flex;
        flex-direction: column;
        white-space: nowrap;
      }
      #logo-title {
        font-size: 15px;
        font-weight: 700;
        letter-spacing: 0.5px;
      }
      #logo-sub {
        font-size: 10px;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 2px;
      }
      #logo-title span {
        color: var(--accent);
      }

      #search-wrap {
        flex: 1;
        max-width: 380px;
        position: relative;
      }
      #search {
        width: 100%;
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: 8px;
        color: var(--text);
        padding: 8px 12px 8px 34px;
        font-size: 13px;
        outline: none;
        transition: border-color 0.2s;
      }
      #search::placeholder {
        color: var(--muted);
      }
      #search:focus {
        border-color: var(--accent);
      }
      #search-icon {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--muted);
        font-size: 14px;
        pointer-events: none;
      }

      #search-dropdown {
        display: none;
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        right: 0;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 10px;
        overflow: hidden;
        z-index: 9999;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
        max-height: 300px;
        overflow-y: auto;
      }
      .s-item {
        padding: 10px 14px;
        cursor: pointer;
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: center;
        gap: 10px;
      }
      .s-item:last-child {
        border-bottom: none;
      }
      .s-item:hover {
        background: var(--surface2);
      }
      .s-icon {
        font-size: 16px;
        flex-shrink: 0;
      }
      .s-text {
        display: flex;
        flex-direction: column;
      }
      .s-name {
        font-size: 13px;
        font-weight: 600;
      }
      .s-meta {
        font-size: 11px;
        color: var(--muted);
        margin-top: 1px;
      }
      .s-no-result {
        padding: 14px;
        text-align: center;
        color: var(--muted);
        font-size: 13px;
      }

      /* ── Layout ── */
      #main {
        height: calc(100vh - 56px);
        height: calc(100dvh - 56px);
        display: flex;
      }
      #map {
        flex: 1;
        height: 100%;
        background: #fff;
        position: relative;
      }
      .leaflet-control-attribution {
        display: none !important;
      }

      /* ── Sidebar ── */
      #sidebar {
        width: 260px;
        min-width: 260px;
        background: var(--surface);
        border-right: 1px solid var(--border);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        transition:
          width 0.25s ease,
          min-width 0.25s ease;
        flex-shrink: 0;
      }
      #sidebar.collapsed {
        width: 0;
        min-width: 0;
      }

      #sidebar-content {
        width: 260px;
        flex: 1;
        overflow-y: auto;
        padding: 14px;
        display: flex;
        flex-direction: column;
        gap: 10px;
      }

      #sidebar-toggle {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
        border-radius: 8px;
        border: 1px solid var(--border);
        background: var(--surface2);
        color: var(--text);
        cursor: pointer;
        font-size: 16px;
        line-height: 1;
        transition:
          background 0.15s,
          border-color 0.15s,
          color 0.15s;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
      }
      #sidebar-toggle:hover {
        background: var(--accent);
        border-color: var(--accent);
        color: #fff;
      }

      .sb-label {
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        color: var(--muted);
      }

      #type-filter {
        width: 100%;
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: 8px;
        color: var(--text);
        padding: 8px 10px;
        font-size: 13px;
        outline: none;
        cursor: pointer;
      }
      #type-filter:focus {
        border-color: var(--accent);
      }
      #type-filter option {
        background: var(--surface);
      }

      #venue-count-label {
        font-size: 11px;
        color: var(--muted);
      }

      #venue-list {
        display: flex;
        flex-direction: column;
        gap: 3px;
      }

      .venue-item {
        display: flex;
        align-items: center;
        gap: 9px;
        padding: 8px 10px;
        border-radius: 8px;
        cursor: pointer;
        border: 1px solid transparent;
        transition:
          background 0.12s,
          border-color 0.12s;
      }
      .venue-item:hover {
        background: var(--surface2);
        border-color: var(--border);
      }
      .venue-item.active {
        background: var(--surface2);
        border-color: var(--accent);
      }
      .venue-item-icon {
        font-size: 15px;
        flex-shrink: 0;
        line-height: 1;
      }
      .venue-item-text {
        flex: 1;
        min-width: 0;
      }
      .venue-item-name {
        font-size: 12px;
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .venue-item-type {
        font-size: 10px;
        color: var(--muted);
        margin-top: 1px;
      }

      /* ── Waypoint marker ── */
      .waypoint-pin {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: rgba(0, 180, 216, 0.2);
        border: 2.5px solid #00b4d8;
        box-shadow: 0 0 0 0 rgba(0, 180, 216, 0.6);
        animation: wp-pulse 1.6s ease-out infinite;
      }
      @keyframes wp-pulse {
        0% {
          box-shadow: 0 0 0 0 rgba(0, 180, 216, 0.65);
        }
        70% {
          box-shadow: 0 0 0 18px rgba(0, 180, 216, 0);
        }
        100% {
          box-shadow: 0 0 0 0 rgba(0, 180, 216, 0);
        }
      }

      /* ── Popover ── */
      #popover {
        position: absolute;
        width: 300px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 12px;
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
        z-index: 2000;
        pointer-events: none;
        opacity: 0;
        transform: translateY(6px) scale(0.98);
        transition:
          opacity 0.18s ease,
          transform 0.18s ease;
        max-height: 420px;
        display: flex;
        flex-direction: column;
      }
      #popover.open {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
      }

      /* arrow pointing down toward the zone */
      #popover::after {
        content: "";
        position: absolute;
        bottom: -8px;
        left: 50%;
        transform: translateX(-50%);
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-top: 8px solid var(--surface);
      }
      #popover::before {
        content: "";
        position: absolute;
        bottom: -9px;
        left: 50%;
        transform: translateX(-50%);
        border-left: 9px solid transparent;
        border-right: 9px solid transparent;
        border-top: 9px solid var(--border);
      }
      #popover.arrow-up::after {
        bottom: auto;
        top: -8px;
        border-top: none;
        border-bottom: 8px solid var(--surface);
      }
      #popover.arrow-up::before {
        bottom: auto;
        top: -9px;
        border-top: none;
        border-bottom: 9px solid var(--border);
      }

      #pop-head {
        padding: 14px 14px 10px;
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 8px;
        flex-shrink: 0;
      }
      #pop-badge {
        display: inline-block;
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1px;
        padding: 2px 8px;
        border-radius: 20px;
        margin-bottom: 5px;
      }
      #pop-title {
        font-size: 14px;
        font-weight: 700;
        line-height: 1.35;
      }
      #pop-close {
        background: none;
        border: none;
        color: var(--muted);
        cursor: pointer;
        font-size: 16px;
        line-height: 1;
        padding: 2px;
        flex-shrink: 0;
        margin-top: 1px;
      }
      #pop-close:hover {
        color: var(--text);
      }

      #pop-body {
        overflow-y: auto;
        padding: 12px 14px;
        display: flex;
        flex-direction: column;
        gap: 12px;
      }
      #pop-img-wrap {
        position: relative;
        border-radius: 8px;
        overflow: hidden;
        margin-bottom: 2px;
        background: var(--surface2);
      }
      #pop-img-wrap.is-loading #pop-img {
        visibility: hidden;
        position: absolute;
        inset: 0;
      }
      .pop-img-loading {
        display: none;
        align-items: center;
        justify-content: center;
        min-height: 120px;
      }
      #pop-img-wrap.is-loading .pop-img-loading {
        display: flex;
      }
      .pop-img-spinner {
        width: 28px;
        height: 28px;
        border: 3px solid var(--border);
        border-top-color: var(--accent);
        border-radius: 50%;
        animation: pop-img-spin 0.7s linear infinite;
      }
      @keyframes pop-img-spin {
        to {
          transform: rotate(360deg);
        }
      }
      #pop-img {
        width: 100%;
        display: block;
        max-height: 160px;
        object-fit: cover;
      }
      #pop-desc {
        font-size: 12px;
        color: var(--muted);
        line-height: 1.65;
      }

      #pop-meta {
        display: flex;
        flex-direction: column;
        gap: 5px;
      }
      .pop-meta-row {
        display: flex;
        align-items: center;
        gap: 7px;
        font-size: 12px;
        color: var(--text);
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 6px;
        padding: 5px 9px;
      }
      .pop-meta-icon {
        font-size: 13px;
        flex-shrink: 0;
      }

      .section-label {
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        color: var(--muted);
        margin-bottom: 6px;
      }

      /* tenant cards in popover */
      .tc {
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 9px 11px;
        display: flex;
        gap: 9px;
        align-items: flex-start;
      }
      .tc-photo {
        width: 36px;
        height: 36px;
        border-radius: 6px;
        background: var(--border);
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 17px;
      }
      .tc-photo img {
        width: 36px;
        height: 36px;
        border-radius: 6px;
        object-fit: cover;
      }
      .tc-info {
        flex: 1;
        min-width: 0;
      }
      .tc-name {
        font-size: 12px;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .tc-tags {
        display: flex;
        gap: 4px;
        flex-wrap: wrap;
        margin-top: 4px;
      }
      .tag {
        font-size: 10px;
        padding: 1px 6px;
        border-radius: 20px;
        background: var(--bg);
        border: 1px solid var(--border);
        color: var(--muted);
        white-space: nowrap;
      }

      /* ── Mall View (full-screen overlay with sidebar) ── */
      #mall-view {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 8000;
        background: var(--bg);
      }
      #mall-view.open {
        display: flex;
        flex-direction: column;
      }
      #mall-content {
        flex: 1;
        display: flex;
        min-height: 0;
        position: relative;
      }

      /* left panel */
      #mall-panel {
        width: 260px;
        min-width: 260px;
        background: var(--surface);
        border-right: 1px solid var(--border);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        transition:
          width 0.25s ease,
          min-width 0.25s ease,
          transform 0.25s ease;
      }
      #mall-panel.collapsed {
        width: 0;
        min-width: 0;
      }
      #mall-back {
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 7px 14px;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
        color: var(--text);
        white-space: nowrap;
        flex-shrink: 0;
        transition:
          background 0.15s,
          border-color 0.15s;
      }
      #mall-back:hover {
        background: var(--accent);
        color: #fff;
        border-color: var(--accent);
      }
      #mall-panel-body {
        flex: 1;
        overflow: hidden;
        padding: 12px 14px;
        display: flex;
        flex-direction: column;
        gap: 8px;
        min-height: 0;
      }
      #mall-list-filter {
        width: 100%;
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: 8px;
        color: var(--text);
        padding: 7px 10px;
        font-size: 13px;
        outline: none;
        cursor: pointer;
      }
      #mall-list-filter:focus {
        border-color: var(--accent);
      }
      #mall-tenant-count {
        font-size: 11px;
        color: var(--muted);
      }
      #mall-tenant-list {
        display: flex;
        flex-direction: column;
        gap: 6px;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
      }
      .mall-level-accordion {
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--surface);
      }
      .mall-level-summary {
        list-style: none;
        cursor: pointer;
        padding: 8px 10px;
        font-size: 12px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: var(--text);
      }
      .mall-level-summary::-webkit-details-marker {
        display: none;
      }
      .mall-level-summary::after {
        content: "▾";
        font-size: 11px;
        color: var(--muted);
        transition: transform 0.12s ease;
      }
      .mall-level-accordion:not([open]) .mall-level-summary::after {
        transform: rotate(-90deg);
      }
      .mall-level-list {
        display: flex;
        flex-direction: column;
        gap: 3px;
        padding: 0 6px 6px;
      }
      .mall-tenant-item {
        padding: 8px 10px;
        border-radius: 8px;
        cursor: pointer;
        border: 1px solid transparent;
        transition:
          background 0.12s,
          border-color 0.12s;
      }
      .mall-tenant-item:hover {
        background: var(--surface2);
        border-color: var(--border);
      }
      .mall-tenant-item.active {
        background: var(--surface2);
        border-color: var(--accent);
      }
      .mti-name {
        font-size: 12px;
        font-weight: 600;
      }
      .mti-meta {
        font-size: 10px;
        color: var(--muted);
        margin-top: 2px;
      }

      /* right: toolbar + canvas */
      #mall-right {
        flex: 1;
        display: flex;
        flex-direction: column;
        position: relative;
        overflow: hidden;
        min-width: 0;
        min-height: 0;
      }
      #mall-toolbar {
        height: 56px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: center;
        padding: 0 14px;
        gap: 12px;
        flex-shrink: 0;
      }
      #mall-logo {
        display: flex;
        flex-direction: column;
        white-space: nowrap;
        flex-shrink: 0;
      }
      #mall-logo-title {
        font-size: 15px;
        font-weight: 700;
        letter-spacing: 0.5px;
      }
      #mall-logo-title span {
        color: var(--accent);
      }
      #mall-logo-sub {
        font-size: 10px;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 2px;
      }
      #mall-panel-toggle {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        border: 1px solid var(--border);
        background: var(--surface2);
        color: var(--text);
        font-size: 16px;
        line-height: 1;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        transition:
          background 0.15s,
          border-color 0.15s,
          color 0.15s;
      }
      #mall-panel-toggle:hover {
        background: var(--accent);
        border-color: var(--accent);
        color: #fff;
      }
      #mall-search-wrap {
        flex: 1;
        max-width: 420px;
        min-width: 0;
        position: relative;
      }
      #mall-level-tabs {
        position: absolute;
        top: 10px;
        left: 60px;
        z-index: 8250;
        display: flex;
        gap: 4px;
      }
      #mall-search {
        width: 100%;
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: 8px;
        color: var(--text);
        padding: 8px 12px 8px 34px;
        font-size: 13px;
        outline: none;
        transition: border-color 0.2s;
      }
      #mall-search::placeholder {
        color: var(--muted);
      }
      #mall-search:focus {
        border-color: var(--accent);
      }
      #mall-search-icon {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--muted);
        font-size: 14px;
        pointer-events: none;
      }
      #mall-search-dropdown {
        display: none;
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        right: 0;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 10px;
        overflow: hidden;
        z-index: 9999;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
        max-height: 300px;
        overflow-y: auto;
      }
      .ltab {
        padding: 6px 18px;
        border-radius: 6px;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
        border: 1px solid var(--border);
        background: var(--bg);
        color: var(--muted);
        transition: all 0.15s;
      }
      .ltab.active {
        background: var(--accent);
        color: #fff;
        border-color: var(--accent);
      }
      #mall-canvas-wrap {
        flex: 1;
        min-height: 0;
        overflow: visible;
        position: relative;
        cursor: grab;
        background: #ffffff;
        touch-action: none;
      }
      #mall-canvas-wrap.panning {
        cursor: grabbing !important;
      }
      #mall-canvas-wrap canvas {
        position: absolute;
        top: 0;
        left: 0;
      }
      #mall-zoom-controls {
        position: absolute;
        top: 10px;
        left: 12px;
        z-index: 8250;
        display: flex;
        flex-direction: column;
        border: 1px solid #bfc4cc;
        border-radius: 4px;
        overflow: hidden;
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.28);
      }
      #mall-zoom-controls button {
        border: none;
        border-bottom: 1px solid #bfc4cc;
        background: #fff;
        color: #333;
        width: 34px;
        height: 34px;
        cursor: pointer;
        font-size: 20px;
        font-weight: 500;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.15s;
      }
      #mall-zoom-controls button:hover {
        background: #f4f4f4;
      }
      #mall-zoom-controls button:last-child {
        border-bottom: none;
      }
      #mall-zoom-controls button.fit {
        width: 34px;
        height: 30px;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.3px;
      }

      /* ── Mall tenant popover ── */
      #mv-pop {
        position: absolute;
        width: 260px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 12px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
        z-index: 9100;
        display: none;
        pointer-events: auto;
        opacity: 0;
        transform: translateY(6px) scale(0.98);
        transition:
          opacity 0.15s ease,
          transform 0.15s ease;
      }
      #mv-pop.open {
        display: block;
        opacity: 1;
        transform: translateY(0) scale(1);
      }
      #mv-pop::after {
        content: "";
        position: absolute;
        bottom: -8px;
        left: 50%;
        transform: translateX(-50%);
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-top: 8px solid var(--surface);
      }
      #mv-pop::before {
        content: "";
        position: absolute;
        bottom: -9px;
        left: 50%;
        transform: translateX(-50%);
        border-left: 9px solid transparent;
        border-right: 9px solid transparent;
        border-top: 9px solid var(--border);
      }
      #mv-pop.arrow-up::after {
        bottom: auto;
        top: -8px;
        border-top: none;
        border-bottom: 8px solid var(--surface);
      }
      #mv-pop.arrow-up::before {
        bottom: auto;
        top: -9px;
        border-top: none;
        border-bottom: 9px solid var(--border);
      }
      #mv-pop-head {
        padding: 12px 12px 8px;
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 8px;
      }
      #mv-pop-badge {
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1px;
        padding: 2px 8px;
        border-radius: 20px;
        display: inline-block;
        margin-bottom: 4px;
      }
      #mv-pop-name {
        font-size: 13px;
        font-weight: 700;
        line-height: 1.3;
      }
      #mv-pop-close {
        background: none;
        border: none;
        color: var(--muted);
        cursor: pointer;
        font-size: 15px;
        flex-shrink: 0;
        padding: 2px;
      }
      #mv-pop-close:hover {
        color: var(--text);
      }
      #mv-pop-body {
        padding: 10px 12px;
        display: flex;
        flex-direction: column;
        gap: 6px;
      }
      .mv-pop-row {
        font-size: 11px;
        color: var(--text);
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 6px;
        padding: 4px 8px;
        display: flex;
        align-items: center;
        gap: 6px;
      }
      #mv-pop-desc {
        font-size: 11px;
        color: var(--muted);
        line-height: 1.55;
      }
      #mv-pop-img-wrap {
        width: 100%;
        height: 140px;
        overflow: hidden;
        border-radius: 8px;
        background: var(--surface2);
        flex-shrink: 0;
      }
      #mv-pop-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
      }

      /* ── Sparkle effect ── */
      .sparkle-container {
        position: absolute;
        pointer-events: none;
        z-index: 1500;
        transform: translate(-50%, -50%);
      }
      .sparkle-particle {
        position: absolute;
        border-radius: 50%;
        top: 0;
        left: 0;
        animation: sparkle-burst 0.6s ease-out forwards;
      }
      @keyframes sparkle-burst {
        0% {
          transform: translate(0, 0) scale(1);
          opacity: 1;
        }
        100% {
          transform: translate(var(--tx), var(--ty)) scale(0);
          opacity: 0;
        }
      }
      .sparkle-ring {
        position: absolute;
        border-radius: 50%;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0);
        animation: sparkle-ring 0.5s ease-out forwards;
      }
      @keyframes sparkle-ring {
        0% {
          transform: translate(-50%, -50%) scale(0);
          opacity: 0.9;
        }
        100% {
          transform: translate(-50%, -50%) scale(1);
          opacity: 0;
        }
      }

      .sparkle-special .sparkle-ring-special {
        animation: sparkle-ring-special 0.7s ease-out forwards;
      }
      @keyframes sparkle-ring-special {
        0% {
          transform: translate(-50%, -50%) scale(0);
          opacity: 1;
        }
        60% {
          opacity: 0.7;
        }
        100% {
          transform: translate(-50%, -50%) scale(1.15);
          opacity: 0;
        }
      }
      .sparkle-particle-special {
        animation: sparkle-burst-special 0.75s ease-out forwards;
      }
      @keyframes sparkle-burst-special {
        0% {
          transform: translate(0, 0) scale(1.2);
          opacity: 1;
        }
        100% {
          transform: translate(var(--tx), var(--ty)) scale(0);
          opacity: 0;
        }
      }
      .sparkle-star {
        position: absolute;
        top: 0;
        left: 0;
        font-size: 18px;
        line-height: 1;
        color: #ffd700;
        text-shadow: 0 0 6px #ffed3b, 0 0 12px #ff9f1c;
        pointer-events: none;
        animation: sparkle-star-burst 0.8s ease-out forwards;
      }
      @keyframes sparkle-star-burst {
        0% {
          transform: translate(0, 0) scale(0) rotate(0deg);
          opacity: 1;
        }
        100% {
          transform: translate(var(--tx), var(--ty)) scale(1.1) rotate(180deg);
          opacity: 0;
        }
      }

      /* ── GPS Button ── */
      #gps-btn {
        position: absolute;
        top: 12px;
        right: 12px;
        z-index: 1000;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        background: var(--surface);
        border: 1px solid var(--border);
        color: var(--muted);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
        transition:
          background 0.15s,
          border-color 0.15s,
          color 0.15s;
        padding: 0;
      }
      #gps-btn:hover {
        background: var(--surface2);
        color: var(--text);
      }
      #gps-btn.active {
        border-color: #2563eb;
        color: #2563eb;
        background: #dbeeff;
      }
      #gps-btn.searching {
        animation: gps-btn-blink 1.1s ease-in-out infinite;
      }
      @keyframes gps-btn-blink {
        0%,
        100% {
          opacity: 1;
        }
        50% {
          opacity: 0.4;
        }
      }

      /* ── User location pin (GPS) ── */
      .gps-pin {
        position: relative;
        width: 32px;
        height: 40px;
      }
      .gps-pin svg {
        position: absolute;
        inset: 0;
        width: 32px;
        height: 40px;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
        animation: gps-pin-bob 1.8s ease-in-out infinite;
      }
      .gps-pin::after {
        content: "";
        position: absolute;
        bottom: -3px;
        left: 50%;
        width: 16px;
        height: 6px;
        background: rgba(37, 99, 235, 0.55);
        border-radius: 50%;
        filter: blur(2px);
        transform: translateX(-50%);
        animation: gps-pin-shadow 1.8s ease-in-out infinite;
      }
      @keyframes gps-pin-bob {
        0%,
        100% {
          transform: translateY(0);
        }
        50% {
          transform: translateY(-4px);
        }
      }
      @keyframes gps-pin-shadow {
        0%,
        100% {
          transform: translateX(-50%) scale(1);
          opacity: 0.55;
        }
        50% {
          transform: translateX(-50%) scale(0.7);
          opacity: 0.3;
        }
      }

      /* legend */
      #legend {
        position: absolute;
        bottom: 16px;
        left: 16px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 10px 12px;
        z-index: 1000;
        font-size: 12px;
        display: flex;
        flex-direction: column;
        gap: 6px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
      }
      #legend-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        cursor: pointer;
        user-select: none;
      }
      #legend-label {
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        color: var(--muted);
      }
      #legend-toggle {
        background: none;
        border: none;
        color: var(--muted);
        cursor: pointer;
        font-size: 12px;
        padding: 0;
        line-height: 1;
        transition: transform 0.2s;
        flex-shrink: 0;
      }
      #legend-toggle:hover {
        color: var(--text);
      }
      #legend.collapsed #legend-items {
        display: none;
      }
      #legend.collapsed #legend-toggle {
        transform: rotate(-90deg);
      }
      #legend-items {
        display: flex;
        flex-direction: column;
        gap: 6px;
      }
      .legend-item {
        display: flex;
        align-items: center;
        gap: 8px;
      }
      .legend-dot {
        width: 12px;
        height: 12px;
        border-radius: 3px;
        flex-shrink: 0;
      }

      /* ── Floor Plan button (in popover) ── */
      .fp-btn {
        width: 100%;
        padding: 10px 14px;
        background: var(--accent);
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
        transition: opacity 0.2s;
        text-align: center;
      }
      .fp-btn:hover {
        opacity: 0.85;
      }

      /* ── Mall header button ── */
      #mall-btn {
        padding: 7px 14px;
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 8px;
        font-size: 12px;
        font-weight: 700;
        color: var(--text);
        cursor: pointer;
        white-space: nowrap;
        transition:
          background 0.15s,
          border-color 0.15s;
        flex-shrink: 0;
      }
      #mall-btn:hover {
        background: var(--accent);
        color: #fff;
        border-color: var(--accent);
      }

      /* ── Mobile ── */
      @media (max-width: 640px) {
        #header {
          height: 50px;
          padding: 0 8px;
          gap: 8px;
        }
        #main {
          height: calc(100vh - 50px);
          height: calc(100dvh - 50px);
          position: relative;
        }
        #logo-title {
          font-size: 12px;
        }
        #logo-title span {
          display: none;
        }
        #logo-sub {
          display: none;
        }
        #mall-btn {
          padding: 6px 9px;
          font-size: 11px;
          min-width: 0;
        }
        #search-wrap {
          max-width: none;
        }
        #search {
          font-size: 13px;
          padding: 8px 10px 8px 30px;
        }
        #search-icon {
          left: 9px;
        }
        #popover {
          width: calc(100vw - 20px);
          max-width: calc(100vw - 20px);
          left: 10px !important;
        }
        #sidebar {
          position: absolute;
          top: 0;
          left: 0;
          bottom: 0;
          z-index: 2200;
          width: min(82vw, 300px);
          min-width: 0;
          box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
          border-right: 1px solid var(--border);
          transform: translateX(0);
        }
        #sidebar-content {
          width: 100%;
        }
        #sidebar.collapsed {
          width: min(82vw, 300px);
          min-width: 0;
          transform: translateX(calc(-100% - 1px));
        }
        #sidebar-toggle {
          width: 30px;
          height: 30px;
          border-radius: 7px;
        }
        #legend {
          bottom: 10px;
          left: 10px;
          font-size: 11px;
          padding: 8px 10px;
        }
        #gps-btn {
          top: 10px;
          right: 10px;
        }
        #mall-toolbar {
          height: 50px;
        }
        #mall-view {
          position: fixed;
        }
        #mall-panel {
          position: absolute;
          top: 0;
          bottom: 0;
          left: 0;
          z-index: 9200;
          width: min(82vw, 300px);
          min-width: 0;
          box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
        }
        #mall-panel.collapsed {
          width: min(82vw, 300px);
          min-width: 0;
          transform: translateX(calc(-100% - 1px));
        }
        #mall-panel-body {
          padding: 10px;
        }
        #mall-toolbar {
          padding: 0 10px;
          gap: 8px;
        }
        #mall-logo-title {
          font-size: 12px;
        }
        #mall-logo-sub {
          display: none;
        }
        #mall-back {
          padding: 6px 9px;
          font-size: 11px;
          min-width: 0;
        }
        #mall-panel-toggle {
          width: 30px;
          height: 30px;
          border-radius: 7px;
        }
        #mall-search-wrap {
          max-width: none;
        }
        #mall-search {
          font-size: 13px;
          padding: 8px 10px 8px 30px;
        }
        #mall-search-icon {
          left: 9px;
        }
        #mall-level-tabs {
          top: 8px;
          left: 58px;
          z-index: 8260;
        }
        #mall-zoom-controls {
          top: 8px;
          left: 10px;
          z-index: 8260;
        }
        #mall-zoom-controls button {
          width: 32px;
          height: 32px;
        }
        #mall-zoom-controls button.fit {
          width: 32px;
          height: 28px;
        }
      }
