/* Externalized from map/index.html for CSP. */
:root {
            --panel: rgba(17, 24, 39, .95);
            --text: #e5e7eb;
            --muted: #9ca3af;
            --accent: #2563eb;
            --accentHover: #1d4ed8;
            --nav-z: 120;
            --top-nav-h: calc(56px + env(safe-area-inset-top));
            --bottom-nav-h: 64px;
            --map-popup-max-h: min(700px, calc(100dvh - var(--top-nav-h) - 40px));
        }

        * {
            box-sizing: border-box;
        }

        html,
        body {
            height: 100%;
        }

        body {
            margin: 0;
            background: #0d1117;
            color: var(--text);
            font-family: var(--seen-font);
            overflow: hidden;
        }

        /* Map */
        #map,
        #mapLoadingOverlay {
            position: fixed;
            top: var(--top-nav-h);
            /* below nav */
            left: 0;
            right: 0;
            bottom: 0;
        }

        /* Neutralize tile color without affecting markers/popups */
        #map .maplibregl-canvas {
            filter: grayscale(1) saturate(0) contrast(1.12) brightness(0.94);
        }

        #map::after {
            content: '';
            position: absolute;
            inset: 0;
            background: rgba(0, 0, 0, 0.18);
            pointer-events: none;
            z-index: 0;
        }

        #mapLoadingOverlay {
            z-index: 45;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 16px;
            pointer-events: none;
            background:
                radial-gradient(120% 80% at 50% 100%, rgba(15, 23, 42, 0.5), rgba(15, 23, 42, 0) 70%),
                linear-gradient(180deg, rgba(15, 23, 42, 0.32), rgba(15, 23, 42, 0.1));
            opacity: 1;
            visibility: visible;
            transition: opacity .24s ease, visibility .24s ease;
        }

        #mapLoadingOverlay.is-hidden {
            opacity: 0;
            visibility: hidden;
        }

        .map-loading-card {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 11px 14px;
            border-radius: 999px;
            border: 1px solid rgba(148, 163, 184, 0.35);
            background: rgba(15, 23, 42, 0.86);
            color: #e5e7eb;
            font-size: 13px;
            font-weight: 700;
            box-shadow: 0 10px 30px rgba(2, 6, 23, 0.35);
            backdrop-filter: blur(6px);
        }

        .map-loading-spinner {
            width: 13px;
            height: 13px;
            border-radius: 50%;
            border: 2px solid rgba(148, 163, 184, 0.45);
            border-top-color: #ffffff;
            animation: mapLoadingSpin 0.8s linear infinite;
            flex: 0 0 auto;
        }

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

        .maplibregl-marker {
            z-index: 2 !important;
        }

        .maplibregl-popup {
            z-index: 86 !important;
        }

        /* -----------------------------
   Bottom nav (mobile)
------------------------------*/
        .bottom-nav {
            position: fixed;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 80;
            height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
            padding: 6px 10px calc(env(safe-area-inset-bottom) + 6px);
            background: linear-gradient(to top,
                    rgba(15, 23, 42, .95),
                    rgba(15, 23, 42, .65),
                    transparent);
            backdrop-filter: blur(10px);
            border-top: 1px solid rgba(148, 163, 184, .22);
            display: flex;
            flex-direction: column;
            justify-content: center;
            gap: 4px;
        }


        .bottom-nav-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            width: 100%;
            max-width: 520px;
            margin: 0 auto;
        }

        .bn-link {
            flex: 1 1 0;
            text-align: center;
            padding: 8px 10px;
            border-radius: 999px;
            text-decoration: none;
            color: rgba(229, 231, 235, .92);
            font-weight: 800;
            font-size: 12px;
            border: 1px solid rgba(148, 163, 184, .22);
            background: rgba(17, 24, 39, .55);
        }

        .bn-link:hover {
            background: rgba(148, 163, 184, .18);
        }

        .bn-link.active {
            background: rgba(37, 99, 235, .95);
            border-color: rgba(37, 99, 235, .65);
            color: #fff;
        }

        .bottom-nav-status {
            text-align: center;
            color: rgba(156, 163, 175, 0.95);
            font-size: 11px;
            font-weight: 750;
            text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
            line-height: 1.1;
            min-height: 11px;
        }

        /* Desktop: hide bottom nav */
        @media (min-width:641px) {
            .bottom-nav {
                display: none;
            }
        }

        /* Lift map controls above bottom nav on mobile PWA */
        @media (max-width: 640px) {

            .maplibregl-ctrl-bottom-right,
            .maplibregl-ctrl-bottom-left {
                bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 8px) !important;
            }
        }

        /* Keep attribution tucked at the very bottom on mobile */
        @media (max-width: 640px) {
            .maplibregl-ctrl-attrib {
                bottom: 4px !important;
                right: 8px !important;
                top: auto !important;
            }
        }

        /* Bottom status */
        .status {
            position: fixed;
            bottom: 104px;
            left: 0;
            right: 0;
            text-align: center;
            color: var(--muted);
            font-size: 12px;
            width: fit-content;
            max-width: min(440px, calc(100vw - 28px));
            margin: 0 auto;
            padding: 8px 12px;
            border-radius: 999px;
            border: 1px solid rgba(148, 163, 184, 0.24);
            background: rgba(2, 6, 23, 0.76);
            box-shadow: 0 10px 26px rgba(2, 6, 23, 0.28);
            backdrop-filter: blur(10px);
            z-index: 60;
            pointer-events: none;
            text-shadow: 0 1px 2px rgba(0, 0, 0, .7);
        }

        /* Avatar map pins */
        .avatar-pin {
            width: 44px;
            height: 44px;
            border-radius: 12px;
            border: 2px solid rgba(148, 163, 184, 0.55);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
            background: rgba(255, 255, 255, 0.10);
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .avatar-pin.is-active {
            border-color: #22c55e;
            box-shadow:
                0 0 0 4px rgba(34, 197, 94, 0.25),
                0 0 18px rgba(34, 197, 94, 0.65),
                0 8px 20px rgba(0, 0, 0, 0.45);
        }

        .avatar-pin.is-recent {
            border-color: #f59e0b;
            box-shadow:
                0 0 0 4px rgba(245, 158, 11, 0.22),
                0 0 16px rgba(245, 158, 11, 0.6),
                0 8px 20px rgba(0, 0, 0, 0.45);
        }

        .avatar-pin.is-offline {
            border-color: rgba(148, 163, 184, 0.55);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
        }

        .avatar-pin.me.is-active {
            animation: mePulse 2.8s ease-in-out infinite;
        }

        @keyframes mePulse {

            0%,
            100% {
                box-shadow:
                    0 0 0 4px rgba(34, 197, 94, 0.22),
                    0 0 16px rgba(34, 197, 94, 0.55),
                    0 8px 20px rgba(0, 0, 0, 0.45);
            }

            50% {
                box-shadow:
                    0 0 0 6px rgba(34, 197, 94, 0.32),
                    0 0 26px rgba(34, 197, 94, 0.85),
                    0 8px 20px rgba(0, 0, 0, 0.45);
            }
        }

        .avatar-pin img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
            pointer-events: none;
        }

        .avatar-pin .fallback {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 800;
            font-size: 14px;
            color: rgba(255, 255, 255, 0.85);
            background: rgba(59, 130, 246, 0.35);
            pointer-events: none;
        }

        .avatar-pin-count {
            position: absolute;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 16px;
            padding: 0 5px;
            border-radius: 999px;
            font-size: 9px;
            font-weight: 900;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            line-height: 1;
            pointer-events: none;
            backdrop-filter: blur(8px);
        }

        .avatar-pin-count {
            left: -4px;
            bottom: -4px;
            min-width: 18px;
            border: 1px solid rgba(236, 72, 153, 0.42);
            background: rgba(91, 33, 182, 0.92);
            color: #fdf2f8;
        }

        /* -----------------------------
            Popups: match Seen UI
        ------------------------------*/
        .maplibregl-popup-content {
            background: transparent;
            color: var(--text);
            border: none;
            border-radius: 16px;
            box-shadow: none;
            padding: 0;
            backdrop-filter: none;
            overflow: visible;
            max-height: var(--map-popup-max-h);
            pointer-events: auto;
        }

        .maplibregl-popup {
            max-width: min(460px, calc(100vw - 34px)) !important;
            overflow: visible;
        }

        .maplibregl-popup-tip {
            border-top-color: rgba(11, 59, 159, 0.95) !important;
            border-bottom-color: rgba(11, 59, 159, 0.95) !important;
        }

        /* Bigger, more tappable close button */
        .maplibregl-popup-close-button {
            width: 36px;
            height: 36px;
            font-size: 22px;
            line-height: 34px;
            border-radius: 12px;
            color: rgba(229, 231, 235, 0.9);
            background: rgba(2, 6, 23, 0.85);
            border: 1px solid rgba(148, 163, 184, 0.25);
            box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
            top: -18px;
            right: -18px;
        }

        .maplibregl-popup-close-button:hover {
            background: rgba(2, 6, 23, 0.95);
            color: rgba(255, 255, 255, 0.95);
        }

        .profile-pop {
            width: min(460px, calc(100vw - 34px));
            max-width: calc(100vw - 34px);
            --profile-pop-icon-like: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10v12'/%3E%3Cpath d='M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z'/%3E%3C/svg%3E");
            --profile-pop-icon-user: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21a8 8 0 0 0-16 0'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
            --profile-pop-icon-menu: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h16'/%3E%3Cpath d='M4 6h16'/%3E%3Cpath d='M4 18h16'/%3E%3C/svg%3E");
            --profile-pop-icon-chat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a4 4 0 0 1-4 4H7l-4 4V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z'/%3E%3C/svg%3E");
            background:
                radial-gradient(106% 74% at 16% 0%, rgba(96, 165, 250, 0.32), transparent 58%),
                linear-gradient(160deg, rgba(10, 18, 40, 0.98), rgba(15, 23, 42, 0.96));
            border-radius: 24px;
            border: 1px solid rgba(96, 165, 250, 0.28);
            padding: 12px;
            display: grid;
            gap: 10px;
            box-shadow: 0 24px 58px rgba(3, 7, 18, 0.62);
            max-height: var(--map-popup-max-h);
            overflow-y: auto;
            overscroll-behavior-y: contain;
            overscroll-behavior: contain;
            -webkit-overflow-scrolling: touch;
            scrollbar-gutter: stable both-edges;
            touch-action: pan-y pinch-zoom;
        }

        .profile-pop-media {
            display: grid;
            grid-template-columns: minmax(0, 1.22fr) minmax(0, 0.9fr);
            gap: 8px;
        }

        .profile-pop-main {
            position: relative;
            border-radius: 15px;
            overflow: hidden;
            background: rgba(2, 6, 23, 0.42);
            border: 1px solid rgba(148, 163, 184, 0.26);
            min-height: 152px;
            display: grid;
            place-items: center;
        }

        .profile-pop-main::after {
            content: '';
            position: absolute;
            inset: auto 0 0 0;
            height: 40%;
            background: linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.52));
            pointer-events: none;
        }

        .profile-pop-main img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .profile-pop-main img.is-default {
            object-fit: contain;
            padding: 16px;
            opacity: 0.9;
        }

        .profile-pop-thumbs {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 7px;
            align-content: start;
        }

        .profile-pop-thumb {
            border-radius: 11px;
            background: rgba(2, 6, 23, 0.38);
            border: 1px solid rgba(148, 163, 184, 0.24);
            min-height: 72px;
            display: grid;
            place-items: center;
            overflow: hidden;
            cursor: pointer;
            transition: transform 0.16s ease, border-color 0.16s ease;
        }

        .profile-pop-thumb:hover {
            transform: translateY(-1px);
            border-color: rgba(96, 165, 250, 0.58);
        }

        .profile-pop-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .profile-pop-thumb.is-empty {
            opacity: 0.45;
            cursor: default;
        }

        .profile-pop-thumb.is-empty img {
            display: none;
        }

        .profile-pop-info {
            display: grid;
            gap: 7px;
        }

        .profile-pop-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 8px;
            flex-wrap: wrap;
        }

        .profile-pop-name {
            display: flex;
            align-items: baseline;
            gap: 6px;
            flex-wrap: wrap;
            font-weight: 900;
            font-size: clamp(18px, 2.3vw, 24px);
            line-height: 1.08;
            letter-spacing: -0.01em;
        }

        .profile-pop-age {
            color: rgba(191, 219, 254, 0.86);
            font-size: 13px;
            font-weight: 700;
        }

        .profile-pop-status {
            display: inline-flex;
            align-items: center;
            min-height: 26px;
            padding: 0 9px;
            border-radius: 999px;
            border: 1px solid rgba(148, 163, 184, 0.26);
            background: rgba(15, 23, 42, 0.52);
            color: rgba(226, 232, 240, 0.95);
            font-size: 10px;
            font-weight: 900;
            letter-spacing: 0.05em;
            text-transform: uppercase;
        }

        .profile-pop-status.is-active {
            border-color: rgba(34, 197, 94, 0.42);
            background: rgba(6, 95, 70, 0.32);
            color: #dcfce7;
        }

        .profile-pop-status.is-recent {
            border-color: rgba(245, 158, 11, 0.42);
            background: rgba(120, 53, 15, 0.28);
            color: #fef3c7;
        }

        .profile-pop-status.is-offline {
            border-color: rgba(148, 163, 184, 0.24);
            background: rgba(15, 23, 42, 0.44);
            color: rgba(226, 232, 240, 0.88);
        }

        .profile-pop-status.is-self {
            border-color: rgba(96, 165, 250, 0.42);
            background: rgba(30, 64, 175, 0.24);
            color: #dbeafe;
        }

        .profile-pop-subline {
            color: rgba(226, 232, 240, 0.9);
            font-size: 12px;
            font-weight: 700;
            line-height: 1.35;
        }

        .profile-pop-supportline {
            color: rgba(148, 163, 184, 0.96);
            font-size: 11px;
            font-weight: 700;
            line-height: 1.35;
        }

        .profile-pop-facts {
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
            min-height: 0;
        }

        .profile-pop-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
            min-height: 0;
        }

        .profile-pop-chip {
            display: inline-flex;
            align-items: center;
            padding: 4px 8px;
            border-radius: 999px;
            border: 1px solid rgba(96, 165, 250, 0.3);
            background: rgba(30, 58, 138, 0.24);
            color: rgba(219, 234, 254, 0.96);
            font-size: 10px;
            font-weight: 800;
            letter-spacing: 0.03em;
            text-transform: uppercase;
        }

        .profile-pop-chip.is-distance {
            border-color: rgba(34, 211, 238, 0.3);
            background: rgba(8, 47, 73, 0.42);
            color: #cffafe;
        }

        .profile-pop-chip.is-new {
            border-color: rgba(244, 114, 182, 0.36);
            background: rgba(131, 24, 67, 0.28);
            color: #fce7f3;
        }

        .profile-pop-chip.is-plus {
            border-color: rgba(96, 165, 250, 0.34);
            background: rgba(30, 64, 175, 0.28);
            color: #dbeafe;
        }

        .profile-pop-chip.is-activity {
            border-color: rgba(34, 197, 94, 0.3);
            background: rgba(6, 78, 59, 0.32);
            color: #dcfce7;
        }

        .profile-pop-chip.is-activity.is-recent {
            border-color: rgba(245, 158, 11, 0.3);
            background: rgba(120, 53, 15, 0.3);
            color: #fef3c7;
        }

        .profile-pop-chip.is-activity.is-offline {
            border-color: rgba(148, 163, 184, 0.24);
            background: rgba(15, 23, 42, 0.44);
            color: rgba(226, 232, 240, 0.9);
        }

        .profile-pop-bio {
            color: rgba(226, 232, 240, 0.9);
            font-size: 12px;
            line-height: 1.38;
            white-space: pre-wrap;
            max-height: 72px;
            overflow: auto;
            padding: 8px 9px;
            border-radius: 11px;
            border: 1px solid rgba(148, 163, 184, 0.18);
            background: rgba(2, 6, 23, 0.3);
        }

        .profile-pop-actions {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 7px;
            align-items: center;
        }

        .profile-pop-gear {
            width: 100%;
            min-height: 36px;
            border-radius: 8px;
            border: 1px solid rgba(125, 169, 242, 0.28);
            background:
                linear-gradient(180deg, rgba(45, 84, 158, 0.88), rgba(31, 65, 132, 0.9));
            color: rgba(219, 234, 254, 0.96);
            font-size: 12px;
            font-weight: 800;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            cursor: pointer;
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.09),
                0 8px 18px rgba(2, 6, 23, 0.2);
            transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
        }

        .profile-pop-gear:hover {
            transform: translateY(-1px);
            border-color: rgba(147, 197, 253, 0.5);
            background:
                linear-gradient(180deg, rgba(55, 98, 180, 0.94), rgba(35, 74, 148, 0.94));
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.12),
                0 10px 22px rgba(2, 6, 23, 0.25);
        }

        .profile-pop-btn {
            border: 1px solid rgba(125, 169, 242, 0.28);
            border-radius: 8px;
            padding: 9px 9px;
            font-weight: 800;
            font-size: 12px;
            cursor: pointer;
            text-align: center;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            min-height: 36px;
            min-width: 0;
            width: 100%;
            white-space: nowrap;
            line-height: 1.08;
            color: rgba(219, 234, 254, 0.96);
            background:
                linear-gradient(180deg, rgba(45, 84, 158, 0.88), rgba(31, 65, 132, 0.9));
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.09),
                0 8px 18px rgba(2, 6, 23, 0.2);
            transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
        }

        .profile-pop-btn::before,
        .profile-pop-gear::before {
            content: '';
            width: 14px;
            height: 14px;
            flex: 0 0 auto;
            background: currentColor;
            opacity: 0.72;
            -webkit-mask: var(--profile-pop-action-icon) center / contain no-repeat;
            mask: var(--profile-pop-action-icon) center / contain no-repeat;
        }

        .profile-pop-btn:hover {
            transform: translateY(-1px);
            border-color: rgba(147, 197, 253, 0.5);
            background:
                linear-gradient(180deg, rgba(55, 98, 180, 0.94), rgba(35, 74, 148, 0.94));
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.12),
                0 10px 22px rgba(2, 6, 23, 0.25);
        }

        .profile-pop-btn:focus,
        .profile-pop-gear:focus {
            outline: none;
        }

        .profile-pop-btn:focus-visible,
        .profile-pop-gear:focus-visible {
            border-color: rgba(191, 219, 254, 0.78);
            box-shadow:
                0 0 0 2px rgba(96, 165, 250, 0.28),
                inset 0 1px 0 rgba(255, 255, 255, 0.12),
                0 10px 22px rgba(2, 6, 23, 0.25);
        }

        .profile-pop-btn.profile {
            --profile-pop-action-icon: var(--profile-pop-icon-user);
        }

        .profile-pop-btn.chat {
            --profile-pop-action-icon: var(--profile-pop-icon-chat);
        }

        .profile-pop-btn.seen {
            --profile-pop-action-icon: var(--profile-pop-icon-like);
        }

        .profile-pop-btn.seen.is-added {
            background:
                linear-gradient(180deg, rgba(23, 126, 72, 0.86), rgba(16, 105, 67, 0.9));
            border-color: rgba(74, 222, 128, 0.42);
            color: #dcfce7;
        }

        .profile-pop-btn.seen.is-pending {
            background:
                linear-gradient(180deg, rgba(161, 98, 7, 0.88), rgba(120, 73, 15, 0.92));
            border-color: rgba(251, 191, 36, 0.48);
            color: #fff7d6;
        }

        .profile-pop-gear {
            --profile-pop-action-icon: var(--profile-pop-icon-menu);
        }

        .profile-pop-menu-btn.is-added {
            background:
                linear-gradient(180deg, rgba(23, 126, 72, 0.86), rgba(16, 105, 67, 0.9));
            color: #dcfce7;
            border-color: rgba(74, 222, 128, 0.42);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
        }

        .profile-pop-menu-btn.is-pending {
            background:
                linear-gradient(180deg, rgba(161, 98, 7, 0.88), rgba(120, 73, 15, 0.92));
            color: #fff7d6;
            border-color: rgba(251, 191, 36, 0.48);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
        }

        .profile-pop-btn[disabled] {
            opacity: 0.55;
            cursor: not-allowed;
        }

        .profile-pop-menu {
            display: none;
            background: rgba(15, 23, 42, 0.78);
            border-radius: 18px;
            padding: 10px;
            border: 1px solid rgba(148, 163, 184, 0.26);
            gap: 8px;
        }

        .profile-pop-menu.open {
            display: grid;
        }

        .profile-pop-menu-title {
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            text-align: center;
        }

        .profile-pop-menu-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 8px;
        }

        .profile-pop-menu-btn {
            border-radius: 8px;
            border: 1px solid rgba(125, 169, 242, 0.2);
            padding: 8px 7px;
            font-weight: 800;
            font-size: 12px;
            background:
                linear-gradient(180deg, rgba(30, 58, 120, 0.82), rgba(17, 36, 82, 0.88));
            color: rgba(219, 234, 254, 0.96);
            cursor: pointer;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
        }

        .profile-pop-menu-btn:hover {
            border-color: rgba(147, 197, 253, 0.42);
            background:
                linear-gradient(180deg, rgba(44, 83, 158, 0.9), rgba(29, 64, 132, 0.92));
        }

        .profile-pop-menu-btn:focus {
            outline: none;
        }

        .profile-pop-menu-btn:focus-visible {
            border-color: rgba(191, 219, 254, 0.72);
            box-shadow:
                0 0 0 2px rgba(96, 165, 250, 0.24),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
        }

        @media (max-width: 640px) {
            .profile-pop {
                width: min(420px, calc(100vw - 22px));
                max-width: calc(100vw - 22px);
                border-radius: 20px;
                padding: 10px;
                gap: 8px;
            }

            .profile-pop-media {
                grid-template-columns: minmax(0, 1.14fr) minmax(0, 0.86fr);
                gap: 7px;
            }

            .profile-pop-thumbs {
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 6px;
            }

            .profile-pop-main {
                min-height: clamp(122px, 26vh, 148px);
            }

            .profile-pop-thumb {
                min-height: 56px;
            }

            .profile-pop-name {
                font-size: clamp(17px, 4.8vw, 21px);
                gap: 5px;
            }

            .profile-pop-status {
                min-height: 23px;
                padding: 0 8px;
            }

            .profile-pop-actions {
                gap: 6px;
            }

            .profile-pop-btn,
            .profile-pop-gear {
                min-height: 34px;
                font-size: 12px;
            }

            .profile-pop-btn {
                padding: 7px 8px;
            }

            .profile-pop-menu {
                border-radius: 15px;
                padding: 9px;
            }

            .profile-pop-menu-grid {
                gap: 7px;
            }

            .profile-pop-menu-btn {
                border-radius: 10px;
                padding: 8px 6px;
                font-size: 12px;
            }
        }

        @media (max-width: 640px) and (max-height: 860px) {
            .profile-pop {
                width: min(408px, calc(100vw - 18px));
                max-width: calc(100vw - 18px);
                border-radius: 18px;
                padding: 9px;
                gap: 7px;
            }

            .profile-pop-media {
                gap: 6px;
            }

            .profile-pop-main {
                min-height: clamp(104px, 22vh, 128px);
            }

            .profile-pop-thumb {
                min-height: 50px;
            }

            .profile-pop-name {
                font-size: clamp(16px, 4.5vw, 20px);
            }

            .profile-pop-subline,
            .profile-pop-supportline {
                font-size: 11px;
            }

            .profile-pop-chip {
                padding: 3px 7px;
                font-size: 9px;
            }

            .profile-pop-bio {
                max-height: 56px;
                padding: 7px 8px;
                font-size: 11px;
            }

            .profile-pop-actions {
                gap: 5px;
            }

            .profile-pop-btn,
            .profile-pop-gear {
                min-height: 32px;
                font-size: 11px;
                padding: 7px 7px;
            }

            .profile-pop-menu {
                border-radius: 14px;
                padding: 8px;
            }

            .profile-pop-menu-grid {
                gap: 6px;
            }

            .profile-pop-menu-btn {
                padding: 7px 6px;
                font-size: 11px;
            }
        }

        @media (max-width: 640px) and (max-height: 760px) {
            .profile-pop {
                width: min(392px, calc(100vw - 16px));
                max-width: calc(100vw - 16px);
                padding: 8px;
                gap: 6px;
            }

            .profile-pop-main {
                min-height: clamp(92px, 20vh, 114px);
            }

            .profile-pop-thumb {
                min-height: 44px;
            }

            .profile-pop-name {
                font-size: 16px;
                gap: 4px;
            }

            .profile-pop-age,
            .profile-pop-subline,
            .profile-pop-supportline {
                font-size: 10px;
            }

            .profile-pop-status {
                min-height: 20px;
                padding: 0 7px;
                font-size: 9px;
            }

            .profile-pop-bio {
                max-height: 48px;
            }
        }

        .profile-pop-menu-btn[disabled] {
            opacity: 0.55;
            cursor: not-allowed;
        }

        .profile-pop-menu-btn.danger {
            color: #fca5a5;
        }

        /* Gallery modal */
        .modal {
            position: fixed;
            inset: 0;
            z-index: 999;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 16px;
            background: rgba(0, 0, 0, 0.65);
            backdrop-filter: blur(6px);
        }

        .modal.open {
            display: flex;
        }

        .modal-card {
            width: min(720px, 96vw);
            max-height: 88vh;
            overflow: auto;
            border-radius: 14px;
            border: 1px solid rgba(148, 163, 184, 0.25);
            background: rgba(15, 23, 42, 0.98);
            padding: 14px;
        }

        .modal-top {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 10px;
        }

        .modal-title {
            font-weight: 700;
            font-size: 14px;
        }

        .modal-close {
            border: 0;
            background: rgba(148, 163, 184, 0.18);
            color: #e5e7eb;
            padding: 6px 10px;
            border-radius: 10px;
            cursor: pointer;
        }

        .modal-close:hover {
            background: rgba(148, 163, 184, 0.28);
        }

        .radar-announcement-modal {
            z-index: 1450;
            background: rgba(2, 6, 23, 0.78);
            backdrop-filter: blur(8px);
        }

        .radar-announcement-card {
            width: min(560px, 96vw);
            display: grid;
            gap: 12px;
            border-radius: 16px;
            border: 1px solid rgba(148, 163, 184, 0.28);
            background:
                radial-gradient(105% 90% at 8% 0%, rgba(59, 130, 246, 0.2), transparent 62%),
                rgba(15, 23, 42, 0.97);
            box-shadow: 0 24px 56px rgba(2, 6, 23, 0.5);
            padding: 16px;
        }

        .radar-announcement-kicker {
            margin: 0;
            color: #93c5fd;
            font-size: 11px;
            font-weight: 900;
            letter-spacing: 0.09em;
            text-transform: uppercase;
            justify-self: end;
            text-align: right;
        }

        .radar-announcement-title {
            margin: 0;
            color: #f8fafc;
            font-size: 22px;
            font-weight: 900;
            letter-spacing: -0.01em;
            line-height: 1.1;
        }

        .radar-announcement-message {
            margin: 0;
            color: rgba(226, 232, 240, 0.95);
            font-size: 14px;
            line-height: 1.5;
            white-space: pre-wrap;
            overflow-wrap: anywhere;
        }

        .radar-announcement-image {
            width: 100%;
            max-height: 280px;
            border-radius: 12px;
            object-fit: cover;
            border: 1px solid rgba(148, 163, 184, 0.24);
            background: rgba(2, 6, 23, 0.45);
        }

        .radar-announcement-cta {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: fit-content;
            max-width: 100%;
            min-height: 38px;
            padding: 0 14px;
            border-radius: 10px;
            border: 1px solid rgba(59, 130, 246, 0.4);
            background: rgba(37, 99, 235, 0.26);
            color: #dbeafe;
            text-decoration: none;
            font-size: 13px;
            font-weight: 800;
            overflow-wrap: anywhere;
            word-break: break-word;
        }

        .radar-announcement-cta:hover {
            background: rgba(37, 99, 235, 0.38);
        }

        .radar-announcement-status {
            margin: 0;
            font-size: 12px;
            color: rgba(148, 163, 184, 0.95);
            min-height: 16px;
        }

        .radar-announcement-status.is-error {
            color: #fca5a5;
        }

        .radar-announcement-actions {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
        }

        .radar-announcement-dismiss-btn {
            border: 1px solid rgba(148, 163, 184, 0.3);
            background: rgba(2, 6, 23, 0.6);
            color: #e5e7eb;
            border-radius: 10px;
            padding: 9px 14px;
            font-size: 13px;
            font-weight: 800;
            cursor: pointer;
        }

        .radar-announcement-dismiss-btn:hover {
            background: rgba(15, 23, 42, 0.92);
        }

        .radar-announcement-dismiss-btn[disabled] {
            opacity: 0.6;
            cursor: not-allowed;
        }

        .gallery-main {
            width: 100%;
            border-radius: 12px;
            border: 1px solid rgba(148, 163, 184, 0.25);
            background: rgba(2, 6, 23, 0.6);
            object-fit: contain;
            max-height: 60vh;
            touch-action: pan-y pinch-zoom;
            -webkit-user-drag: none;
            user-select: none;
        }

        .gallery-controls {
            display: flex;
            gap: 8px;
            margin-top: 10px;
        }

        .gallery-btn {
            border: 0;
            background: rgba(37, 99, 235, 0.2);
            color: #e5e7eb;
            padding: 8px 12px;
            border-radius: 10px;
            cursor: pointer;
            font-weight: 600;
        }

        .gallery-btn:hover {
            background: rgba(37, 99, 235, 0.3);
        }

        .thumbs {
            display: flex;
            gap: 8px;
            overflow-x: auto;
            padding: 10px 2px 2px;
            margin-top: 8px;
        }

        .thumbs img {
            width: 56px;
            height: 56px;
            border-radius: 10px;
            object-fit: cover;
            border: 1px solid rgba(148, 163, 184, 0.25);
            cursor: pointer;
            opacity: 0.85;
        }

        .thumbs img.active {
            border-color: rgba(37, 99, 235, 0.9);
            opacity: 1;
        }

        .onboarding-modal {
            position: fixed;
            inset: 0;
            z-index: 1400;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 16px;
            background: rgba(2, 6, 23, 0.78);
            backdrop-filter: blur(8px);
        }

        .onboarding-modal.open {
            display: flex;
        }

        .onboarding-card {
            width: min(560px, 96vw);
            border-radius: 16px;
            border: 1px solid rgba(148, 163, 184, 0.28);
            background: rgba(15, 23, 42, 0.96);
            box-shadow: 0 24px 56px rgba(2, 6, 23, 0.5);
            padding: 16px;
            display: grid;
            gap: 12px;
        }

        .onboarding-title {
            margin: 0;
            font-size: 19px;
            font-weight: 900;
            color: #f8fafc;
            letter-spacing: -0.01em;
        }

        .onboarding-copy {
            margin: 0;
            font-size: 14px;
            line-height: 1.45;
            color: rgba(226, 232, 240, 0.95);
        }

        .onboarding-links {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            font-size: 13px;
        }

        .onboarding-links a {
            color: #dbeafe;
            font-weight: 700;
        }

        .onboarding-check {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            padding: 10px 12px;
            border-radius: 12px;
            border: 1px solid rgba(148, 163, 184, 0.24);
            background: rgba(2, 6, 23, 0.32);
            font-size: 13px;
            color: rgba(226, 232, 240, 0.95);
            line-height: 1.35;
        }

        .onboarding-check input[type="checkbox"] {
            margin: 2px 0 0;
            width: 16px;
            height: 16px;
            accent-color: #2563eb;
            flex: 0 0 auto;
        }

        .onboarding-actions {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
            flex-wrap: wrap;
        }

        .onboarding-btn {
            border-radius: 12px;
            border: 1px solid rgba(148, 163, 184, 0.3);
            background: rgba(15, 23, 42, 0.55);
            color: rgba(226, 232, 240, 0.95);
            font-size: 13px;
            font-weight: 800;
            min-height: 40px;
            padding: 8px 14px;
            cursor: pointer;
        }

        .onboarding-btn.primary {
            border-color: rgba(37, 99, 235, 0.68);
            background: rgba(37, 99, 235, 0.95);
            color: #ffffff;
        }

        .onboarding-btn[disabled] {
            opacity: 0.55;
            cursor: not-allowed;
        }

        .location-picker-modal {
            position: fixed;
            inset: 0;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 24px;
            background: rgba(2, 6, 23, 0.76);
            backdrop-filter: blur(12px);
            z-index: 1410;
        }

        .location-picker-modal.open {
            display: flex;
        }

        .location-picker-card {
            width: min(100%, 460px);
            max-height: min(82vh, 760px);
            overflow: auto;
            border-radius: 24px;
            border: 1px solid rgba(148, 163, 184, 0.24);
            background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.97));
            box-shadow: 0 28px 64px rgba(2, 6, 23, 0.48);
            padding: 22px;
            display: flex;
            flex-direction: column;
            gap: 14px;
        }

        .location-picker-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
        }

        .location-picker-title {
            margin: 0;
            font-size: 23px;
            font-weight: 900;
            color: #f8fafc;
        }

        .location-picker-copy {
            margin: 6px 0 0;
            color: #cbd5e1;
            line-height: 1.5;
            font-size: 14px;
        }

        .location-picker-close {
            border: 1px solid rgba(148, 163, 184, 0.28);
            background: rgba(15, 23, 42, 0.82);
            color: #e2e8f0;
            border-radius: 999px;
            min-width: 40px;
            min-height: 40px;
            padding: 0 14px;
            font-size: 18px;
            font-weight: 800;
            cursor: pointer;
            line-height: 1;
        }

        .location-picker-close:hover {
            background: rgba(30, 41, 59, 0.92);
        }

        .location-picker-form {
            display: grid;
            gap: 10px;
        }

        .location-picker-label {
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            color: rgba(125, 211, 252, 0.82);
        }

        .location-picker-input {
            width: 100%;
            min-height: 46px;
            border-radius: 14px;
            border: 1px solid rgba(99, 148, 211, 0.28);
            background: rgba(8, 22, 40, 0.82);
            color: #eff6ff;
            padding: 12px 14px;
            font-size: 14px;
            outline: none;
        }

        .location-picker-input:focus {
            border-color: rgba(56, 189, 248, 0.56);
            box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.14);
        }

        .location-picker-status {
            min-height: 18px;
            font-size: 12px;
            color: rgba(191, 210, 236, 0.78);
        }

        .location-picker-status.is-error {
            color: rgba(254, 202, 202, 0.95);
        }

        .location-picker-status.is-success {
            color: rgba(187, 247, 208, 0.96);
        }

        .location-picker-actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            flex-wrap: wrap;
        }

        .location-picker-btn {
            border: 1px solid rgba(148, 163, 184, 0.28);
            background: rgba(15, 23, 42, 0.82);
            color: #e2e8f0;
            border-radius: 999px;
            min-height: 42px;
            padding: 10px 16px;
            font-size: 13px;
            font-weight: 800;
            cursor: pointer;
        }

        .location-picker-btn.primary {
            background: linear-gradient(135deg, #2563eb, #06b6d4);
            border-color: transparent;
            color: #eff6ff;
        }

        .location-picker-btn:disabled,
        .location-picker-close:disabled,
        .location-picker-input:disabled,
        .location-picker-chip:disabled {
            opacity: 0.64;
            cursor: wait;
        }

        .location-picker-quick {
            display: grid;
            gap: 10px;
        }

        .location-picker-grid {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 10px;
        }

        .location-picker-chip {
            width: 100%;
            min-height: 42px;
            border-radius: 14px;
            border: 1px solid rgba(124, 164, 219, 0.24);
            background: rgba(9, 25, 45, 0.74);
            color: rgba(226, 232, 240, 0.94);
            padding: 10px 12px;
            font-size: 12px;
            font-weight: 800;
            cursor: pointer;
            text-align: center;
        }

        .location-picker-chip:hover {
            background: rgba(28, 51, 79, 0.92);
            border-color: rgba(125, 211, 252, 0.36);
        }

        .position-filter-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px;
        }

        .position-filter-option {
            min-height: 46px;
            border-radius: 16px;
            border: 1px solid rgba(99, 148, 211, 0.28);
            background: rgba(8, 22, 40, 0.82);
            color: #eff6ff;
            font-size: 14px;
            font-weight: 800;
            letter-spacing: 0.02em;
            cursor: pointer;
            transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
        }

        .position-filter-option:hover {
            transform: translateY(-1px);
            border-color: rgba(56, 189, 248, 0.42);
            background: rgba(17, 44, 76, 0.88);
        }

        .position-filter-option.is-active {
            border-color: rgba(56, 189, 248, 0.58);
            background: rgba(14, 165, 233, 0.18);
            color: #e0f2fe;
            box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.16);
        }

        .basics-disabled-banner {
            position: fixed;
            top: calc(var(--top-nav-h) + 10px);
            left: 50%;
            transform: translateX(-50%);
            z-index: 82;
            width: min(720px, calc(100vw - 24px));
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 12px 14px;
            border-radius: 16px;
            border: 1px solid rgba(96, 165, 250, 0.32);
            background: rgba(2, 6, 23, 0.92);
            color: #dbeafe;
            box-shadow: 0 18px 36px rgba(2, 6, 23, 0.35);
            backdrop-filter: blur(12px);
        }

        .basics-disabled-banner[hidden] {
            display: none;
        }

        .basics-disabled-banner-copy {
            margin: 0;
            font-size: 13px;
            line-height: 1.45;
            color: #dbeafe;
        }

        .basics-disabled-banner-btn {
            border: 1px solid rgba(37, 99, 235, 0.78);
            background: linear-gradient(135deg, #2563eb, #06b6d4);
            color: #eff6ff;
            border-radius: 999px;
            min-height: 40px;
            padding: 9px 14px;
            font-size: 13px;
            font-weight: 800;
            cursor: pointer;
            white-space: nowrap;
        }

        .activation-checklist {
            position: fixed;
            top: calc(var(--top-nav-h) + 10px);
            left: 50%;
            transform: translateX(-50%);
            z-index: 83;
            width: min(720px, calc(100vw - 24px));
            display: grid;
            gap: 10px;
            padding: 12px 14px;
            border-radius: 16px;
            border: 1px solid rgba(56, 189, 248, 0.32);
            background: rgba(2, 6, 23, 0.92);
            color: #e2e8f0;
            box-shadow: 0 18px 36px rgba(2, 6, 23, 0.35);
            backdrop-filter: blur(12px);
        }

        .activation-checklist[hidden] {
            display: none;
        }

        .activation-checklist-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            flex-wrap: wrap;
        }

        .activation-checklist-title {
            margin: 0;
            font-size: 12px;
            font-weight: 900;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: #bfdbfe;
        }

        .activation-checklist-meter {
            margin: 0;
            font-size: 12px;
            font-weight: 800;
            color: #93c5fd;
        }

        .activation-progress-track {
            height: 8px;
            border-radius: 999px;
            background: rgba(148, 163, 184, 0.25);
            overflow: hidden;
        }

        .activation-progress-fill {
            width: 0%;
            height: 100%;
            border-radius: inherit;
            background: linear-gradient(90deg, #2563eb, #06b6d4);
            transition: width 0.2s ease;
        }

        .activation-checklist-items {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 8px;
        }

        .activation-step {
            appearance: none;
            border: 1px solid rgba(148, 163, 184, 0.26);
            border-radius: 12px;
            background: rgba(2, 6, 23, 0.38);
            color: #dbeafe;
            min-height: 44px;
            padding: 9px 10px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            text-align: left;
            cursor: pointer;
        }

        .activation-step-main {
            min-width: 0;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            font-weight: 700;
            line-height: 1.35;
        }

        .activation-step-dot {
            width: 9px;
            height: 9px;
            border-radius: 50%;
            background: #38bdf8;
            box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
            flex: 0 0 auto;
        }

        .activation-step-status {
            font-size: 11px;
            font-weight: 800;
            color: #93c5fd;
            white-space: nowrap;
            flex: 0 0 auto;
        }

        .activation-step.is-done {
            border-color: rgba(34, 197, 94, 0.4);
            background: rgba(21, 128, 61, 0.22);
            color: #dcfce7;
            cursor: default;
        }

        .activation-step.is-done .activation-step-dot {
            background: #22c55e;
            box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
        }

        .activation-step.is-done .activation-step-status {
            color: #86efac;
        }

        .activation-step[disabled] {
            opacity: 0.95;
            cursor: default;
        }

        .onboarding-status {
            min-height: 16px;
            font-size: 12px;
            color: rgba(191, 219, 254, 0.95);
        }

        .onboarding-status.error {
            color: #fecaca;
        }

        /* -----------------------------
            Mobile: Map nav + layout
        ------------------------------*/
        @media (max-width: 640px) {
            body {
                overflow: hidden;
            }

            body:not(.is-admin) .top-nav {
                height: auto;
                padding: calc(env(safe-area-inset-top) + 8px) 12px 8px;
                gap: 8px;
                flex-wrap: nowrap;
            }

            body:not(.is-admin) .nav-links {
                flex: 1 1 auto;
                min-width: 0;
                margin-left: auto;
                justify-content: flex-end;
                flex-wrap: nowrap;
                overflow: hidden;
                gap: 6px;
                padding-bottom: 0;
            }

            body:not(.is-admin) .nav-link {
                flex: 0 0 auto;
                padding: 8px 8px;
                font-size: 13px;
                white-space: nowrap;
            }

            .nav-mobile-hide {
                display: none !important;
            }

            /* Map should start below nav (nav is taller on mobile now) */
            #map,
            #mapLoadingOverlay {
                top: var(--top-nav-h);
                bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
                /* room for bottom-nav */
            }
        }

        #gpsBtn {
            position: fixed;
            bottom: 96px;
            right: 16px;
            width: 44px;
            height: 44px;
            border-radius: 999px;
            border: 1px solid rgba(148, 163, 184, 0.26);
            background: rgba(2, 6, 23, 0.82);
            color: white;
            font-size: 18px;
            cursor: pointer;
            z-index: 70;
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
            backdrop-filter: blur(12px);
        }

        #gpsBtn:hover {
            background: rgba(17, 24, 39, 1);
        }

        .map-discovery-tools {
            position: fixed;
            top: calc(var(--top-nav-h) + 12px);
            left: 50%;
            transform: translateX(-50%);
            z-index: 71;
            display: flex;
            align-items: center;
            gap: 8px;
            max-width: calc(100vw - 24px);
        }

        .map-view-toggle,
        .map-search-area-btn,
        .map-legend-btn {
            border: 1px solid rgba(148, 163, 184, 0.3);
            background: rgba(2, 6, 23, 0.88);
            color: #e5e7eb;
            box-shadow: 0 8px 24px rgba(2, 6, 23, 0.34);
            backdrop-filter: blur(14px);
        }

        .map-view-toggle {
            display: flex;
            padding: 3px;
            border-radius: 999px;
        }

        .map-view-toggle button {
            min-height: 34px;
            padding: 0 12px;
            border: 0;
            border-radius: 999px;
            background: transparent;
            color: rgba(203, 213, 225, 0.88);
            font-size: 11px;
            font-weight: 850;
            cursor: pointer;
        }

        .map-search-area-btn {
            min-width: 120px;
            padding-inline: 18px;
            white-space: nowrap;
        }

        .map-view-toggle button.is-active {
            color: #fff;
            background: rgba(37, 99, 235, 0.9);
        }

        .map-search-area-btn,
        .map-legend-btn {
            min-height: 40px;
            border-radius: 999px;
            padding: 0 13px;
            font-size: 11px;
            font-weight: 850;
            cursor: pointer;
        }

        .map-search-area-btn[hidden] { display: none; }

        .map-layer-toggle {
            position: fixed;
            top: calc(var(--top-nav-h) + 62px);
            left: 50%;
            transform: translateX(-50%);
            z-index: 70;
            display: flex;
            padding: 3px;
            border: 1px solid rgba(96, 165, 250, 0.34);
            border-radius: 999px;
            background: rgba(2, 6, 23, 0.88);
            box-shadow: 0 8px 24px rgba(2, 6, 23, 0.34);
            backdrop-filter: blur(14px);
        }

        .map-layer-toggle button {
            min-height: 32px;
            padding: 0 13px;
            border: 0;
            border-radius: 999px;
            background: transparent;
            color: rgba(203, 213, 225, 0.82);
            font-size: 10px;
            font-weight: 850;
            white-space: nowrap;
            cursor: pointer;
        }

        .map-layer-toggle button.is-active {
            color: #fff;
            background: linear-gradient(135deg, rgba(37, 99, 235, .96), rgba(124, 58, 237, .9));
            box-shadow: 0 4px 14px rgba(59, 130, 246, .3);
        }

        .map-checkin-filter-bar {
            position: fixed;
            top: calc(var(--top-nav-h) + 104px);
            left: 50%;
            transform: translateX(-50%);
            z-index: 69;
            width: min(calc(100vw - 22px), 640px);
            display: flex;
            gap: 6px;
            padding: 4px;
            overflow-x: auto;
            scrollbar-width: none;
            border: 1px solid rgba(167, 139, 250, .28);
            border-radius: 999px;
            background: rgba(2, 6, 23, .84);
            box-shadow: 0 8px 22px rgba(2, 6, 23, .28);
            backdrop-filter: blur(14px);
        }
        .map-checkin-filter-bar::-webkit-scrollbar { display: none; }
        .map-checkin-filter-bar[hidden] { display: none; }
        .map-checkin-filter-bar button {
            flex: 0 0 auto;
            min-height: 30px;
            padding: 0 11px;
            border: 0;
            border-radius: 999px;
            background: transparent;
            color: rgba(221, 214, 254, .82);
            font-size: 10px;
            font-weight: 850;
            white-space: nowrap;
            cursor: pointer;
        }
        .map-checkin-filter-bar button.is-active {
            color: #fff;
            background: rgba(109, 40, 217, .74);
            box-shadow: 0 3px 12px rgba(91, 33, 182, .34);
        }

        .map-checkin-pin {
            min-width: 44px;
            height: 44px;
            display: grid;
            grid-template-columns: 32px auto;
            place-items: center;
            padding: 5px;
            border: 2px solid rgba(167, 139, 250, .92);
            border-radius: 16px;
            background: rgba(30, 16, 64, .94);
            box-shadow: 0 0 0 4px rgba(124, 58, 237, .16), 0 10px 26px rgba(2, 6, 23, .48);
            color: #fff;
            cursor: pointer;
        }

        .map-checkin-pin.is-cluster {
            min-width: 50px;
            grid-template-columns: 28px auto;
            border-radius: 999px;
            padding-right: 10px;
        }

        .map-checkin-emoji { font-size: 22px; line-height: 1; }
        .map-checkin-count { font-size: 12px; font-weight: 950; }
        .map-checkin-pin.is-mine { border-color: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .18), 0 10px 26px rgba(2, 6, 23, .48); }

        .map-checkin-card { max-width: 500px; }
        .map-checkin-kicker { margin: 0 0 6px; color: #a78bfa; font-size: 11px; font-weight: 950; letter-spacing: .13em; text-transform: uppercase; }
        .map-checkin-copy { margin: 0 0 14px; color: #cbd5e1; font-size: 13px; line-height: 1.5; }
        .map-checkin-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 16px; }
        .map-checkin-choice {
            min-height: 68px;
            display: grid;
            place-items: center;
            gap: 3px;
            padding: 8px 5px;
            border: 1px solid rgba(148, 163, 184, .24);
            border-radius: 15px;
            background: rgba(15, 23, 42, .7);
            color: #dbeafe;
            font-size: 10px;
            font-weight: 850;
            cursor: pointer;
        }
        .map-checkin-choice span:first-child { font-size: 22px; }
        .map-checkin-choice.is-active { border-color: #8b5cf6; background: rgba(91, 33, 182, .34); color: #fff; }
        .map-checkin-fields { display: grid; gap: 10px; }
        .map-checkin-field { display: grid; gap: 5px; color: #bfdbfe; font-size: 11px; font-weight: 800; }
        .map-checkin-field input,
        .map-checkin-field select {
            width: 100%;
            min-height: 44px;
            padding: 0 12px;
            border: 1px solid rgba(148, 163, 184, .26);
            border-radius: 13px;
            background: rgba(2, 6, 23, .78);
            color: #fff;
            font: inherit;
        }
        .map-checkin-privacy {
            margin: 13px 0;
            padding: 11px;
            border: 1px solid rgba(52, 211, 153, .22);
            border-radius: 14px;
            background: rgba(6, 78, 59, .16);
            color: #a7f3d0;
            font-size: 11px;
            line-height: 1.5;
        }
        .map-checkin-actions { display: flex; gap: 8px; justify-content: flex-end; }
        .map-checkin-action {
            min-height: 42px;
            padding: 0 15px;
            border: 1px solid rgba(148, 163, 184, .28);
            border-radius: 999px;
            background: rgba(15, 23, 42, .82);
            color: #e5e7eb;
            font-size: 12px;
            font-weight: 850;
            cursor: pointer;
        }
        .map-checkin-action.primary { border-color: #8b5cf6; background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; }
        .map-checkin-action.danger { border-color: rgba(248, 113, 113, .5); color: #fecaca; }
        .map-checkin-action[disabled] { opacity: .55; cursor: wait; }
        .map-checkin-status { min-height: 18px; margin: 10px 0 0; color: #93c5fd; font-size: 11px; font-weight: 750; }
        .map-checkin-status.is-error { color: #fca5a5; }
        .map-checkin-active {
            display: grid;
            grid-template-columns: auto minmax(0, 1fr);
            gap: 12px;
            align-items: center;
            padding: 14px;
            border: 1px solid rgba(52, 211, 153, .32);
            border-radius: 18px;
            background: rgba(6, 78, 59, .18);
        }
        .map-checkin-active-emoji { font-size: 32px; }
        .map-checkin-active-title { color: #fff; font-size: 15px; font-weight: 900; }
        .map-checkin-active-meta { margin-top: 4px; color: #a7f3d0; font-size: 11px; line-height: 1.4; }
        .map-checkin-results { display: grid; gap: 9px; margin-top: 12px; max-height: min(52vh, 420px); overflow-y: auto; }
        .map-checkin-result {
            display: grid;
            grid-template-columns: 48px minmax(0, 1fr) auto;
            gap: 10px;
            align-items: center;
            padding: 9px;
            border: 1px solid rgba(148, 163, 184, .22);
            border-radius: 16px;
            background: rgba(15, 23, 42, .72);
            color: #fff;
        }
        .map-checkin-result img,
        .map-checkin-result-avatar { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; object-fit: cover; background: rgba(91, 33, 182, .45); font-size: 20px; font-weight: 900; }
        .map-checkin-result-name { display: block; font-size: 13px; font-weight: 900; }
        .map-checkin-result-meta { display: block; margin-top: 3px; color: #c4b5fd; font-size: 10px; line-height: 1.4; }
        .map-checkin-engage-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
        .map-checkin-engage-actions .map-checkin-action.is-selected {
            border-color: rgba(52, 211, 153, .72);
            background: rgba(6, 95, 70, .34);
            color: #d1fae5;
        }

        .map-nearby-context {
            position: fixed;
            left: 50%;
            bottom: 104px;
            transform: translateX(-50%);
            z-index: 68;
            max-width: calc(100vw - 32px);
            padding: 7px 11px;
            border: 1px solid rgba(148, 163, 184, 0.25);
            border-radius: 999px;
            background: rgba(2, 6, 23, 0.8);
            color: rgba(226, 232, 240, 0.96);
            font-size: 11px;
            font-weight: 800;
            white-space: nowrap;
            backdrop-filter: blur(12px);
        }

        .map-nearby-strip {
            position: fixed;
            left: 50%;
            bottom: 190px;
            transform: translateX(-50%);
            z-index: 67;
            width: min(680px, calc(100vw - 24px));
            display: flex;
            gap: 9px;
            overflow-x: auto;
            padding: 4px 2px 8px;
            scroll-snap-type: x proximity;
            scrollbar-width: none;
        }

        .map-nearby-strip::-webkit-scrollbar { display: none; }
        .map-nearby-strip[hidden] { display: none; }

        .map-nearby-card {
            flex: 0 0 164px;
            min-height: 62px;
            display: grid;
            grid-template-columns: 46px minmax(0, 1fr);
            align-items: center;
            gap: 9px;
            padding: 8px;
            scroll-snap-align: start;
            border: 1px solid rgba(148, 163, 184, 0.25);
            border-radius: 16px;
            background: rgba(2, 6, 23, 0.86);
            color: #fff;
            text-align: left;
            box-shadow: 0 9px 25px rgba(2, 6, 23, 0.34);
            backdrop-filter: blur(14px);
            cursor: pointer;
            transition: transform .16s ease, border-color .16s ease, opacity .16s ease;
        }

        .map-nearby-card:hover,
        .map-nearby-card.is-selected {
            transform: translateY(-2px);
            border-color: rgba(96, 165, 250, 0.75);
        }

        .map-nearby-card img,
        .map-nearby-avatar-fallback {
            width: 46px;
            height: 46px;
            border-radius: 13px;
            object-fit: cover;
            display: grid;
            place-items: center;
            background: rgba(30, 64, 175, 0.46);
            font-weight: 900;
        }

        .map-nearby-copy { min-width: 0; }
        .map-nearby-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 900; }
        .map-nearby-meta { display: block; margin-top: 4px; color: rgba(191, 219, 254, .9); font-size: 10px; font-weight: 750; }

        .avatar-pin.is-selected {
            scale: 1.14;
            box-shadow: 0 0 0 4px rgba(96, 165, 250, .34), 0 0 24px rgba(59, 130, 246, .72) !important;
            z-index: 8;
        }

        .avatar-pin.is-muted { opacity: .4; filter: saturate(.55); }

        .map-list-panel {
            position: fixed;
            inset: var(--top-nav-h) 0 0;
            z-index: 62;
            display: none;
            overflow-y: auto;
            padding: 76px max(16px, calc((100vw - 760px) / 2)) 120px;
            background: linear-gradient(180deg, #071126, #020617);
        }

        body.map-list-mode .map-list-panel { display: block; }
        body.map-list-mode #map,
        body.map-list-mode #mapLoadingOverlay,
        body.map-list-mode #gpsBtn,
        body.map-list-mode .map-action-menu,
        body.map-list-mode .map-nearby-strip { visibility: hidden; pointer-events: none; }

        .map-list-heading { margin: 0 0 14px; color: #fff; font-size: 20px; }
        .map-list-grid { display: grid; gap: 10px; }
        .map-list-card {
            width: 100%;
            display: grid;
            grid-template-columns: 68px minmax(0, 1fr) auto;
            align-items: center;
            gap: 12px;
            padding: 10px;
            border: 1px solid rgba(148, 163, 184, .22);
            border-radius: 18px;
            background: rgba(15, 23, 42, .72);
            color: #fff;
            text-align: left;
            cursor: pointer;
        }
        .map-list-card img, .map-list-card .map-nearby-avatar-fallback { width: 68px; height: 68px; border-radius: 15px; object-fit: cover; }
        .map-list-card-title { display: block; font-size: 15px; font-weight: 900; }
        .map-list-card-meta { display: block; margin-top: 5px; color: rgba(191, 219, 254, .88); font-size: 11px; font-weight: 700; }
        .map-list-card-arrow { color: #93c5fd; font-size: 20px; }
        .map-list-empty { padding: 36px 18px; color: #cbd5e1; text-align: center; }

        .map-legend-card { max-width: 420px; }
        .map-legend-items { display: grid; gap: 11px; margin: 16px 0; }
        .map-legend-row { display: flex; align-items: center; gap: 11px; color: #dbeafe; font-size: 13px; font-weight: 700; }
        .map-legend-dot { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #64748b; background: #111827; }
        .map-legend-dot.online { border-color: #22c55e; }
        .map-legend-dot.recent { border-color: #f59e0b; }
        .map-legend-dot.invite { border-radius: 6px; border-color: #60a5fa; }
        .map-privacy-note { color: #94a3b8; font-size: 12px; line-height: 1.5; }

        @media (max-width: 640px) {
            .map-discovery-tools { top: calc(var(--top-nav-h) + 8px); gap: 6px; }
            .map-layer-toggle { top: calc(var(--top-nav-h) + 56px); }
            .map-layer-toggle button { padding: 0 11px; }
            .map-view-toggle button { padding: 0 10px; }
            .map-search-area-btn { min-width: 118px; padding: 0 14px; }
            .map-legend-btn { padding: 0 10px; }
            .map-nearby-strip { bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 96px); }
            .map-nearby-context { bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 14px); }
            .map-nearby-card { flex-basis: 148px; }
        }

        /* The richer approximate-radius summary replaces the older count-only status pill. */
        .status {
            display: none;
        }

        @media (prefers-reduced-motion: reduce) {
            .map-nearby-card, .avatar-pin, .map-checkin-pin { transition: none !important; }
        }

        body.map-popup-open #gpsBtn,
        body.map-popup-open .status,
        body.map-popup-open .map-action-menu {
            pointer-events: none;
            opacity: 0.55;
        }

        .map-action-menu {
            position: fixed;
            left: 16px;
            bottom: 148px;
            width: min(292px, calc(100vw - 34px));
            max-width: calc(100vw - 34px);
            padding: 9px;
            border-radius: 20px;
            border: 1px solid rgba(148, 163, 184, 0.24);
            background: rgba(2, 6, 23, 0.86);
            box-shadow: 0 16px 30px rgba(0, 0, 0, 0.4);
            backdrop-filter: blur(16px);
            display: none;
            gap: 7px;
            z-index: 72;
        }

        .map-action-item {
            appearance: none;
            width: 100%;
            min-height: 42px;
            padding: 9px 11px;
            border-radius: 15px;
            border: 1px solid rgba(148, 163, 184, 0.24);
            background: rgba(15, 23, 42, 0.82);
            color: rgba(229, 231, 235, 0.96);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            text-align: left;
            cursor: pointer;
            transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
        }

        .map-action-item:hover {
            transform: translateY(-1px);
            border-color: rgba(96, 165, 250, 0.48);
            background: rgba(30, 41, 59, 0.94);
        }

        .map-action-item.is-open {
            border-color: rgba(56, 189, 248, 0.48);
            background: rgba(8, 47, 73, 0.72);
        }

        .map-action-item.is-active-mode {
            border-color: rgba(56, 189, 248, 0.4);
            background: rgba(12, 35, 64, 0.88);
        }

        .map-action-item.is-invite {
            border-color: rgba(251, 191, 36, 0.4);
            background: linear-gradient(135deg, rgba(124, 45, 18, 0.94), rgba(190, 24, 93, 0.9));
            color: #fef3c7;
        }

        .map-action-item.is-invite.is-live {
            border-color: rgba(236, 72, 153, 0.42);
            background: linear-gradient(135deg, rgba(190, 24, 93, 0.94), rgba(91, 33, 182, 0.94));
            color: #fdf2f8;
        }

        .map-action-item.is-invite.is-locked {
            border-color: rgba(148, 163, 184, 0.28);
            background: rgba(30, 41, 59, 0.82);
            color: rgba(226, 232, 240, 0.9);
        }

        .map-action-item[disabled] {
            opacity: 0.6;
            cursor: default;
            transform: none;
        }

        .map-action-item-copy {
            min-width: 0;
            display: grid;
            gap: 2px;
            flex: 1 1 auto;
        }

        .map-action-item-label {
            font-size: 12px;
            font-weight: 800;
            line-height: 1.1;
        }

        .map-action-item-value {
            min-width: 0;
            color: rgba(191, 219, 254, 0.8);
            font-size: 10px;
            font-weight: 700;
            line-height: 1.2;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .map-action-item.is-invite .map-action-item-value {
            color: rgba(255, 251, 235, 0.88);
        }

        .map-action-item-caret {
            flex: 0 0 auto;
            color: rgba(191, 219, 254, 0.95);
            font-size: 14px;
            line-height: 1;
            transition: transform 0.15s ease;
        }

        .map-action-item.is-open .map-action-item-caret {
            transform: rotate(180deg);
        }

        .map-action-filters {
            display: none;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 7px;
        }

        .map-action-filters.open {
            display: grid;
        }

        .map-filter-chip {
            appearance: none;
            width: 100%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 34px;
            padding: 0 10px;
            border-radius: 13px;
            border: 1px solid rgba(148, 163, 184, 0.22);
            background: rgba(15, 23, 42, 0.58);
            color: rgba(226, 232, 240, 0.92);
            font-size: 10px;
            font-weight: 800;
            letter-spacing: 0.04em;
            text-align: center;
            cursor: pointer;
            transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
        }

        .map-filter-chip:hover {
            transform: translateY(-1px);
            border-color: rgba(96, 165, 250, 0.46);
            background: rgba(30, 41, 59, 0.9);
        }

        .map-filter-chip.is-active {
            border-color: rgba(56, 189, 248, 0.48);
            background: rgba(8, 47, 73, 0.92);
            color: #e0f2fe;
            box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.18);
        }

        .map-filter-chip[data-filter="invites"].is-active {
            border-color: rgba(236, 72, 153, 0.46);
            background: rgba(88, 28, 135, 0.9);
            color: #fdf2f8;
            box-shadow: inset 0 0 0 1px rgba(236, 72, 153, 0.18);
        }

        .map-filter-chip[data-filter="all"] {
            grid-column: 1 / -1;
        }

        .seen-invite-pin {
            width: 44px;
            height: 44px;
            padding: 0;
            border-radius: 12px;
            border: 2px solid rgba(236, 72, 153, 0.82);
            background:
                radial-gradient(circle at 30% 24%, rgba(244, 114, 182, 0.32), transparent 34%),
                linear-gradient(155deg, rgba(54, 12, 110, 0.98), rgba(25, 7, 62, 0.98));
            box-shadow:
                0 0 0 4px rgba(168, 85, 247, 0.2),
                0 10px 24px rgba(0, 0, 0, 0.34);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            cursor: pointer;
            appearance: none;
        }

        .seen-invite-pin.is-live {
            animation: seenInvitePulse 2.8s ease-in-out infinite;
        }

        @keyframes seenInvitePulse {

            0%,
            100% {
                box-shadow:
                    0 0 0 4px rgba(168, 85, 247, 0.2),
                    0 10px 24px rgba(0, 0, 0, 0.34);
            }

            50% {
                box-shadow:
                    0 0 0 6px rgba(236, 72, 153, 0.24),
                    0 0 18px rgba(236, 72, 153, 0.32),
                    0 10px 24px rgba(0, 0, 0, 0.34);
            }
        }

        .seen-invite-pin:focus-visible {
            outline: 2px solid rgba(236, 72, 153, 0.9);
            outline-offset: 4px;
        }

        .seen-invite-pin-img {
            width: 100%;
            height: 100%;
            display: block;
            object-fit: cover;
            pointer-events: none;
        }

        .seen-invite-pop {
            display: grid;
            gap: 10px;
            min-width: 236px;
            max-width: 280px;
            padding: 12px;
            border-radius: 20px;
            border: 1px solid rgba(192, 132, 252, 0.28);
            background:
                radial-gradient(120% 80% at 0% 0%, rgba(244, 114, 182, 0.22), transparent 56%),
                linear-gradient(160deg, rgba(36, 10, 72, 0.98), rgba(15, 23, 42, 0.96));
            box-shadow: 0 22px 44px rgba(3, 7, 18, 0.42);
            color: #f8fafc;
        }

        .seen-invite-pop-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 10px;
        }

        .seen-invite-pop-head {
            display: grid;
            gap: 4px;
            min-width: 0;
        }

        .seen-invite-pop-kicker {
            color: #f9a8d4;
            font-size: 10px;
            font-weight: 900;
            letter-spacing: 0.08em;
            text-transform: uppercase;
        }

        .seen-invite-pop-title {
            font-size: 16px;
            font-weight: 800;
            color: #f8fafc;
        }

        .seen-invite-pop-meta,
        .seen-invite-pop-support,
        .seen-invite-pop-note {
            font-size: 13px;
            line-height: 1.45;
            color: rgba(226, 232, 240, 0.88);
        }

        .seen-invite-pop-note:empty {
            display: none;
        }

        .seen-invite-pop-chip-row {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        .seen-invite-pop-chip {
            display: inline-flex;
            align-items: center;
            min-height: 26px;
            padding: 0 9px;
            border-radius: 999px;
            border: 1px solid rgba(148, 163, 184, 0.24);
            background: rgba(15, 23, 42, 0.42);
            color: rgba(226, 232, 240, 0.94);
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 0.03em;
        }

        .seen-invite-pop-chip.is-time {
            border-color: rgba(251, 191, 36, 0.3);
            background: rgba(120, 53, 15, 0.3);
            color: #fef3c7;
        }

        .seen-invite-pop-chip.is-members {
            border-color: rgba(96, 165, 250, 0.32);
            background: rgba(30, 64, 175, 0.28);
            color: #dbeafe;
        }

        .seen-invite-pop-chip.is-state {
            border-color: rgba(244, 114, 182, 0.3);
            background: rgba(131, 24, 67, 0.3);
            color: #fce7f3;
        }

        .seen-invite-pop-badge {
            display: inline-flex;
            align-items: center;
            padding: 4px 8px;
            border-radius: 999px;
            border: 1px solid rgba(244, 114, 182, 0.26);
            background: rgba(131, 24, 67, 0.28);
            color: #fce7f3;
            font-size: 11px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .seen-invite-pop-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .seen-invite-pop-btn {
            border: 1px solid rgba(148, 163, 184, 0.24);
            border-radius: 999px;
            background: rgba(15, 23, 42, 0.42);
            color: #f8fafc;
            font-size: 12px;
            font-weight: 800;
            padding: 7px 10px;
            cursor: pointer;
        }

        .seen-invite-pop-btn.is-primary {
            background: rgba(180, 83, 9, 0.86);
            border-color: rgba(251, 191, 36, 0.32);
            color: #fef3c7;
        }

        .seen-invite-modal-card {
            width: min(640px, 96vw);
            max-height: min(88vh, 820px);
            padding: 18px;
            display: grid;
            gap: 14px;
            overscroll-behavior: contain;
        }

        .seen-invite-modal-copy {
            margin: 0;
            color: rgba(226, 232, 240, 0.9);
            font-size: 13px;
            line-height: 1.5;
        }

        .seen-invite-status {
            min-height: 18px;
            font-size: 12px;
            font-weight: 700;
            color: rgba(191, 219, 254, 0.95);
        }

        .seen-invite-status.error {
            color: #fecaca;
        }

        .seen-invite-status.success {
            color: #bbf7d0;
        }

        .seen-invite-lock-card,
        .seen-invite-summary-card,
        .seen-invite-section,
        .seen-invite-request-card,
        .seen-invite-member-card {
            border-radius: 16px;
            border: 1px solid rgba(148, 163, 184, 0.2);
            background: rgba(2, 6, 23, 0.36);
        }

        .seen-invite-lock-card,
        .seen-invite-summary-card,
        .seen-invite-section {
            padding: 14px;
        }

        .seen-invite-lock-title,
        .seen-invite-section-title {
            margin: 0;
            font-size: 15px;
            font-weight: 800;
            color: #f8fafc;
        }

        .seen-invite-lock-copy,
        .seen-invite-inline-copy,
        .seen-invite-empty,
        .seen-invite-member-meta,
        .seen-invite-request-meta {
            margin: 0;
            color: rgba(203, 213, 225, 0.88);
            font-size: 12px;
            line-height: 1.5;
        }

        .seen-invite-inline-copy strong {
            color: #fef3c7;
        }

        .seen-invite-form,
        .seen-invite-edit-form,
        .seen-invite-details-body {
            display: grid;
            gap: 14px;
        }

        .seen-invite-form-grid {
            display: grid;
            gap: 12px;
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        .seen-invite-field {
            display: grid;
            gap: 6px;
        }

        .seen-invite-field.is-span-2 {
            grid-column: 1 / -1;
        }

        .seen-invite-field-label {
            font-size: 12px;
            font-weight: 800;
            color: rgba(226, 232, 240, 0.92);
            letter-spacing: 0.01em;
        }

        .seen-invite-input,
        .seen-invite-textarea {
            width: 100%;
            border-radius: 12px;
            border: 1px solid rgba(148, 163, 184, 0.24);
            background: rgba(15, 23, 42, 0.92);
            color: #f8fafc;
            padding: 11px 12px;
            font: inherit;
            outline: none;
            transition: border-color 0.16s ease, box-shadow 0.16s ease;
        }

        .seen-invite-input:focus,
        .seen-invite-textarea:focus {
            border-color: rgba(251, 191, 36, 0.6);
            box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.16);
        }

        .seen-invite-textarea {
            min-height: 96px;
            resize: vertical;
        }

        .seen-invite-inline-note {
            margin: 0;
            font-size: 11px;
            color: rgba(148, 163, 184, 0.94);
            line-height: 1.45;
        }

        .seen-invite-actions,
        .seen-invite-request-actions,
        .seen-invite-member-actions,
        .seen-invite-cta-row,
        .seen-invite-meta-grid {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        .seen-invite-meta-grid {
            display: grid;
            gap: 10px;
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        .seen-invite-meta-item {
            display: grid;
            gap: 4px;
        }

        .seen-invite-meta-label {
            font-size: 11px;
            font-weight: 800;
            color: rgba(148, 163, 184, 0.92);
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .seen-invite-meta-value {
            font-size: 13px;
            font-weight: 700;
            color: rgba(241, 245, 249, 0.96);
            line-height: 1.45;
        }

        .seen-invite-btn {
            border: 1px solid rgba(148, 163, 184, 0.24);
            border-radius: 12px;
            padding: 10px 12px;
            background: rgba(15, 23, 42, 0.84);
            color: #e5e7eb;
            font-size: 12px;
            font-weight: 800;
            text-decoration: none;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 40px;
            transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
        }

        .seen-invite-btn:hover {
            transform: translateY(-1px);
            border-color: rgba(251, 191, 36, 0.45);
        }

        .seen-invite-btn.primary {
            background: rgba(180, 83, 9, 0.92);
            border-color: rgba(251, 191, 36, 0.4);
            color: #fef3c7;
        }

        .seen-invite-btn.secondary {
            background: rgba(37, 99, 235, 0.18);
            border-color: rgba(96, 165, 250, 0.32);
            color: #dbeafe;
        }

        .seen-invite-btn.danger {
            background: rgba(127, 29, 29, 0.36);
            border-color: rgba(248, 113, 113, 0.3);
            color: #fecaca;
        }

        .seen-invite-btn[disabled] {
            opacity: 0.56;
            cursor: not-allowed;
            transform: none;
        }

        .seen-invite-badge-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            flex-wrap: wrap;
        }

        .seen-invite-badge {
            display: inline-flex;
            align-items: center;
            min-height: 28px;
            padding: 0 10px;
            border-radius: 999px;
            background: rgba(180, 83, 9, 0.18);
            border: 1px solid rgba(251, 191, 36, 0.28);
            color: #fef3c7;
            font-size: 11px;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }

        .seen-invite-chip-row {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .seen-invite-chip {
            display: inline-flex;
            align-items: center;
            min-height: 28px;
            padding: 0 10px;
            border-radius: 999px;
            border: 1px solid rgba(148, 163, 184, 0.22);
            background: rgba(15, 23, 42, 0.78);
            color: rgba(226, 232, 240, 0.92);
            font-size: 11px;
            font-weight: 800;
        }

        .seen-invite-list {
            display: grid;
            gap: 10px;
        }

        .seen-invite-request-card,
        .seen-invite-member-card {
            padding: 12px;
            display: grid;
            gap: 8px;
        }

        .seen-invite-request-top,
        .seen-invite-member-top {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
        }

        .seen-invite-request-handle,
        .seen-invite-member-handle {
            font-size: 13px;
            font-weight: 800;
            color: #f8fafc;
        }

        .seen-invite-request-status {
            font-size: 11px;
            font-weight: 800;
            color: rgba(251, 191, 36, 0.94);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .seen-invite-loading {
            padding: 22px 0;
            text-align: center;
            font-size: 13px;
            font-weight: 700;
            color: rgba(191, 219, 254, 0.94);
        }

        @media (max-width: 640px) {
            .seen-invite-modal-card {
                width: calc(100vw - 14px);
                max-height: min(90vh, 880px);
                padding: 14px;
                border-radius: 18px;
            }

            .seen-invite-form-grid,
            .seen-invite-meta-grid {
                grid-template-columns: minmax(0, 1fr);
            }

            .seen-invite-actions,
            .seen-invite-request-actions,
            .seen-invite-member-actions,
            .seen-invite-cta-row {
                flex-direction: column;
            }

            .seen-invite-btn {
                width: 100%;
            }
        }

        .status {
            bottom: 104px;
        }

        @media (max-width: 640px) {
            .status {
                bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 14px);
                font-size: 11px;
                padding: 7px 10px;
                max-width: calc(100vw - 22px);
            }

            #gpsBtn {
                bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 8px);
            }

            .location-picker-modal {
                padding: 16px;
            }

            .location-picker-card {
                padding: 18px;
                border-radius: 22px;
            }

            .location-picker-title {
                font-size: 21px;
            }

            .location-picker-copy {
                font-size: 13px;
            }

            .location-picker-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            .map-action-menu {
                left: 14px;
                bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 58px);
                width: min(284px, calc(100vw - 28px));
                max-width: calc(100vw - 28px);
                padding: 8px;
                gap: 6px;
            }

            .map-action-item {
                min-height: 40px;
                padding: 8px 10px;
                border-radius: 14px;
            }

            .map-action-filters {
                gap: 6px;
            }

            .map-filter-chip {
                min-height: 34px;
                border-radius: 13px;
            }

            .maplibregl-ctrl-attrib {
                position: fixed !important;
                bottom: calc(env(safe-area-inset-bottom) + 6px) !important;
                right: 8px !important;
                left: auto !important;
                top: auto !important;
                margin: 0 !important;
                z-index: 70;
            }

            .basics-disabled-banner {
                top: calc(var(--top-nav-h) + 8px);
                align-items: flex-start;
                flex-direction: column;
            }

            .activation-checklist {
                top: calc(var(--top-nav-h) + 8px);
                gap: 8px;
            }

            .activation-checklist-items {
                grid-template-columns: 1fr;
            }

            .basics-disabled-banner-btn {
                width: 100%;
            }
        }

        /* Phase 1 map-first interface. Navigation selectors above are intentionally untouched. */
        .map-discovery-tools {
            top: calc(var(--top-nav-h) + 10px);
            left: max(12px, env(safe-area-inset-left));
            right: max(12px, env(safe-area-inset-right));
            width: auto;
            max-width: none;
            transform: none;
            display: grid;
            grid-template-columns: auto minmax(0, 1fr);
            align-items: center;
            justify-content: stretch;
            gap: 6px;
            pointer-events: none;
            transition: opacity .18s ease;
        }

        .map-discovery-tools > * { pointer-events: auto; }

        .map-view-toggle,
        .map-layer-toggle,
        .map-checkin-filter-bar,
        .map-search-area-btn,
        .map-legend-btn,
        .map-nearby-context,
        .map-nearby-card,
        .map-action-menu,
        #gpsBtn {
            background-color: rgba(5, 12, 29, .9);
            border-color: rgba(148, 163, 184, .28);
            box-shadow: 0 12px 30px rgba(2, 6, 23, .36);
            -webkit-backdrop-filter: blur(18px) saturate(1.15);
            backdrop-filter: blur(18px) saturate(1.15);
        }

        .map-view-toggle {
            width: 128px;
            min-height: 44px;
            padding: 0;
            border-radius: 14px;
        }

        .map-view-toggle button {
            flex: 1 1 50%;
            min-width: 44px;
            min-height: 44px;
            padding: 0 10px;
            border-radius: 11px;
            font-size: 12px;
            letter-spacing: -.01em;
        }

        .map-view-toggle button.is-active {
            color: #081122;
            background: #f8fafc;
            box-shadow: 0 2px 8px rgba(2, 6, 23, .22);
        }

        .map-legend-btn {
            position: fixed;
            right: max(14px, env(safe-area-inset-right));
            bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 122px);
            width: 44px;
            min-width: 44px;
            height: 44px;
            padding: 0;
            display: grid;
            place-items: center;
            border-radius: 50%;
            z-index: 70;
            transition: bottom .18s ease, transform .15s ease, opacity .18s ease;
        }

        .map-legend-btn span {
            width: 22px;
            height: 22px;
            display: grid;
            place-items: center;
            border: 2px solid rgba(226, 232, 240, .9);
            border-radius: 50%;
            font: 900 13px/1 ui-rounded, system-ui, sans-serif;
        }

        .map-search-area-btn {
            position: fixed;
            top: calc(var(--top-nav-h) + 142px);
            left: 50%;
            transform: translateX(-50%);
            min-height: 44px;
            z-index: 72;
            border-color: rgba(96, 165, 250, .5);
            color: #dbeafe;
        }

        .map-layer-toggle {
            position: static;
            top: auto;
            left: auto;
            width: 240px;
            min-height: 44px;
            padding: 0;
            transform: none;
            z-index: auto;
            justify-self: end;
            border-color: rgba(148, 163, 184, .26);
            border-radius: 14px;
        }

        .map-layer-toggle button {
            flex: 1 1 33.333%;
            min-width: 0;
            min-height: 44px;
            padding: 0 9px;
            border-radius: 11px;
            font-size: 11px;
        }

        .map-layer-toggle button.is-active {
            color: #312e81;
            background: linear-gradient(135deg, #f8fafc, #ede9fe);
            box-shadow: 0 2px 9px rgba(2, 6, 23, .22);
        }

        .map-checkin-filter-bar {
            top: calc(var(--top-nav-h) + 64px);
            width: min(620px, calc(100vw - 28px));
            min-height: 70px;
            gap: 6px;
            padding: 7px;
            border-radius: 23px;
            overscroll-behavior-inline: contain;
            scroll-padding-inline: 8px;
            transition: opacity .18s ease;
        }

        .map-checkin-filter-bar button {
            min-width: 58px;
            min-height: 54px;
            display: grid;
            grid-template-rows: 28px 14px;
            place-items: center;
            gap: 2px;
            padding: 4px 8px;
            border-radius: 16px;
            color: rgba(226, 232, 240, .84);
            font-size: 9px;
        }

        .map-checkin-filter-bar button.is-active {
            color: #ede9fe;
            background: rgba(109, 40, 217, .46);
            box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .42);
        }

        .map-category-icon {
            width: 28px;
            height: 28px;
            display: grid;
            place-items: center;
            border-radius: 50%;
            background: rgba(248, 250, 252, .96);
            color: #312e81;
            font-size: 15px;
            box-shadow: 0 2px 8px rgba(2, 6, 23, .26);
        }

        .map-nearby-context {
            bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 70px);
            min-height: 44px;
            max-width: min(390px, calc(100vw - 116px));
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 0 13px;
            appearance: none;
            cursor: pointer;
            transition: bottom .18s ease, border-color .18s ease, background-color .18s ease, opacity .18s ease;
        }

        .map-nearby-context:disabled {
            cursor: default;
            opacity: .74;
        }

        .map-nearby-context.is-open {
            border-color: rgba(139, 92, 246, .64);
            background-color: rgba(30, 20, 61, .94);
        }

        .map-nearby-status-dot {
            width: 8px;
            height: 8px;
            flex: 0 0 auto;
            border-radius: 50%;
            background: #34d399;
            box-shadow: 0 0 0 4px rgba(52, 211, 153, .12);
        }

        .map-nearby-status-copy {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .map-nearby-status-chevron {
            font-size: 18px;
            transition: transform .18s ease;
        }

        .map-nearby-context.is-open .map-nearby-status-chevron { transform: rotate(-90deg); }

        .map-nearby-strip {
            bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 120px);
            width: min(700px, calc(100vw - 24px));
            z-index: 69;
            transition: opacity .18s ease;
        }

        .map-nearby-card {
            min-height: 68px;
            background-color: rgba(5, 12, 29, .94);
        }

        #gpsBtn {
            right: max(14px, env(safe-area-inset-right));
            bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 70px);
            display: grid;
            place-items: center;
            background-color: rgba(248, 250, 252, .94);
            color: #172554;
            transition: bottom .18s ease, transform .15s ease, opacity .18s ease;
        }

        #gpsBtn svg,
        .map-sheet-filter-button svg {
            width: 22px;
            height: 22px;
            fill: none;
            stroke: currentColor;
            stroke-width: 1.8;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .map-action-menu {
            left: 50%;
            bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 8px);
            width: min(320px, calc(100vw - 24px));
            max-width: none;
            min-height: 0;
            transform: translateX(-50%);
            display: grid;
            gap: 0;
            padding: 4px;
            border-radius: 18px;
            z-index: 72;
            transition: width .18s ease, opacity .18s ease, transform .18s ease;
        }

        body.map-sheet-expanded .map-action-menu {
            width: min(520px, calc(100vw - 24px));
            padding: 6px 10px 10px;
            border-radius: 22px;
        }

        .map-sheet-toggle {
            width: 100%;
            min-height: 48px;
            display: flex;
            align-items: center;
            gap: 9px;
            padding: 5px 8px;
            appearance: none;
            border: 0;
            border-radius: 14px;
            background: transparent;
            color: #f8fafc;
            text-align: left;
            cursor: pointer;
        }

        .map-sheet-toggle:hover { background: rgba(30, 41, 59, .56); }

        .map-sheet-toggle-icon {
            width: 32px;
            height: 32px;
            flex: 0 0 auto;
            display: grid;
            place-items: center;
            border: 1px solid rgba(96, 165, 250, .3);
            border-radius: 11px;
            background: rgba(37, 99, 235, .14);
            color: #93c5fd;
            font-size: 17px;
            transition: transform .18s ease;
        }

        body.map-sheet-expanded .map-sheet-toggle-icon { transform: rotate(180deg); }

        .map-sheet-toggle-copy {
            min-width: 0;
            flex: 1 1 auto;
            display: grid;
            gap: 2px;
        }

        .map-sheet-toggle-label { font-size: 12px; font-weight: 900; }

        .map-sheet-toggle-meta {
            overflow: hidden;
            color: rgba(191, 219, 254, .76);
            font-size: 9px;
            font-weight: 700;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .map-sheet-toggle-action {
            flex: 0 0 auto;
            padding: 5px 8px;
            border-radius: 999px;
            background: rgba(124, 58, 237, .18);
            color: #ddd6fe;
            font-size: 9px;
            font-weight: 900;
            letter-spacing: .02em;
        }

        .map-sheet-body {
            display: grid;
            gap: 8px;
            padding: 5px 2px 0;
            border-top: 1px solid rgba(148, 163, 184, .16);
        }

        .map-sheet-body[hidden] { display: none; }

        .map-sheet-summary {
            display: grid;
            grid-template-columns: minmax(0, 1fr) 44px;
            align-items: center;
            gap: 8px;
        }

        .map-action-item.map-location-action {
            min-height: 44px;
            padding: 4px 7px;
            border: 0;
            background: transparent;
        }

        .map-action-leading {
            width: 30px;
            height: 30px;
            flex: 0 0 auto;
            display: grid;
            place-items: center;
            border-radius: 50%;
            background: rgba(37, 99, 235, .16);
            color: #93c5fd;
            font-size: 17px;
        }

        .map-sheet-filter-button {
            width: 44px;
            height: 44px;
            display: grid;
            place-items: center;
            appearance: none;
            border: 1px solid rgba(148, 163, 184, .25);
            border-radius: 14px;
            background: rgba(15, 23, 42, .7);
            color: #bfdbfe;
            cursor: pointer;
        }

        .map-sheet-filter-button.is-open,
        .map-sheet-filter-button.is-active-mode {
            border-color: rgba(139, 92, 246, .66);
            background: rgba(76, 29, 149, .42);
            color: #ddd6fe;
        }

        .map-sheet-filter-summary {
            margin: -8px 52px 0 41px;
            overflow: hidden;
            color: rgba(191, 219, 254, .72);
            font-size: 10px;
            font-weight: 700;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .map-action-filters {
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 7px;
            padding: 4px 0 2px;
        }

        .map-filter-chip,
        .map-action-item {
            min-height: 44px;
        }

        .map-filter-chip[data-filter="all"] { grid-column: auto; }

        .map-sheet-actions {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 8px;
            padding-top: 8px;
            border-top: 1px solid rgba(148, 163, 184, .18);
        }

        .map-sheet-primary-action {
            min-height: 58px;
            padding: 7px 9px;
            border: 0;
            background: transparent;
        }

        .map-sheet-primary-action + .map-sheet-primary-action {
            border-left: 1px solid rgba(148, 163, 184, .18);
            border-radius: 0;
        }

        .map-action-item.is-invite,
        .map-action-item.is-invite.is-live,
        .map-action-item.is-invite.is-locked {
            border-top: 0;
            border-right: 0;
            border-bottom: 0;
            background: transparent;
            color: #f8fafc;
        }

        .map-action-item.is-invite .map-action-item-value { color: rgba(203, 213, 225, .78); }
        .map-action-leading-checkin { color: #fbbf24; background: rgba(245, 158, 11, .12); }
        .map-action-leading-invite { color: #a78bfa; background: rgba(124, 58, 237, .16); }

        body.map-sheet-expanded .map-nearby-context,
        body.map-sheet-expanded #gpsBtn {
            bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 232px);
        }

        body.map-sheet-expanded .map-legend-btn {
            bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 284px);
        }

        body.map-sheet-expanded .map-nearby-strip {
            bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 282px);
        }

        body.map-filters-expanded .map-nearby-context,
        body.map-filters-expanded #gpsBtn {
            bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 342px);
        }

        body.map-filters-expanded .map-legend-btn {
            bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 394px);
        }

        body.map-filters-expanded .map-nearby-strip {
            bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 392px);
        }

        /* Give an open avatar card the full map canvas. Navigation stays visible. */
        body.map-popup-open .map-discovery-tools,
        body.map-popup-open .map-checkin-filter-bar,
        body.map-popup-open .map-nearby-context,
        body.map-popup-open .map-nearby-strip,
        body.map-popup-open .map-action-menu,
        body.map-popup-open #gpsBtn,
        body.map-popup-open .status {
            opacity: 0;
            pointer-events: none;
        }

        body.map-popup-open .map-discovery-tools > *,
        body.map-popup-open .map-checkin-filter-bar > *,
        body.map-popup-open .map-nearby-strip > *,
        body.map-popup-open .map-action-menu > * {
            pointer-events: none;
        }

        body.map-list-mode .map-nearby-context,
        body.map-list-mode .map-action-menu,
        body.map-list-mode #gpsBtn {
            visibility: hidden;
            pointer-events: none;
        }

        body.map-list-mode .map-list-panel {
            bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
            padding-top: 150px;
            padding-bottom: 32px;
        }

        body.map-list-mode .map-checkin-filter-bar { display: flex; }

        .map-view-toggle button:focus-visible,
        .map-layer-toggle button:focus-visible,
        .map-checkin-filter-bar button:focus-visible,
        .map-search-area-btn:focus-visible,
        .map-legend-btn:focus-visible,
        .map-nearby-context:focus-visible,
        .map-nearby-card:focus-visible,
        .map-action-menu button:focus-visible,
        #gpsBtn:focus-visible {
            outline: 3px solid #60a5fa;
            outline-offset: 2px;
        }

        @supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
            .map-view-toggle,
            .map-layer-toggle,
            .map-checkin-filter-bar,
            .map-search-area-btn,
            .map-legend-btn,
            .map-nearby-context,
            .map-nearby-card,
            .map-action-menu { background-color: #071126; }
        }

        @media (max-width: 640px) {
            .map-discovery-tools { top: calc(var(--top-nav-h) + 8px); }
            .map-view-toggle { width: 102px; }
            .map-layer-toggle { width: 180px; }
            .map-layer-toggle button { padding-inline: 5px; font-size: 9px; }
            .map-checkin-filter-bar { top: calc(var(--top-nav-h) + 62px); }
            .map-search-area-btn { top: calc(var(--top-nav-h) + 140px); }
            .map-action-menu {
                left: 50%;
                bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 7px);
                max-width: none;
            }
            .map-action-item { padding: 7px 8px; }
            .map-nearby-card { flex-basis: 154px; }
        }

        @media (max-width: 350px) {
            .map-discovery-tools {
                left: max(8px, env(safe-area-inset-left));
                right: max(8px, env(safe-area-inset-right));
                gap: 4px;
            }
            .map-checkin-filter-bar { width: calc(100vw - 16px); }
            .map-view-toggle { width: 88px; }
            .map-layer-toggle { width: 144px; }
            .map-layer-toggle button { min-width: 0; padding-inline: 2px; font-size: 8px; }
            .map-sheet-filter-summary { display: none; }
            .map-action-item-label { font-size: 11px; }
            .map-action-item-value { font-size: 9px; }
            .map-nearby-context { max-width: calc(100vw - 106px); }
        }

        @media (max-height: 620px) {
            .map-discovery-tools { top: calc(var(--top-nav-h) + 6px); }
            .map-checkin-filter-bar { top: calc(var(--top-nav-h) + 56px); min-height: 56px; }
            .map-checkin-filter-bar button { min-height: 42px; grid-template-rows: 22px 12px; }
            .map-category-icon { width: 22px; height: 22px; font-size: 12px; }
            .map-nearby-context,
            #gpsBtn { bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 70px); }
            .map-nearby-strip { bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 120px); }
            .map-nearby-card { min-height: 62px; }
            body.map-sheet-expanded .map-nearby-context,
            body.map-sheet-expanded .map-nearby-strip { visibility: hidden; pointer-events: none; }
        }

        @media (min-width: 900px) {
            .map-checkin-filter-bar { width: min(660px, calc(100vw - 40px)); }
            body.map-sheet-expanded .map-action-menu { width: 540px; }
            #gpsBtn,
            .map-legend-btn { right: max(28px, calc((100vw - 900px) / 2)); }
        }

        @media (prefers-reduced-motion: reduce) {
            .map-discovery-tools,
            .map-checkin-filter-bar,
            .map-nearby-context,
            .map-nearby-strip,
            .map-nearby-status-chevron,
            .map-action-menu,
            .map-legend-btn,
            #gpsBtn { transition: none !important; }
        }

        /* Staging map mock: replace the bottom options sheet with a compact action rail. */
        .map-action-rail {
            position: fixed;
            right: max(14px, env(safe-area-inset-right));
            bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 14px);
            z-index: 74;
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 7px;
            pointer-events: none;
            transition: opacity .18s ease, transform .18s ease;
        }

        .map-action-hint {
            position: fixed;
            right: max(70px, calc(env(safe-area-inset-right) + 56px));
            bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 14px);
            z-index: 75;
            width: min(248px, calc(100vw - 90px));
            padding: 14px;
            border: 1px solid rgba(167, 139, 250, .42);
            border-radius: 20px;
            background: rgba(5, 12, 29, .97);
            color: #f8fafc;
            box-shadow: 0 18px 42px rgba(2, 6, 23, .52);
            -webkit-backdrop-filter: blur(20px) saturate(1.15);
            backdrop-filter: blur(20px) saturate(1.15);
            opacity: 0;
            transform: translateX(8px) scale(.98);
            pointer-events: none;
            transition: opacity .18s ease, transform .18s ease;
        }

        .map-action-hint::after {
            content: '';
            position: absolute;
            right: -7px;
            top: 50%;
            width: 12px;
            height: 12px;
            border-top: 1px solid rgba(167, 139, 250, .42);
            border-right: 1px solid rgba(167, 139, 250, .42);
            background: rgba(5, 12, 29, .97);
            transform: translateY(-50%) rotate(45deg);
        }

        .map-action-hint.is-visible {
            opacity: 1;
            transform: translateX(0) scale(1);
            pointer-events: auto;
        }

        .map-action-hint-kicker {
            color: #a78bfa;
            font-size: 9px;
            font-weight: 900;
            letter-spacing: .12em;
            text-transform: uppercase;
        }

        .map-action-hint-title {
            margin-top: 3px;
            font-size: 15px;
            font-weight: 900;
        }

        .map-action-hint-copy {
            margin: 4px 0 10px;
            color: rgba(203, 213, 225, .86);
            font-size: 10px;
            line-height: 1.4;
        }

        .map-action-hint-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 7px 9px;
            font-size: 10px;
            font-weight: 750;
        }

        .map-action-hint-grid span {
            min-width: 0;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .map-action-hint-grid .map-action-hint-icon {
            width: 20px;
            height: 20px;
            flex: 0 0 20px;
            display: grid;
            place-items: center;
            border-radius: 50%;
            border: 1px solid var(--seen-border, rgba(255, 255, 255, .1));
            background: rgba(255, 255, 255, .06);
            color: var(--seen-text-primary, #f5f5f7);
            font-size: 11px;
            font-style: normal;
        }

        .map-action-hint-icon svg {
            width: 14px;
            height: 14px;
            fill: none;
            stroke: currentColor;
            stroke-width: 1.8;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .map-action-hint-icon i {
            width: 14px;
            height: 14px;
            display: grid;
            place-items: center;
            border: 1.5px solid currentColor;
            border-radius: 50%;
            font: 800 9px/1 ui-rounded, system-ui, sans-serif;
        }

        .map-action-hint-icon.is-checkin { color: var(--seen-gold, #ffb340); }
        .map-action-hint-icon.is-invite { color: var(--seen-purple, #8b7cff); }

        .map-action-hint-dismiss {
            width: 100%;
            min-height: 40px;
            margin-top: 12px;
            border: 1px solid rgba(167, 139, 250, .5);
            border-radius: 13px;
            background: rgba(76, 29, 149, .72);
            color: #fff;
            font: 850 11px/1 inherit;
            cursor: pointer;
        }

        .map-nearby-context {
            bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 14px);
            max-width: min(390px, calc(100vw - 86px));
        }

        .map-nearby-strip {
            bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 64px);
            width: min(700px, calc(100vw - 116px));
        }

        .map-rail-btn,
        #gpsBtn.map-rail-btn,
        .map-legend-btn.map-rail-btn {
            position: relative;
            inset: auto;
            width: 44px;
            min-width: 44px;
            height: 44px;
            min-height: 44px;
            padding: 0;
            display: grid;
            place-items: center;
            appearance: none;
            border: 1px solid rgba(148, 163, 184, .28);
            border-radius: 50%;
            background: rgba(5, 12, 29, .92);
            color: #f8fafc;
            box-shadow: 0 10px 26px rgba(2, 6, 23, .38);
            -webkit-backdrop-filter: blur(18px) saturate(1.15);
            backdrop-filter: blur(18px) saturate(1.15);
            cursor: pointer;
            pointer-events: auto;
            transition: transform .15s ease, opacity .18s ease, border-color .15s ease, background-color .15s ease;
        }

        .map-rail-btn:hover {
            transform: translateX(-2px);
            border-color: rgba(167, 139, 250, .62);
            background: rgba(22, 28, 45, .98);
        }

        .map-rail-btn.is-open,
        .map-rail-btn.is-active-mode {
            border-color: rgba(167, 139, 250, .78);
            background: rgba(76, 29, 149, .82);
        }

        .map-rail-btn.is-invite {
            color: #ddd6fe;
        }

        .map-rail-btn.is-invite.is-live {
            border-color: rgba(236, 72, 153, .66);
            background: rgba(88, 28, 135, .94);
            color: #fdf2f8;
        }

        .map-rail-btn.is-invite.is-locked {
            color: rgba(203, 213, 225, .76);
        }

        .map-rail-btn[disabled] {
            opacity: .52;
            cursor: default;
            transform: none;
        }

        .map-rail-btn svg {
            width: 21px;
            height: 21px;
            fill: none;
            stroke: currentColor;
            stroke-width: 1.8;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .map-rail-icon {
            font-size: 19px;
            font-weight: 900;
            line-height: 1;
        }

        .map-checkin-rail-btn .map-rail-icon { color: #fbbf24; }
        .map-invite-rail-btn .map-rail-icon { color: #a78bfa; font-size: 14px; }

        .map-info-icon {
            width: 22px;
            height: 22px;
            display: grid;
            place-items: center;
            border: 2px solid currentColor;
            border-radius: 50%;
            font: 900 13px/1 ui-rounded, system-ui, sans-serif;
        }

        .map-rail-tooltip {
            position: absolute;
            top: 50%;
            right: calc(100% + 9px);
            min-width: 146px;
            max-width: min(240px, calc(100vw - 82px));
            padding: 8px 10px;
            display: grid;
            gap: 2px;
            transform: translate(5px, -50%);
            border: 1px solid rgba(148, 163, 184, .26);
            border-radius: 12px;
            background: rgba(5, 12, 29, .96);
            color: #f8fafc;
            box-shadow: 0 10px 28px rgba(2, 6, 23, .42);
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            text-align: left;
            white-space: nowrap;
            transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
        }

        .map-rail-tooltip strong { font-size: 11px; line-height: 1.2; }
        .map-rail-tooltip small {
            overflow: hidden;
            color: rgba(191, 219, 254, .78);
            font-size: 9px;
            line-height: 1.25;
            text-overflow: ellipsis;
        }

        @media (hover: hover) and (pointer: fine) {
            .map-rail-btn:hover .map-rail-tooltip,
            .map-rail-btn:focus-visible .map-rail-tooltip {
                transform: translate(0, -50%);
                opacity: 1;
                visibility: visible;
            }
        }

        .map-filters-modal-card {
            width: min(440px, calc(100vw - 28px));
        }

        .map-filters-modal-copy {
            margin: 5px 0 0;
            color: #cbd5e1;
            font-size: 11px;
            line-height: 1.45;
        }

        .map-filters-modal-card .map-action-filters {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 8px;
            margin-top: 16px;
        }

        .map-filters-modal-card .map-filter-chip[data-filter="all"] {
            grid-column: 1 / -1;
        }

        body.map-popup-open .map-action-rail,
        body.map-popup-open .map-action-hint,
        body.map-modal-open .map-discovery-tools,
        body.map-modal-open .map-checkin-filter-bar,
        body.map-modal-open .map-nearby-context,
        body.map-modal-open .map-nearby-strip,
        body.map-modal-open .map-action-rail,
        body.map-modal-open .map-action-hint,
        body.map-modal-open .map-search-area-btn,
        body.map-modal-open .status {
            opacity: 0;
            pointer-events: none;
        }

        body.map-popup-open .map-action-rail > *,
        body.map-modal-open .map-action-rail > * {
            pointer-events: none;
        }

        body.map-list-mode .map-action-rail {
            visibility: hidden;
            pointer-events: none;
        }

        body.map-list-mode .map-action-hint {
            display: none;
        }

        .map-rail-btn:focus-visible {
            outline: 3px solid #60a5fa;
            outline-offset: 2px;
        }

        @supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
            .map-rail-btn,
            .map-action-hint,
            #gpsBtn.map-rail-btn,
            .map-legend-btn.map-rail-btn { background: #071126; }
        }

        @media (max-height: 700px) {
            .map-action-rail { gap: 5px; }
            .map-rail-btn,
            #gpsBtn.map-rail-btn,
            .map-legend-btn.map-rail-btn {
                width: 40px;
                min-width: 40px;
                height: 40px;
                min-height: 40px;
            }
        }

        @media (min-width: 900px) {
            .map-action-rail { right: max(28px, calc((100vw - 900px) / 2)); }
            .map-action-hint { right: max(84px, calc((100vw - 900px) / 2 + 56px)); }
        }

        @media (prefers-reduced-motion: reduce) {
            .map-action-rail,
            .map-action-hint,
            .map-rail-btn,
            .map-rail-tooltip { transition: none !important; }
        }
