        :root {
            --sky: #B8D8F0;
            --deep: #0D2B5E;
            --violet: #6B3FA0;
            --orange: #E8772A;
            --red: #C42B2B;
            --white: #F5F0EB;

            /* ── MAP CONTROL SURFACE ──
               One material for every icon control that floats over the map:
               a pane of tinted glass (translucent, blurred, hairline edge)
               with a violet glyph. Deliberately quiet — no coloured glows, no
               gradients, no lettering — so the controls read as instruments on
               the imagery instead of badges. Change a token here and every
               map button follows. */
            --ctl-radius: 12px;
            --ctl-bg: rgba(24, 19, 40, 0.45);
            --ctl-bg-hover: rgba(45, 33, 74, 0.60);
            --ctl-bg-press: rgba(38, 27, 64, 0.68);
            --ctl-bg-engaged: rgba(126, 94, 214, 0.26);
            --ctl-border: rgba(198, 180, 255, 0.20);
            --ctl-border-hover: rgba(198, 180, 255, 0.38);
            --ctl-border-engaged: rgba(206, 190, 255, 0.55);
            --ctl-icon: #BBA9F2;
            --ctl-icon-hover: #DCD2FB;
            --ctl-icon-engaged: #F0EBFF;
            --ctl-live: #F08298;   /* live / recording status only */
            --ctl-blur: blur(18px) saturate(150%);
            --ctl-shadow: 0 6px 18px rgba(4, 6, 18, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.07);
            --ctl-shadow-hover: 0 8px 22px rgba(4, 6, 18, 0.40), inset 0 1px 0 rgba(255, 255, 255, 0.10);

            /* ── SLIM 3D-STYLE PASTEL FADED SEMITRANSPARENT ORANGE SLIDER TOKENS ──
               Shared by layer-window sliders, on-map vertical mirrors, 3D controls,
               custom map overlays, and settings panels. */
            --slider-track-h: 3px;
            --slider-thumb-size: 12px;
            --slider-v-thumb-size: 13px;
            --slider-track-bg: rgba(245, 240, 235, 0.14);
            --slider-fill: rgba(242, 170, 121, 0.52);
            --slider-fill-soft: rgba(242, 170, 121, 0.24);
            --slider-thumb-bg: rgba(244, 176, 128, 0.74);
            --slider-thumb-bg-hover: rgba(248, 188, 144, 0.88);
            --slider-thumb-border: rgba(255, 228, 206, 0.52);
            --slider-thumb-shadow: 0 1px 4px rgba(4, 6, 18, 0.36);
            --slider-value-color: rgba(246, 186, 142, 0.92);
        }

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

        html {
            width: 100%;
            max-width: 100%;
            overflow-x: hidden;
            overscroll-behavior-x: none;
            scroll-behavior: smooth;
            /* PWA safe area (iPhone notch) — fills the status bar / notch area */
            background-color: #091123;
        }

        body {
            width: 100%;
            max-width: 100%;
            font-family: 'Outfit', sans-serif;
            background-color: #060E1E;
            color: var(--white);
            overflow-x: hidden;
            overscroll-behavior-x: none;
        }

        @supports (overflow-x: clip) {
            html,
            body {
                overflow-x: clip;
            }
        }

        /* PWA: solid #091123 bar behind the iPhone notch so it blends with the nav theme */
        @supports (padding-top: env(safe-area-inset-top)) {
            body::before {
                content: '';
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                height: env(safe-area-inset-top, 0px);
                background: #091123;
                z-index: 1001;
                pointer-events: none;
            }
        }

        /* ── APM 2.0 Search Help — overlay flotant centrat pe hartă ── */
        #apm20SearchHelpBtn {
            display: none;
            position: absolute;
            bottom: calc(26px + var(--layer-dock-clearance, 0px));
            left: 50%;
            transform: translateX(-50%);
            z-index: 900;
            align-items: center;
            gap: 8px;
            background: rgba(13, 28, 60, 0.88);
            border: 1px solid rgba(107,63,160,0.55);
            color: #B8D8F0;
            padding: 10px 22px;
            border-radius: 24px;
            font-family: 'Outfit', sans-serif;
            font-size: 0.82rem;
            font-weight: 600;
            cursor: pointer;
            letter-spacing: 0.06em;
            white-space: nowrap;
            backdrop-filter: blur(10px);
            box-shadow: 0 4px 20px rgba(107,63,160,0.35), 0 2px 8px rgba(0,0,0,0.5);
            transition: all 0.2s;
        }
        #apm20SearchHelpBtn:hover {
            background: rgba(107,63,160,0.55);
            border-color: rgba(107,63,160,0.9);
            color: #fff;
            box-shadow: 0 6px 24px rgba(107,63,160,0.55), 0 2px 8px rgba(0,0,0,0.5);
        }
        #apm20SearchHelpBtn:disabled {
            opacity: 0.6;
            cursor: wait;
            pointer-events: none;
        }
        #apm20SearchHelpBtn.needs-zoom {
            opacity: 0.55;
            cursor: not-allowed;
        }

        /* ── Iozefina+ Buildings Search Help button ── */
        #iosBldSearchHelpBtn {
            display: none;
            position: absolute;
            bottom: 76px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 900;
            align-items: center;
            gap: 6px;
            background: rgba(13, 28, 60, 0.88);
            border: 1px solid rgba(200,169,110,0.55);
            color: #f5d98a;
            padding: 9px 14px;
            border-radius: 24px;
            font-family: 'Outfit', sans-serif;
            font-size: 0.74rem;
            font-weight: 600;
            cursor: pointer;
            letter-spacing: 0.02em;
            white-space: nowrap;
            backdrop-filter: blur(10px);
            box-shadow: 0 4px 20px rgba(200,169,110,0.28), 0 2px 8px rgba(0,0,0,0.5);
            transition: all 0.2s;
        }
        #iosBldSearchHelpBtn:hover {
            background: rgba(200,169,110,0.35);
            border-color: rgba(200,169,110,0.9);
            color: #fff;
            box-shadow: 0 6px 24px rgba(200,169,110,0.5), 0 2px 8px rgba(0,0,0,0.5);
        }
        #iosBldSearchHelpBtn:disabled {
            opacity: 0.6;
            cursor: wait;
            pointer-events: none;
        }
        #iosBldSearchHelpHint {
            display: none;
            position: absolute;
            bottom: 76px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 900;
            align-items: center;
            gap: 8px;
            background: rgba(13, 28, 60, 0.88);
            border: 1px solid rgba(200,169,110,0.25);
            color: #f5d98a;
            padding: 10px 22px;
            border-radius: 24px;
            font-family: 'Outfit', sans-serif;
            font-size: 0.82rem;
            font-weight: 600;
            letter-spacing: 0.06em;
            white-space: nowrap;
            backdrop-filter: blur(10px);
            box-shadow: 0 4px 20px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.5);
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.25s ease;
        }
        #iosBldSearchHelpHint.visible { opacity: 1; }
        #iosBldSearchHelpToast {
            display: none;
            position: absolute;
            bottom: 130px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 901;
            background: rgba(13, 28, 60, 0.92);
            border: 1px solid rgba(200,169,110,0.25);
            border-radius: 8px;
            padding: 9px 18px;
            color: #f5d98a;
            font-family: 'Outfit', sans-serif;
            font-size: 0.8rem;
            font-weight: 500;
            white-space: nowrap;
            pointer-events: none;
            backdrop-filter: blur(8px);
            box-shadow: 0 4px 18px rgba(0,0,0,0.45);
        }

        /* ── Iozefina+ Buildings — buton setări detecție ("Ruleaza detectia pe viewport", portat din model-test-v3.1.html) ── */
        #iosBldSettingsBtn {
            display: none;
            position: absolute;
            bottom: 76px;
            left: 50%;
            transform: translateX(-50%) translateX(112px);
            z-index: 900;
            align-items: center;
            justify-content: center;
            width: 38px;
            height: 38px;
            background: rgba(13, 28, 60, 0.88);
            border: 1px solid rgba(200,169,110,0.55);
            color: #f5d98a;
            border-radius: 50%;
            cursor: pointer;
            backdrop-filter: blur(10px);
            box-shadow: 0 4px 20px rgba(200,169,110,0.28), 0 2px 8px rgba(0,0,0,0.5);
            transition: all 0.2s;
            font-size: 0.95rem;
        }
        #iosBldSettingsBtn:hover {
            background: rgba(200,169,110,0.35);
            border-color: rgba(200,169,110,0.9);
            color: #fff;
        }

        /* ── Iozefina+ Buildings — buton "Sugerează un poligon" (desenare manuală de clădiri nedetectate) ── */
        #iosBldSuggestBtn {
            display: none;
            position: absolute;
            bottom: 76px;
            left: 50%;
            transform: translateX(-50%) translateX(-112px);
            z-index: 900;
            align-items: center;
            justify-content: center;
            width: 38px;
            height: 38px;
            background: rgba(13, 28, 60, 0.88);
            border: 1px solid rgba(107,193,228,0.55);
            color: #6EC1E4;
            border-radius: 50%;
            cursor: pointer;
            backdrop-filter: blur(10px);
            box-shadow: 0 4px 20px rgba(107,193,228,0.28), 0 2px 8px rgba(0,0,0,0.5);
            transition: all 0.2s;
            font-size: 0.95rem;
        }
        #iosBldSuggestBtn:hover {
            background: rgba(107,193,228,0.3);
            border-color: rgba(107,193,228,0.9);
            color: #fff;
        }
        #iosBldSuggestBtn.active {
            background: #6EC1E4;
            border-color: #6EC1E4;
            color: #0D2B5E;
            box-shadow: 0 4px 20px rgba(107,193,228,0.6), 0 2px 8px rgba(0,0,0,0.5);
        }
        #iosBldSuggestPopup { font-family: 'Outfit', sans-serif; font-size: 13px; min-width: 180px; }
        #iosBldSuggestPopup .ios-bld-fb-row { margin-top: 8px; display: flex; gap: 6px; }
        #iosBldSuggestPopup button { cursor: pointer; padding: 5px 9px; border-radius: 5px; border: 1px solid #ccc; }

        #iosBldSettingsPanel {
            display: none;
            position: absolute;
            bottom: 124px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 950;
            width: 288px;
            background: var(--ctl-bg);
            border: 1px solid var(--ctl-border);
            border-radius: var(--ctl-radius);
            padding: 12px 14px;
            color: var(--slider-value-color);
            font-family: 'Outfit', sans-serif;
            -webkit-backdrop-filter: var(--ctl-blur);
            backdrop-filter: var(--ctl-blur);
            box-shadow: var(--ctl-shadow);
        }
        #iosBldSettingsPanel.open { display: block; }
        #iosBldSettingsPanel h4 {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: rgba(245, 240, 235, 0.88);
            margin: 0 0 10px;
            font-weight: 600;
        }
        #iosBldSettingsPanel .ios-bld-field {
            display: flex;
            flex-direction: column;
            gap: 4px;
            margin-bottom: 10px;
        }
        #iosBldSettingsPanel label {
            font-size: 0.72rem;
            color: rgba(245, 240, 235, 0.8);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        #iosBldSettingsPanel .ios-bld-val {
            font-family: 'Outfit', sans-serif;
            font-variant-numeric: tabular-nums;
            color: var(--slider-value-color);
            font-size: 0.72rem;
            font-weight: 600;
        }
        #iosBldSettingsPanel input[type=range] {
            -webkit-appearance: none;
            appearance: none;
            width: 100%;
            height: var(--slider-track-h);
            margin: 3px 0;
            padding: 0;
            border: 0;
            border-radius: 999px;
            background: linear-gradient(90deg, var(--slider-fill) 0%, var(--slider-fill) var(--slider-pct, 0%), var(--slider-track-bg) var(--slider-pct, 0%), var(--slider-track-bg) 100%);
            accent-color: rgba(244, 176, 128, 0.82);
            outline: none;
            cursor: pointer;
        }
        #iosBldSettingsPanel input[type=range]::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: var(--slider-thumb-size);
            height: var(--slider-thumb-size);
            border-radius: 50%;
            background: var(--slider-thumb-bg);
            border: 1px solid var(--slider-thumb-border);
            box-shadow: var(--slider-thumb-shadow);
            cursor: pointer;
            transition: background 0.15s ease, transform 0.15s ease;
        }
        #iosBldSettingsPanel input[type=range]::-webkit-slider-thumb:hover {
            background: var(--slider-thumb-bg-hover);
            transform: scale(1.1);
        }
        #iosBldSettingsPanel input[type=range]::-moz-range-thumb {
            width: var(--slider-thumb-size);
            height: var(--slider-thumb-size);
            border-radius: 50%;
            background: var(--slider-thumb-bg);
            border: 1px solid var(--slider-thumb-border);
            box-shadow: var(--slider-thumb-shadow);
            cursor: pointer;
        }
        #iosBldSettingsPanel input[type=range]::-moz-range-track {
            height: var(--slider-track-h);
            border: 0;
            border-radius: 999px;
            background: var(--slider-track-bg);
        }
        #iosBldSettingsPanel input[type=range]::-moz-range-progress {
            height: var(--slider-track-h);
            border-radius: 999px;
            background: var(--slider-fill);
        }
        #iosBldSettingsPanel input[type=number],
        #iosBldSettingsPanel input[type=text] {
            width: 100%;
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(200,169,110,0.3);
            color: #F5F0EB;
            padding: 7px 9px;
            border-radius: 6px;
            font-size: 0.78rem;
            font-family: 'Outfit', sans-serif;
        }
        #iosBldSettingsPanel .ios-bld-checkbox-row {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.75rem;
            color: #B8D8F0;
            cursor: pointer;
            margin-bottom: 12px;
        }
        #iosBldSettingsPanel .ios-bld-hint {
            font-size: 0.68rem;
            color: rgba(184,216,240,0.65);
            line-height: 1.4;
            margin: -6px 0 12px;
        }
        #iosBldFeedbackPopup { font-family: 'Outfit', sans-serif; font-size: 13px; min-width: 170px; }
        #iosBldFeedbackPopup .ios-bld-fb-row { margin-top: 8px; display: flex; gap: 6px; }
        #iosBldFeedbackPopup button { cursor: pointer; padding: 5px 9px; border-radius: 5px; border: 1px solid #ccc; }

        /* Hint persistent "Zoom in for advanced search" — același loc ca butonul, înainte de zoom-ul minim */
        #apm20SearchHelpHint {
            display: none;
            position: absolute;
            bottom: calc(26px + var(--layer-dock-clearance, 0px));
            left: 50%;
            transform: translateX(-50%);
            z-index: 900;
            align-items: center;
            gap: 8px;
            background: rgba(13, 28, 60, 0.88);
            border: 1px solid rgba(184,216,240,0.30);
            color: #B8D8F0;
            padding: 10px 22px;
            border-radius: 24px;
            font-family: 'Outfit', sans-serif;
            font-size: 0.82rem;
            font-weight: 600;
            letter-spacing: 0.06em;
            white-space: nowrap;
            backdrop-filter: blur(10px);
            box-shadow: 0 4px 20px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.5);
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.25s ease;
        }
        #apm20SearchHelpHint.visible {
            opacity: 1;
        }
        #apm20SearchHelpHint .zh-icon {
            font-size: 1rem;
            flex-shrink: 0;
        }
        /* Toast feedback pentru Search Help */
        #apm20SearchHelpToast {
            display: none;
            position: absolute;
            bottom: 90px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 901;
            background: rgba(13, 28, 60, 0.92);
            border: 1px solid rgba(184,216,240,0.25);
            border-radius: 8px;
            padding: 9px 18px;
            color: #B8D8F0;
            font-family: 'Outfit', sans-serif;
            font-size: 0.8rem;
            font-weight: 500;
            white-space: nowrap;
            pointer-events: none;
            backdrop-filter: blur(8px);
            box-shadow: 0 4px 18px rgba(0,0,0,0.45);
        }

        /* ── OSM Places tooltip ── stil Google Maps (fara fundal) ── */
        .osm-places-tooltip {
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
            backdrop-filter: none !important;
            padding: 0 !important;
            color: #ffffff;
            font-family: 'Outfit', sans-serif;
            font-size: 0.78rem;
            font-weight: 600;
            white-space: nowrap;
            text-shadow:
                0 0 3px rgba(0,0,0,0.9),
                0 1px 4px rgba(0,0,0,0.85),
                1px 1px 0 rgba(0,0,0,0.8),
               -1px -1px 0 rgba(0,0,0,0.8),
                1px -1px 0 rgba(0,0,0,0.8),
               -1px  1px 0 rgba(0,0,0,0.8);
            letter-spacing: 0.01em;
            line-height: 1.3;
        }
        .osm-places-tooltip::before { display: none; }

        /* ── Romania-wide LIDAR: elimina fundalul alb al tile-urilor ArcGIS pe harta satelit ── */
        .lidar-ro2m-tiles,
        .lidar-ro5m-tiles,
        .lidar-ro1m-tiles {
            filter: invert(1);
            mix-blend-mode: screen;
        }

        /* ── Premium Historical Maps Coverage Polygons ── */
        .premium-map-coverage {
            cursor: pointer;
            transition: opacity 0.2s, stroke-width 0.2s;
        }
        .premium-map-coverage:hover {
            opacity: 0.7 !important;
            stroke-width: 3 !important;
        }
        .leaflet-popup-premium {
            font-family: 'Outfit', sans-serif;
            font-size: 0.85rem;
        }

        /* ── CS-LAKI III zoom hint toast ── */
        #cs917ZoomHint {
            display: none;
            position: absolute;
            bottom: calc(52px + var(--layer-dock-clearance, 0px));
            left: 50%;
            transform: translateX(-50%) translateY(8px);
            z-index: 900;
            background: rgba(13, 28, 60, 0.92);
            border: 1px solid rgba(184,216,240,0.30);
            border-radius: 8px;
            padding: 9px 18px 9px 14px;
            color: #B8D8F0;
            font-family: 'Outfit', sans-serif;
            font-size: 0.82rem;
            font-weight: 500;
            white-space: nowrap;
            pointer-events: none;
            box-shadow: 0 4px 18px rgba(0,0,0,0.45);
            gap: 8px;
            align-items: center;
            backdrop-filter: blur(8px);
            opacity: 0;
            transition: opacity 0.25s ease, transform 0.25s ease;
        }
        #cs917ZoomHint.visible {
            display: flex;
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }
        #cs917ZoomHint .zh-icon { font-size: 1rem; flex-shrink: 0; }
        #cs917ZoomHint .zh-label { display: flex; flex-direction: column; gap: 4px; }
        #cs917ZoomHint .zh-bar {
            display: flex;
            align-items: center;
            gap: 3px;
        }
        #cs917ZoomHint .zh-pip {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: rgba(184,216,240,0.22);
            transition: background 0.2s;
        }
        #cs917ZoomHint .zh-pip.filled { background: #B8D8F0; }

        /* ── DJ-LAKI III zoom hint toast ── */
        #dj917ZoomHint {
            display: none;
            position: absolute;
            bottom: 96px;
            left: 50%;
            transform: translateX(-50%) translateY(8px);
            z-index: 900;
            background: rgba(13, 28, 60, 0.92);
            border: 1px solid rgba(184,216,240,0.30);
            border-radius: 8px;
            padding: 9px 18px 9px 14px;
            color: #B8D8F0;
            font-family: 'Outfit', sans-serif;
            font-size: 0.82rem;
            font-weight: 500;
            white-space: nowrap;
            pointer-events: none;
            box-shadow: 0 4px 18px rgba(0,0,0,0.45);
            gap: 8px;
            align-items: center;
            backdrop-filter: blur(8px);
            opacity: 0;
            transition: opacity 0.25s ease, transform 0.25s ease;
        }
        #dj917ZoomHint.visible {
            display: flex;
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }
        #dj917ZoomHint .zh-icon { font-size: 1rem; flex-shrink: 0; }
        #dj917ZoomHint .zh-label { display: flex; flex-direction: column; gap: 4px; }
        #dj917ZoomHint .zh-bar {
            display: flex;
            align-items: center;
            gap: 3px;
        }
        #dj917ZoomHint .zh-pip {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: rgba(184,216,240,0.22);
            transition: background 0.2s;
        }
        #dj917ZoomHint .zh-pip.filled { background: #B8D8F0; }

        /* ── GJ-LAKI III zoom hint toast ── */
        #gj917ZoomHint {
            display: none;
            position: absolute;
            bottom: 140px;
            left: 50%;
            transform: translateX(-50%) translateY(8px);
            z-index: 900;
            background: rgba(13, 28, 60, 0.92);
            border: 1px solid rgba(184,216,240,0.30);
            border-radius: 8px;
            padding: 9px 18px 9px 14px;
            color: #B8D8F0;
            font-family: 'Outfit', sans-serif;
            font-size: 0.82rem;
            font-weight: 500;
            white-space: nowrap;
            pointer-events: none;
            box-shadow: 0 4px 18px rgba(0,0,0,0.45);
            gap: 8px;
            align-items: center;
            backdrop-filter: blur(8px);
            opacity: 0;
            transition: opacity 0.25s ease, transform 0.25s ease;
        }
        #gj917ZoomHint.visible {
            display: flex;
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }
        #gj917ZoomHint .zh-icon { font-size: 1rem; flex-shrink: 0; }
        #gj917ZoomHint .zh-label { display: flex; flex-direction: column; gap: 4px; }
        #gj917ZoomHint .zh-bar {
            display: flex;
            align-items: center;
            gap: 3px;
        }
        #gj917ZoomHint .zh-pip {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: rgba(184,216,240,0.22);
            transition: background 0.2s;
        }
        #gj917ZoomHint .zh-pip.filled { background: #B8D8F0; }

        /* ── MH-LAKI III zoom hint toast ── */
        #mh917ZoomHint {
            display: none;
            position: absolute;
            bottom: 184px;
            left: 50%;
            transform: translateX(-50%) translateY(8px);
            z-index: 900;
            background: rgba(13, 28, 60, 0.92);
            border: 1px solid rgba(184,216,240,0.30);
            border-radius: 8px;
            padding: 9px 18px 9px 14px;
            color: #B8D8F0;
            font-family: 'Outfit', sans-serif;
            font-size: 0.82rem;
            font-weight: 500;
            white-space: nowrap;
            pointer-events: none;
            box-shadow: 0 4px 18px rgba(0,0,0,0.45);
            gap: 8px;
            align-items: center;
            backdrop-filter: blur(8px);
            opacity: 0;
            transition: opacity 0.25s ease, transform 0.25s ease;
        }
        #mh917ZoomHint.visible {
            display: flex;
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }
        #mh917ZoomHint .zh-icon { font-size: 1rem; flex-shrink: 0; }
        #mh917ZoomHint .zh-label { display: flex; flex-direction: column; gap: 4px; }
        #mh917ZoomHint .zh-bar {
            display: flex;
            align-items: center;
            gap: 3px;
        }
        #mh917ZoomHint .zh-pip {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: rgba(184,216,240,0.22);
            transition: background 0.2s;
        }
        #mh917ZoomHint .zh-pip.filled { background: #B8D8F0; }

        /* ── IOSFREE MAP LAYER (plutitor direct pe hartă) ── */
        #iosfreeModal {
            display: none;
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 950;
            background: transparent;
            pointer-events: none;
            animation: iosOverlayFadeIn 0.25s ease;
            align-items: center;
            justify-content: center;
        }
        #iosfreeModal.visible {
            display: flex;
        }
        @keyframes iosOverlayFadeIn {
            from { opacity: 0; transform: translateY(-6px); }
            to   { opacity: 1; transform: translateY(0); }
        }
        #iosfreeModalInner {
            position: relative;
            width: 680px;
            max-width: calc(100% - 24px);
            background: transparent;
            border: none;
            border-radius: 6px;
            overflow: hidden;
            box-shadow: 0 4px 24px rgba(0,0,0,0.55);
            pointer-events: all;
        }
        #iosfreeModalImg {
            display: block;
            width: 100%;
            height: auto;
            border-radius: 6px;
        }
        #iosfreeModalCloseBtn {
            position: absolute;
            top: 6px;
            right: 6px;
            width: 24px;
            height: 24px;
            background: rgba(0,0,0,0.55);
            border: none;
            border-radius: 50%;
            color: #fff;
            font-size: 0.85rem;
            line-height: 24px;
            text-align: center;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.15s;
            z-index: 2;
        }
        #iosfreeModalCloseBtn:hover { background: rgba(0,0,0,0.85); }
        .map-frame.is-fullscreen #iosfreeModal {
            position: fixed;
        }

        /* ── IOSFREE PAN BUTTONS ── */
        #iosfreeModalOuter {
            display: flex;
            flex-direction: row;
            align-items: flex-start;
            gap: 8px;
            pointer-events: all;
        }
        #iosfreeModalCenterCol {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }
        #iosfreePanV {
            display: flex;
            flex-direction: column;
            gap: 6px;
            justify-content: center;
            align-self: center;
            flex-shrink: 0;
            pointer-events: all;
        }
        #iosfreePanH {
            display: flex;
            flex-direction: row;
            gap: 6px;
            justify-content: center;
            pointer-events: all;
        }
        .iosfree-pan-btn {
            width: 36px;
            height: 36px;
            background: rgba(0,0,0,0.60);
            border: 1px solid rgba(255,255,255,0.25);
            border-radius: 50%;
            color: #fff;
            font-size: 1rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.15s, transform 0.1s;
            user-select: none;
            flex-shrink: 0;
            pointer-events: all;
        }
        .iosfree-pan-btn:hover {
            background: rgba(0,0,0,0.85);
            transform: scale(1.12);
        }
        .iosfree-pan-btn:active {
            transform: scale(0.95);
        }

        /* NAV */
        nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 18px 48px;
            padding-top: calc(18px + env(safe-area-inset-top, 0px));
            background: rgba(6,14,30,0.88);
            backdrop-filter: blur(20px);
            border-bottom: 1px solid rgba(184,216,240,0.1);
        }

        .nav-logo {
            font-family: 'Cinzel', serif;
            font-size: 1.5rem;
            font-weight: 900;
            letter-spacing: 0;
            color: var(--sky);
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 10px;
        }

            .nav-logo span {
                color: #E8772A !important; /* portocaliu direct, fără variabilă */
            }

        .nav-links {
            display: flex;
            align-items: center;
            gap: 36px;
            list-style: none;
        }

            .nav-links a {
                color: rgba(245,240,235,0.75);
                text-decoration: none;
                font-size: 0.9rem;
                font-weight: 500;
                letter-spacing: 0.04em;
                transition: color 0.2s;
            }

                .nav-links a:hover {
                    color: var(--sky);
                }

        .nav-right {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        /* ── CUSTOM LANGUAGE DROPDOWN ── */
        .lang-dropdown {
            position: relative;
            font-family: 'Outfit', sans-serif;
            font-size: 0.82rem;
            user-select: none;
        }

        .lang-trigger {
            display: flex;
            align-items: center;
            gap: 7px;
            background: rgba(184,216,240,0.1);
            border: 1px solid rgba(184,216,240,0.25);
            color: var(--white);
            padding: 6px 12px;
            border-radius: 4px;
            cursor: pointer;
            transition: background 0.2s, border-color 0.2s;
            white-space: nowrap;
        }

        .lang-trigger:hover {
            background: rgba(184,216,240,0.18);
            border-color: rgba(184,216,240,0.5);
        }

        .lang-trigger-arrow {
            font-size: 0.65rem;
            opacity: 0.6;
            transition: transform 0.2s;
        }

        .lang-dropdown.open .lang-trigger-arrow {
            transform: rotate(180deg);
        }

        .lang-menu {
            display: none;
            position: absolute;
            top: calc(100% + 6px);
            right: 0;
            min-width: 130px;
            max-height: 340px;
            overflow-y: auto;
            background: #0f1e3a;
            border: 1px solid rgba(184,216,240,0.18);
            border-radius: 8px;
            box-shadow: 0 8px 24px rgba(0,0,0,0.45);
            z-index: 9999;
        }

        .lang-dropdown.open .lang-menu {
            display: block;
        }

        .lang-option {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 16px;
            color: rgba(245,240,235,0.8);
            cursor: pointer;
            transition: background 0.15s, color 0.15s;
            font-size: 0.82rem;
        }

        .lang-option:hover {
            background: rgba(184,216,240,0.1);
            color: var(--white);
        }

        .lang-option.selected {
            background: var(--deep);
            color: var(--sky);
            font-weight: 600;
        }

        .lang-option.selected:hover {
            background: rgba(13,43,94,0.8);
        }

        .btn-nav {
            background: var(--orange);
            color: #fff;
            border: none;
            padding: 8px 22px;
            font-family: 'Outfit', sans-serif;
            font-size: 0.88rem;
            font-weight: 600;
            border-radius: 4px;
            cursor: pointer;
            letter-spacing: 0.04em;
            transition: background 0.2s;
        }

            .btn-nav:hover {
                background: #d4621a;
            }

        /* ── COMPACT MOBILE HEADER ──
           On narrow PWA screens the fixed header must stay on one row so the
           language switcher and the profile / account controls remain
           visible. Shrink the logo and tighten paddings and gaps. */
        @media (max-width: 600px) {
            nav {
                padding: 8px 12px;
                padding-top: calc(8px + env(safe-area-inset-top, 0px));
                gap: 8px;
            }

            .nav-logo {
                gap: 6px;
                flex-shrink: 1;
                min-width: 0;
            }

                .nav-logo svg {
                    width: 22px;
                    height: 22px;
                    flex-shrink: 0;
                }

                .nav-logo img {
                    height: 1.1rem !important;
                }

            .nav-right {
                gap: 8px;
                margin-left: auto;
                flex-shrink: 0;
            }

            .lang-dropdown {
                font-size: 0.75rem;
            }

            .lang-trigger {
                padding: 4px 8px;
                gap: 5px;
            }

            .nav-user {
                padding: 3px 10px 3px 5px;
                gap: 6px;
            }

            .nav-avatar {
                width: 22px;
                height: 22px;
                font-size: 0.62rem;
            }

            .user-trigger {
                gap: 6px;
            }

            .btn-nav {
                padding: 6px 12px;
                font-size: 0.78rem;
            }
        }

        /* HERO */
        #hero {
            position: relative;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 120px 24px 80px;
            padding-top: calc(120px + env(safe-area-inset-top, 0px));
            overflow: hidden;
        }

        .hero-bg {
            position: absolute;
            inset: 0;
            background: radial-gradient(ellipse 80% 60% at 50% 30%, rgba(107,63,160,0.22) 0%, transparent 60%), radial-gradient(ellipse 60% 40% at 20% 80%, rgba(13,43,94,0.5) 0%, transparent 50%), linear-gradient(180deg, #060E1E 0%, #0a1a38 50%, #060E1E 100%);
        }

        .topo-lines {
            position: absolute;
            inset: 0;
            overflow: hidden;
            opacity: 0.12;
        }

            .topo-lines svg {
                width: 100%;
                height: 100%;
            }

        .hero-badge {
            position: relative;
            display: inline-block;
            background: rgba(107,63,160,0.25);
            border: 1px solid rgba(107,63,160,0.5);
            border-radius: 100px;
            padding: 6px 20px;
            font-size: 0.78rem;
            font-weight: 600;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            color: #c4a0f0;
            margin-bottom: 28px;
            animation: fadeUp 0.8s ease both;
        }

        .hero-title {
            position: relative;
            font-family: 'Cinzel', serif;
            font-size: clamp(2.8rem, 7vw, 5.5rem);
            font-weight: 900;
            line-height: 1.05;
            letter-spacing: 0;
            color: var(--white);
            margin-bottom: 12px;
            animation: fadeUp 0.9s 0.1s ease both;
        }

            .hero-title .a1 {
                color: var(--sky);
            }

            .hero-title .a2 {
                color: var(--orange);
            }

        .hero-tagline {
            position: relative;
            font-family: 'Cinzel', serif;
            font-size: clamp(0.9rem, 2vw, 1.2rem);
            font-weight: 400;
            letter-spacing: 0.18em;
            color: rgba(184,216,240,0.65);
            text-transform: uppercase;
            margin-bottom: 32px;
            animation: fadeUp 1s 0.2s ease both;
        }

        .hero-tech {
            position: relative;
            display: flex;
            justify-content: center;
            margin-bottom: 32px;
            animation: fadeUp 1s 0.3s ease both;
        }

        .hero-ctas {
            position: relative;
            display: flex;
            gap: 16px;
            flex-wrap: wrap;
            justify-content: center;
            animation: fadeUp 1s 0.4s ease both;
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--violet), #4a2880);
            color: #fff;
            border: none;
            padding: 14px 36px;
            font-family: 'Outfit', sans-serif;
            font-size: 1rem;
            font-weight: 600;
            border-radius: 6px;
            cursor: pointer;
            letter-spacing: 0.05em;
            text-decoration: none;
            transition: transform 0.2s, box-shadow 0.2s;
            box-shadow: 0 4px 20px rgba(107,63,160,0.4);
        }

            .btn-primary:hover {
                transform: translateY(-2px);
                box-shadow: 0 8px 30px rgba(107,63,160,0.6);
            }

        .btn-secondary {
            background: transparent;
            color: var(--sky);
            border: 1px solid rgba(184,216,240,0.4);
            padding: 14px 36px;
            font-family: 'Outfit', sans-serif;
            font-size: 1rem;
            font-weight: 500;
            border-radius: 6px;
            cursor: pointer;
            letter-spacing: 0.05em;
            text-decoration: none;
            transition: border-color 0.2s, background 0.2s;
        }

            .btn-secondary:hover {
                border-color: var(--sky);
                background: rgba(184,216,240,0.08);
            }

        .hero-scroll {
            position: absolute;
            bottom: 36px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            color: rgba(184,216,240,0.4);
            font-size: 0.72rem;
            letter-spacing: 0.15em;
            text-transform: uppercase;
            animation: bounce 2s infinite;
        }

        /* SECTIONS */
        section {
            padding: 100px 24px;
        }

        .container {
            max-width: 1100px;
            margin: 0 auto;
        }

        .section-label {
            font-size: 0.75rem;
            font-weight: 600;
            letter-spacing: 0.18em;
            text-transform: uppercase;
            color: var(--orange);
            margin-bottom: 14px;
        }

        .section-title {
            font-family: 'Cinzel', serif;
            font-size: clamp(1.8rem, 4vw, 2.8rem);
            font-weight: 700;
            line-height: 1.2;
            color: var(--white);
            margin-bottom: 20px;
        }

            .section-title .hl {
                color: var(--sky);
            }

        .section-desc {
            font-size: 1rem;
            font-weight: 300;
            line-height: 1.8;
            color: rgba(245,240,235,0.68);
            max-width: 680px;
        }

        /* WHAT IS APM */
        #what {
            background: linear-gradient(180deg, #060E1E 0%, #0a1530 100%);
        }

        .what-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 64px;
            align-items: center;
            margin-top: 60px;
        }

        .what-cards {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .what-card {
            background: rgba(184,216,240,0.05);
            border: 1px solid rgba(184,216,240,0.1);
            border-left: 3px solid var(--violet);
            border-radius: 8px;
            padding: 24px 28px;
            transition: background 0.2s;
            opacity: 0;
            transform: translateY(30px);
        }

            .what-card:nth-child(2) {
                border-left-color: var(--sky);
            }

            .what-card:nth-child(3) {
                border-left-color: var(--orange);
            }

            .what-card.visible {
                opacity: 1;
                transform: translateY(0);
                transition: opacity 0.6s ease, transform 0.6s ease;
            }

            .what-card:hover {
                background: rgba(184,216,240,0.08);
            }

            .what-card h3 {
                font-family: 'Cinzel', serif;
                font-size: 1rem;
                font-weight: 600;
                color: var(--sky);
                margin-bottom: 8px;
            }

            .what-card p {
                font-size: 0.9rem;
                line-height: 1.7;
                color: rgba(245,240,235,0.65);
            }

        .what-visual-inner {
            background: linear-gradient(135deg, rgba(13,43,94,0.6), rgba(107,63,160,0.3));
            border: 1px solid rgba(184,216,240,0.15);
            border-radius: 12px;
            padding: 40px;
            text-align: center;
        }

        .score-ring {
            width: 180px;
            height: 180px;
            border-radius: 50%;
            background: conic-gradient(var(--violet) 0deg, var(--sky) 90deg, var(--orange) 180deg, var(--red) 270deg, rgba(184,216,240,0.1) 270deg);
            margin: 0 auto 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }

            .score-ring::after {
                content: '';
                width: 120px;
                height: 120px;
                background: #0a1530;
                border-radius: 50%;
                position: absolute;
            }

        .score-label {
            position: relative;
            z-index: 1;
            font-family: 'Cinzel', serif;
            font-size: 1rem;
            font-weight: 700;
            color: var(--white);
        }

        .legend-items {
            display: flex;
            flex-direction: column;
            gap: 10px;
            text-align: left;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 0.85rem;
            color: rgba(245,240,235,0.7);
        }

        .legend-dot {
            width: 14px;
            height: 14px;
            border-radius: 2px;
            flex-shrink: 0;
        }

        .user-dropdown {
            position: relative;
        }

        .user-trigger {
            display: flex;
            align-items: center;
            gap: 12px;
            background: none;
            border: none;
            color: white;
            cursor: pointer;
        }

        .user-arrow {
            opacity: .6;
            font-size: 12px;
        }

        .user-menu {
            position: absolute;
            top: 65px;
            right: 0;
            width: 220px;
            background: #0f172a;
            border: 1px solid rgba(255,255,255,.08);
            border-radius: 16px;
            padding: 10px;
            display: flex;
            flex-direction: column;
            gap: 6px;
            z-index: 99999;
        }

            .user-menu button {
                background: none;
                border: none;
                color: white;
                text-align: left;
                padding: 12px 14px;
                border-radius: 10px;
                cursor: pointer;
                transition: .2s;
            }

                .user-menu button:hover {
                    background: rgba(255,255,255,.06);
                }

        .user-premium-badge {
            float: right;
            font-size: 0.58rem;
            font-weight: 700;
            letter-spacing: 0.08em;
            background: rgba(255,200,50,0.15);
            color: #ffc832;
            border: 1px solid rgba(255,200,50,0.4);
            border-radius: 4px;
            padding: 2px 6px;
            margin-top: 1px;
        }

        .hidden {
            display: none;
        }









        /*USER DROPDOWN*/



        .user-dropdown {
            position: relative;
        }

        .user-trigger {
            display: flex;
            align-items: center;
            gap: 12px;
            background: none;
            border: none;
            color: white;
            cursor: pointer;
        }

        .user-arrow {
            opacity: .6;
            font-size: 12px;
        }

        .user-menu {
            position: absolute;
            top: 65px;
            right: 0;
            width: 220px;
            background: #0f172a;
            border: 1px solid rgba(255,255,255,.08);
            border-radius: 16px;
            padding: 10px;
            display: flex;
            flex-direction: column;
            gap: 6px;
            z-index: 99999;
        }

            .user-menu button {
                background: none;
                border: none;
                color: white;
                text-align: left;
                padding: 12px 14px;
                border-radius: 10px;
                cursor: pointer;
                transition: .2s;
            }

                .user-menu button:hover {
                    background: rgba(255,255,255,.06);
                }

        .hidden {
            display: none;
        }

        /* MAP */
        #map-section {
            background: #060E1E;
            padding: 100px 0;
        }

            #map-section .container {
                padding: 0 24px;
            }

        .map-header {
            display: flex;
            align-items: flex-end;
            justify-content: space-between;
            margin-bottom: 32px;
            flex-wrap: wrap;
            gap: 24px;
        }

        .map-tabs {
            display: flex;
            background: rgba(184,216,240,0.06);
            border: 1px solid rgba(184,216,240,0.15);
            border-radius: 8px;
            overflow: hidden;
        }

        .map-tab {
            padding: 10px 24px;
            font-size: 0.88rem;
            font-weight: 500;
            color: rgba(245,240,235,0.55);
            cursor: pointer;
            border: none;
            background: none;
            font-family: 'Outfit', sans-serif;
            transition: all 0.2s;
        }

            .map-tab.active {
                background: var(--violet);
                color: #fff;
            }

        .map-wrapper {
            position: relative;
            border-radius: 12px;
            overflow: visible;
            border: 1px solid rgba(184,216,240,0.15);
            height: 560px;
            box-shadow: 0 24px 80px rgba(0,0,0,0.5);
        }
        /* Clip the actual map tiles to rounded corners without clipping the search dropdown */
        #detectlab-map {
            border-radius: 12px;
            overflow: hidden;
            background: #060E1E;
        }

        /* ── JOSEPHINE MAP + SOURCE TRANSITION ────────────────────────────
           The visual premium layer can switch between the Cloudflare raster
           and the Supabase raster when the viewport reaches a source boundary.
           This sits above the map only during that switch, softly blurs the
           frozen map beneath it, and reuses the app's sonar loading animation.

           z-index MUST stay below the transparency side panel (.transp-panel,
           z-index 1001) and its arrow tab (.transp-arrow-tab, z-index 1002) in
           every stacking context, so the overlay blurs only the map canvas and
           never covers, blurs, hides, restacks or blocks the side panel, its
           tabs or its scrolling. 950 sits above the Leaflet tile/radius panes
           (≤900) and well below the panel/tab/search-bar (≥1000). In fullscreen
           the panel/tab jump to 10002/10003 and the search bar to 1000, so the
           overlay (950) stays below them there too. */
        .josephine-source-transition {
            position: absolute;
            inset: 0;
            z-index: 950;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            border-radius: inherit;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            background:
                radial-gradient(circle at 50% 50%, rgba(13, 43, 94, 0.34) 0%, rgba(6, 14, 30, 0.48) 52%, rgba(3, 8, 18, 0.66) 100%);
            -webkit-backdrop-filter: blur(10px) saturate(0.72);
            backdrop-filter: blur(10px) saturate(0.72);
            transition: opacity 0.2s ease, visibility 0s linear 0.2s;
        }

        .josephine-source-transition::before {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(125deg, rgba(184, 216, 240, 0.07), transparent 34%, rgba(107, 63, 160, 0.10) 70%, transparent);
            pointer-events: none;
        }

        .josephine-source-transition.is-visible {
            opacity: 1;
            visibility: visible;
            transition: opacity 0.16s ease;
        }

        /* Pure CSS/SVG sonar animation (no animated image = no glitches) —
           same motion as the PWA launch screen .launch-sonar (inline <style>
           in index.html), scoped here and sized down to fit the map-frame
           overlay (120–150px). */
        .josephine-source-transition .jst-sonar {
            position: relative;
            z-index: 1;
            width: clamp(120px, 24vw, 150px);
            height: clamp(120px, 24vw, 150px);
            aspect-ratio: 1 / 1;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        /* Expanding sonar ripples — GPU-composited transform/opacity only */
        .josephine-source-transition .ls-ring {
            position: absolute;
            inset: 0;
            border-radius: 50%;
            border: 2px solid rgba(184, 216, 240, 0.9);
            opacity: 0;
            transform: scale(0.34);
            animation: ls-ripple 2.6s cubic-bezier(0.2, 0.55, 0.4, 1) infinite;
            will-change: transform, opacity;
            pointer-events: none;
        }
        .josephine-source-transition .ls-ring:nth-child(2) {
            animation-delay: 0.866s;
            border-color: rgba(107, 63, 160, 0.85);
        }
        .josephine-source-transition .ls-ring:nth-child(3) {
            animation-delay: 1.733s;
            border-color: rgba(184, 216, 240, 0.55);
        }
        @keyframes ls-ripple {
            0%   { opacity: 0;    transform: scale(0.34); }
            12%  { opacity: 0.85; }
            100% { opacity: 0;    transform: scale(1); }
        }
        /* Rotating radar sweep behind the logo */
        .josephine-source-transition .ls-sweep {
            position: absolute;
            inset: 6%;
            border-radius: 50%;
            background: conic-gradient(
                from 0deg,
                rgba(184, 216, 240, 0) 0deg,
                rgba(184, 216, 240, 0) 285deg,
                rgba(184, 216, 240, 0.10) 330deg,
                rgba(184, 216, 240, 0.38) 359deg,
                rgba(184, 216, 240, 0) 360deg
            );
            -webkit-mask: radial-gradient(circle, transparent 30%, #000 31%);
            mask: radial-gradient(circle, transparent 30%, #000 31%);
            animation: ls-rotate 2.6s linear infinite;
            will-change: transform;
            pointer-events: none;
        }
        @keyframes ls-rotate {
            from { transform: rotate(0deg); }
            to   { transform: rotate(360deg); }
        }
        /* Vector logo — crisp at any size */
        .josephine-source-transition .ls-logo {
            position: relative;
            width: 46%;
            height: 46%;
            display: block;
            filter: drop-shadow(0 0 14px rgba(184, 216, 240, 0.28));
        }
        .josephine-source-transition .ls-logo .ls-dot {
            transform-box: fill-box;
            transform-origin: center;
            animation: ls-pulse 2.6s ease-in-out infinite;
        }
        @keyframes ls-pulse {
            0%, 100% { transform: scale(1);    opacity: 1; }
            50%      { transform: scale(1.22); opacity: 0.82; }
        }

        @media (prefers-reduced-motion: reduce) {
            .josephine-source-transition {
                transition: none;
            }
            /* Animations off, static rings — same treatment as the launch screen */
            .josephine-source-transition .ls-ring,
            .josephine-source-transition .ls-sweep,
            .josephine-source-transition .ls-logo .ls-dot {
                animation: none !important;
            }
            .josephine-source-transition .ls-ring {
                opacity: 0.35;
                transform: scale(0.75);
            }
            .josephine-source-transition .ls-sweep {
                display: none;
            }
        }

        .map-frame {
            position: relative;
            overflow: visible;
            isolation: isolate;
            /* Needed so transp-panel and transp-arrow-tab (position:absolute) anchor here */
            height: 560px;
        }

        .map-iframe {
            width: 100%;
            height: 100%;
            border: none;
        }

        .map-overlay-lock {
            position: absolute;
            inset: 0;
            background: rgba(6,14,30,0.8);
            backdrop-filter: blur(8px);
            display: none;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            gap: 20px;
            text-align: center;
        }

            .map-overlay-lock.show {
                display: flex;
            }

        .lock-icon {
            width: 64px;
            height: 64px;
            background: rgba(107,63,160,0.3);
            border: 1px solid var(--violet);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.8rem;
        }

        .map-legend-bar {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-top: 16px;
            flex-wrap: wrap;
        }

        #legendPills {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }

        .legend-pill {
            display: flex;
            align-items: center;
            gap: 6px;
            background: rgba(184,216,240,0.06);
            border: 1px solid rgba(184,216,240,0.12);
            border-radius: 100px;
            padding: 4px 12px;
            font-size: 0.78rem;
            color: rgba(245,240,235,0.6);
        }

        .legend-pill-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
        }

        /* HOW IT WORKS */
        #how {
            background: #060E1E;
        }

        .steps {
            display: grid;
            grid-template-columns: repeat(4,1fr);
            gap: 0;
            margin-top: 60px;
            position: relative;
        }

            .steps::before {
                content: '';
                position: absolute;
                top: 36px;
                left: 15%;
                right: 15%;
                height: 1px;
                background: linear-gradient(90deg, transparent, var(--violet), var(--sky), var(--orange), transparent);
            }

        .step {
            text-align: center;
            padding: 0 20px;
            position: relative;
            z-index: 1;
            opacity: 0;
            transform: translateY(30px);
        }

            .step.visible {
                opacity: 1;
                transform: translateY(0);
                transition: opacity 0.6s ease, transform 0.6s ease;
            }

        .step-num {
            width: 72px;
            height: 72px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'Cinzel', serif;
            font-size: 1.4rem;
            font-weight: 900;
            margin: 0 auto 24px;
        }

        .step:nth-child(1) .step-num {
            background: rgba(107,63,160,0.3);
            border: 2px solid var(--violet);
            color: var(--violet);
        }

        .step:nth-child(2) .step-num {
            background: rgba(184,216,240,0.15);
            border: 2px solid var(--sky);
            color: var(--sky);
        }

        .step:nth-child(3) .step-num {
            background: rgba(232,119,42,0.2);
            border: 2px solid var(--orange);
            color: var(--orange);
        }

        .step:nth-child(4) .step-num {
            background: rgba(196,43,43,0.2);
            border: 2px solid var(--red);
            color: var(--red);
        }

        .step h3 {
            font-family: 'Cinzel', serif;
            font-size: 1rem;
            font-weight: 600;
            color: var(--white);
            margin-bottom: 10px;
        }

        .step p {
            font-size: 0.85rem;
            line-height: 1.6;
            color: rgba(245,240,235,0.55);
        }

        /* PRICING */
        #pricing {
            background: linear-gradient(180deg, #060E1E 0%, #07142a 100%);
        }

        .pricing-toggle {
            display: flex;
            align-items: center;
            gap: 14px;
            margin: 36px 0 52px;
        }

        .toggle-label {
            font-size: 0.9rem;
            color: rgba(245,240,235,0.45);
        }

            .toggle-label.active {
                color: var(--sky);
                font-weight: 600;
            }

        .toggle-switch {
            width: 52px;
            height: 28px;
            background: var(--violet);
            border-radius: 100px;
            position: relative;
            cursor: pointer;
            transition: background 0.3s;
            border: none;
            outline: none;
        }

            .toggle-switch::after {
                content: '';
                position: absolute;
                top: 3px;
                left: 3px;
                width: 22px;
                height: 22px;
                background: white;
                border-radius: 50%;
                transition: left 0.3s;
            }

            .toggle-switch.monthly::after {
                left: 27px;
            }

        .toggle-save {
            background: rgba(232,119,42,0.2);
            border: 1px solid rgba(232,119,42,0.4);
            color: var(--orange);
            padding: 3px 10px;
            border-radius: 100px;
            font-size: 0.75rem;
            font-weight: 600;
        }

        .pricing-grid {
            display: grid;
            grid-template-columns: repeat(3,1fr);
            gap: 24px;
        }

        .plan-card {
            background: rgba(184,216,240,0.04);
            border: 1px solid rgba(184,216,240,0.12);
            border-radius: 12px;
            padding: 36px 32px;
            position: relative;
            transition: transform 0.2s;
            opacity: 0;
            transform: translateY(30px);
        }

            .plan-card.visible {
                opacity: 1;
                transform: translateY(0);
                transition: opacity 0.6s ease, transform 0.6s ease;
            }

            .plan-card:hover {
                transform: translateY(-4px) !important;
            }

            .plan-card.featured {
                background: linear-gradient(145deg, rgba(107,63,160,0.2), rgba(13,43,94,0.3));
                border-color: rgba(107,63,160,0.5);
            }

        .plan-badge {
            position: absolute;
            top: -13px;
            left: 50%;
            transform: translateX(-50%);
            background: var(--violet);
            color: #fff;
            font-size: 0.72rem;
            font-weight: 700;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            padding: 4px 16px;
            border-radius: 100px;
            white-space: nowrap;
        }

        /* Plans that are not sold (weekly / yearly) — semi-transparent
           "Not available" tag + dimmed card */
        .plan-card.plan-disabled {
            opacity: 0.68;
            filter: saturate(0.55);
            pointer-events: none;
            user-select: none;
        }

        .plan-card.plan-disabled:hover {
            transform: none !important;
        }

        .plan-unavailable {
            position: absolute;
            top: 14px;
            right: 14px;
            background: rgba(255, 255, 255, 0.10);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            color: rgba(245, 240, 235, 0.75);
            font-size: 0.62rem;
            font-weight: 700;
            letter-spacing: 0.16em;
            text-transform: uppercase;
            padding: 5px 10px;
            border: 1px solid rgba(245, 240, 235, 0.28);
            border-radius: 100px;
            white-space: nowrap;
            pointer-events: none;
        }

        .plan-card .btn-plan:disabled {
            opacity: 0.45;
            cursor: not-allowed;
        }

        .plan-tier {
            font-size: 0.78rem;
            font-weight: 600;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            margin-bottom: 8px;
        }

            .plan-tier.bronze {
                color: #CD7F32;
            }

            .plan-tier.silver {
                color: #C0C0C0;
            }

            .plan-tier.gold {
                color: #FFD700;
            }

        .plan-name {
            font-family: 'Cinzel', serif;
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--white);
            margin-bottom: 24px;
        }

        .plan-price {
            margin-bottom: 8px;
        }

            .plan-price .amount {
                font-family: 'Cinzel', serif;
                font-size: 2.6rem;
                font-weight: 900;
                color: var(--white);
            }

            .plan-price .currency {
                font-size: 1.2rem;
                color: rgba(245,240,235,0.6);
                vertical-align: super;
            }

            .plan-price .period {
                font-size: 0.88rem;
                color: rgba(245,240,235,0.5);
            }

        .plan-billing-note {
            font-size: 0.8rem;
            color: rgba(245,240,235,0.45);
            margin-bottom: 28px;
            min-height: 20px;
        }

        .plan-divider {
            height: 1px;
            background: rgba(184,216,240,0.12);
            margin-bottom: 28px;
        }

        .plan-features {
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-bottom: 36px;
        }

            .plan-features li {
                display: flex;
                align-items: flex-start;
                gap: 10px;
                font-size: 0.88rem;
                color: rgba(245,240,235,0.75);
                line-height: 1.5;
            }

                .plan-features li .check {
                    color: var(--sky);
                    font-size: 0.75rem;
                    margin-top: 3px;
                    flex-shrink: 0;
                }

                .plan-features li.off .check {
                    color: rgba(245,240,235,0.2);
                }

                .plan-features li.off {
                    color: rgba(245,240,235,0.3);
                    text-decoration: line-through;
                }

        .btn-plan {
            width: 100%;
            padding: 13px;
            border-radius: 6px;
            font-family: 'Outfit', sans-serif;
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            letter-spacing: 0.05em;
            transition: all 0.2s;
            border: 1px solid rgba(184,216,240,0.25);
            background: transparent;
            color: var(--sky);
        }

            .btn-plan:hover {
                background: rgba(184,216,240,0.08);
            }

            .btn-plan.fp {
                background: linear-gradient(135deg, var(--violet), #4a2880);
                border-color: transparent;
                color: #fff;
                box-shadow: 0 4px 20px rgba(107,63,160,0.4);
            }

                .btn-plan.fp:hover {
                    box-shadow: 0 6px 30px rgba(107,63,160,0.6);
                }

        .free-plan {
            margin-top: 32px;
            background: rgba(184,216,240,0.03);
            border: 1px solid rgba(184,216,240,0.1);
            border-radius: 10px;
            padding: 28px 32px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 24px;
            flex-wrap: wrap;
        }

            .free-plan h3 {
                font-family: 'Cinzel', serif;
                font-size: 1.1rem;
                color: var(--white);
                margin-bottom: 6px;
            }

            .free-plan p {
                font-size: 0.88rem;
                color: rgba(245,240,235,0.55);
            }

        /* FOOTER */
        footer {
            background: #030811;
            border-top: 1px solid rgba(184,216,240,0.08);
            padding: 60px 24px 36px;
        }

        .footer-inner {
            max-width: 1100px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: 2fr 1fr 1fr 1fr;
            gap: 48px;
            margin-bottom: 48px;
        }

        .footer-brand p {
            font-size: 0.88rem;
            line-height: 1.7;
            color: rgba(245,240,235,0.45);
            margin-top: 14px;
            max-width: 260px;
        }

        .footer-col h4 {
            font-family: 'Cinzel', serif;
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--sky);
            margin-bottom: 16px;
            letter-spacing: 0.06em;
        }

        .footer-col ul {
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

            .footer-col ul li a {
                color: rgba(245,240,235,0.45);
                text-decoration: none;
                font-size: 0.85rem;
                transition: color 0.2s;
            }

                .footer-col ul li a:hover {
                    color: var(--sky);
                }

        .footer-bottom {
            max-width: 1100px;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding-top: 24px;
            border-top: 1px solid rgba(184,216,240,0.07);
            font-size: 0.8rem;
            color: rgba(245,240,235,0.3);
            flex-wrap: wrap;
            gap: 12px;
        }

        /* ANIMATIONS */
        @keyframes fadeUp {
            from {
                opacity: 0;
                transform: translateY(24px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes bounce {
            0%,100% {
                transform: translateX(-50%) translateY(0);
            }

            50% {
                transform: translateX(-50%) translateY(8px);
            }
        }

        /* RESPONSIVE */
        @media (max-width: 900px) {
            nav {
                padding: 14px 20px;
            }

            .nav-links {
                display: none;
            }

            .what-grid {
                grid-template-columns: 1fr;
            }

            .pricing-grid {
                grid-template-columns: 1fr;
            }

            .steps {
                grid-template-columns: 1fr 1fr;
                gap: 40px;
            }

                .steps::before {
                    display: none;
                }

            .footer-inner {
                grid-template-columns: 1fr 1fr;
            }
        }

        @media (max-width: 600px) {
            .steps {
                grid-template-columns: 1fr;
            }

            .footer-inner {
                grid-template-columns: 1fr;
            }

            .hero-ctas {
                flex-direction: column;
                align-items: center;
            }
        }

        /* MAP SEARCH */
        .map-search-wrap {
            position: absolute;
            top: 14px;
            top: calc(14px + env(safe-area-inset-top, 0px));
            left: 50%;
            transform: translateX(-50%);
            z-index: 1000;
            width: min(380px, calc(100% - 100px));
            pointer-events: all;
        }

        .map-search-inner {
            display: flex;
            align-items: center;
            gap: 8px;
            background: rgba(6,14,30,0.88);
            backdrop-filter: blur(16px);
            border: 1px solid rgba(184,216,240,0.22);
            border-radius: 8px;
            padding: 9px 14px;
            box-shadow: 0 4px 24px rgba(0,0,0,0.45);
            transition: border-color 0.2s;
        }

        .map-search-wrap:focus-within .map-search-inner {
            border-color: rgba(128,211,248,0.5);
        }

        .map-search-input {
            flex: 1;
            background: none;
            border: none;
            outline: none;
            font-family: 'Outfit', sans-serif;
            font-size: 0.88rem;
            color: var(--white);
            min-width: 0;
        }

            .map-search-input::placeholder {
                color: rgba(184,216,240,0.38);
            }

        .map-search-clear {
            background: none;
            border: none;
            color: rgba(184,216,240,0.4);
            font-size: 0.78rem;
            cursor: pointer;
            padding: 0 2px;
            display: none;
            transition: color 0.15s;
            line-height: 1;
        }

            .map-search-clear:hover {
                color: var(--white);
            }

            .map-search-clear.visible {
                display: block;
            }

        .map-search-results {
            list-style: none;
            margin-top: 6px;
            background: rgba(6,14,30,0.95);
            backdrop-filter: blur(16px);
            border: 1px solid rgba(184,216,240,0.18);
            border-radius: 8px;
            overflow: hidden;
            display: none;
            box-shadow: 0 8px 32px rgba(0,0,0,0.5);
            max-height: 240px;
            overflow-y: auto;
        }

            .map-search-results.open {
                display: block;
            }

            .map-search-results li {
                padding: 10px 16px;
                font-size: 0.85rem;
                color: rgba(245,240,235,0.8);
                cursor: pointer;
                transition: background 0.15s;
                border-bottom: 1px solid rgba(184,216,240,0.07);
                display: flex;
                align-items: center;
                gap: 10px;
            }

                .map-search-results li:last-child {
                    border-bottom: none;
                }

                .map-search-results li:hover, .map-search-results li.active {
                    background: rgba(107,63,160,0.3);
                    color: #fff;
                }

                .map-search-results li .sr-icon {
                    opacity: 0.45;
                    flex-shrink: 0;
                }

                .map-search-results li .sr-name {
                    flex: 1;
                }

                .map-search-results li .sr-country {
                    font-size: 0.75rem;
                    opacity: 0.45;
                }

        .map-search-msg {
            padding: 12px 16px;
            font-size: 0.82rem;
            color: rgba(184,216,240,0.45);
            text-align: center;
            font-style: italic;
        }

        /* PLACE CARD — standalone variant (not used inside a Leaflet popup).
           Every current caller passes this card as the CONTENT of a real Leaflet
           popup (marker.bindPopup('<div class="map-place-popup">…')), which is
           handled by the .leaflet-popup override below. */
        .map-place-popup {
            position: absolute;
            z-index: 15;
            pointer-events: none;
            transform: translate(-50%, calc(-100% - 14px));
            background: rgba(6,14,30,0.92);
            backdrop-filter: blur(12px);
            border: 1px solid rgba(128,211,248,0.35);
            border-radius: 8px;
            padding: 8px 14px;
            white-space: nowrap;
            font-size: 0.82rem;
            color: #fff;
            box-shadow: 0 4px 20px rgba(0,0,0,0.5);
        }

            .map-place-popup::after {
                content: '';
                position: absolute;
                bottom: -7px;
                left: 50%;
                transform: translateX(-50%);
                border-left: 6px solid transparent;
                border-right: 6px solid transparent;
                border-top: 7px solid rgba(128,211,248,0.35);
            }

        /* ── .map-place-popup INSIDE A LEAFLET POPUP ───────────────────────────
           The nearby-detectorist pins (orange live + black/white offline), the
           "You are here" marker and the saved-trail polylines all pass this card
           as the content of a REAL Leaflet popup. The standalone rule above then
           pulled the card out of the flow (position:absolute +
           translate(-50%, calc(-100% - 14px))), so .leaflet-popup-content had
           nothing left to size around: Leaflet clamped it to minWidth (50px) and
           the map showed TWO windows — an empty little Leaflet popup box (dark,
           blank, only the × button) plus the info card floating above it. That is
           the "two windows" bug reported for the offline detectorist bubbles.
           Inside a popup the card must stay in normal flow and drop its own
           duplicate frame: #detectlab-map .leaflet-popup-content-wrapper already
           paints the very same dark background / border / radius, and Leaflet
           draws the arrow with .leaflet-popup-tip — so exactly ONE window, the
           one carrying the information, remains. */
        .leaflet-popup .map-place-popup {
            position: static;
            transform: none;
            pointer-events: auto;   /* tapping the popup must not close it */
            background: transparent;
            backdrop-filter: none;
            border: none;
            border-radius: 0;
            padding: 0;
            box-shadow: none;
            white-space: normal;    /* Leaflet sets an explicit content width */
        }

            .leaflet-popup .map-place-popup::after {
                content: none;      /* Leaflet's .leaflet-popup-tip is the arrow */
            }

        /* Search result tooltip */
        .leaflet-tooltip.map-search-tooltip {
            background: rgba(6,14,30,0.92);
            border: 1px solid rgba(128,211,248,0.35);
            border-radius: 8px;
            color: #fff;
            font-family: 'Outfit', sans-serif;
            font-size: 0.88rem;
            font-weight: 500;
            padding: 6px 14px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.5);
            white-space: nowrap;
            pointer-events: none;
        }

            .leaflet-tooltip.map-search-tooltip::before {
                border-top-color: rgba(128,211,248,0.35);
            }

        /* APM CONTROLS */
        .map-controls {
            display: flex;
            align-items: center;
            gap: 16px;
            margin-top: 14px;
            flex-wrap: wrap;
        }
        /* APM layer toggle switch */
        .apm-toggle-wrap {
            display: flex;
            align-items: center;
            gap: 10px;
            background: rgba(184,216,240,0.06);
            border: 1px solid rgba(184,216,240,0.14);
            border-radius: 8px;
            padding: 8px 16px;
        }

        .apm-toggle-label {
            font-size: 0.78rem;
            color: rgba(184,216,240,0.7);
            white-space: nowrap;
            letter-spacing: 0.05em;
        }

        .apm-toggle-switch {
            position: relative;
            display: inline-block;
            width: 44px;
            height: 24px;
            flex-shrink: 0;
        }

            .apm-toggle-switch input {
                opacity: 0;
                width: 0;
                height: 0;
                position: absolute;
            }

        .apm-toggle-track {
            position: absolute;
            inset: 0;
            border-radius: 12px;
            cursor: pointer;
            /* The idle switch speaks the control material too: it sits inside
               the glass rows now, where the old sky-blue track read as a
               different component. */
            background: rgba(198,180,255,0.13);
            border: 1px solid var(--ctl-border);
            transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
        }

            .apm-toggle-track::after {
                content: '';
                position: absolute;
                top: 2.5px;
                left: 3px;
                width: 17px;
                height: 17px;
                border-radius: 50%;
                background: rgba(198,180,255,0.58);
                box-shadow: 0 1px 3px rgba(0,0,0,0.4);
                transition: transform 0.25s, background 0.25s;
            }

        .apm-toggle-switch input:checked + .apm-toggle-track {
            background: linear-gradient(135deg, #7a4bc0, var(--violet));
            border-color: rgba(160,112,232,0.8);
            box-shadow: 0 0 10px rgba(107,63,160,0.45);
        }

            .apm-toggle-switch input:checked + .apm-toggle-track::after {
                transform: translateX(20px);
                background: #fff;
            }

        /* ── Detection switch ── */
        .detect-toggle-wrap {
            display: flex;
            align-items: center;
            gap: 10px;
            background: rgba(184,216,240,0.06);
            border: 1px solid rgba(184,216,240,0.14);
            border-radius: 8px;
            padding: 8px 16px;
            transition: border-color 0.3s, background 0.3s;
        }

            .detect-toggle-wrap.active {
                background: rgba(196,43,43,0.12);
                border-color: rgba(196,43,43,0.45);
            }

        .detect-toggle-label {
            display: flex;
            align-items: center;
            gap: 7px;
            font-size: 0.78rem;
            color: rgba(184,216,240,0.7);
            white-space: nowrap;
            letter-spacing: 0.05em;
            cursor: pointer;
            user-select: none;
        }

            .detect-toggle-label svg {
                flex-shrink: 0;
                transition: color 0.3s;
            }

        .detect-toggle-wrap.active .detect-toggle-label {
            color: #ff6b6b;
        }

            .detect-toggle-wrap.active .detect-toggle-label svg {
                color: #ff6b6b;
            }

        .detect-switch {
            position: relative;
            display: inline-block;
            width: 44px;
            height: 24px;
            flex-shrink: 0;
        }

            .detect-switch input {
                opacity: 0;
                width: 0;
                height: 0;
                position: absolute;
            }

        .detect-track {
            position: absolute;
            inset: 0;
            border-radius: 12px;
            cursor: pointer;
            background: rgba(184,216,240,0.15);
            border: 1px solid rgba(184,216,240,0.2);
            transition: background 0.25s, border-color 0.25s;
        }

            .detect-track::after {
                content: '';
                position: absolute;
                top: 3px;
                left: 3px;
                width: 16px;
                height: 16px;
                border-radius: 50%;
                background: rgba(184,216,240,0.5);
                transition: transform 0.25s, background 0.25s;
            }

        .detect-switch input:checked + .detect-track {
            background: #c42b2b;
            border-color: rgba(196,43,43,0.7);
        }

            .detect-switch input:checked + .detect-track::after {
                transform: translateX(20px);
                background: #fff;
            }

        /* ── Site Alert overlay ── */
        #siteAlert {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 99999;
            background: rgba(0,0,0,0.82);
            align-items: center;
            justify-content: center;
        }

            #siteAlert.visible {
                display: flex;
            }

        .site-alert-box {
            background: #1a0505;
            border: 2px solid #c42b2b;
            border-radius: 16px;
            padding: 36px 40px;
            max-width: 460px;
            width: 90%;
            text-align: center;
            box-shadow: 0 0 60px rgba(196,43,43,0.6);
            animation: alertPulse 1.2s ease-in-out infinite alternate;
        }

        @keyframes alertPulse {
            from {
                box-shadow: 0 0 40px rgba(196,43,43,0.5);
                border-color: #c42b2b;
            }

            to {
                box-shadow: 0 0 80px rgba(196,43,43,0.9);
                border-color: #ff4444;
            }
        }

        .site-alert-icon {
            font-size: 3rem;
            margin-bottom: 12px;
        }

        .site-alert-title {
            font-family: 'Cinzel', serif;
            font-size: 1.5rem;
            font-weight: 700;
            color: #ff4444;
            letter-spacing: 0.08em;
            margin-bottom: 6px;
        }

        .site-alert-sub {
            font-size: 0.8rem;
            color: rgba(255,100,100,0.7);
            letter-spacing: 0.12em;
            text-transform: uppercase;
            margin-bottom: 20px;
        }

        .site-alert-divider {
            border: none;
            border-top: 1px solid rgba(196,43,43,0.4);
            margin: 18px 0;
        }

        .site-alert-ro {
            font-size: 1rem;
            color: #ffb3b3;
            line-height: 1.55;
            margin-bottom: 4px;
        }

        .site-alert-en {
            font-size: 0.92rem;
            color: rgba(255,179,179,0.7);
            line-height: 1.55;
        }

        .site-alert-dismiss {
            margin-top: 24px;
            padding: 10px 28px;
            border-radius: 8px;
            background: #c42b2b;
            border: none;
            color: #fff;
            font-family: 'Outfit', sans-serif;
            font-size: 0.88rem;
            font-weight: 600;
            cursor: pointer;
            letter-spacing: 0.05em;
            transition: background 0.2s;
        }

            .site-alert-dismiss:hover {
                background: #a02020;
            }

        .btn-fullscreen,
        .btn-saved-locations {
            display: flex;
            align-items: center;
            gap: 7px;
            background: rgba(184,216,240,0.06);
            border: 1px solid rgba(184,216,240,0.14);
            color: rgba(184,216,240,0.75);
            padding: 8px 16px;
            border-radius: 8px;
            font-family: 'Outfit', sans-serif;
            font-size: 0.78rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            letter-spacing: 0.05em;
            white-space: nowrap;
        }

            .btn-fullscreen:hover {
                background: rgba(107,63,160,0.3);
                border-color: rgba(107,63,160,0.5);
                color: #fff;
            }

            .btn-saved-locations:hover {
                background: rgba(196,43,43,0.18);
                border-color: rgba(196,43,43,0.55);
                color: #ff8a8a;
            }

            .btn-saved-locations.is-active {
                background: #c42b2b;
                border-color: #e25353;
                color: #fff;
            }

            .btn-fullscreen svg,
            .btn-saved-locations svg {
                flex-shrink: 0;
            }

        .btn-fullscreen:disabled,
        .btn-fullscreen[disabled] {
            opacity: 0.6;
            cursor: wait;
            pointer-events: none;
        }
        .saved-location-marker-wrap {
            background: transparent;
            border: 0;
        }

        /* Personal, search and draft pins share a centred ring-and-dot silhouette. */
        .saved-location-marker {
            box-sizing: border-box;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 24px;
            height: 24px;
            color: #e2d5fa;
            background: rgba(24,17,39,.88);
            border: 1.5px solid currentColor;
            border-radius: 50%;
            box-shadow: 0 3px 10px rgba(4,6,18,.4);
        }
        .saved-location-marker::after {
            content: '';
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: currentColor;
        }
        .has-event .saved-location-marker { color: #e8c979; }

        /* Fullscreen map state */
        .map-frame.is-fullscreen {
            position: fixed !important;
            inset: 0 !important;
            z-index: 9999 !important;
            border-radius: 0 !important;
            height: 100vh !important;
            width: 100vw !important;
        }

        .map-frame.is-fullscreen .map-controls {
            padding-top: calc(14px + env(safe-area-inset-top));
        }

        .map-wrapper.is-fullscreen {
            border-radius: 0 !important;
            height: 100% !important;
            width: 100% !important;
            border: none !important;
        }

            .map-wrapper.is-fullscreen #detectlab-map {
                height: 100% !important;
            }

        /* ── WEATHER PANEL ── */
        #weatherPanel {
            display: none;
            padding: 14px 24px 20px;
            max-width: 860px;
            margin: 0 auto;
        }

            #weatherPanel.active {
                display: block;
            }

        .weather-search-row {
            display: flex;
            gap: 8px;
            margin-bottom: 16px;
            flex-wrap: wrap;
        }

        .weather-search-input {
            flex: 1;
            min-width: 200px;
            background: rgba(184,216,240,0.06);
            border: 1px solid rgba(184,216,240,0.18);
            color: var(--white);
            padding: 8px 12px;
            border-radius: 7px;
            font-family: 'Outfit', sans-serif;
            font-size: 0.82rem;
            outline: none;
            transition: border-color 0.2s, background 0.2s;
        }

            .weather-search-input:focus {
                border-color: rgba(107,63,160,0.7);
                background: rgba(107,63,160,0.08);
            }

            .weather-search-input::placeholder {
                color: rgba(184,216,240,0.3);
            }

        .weather-search-btn {
            background: linear-gradient(135deg, var(--violet), #4a2880);
            border: none;
            color: #fff;
            padding: 8px 18px;
            border-radius: 7px;
            font-family: 'Outfit', sans-serif;
            font-size: 0.82rem;
            font-weight: 600;
            cursor: pointer;
            letter-spacing: 0.04em;
            transition: box-shadow 0.2s, transform 0.2s;
            box-shadow: 0 3px 12px rgba(107,63,160,0.35);
        }

            .weather-search-btn:hover {
                box-shadow: 0 5px 18px rgba(107,63,160,0.55);
                transform: translateY(-1px);
            }

        .weather-suggestions {
            position: relative;
        }

        .weather-suggest-list {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            z-index: 200;
            background: rgba(10,20,45,0.97);
            border: 1px solid rgba(184,216,240,0.18);
            border-radius: 7px;
            margin-top: 4px;
            list-style: none;
            overflow: hidden;
            box-shadow: 0 12px 40px rgba(0,0,0,0.6);
        }

            .weather-suggest-list li {
                padding: 7px 12px;
                font-size: 0.8rem;
                color: rgba(245,240,235,0.8);
                cursor: pointer;
                transition: background 0.15s;
                border-bottom: 1px solid rgba(184,216,240,0.07);
            }

                .weather-suggest-list li:last-child {
                    border-bottom: none;
                }

                .weather-suggest-list li:hover {
                    background: rgba(107,63,160,0.3);
                    color: #fff;
                }

            .weather-suggest-list.hidden {
                display: none;
            }

        .weather-loading {
            display: none;
            text-align: center;
            padding: 28px 0;
            color: rgba(184,216,240,0.5);
            font-size: 0.82rem;
            letter-spacing: 0.1em;
        }

            .weather-loading.show {
                display: block;
            }

        .weather-spinner {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            border: 2px solid rgba(184,216,240,0.15);
            border-top-color: var(--violet);
            animation: wspin 0.8s linear infinite;
            margin: 0 auto 10px;
        }

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

        .weather-error {
            display: none;
            text-align: center;
            padding: 20px 0;
            color: #ff8a8a;
            font-size: 0.84rem;
        }

            .weather-error.show {
                display: block;
            }

        .weather-result {
            display: none;
        }

            .weather-result.show {
                display: block;
            }

        .weather-city-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px;
            flex-wrap: wrap;
        }

        .weather-city-name {
            font-family: 'Cinzel', serif;
            font-size: 0.95rem;
            font-weight: 700;
            color: var(--white);
        }

        .weather-city-meta {
            font-size: 0.68rem;
            color: rgba(184,216,240,0.5);
            letter-spacing: 0.06em;
            text-transform: uppercase;
        }

        .weather-today {
            background: linear-gradient(135deg, rgba(107,63,160,0.2), rgba(13,43,94,0.4));
            border: 1px solid rgba(107,63,160,0.35);
            border-radius: 10px;
            padding: 12px 16px;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 16px;
            flex-wrap: wrap;
        }

        .weather-today-icon {
            font-size: 2.2rem;
            line-height: 1;
        }

        .weather-today-temp {
            font-family: 'Cinzel', serif;
            font-size: 1.8rem;
            font-weight: 900;
            color: var(--white);
        }

        .weather-today-feels {
            font-size: 0.76rem;
            color: rgba(184,216,240,0.55);
            margin-top: 3px;
        }

        .weather-today-desc {
            font-size: 0.88rem;
            color: rgba(245,240,235,0.75);
            margin-bottom: 4px;
            font-weight: 500;
        }

        .weather-today-details {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 6px;
        }

        .weather-detail-chip {
            display: flex;
            align-items: center;
            gap: 5px;
            background: rgba(184,216,240,0.07);
            border: 1px solid rgba(184,216,240,0.12);
            border-radius: 100px;
            padding: 3px 10px;
            font-size: 0.72rem;
            color: rgba(245,240,235,0.7);
        }

            .weather-detail-chip span:first-child {
                opacity: 0.65;
            }

        .weather-5day {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 8px;
        }

        .weather-day-card {
            background: rgba(184,216,240,0.04);
            border: 1px solid rgba(184,216,240,0.1);
            border-radius: 8px;
            padding: 12px 8px;
            text-align: center;
            transition: background 0.2s, border-color 0.2s;
        }

            .weather-day-card:hover {
                background: rgba(184,216,240,0.08);
                border-color: rgba(107,63,160,0.35);
            }

        .weather-day-name {
            font-family: 'Cinzel', serif;
            font-size: 0.68rem;
            font-weight: 600;
            color: var(--sky);
            letter-spacing: 0.08em;
            text-transform: uppercase;
            margin-bottom: 6px;
        }

        .weather-day-icon {
            font-size: 1.5rem;
            margin-bottom: 6px;
        }

        .weather-day-max {
            font-family: 'Cinzel', serif;
            font-size: 1rem;
            font-weight: 700;
            color: var(--white);
        }

        .weather-day-min {
            font-size: 0.74rem;
            color: rgba(184,216,240,0.45);
            margin-top: 2px;
        }

        .weather-day-rain {
            font-size: 0.68rem;
            color: rgba(184,216,240,0.5);
            margin-top: 5px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 3px;
        }

        @media (max-width: 700px) {
            .weather-5day {
                grid-template-columns: repeat(3, 1fr);
            }

            .weather-today {
                padding: 14px;
            }

            .weather-today-temp {
                font-size: 1.8rem;
            }
        }

        @media (max-width: 420px) {
            .weather-5day {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        /* ── MY ACCOUNT PANEL ── */
        #accountPanel {
            display: none;
            padding: 14px 24px 40px;
            max-width: 560px;
            margin: 0 auto;
        }

            #accountPanel.active {
                display: block;
            }

        .account-back {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: none;
            border: none;
            color: rgba(184,216,240,0.6);
            font-family: 'Outfit', sans-serif;
            font-size: 0.8rem;
            font-weight: 600;
            cursor: pointer;
            padding: 6px 2px;
            margin-bottom: 14px;
            transition: color 0.2s;
        }

            .account-back:hover {
                color: var(--sky);
            }

        .account-card {
            position: relative;
            background: linear-gradient(160deg, #0d1f42 0%, #0a1530 60%, #10083a 100%);
            border: 1px solid rgba(184,216,240,0.18);
            border-radius: 16px;
            padding: 40px 32px 32px;
            box-shadow: 0 32px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(107,63,160,0.15);
        }

        .account-terms-btn {
            position: absolute;
            top: 18px;
            right: 18px;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(184,216,240,0.08);
            border: 1px solid rgba(184,216,240,0.2);
            border-radius: 8px;
            color: rgba(184,216,240,0.7);
            cursor: pointer;
            transition: background 0.2s, color 0.2s, border-color 0.2s;
        }

            .account-terms-btn:hover {
                background: rgba(107,63,160,0.35);
                border-color: rgba(184,216,240,0.4);
                color: var(--sky);
            }

        .account-header {
            display: flex;
            align-items: center;
            gap: 16px;
            margin-bottom: 26px;
        }

        .account-avatar {
            width: 64px;
            height: 64px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--violet), var(--sky));
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.6rem;
            font-weight: 700;
            color: #fff;
            flex-shrink: 0;
        }

        .account-name {
            font-family: 'Cinzel', serif;
            font-size: 1.05rem;
            font-weight: 600;
            color: var(--white);
            margin-bottom: 6px;
        }

        .account-plan-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 0.68rem;
            font-weight: 700;
            letter-spacing: 0.04em;
            border-radius: 4px;
            padding: 3px 9px;
        }

            .account-plan-badge.free {
                background: rgba(184,216,240,0.1);
                color: rgba(184,216,240,0.75);
                border: 1px solid rgba(184,216,240,0.25);
            }

            .account-plan-badge.premium {
                background: rgba(255,200,50,0.15);
                color: #ffc832;
                border: 1px solid rgba(255,200,50,0.4);
            }

        .account-plan-days {
            font-size: 0.72rem;
            color: rgba(184,216,240,0.55);
            margin-left: 8px;
        }

        .account-sub-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            background: rgba(184,216,240,0.05);
            border: 1px solid rgba(184,216,240,0.12);
            border-radius: 10px;
            padding: 12px 14px;
            flex-wrap: wrap;
        }

        .account-sub-info {
            display: flex;
            flex-direction: column;
            gap: 4px;
            min-width: 0;
        }

        .account-sub-status {
            font-size: 0.78rem;
            font-weight: 700;
            letter-spacing: 0.08em;
        }

            .account-sub-status.free {
                color: rgba(184,216,240,0.6);
            }

            .account-sub-status.premium {
                color: #ffc832;
            }

        .account-sub-expiry {
            font-size: 0.72rem;
            color: rgba(245,240,235,0.55);
            line-height: 1.45;
        }

        /* "€5 for one month — no automatic renewal" (hidden for legacy
           recurring subscribers, whose text is emptied by JS). */
        .account-sub-note {
            font-size: 0.7rem;
            color: rgba(245,240,235,0.45);
            line-height: 1.45;
        }

        .account-sub-note:empty {
            display: none;
        }

        .account-sub-row .account-btn {
            padding: 9px 14px;
            font-size: 0.78rem;
            flex-shrink: 0;
        }

        .account-section-label {
            font-family: 'Cinzel', serif;
            font-size: 0.66rem;
            font-weight: 600;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            color: rgba(184,216,240,0.45);
            margin: 22px 0 10px;
        }

        .account-field-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            background: rgba(184,216,240,0.05);
            border: 1px solid rgba(184,216,240,0.12);
            border-radius: 10px;
            padding: 11px 14px;
            font-size: 0.82rem;
            color: rgba(245,240,235,0.85);
        }

        .account-field-label {
            font-size: 0.68rem;
            color: rgba(184,216,240,0.5);
            text-transform: uppercase;
            letter-spacing: 0.06em;
            margin-bottom: 3px;
        }

        .account-pw-form {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .account-pw-form input {
            width: 100%;
            background: rgba(184,216,240,0.06);
            border: 1px solid rgba(184,216,240,0.18);
            border-radius: 10px;
            padding: 11px 14px;
            font-family: 'Outfit', sans-serif;
            font-size: 0.85rem;
            color: var(--white);
            outline: none;
            transition: border-color 0.2s, background 0.2s;
        }

            .account-pw-form input:focus {
                border-color: var(--violet);
                background: rgba(184,216,240,0.1);
            }

        .account-btn {
            width: 100%;
            padding: 12px;
            border-radius: 10px;
            border: none;
            font-family: 'Outfit', sans-serif;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: filter 0.2s, background 0.2s;
        }

            .account-btn.primary {
                background: linear-gradient(135deg, var(--violet), #8a5fd0);
                color: #fff;
            }

                .account-btn.primary:hover {
                    filter: brightness(1.1);
                }

            .account-btn.primary:disabled {
                opacity: 0.6;
                cursor: not-allowed;
            }

        .account-msg {
            font-size: 0.76rem;
            min-height: 1em;
            margin-top: -2px;
        }

            .account-msg.error { color: #ff8a8a; }
            .account-msg.success { color: #7fe0a0; }

        .account-footer-actions {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-top: 26px;
            padding-top: 22px;
            border-top: 1px solid rgba(184,216,240,0.12);
        }

        .account-btn.logout {
            background: rgba(184,216,240,0.08);
            border: 1px solid rgba(184,216,240,0.2);
            color: rgba(184,216,240,0.85);
        }

            .account-btn.logout:hover {
                background: rgba(184,216,240,0.14);
            }

        .account-btn.danger {
            background: rgba(196,43,43,0.12);
            border: 1px solid rgba(196,43,43,0.4);
            color: #ff8a8a;
        }

            .account-btn.danger:hover {
                background: rgba(196,43,43,0.22);
            }

        /* ── TERMS MODAL ── */
        #termsModal {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 99999;
            background: rgba(4,10,22,0.85);
            backdrop-filter: blur(10px);
            align-items: center;
            justify-content: center;
        }

            #termsModal.show {
                display: flex;
            }

        .terms-box {
            background: linear-gradient(160deg, #0d1f42 0%, #0a1530 60%, #10083a 100%);
            border: 1px solid rgba(184,216,240,0.18);
            border-radius: 16px;
            padding: 32px 34px;
            width: 100%;
            max-width: 520px;
            max-height: 76vh;
            overflow-y: auto;
            box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(107,63,160,0.15);
            position: relative;
        }

        .terms-box h3 {
            font-family: 'Cinzel', serif;
            font-size: 1rem;
            color: var(--sky);
            margin-bottom: 16px;
            padding-right: 24px;
        }

        .terms-box p {
            font-size: 0.82rem;
            line-height: 1.6;
            color: rgba(245,240,235,0.75);
            margin-bottom: 12px;
        }

        .terms-close-x {
            position: absolute;
            top: 16px;
            right: 16px;
            background: none;
            border: none;
            color: rgba(184,216,240,0.6);
            font-size: 1.2rem;
            line-height: 1;
            cursor: pointer;
        }

            .terms-close-x:hover {
                color: var(--sky);
            }

        /* Leaflet zoom control — the shared glass pane (tokens in :root). */
        #detectlab-map .leaflet-control-zoom a {
            width: 38px !important;
            height: 38px !important;
            line-height: 38px !important;
            background: var(--ctl-bg) !important;
            color: var(--ctl-icon) !important;
            border: 1px solid var(--ctl-border) !important;
            border-radius: var(--ctl-radius) !important;
            box-shadow: var(--ctl-shadow);
            -webkit-backdrop-filter: var(--ctl-blur);
            backdrop-filter: var(--ctl-blur);
            font-family: 'Outfit', sans-serif;
            font-size: 1.05rem;
            font-weight: 300;
            transition: background-color .18s ease, border-color .18s ease,
                        color .18s ease, box-shadow .18s ease;
        }

            #detectlab-map .leaflet-control-zoom a:hover {
                background: var(--ctl-bg-hover) !important;
                border-color: var(--ctl-border-hover) !important;
                color: var(--ctl-icon-hover) !important;
                box-shadow: var(--ctl-shadow-hover);
            }

            #detectlab-map .leaflet-control-zoom a:active,
            #detectlab-map .leaflet-control-zoom a.leaflet-control-zoom-in:active,
            #detectlab-map .leaflet-control-zoom a.leaflet-control-zoom-out:active {
                background: var(--ctl-bg-press) !important;
            }

            #detectlab-map .leaflet-control-zoom a:focus-visible {
                outline: 2px solid var(--ctl-border-engaged);
                outline-offset: 2px;
            }

            #detectlab-map .leaflet-control-zoom a.leaflet-disabled {
                background: var(--ctl-bg) !important;
                color: rgba(187, 169, 242, 0.34) !important;
            }

        #detectlab-map .leaflet-control-zoom {
            border: none !important;
        }

        /* Two separate panes with the same 8px rhythm as the icon column,
           not one lozenge pressed out of two 12px corners. */
        #detectlab-map .leaflet-control-zoom a + a {
            margin-top: 6px;
        }

        #detectlab-map {
            cursor: grab;
            background: #060E1E;
        }

            #detectlab-map:active {
                cursor: grabbing;
            }

            #detectlab-map .leaflet-tile-pane {
                image-rendering: auto;
            }

            /* Seam fix ("white grid"). Tiles overlap by 1px so no hairline
               can open between them — neither at rest, nor while a zoom
               animation scales the previous zoom level over the incoming one.
               The blend mode MUST stay `normal` here: Leaflet's default rule
               `.leaflet-container img.leaflet-tile { mix-blend-mode:
               plus-lighter }` (a workaround for Chromium bug 600120) ADDS the
               colours of whatever is underneath a tile instead of covering
               it, so with the 1px overlap every 256px seam between tiles
               saturated to white — exactly the white grid that was visible
               over the basemap. With normal blending the overlapping pixel
               is simply covered by the neighbouring tile. */
            #detectlab-map img.leaflet-tile {
                width: 257px !important;
                height: 257px !important;
                mix-blend-mode: normal !important;
            }

            /* Same for canvas tiles (the UAT buildings layer): never blend
               additively with what is underneath. */
            #detectlab-map canvas.leaflet-tile {
                mix-blend-mode: normal !important;
            }

            /* Keep scaled tiles smooth while the zoom animation runs on
               every browser: Leaflet's `.leaflet-safari .leaflet-tile` rule
               uses image-rendering: -webkit-optimize-contrast, which renders
               the scaling tiles blocky instead of smoothly resampled. */
            #detectlab-map .leaflet-tile {
                image-rendering: auto;
            }

            #detectlab-map .leaflet-popup-content-wrapper {
                background: rgba(6,14,30,0.92);
                color: #fff;
                border: 1px solid rgba(128,211,248,0.35);
                border-radius: 8px;
                box-shadow: 0 4px 20px rgba(0,0,0,0.5);
            }

            #detectlab-map .leaflet-popup-tip {
                background: rgba(6,14,30,0.92);
            }
        /* ── CUSTOM LIVE LOCATION BUTTON ── */
        .btn-live-location {
            width: 38px;
            height: 38px;
            background: var(--ctl-bg) !important;
            border: 1px solid var(--ctl-border) !important;
            border-radius: var(--ctl-radius) !important;
            color: var(--ctl-icon);
            box-shadow: var(--ctl-shadow);
            -webkit-backdrop-filter: var(--ctl-blur);
            backdrop-filter: var(--ctl-blur);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background-color .18s ease, border-color .18s ease,
                        color .18s ease, box-shadow .18s ease;
        }

            .btn-live-location:hover {
                background: var(--ctl-bg-hover) !important;
                border-color: var(--ctl-border-hover) !important;
                color: var(--ctl-icon-hover);
                box-shadow: var(--ctl-shadow-hover);
            }

            /* Live = a status, not a mode: a muted rose, never a neon red. */
            .btn-live-location.active {
                background: rgba(240, 130, 152, 0.16) !important;
                border-color: rgba(240, 130, 152, 0.50) !important;
                color: var(--ctl-live);
            }

                .btn-live-location.active:hover {
                    background: rgba(240, 130, 152, 0.24) !important;
                    color: #FFD3DC;
                }
        /* Pulsing red dot marker for live location */
        .live-location-marker {
            width: 16px;
            height: 16px;
            position: relative;
        }

            .live-location-marker::before {
                content: '';
                position: absolute;
                inset: 0;
                background: #C42B2B;
                border-radius: 50%;
                border: 2px solid #fff;
                box-shadow: 0 0 0 0 rgba(196,43,43,0.6);
                animation: livePulse 1.8s ease-out infinite;
            }

        @keyframes livePulse {
            0% {
                box-shadow: 0 0 0 0 rgba(196,43,43,0.7);
            }

            70% {
                box-shadow: 0 0 0 10px rgba(196,43,43,0);
            }

            100% {
                box-shadow: 0 0 0 0 rgba(196,43,43,0);
            }
        }
        /* Leaflet locate control — hide the plugin button since we use custom */
        #detectlab-map .leaflet-control-locate {
            display: none !important;
        }

        /* ── COMPASS + DETECT (bottom-left) ──
           Two stacked 38×38 controls in the shared glass material. The compass
           behaves like Google Earth's: the rose follows the camera frame by
           frame, a tap eases the view back to true north, and a horizontal
           drag on the rose turns the view. There is no rotation lock — the map
           can always be turned. Detect (PWA only; desktop keeps the switch in
           the .map-controls row) toggles activity detection. No labels, no
           badges, no slide gesture. */
        #detectlab-map .detectlab-compass {
            margin: 0 0 10px 10px !important;
            border: none !important;
            background: none !important;
            box-shadow: none !important;
            user-select: none;
            -webkit-user-select: none;
        }
        .detectlab-compass-col {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .detectlab-compass-btn,
        .compass-detect-btn {
            width: 38px;
            height: 38px;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--ctl-bg);
            border: 1px solid var(--ctl-border);
            border-radius: var(--ctl-radius);
            color: var(--ctl-icon);
            box-shadow: var(--ctl-shadow);
            -webkit-backdrop-filter: var(--ctl-blur);
            backdrop-filter: var(--ctl-blur);
            cursor: pointer;
            transition: background-color .18s ease, border-color .18s ease,
                        color .18s ease, box-shadow .18s ease;
        }
        .detectlab-compass-btn:hover,
        .compass-detect-btn:hover {
            background: var(--ctl-bg-hover);
            border-color: var(--ctl-border-hover);
            color: var(--ctl-icon-hover);
            box-shadow: var(--ctl-shadow-hover);
        }
        .detectlab-compass-btn:focus-visible,
        .compass-detect-btn:focus-visible {
            outline: 2px solid var(--ctl-border-engaged);
            outline-offset: 2px;
        }
        /* The compass is a handle, so it says so: grab to turn, grabbing while
           the view follows the pointer. touch-action:none keeps a phone's
           pan/pinch from stealing the drag. */
        .detectlab-compass-btn {
            cursor: grab;
            touch-action: none;
        }
        .detectlab-compass-btn:active,
        .detectlab-compass-btn.is-dragging {
            cursor: grabbing;
            background: var(--ctl-bg-press);
        }
        /* Off north, the rose brightens a little; the pane stays quiet. */
        .detectlab-compass-btn.is-rotated {
            border-color: var(--ctl-border-hover);
        }
        .detectlab-compass-btn.is-rotated .dl-c-needle-n {
            fill: var(--ctl-icon-hover);
        }
        /* Detect ON is a live status (recording), so it keeps the muted rose
           instead of the violet "engaged mode" fill. */
        .compass-detect-btn.detect-active {
            background: rgba(240, 130, 152, 0.16);
            border-color: rgba(240, 130, 152, 0.50);
            color: var(--ctl-live);
        }
        .compass-detect-btn.detect-active:hover {
            background: rgba(240, 130, 152, 0.24);
            border-color: rgba(240, 130, 152, 0.62);
            color: #FFD3DC;
        }
        /* The Detect toggle lives here only in PWA mode — desktop keeps the
           switch in the .map-controls row below the map. */
        body:not(.is-pwa) .compass-detect-btn {
            display: none;
        }
        /* Monochrome-violet compass rose: a hairline ring, a two-tone needle
           and a single hub dot. No letters, so nothing can end up upside down
           when the view is turned. */
        .detectlab-compass-rose {
            display: block;
            width: 26px;
            height: 26px;
            transform-origin: 50% 50%;
            will-change: transform;
            pointer-events: none;
        }
        .detectlab-compass-rose svg {
            display: block;
            width: 100%;
            height: 100%;
        }
        .dl-c-ring {
            fill: none;
            stroke: rgba(198, 180, 255, 0.30);
            stroke-width: 1.2;
        }
        .dl-c-needle-n {
            fill: #C6B4FA;
            transition: fill .18s ease;
        }
        .dl-c-needle-s {
            fill: rgba(198, 180, 255, 0.28);
        }
        .dl-c-hub {
            fill: #EDE9FE;
        }
        #detectlab-map.is-map-rotated {
            cursor: grab;
        }

        /* ── CUSTOM MEASURE BUTTON ── */
        .btn-measure {
            width: 38px;
            height: 38px;
            background: var(--ctl-bg) !important;
            border: 1px solid var(--ctl-border) !important;
            border-radius: var(--ctl-radius) !important;
            color: var(--ctl-icon);
            box-shadow: var(--ctl-shadow);
            -webkit-backdrop-filter: var(--ctl-blur);
            backdrop-filter: var(--ctl-blur);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background-color .18s ease, border-color .18s ease,
                        color .18s ease, box-shadow .18s ease;
        }

            .btn-measure:hover {
                background: var(--ctl-bg-hover) !important;
                border-color: var(--ctl-border-hover) !important;
                color: var(--ctl-icon-hover);
                box-shadow: var(--ctl-shadow-hover);
            }

            /* Engaged tool: a soft violet wash, same as every other map mode. */
            .btn-measure.active,
            .btn-coord.active,
            .btn-track.active,
            .btn-nearby-pwa.is-active,
            .btn-offline-maps.active {
                background: var(--ctl-bg-engaged) !important;
                border-color: var(--ctl-border-engaged) !important;
                color: var(--ctl-icon-engaged);
            }

                .btn-measure.active:hover,
                .btn-coord.active:hover,
                .btn-track.active:hover,
                .btn-nearby-pwa.is-active:hover,
                .btn-offline-maps.active:hover {
                    background: rgba(126, 94, 214, 0.34) !important;
                    color: #FFFFFF;
                }

        /* ── PWA NEARBY-DETECTORISTS BUTTON (last in the left stack) ──
           Shared glass pane; the engaged state is defined once, above, with
           the other map modes. */
        .btn-nearby-pwa {
            width: 38px;
            height: 38px;
            background: var(--ctl-bg) !important;
            border: 1px solid var(--ctl-border) !important;
            border-radius: var(--ctl-radius) !important;
            color: var(--ctl-icon);
            box-shadow: var(--ctl-shadow);
            -webkit-backdrop-filter: var(--ctl-blur);
            backdrop-filter: var(--ctl-blur);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background-color .18s ease, border-color .18s ease,
                        color .18s ease, box-shadow .18s ease;
        }

            .btn-nearby-pwa:hover {
                background: var(--ctl-bg-hover) !important;
                border-color: var(--ctl-border-hover) !important;
                color: var(--ctl-icon-hover);
                box-shadow: var(--ctl-shadow-hover);
            }

        .transp-panel .transp-layer-row {
            height: auto !important;
            max-height: none !important;
            overflow: visible !important;
        }

        /* Measure tooltip */
        .measure-tooltip {
            background: rgba(10,25,48,0.92);
            border: 1px solid rgba(232,119,42,0.5);
            border-radius: 6px;
            color: #F5F0EB;
            font-family: 'Outfit', sans-serif;
            font-size: 0.78rem;
            padding: 4px 10px;
            white-space: nowrap;
            pointer-events: none;
        }

        .measure-tooltip-total {
            font-weight: 600;
            color: #E8772A;
        }

        /* ── CUSTOM COORD BUTTON ── */
        .btn-coord {
            width: 38px;
            height: 38px;
            background: var(--ctl-bg) !important;
            border: 1px solid var(--ctl-border) !important;
            border-radius: var(--ctl-radius) !important;
            color: var(--ctl-icon);
            box-shadow: var(--ctl-shadow);
            -webkit-backdrop-filter: var(--ctl-blur);
            backdrop-filter: var(--ctl-blur);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background-color .18s ease, border-color .18s ease,
                        color .18s ease, box-shadow .18s ease;
        }
        .btn-coord:hover {
            background: var(--ctl-bg-hover) !important;
            border-color: var(--ctl-border-hover) !important;
            color: var(--ctl-icon-hover);
            box-shadow: var(--ctl-shadow-hover);
        }
        /* ── CUSTOM TRACK BUTTON ── */
        .btn-track {
            width: 38px;
            height: 38px;
            background: var(--ctl-bg) !important;
            border: 1px solid var(--ctl-border) !important;
            border-radius: var(--ctl-radius) !important;
            color: var(--ctl-icon);
            box-shadow: var(--ctl-shadow);
            -webkit-backdrop-filter: var(--ctl-blur);
            backdrop-filter: var(--ctl-blur);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background-color .18s ease, border-color .18s ease,
                        color .18s ease, box-shadow .18s ease;
        }
        .btn-track:hover {
            background: var(--ctl-bg-hover) !important;
            border-color: var(--ctl-border-hover) !important;
            color: var(--ctl-icon-hover);
            box-shadow: var(--ctl-shadow-hover);
        }
        /* Coord popup tooltip */
        .coord-popup .leaflet-popup-content-wrapper {
            background:
                radial-gradient(circle at 100% 0%, rgba(107,63,160,0.30), transparent 55%),
                radial-gradient(circle at 0% 100%, rgba(126,94,214,0.16), transparent 60%),
                linear-gradient(180deg, rgba(20,14,34,0.66) 0%, rgba(12,9,24,0.76) 100%);
            -webkit-backdrop-filter: var(--ctl-blur);
            backdrop-filter: var(--ctl-blur);
            border: 1px solid var(--ctl-border);
            border-radius: 16px;
            color: #F5F0EB;
            font-family: 'Outfit', sans-serif;
            font-size: 0.82rem;
            box-shadow: 0 10px 40px rgba(4,6,18,0.42), inset 1px 0 0 rgba(255,255,255,0.05);
            padding: 0;
        }
        .coord-popup .leaflet-popup-tip {
            background: rgba(12,9,24,0.76);
        }
        .coord-popup-container.pin-popup button {
            min-height: 34px;
            border-radius: 8px !important;
            background: rgba(255,255,255,.05) !important;
            border: 1px solid rgba(196,160,240,.22) !important;
            color: #e2d5fa !important;
            transition: background .18s, border-color .18s;
        }
        .coord-popup-container.pin-popup button:hover {
            background: rgba(126,94,214,.18) !important;
            border-color: rgba(196,160,240,.5) !important;
        }
        .coord-popup-container.pin-popup .coord-popup-delete { color: #e9afa6 !important; }
        .coord-popup-container.pin-popup input,
        .coord-popup-container.pin-popup textarea {
            border-radius: 8px !important;
            padding: 8px 10px !important;
        }
        .coord-popup-container.pin-popup textarea { min-height: 60px; }
        .coord-popup-container.pin-popup input:focus-visible,
        .coord-popup-container.pin-popup textarea:focus-visible {
            outline: 2px solid #b99adc;
            outline-offset: 2px;
        }
        .coord-popup .leaflet-popup-content {
            margin: 0;
            padding: 16px 18px;
        }
        .coord-popup-title {
            font-size: 0.7rem;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            color: #B8D8F0;
            margin-bottom: 6px;
            font-weight: 600;
        }
        .coord-popup-row {
            display: flex;
            gap: 6px;
            align-items: center;
            margin-bottom: 3px;
            font-size: 0.83rem;
        }
        .coord-popup-label {
            color: rgba(184,216,240,0.6);
            min-width: 26px;
        }
        .coord-popup-val {
            color: #F5F0EB;
            font-weight: 500;
            cursor: pointer;
            user-select: all;
        }
        .coord-popup-copy {
            margin-top: 8px;
            width: 100%;
            background: rgba(107,63,160,0.5);
            border: 1px solid rgba(107,63,160,0.7);
            border-radius: 5px;
            color: #fff;
            font-family: 'Outfit', sans-serif;
            font-size: 0.76rem;
            padding: 5px 0;
            cursor: pointer;
            transition: background 0.15s;
        }
        .coord-popup-copy:hover {
            background: rgba(107,63,160,0.85);
        }
        .coord-popup-save {
            margin-top: 5px;
            width: 100%;
            min-height: 27px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            background: rgba(184,216,240,0.08);
            border: 1px solid rgba(184,216,240,0.38);
            border-radius: 5px;
            color: #B8D8F0;
            font-family: 'Outfit', sans-serif;
            font-size: 0.72rem;
            font-weight: 500;
            padding: 4px 8px;
            cursor: pointer;
            transition: background 0.15s, border-color 0.15s, color 0.15s;
        }
        .coord-popup-save:hover:not(:disabled) {
            background: rgba(184,216,240,0.18);
            border-color: rgba(184,216,240,0.65);
            color: #fff;
        }
        .coord-popup-save:focus-visible {
            outline: 2px solid #B8D8F0;
            outline-offset: 2px;
        }
        .coord-popup-save:disabled {
            cursor: wait;
            opacity: 0.8;
        }
        .coord-popup-save.saved {
            background: rgba(62,177,118,0.18);
            border-color: rgba(62,177,118,0.6);
            color: #8EE0B2;
            cursor: default;
            opacity: 1;
        }
        .coord-popup-save.error {
            border-color: rgba(232,119,42,0.7);
            color: #FFC08F;
        }
        .coord-popup-save-icon {
            flex: 0 0 auto;
        }
        .coord-popup-status {
            display: none;
            max-width: 180px;
            margin-top: 5px;
            font-size: 0.65rem;
            line-height: 1.25;
            text-align: center;
        }
        .coord-popup-status.success,
        .coord-popup-status.error {
            display: block;
        }
        .coord-popup-status.success {
            color: #8EE0B2;
        }
        .coord-popup-status.error {
            color: #FFC08F;
        }

        /* ── TRANSPARENCY PANEL ARROW TAB ── */
        .transp-arrow-tab {
            position: absolute;
            right: 0;
            top: 280px; /* vertically centred on the 560px map-wrapper */
            transform: translateY(-50%);
            z-index: 1002; /* above map-wrapper stacking context */
            width: 28px;
            height: 64px;
            background: rgba(107,63,160,0.55);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(184,216,240,0.3);
            border-right: none;
            border-radius: 10px 0 0 10px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s, width 0.2s;
            box-shadow: -2px 0 16px rgba(0,0,0,0.45);
        }

            .transp-arrow-tab:hover {
                background: rgba(107,63,160,0.82);
            }

            .transp-arrow-tab svg {
                transition: transform 0.3s;
                flex-shrink: 0;
            }

            .transp-arrow-tab.open svg {
                transform: rotate(180deg);
            }

        /* ── TRANSPARENCY PANEL ──
           The window is anchored to the top AND the bottom of its container
           instead of carrying a hardcoded 560px: on the website the map frame
           is exactly 560px, so the look is unchanged there, while in the
           installed PWA (frame = full viewport) the panel now reaches the
           bottom of the screen instead of stopping at the old 560px cap.
           No bottom padding: the strip of panel background below the last row
           was pure dead space in the tall PWA layout. */
        .transp-panel {
            position: absolute;
            right: 0;
            top: 0;
            bottom: 0;
            height: auto;
            max-height: none;
            display: block;
            padding: 22px 16px 0;
            width: 272px;
            /* Same material as the map controls (--ctl-*): the window is a
               translucent violet glass pane, not the near-opaque navy slab it
               used to be. The two alpha stops are variables so the LiDAR /
               archeology drag path can thicken the pane when it drops the
               backdrop blur for performance (see the drag rules further
               down). */
            --panel-top-alpha: 0.66;
            --panel-bottom-alpha: 0.76;
            background:
                radial-gradient(circle at 100% 0%, rgba(107,63,160,0.30), transparent 55%),
                radial-gradient(circle at 0% 100%, rgba(126,94,214,0.16), transparent 60%),
                linear-gradient(180deg,
                    rgba(20,14,34,var(--panel-top-alpha)) 0%,
                    rgba(12,9,24,var(--panel-bottom-alpha)) 100%);
            -webkit-backdrop-filter: var(--ctl-blur);
            backdrop-filter: var(--ctl-blur);
            border: 1px solid var(--ctl-border);
            border-right: none;
            border-radius: 16px 0 0 16px;
            box-shadow: -10px 0 40px rgba(4,6,18,0.42), inset 1px 0 0 rgba(255,255,255,0.05);
            transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), opacity 0.35s, visibility 0s linear 0.35s;
            pointer-events: none;
            visibility: hidden;
            z-index: 1001;
            transform: translateX(100%);
            opacity: 0;
            overflow-y: auto;
            overflow-x: hidden;
            scrollbar-width: thin;
            scrollbar-color: rgba(107,63,160,0.5) rgba(184,216,240,0.06);
        }

        .transp-panel::-webkit-scrollbar {
            width: 4px;
        }
        .transp-panel::-webkit-scrollbar-track {
            background: rgba(184,216,240,0.06);
            border-radius: 2px;
        }
        .transp-panel::-webkit-scrollbar-thumb {
            background: rgba(107,63,160,0.5);
            border-radius: 2px;
        }
        .transp-panel::-webkit-scrollbar-thumb:hover {
            background: rgba(107,63,160,0.8);
        }

            .transp-panel.open {
                transform: translateX(0%);
                pointer-events: all;
                visibility: visible;
                opacity: 1;
                transition-delay: 0s;
            }

        .transp-panel-title {
            font-family: 'Cinzel', serif;
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--sky);
            letter-spacing: 0.1em;
            text-transform: uppercase;
            margin-bottom: 16px;
            padding-bottom: 14px;
            display: flex;
            align-items: center;
            gap: 9px;
            border-bottom: 1px solid rgba(198,180,255,0.14);
        }

            .transp-panel-title svg {
                opacity: 0.85;
                flex-shrink: 0;
                filter: drop-shadow(0 0 4px rgba(107,63,160,0.5));
            }

        /* ── Heritage Sites hover legend ── */
        .heritage-legend-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            cursor: help;
            opacity: 0.6;
            transition: opacity 0.18s;
            outline: none;
        }
        .heritage-legend-icon:hover,
        .heritage-legend-icon:focus {
            opacity: 1;
        }
        .heritage-legend-tooltip {
            position: absolute;
            left: 15px;
            right: 15px;
            bottom: -8px;
            transform: translateY(100%);
            background: rgba(6,14,30,0.97);
            border: 1px solid rgba(196,160,240,0.4);
            border-radius: 10px;
            padding: 10px 12px;
            box-shadow: 0 8px 24px rgba(0,0,0,0.55);
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.18s, visibility 0.18s;
            z-index: 50;
            pointer-events: none;
        }
        .heritage-legend-tooltip.visible {
            opacity: 1;
            visibility: visible;
        }
        .heritage-legend-title {
            font-size: 0.66rem;
            font-weight: 600;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: #c4a0f0;
            opacity: 0.85;
            margin-bottom: 7px;
        }
        .heritage-legend-row {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.74rem;
            color: #F5F0EB;
            padding: 3px 0;
        }
        .heritage-legend-dot {
            width: 9px;
            height: 9px;
            border-radius: 50%;
            flex-shrink: 0;
            box-shadow: 0 0 4px rgba(0,0,0,0.5);
        }

        /* ── Layer rows: one material with the window and the map controls ──
           `.dl-sublayer-row` is tagged at runtime (js/layer-panel-rows.js) on
           every nested row the catalogue renders inside a *SubLayers group, so
           the accordion children get the same box as the top-level rows
           instead of floating bare on the panel background.
           The rows deliberately carry NO backdrop-filter of their own: the
           window above them already creates a backdrop root, so a row-level
           blur would only re-blur the pane's own flat tint (invisible) while
           each row still bought its own compositing layer — on a phone that is
           dozens of layers over a live map, the exact cost the LiDAR drag path
           had to work around. The translucency + the control border + the
           inset highlight are what make them read as glass inside the pane. */
        .transp-layer-row,
        .dl-sublayer-row {
            --row-radius: var(--ctl-radius);
            position: relative;
            margin-bottom: 8px;
            padding: 10px 12px 11px;
            background: var(--ctl-bg);
            border: 1px solid var(--ctl-border);
            border-radius: var(--row-radius);
            box-shadow: var(--ctl-shadow);
            transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
        }

            /* Nested rows are the compact cut of the same box: they live
               inside an accordion, so they keep a smaller radius, a tighter
               padding and a shorter gap. */
            #transpPanel .dl-sublayer-row {
                --row-radius: 10px;
                /* The *SubLayers containers are flex columns with their own
                   gap; a large margin here would double the spacing. */
                margin-bottom: 2px;
                padding: 8px 10px 9px;
                box-shadow: 0 4px 14px rgba(4,6,18,0.26), inset 0 1px 0 rgba(255,255,255,0.06);
            }

            .transp-layer-row:hover,
            .dl-sublayer-row:hover {
                background: var(--ctl-bg-hover);
                border-color: var(--ctl-border-hover);
                box-shadow: var(--ctl-shadow-hover);
            }

            .transp-layer-row:last-child {
                margin-bottom: 0;
            }

        /* ── Historical sublayer rows carry a photo of one of their own tiles ──
           `--row-preview` is set by js/layer-panel-rows.js once the tile has
           actually loaded, so a dead service leaves the plain glass row behind
           instead of an empty box. Keep map details recognizable rather than
           blurring the tile into a flat colour. A dark violet wash keeps the
           slider, switch, info button and labels readable above the image. */
        .transp-layer-row[data-row-preview]::before,
        .dl-sublayer-row[data-row-preview]::before {
            content: '';
            position: absolute;
            inset: 0;
            z-index: 0;
            border-radius: inherit;
            background-image: var(--row-preview);
            background-position: center;
            background-size: cover;
            background-repeat: no-repeat;
            filter: saturate(0.85) brightness(0.9) contrast(1.05);
            /* The blur softens the edges outwards; clip them back to the row. */
            -webkit-clip-path: inset(0 round var(--row-radius));
            clip-path: inset(0 round var(--row-radius));
            opacity: 0.95;
            pointer-events: none;
        }

        .transp-layer-row[data-row-preview]::after,
        .dl-sublayer-row[data-row-preview]::after {
            content: '';
            position: absolute;
            inset: 0;
            z-index: 0;
            border-radius: inherit;
            background:
                linear-gradient(180deg, rgba(45,33,74,0.44) 0%, rgba(14,10,26,0.68) 100%),
                radial-gradient(120% 90% at 100% 0%, rgba(126,94,214,0.30), transparent 62%);
            pointer-events: none;
        }

        .transp-layer-row[data-row-preview] > *,
        .dl-sublayer-row[data-row-preview] > * {
            position: relative;
            z-index: 1;
        }

        .transp-layer-label {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 8px;
            font-size: 0.76rem;
            color: rgba(245,240,235,0.82);
            margin-bottom: 5px;
            font-weight: 500;
            letter-spacing: 0.02em;
        }

            .transp-layer-label > span:first-child {
                min-width: 0;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

        /* ── Layer Panel Tabs ── */
        .transp-panel-tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 16px;
            padding-bottom: 16px;
            border-bottom: 1px solid rgba(198,180,255,0.14);
        }
        .transp-panel-tabs button {
            flex: 1;
            padding: 9px 10px;
            background: var(--ctl-bg);
            border: 1px solid var(--ctl-border);
            border-radius: 10px;
            color: var(--ctl-icon);
            opacity: 0.8;
            font-family: 'Outfit', sans-serif;
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            cursor: pointer;
            transition: all 0.25s ease;
        }
        .transp-panel-tabs button:hover {
            background: var(--ctl-bg-hover);
            border-color: var(--ctl-border-hover);
            color: var(--ctl-icon-hover);
            opacity: 1;
        }
        .transp-panel-tabs button.active {
            background: var(--ctl-bg-engaged);
            border-color: var(--ctl-border-engaged);
            color: var(--ctl-icon-engaged);
            opacity: 1;
            box-shadow: 0 0 14px rgba(126,94,214,0.30), inset 0 1px 0 rgba(255,255,255,0.10);
        }

        /* ── Premium catalogue for free members ──
           Free users can browse every Premium row instead of being stopped at
           the tab. Each row is visibly locked and this checkout CTA stays at
           the top of the catalogue. */
        .premium-panel-upsell[data-category] {
            display: none;
        }

        .premium-panel-upsell[data-category].active {
            display: block;
        }

        .premium-panel-upsell.premium-member {
            display: none !important;
        }

        .premium-panel-upsell {
            margin: 0 0 13px;
            padding: 13px;
            border: 1px solid rgba(255,200,50,0.34);
            border-radius: 12px;
            background:
                radial-gradient(circle at 100% 0%, rgba(255,200,50,0.13), transparent 55%),
                linear-gradient(145deg, rgba(107,63,160,0.23), rgba(255,200,50,0.055));
            box-shadow: 0 8px 22px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.035);
        }

        .premium-panel-upsell-head {
            display: flex;
            align-items: flex-start;
            gap: 9px;
        }

        .premium-panel-upsell-icon {
            width: 29px;
            height: 29px;
            flex: 0 0 29px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            color: #ffc832;
            background: rgba(255,200,50,0.1);
            border: 1px solid rgba(255,200,50,0.28);
        }

        .premium-panel-upsell strong {
            display: block;
            margin: 1px 0 3px;
            color: #fff1bd;
            font-family: 'Outfit', sans-serif;
            font-size: 0.79rem;
            line-height: 1.25;
        }

        .premium-panel-upsell p {
            margin: 0;
            color: rgba(245,240,235,0.62);
            font-size: 0.68rem;
            line-height: 1.4;
        }

        .premium-panel-cta {
            width: 100%;
            margin-top: 11px;
            padding: 9px 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 7px;
            border: 1px solid rgba(255,200,50,0.55);
            border-radius: 8px;
            background: linear-gradient(135deg, #e8772a, #c9550e);
            color: #fff;
            font-family: 'Outfit', sans-serif;
            font-size: 0.75rem;
            font-weight: 700;
            line-height: 1.2;
            cursor: pointer;
            box-shadow: 0 5px 16px rgba(232,119,42,0.21);
            transition: transform 0.16s ease, box-shadow 0.2s ease, filter 0.2s ease;
        }

        .premium-panel-cta:hover {
            transform: translateY(-1px);
            filter: brightness(1.08);
            box-shadow: 0 8px 20px rgba(232,119,42,0.32);
        }

        .premium-panel-cta:focus-visible {
            outline: 2px solid #ffc832;
            outline-offset: 2px;
        }

        .premium-layer-lock-badge {
            display: none;
            width: max-content;
            margin: -2px 0 10px auto;
            padding: 4px 7px;
            align-items: center;
            gap: 5px;
            border: 1px solid rgba(255,200,50,0.32);
            border-radius: 999px;
            background: rgba(255,200,50,0.08);
            color: #ffd866;
            font-family: 'Outfit', sans-serif;
            font-size: 0.58rem;
            font-weight: 700;
            letter-spacing: 0.06em;
            line-height: 1;
            text-transform: uppercase;
            cursor: pointer;
        }

        .transp-layer-row.is-premium-locked {
            border-color: rgba(255,200,50,0.18);
            /* The lock hint is a gold wash ON TOP of the shared glass — it used
               to replace the row background outright, which would have dropped
               the material for every free visitor. */
            background:
                linear-gradient(145deg, rgba(255,200,50,0.06), rgba(255,200,50,0)),
                var(--ctl-bg);
        }

        .transp-layer-row.is-premium-locked:hover {
            border-color: rgba(255,200,50,0.34);
            box-shadow: 0 5px 20px rgba(0,0,0,0.32), inset 0 0 20px rgba(255,200,50,0.025);
        }

        .transp-layer-row.is-premium-locked > .premium-layer-lock-badge {
            display: inline-flex;
        }

        .transp-layer-row.is-premium-locked > :not(.premium-layer-lock-badge) {
            opacity: 0.52;
            filter: saturate(0.7);
        }

        .transp-layer-row.is-premium-locked input,
        .transp-layer-row.is-premium-locked button,
        .transp-layer-row.is-premium-locked label,
        .transp-layer-row.is-premium-locked select,
        .transp-layer-row.is-premium-locked textarea {
            cursor: not-allowed !important;
        }

        .transp-layer-row.is-premium-locked .premium-layer-lock-badge {
            opacity: 1;
            filter: none;
            cursor: pointer !important;
        }

        /* ── Layer Groups Visibility Toggle ── */
        .transp-layer-row[data-category] {
            display: none !important;
        }
        .transp-layer-row[data-category].active {
            display: block !important;
        }
        .transp-divider[data-category] {
            display: none !important;
        }
        .transp-divider[data-category].active {
            display: block !important;
        }

        /* ── Battles / Bătălii premium layer ── */
        .battles-zone {
            animation: battlesFadeIn 0.45s ease both;
            cursor: pointer;
            pointer-events: auto;
        }
        /* Eticheta bătăliei — ancorată pe marginea de sus a razei.
           battles-layer.js o pune într-un L.marker fixat GEOGRAFIC în vârful
           cercului (același punct pe care îl desenează L.Circle._project), iar
           aici doar o centrăm pe orizontală și o ridicăm cu 8 px deasupra
           conturului. Valorile sunt în CSS (nu în JS), deci eticheta stă lipită
           de raza ei la pan / zoom / pinch / flyTo, fără recalculări în pixeli. */
        .battles-label-anchor {
            background: transparent;
            border: 0;
            overflow: visible;
        }
        .battles-label {
            position: absolute;
            left: 0;
            top: 0;
            margin: 0;
            transform: translate(-50%, calc(-100% - 8px));
            background: rgba(12, 15, 20, 0.88);
            border: 1px solid rgba(232, 179, 75, 0.55);
            color: #f0e6d2;
            font-size: 0.68rem;
            font-weight: 600;
            letter-spacing: 0.02em;
            padding: 2px 7px;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
            cursor: pointer;
            white-space: nowrap;
            animation: battlesLabelFade 0.4s ease both;
            pointer-events: auto;
            -webkit-user-select: none;
            user-select: none;
        }
        /* Textul se poate schimba (RO ↔ EN): lățimea diferită rămâne centrată
           pe aceeași axă, tot din CSS. */
        .battles-label:hover {
            background: rgba(30, 26, 18, 0.95);
            border-color: #E8B34B;
            color: #fff;
        }

        /* „On hover” century bubble for the period slider: hidden by default,
           shown by battles-layer.js when the slider is touched / hovered /
           focused. Anchored above the slider thumb (left/top set from JS). */
        .battles-century-tip {
            position: absolute;
            z-index: 6;
            left: 50%;
            top: -6px;
            transform: translate(-50%, -100%);
            padding: 3px 8px;
            background: var(--ctl-bg-hover);
            border: 1px solid var(--ctl-border-hover);
            border-radius: 8px;
            color: var(--slider-value-color);
            font: 600 0.68rem/1.25 'Outfit', sans-serif;
            letter-spacing: 0.02em;
            white-space: nowrap;
            -webkit-backdrop-filter: var(--ctl-blur);
            backdrop-filter: var(--ctl-blur);
            box-shadow: var(--ctl-shadow);
            pointer-events: none;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.16s ease, visibility 0s linear 0.16s;
        }
        .battles-century-tip::after {
            content: '';
            position: absolute;
            left: 50%;
            bottom: -4.5px;
            width: 8px;
            height: 8px;
            transform: translateX(-50%) rotate(45deg);
            background: var(--ctl-bg-hover);
            border-right: 1px solid var(--ctl-border-hover);
            border-bottom: 1px solid var(--ctl-border-hover);
        }
        .battles-century-tip.visible {
            opacity: 1;
            visibility: visible;
            transition-delay: 0s;
        }
        @keyframes battlesLabelFade {
            from { opacity: 0; }
            to   { opacity: 1; }
        }
        @keyframes battlesFadeIn {
            from { opacity: 0; transform: scale(0.85); }
            to   { opacity: 1; transform: scale(1); }
        }

        /* ─────────────────────────────────────────────────────────────
           Fereastra de informații pentru bătălii (.battles-popup)
           → COMPACTĂ: nu mai acoperă ecranul. Lățimea și înălțimea sunt
           plafonate față de viewport (px + vh/vw), fonturile și spațierile
           sunt reduse, iar descrierea lungă este strânsă implicit în câteva
           rânduri și se desface cu butonul „Detalii / Ascunde".
           Plafoanele în px sunt dublate de JS (popupMetrics() în
           battles-layer.js → maxWidth / minWidth / maxHeight la bindPopup).
           ───────────────────────────────────────────────────────────── */
        .battles-popup .leaflet-popup-content-wrapper {
            background: #141a22;
            color: #e8edf3;
            border: 1px solid rgba(232, 179, 75, 0.35);
            border-radius: 10px;
            box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
        }
        .battles-popup .leaflet-popup-tip {
            background: #141a22;
            border: 1px solid rgba(232, 179, 75, 0.35);
        }
        .battles-popup .leaflet-popup-content {
            margin: 8px 10px;
            line-height: 1.4;
            font-size: 0.72rem;
            /* tavanele ferestrei: ≈ 260×300 px pe desktop, mai puțin pe ecrane
               mici; conținutul în plus se derulează intern */
            max-width: min(260px, calc(100vw - 60px));
            max-height: min(300px, 44vh);
            overflow-y: auto;
            overscroll-behavior: contain;
        }
        .battles-popup-inner {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }
        .battles-popup-title {
            font-family: 'Cinzel', serif;
            font-size: 0.9rem;
            font-weight: 700;
            color: #E8B34B;
            line-height: 1.2;
            padding-bottom: 4px;
            padding-right: 18px;   /* loc pentru butonul de închidere Leaflet */
            border-bottom: 1px solid rgba(232, 179, 75, 0.25);
        }
        .battles-popup-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
            align-items: center;
            font-size: 0.64rem;
        }
        .battles-popup-date {
            color: var(--sky);
            font-weight: 600;
        }
        .battles-popup-type {
            background: rgba(160, 112, 232, 0.16);
            border: 1px solid rgba(160, 112, 232, 0.4);
            color: #c9a8f2;
            border-radius: 20px;
            padding: 0 7px;
        }
        .battles-popup-context {
            font-size: 0.6rem;
            font-style: italic;
            color: rgba(232, 179, 75, 0.85);
            background: rgba(232, 179, 75, 0.08);
            border: 1px dashed rgba(232, 179, 75, 0.4);
            border-radius: 5px;
            padding: 3px 6px;
        }
        .battles-popup-row {
            display: flex;
            gap: 7px;
            font-size: 0.7rem;
        }
        .battles-popup-k {
            flex-shrink: 0;
            min-width: 76px;
            color: rgba(245, 240, 235, 0.5);
            font-weight: 600;
            text-transform: uppercase;
            font-size: 0.55rem;
            letter-spacing: 0.05em;
            padding-top: 1px;
        }
        .battles-popup-desc {
            font-size: 0.7rem;
            color: #c9d3df;
            border-top: 1px solid rgba(184, 216, 240, 0.12);
            padding-top: 6px;
            margin-top: 1px;
        }
        /* Descriere strânsă implicit: doar câteva rânduri (cu „…” nativ), ca
           fereastra să rămână scurtă. Se desface cu butonul de mai jos. */
        .battles-popup-desc.is-clamped {
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 3;
            line-clamp: 3;
            max-height: 4.4em;   /* fallback pentru motoare fără line-clamp */
            overflow: hidden;
        }
        /* Deschisă: textul curge complet, iar popup-ul (deja plafonat) derulează */
        .battles-popup-desc.is-open {
            display: block;
            -webkit-line-clamp: unset;
            line-clamp: unset;
            max-height: none;
            overflow: visible;
        }
        .battles-popup-more {
            align-self: flex-start;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            background: rgba(184, 216, 240, 0.08);
            border: 1px solid rgba(184, 216, 240, 0.22);
            color: var(--sky);
            font-family: 'Outfit', sans-serif;
            font-size: 0.6rem;
            font-weight: 600;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            border-radius: 6px;
            padding: 2px 7px;
            cursor: pointer;
            transition: background 0.18s, border-color 0.18s;
        }
        .battles-popup-more:hover {
            background: rgba(184, 216, 240, 0.16);
            border-color: rgba(184, 216, 240, 0.4);
        }
        .battles-popup-more-caret { transition: transform 0.2s; }
        .battles-popup-more.is-open .battles-popup-more-caret { transform: rotate(180deg); }
        .battles-popup-search {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            margin-top: 2px;
            background: linear-gradient(135deg, #7a4bc0, var(--violet));
            border: 1px solid rgba(160, 112, 232, 0.8);
            color: #fff;
            font-size: 0.72rem;
            font-weight: 700;
            letter-spacing: 0.03em;
            text-decoration: none;
            border-radius: 7px;
            padding: 6px 10px;
            transition: filter 0.2s, transform 0.15s;
        }
        .battles-popup-search:hover {
            filter: brightness(1.15);
            transform: translateY(-1px);
            color: #fff;
        }
        .battles-popup-search:active {
            transform: translateY(0);
        }
        .battles-popup .leaflet-popup-close-button {
            color: rgba(245, 240, 235, 0.6) !important;
        }
        .battles-popup .leaflet-popup-close-button:hover {
            color: #fff !important;
        }

        /* Telefoane: fereastra devine și mai mică — ≈ 60% din lățimea și
           ≈ 40% din înălțimea ecranului, ca să nu acopere harta. */
        @media (max-width: 600px) {
            .battles-popup .leaflet-popup-content {
                margin: 7px 9px;
                font-size: 0.68rem;
                max-width: min(240px, calc(100vw - 52px));
                max-height: min(280px, 40vh);
            }
            .battles-popup-inner { gap: 4px; }
            .battles-popup-title { font-size: 0.82rem; padding-bottom: 3px; padding-right: 16px; }
            .battles-popup-meta { font-size: 0.6rem; gap: 4px; }
            .battles-popup-row { font-size: 0.66rem; gap: 6px; }
            .battles-popup-k { min-width: 66px; font-size: 0.52rem; }
            .battles-popup-context { font-size: 0.56rem; padding: 2px 5px; }
            .battles-popup-desc { font-size: 0.66rem; padding-top: 5px; }
            .battles-popup-more { font-size: 0.56rem; padding: 2px 6px; }
            .battles-popup-search { font-size: 0.66rem; padding: 5px 9px; gap: 5px; }
        }
        @media (max-width: 420px) {
            .battles-popup .leaflet-popup-content {
                max-width: min(224px, calc(100vw - 44px));
                max-height: min(270px, 40vh);
            }
            .battles-popup-title { font-size: 0.78rem; }
            .battles-popup-row { font-size: 0.64rem; }
            .battles-popup-k { min-width: 60px; }
            .battles-popup-desc { font-size: 0.64rem; }
            .battles-popup-desc.is-clamped {
                -webkit-line-clamp: 2;
                line-clamp: 2;
                max-height: 3.1em;
            }
        }
        /* Ecrane scunde (telefon în landscape): și mai puțin pe verticală */
        @media (max-height: 560px) {
            .battles-popup .leaflet-popup-content { max-height: min(210px, 62vh); }
            .battles-popup-desc.is-clamped {
                -webkit-line-clamp: 2;
                line-clamp: 2;
                max-height: 3.1em;
            }
        }

        footer .nav-logo span {
            color: #E8772A !important;
        }

            .transp-layer-label span.pct {
                font-family: 'Outfit', sans-serif;
                font-variant-numeric: tabular-nums;
                font-size: 0.68rem;
                color: var(--slider-value-color);
                font-weight: 600;
                min-width: 34px;
                text-align: center;
                background: rgba(242, 170, 121, 0.10);
                border: 1px solid rgba(242, 170, 121, 0.22);
                border-radius: 5px;
                padding: 1px 5px;
            }

        /* ── UNIFIED SLIM 3D-STYLE PASTEL ORANGE SLIDERS (layer window) ── */
        .transp-slider,
        .lidar-country-opacity,
        .albania-active-slider {
            -webkit-appearance: none;
            appearance: none;
            width: 100%;
            height: var(--slider-track-h);
            margin: 3px 0;
            padding: 0;
            border: 0;
            border-radius: 999px;
            background: linear-gradient(
                90deg,
                var(--slider-fill) 0%,
                var(--slider-fill) var(--slider-pct, 0%),
                var(--slider-track-bg) var(--slider-pct, 0%),
                var(--slider-track-bg) 100%
            );
            accent-color: rgba(244, 176, 128, 0.82);
            outline: none;
            cursor: pointer;
        }

            .transp-slider::-webkit-slider-thumb,
            .lidar-country-opacity::-webkit-slider-thumb,
            .albania-active-slider::-webkit-slider-thumb {
                -webkit-appearance: none;
                appearance: none;
                width: var(--slider-thumb-size);
                height: var(--slider-thumb-size);
                border-radius: 50%;
                background: var(--slider-thumb-bg);
                border: 1px solid var(--slider-thumb-border);
                box-shadow: var(--slider-thumb-shadow);
                cursor: pointer;
                transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
            }

                .transp-slider::-webkit-slider-thumb:hover,
                .lidar-country-opacity::-webkit-slider-thumb:hover,
                .albania-active-slider::-webkit-slider-thumb:hover {
                    background: var(--slider-thumb-bg-hover);
                    transform: scale(1.1);
                }

            .transp-slider::-moz-range-thumb,
            .lidar-country-opacity::-moz-range-thumb,
            .albania-active-slider::-moz-range-thumb {
                width: var(--slider-thumb-size);
                height: var(--slider-thumb-size);
                border-radius: 50%;
                background: var(--slider-thumb-bg);
                border: 1px solid var(--slider-thumb-border);
                box-shadow: var(--slider-thumb-shadow);
                cursor: pointer;
            }

            .transp-slider::-moz-range-track,
            .lidar-country-opacity::-moz-range-track,
            .albania-active-slider::-moz-range-track {
                height: var(--slider-track-h);
                border: 0;
                border-radius: 999px;
                background: var(--slider-track-bg);
            }

            .transp-slider::-moz-range-progress,
            .lidar-country-opacity::-moz-range-progress,
            .albania-active-slider::-moz-range-progress {
                height: var(--slider-track-h);
                border-radius: 999px;
                background: var(--slider-fill);
            }

            .transp-slider:focus-visible,
            .lidar-country-opacity:focus-visible,
            .albania-active-slider:focus-visible {
                box-shadow: 0 0 0 2px var(--slider-fill-soft);
            }

        .cenagis-opacity-slider {
            height: var(--slider-track-h) !important;
        }

        /* ── SELECTED LAYER: VERTICAL OPACITY CONTROL ──
           Every real opacity range in the layer panel is registered by
           vertical-opacity-control.js. The selected range is mirrored here so
           users can tune it over the map after the full layer panel closes.

           Slim blurred button-box card (--ctl-*): matches the map control
           buttons (38px wide on desktop, 36px on mobile/PWA) with the slim
           pastel faded semitransparent orange 3D slider inside. */
        .vertical-opacity-control {
            position: absolute;
            right: calc(38px + env(safe-area-inset-right, 0px));
            top: 50%;
            z-index: 1000;
            width: 38px;
            height: 248px;
            padding: 9px 3px 8px;
            display: grid;
            grid-template-columns: auto 1fr;
            grid-template-rows: 1fr auto;
            column-gap: 1px;
            row-gap: 4px;
            justify-items: center;
            align-items: center;
            color: #F5F0EB;
            background: var(--ctl-bg);
            border: 1px solid var(--ctl-border);
            border-radius: var(--ctl-radius);
            box-shadow: var(--ctl-shadow);
            -webkit-backdrop-filter: var(--ctl-blur);
            backdrop-filter: var(--ctl-blur);
            transform: translateY(-50%) translateX(16px) scale(0.96);
            transform-origin: center right;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            /* `right` e în listă ca oglinda rămasă singură (clasa
               „mirror-sole”) să alunece spre marginea din dreapta în același
               ritm cu apariția/dispariția ei, în loc să sară. */
            transition: opacity 0.2s ease, transform 0.2s ease, right 0.2s ease,
                background-color 0.18s ease, border-color 0.18s ease,
                visibility 0s linear 0.2s;
        }

        .vertical-opacity-control:hover {
            border-color: var(--ctl-border-hover);
        }

        .vertical-opacity-control.visible {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
            transform: translateY(-50%) translateX(0) scale(1);
            transition-delay: 0s;
        }

        .vertical-opacity-close {
            position: absolute;
            top: 3px;
            right: 3px;
            /* Pictat DEASUPRA slider-wrap: fără z-index, wrap-ul (poziționat,
               mai târziu în DOM) acoperea jumătatea de jos a butonului și
               îi înghițea click-urile — doar o fâșie subțire de deasupra
               era de fapt accesibilă. Asta făcea ✕ aproape de nimerit. */
            z-index: 2;
            width: 26px;
            height: 26px;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--ctl-icon);
            /* Disc vizibil și în repaus: fără el glifa „×” stinsă era aproape
               imposibil de găsit și de nimerit cu mouse-ul pe desktop. */
            background: rgba(24, 19, 40, 0.52);
            border: 1px solid var(--ctl-border);
            border-radius: 50%;
            font: 400 16px/1 'Outfit', sans-serif;
            cursor: pointer;
            touch-action: manipulation;
            transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.15s;
        }

        /* Halou invizibil de ±7px în jurul butonului: ținta efectivă de click
           ajunge la ~40px, deci mouse-ul nu mai trebuie să cadă exact pe
           glifă. Cardul nu are overflow:hidden (chipul .vertical-opacity-
           caption pluteste deja în afara lui), iar capătul de sus al
           slider-ului începe la ~39px de la marginea cardului — sub halou —
           deci trasarea opacității la 100% nu poate declanșa din greșeală
           închiderea oglinzii. */
        .vertical-opacity-close::before {
            content: '';
            position: absolute;
            inset: -7px;
            border-radius: 50%;
        }

        .vertical-opacity-close:hover,
        .vertical-opacity-close:focus-visible {
            color: var(--ctl-icon-hover);
            background: var(--ctl-bg-hover);
            border-color: var(--ctl-border-hover);
            transform: scale(1.1);
            outline: none;
        }

        .vertical-opacity-close:focus-visible {
            box-shadow: 0 0 0 2px var(--ctl-border-hover);
        }

        /* Cursorul e oriunde pe card → X-ul se aprinde ușor, ca ținta să fie
           vizibilă înainte ca mouse-ul să ajungă peste ea. */
        .vertical-opacity-control:hover .vertical-opacity-close {
            color: var(--ctl-icon-engaged);
            border-color: var(--ctl-border-hover);
        }

        /* ── SLIDER TITLE: VERTICAL, ON THE LEFT SIDE OF THE SLIDER ──
           The layer's initials are written bottom-up along the left edge of
           the slim card (writing-mode vertical + 180° rotation), in a single
           column of text — js/vertical-opacity-control.js keeps them to 3
           letters at most, without years (the full layer name stays in the
           title attribute). The small DISTANȚĂ / RAZĂ / ISTORIC caption is a
           separate chip floating above the card (see .vertical-opacity-caption
           below) and collapses when the JS leaves it empty (opacity mirrors
           carry no caption). */
        .vertical-opacity-title {
            grid-column: 1;
            grid-row: 1 / -1;
            align-self: center;
            justify-self: center;
            max-height: 100%;
            overflow: hidden;
            pointer-events: none;
        }

        /* ── CAPTION CHIP: ALWAYS ABOVE THE CARD ──
           DISTANȚĂ / RAZĂ (analysis layers) and ISTORIC (Satellite) float
           7px above the top edge of the card, centred on it. The chip is a
           DIRECT child of .vertical-opacity-control in index.html, so the
           card — the nearest positioned ancestor in every mode (desktop,
           browser fullscreen, installed PWA) — is its containing block and
           `bottom: 100% + 7px` really means "above the card". It used to live
           inside .vertical-opacity-title; in the installed PWA that wrapper is
           itself absolutely positioned (rotated side-title fallback below),
           which made IT the containing block: the chip was measured from the
           title box (21px below the card's top, 14px wide) and landed on the
           card's top edge, over the × button, instead of above the slider.
           pointer-events: none keeps the (purely informative) chip from
           swallowing map taps just above the card. */
        .vertical-opacity-caption {
            position: absolute;
            bottom: calc(100% + 7px);
            left: 50%;
            transform: translateX(-50%);
            max-width: min(196px, calc(100vw - 26px));
            padding: 3px 7px;
            overflow: hidden;
            color: var(--slider-value-color);
            background: var(--ctl-bg-hover);
            border: 1px solid var(--ctl-border);
            border-radius: 7px;
            -webkit-backdrop-filter: var(--ctl-blur);
            backdrop-filter: var(--ctl-blur);
            box-shadow: var(--ctl-shadow);
            font: 600 0.5rem/1 'Outfit', sans-serif;
            letter-spacing: 0.12em;
            white-space: nowrap;
            text-overflow: ellipsis;
            pointer-events: none;
        }

        /* Opacity mirrors no longer carry the word "OPACITY" above the range, so
           the (empty) caption is dropped entirely. The period and distance
           mirrors (ISTORIC / PERIOADĂ / RAZĂ) keep theirs. */
        .vertical-opacity-caption:empty {
            display: none;
        }

        /* Layer name: bottom-up vertical text on the card's left side. */
        .vertical-opacity-layer {
            display: block;
            max-height: 100%;
            overflow: hidden;
            color: rgba(245,240,235,0.88);
            font: 600 0.56rem/1.2 'Outfit', sans-serif;
            letter-spacing: 0.04em;
            text-shadow: 0 1px 3px rgba(0,0,0,0.55);
            white-space: nowrap;
            writing-mode: vertical-rl;
            transform: rotate(180deg);
        }

        .vertical-opacity-layer:empty {
            display: none;
        }

        .vertical-opacity-slider-wrap {
            position: relative;
            grid-column: 2;
            grid-row: 1;
            align-self: stretch;
            width: 16px;
            min-height: 120px;
        }

        /* The range remains logically horizontal and is rotated. This keeps
           vertical touch dragging reliable in Chromium PWAs and iOS Safari:
           minimum is at the bottom, maximum at the top. */
        .vertical-opacity-slider {
            -webkit-appearance: none;
            appearance: none;
            position: absolute;
            top: 50%;
            left: 50%;
            width: 140px;
            height: var(--slider-track-h);
            margin: 0;
            padding: 0;
            border: 0;
            border-radius: 999px;
            background: linear-gradient(
                90deg,
                var(--slider-fill) 0%,
                var(--slider-fill) var(--slider-pct, 0%),
                var(--slider-track-bg) var(--slider-pct, 0%),
                var(--slider-track-bg) 100%
            );
            accent-color: rgba(244, 176, 128, 0.82);
            outline: none;
            cursor: pointer;
            touch-action: none;
            transform: translate(-50%, -50%) rotate(-90deg);
            transform-origin: center;
        }

        .vertical-opacity-slider:focus-visible {
            box-shadow: 0 0 0 2px var(--slider-fill-soft);
        }

        .vertical-opacity-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: var(--slider-v-thumb-size);
            height: var(--slider-v-thumb-size);
            border-radius: 50%;
            background: var(--slider-thumb-bg);
            border: 1px solid var(--slider-thumb-border);
            box-shadow: var(--slider-thumb-shadow);
            cursor: grab;
            transition: background 0.15s ease, transform 0.15s ease;
        }

        .vertical-opacity-slider::-webkit-slider-thumb:hover {
            background: var(--slider-thumb-bg-hover);
            transform: scale(1.08);
        }

        .vertical-opacity-slider:active::-webkit-slider-thumb {
            cursor: grabbing;
            background: var(--slider-thumb-bg-hover);
            transform: scale(1.1);
        }

        .vertical-opacity-slider::-moz-range-thumb {
            width: var(--slider-v-thumb-size);
            height: var(--slider-v-thumb-size);
            border-radius: 50%;
            background: var(--slider-thumb-bg);
            border: 1px solid var(--slider-thumb-border);
            box-shadow: var(--slider-thumb-shadow);
            cursor: grab;
        }

        .vertical-opacity-slider::-moz-range-track {
            height: var(--slider-track-h);
            border: 0;
            border-radius: 999px;
            background: var(--slider-track-bg);
        }

        .vertical-opacity-slider::-moz-range-progress {
            height: var(--slider-track-h);
            border-radius: 999px;
            background: var(--slider-fill);
        }

        .vertical-opacity-value {
            grid-column: 1 / -1;
            grid-row: 2;
            min-width: 0;
            max-width: 100%;
            padding: 1px 3px;
            color: var(--slider-value-color);
            background: rgba(242, 170, 121, 0.10);
            border: 1px solid rgba(242, 170, 121, 0.22);
            border-radius: 6px;
            font: 600 0.56rem/1.2 'Outfit', sans-serif;
            font-variant-numeric: tabular-nums;
            text-align: center;
            white-space: nowrap;
        }

        /* ── PERCENTAGE ONLY WHILE CHANGING ──
           The opacity mirror's value chip stays hidden until the user actually
           changes the opacity (drag / keyboard / the panel slider), then fades
           away shortly after the last change. js/vertical-opacity-control.js
           toggles the .visible class. Distance and ISTORIC mirrors keep their
           chips permanently visible (they are not percentages). */
        .vertical-opacity-control[data-kind="opacity"] .vertical-opacity-value {
            opacity: 0;
            visibility: hidden;
            transform: translateY(3px);
            transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
        }

        .vertical-opacity-control[data-kind="opacity"] .vertical-opacity-value.visible {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
            transition-delay: 0s;
        }

        /* Period mirrors (e.g. Battles) keep the same compact container as
           every opacity slider. Their century is an on-hover bubble anchored
           to the vertical thumb, matching the horizontal panel slider. */
        .vertical-opacity-control[data-kind="period"] .vertical-opacity-value {
            position: absolute;
            right: calc(100% + 7px);
            z-index: 2;
            width: max-content;
            max-width: 110px;
            min-width: 0;
            padding: 4px 7px;
            border-color: var(--ctl-border-hover);
            border-radius: 8px;
            background: var(--ctl-bg-hover);
            -webkit-backdrop-filter: var(--ctl-blur);
            backdrop-filter: var(--ctl-blur);
            box-shadow: var(--ctl-shadow);
            font-size: 0.62rem;
            line-height: 1.3;
            white-space: nowrap;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transform: translateY(-50%) translateX(3px);
            transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s linear 0.12s;
        }

        .vertical-opacity-control[data-kind="period"] .vertical-opacity-value::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 100%;
            border: 5px solid transparent;
            border-left-color: var(--ctl-bg-hover);
            transform: translateY(-50%);
        }

        .vertical-opacity-control[data-kind="period"] .vertical-opacity-value.visible {
            opacity: 1;
            visibility: visible;
            transform: translateY(-50%) translateX(0);
            transition-delay: 0s;
        }

        /* ── OGLINDA DE DISTANȚĂ / RAZĂ ──
           Aceeași geometrie și același stil pastel-portocaliu semitransparent
           ca la restul sliderelor (atât în fereastra de straturi, cât și în
           oglinda verticală de pe hartă), păstrând variabilele stratului doar
           pentru reperele auxiliare care le citesc. */
        #lidarScannerRow,
        .vertical-opacity-control[data-owner="lidarScannerDistance"] {
            --dl-layer-colour: #8cff66;
            --dl-layer-strong: #39ff14;
            --dl-layer-soft: rgba(57, 255, 20, 0.14);
            --dl-layer-edge: rgba(140, 255, 102, 0.46);
        }

        #archeoPotentialRow,
        .vertical-opacity-control[data-owner="archeoPotDistance"] {
            --dl-layer-colour: #a070e8;
            --dl-layer-strong: #c4a0f0;
            --dl-layer-soft: rgba(123, 63, 212, 0.18);
            --dl-layer-edge: rgba(163, 112, 232, 0.5);
        }

        #archReportRow,
        .vertical-opacity-control[data-owner="archReportDistance"] {
            --dl-layer-colour: #66c8ff;
            --dl-layer-strong: #29b6f6;
            --dl-layer-soft: rgba(41, 182, 246, 0.15);
            --dl-layer-edge: rgba(102, 200, 255, 0.46);
        }

        .vertical-opacity-control[data-kind="distance"] .vertical-opacity-value {
            min-width: 0;
            padding: 1px 3px;
            color: var(--slider-value-color);
            background: rgba(242, 170, 121, 0.10);
            border-color: rgba(242, 170, 121, 0.22);
        }

        /* ── SATELLITE „ISTORIC” PAIR ──
           Selecting the Satellite layer (either its opacity slider or the
           „Istoric” period slider) shows BOTH vertical mirrors at the same
           time: the opacity one keeps its usual anchor, the period one sits
           immediately to its left. Only four discrete stops
           (2012 / 2018 / 2021 / 2025), so the value chip stays permanently
           visible.

           Two classes (0,2,0) keep this offset in control of any single-class
           rule; the mobile block below re-states the narrower geometry with
           the same specificity. */
        .vertical-opacity-control.vertical-period-control {
            right: calc(38px + 38px + 12px + env(safe-area-inset-right, 0px));
        }

        .vertical-opacity-control.vertical-opacity-secondary {
            right: calc(38px + 38px + 12px + env(safe-area-inset-right, 0px));
        }

        /* ── O SINGURĂ OGLINDĂ = CEA MAI DIN DREAPTA POZIȚIE ── */
        .vertical-opacity-control.mirror-sole {
            right: calc(38px + env(safe-area-inset-right, 0px));
        }

        .vertical-opacity-control[data-kind="satperiod"] .vertical-opacity-value {
            font-size: 0.54rem;
            letter-spacing: 0.01em;
        }

        /* Four stop dots on the vertical period track: 2012 at the bottom of
           the travel, then 2018 and 2021, with 2025 at the top. */
        .vertical-period-control .vertical-opacity-slider-wrap::after {
            content: '';
            position: absolute;
            left: 50%;
            top: 50%;
            width: 5px;
            height: 141px;
            transform: translate(-50%, -50%);
            background-image:
                radial-gradient(circle at 50% 50%, rgba(255,228,206,0.85) 1.3px, transparent 1.9px),
                radial-gradient(circle at 50% 50%, rgba(255,228,206,0.85) 1.3px, transparent 1.9px),
                radial-gradient(circle at 50% 50%, rgba(255,228,206,0.85) 1.3px, transparent 1.9px),
                radial-gradient(circle at 50% 50%, rgba(255,228,206,0.85) 1.3px, transparent 1.9px);
            background-size: 5px 5px;
            background-position: 50% 0, 50% 33.333%, 50% 66.667%, 50% 100%;
            background-repeat: no-repeat;
            pointer-events: none;
            z-index: 1;
        }

        /* Panel „Istoric” slider: same pastel-orange look as every .transp-slider,
           plus four stop markers aligned with the 2012 / 2018 / 2021 / 2025 ticks.
           The 6px inset matches half the 12px thumb width. */
        input.transp-slider.sat-period-slider {
            background:
                radial-gradient(circle at 6px 50%, rgba(255,228,206,0.9) 1.5px, transparent 2.1px),
                radial-gradient(circle at calc(6px + (100% - 12px) / 3) 50%, rgba(255,228,206,0.9) 1.5px, transparent 2.1px),
                radial-gradient(circle at calc(6px + (100% - 12px) * 2 / 3) 50%, rgba(255,228,206,0.9) 1.5px, transparent 2.1px),
                radial-gradient(circle at calc(100% - 6px) 50%, rgba(255,228,206,0.9) 1.5px, transparent 2.1px),
                linear-gradient(
                    90deg,
                    var(--slider-fill) 0%,
                    var(--slider-fill) var(--slider-pct, 0%),
                    var(--slider-track-bg) var(--slider-pct, 0%),
                    var(--slider-track-bg) 100%
                );
        }

        .sat-period-ticks {
            display: flex;
            justify-content: space-between;
            margin-top: 4px;
            color: rgba(245,240,235,0.48);
            font: 500 0.6rem/1 'Outfit', sans-serif;
            letter-spacing: 0.02em;
        }

        .sat-period-ticks span {
            transition: color 0.15s ease;
        }

        .sat-period-ticks span.active {
            color: var(--slider-value-color);
            font-weight: 700;
        }

        /* Cursor/focus/selection feedback makes both top-level cards and the
           nested historical/LIDAR entries visibly clickable. */
        #transpPanel .opacity-layer-selectable {
            cursor: pointer;
            border-radius: 8px;
        }

        #transpPanel .opacity-layer-selectable:focus-visible {
            outline: 2px solid rgba(246,186,142,0.7);
            outline-offset: 3px;
        }

        #transpPanel .opacity-layer-selectable.opacity-layer-selected {
            box-shadow: 0 0 0 1px rgba(242,170,121,0.52), var(--ctl-shadow);
        }

        /* A mirrored layer stays recognisable in the panel and is marked only
           by a slightly lighter shade than a resting row (the old "PE HARTĂ"
           badge under the slider is gone). */
        #transpPanel .opacity-layer-selectable.opacity-layer-mirrored {
            background-color: rgba(45, 33, 74, 0.56);
            border-color: var(--ctl-border-hover);
            transition: background-color 0.2s ease, border-color 0.2s ease,
                box-shadow 0.2s ease;
        }

        @media (prefers-reduced-motion: reduce) {
            #transpPanel .opacity-layer-selectable.opacity-layer-mirrored {
                transition: none;
            }
        }

        /* The control belongs to map-frame, so it naturally fills the PWA map
           and remains anchored in normal and browser fullscreen modes. */
        .map-frame.is-fullscreen .vertical-opacity-control {
            position: fixed;
            z-index: 10001;
        }

        body.is-pwa .vertical-opacity-control {
            top: calc(50% - var(--pwa-bottom-controls-half-clearance, 22px));
            /* Keep a real title column in the standalone app. */
            grid-template-columns: 12px 1fr;
        }

        /* PWA title fallback: render the initials as a rotated, explicit-size
           label instead of relying on vertical-writing grid measurement.
           NOTE: this wrapper is positioned, so it must contain ONLY the layer
           initials — the caption chip (.vertical-opacity-caption) is a sibling
           of the wrapper, anchored to the card. */
        body.is-pwa .vertical-opacity-title {
            position: absolute;
            left: 2px;
            top: 50%;
            width: 12px;
            height: calc(100% - 42px);
            max-height: none;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: visible;
            transform: translateY(-50%);
            z-index: 3;
        }

        body.is-pwa .vertical-opacity-layer {
            position: absolute;
            left: 50%;
            top: 50%;
            display: block;
            width: max-content;
            max-height: none;
            overflow: visible;
            writing-mode: horizontal-tb;
            transform: translate(-50%, -50%) rotate(-90deg);
            transform-origin: center;
            white-space: nowrap;
            visibility: visible;
            opacity: 1;
        }

        .vertical-opacity-control.auth-hidden {
            opacity: 0 !important;
            visibility: hidden !important;
            pointer-events: none !important;
        }

        @media (max-width: 600px) {
            .vertical-opacity-control {
                right: calc(34px + env(safe-area-inset-right, 0px));
                width: 36px;
                height: 224px;
                padding-left: 3px;
                padding-right: 3px;
            }

            /* Phones / installed PWA: the mirror is 36px wide here, so the
               Satellite pair and secondary mirror re-derive their left anchor
               from THIS width instead of keeping the desktop 38px. */
            .vertical-opacity-control.vertical-period-control {
                right: calc(34px + 36px + 12px + env(safe-area-inset-right, 0px));
            }

            .vertical-opacity-control.vertical-opacity-secondary {
                right: calc(34px + 36px + 12px + env(safe-area-inset-right, 0px));
            }

            .vertical-opacity-control.mirror-sole {
                right: calc(34px + env(safe-area-inset-right, 0px));
            }

            .vertical-opacity-slider {
                width: 120px;
            }

            .vertical-period-control .vertical-opacity-slider-wrap::after {
                height: 121px;
            }

            .vertical-opacity-layer {
                font-size: 0.52rem;
            }

            .vertical-opacity-value {
                padding: 1px 2px;
                font-size: 0.52rem;
            }
        }

        @media (max-height: 500px) {
            .vertical-opacity-control {
                height: 196px;
                z-index: 1001;
            }

            .vertical-opacity-caption:not(:empty) {
                display: block !important;
                bottom: calc(100% + 4px);
                z-index: 3;
            }

            .vertical-opacity-layer {
                font-size: 0.48rem;
            }

            .vertical-opacity-slider {
                width: 96px;
            }

            .vertical-period-control .vertical-opacity-slider-wrap::after {
                height: 97px;
            }
        }

        @media (max-height: 360px) {
            .vertical-opacity-control {
                height: 168px;
            }

            .vertical-opacity-slider {
                width: 74px;
            }

            .vertical-period-control .vertical-opacity-slider-wrap::after {
                height: 75px;
            }

            .vertical-opacity-layer {
                font-size: 0.44rem;
                letter-spacing: 0.02em;
            }
        }

        /* ── VERTICAL OPACITY: LAYER QUICK ACTIONS ──
           Butonul „Ajutor de căutare” (APM 2.0) și cele trei butoane Iosefină
           Premium (căutare clădiri dispărute / setări / sugerează) sunt mutate
           de js/vertical-opacity-control.js în slotul de acțiuni al oglinzii
           selectate (.vertical-opacity-actions — containerul există în AMBELE
           oglinzi: #verticalOpacityActions și #verticalOpacityActionsSecondary)
           și apar ca iconițe circulare, dispuse vertical sub slider — vizibile
           doar cât timp stratul lor e selectat în oglinda verticală. Eticheta
           fiecărui buton e ascunsă vizual și devine bula de informații la
           hover / focus / tap (clasa .show-tip e adăugată de JS pe touch). */
        .vertical-opacity-actions {
            position: absolute;
            top: calc(100% + 10px);
            left: 50%;
            transform: translateX(-50%);
            z-index: 2;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            pointer-events: none;
        }
        .vertical-opacity-actions:empty {
            display: none;
        }

        /* ── DOCK DE ACȚIUNE CENTRAT JOS (straturile de analiză) ──
           Când un strat de analiză e apăsat — LIDAR Scanner, Zone cu potențial
           arheologic sau Raport arheologic — sliderul său de distanță/rază e
           oglindit vertical în dreapta (exact ca opacitatea), iar butonul de
           acțiune (Scan / Detectează / Generează raport) e mutat fizic aici,
           centrat în partea de jos a ecranului principal. Mutarea fizică (nu o
           clonă) păstrează id-ul, listener-ele, starea disabled și spinner-ul
           butonului original; js/vertical-opacity-control.js îl duce înapoi în
           rândul din panou când oglinda se închide. */
        .layer-action-dock {
            position: absolute;
            left: 50%;
            bottom: calc(18px + env(safe-area-inset-bottom, 0px));
            z-index: 1000;
            display: flex;
            justify-content: center;
            transform: translateX(-50%) translateY(10px) scale(0.97);
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
        }

        .layer-action-dock.visible {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
            transform: translateX(-50%) translateY(0) scale(1);
            transition-delay: 0s;
        }

        .layer-action-dock-inner {
            display: flex;
            align-items: center;
            gap: 8px;
            max-width: min(92vw, 420px);
            padding: 7px 9px;
            background:
                radial-gradient(circle at 50% 0%, rgba(107,63,160,0.24), transparent 52%),
                linear-gradient(180deg, rgba(10,25,48,0.94), rgba(6,14,30,0.96));
            border: 1px solid rgba(184,216,240,0.28);
            border-radius: 14px;
            box-shadow: 0 9px 30px rgba(0,0,0,0.48), inset 0 1px 0 rgba(255,255,255,0.05);
            -webkit-backdrop-filter: blur(14px);
            backdrop-filter: blur(14px);
        }

        .layer-action-dock-inner:empty {
            display: none;
        }

        .layer-action-dock-inner > button[style*="display: none"],
        .layer-action-dock-inner > button[style*="display:none"],
        .layer-action-dock-inner > button.is-hidden {
            display: none !important;
        }

        #lidarScannerRun.is-hidden,
        #lidarScannerRun[style*="display: none"],
        #lidarScannerRun[style*="display:none"] {
            display: none !important;
        }

        #archeoPotRunBtn.is-hidden,
        #archeoPotRunBtn[style*="display: none"],
        #archeoPotRunBtn[style*="display:none"] {
            display: none !important;
        }

        #archReportRunBtn.is-hidden,
        #archReportRunBtn[style*="display: none"],
        #archReportRunBtn[style*="display:none"] {
            display: none !important;
        }

        /* Butonul mutat în dock pierde lățimea de 100% din rândul panoului și
           păstrează doar identitatea vizuală a stratului (verde LIDAR / mov
           potențial / albastru raport). */
        .layer-action-dock-inner > button {
            width: auto;
            margin: 0;
            padding: 9px 16px;
            display: inline-flex;
            align-items: center;
            gap: 7px;
            white-space: nowrap;
            font: 600 0.8rem/1 'Outfit', sans-serif;
            border-radius: 9px;
            cursor: pointer;
        }

        .layer-action-dock-inner > button:disabled {
            opacity: 0.5;
            cursor: wait;
        }

        .layer-action-dock-inner > #lidarScannerRun {
            border-color: rgba(140,255,102,0.55);
            background: linear-gradient(135deg, rgba(57,255,20,0.22), rgba(20,90,35,0.2));
            color: #d9ffd0;
        }

        .layer-action-dock-inner > #archeoPotRunBtn {
            border-color: rgba(163,112,232,0.55);
            background: linear-gradient(135deg, rgba(107,63,160,0.42), rgba(74,40,128,0.28));
            color: rgba(245,240,235,0.95);
        }

        .layer-action-dock-inner > #archReportRunBtn {
            border-color: rgba(102,200,255,0.55);
            background: linear-gradient(135deg, rgba(41,182,246,0.28), rgba(12,54,84,0.24));
            color: #d6f0ff;
        }

        /* Eticheta scurtă a razei, în stânga butonului din dock — aceeași
           valoare ca în oglinda verticală și ca în rândul din panou. */
        .layer-action-dock-radius {
            padding: 4px 8px;
            color: var(--sky);
            background: rgba(184,216,240,0.09);
            border: 1px solid rgba(184,216,240,0.18);
            border-radius: 7px;
            font: 700 0.72rem/1.2 'Cinzel', serif;
            white-space: nowrap;
        }

        /* Dock-ul vizibil ridică stack-ul de controale plutitoare centrate jos
           (ajutor APM20, hint-uri de zoom) ca să nu se suprapună peste butonul
           andocat. Fiecare element își păstrează offset-ul propriu; variabila e
           0px în mod normal și e comutată de body.layer-dock-open. */
        body.layer-dock-open {
            --layer-dock-clearance: 62px;
        }

        /* Hook scris de vertical-opacity-control.js cât timp butonul e andocat:
           îl ridică vizual deasupra hărții (umbră + țintă de tap mai mare). */
        .layer-action-dock-inner > button.la-docked {
            min-height: 38px;
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.07);
        }

        @media (max-width: 600px) {
            .layer-action-dock {
                bottom: calc(14px + env(safe-area-inset-bottom, 0px));
            }
            .layer-action-dock-inner {
                max-width: 94vw;
                padding: 6px 7px;
            }
            .layer-action-dock-inner > button {
                padding: 8px 12px;
                font-size: 0.75rem;
            }
        }

        body.is-pwa .layer-action-dock {
            bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        }

        /* Butoane identice cu celelalte iconițe de pe hartă (zoom / locație /
           măsură / offline): pătrat 38×38 din același material de sticlă
           (--ctl-*), glif violet, fără culori per strat.
           Suprascriu poziționarea absolută bottom-center a variantelor
           flotante de pe hartă. Selectorul e pe CLASA containerului, nu pe
           id-ul primei oglinzi: aceleași butoane ajung și în oglinda secundară
           (#verticalOpacityActionsSecondary), iar un selector „#verticalOpacityActions …”
           nu le mai prindea acolo — rămâneau cu position:absolute / bottom:76px /
           left:50% / translateX(±112px) din regulile de bază, deci ieșeau din
           coloana flex și se suprapuneau orizontal, descentrat, în stânga
           sliderului. Clasa acoperă ambele sloturi, deci butoanele stau sub
           slider în oglinda în care a fost selectat stratul. */
        .vertical-opacity-actions #apm20SearchHelpBtn,
        .vertical-opacity-actions #iosBldSearchHelpBtn,
        .vertical-opacity-actions #iosBldSettingsBtn,
        .vertical-opacity-actions #iosBldSuggestBtn {
            position: relative !important;
            bottom: auto !important;
            left: auto !important;
            transform: none !important;
            width: 38px !important;
            height: 38px !important;
            min-width: 38px;
            min-height: 38px;
            padding: 0 !important;
            margin: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            pointer-events: auto;
            background: var(--ctl-bg) !important;
            border: 1px solid var(--ctl-border) !important;
            border-radius: var(--ctl-radius) !important;
            color: var(--ctl-icon);
            box-shadow: var(--ctl-shadow);
            -webkit-backdrop-filter: var(--ctl-blur);
            backdrop-filter: var(--ctl-blur);
            cursor: pointer;
            transition: background-color .18s ease, border-color .18s ease,
                        color .18s ease, box-shadow .18s ease;
            white-space: normal;
            letter-spacing: 0;
        }
        /* PWA (aplicația instalată): index.html ridică variantele FLOTANTE ale
           acelorași butoane deasupra indicatorului de acasă cu
           `body.is-pwa #apm20SearchHelpBtn { bottom: calc(36px + …) !important }`
           (Iosefină Premium: `76px + …`). Acel selector are specificitatea
           (1,1,1) și, fiind și el !important, bate `bottom: auto !important`
           de mai sus (1,1,0). Pe un buton deja `position: relative` un
           `bottom` de ~80px / ~120px îl împinge ÎN SUS cu atât — adică peste
           sliderul de care e andocat — în loc să stea în coloana de sub el.
           Aceeași clasă de pe body în selector (1,2,1) readuce geometria
           andocată în PWA; pe site regula nu se potrivește cu nimic. Sunt
           re-afirmate toate cele patru proprietăți de geometrie flotantă, ca
           o viitoare ridicare PWA pe `left` / `transform` să nu redeschidă
           același defect. */
        body.is-pwa .vertical-opacity-actions #apm20SearchHelpBtn,
        body.is-pwa .vertical-opacity-actions #iosBldSearchHelpBtn,
        body.is-pwa .vertical-opacity-actions #iosBldSettingsBtn,
        body.is-pwa .vertical-opacity-actions #iosBldSuggestBtn {
            position: relative !important;
            bottom: auto !important;
            left: auto !important;
            transform: none !important;
        }
        .vertical-opacity-actions #apm20SearchHelpBtn:hover,
        .vertical-opacity-actions #iosBldSearchHelpBtn:hover,
        .vertical-opacity-actions #iosBldSettingsBtn:hover,
        .vertical-opacity-actions #iosBldSuggestBtn:hover {
            background: var(--ctl-bg-hover) !important;
            border-color: var(--ctl-border-hover) !important;
            color: var(--ctl-icon-hover);
            box-shadow: var(--ctl-shadow-hover);
        }
        .vertical-opacity-actions #iosBldSuggestBtn.active,
        .vertical-opacity-actions #iosBldSuggestBtn.active:hover {
            background: var(--ctl-bg-engaged) !important;
            border-color: var(--ctl-border-engaged) !important;
            color: var(--ctl-icon-engaged);
        }
        .vertical-opacity-actions #apm20SearchHelpBtn svg,
        .vertical-opacity-actions #iosBldSearchHelpBtn svg,
        .vertical-opacity-actions #iosBldSettingsBtn svg,
        .vertical-opacity-actions #iosBldSuggestBtn svg {
            flex-shrink: 0;
            width: 17px;
            height: 17px;
        }

        /* Eticheta devine bulă de informații în stânga iconiței — vizibilă doar
           la hover (desktop), focus tastatură, stare activă sau tap (mobil). */
        .vertical-opacity-actions .vo-action-tip {
            position: absolute;
            right: calc(100% + 9px);
            top: 50%;
            transform: translateY(-50%) translateX(5px);
            z-index: 3;
            max-width: 210px;
            padding: 6px 11px;
            background: rgba(8, 20, 41, 0.97);
            border: 1px solid rgba(184, 216, 240, 0.3);
            border-radius: 8px;
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
            color: #F5F0EB;
            font-family: 'Outfit', sans-serif;
            font-size: 0.72rem;
            font-weight: 600;
            letter-spacing: 0.02em;
            text-transform: none;
            line-height: 1.35;
            white-space: nowrap;
            pointer-events: none;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
        }
        .vertical-opacity-actions .vo-action-tip::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 100%;
            border: 5px solid transparent;
            border-left-color: rgba(8, 20, 41, 0.97);
            transform: translateY(-50%);
        }
        .vertical-opacity-actions button:hover .vo-action-tip,
        .vertical-opacity-actions button:focus-visible .vo-action-tip,
        .vertical-opacity-actions button:active .vo-action-tip,
        .vertical-opacity-actions button.show-tip .vo-action-tip,
        .vertical-opacity-actions button:disabled .vo-action-tip {
            opacity: 1;
            visibility: visible;
            transform: translateY(-50%) translateX(0);
            transition-delay: 0s;
        }
        .vertical-opacity-actions button:focus-visible {
            outline: 2px solid rgba(184, 216, 240, 0.75);
            outline-offset: 2px;
        }

        /* Zoom insuficient: iconița rămâne vizibilă, estompată, iar bula arată
           mesajul de zoom (textul etichetei e comutat de JS pe hint-ul de zoom).
           Click-ul declanșează toast-ul explicativ din run*SearchHelp. */
        .vertical-opacity-actions button.needs-zoom {
            opacity: 0.55;
            cursor: pointer;
        }
        /* Stare de încărcare: iconița pulsează, bula cu „Se analizează…” rămâne vizibilă. */
        .vertical-opacity-actions button:disabled {
            cursor: wait;
        }
        .vertical-opacity-actions button:disabled svg {
            animation: vo-action-pulse 1.1s ease-in-out infinite;
        }
        @keyframes vo-action-pulse {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.55; transform: scale(0.88); }
        }

        /* Panoul „Setări detecție” se ancorează în stânga sliderului vertical cât
           timp stratul Josephine Map + e selectat (clasa e pusă de JS pe body),
           în loc să plutească bottom-center departe de butonul care l-a deschis. */
        body.vo-josephine-docked #iosBldSettingsPanel {
            bottom: auto;
            top: 50%;
            left: auto;
            right: calc(38px + 38px + 12px + env(safe-area-inset-right, 0px));
            transform: translateY(-50%);
        }
        /* Oglinda Josephine poate sta și în al doilea slot (la 38px + 12px spre
           stânga de primul): ancora panoului urmărește oglinda, ca panoul să
           rămână în stânga sliderului care i-a deschis iconițele, nu peste el.
           Două clase pe body (0,3,0) bat regula de mai sus (0,2,0). */
        body.vo-josephine-docked.vo-josephine-docked-secondary #iosBldSettingsPanel {
            right: calc(38px + 38px + 12px + 38px + 12px + env(safe-area-inset-right, 0px));
        }
        body.is-pwa.vo-josephine-docked #iosBldSettingsPanel {
            top: calc(50% - var(--pwa-bottom-controls-half-clearance, 22px));
            bottom: auto !important;
        }
        body.vo-josephine-docked .map-frame.is-fullscreen #iosBldSettingsPanel {
            position: fixed;
            top: 50%;
            bottom: auto;
        }

        @media (max-width: 600px) {
            /* Aceeași dimensiune 38px ca restul iconițelor de pe hartă (care nu
               se micșorează pe mobil); doar bula de informații se îngustează. */
            .vertical-opacity-actions .vo-action-tip {
                max-width: 160px;
                white-space: normal;
                text-align: right;
            }
            body.vo-josephine-docked #iosBldSettingsPanel {
                right: calc(34px + 36px + 10px + env(safe-area-inset-right, 0px));
                width: min(280px, calc(100vw - 130px));
            }
            body.vo-josephine-docked.vo-josephine-docked-secondary #iosBldSettingsPanel {
                right: calc(34px + 36px + 10px + 36px + 10px + env(safe-area-inset-right, 0px));
                /* Aceeași margine stângă de 50px ca la ancora primară
                   (100vw − 130px = 80px dreapta + 50px stânga): ancora secundară
                   e cu un pas de oglindă (36 + 10) mai la stânga, deci lățimea
                   scade cu tot atât. */
                width: min(280px, calc(100vw - 176px));
            }
        }

        @media (max-height: 500px) {
            .vertical-opacity-actions {
                top: calc(100% + 8px);
                gap: 6px;
            }
            .vertical-opacity-actions #apm20SearchHelpBtn,
            .vertical-opacity-actions #iosBldSearchHelpBtn,
            .vertical-opacity-actions #iosBldSettingsBtn,
            .vertical-opacity-actions #iosBldSuggestBtn {
                width: 34px !important;
                height: 34px !important;
                min-width: 34px;
                min-height: 34px;
            }
        }

        @media (prefers-reduced-motion: reduce) {
            .vertical-opacity-control {
                transition: none;
            }
            .vertical-opacity-close {
                transition: none;
            }
            .vertical-opacity-close:hover,
            .vertical-opacity-close:focus-visible {
                transform: none;
            }
            .vertical-opacity-actions .vo-action-tip {
                transition: none;
            }
            .vertical-opacity-actions button:disabled svg {
                animation: none;
            }
        }

        .transp-divider {
            height: 0;
            margin: 8px 0;
        }

        /* ── Zone cu potențial arheologic (premium) — pin mov (logica de punct
              e permanentă, fără switch separat), rază 1–10 km, moduri de
              afișare bule / heatmap ── */
        .archeo-potential-row { border-color: rgba(163,112,232,0.20); }
        .archeo-potential-row.is-on { box-shadow: 0 0 22px rgba(123,63,212,0.14), inset 0 0 18px rgba(123,63,212,0.05); }
        .archeo-pot-control { display:flex; justify-content:space-between; align-items:center; font-size:.7rem; color:rgba(245,240,235,.6); margin:8px 0 6px; }
        .archeo-pot-control strong { color:#c4a0f0; font-family:'Cinzel',serif; font-size:.74rem; }
        .archeo-pot-mode { display:flex; align-items:center; gap:8px; margin:11px 0 2px; }
        .archeo-pot-mode-label { font-size:.66rem; letter-spacing:.08em; text-transform:uppercase; color:rgba(245,240,235,.45); }
        .archeo-pot-mode-btns { display:flex; gap:6px; margin-left:auto; }
        .archeo-pot-mode-btn {
            display:inline-flex; align-items:center; gap:5px;
            padding:4px 9px; border:1px solid rgba(163,112,232,.35); border-radius:999px;
            background:rgba(123,63,212,.12); color:rgba(245,240,235,.72);
            font:600 .68rem/1.3 'Outfit',sans-serif; cursor:pointer;
            transition:background .15s,border-color .15s,color .15s,box-shadow .15s;
        }
        .archeo-pot-mode-btn:hover { background:rgba(123,63,212,.26); color:#f0e8fb; }
        .archeo-pot-mode-btn.is-active {
            background:rgba(123,63,212,.46); border-color:#c4a0f0; color:#fff;
            box-shadow:0 0 10px rgba(123,63,212,.35);
        }
        .archeo-pot-legend { margin-top:9px; }
        .archeo-pot-legend-heat { display:flex; flex-direction:column; gap:6px; }
        .archeo-pot-legend-item { display:flex; align-items:center; gap:6px; font-size:.68rem; color:rgba(245,240,235,.7); }
        .archeo-pot-heatbar {
            width:96px; height:9px; border-radius:5px; flex-shrink:0;
            border:1px solid rgba(184,216,240,.22);
            /* Aceeași rampă ca HEAT_GRADIENT din js/archeo-potential.js, cu
               opririle aliniate pe pragurile de clasificare: 25% = trecerea
               Low → Medium, 55% = trecerea Medium → High. Scala e ABSOLUTĂ
               (culoarea = scorul celulei), deci legenda e valabilă pentru
               orice rulare și pentru ambele moduri (bule / heatmap). Roșul e
               rezervat zonelor excluse (intravilan UAT / rază patrimoniu). */
            background:linear-gradient(90deg,#10233f 0%,#1f7fc4 25%,#23c48e 55%,#f2b134 75%,#8b3ff0 100%);
        }
        /* Bulele legendei: culoarea e pictată din JS (syncLegend) cu exact
           culoarea rampei pentru scorul de referință al treptei. */
        .archeo-pot-dot {
            width:11px; height:11px; border-radius:50%; flex-shrink:0; display:inline-block;
            background:#1f7fc4; box-shadow:0 0 0 1px rgba(16,6,28,.65);
        }
        .archeo-pot-band { font-size:.6rem; color:rgba(245,240,235,.45); font-variant-numeric:tabular-nums; }
        .archeo-pot-legend-scale { flex-wrap:wrap; gap:9px; }
        .archeo-pot-chip {
            display:inline-flex; align-items:center; gap:4px;
            font-size:.64rem; color:rgba(245,240,235,.62);
        }
        .archeo-pot-chip i {
            width:9px; height:9px; border-radius:2px; flex-shrink:0;
            display:inline-block; background:#1f7fc4;
        }
        .archeo-pot-heatlabels {
            display:flex; justify-content:space-between; gap:6px;
            min-width:96px; font-size:.62rem; letter-spacing:.04em;
            color:rgba(245,240,235,.55);
        }
        .archeo-pot-heatlabels span:last-child { color:#c4a0f0; font-weight:600; }
        .archeo-pot-swatch { width:11px; height:11px; border-radius:3px; flex-shrink:0; display:inline-block; }
        .archeo-pot-swatch-red { background:rgba(224,60,60,.75); border:1px solid #ff6b6b; }

        /* Pinul mov al stratului (aceeași anatomie ca pinul albastru al
           Raportului arheologic: halou pulsant + punct central). */
        .archeo-pot-pin-wrapper { background:none; border:none; }
        .archeo-pot-pin { position:relative; width:26px; height:26px; }
        .archeo-pot-pin-dot {
            position:absolute; left:9px; top:9px; width:8px; height:8px; border-radius:50%;
            background:#c4a0f0; box-shadow:0 0 0 2px rgba(16,6,28,.85), 0 0 12px rgba(160,112,232,.95);
        }
        .archeo-pot-pin-pulse {
            position:absolute; inset:0; border-radius:50%;
            border:2px solid rgba(196,160,240,.78); animation:archeoPotPinPulse 1.8s ease-out infinite;
        }
        @keyframes archeoPotPinPulse { 0%{transform:scale(.35);opacity:.95} 100%{transform:scale(1.15);opacity:0} }
        .archeo-pot-tooltip {
            background:rgba(14,6,26,.94); border:1px solid rgba(196,160,240,.85);
            border-radius:5px; box-shadow:0 0 12px rgba(123,63,212,.4);
            color:#e9dcfb; padding:4px 7px;
        }
        .archeo-pot-tooltip:before { border-top-color:rgba(196,160,240,.85); }
        .archeo-pot-tag { display:block; font:.68rem/1.25 'Outfit',sans-serif; white-space:nowrap; }
        .archeo-pot-tag b { color:#c4a0f0; font-weight:700; }

        /* Country LiDAR opacity controls share the unified slim pastel-orange
           slider look declared with .transp-slider above; their rows inside
           #lidarSubLayers receive .dl-sublayer-row from js/layer-panel-rows.js. */
        .lidar-country-row { padding: 7px 9px 8px; }
        .lidar-country-select {
            width: 100%;
            box-sizing: border-box;
            padding: 5px 7px;
            border: 1px solid rgba(79,195,247,0.25);
            border-radius: 5px;
            background: rgba(6,14,30,0.7);
            color: rgba(245,240,235,0.82);
            font: 0.7rem 'Outfit', sans-serif;
        }
        .lidar-country-select:focus { outline: 1px solid rgba(79,195,247,0.8); }

        /* ── LIDAR Scanner ── */
        .lidar-scanner-row { border-color: rgba(140,255,102,0.18); }
        .lidar-scanner-row.is-on { box-shadow: 0 0 22px rgba(57,255,20,0.10), inset 0 0 18px rgba(57,255,20,0.035); }
        .lidar-scanner-copy { margin: 8px 0 12px; font-size: .72rem; line-height: 1.4; color: rgba(245,240,235,.72); }
        .lidar-scanner-control { display:flex; justify-content:space-between; align-items:center; font-size:.7rem; color:rgba(245,240,235,.6); margin-bottom:6px; }
        .lidar-scanner-control strong { color:#8cff66; font-family:'Cinzel',serif; font-size:.74rem; }
        .lidar-scanner-button { width:100%; margin-top:13px; padding:8px 10px; border:1px solid rgba(140,255,102,.55); border-radius:7px; background:linear-gradient(135deg,rgba(57,255,20,.22),rgba(20,90,35,.2)); color:#d9ffd0; font:600 .8rem 'Outfit',sans-serif; cursor:pointer; transition:.2s; }
        .lidar-scanner-button:hover { background:rgba(57,255,20,.35); box-shadow:0 0 16px rgba(57,255,20,.2); }
        .lidar-scanner-status { min-height:15px; margin-top:7px; color:rgba(245,240,235,.5); font-size:.68rem; line-height:1.35; }
        .lidar-result-tooltip { background:rgba(5,20,13,.94); border:1px solid rgba(140,255,102,.8); border-radius:5px; box-shadow:0 0 12px rgba(57,255,20,.35); color:#d9ffd0; padding:4px 7px; }
        .lidar-result-tooltip:before { border-top-color:rgba(140,255,102,.8); }
        .lidar-result-tag { display:block; font: .68rem/1.25 'Outfit',sans-serif; white-space:nowrap; }
        .lidar-result-tag b { color:#8cff66; font-weight:600; }
        .lidar-scanner-loading { position:absolute; inset:0; z-index:1400; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:15px; background:rgba(4,12,20,.34); backdrop-filter:blur(7px); opacity:0; visibility:hidden; pointer-events:none; transition:opacity .2s,visibility .2s; }
        .lidar-scanner-loading.visible { opacity:1; visibility:visible; }
        .lidar-scanner-loading:after { content:'SCANNING  /  SCANEAZĂ'; color:#8cff66; font:600 .72rem 'Outfit',sans-serif; letter-spacing:.18em; text-shadow:0 0 12px #39ff14; }
        .lidar-scanner-ring { width:78px; height:78px; border:2px dotted rgba(140,255,102,.9); border-radius:50%; box-shadow:0 0 0 8px rgba(57,255,20,.05),0 0 28px rgba(57,255,20,.35); animation:lidarScanPulse 1.1s ease-in-out infinite; }
        @keyframes lidarScanPulse { 0%,100%{transform:scale(.78);opacity:.45} 50%{transform:scale(1.08);opacity:1} }

        /* ── Archeological Report (premium) — "Raport arheologic" ── */
        .arch-report-row { border-color: rgba(102,200,255,0.20); }
        .arch-report-row.is-on { box-shadow: 0 0 22px rgba(41,182,246,0.12), inset 0 0 18px rgba(41,182,246,0.04); }
        .arch-report-control { display:flex; justify-content:space-between; align-items:center; font-size:.7rem; color:rgba(245,240,235,.6); margin:8px 0 6px; }
        .arch-report-control strong { color:#66c8ff; font-family:'Cinzel',serif; font-size:.74rem; }
        .arch-report-button {
            width:100%; margin-top:10px; padding:8px 10px;
            border:1px solid rgba(102,200,255,.55); border-radius:7px;
            background:linear-gradient(135deg,rgba(41,182,246,.24),rgba(10,58,120,.22));
            color:#d6f0ff; font:600 .8rem 'Outfit',sans-serif; cursor:pointer;
            display:flex; align-items:center; justify-content:center; gap:7px; transition:.2s;
        }
        .arch-report-button:hover:not(:disabled) { background:rgba(41,182,246,.36); box-shadow:0 0 16px rgba(41,182,246,.22); }
        .arch-report-button:disabled { opacity:.45; cursor:not-allowed; }
        .arch-report-button-pdf {
            border-color:rgba(196,160,240,.55);
            background:linear-gradient(135deg,rgba(107,63,160,.4),rgba(74,40,128,.28));
            color:#e9dcff;
        }
        .arch-report-button-pdf:hover:not(:disabled) { background:rgba(107,63,160,.6); box-shadow:0 0 16px rgba(123,63,212,.25); }
        .arch-report-spinner {
            width:11px; height:11px; flex-shrink:0;
            border:2px solid rgba(154,216,255,.25); border-top-color:#66c8ff;
            border-radius:50%; display:inline-block; animation:archReportSpin .8s linear infinite;
        }
        @keyframes archReportSpin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }
        .arch-report-show { display:flex; align-items:center; gap:7px; margin-top:9px; font-size:.7rem; color:rgba(245,240,235,.7); cursor:pointer; }
        .arch-report-show input { accent-color:#66c8ff; }
        .arch-report-lang { display:flex; align-items:center; gap:6px; margin-top:9px; font-size:.7rem; color:rgba(245,240,235,.7); }
        .arch-report-lang-btn {
            background:rgba(41,182,246,.10); border:1px solid rgba(102,200,255,.4);
            color:rgba(245,240,235,.85); border-radius:4px; padding:2px 8px;
            font:.68rem/1.3 'Outfit',sans-serif; cursor:pointer; transition:background .15s,box-shadow .15s,color .15s;
        }
        .arch-report-lang-btn:hover { background:rgba(41,182,246,.28); }
        .arch-report-lang-btn.is-active {
            background:rgba(41,182,246,.5); color:#fff; border-color:#66c8ff;
            box-shadow:0 0 8px rgba(41,182,246,.35);
        }
        .arch-report-status { min-height:15px; margin-top:7px; color:rgba(245,240,235,.5); font-size:.68rem; line-height:1.35; }
        .arch-report-status.error { color:rgba(255,140,120,.92); }
        /* on-map result label + popup */
        .arch-report-tooltip {
            background:rgba(4,16,28,.94); border:1px solid rgba(102,200,255,.85);
            border-radius:5px; box-shadow:0 0 12px rgba(41,182,246,.35);
            color:#d6f0ff; padding:4px 7px; cursor:pointer;
        }
        .arch-report-tooltip:before { border-top-color:rgba(102,200,255,.85); }
        .arch-report-tag { display:block; font:.68rem/1.25 'Outfit',sans-serif; white-space:nowrap; }
        .arch-report-tag b { color:#66c8ff; font-weight:700; }
        .arch-report-popup .leaflet-popup-content-wrapper {
            background:rgba(8,16,28,.96); border:1px solid rgba(102,200,255,.4);
            box-shadow:0 10px 34px rgba(0,0,0,.55);
        }
        .arch-report-popup .leaflet-popup-tip { background:rgba(8,16,28,.96); }
        /* analysis point pin */
        .arch-report-pin-wrapper { background:none; border:none; }
        .arch-report-pin { position:relative; width:26px; height:26px; }
        .arch-report-pin-dot {
            position:absolute; left:9px; top:9px; width:8px; height:8px; border-radius:50%;
            background:#66c8ff; box-shadow:0 0 0 2px rgba(4,16,28,.85), 0 0 12px rgba(41,182,246,.9);
        }
        .arch-report-pin-pulse {
            position:absolute; inset:0; border-radius:50%;
            border:2px solid rgba(102,200,255,.75); animation:archReportPulse 1.8s ease-out infinite;
        }
        @keyframes archReportPulse { 0%{transform:scale(.35);opacity:.95} 100%{transform:scale(1.15);opacity:0} }
        .arch-report-loading { position:absolute; inset:0; z-index:1400; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:15px; background:rgba(4,12,20,.34); backdrop-filter:blur(7px); opacity:0; visibility:hidden; pointer-events:none; transition:opacity .2s,visibility .2s; }
        .arch-report-loading.visible { opacity:1; visibility:visible; }
        .arch-report-loading:after { content:'ANALYZING  /  ANALIZEAZĂ'; color:#66c8ff; font:600 .72rem 'Outfit',sans-serif; letter-spacing:.18em; text-shadow:0 0 12px #29b6f6; }
        .arch-report-ring { width:78px; height:78px; border:2px dotted rgba(102,200,255,.9); border-radius:50%; box-shadow:0 0 0 8px rgba(41,182,246,.05),0 0 28px rgba(41,182,246,.35); animation:archReportScanPulse 1.1s ease-in-out infinite; }
        @keyframes archReportScanPulse { 0%,100%{transform:scale(.78);opacity:.45} 50%{transform:scale(1.08);opacity:1} }

        /* ── LIDAR Scanner: distance drag performance ──
           Dragging the search-distance slider resizes a circle that can be
           50 km across, i.e. far wider than the screen at usable zoom levels.
           The layer panel is painted on top of that circle with a 20 px
           backdrop blur, so on a phone every single frame of the drag forced
           the compositor to re-blur the whole panel over freshly painted map
           pixels — the dominant cost of the lag reported in the installed PWA.
           The panel used to be 97% opaque, so dropping the blur for the drag
           was imperceptible. It is a translucent glass pane now, so the two
           alpha stops are raised to near-solid for the duration of the drag:
           the pane still reads like the same window, the re-blur work is gone,
           and nothing flashes back in once the finger lifts. The row-level
           backdrop blur is dropped the same way, together with the row
           transitions that would otherwise animate on each style change. */
        body.lidar-distance-dragging .transp-panel,
        body.arch-distance-dragging .transp-panel {
            --panel-top-alpha: 0.92;
            --panel-bottom-alpha: 0.94;
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
            box-shadow: -10px 0 40px rgba(0,0,0,0.55) !important;
        }
        body.lidar-distance-dragging .transp-layer-row,
        body.lidar-distance-dragging .dl-sublayer-row,
        body.lidar-distance-dragging .transp-panel *,
        body.arch-distance-dragging .transp-layer-row,
        body.arch-distance-dragging .dl-sublayer-row,
        body.arch-distance-dragging .transp-panel * {
            transition: none !important;
        }
        /* Keep the map's own compositing simple while the circle is resizing. */
        body.lidar-distance-dragging .leaflet-fade-anim .leaflet-tile,
        body.lidar-distance-dragging .leaflet-zoom-anim .leaflet-zoom-animated,
        body.arch-distance-dragging .leaflet-fade-anim .leaflet-tile,
        body.arch-distance-dragging .leaflet-zoom-anim .leaflet-zoom-animated {
            transition: none !important;
        }

        /* ── Map gesture performance (zoom / pan / pinch) ──
           Exactly the cost the block above removes during the distance drag,
           but for every map gesture: each backdrop-filter surface snapshots
           and re-blurs its background on every composited frame, and a pinch
           animates the whole map — with the Sat60/WMS stacks on, hundreds of
           heavy tiles — under ~30 of those glass surfaces at once. On Android
           that per-frame re-blur over the animating tiles is the GPU spike
           behind the reported "whole screen starts glitching", and when the
           compositor runs out of room the same surfaces are the ones that
           stop painting — the layer panel turns "fully transparent" while
           its rows and buttons are still in the DOM. js/tile-perf.js toggles
           body.map-gesturing from the map's own gesture events and lifts it
           after the settle window, so the glass is only plain for the frames
           that matter; the two panel alpha stops go near-solid the same way
           the distance drag does, keeping the window readable without the
           blur. The universal rule also covers the hard-coded blur() rules
           (search bar, legend, tooltip, dock …) that do not read
           --ctl-blur. The zoom TRANSITIONS themselves are left alone: the
           animation is the feature, only its backdrop work is dropped. */
        body.map-gesturing .transp-panel {
            --panel-top-alpha: 0.92;
            --panel-bottom-alpha: 0.94;
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
            box-shadow: -10px 0 40px rgba(0,0,0,0.55) !important;
        }
        body.map-gesturing *,
        body.map-gesturing *::before,
        body.map-gesturing *::after {
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
        }

        /* The distance slider lives inside the vertically scrollable layer
           panel. With the default touch-action the browser has to wait and see
           whether a touch that starts on the thumb is going to become a panel
           scroll before it commits the gesture to the slider, which shows up as
           the thumb sticking and then jumping to catch up with the finger —
           exactly the lag reported on mobile. Claiming the gesture outright
           makes the thumb track the finger from the first move event. */
        #lidarScannerDistance,
        #archReportDistance {
            touch-action: none;
            -ms-touch-action: none;
        }

        /* ── LIDAR Scanner Search Point Marker ── */
        .lidar-search-marker-wrapper {
            background: transparent !important;
            border: none !important;
        }
        .lidar-search-marker {
            width: 26px;
            height: 26px;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            pointer-events: auto;
        }
        .lidar-search-dot {
            width: 14px;
            height: 14px;
            background: #39ff14;
            border: 2px solid #ffffff;
            border-radius: 50%;
            box-shadow: 0 0 10px #39ff14, 0 0 22px rgba(57,255,20,0.95), inset 0 0 4px #8cff66;
            position: relative;
            z-index: 2;
            cursor: pointer;
        }
        .lidar-search-pulse {
            position: absolute;
            inset: 0;
            border-radius: 50%;
            background: rgba(57, 255, 20, 0.25);
            border: 2px solid #39ff14;
            box-shadow: 0 0 14px rgba(57, 255, 20, 0.9), inset 0 0 8px rgba(57, 255, 20, 0.4);
            animation: lidarSearchPulse 1.8s cubic-bezier(0.2, 0.65, 0.35, 1) infinite;
            pointer-events: none;
            z-index: 1;
        }
        @keyframes lidarSearchPulse {
            0% {
                transform: scale(0.5);
                opacity: 1;
            }
            70% {
                transform: scale(2.2);
                opacity: 0.15;
            }
            100% {
                transform: scale(2.7);
                opacity: 0;
            }
        }

        /* ── RADIUS LOADING OVERLAY ── */
        .map-radius-loader {
            position: absolute;
            inset: 0;
            background: rgba(6, 14, 30, 0.62);
            backdrop-filter: blur(3px);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 14px;
            z-index: 900;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.25s ease;
        }

            .map-radius-loader.visible {
                opacity: 1;
            }

        .map-radius-loader-ring {
            width: 100px;
            height: 100px;
            min-width: 100px;
            min-height: 100px;
            aspect-ratio: 1 / 1;
            flex-shrink: 0;
            border-radius: 50%;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
        }

            .map-radius-loader-ring::before,
            .map-radius-loader-ring::after {
                content: '';
                position: absolute;
                border-radius: 50%;
                border: 1.5px solid rgba(184, 216, 240, 0.55);
                animation: sonar-ping 2s ease-out infinite;
            }

            .map-radius-loader-ring::after {
                animation-delay: 1s;
            }

        @keyframes sonar-ping {
            0% {
                width: 18px;
                height: 18px;
                opacity: 0.9;
            }

            100% {
                width: 96px;
                height: 96px;
                opacity: 0;
            }
        }

        .sonar-outer {
            position: absolute;
            width: 80px;
            height: 80px;
            border-radius: 50%;
            border: 1.5px solid rgba(184, 216, 240, 0.4);
        }

        .sonar-mid {
            position: absolute;
            width: 54px;
            height: 54px;
            border-radius: 50%;
            border: 1.5px solid rgba(184, 216, 240, 0.4);
        }

        .sonar-inner {
            position: absolute;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            border: 1.5px solid rgba(184, 216, 240, 0.4);
        }

        .sonar-cross {
            position: absolute;
            width: 80px;
            height: 80px;
        }

            .sonar-cross::before, .sonar-cross::after {
                content: '';
                position: absolute;
                background: rgba(184, 216, 240, 0.25);
            }

            .sonar-cross::before {
                width: 1px;
                height: 100%;
                top: 0;
                left: 50%;
                transform: translateX(-50%);
            }

            .sonar-cross::after {
                width: 100%;
                height: 1px;
                top: 50%;
                left: 0;
                transform: translateY(-50%);
            }

        .sonar-sweep {
            position: absolute;
            width: 80px;
            height: 80px;
            border-radius: 50%;
            overflow: hidden;
            animation: sonar-sweep 2s linear infinite;
        }

            .sonar-sweep::after {
                content: '';
                position: absolute;
                top: 50%;
                left: 50%;
                width: 50%;
                height: 1.5px;
                transform-origin: left center;
                background: linear-gradient(90deg, transparent, rgba(184, 216, 240, 0.75));
            }

        @keyframes sonar-sweep {
            from {
                transform: rotate(0deg);
            }

            to {
                transform: rotate(360deg);
            }
        }

        .sonar-dot {
            position: absolute;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: #E8772A;
            box-shadow: 0 0 8px rgba(232, 119, 42, 0.85);
            z-index: 2;
        }

        .map-radius-loader-text {
            font-family: 'Outfit', sans-serif;
            font-size: 0.78rem;
            font-weight: 500;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            color: rgba(184, 216, 240, 0.7);
        }

        /* Fullscreen overrides for transparency panel and tab */
        .map-frame.is-fullscreen .transp-panel {
            position: fixed;
            top: 0;
            right: 0;
            bottom: 0;
            height: 100vh;
            max-height: 100vh;
            z-index: 10002;
            border-radius: 0;
        }

        .map-frame.is-fullscreen .transp-arrow-tab {
            position: fixed;
            top: 50%;
            right: 0;
            transform: translateY(-50%);
            z-index: 10003;
        }

        /* ── TOP-RIGHT CLOSE FULLSCREEN BUTTON ── */
        .btn-close-fullscreen {
            /* Completely removed from layout when not in fullscreen */
            display: none;
            position: fixed;
            top: 16px;
            top: calc(16px + env(safe-area-inset-top, 0px));
            right: 16px;
            z-index: 10001; /* above the fixed map-frame in fullscreen */
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            background: rgba(6,14,30,0.92);
            backdrop-filter: blur(16px);
            border: 1px solid rgba(184,216,240,0.28);
            border-radius: 8px;
            color: rgba(184,216,240,0.9);
            cursor: pointer;
            transition: background 0.2s, border-color 0.2s, color 0.2s;
            box-shadow: 0 4px 20px rgba(0,0,0,0.55);
        }

            .btn-close-fullscreen:hover {
                background: rgba(196,43,43,0.65);
                border-color: rgba(196,43,43,0.75);
                color: #fff;
            }

            .btn-close-fullscreen svg {
                flex-shrink: 0;
            }
        /* Show only when map frame is in fullscreen */
        .map-frame.is-fullscreen .btn-close-fullscreen {
            display: flex;
        }

        /* ── AUTH MODAL ── */
        #premiumModal {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 99999;
            background: rgba(4,10,22,0.82);
            backdrop-filter: blur(10px);
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

            #premiumModal.show {
                display: flex;
            }

        .premium-box {
            background: linear-gradient(160deg, #141a2e 0%, #0d1526 60%, #180f33 100%);
            border: 1px solid rgba(255,200,50,0.22);
            border-radius: 16px;
            padding: 40px 38px 34px;
            width: 100%;
            max-width: 480px;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 32px 80px rgba(0,0,0,0.75), 0 0 0 1px rgba(107,63,160,0.2);
            position: relative;
            animation: authSlideIn 0.35s cubic-bezier(.22,.68,0,1.2) both;
            text-align: center;
        }

        .premium-box h2 {
            font-family: 'Cinzel', serif;
            font-size: 1.45rem;
            font-weight: 900;
            letter-spacing: 0.04em;
            color: #ffc832;
            margin: 6px 0 6px;
            text-shadow: 0 2px 24px rgba(255,200,50,0.25);
        }

        .prem-ico {
            font-size: 2.6rem;
            line-height: 1.2;
            margin: 4px 0 8px;
        }

        .prem-sub {
            color: rgba(245,240,235,0.78);
            font-size: 0.98rem;
            line-height: 1.55;
            margin: 0 0 16px;
        }

        .prem-features {
            text-align: left;
            margin: 4px 0 16px;
            display: flex;
            flex-direction: column;
            gap: 9px;
        }

        .prem-feature {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            font-size: 0.86rem;
            line-height: 1.45;
            color: rgba(245,240,235,0.9);
            background: rgba(184,216,240,0.05);
            border: 1px solid rgba(184,216,240,0.1);
            border-radius: 9px;
            padding: 10px 12px;
        }

        .prem-price-line {
            font-size: 0.95rem;
            font-weight: 700;
            color: #ffc832;
            margin: 4px 0 18px;
        }

        .prem-expiry {
            font-size: 0.9rem;
            color: #2ecc71;
            margin: 0 0 14px;
            font-weight: 600;
        }

        .prem-login-box {
            margin: 8px 0 2px;
            padding: 14px;
            border: 1px dashed rgba(184,216,240,0.22);
            border-radius: 10px;
            background: rgba(184,216,240,0.04);
        }

        .prem-login-box p {
            color: rgba(245,240,235,0.7);
            font-size: 0.85rem;
            line-height: 1.5;
            margin: 0 0 12px;
        }

        .prem-buy-wrap {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-top: 6px;
        }

        .prem-btn {
            width: 100%;
            font-family: 'Outfit', sans-serif;
            font-size: 0.95rem;
            font-weight: 700;
            padding: 14px 18px;
            border-radius: 10px;
            cursor: pointer;
            border: 1px solid transparent;
            transition: transform 0.15s, box-shadow 0.2s, background 0.2s, opacity 0.2s;
        }

        .prem-btn-buy {
            background: linear-gradient(135deg, #E8772A, #c9550e);
            color: #fff;
        }

        .prem-btn-buy:hover {
            transform: translateY(-1px);
            box-shadow: 0 8px 24px rgba(232,119,42,0.35);
        }

        .prem-btn-primary {
            background: linear-gradient(135deg, #6B3FA0, #4a2a80);
            color: #fff;
        }

        .prem-btn-primary:hover {
            transform: translateY(-1px);
            box-shadow: 0 8px 24px rgba(107,63,160,0.4);
        }

        .prem-btn-ghost {
            background: transparent;
            border-color: rgba(184,216,240,0.18);
            color: rgba(245,240,235,0.6);
        }

        .prem-btn-ghost:hover {
            color: #fff;
            border-color: rgba(184,216,240,0.4);
        }

        .prem-btn:disabled {
            opacity: 0.55;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        /* ── Promo code (free trial) inside the membership popup ────── */

        .prem-promo {
            margin: 2px 0 0;
        }

        /* Understated link until the user opts in — the paid CTA above
           stays the primary action. */
        .prem-promo-toggle {
            width: 100%;
            background: none;
            border: none;
            padding: 4px 0;
            font-family: 'Outfit', sans-serif;
            font-size: 0.85rem;
            font-weight: 600;
            color: rgba(184,216,240,0.72);
            text-decoration: underline;
            text-underline-offset: 3px;
            cursor: pointer;
            transition: color 0.15s;
        }

        .prem-promo-toggle:hover {
            color: #fff;
        }

        .prem-promo-form {
            padding: 14px;
            border: 1px dashed rgba(184,216,240,0.22);
            border-radius: 10px;
            background: rgba(184,216,240,0.04);
            text-align: left;
        }

        .prem-promo-label {
            display: block;
            font-size: 0.72rem;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: rgba(184,216,240,0.65);
            margin-bottom: 7px;
        }

        .prem-promo-input-row {
            display: flex;
            gap: 8px;
            align-items: stretch;
        }

        .prem-promo-input {
            flex: 1 1 auto;
            min-width: 0;
            font-family: 'Outfit', sans-serif;
            font-size: 0.95rem;
            font-weight: 700;
            letter-spacing: 0.09em;
            text-transform: uppercase;
            padding: 12px 13px;
            border-radius: 9px;
            border: 1px solid rgba(184,216,240,0.24);
            background: rgba(4,10,22,0.55);
            color: #F5F0EB;
        }

        .prem-promo-input::placeholder {
            color: rgba(245,240,235,0.3);
            letter-spacing: 0.09em;
        }

        .prem-promo-input:focus {
            outline: none;
            border-color: #6B3FA0;
            box-shadow: 0 0 0 3px rgba(107,63,160,0.25);
        }

        .prem-promo-input:disabled {
            opacity: 0.6;
        }

        /* Compact override of .prem-btn (which is full-width by default). */
        .prem-btn.prem-promo-btn {
            width: auto;
            flex: 0 0 auto;
            padding: 12px 18px;
            font-size: 0.88rem;
        }

        .prem-promo-hint {
            font-size: 0.78rem;
            line-height: 1.45;
            color: rgba(245,240,235,0.55);
            margin: 9px 0 0;
        }

        .prem-promo-msg {
            margin-top: 10px;
            padding: 9px 11px;
            border-radius: 8px;
            font-size: 0.83rem;
            font-weight: 600;
            line-height: 1.45;
        }

        .prem-promo-ok {
            color: #2ecc71;
            background: rgba(46,204,113,0.1);
            border: 1px solid rgba(46,204,113,0.3);
        }

        .prem-promo-err {
            color: #ff8080;
            background: rgba(255,99,99,0.09);
            border: 1px solid rgba(255,99,99,0.28);
        }

        @media (max-width: 420px) {
            .prem-promo-input-row {
                flex-direction: column;
            }

            .prem-btn.prem-promo-btn {
                width: 100%;
            }
        }

        #authModal {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 99998;
            background: rgba(4,10,22,0.85);
            backdrop-filter: blur(10px);
            align-items: center;
            justify-content: center;
        }

            #authModal.show {
                display: flex;
            }

        .auth-box {
            background: linear-gradient(160deg, #0d1f42 0%, #0a1530 60%, #10083a 100%);
            border: 1px solid rgba(184,216,240,0.18);
            border-radius: 16px;
            padding: 44px 48px;
            width: 100%;
            max-width: 460px;
            box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(107,63,160,0.15);
            position: relative;
            animation: authSlideIn 0.35s cubic-bezier(.22,.68,0,1.2) both;
        }

        @keyframes authSlideIn {
            from {
                opacity: 0;
                transform: translateY(24px) scale(0.97);
            }

            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .auth-close {
            position: absolute;
            top: 16px;
            right: 16px;
            background: rgba(184,216,240,0.06);
            border: 1px solid rgba(184,216,240,0.15);
            color: rgba(184,216,240,0.5);
            width: 32px;
            height: 32px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 1rem;
            transition: all 0.2s;
        }

            .auth-close:hover {
                background: rgba(196,43,43,0.2);
                border-color: rgba(196,43,43,0.4);
                color: #fff;
            }

        .auth-logo {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 28px;
            font-family: 'Cinzel', serif;
            font-size: 1.2rem;
            font-weight: 900;
            color: var(--sky);
        }

            .auth-logo span {
                color: var(--orange);
            }

        .auth-tabs {
            display: flex;
            background: rgba(184,216,240,0.06);
            border: 1px solid rgba(184,216,240,0.12);
            border-radius: 8px;
            overflow: hidden;
            margin-bottom: 32px;
        }

        .auth-tab {
            flex: 1;
            padding: 10px;
            font-family: 'Outfit', sans-serif;
            font-size: 0.88rem;
            font-weight: 600;
            border: none;
            background: none;
            color: rgba(245,240,235,0.45);
            cursor: pointer;
            transition: all 0.2s;
            letter-spacing: 0.04em;
        }

            .auth-tab.active {
                background: var(--violet);
                color: #fff;
            }

        .auth-form {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .auth-field {
            display: flex;
            flex-direction: column;
            gap: 7px;
        }

        .auth-label {
            font-size: 0.8rem;
            font-weight: 500;
            color: rgba(184,216,240,0.65);
            letter-spacing: 0.06em;
        }

        .auth-input {
            background: rgba(184,216,240,0.06);
            border: 1px solid rgba(184,216,240,0.18);
            color: var(--white);
            padding: 11px 14px;
            border-radius: 8px;
            font-family: 'Outfit', sans-serif;
            font-size: 0.92rem;
            outline: none;
            transition: border-color 0.2s, background 0.2s;
        }

            .auth-input:focus {
                border-color: rgba(107,63,160,0.7);
                background: rgba(107,63,160,0.08);
            }

            .auth-input::placeholder {
                color: rgba(184,216,240,0.28);
            }

        .auth-checks {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-top: -2px;
        }

        .auth-check {
            display: flex;
            align-items: flex-start;
            gap: 9px;
            color: rgba(184,216,240,0.7);
            font-size: 0.82rem;
            line-height: 1.35;
            cursor: pointer;
        }

        .auth-check input {
            appearance: none;
            -webkit-appearance: none;
            flex: 0 0 auto;
            width: 17px;
            height: 17px;
            margin: 1px 0 0;
            border: 1px solid rgba(184,216,240,0.3);
            border-radius: 4px;
            background: rgba(184,216,240,0.06);
            cursor: pointer;
            position: relative;
            transition: background 0.2s, border-color 0.2s;
        }

        .auth-check input:checked {
            background: var(--violet);
            border-color: var(--violet);
        }

        .auth-check input:checked::after {
            content: '✓';
            position: absolute;
            inset: 0;
            color: #fff;
            font-size: 13px;
            font-weight: 700;
            line-height: 15px;
            text-align: center;
        }

        .auth-check a {
            color: var(--sky);
            text-decoration: underline;
            text-underline-offset: 2px;
        }

        .auth-check a:hover {
            color: #fff;
        }

        .auth-submit {
            margin-top: 8px;
            padding: 13px;
            background: linear-gradient(135deg, var(--violet), #4a2880);
            border: none;
            border-radius: 8px;
            color: #fff;
            font-family: 'Outfit', sans-serif;
            font-size: 0.95rem;
            font-weight: 700;
            cursor: pointer;
            letter-spacing: 0.05em;
            box-shadow: 0 4px 20px rgba(107,63,160,0.4);
            transition: all 0.2s;
        }

            .auth-submit:hover {
                box-shadow: 0 6px 30px rgba(107,63,160,0.65);
                transform: translateY(-1px);
            }

            .auth-submit:active {
                transform: translateY(0);
            }

        .auth-divider {
            display: flex;
            align-items: center;
            gap: 12px;
            margin: 4px 0;
        }

            .auth-divider::before, .auth-divider::after {
                content: '';
                flex: 1;
                height: 1px;
                background: rgba(184,216,240,0.12);
            }

            .auth-divider span {
                font-size: 0.75rem;
                color: rgba(184,216,240,0.3);
            }

        .auth-switch {
            text-align: center;
            font-size: 0.83rem;
            color: rgba(184,216,240,0.45);
        }

            .auth-switch a {
                color: var(--sky);
                text-decoration: none;
                font-weight: 600;
                cursor: pointer;
            }

                .auth-switch a:hover {
                    color: #fff;
                }

        .auth-msg {
            padding: 10px 14px;
            border-radius: 8px;
            font-size: 0.84rem;
            text-align: center;
            display: none;
            margin-bottom: 4px;
        }

            .auth-msg.error {
                background: rgba(196,43,43,0.15);
                border: 1px solid rgba(196,43,43,0.35);
                color: #ff8a8a;
                display: block;
            }

            .auth-msg.success {
                background: rgba(0,180,100,0.12);
                border: 1px solid rgba(0,180,100,0.3);
                color: #5dffa8;
                display: block;
            }

            .auth-msg.info {
                background: rgba(184,216,240,0.12);
                border: 1px solid rgba(184,216,240,0.3);
                color: #B8D8F0;
                display: block;
            }

            .auth-msg .auth-resend-link {
                color: #fff;
                text-decoration: underline;
                cursor: pointer;
                font-weight: 600;
            }

            .auth-resend-confirm {
                display: none;
                width: 100%;
                margin-top: 2px;
                padding: 11px 14px;
                background: transparent;
                border: 1px dashed rgba(184,216,240,0.4);
                border-radius: 8px;
                color: var(--sky);
                font-family: 'Outfit', sans-serif;
                font-size: 0.88rem;
                font-weight: 600;
                cursor: pointer;
                letter-spacing: 0.02em;
                transition: background 0.15s, border-color 0.15s, color 0.15s;
            }

            .auth-resend-confirm:hover:not(:disabled) {
                background: rgba(184,216,240,0.08);
                border-color: rgba(184,216,240,0.7);
                color: #fff;
            }

            .auth-resend-confirm:disabled {
                opacity: 0.65;
                cursor: default;
            }

        /* ── MAP LOCK OVERLAY (auth version) ── */
        /* ── AUTH GATE OVERLAY WITH SLIDESHOW ── */
        .map-overlay-lock-auth {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            text-align: center;
            z-index: 1000;
            border-radius: 12px;
            overflow: hidden;
        }

            .map-overlay-lock-auth.hidden {
                display: none !important;
            }

        /* Slideshow background */
        .auth-gate-slideshow {
            position: absolute;
            inset: 0;
            z-index: 0;
        }

        .auth-gate-slide {
            position: absolute;
            inset: 0;
            background-size: 110% auto;
            background-repeat: no-repeat;
            background-position: center center;
            opacity: 0;
            transition: opacity 1.5s ease-in-out;
        }

            .auth-gate-slide.active {
                opacity: 1;
            }

        /* Pan right-to-left — tight range so subjects stay centred */
        @keyframes panRTL {
            0% {
                background-position: 65% center;
                background-size: 110% auto;
            }

            100% {
                background-position: 35% center;
                background-size: 110% auto;
            }
        }
        /* Pan left-to-right */
        @keyframes panLTR {
            0% {
                background-position: 35% center;
                background-size: 110% auto;
            }

            100% {
                background-position: 65% center;
                background-size: 110% auto;
            }
        }
        /* Variants for slides that need a higher vertical crop (slides 2 & 4) */
        @keyframes panRTL-high {
            0% {
                background-position: 65% 35%;
                background-size: 110% auto;
            }

            100% {
                background-position: 35% 35%;
                background-size: 110% auto;
            }
        }

        @keyframes panLTR-high {
            0% {
                background-position: 35% 35%;
                background-size: 110% auto;
            }

            100% {
                background-position: 65% 35%;
                background-size: 110% auto;
            }
        }

        .auth-gate-slide.pan-rtl.active {
            animation: panRTL 9s ease-in-out forwards;
        }

        .auth-gate-slide.pan-ltr.active {
            animation: panLTR 9s ease-in-out forwards;
        }

        .auth-gate-slide.pan-ltr.high.active {
            animation: panLTR-high 9s ease-in-out forwards;
        }

        .auth-gate-slide.pan-rtl.high.active {
            animation: panRTL-high 9s ease-in-out forwards;
        }

        /* MOBILE FIX: on tall/narrow viewports, 110% auto doesn't cover the
           full height of the slideshow box (the source photos are landscape),
           leaving gaps top/bottom that expose the live map underneath.
           Force cover sizing so the slide always fills the box, and mirror
           that into the pan keyframes so the animation doesn't reset back
           to 110% auto mid-cycle. */
        @media (max-width: 600px) {
            .auth-gate-slide {
                background-size: cover;
            }

            @keyframes panRTL {
                0% { background-position: 65% center; background-size: cover; }
                100% { background-position: 35% center; background-size: cover; }
            }

            @keyframes panLTR {
                0% { background-position: 35% center; background-size: cover; }
                100% { background-position: 65% center; background-size: cover; }
            }

            @keyframes panRTL-high {
                0% { background-position: 65% 35%; background-size: cover; }
                100% { background-position: 35% 35%; background-size: cover; }
            }

            @keyframes panLTR-high {
                0% { background-position: 35% 35%; background-size: cover; }
                100% { background-position: 65% 35%; background-size: cover; }
            }
        }

        /* Dark gradient vignette — lightened ~8% */
        .auth-gate-vignette {
            position: absolute;
            inset: 0;
            z-index: 1;
            background: radial-gradient(ellipse 70% 70% at 50% 50%, rgba(6,14,30,0.22) 0%, rgba(6,14,30,0.58) 100%), linear-gradient(180deg, rgba(6,14,30,0.42) 0%, rgba(6,14,30,0.10) 40%, rgba(6,14,30,0.10) 60%, rgba(6,14,30,0.50) 100%);
        }

        /* Content sits above vignette */
        .auth-gate-content {
            position: relative;
            z-index: 2;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 18px;
        }

        .auth-gate-icon {
            width: 72px;
            height: 72px;
            border-radius: 50%;
            background: rgba(107,63,160,0.25);
            border: 1px solid rgba(107,63,160,0.6);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2rem;
            animation: gateGlow 2.5s ease-in-out infinite alternate;
            backdrop-filter: blur(6px);
        }

        @keyframes gateGlow {
            from {
                box-shadow: 0 0 12px rgba(107,63,160,0.3);
            }

            to {
                box-shadow: 0 0 32px rgba(107,63,160,0.7);
            }
        }

        .auth-gate-title {
            font-family: 'Cinzel', serif;
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--white);
            text-shadow: 0 2px 12px rgba(0,0,0,0.7);
        }

        .auth-gate-desc {
            color: rgba(245,240,235,0.82);
            max-width: 300px;
            line-height: 1.7;
            font-size: 0.9rem;
            text-shadow: 0 1px 6px rgba(0,0,0,0.6);
        }

        .auth-gate-btns {
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
            justify-content: center;
        }

        /* Semitransparent login button */
        .btn-gate-login {
            padding: 11px 28px;
            background: rgba(107,63,160,0.55);
            border: 1px solid rgba(184,216,240,0.45);
            border-radius: 8px;
            color: #fff;
            font-family: 'Outfit', sans-serif;
            font-size: 0.9rem;
            font-weight: 700;
            cursor: pointer;
            letter-spacing: 0.05em;
            backdrop-filter: blur(12px);
            box-shadow: 0 4px 20px rgba(0,0,0,0.35), 0 0 0 1px rgba(107,63,160,0.3) inset;
            transition: all 0.25s;
        }

            .btn-gate-login:hover {
                background: rgba(107,63,160,0.78);
                border-color: rgba(184,216,240,0.7);
                box-shadow: 0 6px 28px rgba(107,63,160,0.55), 0 0 0 1px rgba(107,63,160,0.5) inset;
                transform: translateY(-2px);
            }

        .btn-gate-register {
            padding: 11px 28px;
            background: rgba(6,14,30,0.38);
            border: 1px solid rgba(184,216,240,0.35);
            border-radius: 8px;
            color: var(--sky);
            font-family: 'Outfit', sans-serif;
            font-size: 0.9rem;
            font-weight: 600;
            cursor: pointer;
            letter-spacing: 0.04em;
            backdrop-filter: blur(12px);
            box-shadow: 0 4px 16px rgba(0,0,0,0.25);
            transition: all 0.25s;
        }

            .btn-gate-register:hover {
                border-color: var(--sky);
                background: rgba(184,216,240,0.15);
                transform: translateY(-2px);
            }

        /* Nav user pill */
        .nav-user {
            display: none;
            align-items: center;
            gap: 10px;
            background: rgba(107,63,160,0.2);
            border: 1px solid rgba(107,63,160,0.4);
            border-radius: 100px;
            padding: 5px 14px 5px 8px;
        }

            .nav-user.show {
                display: flex;
            }

        .nav-avatar {
            width: 26px;
            height: 26px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--violet), var(--sky));
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.7rem;
            font-weight: 700;
            color: #fff;
        }

        .nav-username {
            font-size: 0.82rem;
            font-weight: 600;
            color: rgba(184,216,240,0.9);
        }

        .nav-logout {
            background: none;
            border: none;
            color: rgba(184,216,240,0.4);
            cursor: pointer;
            font-size: 0.75rem;
            padding: 0;
            transition: color 0.2s;
            margin-left: 4px;
        }

            .nav-logout:hover {
                color: #ff8a8a;
            }

        /* ── SEARCH & SLIDER HIDDEN BEHIND AUTH GATE ── */
        .map-search-wrap.auth-hidden,
        .transp-arrow-tab.auth-hidden,
        .transp-panel.auth-hidden {
            opacity: 0 !important;
            pointer-events: none !important;
            visibility: hidden !important;
        }

        /* ── DETECT TOGGLE LOCKED STATE ── */
        .detect-toggle-wrap.locked {
            opacity: 0.5;
            cursor: not-allowed;
            position: relative;
        }

            .detect-toggle-wrap.locked * {
                pointer-events: none;
            }

        /* Premium gate on the Detect switch: a hairline padlock in the map
           palette, not the 🔒 emoji it used to render. */
        .detect-lock-icon {
            display: none;
            align-items: center;
            color: var(--ctl-icon, #BBA9F2);
            margin-left: 3px;
        }

        .detect-lock-icon svg {
            display: block;
        }

        .detect-toggle-wrap.locked .detect-lock-icon {
            display: inline-flex;
        }

        /* Desktop fullscreen uses Leaflet's normal 10px left control inset,
           matching measure/offline/compass below zoom, just like the embedded
           map. Reserve the extra notch clearance for mobile web only. */

        /* ── MOBILE FULLSCREEN & SEARCH FIXES ── */
        @media (max-width: 600px) {
            body:not(.is-pwa) .map-frame.is-fullscreen #detectlab-map .leaflet-left .leaflet-control-zoom {
                margin-left: calc(18px + env(safe-area-inset-left, 0px));
            }

            /* Keep Leaflet controls below the search bar on narrow screens. */
            #detectlab-map .leaflet-top.leaflet-left,
            #detectlab-map .leaflet-top.leaflet-right {
                top: calc(64px + env(safe-area-inset-top, 0px));
            }

            /* Move X button to bottom-right so it doesn't crowd the search bar */
            .map-frame.is-fullscreen .btn-close-fullscreen {
                top: auto;
                bottom: 24px;
                right: 16px;
                width: 44px;
                height: 44px;
                border-radius: 50%;
            }

            /* Mobile WEB fullscreen only (browser tab — NOT the installed PWA):
               the browser's bottom search/URL bar hid the compass +
               rotation-lock column pinned to the map's bottom-left corner.
               The full-screen map frame is `inset:0; height:100vh`, and 100vh
               is the LARGE viewport — the frame's bottom edge, and every
               absolutely-positioned control anchored to it, slides under the
               browser toolbar (the same overshoot documented for ?pwa=1 in a
               mobile browser tab in index.html). position:fixed pulls the
               Leaflet bottom-left corner back onto the visible viewport —
               .map-frame / .map-wrapper / #detectlab-map carry no transform,
               so it fixes to the screen exactly like the ✕ button above —
               and lifts it clear of the browser search bar (~50-56px) plus
               the home-indicator / gesture inset; the compass keeps its own
               10px margin on top of that. Scoped to body:not(.is-pwa): the
               installed app has no browser bar and keeps its own clearance
               (body.is-pwa .leaflet-bottom → env(safe-area-inset-bottom),
               index.html). */
            body:not(.is-pwa) .map-frame.is-fullscreen #detectlab-map .leaflet-bottom.leaflet-left {
                position: fixed;
                bottom: calc(56px + env(safe-area-inset-bottom, 0px));
            }
            /* Leaflet's attribution bar sits flush against the true viewport
               bottom by default, crowding the ✕ button and search-help pill
               on small screens. Hide it entirely on mobile — it's the only
               thing in .leaflet-bottom (no scale control is added), so this
               doesn't affect any other control. */
            .leaflet-control-attribution {
                display: none !important;
            }
            /* Shorten the search bar on mobile */
            .map-search-wrap {
                width: min(260px, calc(100% - 80px));
                left: 50%;
                transform: translateX(-50%);
            }

            /* Align the Josephine+ "Clădiri Dispărute" button row (pencil / pill / gear)
               with the ✕ close-fullscreen button so they sit level, in one row,
               instead of floating too low and overlapping the ✕. */
            .map-frame.is-fullscreen #iosBldSearchHelpBtn,
            .map-frame.is-fullscreen #iosBldSearchHelpHint,
            .map-frame.is-fullscreen #iosBldSettingsBtn,
            .map-frame.is-fullscreen #iosBldSuggestBtn {
                bottom: 27px;
            }
        }

        /* Desktop web browser: keep the ✕ exit-fullscreen button aligned in the
           top-right corner. The base rule above already positions it at
           top:16px / right:16px, so no downward override is needed here.
           (An earlier min-width:601px rule pushed it down 72px, knocking it
           out of the corner — removed. Mobile keeps its own bottom-right
           placement defined in the max-width:600px block above.) */

        /*heritage-marker-icon*/
        .heritage-marker-icon {
            background: none !important;
            border: none !important;
        }

        /* Ascunde TOATE etichetele/atribuirile native Leaflet (orice tile layer: OSM, satelit, etc.) */
        .leaflet-control-attribution {
            display: none !important;
        }

        /* Etichetă proprie, semitransparentă, în locul atribuirii Leaflet */
        .leaflet-container {
            position: relative;
        }

        .leaflet-container::after {
            content: "© Leafleet";
            position: absolute;
            bottom: 4px;
            right: 6px;
            font-family: 'Outfit', sans-serif;
            font-size: 11px;
            color: rgba(0, 0, 0, 0.45);
            background: rgba(255, 255, 255, 0.35);
            padding: 1px 6px;
            border-radius: 3px;
            pointer-events: none;
            z-index: 1000;
            line-height: 1.4;
        }

        /* Iconița "i" de informații lângă fiecare strat */
        .layer-info-btn {
            background: none;
            border: none;
            padding: 0;
            margin: 0;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: rgba(245, 240, 235, 0.4);
            flex-shrink: 0;
            transition: color 0.15s ease;
        }

        .layer-info-btn:hover,
        .layer-info-btn:focus-visible {
            color: #c8a96e;
        }

        /* Fereastra popup cu informații despre strat */
        .layer-info-overlay {
            position: fixed;
            inset: 0;
            background: rgba(10, 8, 6, 0.55);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 2147483647;
            padding: 16px;
            pointer-events: auto;
        }

        .layer-info-overlay.open {
            display: flex;
        }

        .layer-info-window-stack {
            position: fixed;
            z-index: 1;
            left: 50%;
            bottom: max(16px, env(safe-area-inset-bottom));
            transform: translateX(-50%);
            display: flex;
            gap: 6px;
            width: min(560px, calc(100vw - 24px));
            overflow-x: auto;
            padding: 7px;
            border: 1px solid rgba(184,216,240,.25);
            border-radius: 12px;
            background: rgba(12,16,30,.94);
            backdrop-filter: blur(14px);
        }
        .layer-info-window-stack[hidden] { display: none; }
        .layer-info-window-tab {
            flex: 0 0 auto;
            max-width: 170px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            border: 1px solid rgba(184,216,240,.2);
            border-radius: 8px;
            padding: 8px 11px;
            color: #dce8ff;
            background: rgba(255,255,255,.06);
            cursor: pointer;
        }
        .layer-info-window-tab[aria-selected="true"] { background: rgba(112,88,190,.48); border-color: rgba(180,160,255,.65); }
        .layer-info-box {
            position: relative;
            background: #1c1712;
            border: 1px solid rgba(200, 169, 110, 0.35);
            border-radius: 10px;
            padding: 20px 22px;
            width: min(380px, calc(100vw - 32px));
            height: min(420px, calc(100vh - 140px));
            min-height: 230px;
            overflow-y: auto;
            flex: 0 0 auto;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
            font-family: 'Outfit', sans-serif;
            color: #f5f0eb;
        }

        .layer-info-close {
            position: absolute;
            top: 6px;
            right: 6px;
            background: none;
            border: none;
            cursor: pointer;
            color: rgba(245, 240, 235, 0.6);
            width: 26px;
            height: 26px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: background 0.15s ease, color 0.15s ease;
        }

        .layer-info-close:hover {
            background: rgba(255, 255, 255, 0.08);
            color: #fff;
        }

        .layer-info-title {
            font-size: 0.95rem;
            font-weight: 600;
            margin: 0 0 8px 0;
            padding-right: 22px;
            color: #c8a96e;
        }

        .layer-info-attribution {
            font-size: 0.85rem;
            line-height: 1.5;
            color: rgba(245, 240, 235, 0.85);
            margin: 0;
        }

        /* Descriere opțională sub atribuire (ex. „Zone cu potențial arheologic”,
           a cărei explicație a fost mutată din panou în fereastra de info). */
        .layer-info-description {
            font-size: 0.78rem;
            line-height: 1.55;
            color: rgba(245, 240, 235, 0.62);
            margin: 10px 0 0 0;
            padding-top: 10px;
            border-top: 1px solid rgba(200, 169, 110, 0.18);
        }

        /* Legend moved from the Battles layer panel into its info tab. */
        .layer-info-battles-legend {
            margin-top: 12px;
            padding-top: 10px;
            border-top: 1px solid rgba(200, 169, 110, 0.18);
            color: rgba(245, 240, 235, 0.78);
        }

        .layer-info-battles-heading {
            margin-bottom: 8px;
            color: #c8a96e;
            font-size: 0.72rem;
            font-weight: 600;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }

        .layer-info-battles-list {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .layer-info-battles-item {
            display: flex;
            align-items: center;
            gap: 7px;
            font-size: 0.74rem;
            line-height: 1.25;
        }

        .layer-info-battles-swatch {
            width: 9px;
            height: 9px;
            flex: 0 0 9px;
            border-radius: 50%;
            box-shadow: 0 0 0 1px rgba(245, 240, 235, 0.16);
        }

        /* Source links inside a layer attribution (e.g. bukowina1856.eu for the
           maps digitized by Universitatea „Ștefan cel Mare” din Suceava). */
        .layer-info-attribution a {
            color: #c8a96e;
            text-decoration: underline;
            text-underline-offset: 2px;
            word-break: break-word;
        }

        .layer-info-attribution a:hover,
        .layer-info-attribution a:focus-visible {
            color: #f5f0eb;
        }

        /* Heritage 600 m radius canvas lives as a direct child of the map
           pane. Pin its zoom-animation origin to 0 0 (same as Leaflet's
           own renderers) so the circles stay on their sites while zooming.
           will-change + backface-visibility force a GPU layer in the PWA
           standalone WebView (position:fixed + backdrop-filter otherwise
           causes the canvas to be repainted each frame and appear glitchy
           during zoom). The previous contain:layout style paint broke the
           shared transform origin with tile layers in some PWA WebViews,
           producing the reported slide during pinch/button zoom. */
        #detectlab-map .leaflet-map-pane > canvas.leaflet-zoom-animated {
            transform-origin: 0 0 !important;
            -webkit-transform-origin: 0 0 !important;
            will-change: transform !important;
            backface-visibility: hidden !important;
            -webkit-backface-visibility: hidden !important;
            /* Keep the canvas on its own compositor layer without using
               contain:layout which isolates it from the mapPane's transform. */
            transform: translate3d(0,0,0);
        }
        /* Leaflet adds leaflet-zoom-anim to the map pane during zoom.  The
           transition is defined in leaflet.css, but in PWA standalone the
           map pane is position:fixed and has a backdrop-filter sibling,
           which can prevent the transition from being applied unless the
           animated children are explicitly promoted. */
        .leaflet-zoom-anim #detectlab-map .leaflet-map-pane > canvas.leaflet-zoom-animated {
            will-change: transform !important;
        }
        /* PWA standalone: ensure the custom canvases get the same transition
           as Leaflet's own zoom-animated layers even when the map pane is
           fixed.  Without this, iOS standalone sometimes drops the transition
           and the canvas jumps instead of scaling with tiles. */
        body.is-pwa .leaflet-zoom-anim #detectlab-map .leaflet-map-pane > canvas.leaflet-zoom-animated {
            transition: transform 0.25s cubic-bezier(0,0,0.25,1) !important;
            -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1) !important;
        }

        /* Stil pentru imaginile heritage - rotunde și cu contur negru */
        .heritage-circle-icon {
            background: none !important;
            border: none !important;
        }

            .heritage-circle-icon img {
                display: block;
                width: 100%;
                height: 100%;
                object-fit: cover;
                border-radius: 50%;
               
                background: none;
            }

        /* ── GET MOBILE APP SECTION ── */
        #get-mobile {
            background: linear-gradient(180deg, #060E1E 0%, #081530 50%, #060E1E 100%);
            border-top: 1px solid rgba(184, 216, 240, 0.05);
            border-bottom: 1px solid rgba(184, 216, 240, 0.05);
            text-align: center;
        }

        .app-buttons-wrap {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin-top: 40px;
            flex-wrap: wrap;
        }

        .btn-app {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 14px 32px;
            border-radius: 12px;
            font-family: 'Outfit', sans-serif;
            font-size: 1.05rem;
            font-weight: 700;
            letter-spacing: 0.04em;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            border: 1px solid rgba(184, 216, 240, 0.25);
            backdrop-filter: blur(12px);
            min-width: 220px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
        }

        .android-btn {
            background: rgba(107, 63, 160, 0.2);
            color: var(--sky);
            border-color: rgba(107, 63, 160, 0.45);
        }

        .android-btn:hover {
            background: rgba(107, 63, 160, 0.45);
            border-color: rgba(184, 216, 240, 0.6);
            transform: translateY(-3px);
            box-shadow: 0 8px 30px rgba(107, 63, 160, 0.4), 0 0 10px rgba(184, 216, 240, 0.2) inset;
        }

        .ios-btn {
            background: rgba(200, 169, 110, 0.15);
            color: #f5d98a;
            border-color: rgba(200, 169, 110, 0.35);
        }

        .ios-btn:hover {
            background: rgba(200, 169, 110, 0.35);
            border-color: rgba(200, 169, 110, 0.7);
            transform: translateY(-3px);
            box-shadow: 0 8px 30px rgba(200, 169, 110, 0.3), 0 0 10px rgba(200, 169, 110, 0.25) inset;
        }

        /* Toast styling for PWA messages */
        .pwa-toast {
            display: none;
            margin: 24px auto 0;
            max-width: 480px;
            padding: 14px 24px;
            border-radius: 10px;
            background: rgba(13, 28, 60, 0.95);
            border: 1px solid rgba(200, 169, 110, 0.3);
            color: #f5d98a;
            font-family: 'Outfit', sans-serif;
            font-size: 0.95rem;
            font-weight: 500;
            line-height: 1.5;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(10px);
            animation: pwaFadeIn 0.35s ease-out;
        }

        .pwa-toast.visible {
            display: block;
        }

        @keyframes pwaFadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* ── PWA INSTALL HELP CARD (Android) ──
           Shown when the current Android browser cannot produce an app that
           Google Play Protect accepts (Samsung Internet & OEM browsers mint a
           WebAPK that is flagged as unsafe). It explains the situation and
           routes the user to Chrome, whose install flow is not affected. */
        .pwa-help-card {
            display: none;
            text-align: left;
            max-width: 560px;
            margin: 28px auto 0;
            padding: 22px 24px;
            border-radius: 14px;
            background: rgba(13, 28, 60, 0.92);
            border: 1px solid rgba(200, 169, 110, 0.32);
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
            backdrop-filter: blur(12px);
            font-family: 'Outfit', sans-serif;
            color: rgba(245, 240, 235, 0.9);
            animation: pwaFadeIn 0.35s ease-out;
        }

        .pwa-help-card.visible {
            display: block;
        }

        .pwa-help-title {
            margin: 0 0 10px;
            font-family: 'Outfit', sans-serif;
            font-size: 1.12rem;
            font-weight: 700;
            letter-spacing: 0.01em;
            color: #f5d98a;
        }

        .pwa-help-body {
            margin: 0 0 14px;
            font-size: 0.95rem;
            line-height: 1.6;
            color: rgba(245, 240, 235, 0.82);
        }

        .pwa-help-steps {
            margin: 0 0 14px;
            padding-left: 20px;
            font-size: 0.95rem;
            line-height: 1.65;
            color: rgba(245, 240, 235, 0.82);
        }

        .pwa-help-steps li {
            margin-bottom: 6px;
        }

        .pwa-help-tip {
            margin: 0 0 16px;
            padding: 12px 14px;
            border-radius: 10px;
            background: rgba(200, 169, 110, 0.12);
            border-left: 3px solid rgba(200, 169, 110, 0.55);
            font-size: 0.9rem;
            line-height: 1.55;
            color: rgba(245, 217, 138, 0.92);
        }

        .pwa-help-actions {
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
            align-items: center;
        }

        .pwa-help-btn {
            padding: 12px 22px;
            border-radius: 10px;
            font-family: 'Outfit', sans-serif;
            font-size: 0.95rem;
            font-weight: 700;
            letter-spacing: 0.03em;
            cursor: pointer;
            transition: all 0.25s ease;
            border: 1px solid transparent;
        }

        .pwa-help-btn.primary {
            background: rgba(107, 63, 160, 0.35);
            color: var(--sky);
            border-color: rgba(184, 216, 240, 0.45);
        }

        .pwa-help-btn.primary:hover {
            background: rgba(107, 63, 160, 0.6);
            transform: translateY(-2px);
        }

        .pwa-help-btn.secondary {
            background: transparent;
            color: rgba(245, 240, 235, 0.75);
            border-color: rgba(184, 216, 240, 0.22);
        }

        .pwa-help-btn.secondary:hover {
            background: rgba(184, 216, 240, 0.08);
            color: rgba(245, 240, 235, 0.95);
        }

        /* ── STICKY INSTALL BANNER ──
           Only used on the Chrome landing page (?pwa=install) opened by the
           "Open in Chrome" flow, so the install button stays visible. */
        .pwa-install-banner {
            display: none;
            position: fixed;
            left: 12px;
            right: 12px;
            bottom: 12px;
            z-index: 3000;
            align-items: center;
            justify-content: space-between;
            gap: 14px;
            padding: 14px 16px;
            border-radius: 14px;
            background: rgba(6, 14, 30, 0.97);
            border: 1px solid rgba(200, 169, 110, 0.4);
            box-shadow: 0 14px 44px rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(18px);
            font-family: 'Outfit', sans-serif;
            animation: pwaFadeIn 0.35s ease-out;
        }

        .pwa-install-banner.visible {
            display: flex;
        }

        .pwa-banner-text {
            display: flex;
            flex-direction: column;
            gap: 3px;
            min-width: 0;
        }

        .pwa-banner-title {
            font-size: 0.98rem;
            font-weight: 700;
            color: #f5d98a;
        }

        .pwa-banner-desc {
            font-size: 0.84rem;
            line-height: 1.45;
            color: rgba(245, 240, 235, 0.75);
        }

        .pwa-banner-actions {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
        }

        .pwa-banner-btn {
            padding: 12px 18px;
            border-radius: 10px;
            border: 1px solid rgba(184, 216, 240, 0.45);
            background: rgba(107, 63, 160, 0.4);
            color: var(--sky);
            font-family: 'Outfit', sans-serif;
            font-size: 0.9rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.25s ease;
            white-space: nowrap;
        }

        .pwa-banner-btn:hover:not(:disabled) {
            background: rgba(107, 63, 160, 0.65);
        }

        .pwa-banner-btn:disabled {
            opacity: 0.55;
            cursor: progress;
        }

        .pwa-banner-close {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            border: 1px solid rgba(184, 216, 240, 0.2);
            background: transparent;
            color: rgba(245, 240, 235, 0.6);
            font-size: 0.85rem;
            cursor: pointer;
            transition: background 0.2s, color 0.2s;
        }

        .pwa-banner-close:hover {
            background: rgba(184, 216, 240, 0.1);
            color: #fff;
        }

        @media (max-width: 560px) {
            .pwa-install-banner {
                flex-direction: column;
                align-items: stretch;
                gap: 10px;
            }

            .pwa-banner-actions {
                justify-content: space-between;
            }

            .pwa-banner-btn {
                flex: 1;
            }

            .pwa-help-card {
                padding: 18px;
            }
        }


/* Nearby detectorists */
.btn-nearby-detectors {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(184, 216, 240, 0.06);
    border: 1px solid rgba(184, 216, 240, 0.14);
    color: rgba(184, 216, 240, 0.75);
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.btn-nearby-detectors:hover {
    background: rgba(43, 150, 196, 0.18);
    border-color: rgba(43, 150, 196, 0.55);
    color: #8adeff;
}

.btn-nearby-detectors.is-active {
    background: #2b96c4;
    border-color: #53b6e2;
    color: #fff;
}

.btn-nearby-detectors .nearby-icon {
    font-size: 14px;
    line-height: 1;
    font-weight: 700;
    margin-top: -1px;
}

.nearby-icon { font-size:25px; line-height:1; font-weight:700; }
.pwa-nearby-trigger { min-width:42px; justify-content:center; padding:5px 8px; }
.nearby-modal { display:none; position:fixed; inset:0; z-index:3000; background:rgba(0,0,0,.65); align-items:center; justify-content:center; }
.nearby-modal.show { display:flex; }
.nearby-dialog { position:relative; width:min(390px,calc(100% - 32px)); padding:28px 24px 24px; border-radius:14px; background:#17252b; color:#f5f0eb; text-align:center; box-shadow:0 12px 45px #000; }
.nearby-dialog h3 { margin:0 0 16px; font-size:1.15rem; line-height:1.5; }.nearby-dialog small { opacity:.72; font-weight:400; }.nearby-dialog p { line-height:1.6; }.nearby-actions { display:flex; gap:10px; justify-content:center; margin-top:22px; }.nearby-actions button { border:0; border-radius:7px; padding:10px 24px; background:#d99b45; color:#182126; font-weight:700; cursor:pointer; }.nearby-actions .secondary { background:transparent; border:1px solid #78909c; color:#eee; }.nearby-close { position:absolute; right:10px; top:5px; background:none; border:0; color:#fff; font-size:27px; cursor:pointer; }
.detector-nearby-marker { border-radius:50%; width:32px; height:32px; display:flex; align-items:center; justify-content:center; background:#d99b45; color:#182126; border:2px solid #fff; font-weight:800; box-shadow:0 2px 8px #0008; }
/* Offline detectorists: last known (broad) location — black & white bubble,
   visually muted so live orange pins keep the visual priority. */
.detector-offline-marker { border-radius:50%; width:32px; height:32px; display:flex; align-items:center; justify-content:center; background:#111; color:#fff; border:2px solid #fff; font-weight:800; box-shadow:0 2px 8px #0008; filter:grayscale(1); opacity:.82; }
/* Invisible 44×44 tap pad around the 32px detectorist bubble (the divIcon is
   44×44 with a centred anchor): the pin looks the same, but a thumb tapping
   slightly off-centre still lands on the marker in the PWA. */
.detector-tap-pad { width:44px; height:44px; display:flex; align-items:center; justify-content:center; background:transparent; }

/* Social actions inside a detectorist popup (live pin + offline bubble).
   The slot is EMPTY in the popup markup and filled by js/friends.js when the
   popup opens: "＋ Adaugă prieten" for a stranger, "✓ Acceptă cererea" for a
   pending request addressed to us, "⏳ Cerere de prietenie trimisă / Anulează"
   while ours is pending and "💬 Trimite mesaj" once you are friends. */
.detector-social-actions { margin-top: 8px; padding-top: 7px; border-top: 1px solid rgba(184,216,240,0.18); }
.detector-social-actions:empty { display: none; }
.detector-social-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; max-width: 100%; }
.detector-social-btn { border: 0; border-radius: 7px; padding: 8px 12px; min-height: 36px; font-family: 'Outfit', sans-serif; font-size: 0.74rem; font-weight: 700; cursor: pointer; background: #6B3FA0; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; touch-action: manipulation; }
.detector-social-btn:hover { filter: brightness(1.12); }
.detector-social-btn:disabled { opacity: 0.55; cursor: default; filter: none; }
.detector-social-btn.chat { background: #0D2B5E; border: 1px solid rgba(184,216,240,0.35); color: var(--sky,#B8D8F0); }
.detector-social-btn.ok { background: #2E9E4F; }
.detector-social-btn.ghost { background: transparent; border: 1px solid rgba(184,216,240,0.3); color: #F5F0EB; }
.detector-social-note { font-size: 0.68rem; opacity: 0.8; line-height: 1.3; }
.detector-social-msg { font-size: 0.7rem; line-height: 1.35; margin-top: 5px; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
.detector-social-msg:empty { display: none; }
.detector-social-msg.ok { color: #7fd694; }
.detector-social-msg.error { color: #ff8a8a; }
/* Leaflet popups are narrow; keep the buttons on one line on desktop and let
   them wrap on phones instead of overflowing the card. */
.leaflet-popup .detector-social-btn { max-width: 100%; }

/* ── Detectorist popup card: HORIZONTAL layout ─────────────────────────────
   Avatar left, identity right, social actions full-width below. The card root
   intentionally paints NO background / border / padding of its own: inside a
   Leaflet popup the single visible window is #detectlab-map
   .leaflet-popup-content-wrapper (see the .leaflet-popup .map-place-popup
   override — one window, not two). The min-width reserves room for the social
   slot, which is EMPTY while Leaflet measures the popup and is painted by
   js/friends.js only on 'popupopen' (plus popup.update() re-runs the layout
   after every paint, so buttons and messages never leave the frame). */
.detector-popup { min-width: 228px; max-width: 100%; font-family: 'Outfit', sans-serif; }
.detector-card-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.detector-avatar { position: relative; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.02rem; letter-spacing: 0.02em; }
.detector-live .detector-avatar { background: linear-gradient(135deg, #E8620C, #F5A623); color: #fff; border: 2px solid rgba(255,190,90,0.85); box-shadow: 0 2px 10px rgba(232,98,12,0.45); }
.detector-offline .detector-avatar { background: #232323; color: #f2f2f2; border: 2px solid rgba(200,200,200,0.7); filter: grayscale(1); }
.detector-presence { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #060e1e; }
.detector-live .detector-presence { background: #39ff14; box-shadow: 0 0 6px rgba(57,255,20,0.9); }
.detector-offline .detector-presence { background: #8a8a8a; }
.detector-id { flex: 1 1 auto; min-width: 0; }
.detector-name { font-weight: 800; font-size: 0.86rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detector-status { font-size: 0.7rem; line-height: 1.3; opacity: 0.85; margin-top: 1px; }
.detector-meta { font-size: 0.7rem; line-height: 1.3; opacity: 0.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) {
    .detector-popup { min-width: 0; }
}

/* Tax qualifier shown beside every Premium price. */
.vat-note {
    display: inline-block;
    margin-left: 0.2em;
    font-size: 0.62em;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.04em;
    vertical-align: super;
    white-space: nowrap;
}

.plan-price .vat-note-price {
    align-self: flex-start;
    margin-top: 0.45em;
}

/* Viewport coverage filter: rows outside the visible map area are temporarily
   removed from the panel and return as soon as their coverage enters the view. */
#transpPanel.viewport-filter-active .viewport-layer-unavailable {
    display: none !important;
}

/* The small leading SVGs/emoji are decorative layer markers, not controls.
   Keep functional expand/collapse arrows, info buttons and toggle controls. */
#transpPanel .transp-layer-label > span:first-child > svg,
#transpPanel .transp-layer-label > span:first-child .babel-scroll-icon {
    display: none !important;
}

/* ── Country coverage filter ──
   Once a country is selected the map is locked to it, and the layer panel
   keeps only the layers whose coverage partially or entirely overlaps the
   bounds of that country. js/map-app.js (filterLayersForCountry) marks the
   rows outside the country — including a whole group row when none of its
   sublayers covers the country — and js/map-app.js (unfilterLayersForCountry)
   removes the marks when the lock is released. The rows are hidden outright:
   a layer with no data over the selected country is not an available layer. */
#transpPanel.country-filter-active .country-layer-unavailable {
    display: none !important;
}

/* ── Danish layers (js/danish-layers.config.js + js/danish-layers.js) ───────
   The rows are generated in the same style as the other countries' rows:
   the shared glass `.dl-sublayer-row` box, the `.apm-toggle-switch` pill
   on/off switch, the `.transp-layer-label` opacity line with the `.pct`
   badge and `.layer-info-btn`, and the `.transp-slider` opacity slider —
   inside Romania-style `.transp-layer-row` sections (Heritage, Historical
   maps, Ortophoto) and the shared LiDAR accordion. Only the small Danish
   leftovers below (title truncation, the per-row status line, focus rings)
   still need their own rules, which is what keeps 375 px unchanged. */
.danish-sublayers {
    padding-left: 6px;
    border-left: 2px solid rgba(214, 69, 80, 0.3);
}

.danish-layer-section {
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.5;
    margin-top: 2px;
}

.danish-year-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    max-width: 100%;
    color: rgba(245, 240, 235, 0.82);
    font-size: 0.76rem;
}

.danish-year-select {
    min-width: 82px;
    max-width: 45%;
    padding: 5px 8px;
    border: 1px solid rgba(214, 69, 80, 0.45);
    border-radius: 4px;
    color: #f5f0eb;
    background: #252327;
    font: inherit;
}

.danish-year-select:focus-visible {
    outline: 2px solid #d64550;
    outline-offset: 2px;
}

.danish-layer-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.danish-layer-head {
    display: flex;
    align-items: center;
    gap: 6px;
}

.danish-layer-label {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
    cursor: pointer;
    font-size: 0.78rem;
    color: rgba(245, 240, 235, 0.78);
}

.danish-layer-label input {
    flex-shrink: 0;
    accent-color: #d64550;
    width: 13px;
    height: 13px;
    cursor: pointer;
}

.danish-layer-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.danish-layer-info {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(245, 240, 235, 0.35);
    background: none;
    color: rgba(245, 240, 235, 0.7);
    font-size: 0.6rem;
    line-height: 1;
    cursor: pointer;
}

.danish-layer-info:hover,
.danish-layer-info:focus-visible {
    border-color: #d64550;
    color: #fff;
}

.danish-layer-opacity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    opacity: 0.6;
    padding-left: 19px;
}

.danish-layer-slider {
    margin-left: 19px;
    width: calc(100% - 19px);
}

.danish-layer-status {
    font-size: 0.66rem;
    line-height: 1.3;
    padding-left: 19px;
    opacity: 0.7;
}

.danish-layer-status.is-error {
    color: #ffb4a2;
    opacity: 1;
}

.danish-layer-status.is-warn {
    color: #ffd166;
    opacity: 1;
}

.danish-group-notice {
    font-size: 0.68rem;
    line-height: 1.35;
    color: #ffd166;
    border-left: 2px solid rgba(255, 209, 102, 0.5);
    padding: 3px 0 3px 7px;
    margin: 0 0 6px;
}

.danish-layer-row.is-active .danish-layer-title {
    color: rgba(245, 240, 235, 0.98);
}

/* The shared pill switch hides its checkbox, so keyboard focus has to land
   on the track that follows it; the section chevron gets the same ring. */
#transpPanel .danish-layer-row .apm-toggle-switch input:focus-visible + .apm-toggle-track,
#transpPanel .danish-group-row .apm-toggle-switch input:focus-visible + .apm-toggle-track,
#transpPanel .albania-layer-row .apm-toggle-switch input:focus-visible + .apm-toggle-track,
#transpPanel .albania-section .apm-toggle-switch input:focus-visible + .apm-toggle-track {
    outline: 2px solid #d64550;
    outline-offset: 1px;
}

#transpPanel .danish-group-row button:focus-visible {
    outline: 2px solid #d64550;
    outline-offset: 1px;
}

/* The Danish bases mirrored into the existing basemap control. */
.danish-basemap-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.danish-basemap-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(214, 69, 80, 0.45);
    flex-shrink: 0;
}

.danish-basemap-btn.active .danish-basemap-dot {
    background: #d64550;
}

.danish-basemap-name {
    white-space: nowrap;
}

/* Everything the module creates must stay reachable by keyboard: the panel
   rows use real inputs, and this keeps the focus ring visible on the dark
   glass. */
.danish-layer-label input:focus-visible,
.danish-layer-info:focus-visible,
.danish-layer-slider:focus-visible,
.danish-year-select:focus-visible,
.danish-basemap-btn:focus-visible {
    outline: 2px solid #d64550;
    outline-offset: 1px;
}

@media (prefers-reduced-motion: reduce) {
    #transpPanel .transp-layer-row,
    #histSubLayers > div,
    #lidarSubLayers > div,
    #romanSubLayers > div,
    #histPremiumSubLayers > div,
    #histExpandIcon,
    #lidarExpandIcon,
    #romanExpandIcon,
    #histPremiumExpandIcon {
        transition: none !important;
    }
}

/* ── Albania ASIG layers (js/asig-albania-layers.config.js) ─────────────────
   One Albania-owned group (#albaniaRow → #albaniaSubLayers); the rows are not
   mounted in the Romanian/Denmark/Finland sections any more. The group exists
   only while Albania is the selected country: js/asig-albania-layers.js keeps
   .albania-out-of-country on it for every other ISO — and in the global view
   with no country selected. The HTML ships the class, so the rows never flash
   before the module runs. The rule is not scoped to .country-filter-active
   because the gate must also hold when no country filter is applied. */
#albaniaRow.albania-out-of-country {
    display: none !important;
}

.asig-section-mount {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
    padding-left: 6px;
    border-left: 2px solid rgba(228, 30, 32, 0.3);
}

.albania-layer-section {
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.5;
    margin-top: 2px;
}

.albania-layer-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.albania-layer-head {
    display: flex;
    align-items: center;
    gap: 6px;
}

.albania-layer-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.albania-layer-go {
    border: 1px solid rgba(224, 69, 69, 0.45);
    border-radius: 3px;
    padding: 2px 5px;
    background: none;
    color: rgba(245, 240, 235, 0.78);
    font: inherit;
    font-size: 0.62rem;
    cursor: pointer;
}

.albania-layer-go:hover,
.albania-layer-go:focus-visible {
    border-color: #e04545;
    color: #fff;
}

.albania-layer-label {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
    cursor: pointer;
    font-size: 0.78rem;
    color: rgba(245, 240, 235, 0.78);
}

.albania-layer-label input {
    flex-shrink: 0;
    accent-color: #e04545;
    width: 13px;
    height: 13px;
    cursor: pointer;
}

.albania-layer-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.albania-layer-info {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(245, 240, 235, 0.35);
    background: none;
    color: rgba(245, 240, 235, 0.7);
    font-size: 0.6rem;
    line-height: 1;
    cursor: pointer;
}

.albania-layer-info:hover,
.albania-layer-info:focus-visible {
    border-color: #e04545;
    color: #fff;
}

.albania-layer-opacity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    opacity: 0.6;
    padding-left: 19px;
}

.albania-layer-slider {
    margin-left: 19px;
    width: calc(100% - 19px);
}

.albania-layer-status {
    font-size: 0.66rem;
    line-height: 1.3;
    /* No 19px indent: the row no longer starts with a native checkbox —
       title and pill switch share the header line, like Romania's rows. */
    padding-left: 0;
    opacity: 0.7;
}

.albania-layer-status.is-error {
    color: #ffb4a2;
    opacity: 1;
}

.albania-layer-status.is-warn {
    color: #ffd166;
    opacity: 1;
}


.albania-layer-row.is-active .albania-layer-title {
    color: rgba(245, 240, 235, 0.98);
}

/* ── ASIG catalogue panel (js/asig-albania-layers.js) ──────────────────────
   Same dark glass as the rest of the panel: a search box, the active-layer
   list (reorder + remove), the single Heritage toggle at the top, then one
   collapsible section per catalogue section. */

.albania-catalogue-tools {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.albania-search {
    width: 100%;
    padding: 5px 8px;
    border-radius: 4px;
    border: 1px solid rgba(245, 240, 235, 0.18);
    background: rgba(13, 26, 43, 0.85);
    color: rgba(245, 240, 235, 0.9);
    font: inherit;
    font-size: 0.74rem;
}

.albania-search::placeholder {
    color: rgba(245, 240, 235, 0.4);
}

.albania-search:focus-visible {
    outline: 2px solid #e04545;
    outline-offset: 1px;
}

.albania-active {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.albania-active-empty {
    font-size: 0.68rem;
    opacity: 0.5;
}

.albania-active-head {
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.55;
    margin-top: 2px;
}

.albania-active-item {
    border: 1px solid var(--ctl-border);
    border-radius: 8px;
    padding: 6px 8px;
    background: var(--ctl-bg);
    box-shadow: 0 4px 14px rgba(4, 6, 18, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.albania-active-top {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.albania-active-top b {
    flex: 1;
    min-width: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(245, 240, 235, 0.92);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.albania-active-parts {
    font-size: 0.6rem;
    opacity: 0.5;
    flex-shrink: 0;
}

.albania-active-move,
.albania-active-remove {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    padding: 0;
    border-radius: 3px;
    border: 1px solid rgba(245, 240, 235, 0.2);
    background: none;
    color: rgba(245, 240, 235, 0.75);
    font-size: 0.66rem;
    line-height: 1;
    cursor: pointer;
}

.albania-active-move:hover,
.albania-active-move:focus-visible,
.albania-active-remove:hover,
.albania-active-remove:focus-visible {
    border-color: #e04545;
    color: #fff;
}

.albania-active-slider {
    width: 100%;
    margin: 0;
}

.albania-active-hint {
    font-size: 0.62rem;
    line-height: 1.3;
    opacity: 0.65;
}

.albania-active-hint.is-warn {
    color: #ffd166;
    opacity: 1;
}

/* The block itself is a Romania-style `.transp-layer-row` (the shared rule
   supplies the glass box and padding); only the stacking is kept here. */
.albania-heritage-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.albania-heritage-caption {
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgba(245, 240, 235, 0.82);
}

.albania-heritage-note {
    font-size: 0.62rem;
    line-height: 1.3;
    padding-left: 0;
    opacity: 0.55;
}

.albania-layer-parts {
    flex-shrink: 0;
    font-size: 0.62rem;
    opacity: 0.5;
}

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

.albania-section-head {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 4px 2px;
    border: 0;
    background: none;
    color: rgba(245, 240, 235, 0.72);
    font: inherit;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    text-align: left;
}

.albania-section-head:hover,
.albania-section-head:focus-visible {
    color: #fff;
    outline: none;
}

.albania-section-caret {
    color: rgba(224, 69, 69, 0.9);
    font-size: 0.62rem;
    width: 9px;
    flex-shrink: 0;
}

.albania-section-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.albania-section-count {
    opacity: 0.45;
    font-size: 0.62rem;
    flex-shrink: 0;
}

/* Like the other countries' SubLayers columns: an indented stack with a
   2px accent rail (Albania's ASIG red, matching the mount rail above). */
.albania-section-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 6px;
    border-left: 2px solid rgba(228, 30, 32, 0.3);
}

/* Map-click feature info: one sandboxed iframe per endpoint. */
.albania-feature-info {
    max-height: 46vh;
    overflow: auto;
}

.albania-feature-info h4 {
    margin: 4px 0 2px;
    font-size: 0.72rem;
}

.albania-feature-frame {
    width: 100%;
    height: 130px;
    border: 1px solid rgba(245, 240, 235, 0.2);
    border-radius: 4px;
    margin-bottom: 6px;
    background: #fff;
}

/* The "Protected Sites" toggle group: a caption the visitor can collapse,
   with the four child checkboxes nested underneath (transparent overlays). */




/* Everything the module creates must stay reachable by keyboard: the panel
   rows use real inputs, and this keeps the focus ring visible on the dark
   glass. */
.albania-layer-label input:focus-visible,
.albania-layer-info:focus-visible,
.albania-layer-go:focus-visible,
.albania-layer-slider:focus-visible {
    outline: 2px solid #e04545;
    outline-offset: 1px;
}

/* ── Finnish layers (js/finland-layers.config.js + js/finland-layers.js)
   The rows are generated and mirror the Albanian ones (same structure, same
   keyboard rules), plus the two extra levels the Finnish panel has: a
   collapsible SECTION per group whose caption carries an "all on/off"
   checkbox (Terrain / Cadastral / Protected sites / Åland / Local files) and,
   inside "Protected sites", a collapsible SUB-SECTION per register category
   with its colour swatch. The accent is the Finnish ice blue (#6fb3e0). */
.finland-sublayers {
    padding-left: 6px;
    border-left: 2px solid rgba(111, 179, 224, 0.3);
}

.finland-layer-section {
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.5;
    margin-top: 2px;
}

.finland-layer-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.finland-layer-row.is-blocked {
    opacity: 0.55;
}

.finland-layer-head {
    display: flex;
    align-items: center;
    gap: 6px;
}

.finland-layer-label {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
    cursor: pointer;
    font-size: 0.78rem;
    color: rgba(245, 240, 235, 0.78);
}

.finland-layer-label input {
    flex-shrink: 0;
    accent-color: #6fb3e0;
    width: 13px;
    height: 13px;
    cursor: pointer;
}

.finland-layer-label input:disabled {
    cursor: not-allowed;
}

.finland-layer-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.finland-layer-info {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(245, 240, 235, 0.35);
    background: none;
    color: rgba(245, 240, 235, 0.7);
    font-size: 0.6rem;
    line-height: 1;
    cursor: pointer;
}

.finland-layer-info:hover,
.finland-layer-info:focus-visible {
    border-color: #6fb3e0;
    color: #fff;
}

.finland-layer-opacity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    opacity: 0.6;
    padding-left: 19px;
}

.finland-layer-slider {
    margin-left: 19px;
    width: calc(100% - 19px);
}

.finland-layer-status {
    font-size: 0.66rem;
    line-height: 1.3;
    padding-left: 19px;
    opacity: 0.7;
}

.finland-layer-status.is-error {
    color: #ffb4a2;
    opacity: 1;
}

.finland-layer-status.is-warn {
    color: #ffd166;
    opacity: 1;
}

.finland-layer-note {
    font-size: 0.62rem;
    line-height: 1.35;
    padding-left: 19px;
    opacity: 0.55;
    color: rgba(245, 240, 235, 0.75);
}

.finland-layer-retry {
    background: none;
    border: 1px solid rgba(111, 179, 224, 0.5);
    border-radius: 3px;
    color: #9fd0ee;
    font-size: 0.6rem;
    padding: 1px 5px;
    cursor: pointer;
    margin-left: 4px;
}

.finland-layer-retry:hover,
.finland-layer-retry:focus-visible {
    background: rgba(111, 179, 224, 0.18);
    color: #d3ecfb;
}

.finland-group-notice {
    font-size: 0.68rem;
    line-height: 1.35;
    color: #ffd166;
    border-left: 2px solid rgba(255, 209, 102, 0.5);
    padding: 3px 0 3px 7px;
    margin: 0 0 6px;
}

.finland-layer-row.is-active .finland-layer-title {
    color: rgba(245, 240, 235, 0.98);
}

/* The group sections: a caption row (master checkbox + collapse button) with
   the body below. The checkbox is deliberately OUTSIDE the button —
   interactive content inside a <button> is invalid and unreliable. */
.finland-group-caption {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.finland-group-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    padding: 0;
    border: none;
    background: none;
    color: rgba(245, 240, 235, 0.82);
    font: inherit;
    cursor: pointer;
    text-align: left;
}

.finland-group-master {
    flex-shrink: 0;
    accent-color: #6fb3e0;
    width: 13px;
    height: 13px;
    cursor: pointer;
}

.finland-group-chevron {
    color: rgba(111, 179, 224, 0.85);
    font-size: 0.72rem;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.finland-group-body {
    padding-left: 10px;
}

/* The register-category sub-sections inside "Protected sites". */
.finland-subgroup-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 9px;
}

.finland-subgroup-caption {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    border: none;
    background: none;
    color: rgba(245, 240, 235, 0.8);
    font: inherit;
    font-size: 0.72rem;
    cursor: pointer;
    text-align: left;
    min-width: 0;
    flex: 1;
}

.finland-subgroup-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.finland-subgroup.is-blocked .finland-subgroup-title {
    opacity: 0.55;
}

.finland-protected-chevron {
    color: rgba(111, 179, 224, 0.8);
    font-size: 0.66rem;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.finland-swatch {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    border: 1px solid rgba(245, 240, 235, 0.5);
    flex-shrink: 0;
}

.finland-subgroup-body {
    padding-left: 19px;
}

/* Keyboard reach, same rule as the Albanian rows. */
.finland-layer-label input:focus-visible,
.finland-layer-info:focus-visible,
.finland-layer-slider:focus-visible,
.finland-layer-retry:focus-visible,
.finland-group-caption:focus-visible,
.finland-subgroup-caption:focus-visible {
    outline: 2px solid #6fb3e0;
    outline-offset: 1px;
}

/* The identify popups: English title, Finnish original underneath, a compact
   table of translated attributes, the KYPPI link and the attribution. */
.finland-popup {
    font-family: 'Outfit', sans-serif;
    min-width: 190px;
    max-width: 300px;
}

.finland-popup-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1c1c1e;
    margin-bottom: 2px;
}

.finland-popup-fi {
    font-size: 0.66rem;
    opacity: 0.6;
    color: #1c1c1e;
    margin-bottom: 5px;
}

.finland-popup-table {
    border-collapse: collapse;
    font-size: 0.7rem;
    color: #1c1c1e;
    margin: 4px 0;
}

.finland-popup-table th {
    text-align: left;
    padding: 1px 8px 1px 0;
    font-weight: 500;
    opacity: 0.6;
    vertical-align: top;
    white-space: nowrap;
}

.finland-popup-table td {
    padding: 1px 0;
    vertical-align: top;
}

.finland-popup-link {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.7rem;
    color: #0b62a4;
}

.finland-popup-attr {
    margin-top: 6px;
    font-size: 0.6rem;
    line-height: 1.3;
    opacity: 0.55;
    color: #1c1c1e;
}

.finland-popup-note {
    margin-top: 3px;
    font-size: 0.6rem;
    line-height: 1.3;
    opacity: 0.7;
    color: #1c1c1e;
    border-top: 1px solid rgba(28, 28, 30, 0.12);
    padding-top: 3px;
}


/* ── GOOGLE MAPS DIRECTIONS BUTTON (popups) ────────────────────────────────
   Butonul „🧭 Traseu Google Maps / Directions” generat de js/google-maps-
   directions.js și injectat în popup-urile: punctelor LIDAR Scanner, candidaților
   Raportului arheologic, bulelor cu potențial arheologic, pinurilor salvate și
   evenimentelor. Anchor real (target=_blank) — navigația pornește din locația
   curentă a utilizatorului spre CENTRUL cercului/pinului, oricât de mare ar fi
   raza acestuia. Verdele e cel Google Maps (#34A853), ca utilizatorul să-l
   recunoască instant printre acțiunile mov/portocalii ale popup-ului. */
a.dl-gmaps-directions-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 8px;
    padding: 6px 8px;
    background: rgba(52, 168, 83, 0.14);
    border: 1px solid rgba(52, 168, 83, 0.55);
    border-radius: 4px;
    color: #8fdca6;
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

    a.dl-gmaps-directions-btn:hover,
    a.dl-gmaps-directions-btn:focus-visible {
        background: rgba(52, 168, 83, 0.30);
        border-color: rgba(52, 168, 83, 0.85);
        color: #b8eec8;
        text-decoration: none;
    }

    a.dl-gmaps-directions-btn .dl-gmaps-directions-icon {
        flex: 0 0 auto;
        font-size: 0.85rem;
    }

    a.dl-gmaps-directions-btn .dl-gmaps-directions-label {
        flex: 1 1 auto;
    }

/* În coloana flex a popup-ului de pin salvat, gap-ul containerului adună
   deja spațiul — margin-top-ul implicit al butonului ar dubla distanța. */
.coord-popup-container.pin-popup a.dl-gmaps-directions-btn {
    margin-top: 0;
}


/* DARE category badges provide their own circular SVG background. */
.leaflet-div-icon.dare-icon-marker { background: transparent; border: 0; }

/* Free Danish source groups, using native keyboard-accessible disclosure. */
.danish-layer-group {
    margin-top: 8px;
    border-top: 1px solid rgba(214, 69, 80, 0.2);
    padding: 6px 0;
}
.danish-layer-group > summary {
    cursor: pointer;
    padding: 6px 0;
    opacity: 0.85;
}
.danish-layer-group > summary:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Country catalogues expose ordinary sections, not another master layer. */
.country-section-list,
.country-section-list > #albaniaSubLayers,
.country-section-list > #danishSubLayers {
    display: contents !important;
}
.country-section-list.country-layer-unavailable,
.country-section-list.albania-out-of-country,
.country-section-list.viewport-layer-unavailable {
    display: none !important;
}
/* The Free/Premium tabs gate `.transp-layer-row[data-category]`, but these
   containers are display:contents, so a child that is not itself a
   transp-layer-row (Albania's Heritage block used to be a plain div)
   leaked into the Premium tab and duplicated the free layer there.
   Gate the whole free country catalogue by the tab .active marker that
   switchLayerTab() keeps on every [data-category] element: free country
   layers (Albania's Heritage included) belong to the Free tab only. */
.country-section-list[data-category]:not(.active) {
    display: none !important;
}

.asig-heritage-cluster { background:#7354a3; color:#fff; border:2px solid #e6d7ff; border-radius:50%; text-align:center; line-height:28px; font-weight:bold; box-shadow:0 1px 5px #0008; }

/* ── United Kingdom · Heritage (js/uk-heritage-layers.js) ───────────────────
   A FREE group in the shape of every other country catalogue: one Romania-style
   `.transp-layer-row` header (title, ⓘ, expand chevron, master switch, group
   opacity slider) over a left-bordered `#ukHeritageSubLayers` column of one row
   per register. Each row is the shared glass `.dl-sublayer-row` box with the
   `.apm-toggle-switch` pill switch, the `.transp-layer-label` opacity line
   (`.pct` badge + `.layer-info-btn`) and the shared `.transp-slider` — the same
   material as Romania's sublayers, the Danish rows and the Finnish rows.

   The registers are free layers, so the group and every row carry
   data-category="free". The tabs gate `.transp-layer-row[data-category]`, which
   covers the group; the `[data-category]` rules below extend that same gate to
   the register rows, which are nested `.dl-sublayer-row`s rather than
   top-level rows. Nothing in this family can therefore be listed under
   Premium — the duplicate that used to appear there is gone. */
.uk-heritage-group {
    --uk-heritage-accent: #d9a441;
}

/* Country gate: the registers publish England + Wales only, so the group is
   hidden outright whenever the selected country is not the United Kingdom
   (js/uk-heritage-layers.js filter()). The ID in front of each selector keeps
   the gate above the tab rules, which set display on both levels. */
#transpPanel #ukHeritageRow.country-layer-unavailable,
#transpPanel .uk-heritage-sublayer.country-layer-unavailable {
    display: none !important;
}

.uk-heritage-sublayers {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.uk-heritage-sublayer[data-category] {
    display: none !important;
}

.uk-heritage-sublayer[data-category].active {
    display: flex !important;
    flex-direction: column;
    gap: 4px;
}

.uk-heritage-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: rgba(245, 240, 235, 0.75);
    margin-bottom: 5px;
}

.uk-heritage-title-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    min-width: 0;
}

.uk-heritage-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.uk-heritage-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.uk-heritage-provider {
    flex-shrink: 0;
    font-size: 0.62rem;
    font-style: italic;
    opacity: 0.5;
    white-space: nowrap;
}

.uk-heritage-sublayer.is-active .uk-heritage-title {
    color: rgba(245, 240, 235, 0.98);
}

.uk-heritage-opacity-line {
    margin-bottom: 5px;
    margin-top: 2px;
}

.uk-heritage-slider {
    margin-top: 0;
}

.uk-heritage-status {
    display: none;
    font-size: 0.66rem;
    line-height: 1.3;
    opacity: 0.7;
    margin-top: 1px;
}

.uk-heritage-status.is-count,
.uk-heritage-status.is-hint {
    opacity: 0.6;
}

.uk-heritage-status.is-error {
    color: #ffb4a2;
    opacity: 1;
}

/* The shared pill switch hides its checkbox, so keyboard focus has to land on
   the track that follows it; the ⓘ and the sliders keep their own ring. */
#transpPanel .uk-heritage-sublayer .apm-toggle-switch input:focus-visible + .apm-toggle-track,
#transpPanel .uk-heritage-group .apm-toggle-switch input:focus-visible + .apm-toggle-track,
#transpPanel .uk-heritage-group button:focus-visible {
    outline: 2px solid var(--uk-heritage-accent, #d9a441);
    outline-offset: 1px;
}

.uk-heritage-sublayer .uk-heritage-slider:focus-visible,
.uk-heritage-sublayer .layer-info-btn:focus-visible {
    outline: 2px solid var(--uk-heritage-accent, #d9a441);
    outline-offset: 1px;
}

/* 375 px: the register names are long, so the provider tag may wrap under the
   title instead of pushing the switch off the row. */
@media (max-width: 430px) {
    .uk-heritage-title-wrap {
        flex-wrap: wrap;
        row-gap: 2px;
    }

    .uk-heritage-title {
        white-space: normal;
        line-height: 1.25;
    }
}
