        /* ===== LOCAL FONTS ===== */

        /* Inter - Latin Extended */
        @font-face {
            font-family: 'Inter';
            font-style: normal;
            font-weight: 100 900;
            font-display: swap;
            src: url('fonts/inter-latin-ext.woff2') format('woff2');
            unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
        }

        /* Inter - Latin */
        @font-face {
            font-family: 'Inter';
            font-style: normal;
            font-weight: 100 900;
            font-display: swap;
            src: url('fonts/inter-latin.woff2') format('woff2');
            unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
        }

        /* JetBrains Mono - Latin Extended */
        @font-face {
            font-family: 'JetBrains Mono';
            font-style: normal;
            font-weight: 100 800;
            font-display: swap;
            src: url('fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
            unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
        }

        /* JetBrains Mono - Latin */
        @font-face {
            font-family: 'JetBrains Mono';
            font-style: normal;
            font-weight: 100 800;
            font-display: swap;
            src: url('fonts/jetbrains-mono-latin.woff2') format('woff2');
            unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
        }

        /* ===== DESIGN TOKENS (CSS Variables) ===== */
        :root {
            /* Primary Colors */
            --color-primary: #3498db;
            --color-primary-dark: #2980b9;
            --color-primary-light: #5dade2;
            --color-primary-bg: #e3f2fd;

            /* Secondary Colors */
            --color-secondary: #27ae60;
            --color-secondary-dark: #229954;
            --color-secondary-light: #2ecc71;

            /* Accent Colors */
            --color-accent-orange: #e67e22;
            --color-accent-red: #e74c3c;
            --color-accent-purple: #9b59b6;
            --color-accent-yellow: #f39c12;
            --color-accent-cyan: #00bcd4;

            /* Neutral Colors */
            --color-dark: #0a0f1a;
            --color-dark-alt: #2c3e50;
            --color-gray-900: #333;
            --color-gray-800: #555;
            --color-gray-700: #666;
            --color-gray-600: #777;
            --color-gray-500: #888;
            --color-gray-400: #999;
            --color-gray-300: #bdc3c7;
            --color-gray-200: #ddd;
            --color-gray-100: #eee;
            --color-gray-50: #f5f5f5;
            --color-white: #fff;

            /* Background Colors */
            --bg-primary: #ffffff;
            --bg-secondary: #f8f9fa;
            --bg-tertiary: #fafafa;
            --bg-dark: #0a0f1a;
            --bg-overlay: rgba(0, 0, 0, 0.6);

            /* Border Colors */
            --border-light: #eee;
            --border-medium: #ddd;
            --border-dark: #ccc;

            /* Shadow Tokens */
            --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
            --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.15);
            --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.2);
            --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.25);

            /* Border Radius */
            --radius-sm: 4px;
            --radius-md: 6px;
            --radius-lg: 8px;
            --radius-xl: 12px;
            --radius-full: 50%;

            /* Spacing Scale */
            --space-xs: 4px;
            --space-sm: 8px;
            --space-md: 12px;
            --space-lg: 16px;
            --space-xl: 20px;
            --space-2xl: 24px;

            /* Typography — civic-ledger rollout 2026-07-20: serif everywhere (fonts + palette only) */
            --font-family: var(--ms-serif, Charter, "Bitstream Charter", Cambria, "Palatino Linotype", Georgia, serif);
            --font-family-mono: var(--ms-serif, Charter, "Bitstream Charter", Cambria, "Palatino Linotype", Georgia, serif);

            --font-size-xs: 10px;
            --font-size-sm: 11px;
            --font-size-base: 13px;
            --font-size-md: 14px;
            --font-size-lg: 16px;
            --font-size-xl: 18px;
            --font-size-2xl: 20px;

            --font-weight-normal: 400;
            --font-weight-medium: 500;
            --font-weight-semibold: 600;
            --font-weight-bold: 700;
            --font-weight-extrabold: 800;

            /* Transitions */
            --transition-fast: 0.15s ease;
            --transition-base: 0.2s ease;
            --transition-slow: 0.3s ease;

            /* Z-Index Scale */
            --z-base: 1;
            --z-dropdown: 100;
            --z-sticky: 500;
            --z-overlay: 1000;
            --z-modal: 2000;
            --z-toast: 10000;
            --z-lightbox: 20000;
            --z-upload: 25000;

            /* Toolbar height token — consumed by toolbar, dock padding-top, and controls offset.
               Override to 48px inside the landscape @media below. */
            --toolbar-h: 60px;
        }

        /* ===== DARK MODE OVERRIDES ===== */
        .dark-mode {
            /* GIS unification: dark palette converged to Eliot's design-system colors.
               2026-07-20 civic-ledger rollout: color-primary, bg-*, and border-* tokens
               retoned from cyan/slate onto navy/gold (fonts + palette only). Gray ramp,
               accent- and status colors are left as-is (neutral / semantic, not brand). */
            --color-primary: var(--cl-gold, #c9a962);
            --color-primary-dark: var(--cl-gold-deep, #8a6206);
            --color-primary-light: var(--cl-gold-2, #e9c66b);
            --bg-primary: var(--cl-navy-ink, #0a1826);
            --bg-secondary: var(--cl-navy-2, #142840);
            --bg-tertiary: var(--cl-navy-ink, #0a1826);
            --bg-dark: var(--cl-navy-ink, #0a1826);
            --bg-overlay: rgba(0, 0, 0, 0.85);

            --color-white: #f8fafc;
            --color-gray-900: #f1f5f9;
            --color-gray-800: #e2e8f0;
            --color-gray-700: #cbd5e1;
            --color-gray-600: #94a3b8;
            --color-gray-500: #64748b;
            --color-gray-400: #475569;
            --color-gray-300: #334155;
            --color-gray-200: #1e293b;
            --color-gray-100: #0f172a;
            --color-gray-50: #020617;

            --color-dark: #f8fafc;
            --color-dark-alt: #e2e8f0;
            --border-light: rgba(233, 198, 107, 0.14);
            --border-medium: rgba(233, 198, 107, 0.20);
            --border-dark: rgba(233, 198, 107, 0.34);

            --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
            --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
            --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
        }

        /* Numeric Emphasis Utility */
        .numeric-emphasis {
            font-family: var(--font-family-mono);
            font-weight: 700;
            letter-spacing: -0.01em;
        }

        /* Dark Mode Toggle Component */
        .dark-mode-toggle-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: var(--space-sm) 0;
            border-bottom: 1px solid var(--border-light);
            margin-bottom: var(--space-sm);
        }

        .dark-mode-toggle-info {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 13px;
            font-weight: 600;
            color: var(--color-gray-800);
        }

        .dark-mode-toggle-info svg {
            color: var(--color-primary);
        }

        /* Switch UI */
        .switch {
            position: relative;
            display: inline-block;
            width: 44px;
            height: 22px;
        }

        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #e2e8f0;
            transition: .3s;
            border-radius: 34px;
            border: 1px solid rgba(0, 0, 0, 0.05);
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 16px;
            width: 16px;
            left: 2px;
            bottom: 2px;
            background-color: white;
            transition: .3s;
            border-radius: 50%;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
        }

        input:checked+.slider {
            background-color: var(--color-primary);
        }

        input:focus+.slider {
            box-shadow: 0 0 1px var(--color-primary);
        }

        input:checked+.slider:before {
            transform: translateX(22px);
        }

        * {
            box-sizing: border-box;
        }

        body,
        html {
            margin: 0;
            padding: 0;
            height: 100%;
            overflow: hidden;
            font-family: var(--font-family);
            font-size: var(--font-size-base);
            color: var(--color-gray-800);
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            -webkit-text-size-adjust: 100%; /* Prevent iOS text size adjustment */
            -ms-text-size-adjust: 100%;
            text-size-adjust: 100%;
            touch-action: pan-x pan-y; /* Allow scrolling but prevent zoom gestures */
        }

        #app-container {
            position: relative;
            display: flex;
            flex-direction: column;
            height: 100%;
        }

        /* ===== TOP TOOLBAR ===== */
        #toolbar {
            /* GIS unification: float the toolbar over the full-viewport map (Eliot look) */
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            flex-shrink: 0;
            height: var(--toolbar-h);
            /* GIS unification: transparent dark-glass toolbar (Eliot look) — chips float over the dark bg */
            background: transparent;
            color: var(--color-white);
            display: flex;
            align-items: center;
            padding: 0 var(--space-xl);
            box-shadow: none;
            /* dock-fix 2026-06-17: dock-panel is z-index:500; toolbar must paint above it.
               601 sits between --z-sticky (500) and --z-overlay (1000). Mobile overrides
               #dock-panel to position:fixed z-index:9999 !important so this is desktop-only
               in practice, but the @media guard below makes the intent explicit. */
            z-index: var(--z-sticky);
            gap: var(--space-sm);
            overflow-x: auto;
            overflow-y: hidden;
            flex-wrap: nowrap;
            -webkit-overflow-scrolling: touch;
            border-bottom: none;
            justify-content: space-between;
        }

        /* Desktop-only: ensure toolbar floats above the solid #dock-panel box.
           (Mobile already overrides #dock-panel to z-index:9999 !important so
            the toolbar's desktop z-index is irrelevant there.) */
        @media (min-width: 769px) {
            #toolbar {
                z-index: 601;
            }
        }

        .toolbar-left,
        .toolbar-right {
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }

        .navbar-sep {
            width: 1px;
            height: 28px;
            background: linear-gradient(180deg, rgba(148, 163, 184, 0.06) 0%, rgba(148, 163, 184, 0.50) 50%, rgba(148, 163, 184, 0.06) 100%);
            border-radius: 1px;
            flex-shrink: 0;
            margin: 0 3px;
        }

        #toolbar::-webkit-scrollbar {
            height: 4px;
        }

        #toolbar::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 2px;
        }

        #toolbar>* {
            flex-shrink: 0;
        }

        .btn-logout {
            background: rgba(231, 76, 60, 0.1);
            color: var(--color-accent-red);
            border: 1px solid rgba(231, 76, 60, 0.2);
        }

        .btn-logout:hover {
            background: var(--color-accent-red);
            color: white;
            border-color: var(--color-accent-red);
        }

        .brand {
            display: flex;
            align-items: center;
            font-weight: 600;
            font-size: 1.4em;
            letter-spacing: 1px;
            color: #ecf0f1;
            text-decoration: none;
            overflow: hidden;
            margin-right: 2px;
            /* GIS unification: float the brand transparently (no dark box) like the chips */
            background-color: transparent;
            padding-right: 6px;
        }

        /* The brand label used to show for 5s, collapse itself, then slide back
           out whenever the pointer crossed the logo — motion in the corner of
           the eye every time you reached for a toolbar button. The logo is now
           a static mark: the label stays in the DOM for screen readers and the
           accessible name, but takes no width and never animates. */
        .brand-text {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0 0 0 0);
            clip-path: inset(50%);
            white-space: nowrap;
            border: 0;
        }

        #content-area {
            display: flex;
            flex-direction: column;
            flex-grow: 1;
            /* Full height — the toolbar now floats over the map instead of taking a row */
            height: 100%;
        }

        #if-authority-status {
            position: absolute;
            right: 6.4em;
            bottom: 0.45em;
            z-index: 2;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 20px;
            height: 20px;
            padding: 0;
            border: 1px solid rgba(15, 23, 42, 0.5);
            border-radius: 50%;
            background: rgba(15, 23, 42, 0.78);
            color: #cbd5e1;
            font: 500 11px/1.3 system-ui, sans-serif;
        }

        #if-authority-status[hidden] {
            display: none;
        }

        #if-authority-status .if-authority-status__dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: #94a3b8;
        }

        #if-authority-status.is-live .if-authority-status__dot {
            background: #22c55e;
        }

        #if-authority-status.is-fallback {
            border-color: rgba(245, 158, 11, 0.5);
            color: #fde68a;
        }

        #if-authority-status.is-fallback .if-authority-status__dot {
            background: #f59e0b;
        }

        #if-authority-status-text {
            position: absolute;
            right: calc(100% + 6px);
            display: none;
            white-space: nowrap;
        }

        #if-authority-status:is(:hover, :focus-within) #if-authority-status-text {
            display: block;
        }

        @media (max-width: 768px), (pointer: coarse) {
            body.gpwa-on #if-authority-status {
                margin: 0;
                padding: 4px 6px;
            }

            body.gpwa-on #if-authority-status-text {
                font-size: 0;
            }

            body.gpwa-on #if-authority-status-text::after {
                content: attr(data-short-label);
                font-size: 10px;
            }

            body.gpwa-on #if-authority-status:is(:hover, :focus-within) #if-authority-status-text {
                font-size: 10px;
            }

            body.gpwa-on #if-authority-status:is(:hover, :focus-within) #if-authority-status-text::after {
                content: none;
            }
        }

        #map-row {
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap;
            flex-grow: 1;
            width: 100%;
            min-height: 0;
            /* Changed from 100px to 0 to prevent forcing height */
            overflow: hidden;
            position: relative;
        }

        #map {
            --if-map-seal-attribution-bottom-inset: 5px;
            --if-map-seal-attribution-touch-height: 28px;
            --if-map-seal-attribution-gap: 8px;
            --if-map-seal-bottom-offset: 41px;
            flex-grow: 1;
            height: 100%;
            background: #d0e4f7;
            position: relative;
            min-width: 0;
            /* Allow shrinking */
            flex-basis: 0;
            /* Ensures proper space distribution */
        }

        /* ===== SELECTED LOTS (SMALL MAP OVERLAY, TOP-LEFT) ===== */
        .map-selection-overlay {
            position: absolute;
            top: calc(var(--toolbar-h) + 10px);
            left: 50px;
            z-index: 25;
            pointer-events: none;
            display: none;
            max-width: min(320px, calc(100% - 20px));
            padding: 10px 14px;
            border-radius: 10px;
            background: rgba(2, 6, 23, 0.85);
            border: 1px solid rgba(255, 255, 255, 0.14);
            backdrop-filter: blur(12px);
            color: rgba(255, 255, 255, 0.92);
            font-size: 11px;
            font-weight: 700;
            line-height: 1.5;
            letter-spacing: 0.02em;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
            text-transform: uppercase;
        }

        .map-selection-overlay .overlay-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 3px 0;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .map-selection-overlay .overlay-row:last-child {
            border-bottom: none;
        }

        .map-selection-overlay .overlay-label {
            color: rgba(255, 255, 255, 0.65);
            font-weight: 600;
            font-size: 10px;
        }

        .map-selection-overlay .overlay-value {
            color: #fff;
            font-weight: 800;
            font-size: 12px;
            font-family: var(--font-family-mono);
        }

        .map-selection-overlay .muted {
            color: rgba(255, 255, 255, 0.65);
            font-weight: 900;
            margin-left: 8px;
        }

        .map-selection-overlay .strong {
            color: #fff;
            font-weight: 950;
        }

        /* Dock panel: Default 30% width on right side, resizable */
        #dock-panel {
            position: relative;
            /* clear the floating toolbar so the dock header isn't hidden behind it */
            padding-top: var(--toolbar-h);
            width: var(--dock-w, clamp(280px, 30%, 520px));
            min-width: 200px;
            max-width: 60%;

            /* GIS unification: solid Eliot dock color (#16202d), no blur */
            background: #16202d;
            box-shadow: -10px 0 40px rgba(0, 0, 0, 0.40);
            border-left: 1px solid rgba(255, 255, 255, 0.12);

            display: none;
            flex-direction: column;
            z-index: 500;
            height: 100%;
            flex-shrink: 0;
            resize: none;
            overflow-y: auto;
            word-wrap: break-word;
            font-size: var(--font-size-sm);
            box-sizing: border-box;
            font-family: var(--font-family);
        }



        /* Compact dock chrome — unconditional (dock-panel level, unrelated to content width) */
        #dock-panel .dock-header {
            padding: var(--space-md) var(--space-lg);
        }

        #dock-panel .dock-header h3 {
            font-size: var(--font-size-md);
        }

        #dock-panel .dock-close-btn {
            font-size: 16px;
            padding: var(--space-xs);
        }

        /* Compact dock content — only when the dock itself is very narrow (<260px).
           At the current default 30% desktop dock width these rules never fire, so
           behavior is byte-identical on an unchanged install. */
        @container dock-content (max-width: 259px) {
            .parcel-tip {
                padding: 4px;
            }

            .parcel-header h3 {
                font-size: 12px;
                margin: 0;
            }

            .parcel-header p {
                font-size: 9px;
                margin: 2px 0;
            }

            .tab-header {
                flex-direction: column;
                gap: 2px;
            }

            .tab-btn {
                font-size: 9px;
                padding: 6px 4px;
                width: 100%;
                text-align: center;
            }

            .tab-body {
                padding: 6px;
            }

            .tab-body h4 {
                font-size: 10px;
                margin: 4px 0;
            }

            .tab-body ul li {
                font-size: 9px;
                padding: 3px 0;
            }

            .grade-box {
                padding: 6px;
                margin: 4px 0;
            }

            .grade-letter {
                font-size: 18px;
            }

            .grade-rank {
                font-size: 9px;
            }

            .popup-image-container {
                display: none;
            }
        }

        .dock-header {
            padding: var(--space-lg) var(--space-xl);
            background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
            border-bottom: 1px solid var(--border-light);
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
        }

        .dock-header h3 {
            margin: 0;
            font-size: var(--font-size-lg);
            font-weight: var(--font-weight-semibold);
            color: var(--color-dark-alt);
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }

        .dock-close-btn {
            background: none;
            border: none;
            font-size: 22px;
            cursor: pointer;
            color: var(--color-gray-400);
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: var(--radius-md);
            transition: all var(--transition-base);
        }

        .dock-close-btn:hover {
            background: var(--bg-secondary);
            color: var(--color-accent-red);
            transform: scale(1.1);
        }

        /* Dock Resize Handle */
        .dock-resize-handle {
            position: absolute;
            left: -6px;
            top: 0;
            bottom: 0;
            width: 12px;
            background: transparent;
            cursor: ew-resize;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--color-gray-400);
            font-size: 16px;
            letter-spacing: 0;
            writing-mode: vertical-lr;
            text-orientation: mixed;
            transition: all var(--transition-base);
            z-index: 100;
            user-select: none;
        }

        .dock-resize-handle::before {
            content: '';
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            width: 4px;
            height: 40px;
            background: var(--color-gray-400);
            border-radius: 2px;
            opacity: 0.5;
            transition: all var(--transition-base);
        }

        .dock-resize-handle:hover {
            background: rgba(52, 152, 219, 0.1);
        }
        
        .dock-resize-handle:hover::before {
            background: var(--color-primary);
            opacity: 1;
            height: 60px;
        }

        .dock-resize-handle:active {
            background: rgba(52, 152, 219, 0.2);
        }
        
        .dock-resize-handle:active::before {
            background: var(--color-primary);
            opacity: 1;
        }

        /* On mobile, hide the left resize handle and show top handle instead */
        @media (max-width: 768px) {
            .dock-resize-handle {
                left: 0;
                right: 0;
                top: 0;
                bottom: auto;
                width: 100%;
                height: 24px;
                writing-mode: horizontal-tb;
                cursor: ns-resize;
                background: var(--bg-secondary);
                border-bottom: 1px solid var(--border-medium);
            }
            
            .dock-resize-handle::before {
                width: 40px;
                height: 4px;
            }
            
            .dock-resize-handle:hover::before {
                width: 60px;
                height: 4px;
            }
        }

        #dock-content {
            flex: 1;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            min-height: 0;
            /* container-type on content only; NOT on #dock-panel which has an absolute resize handle */
            container-type: inline-size;
            container-name: dock-content;
        }

        #dock-content .parcel-tip {
            max-height: none;
            flex: 1;
            display: flex;
            flex-direction: column;
            min-height: 0;
        }

        #dock-content .tab-body {
            max-height: none;
            flex: 1;
            overflow-y: auto;
            min-height: 0;
        }

        #dock-content .popup-image-container,
        #dock-content .parcel-header,
        #dock-content .tab-header {
            flex-shrink: 0;
        }

        #resize-handle {
            height: 8px;
            background-color: var(--bg-secondary);
            cursor: row-resize;
            flex: none;
            border-top: 1px solid var(--border-medium);
            border-bottom: 1px solid var(--border-medium);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 100;
        }

        #resize-handle:hover {
            background: linear-gradient(90deg, var(--color-gray-300), var(--color-gray-200));
        }

        #resize-handle::after {
            content: "...";
            color: var(--color-gray-500);
            font-size: 16px;
            line-height: 0;
            letter-spacing: 3px;
            font-weight: var(--font-weight-bold);
        }

        #data-table-container {
            height: clamp(150px, 30dvh, 380px);
            max-height: clamp(150px, 45dvh, 480px);
            min-height: 150px;
            display: flex;
            flex-direction: column;
            background: var(--bg-primary);
            border-top: 1px solid var(--border-medium);
            overflow: hidden;
        }

        #data-table {
            flex: 1;
            overflow: auto;
        }

        /* ===== TABLE HEADER + SELECTED-ONLY TOGGLE (parity with Richmond) ===== */

        #table-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 6px;
            padding: 4px 8px;
            border-bottom: 1px solid var(--border-light);
            background: var(--bg-secondary);
            flex-wrap: wrap;
        }

        .table-header-controls {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            margin-left: auto;
            flex-wrap: wrap;
        }

        .table-header-title {
            font-size: 10px;
            font-weight: var(--font-weight-semibold);
            color: var(--color-gray-900);
            line-height: 1;
        }

        .table-clear-filters-btn {
            background: var(--bg-tertiary);
            color: var(--color-gray-800);
            border: 1px solid var(--border-medium);
            border-radius: var(--radius-md);
            padding: 3px 7px;
            font-size: 9px;
            font-weight: 700;
            cursor: pointer;
            white-space: nowrap;
            transition: all var(--transition-fast);
            line-height: 1.1;
        }

        .table-clear-filters-btn:hover {
            background: var(--color-gray-200);
            border-color: var(--border-dark);
        }

        .table-filter-toggle {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 10px;
            color: var(--color-gray-700);
            line-height: 1;
        }

        /* Compact switch size inside the filter toggle (overrides the site-wide 44x22px) */
        .table-filter-toggle .switch {
            flex-shrink: 0;
            width: 34px;
            height: 18px;
        }

        .table-filter-toggle .slider:before {
            width: 12px;
            height: 12px;
            left: 2px;
            bottom: 2px;
        }

        .table-filter-toggle input:checked + .slider:before {
            transform: translateX(16px);
        }

        .table-filter-toggle input:disabled + .slider {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .table-filter-count {
            color: var(--color-gray-500);
            font-variant-numeric: tabular-nums;
            font-size: 9px;
        }

        /* ===== PARCEL DOCK VISIBLE — nudge overlays right to clear the dock ===== */
        /* Mirrors Richmond's html.parcel-dock-visible rules.
           Applies to: Fiscal Command Center overlay (lot-scenario-dashboard). */
        html.parcel-dock-visible #lot-scenario-dashboard.command-center {
            right: max(var(--fiscal-command-right, 14px), calc(max(40%, 320px) + 20px));
            transition: right 0.26s ease, transform 0.26s ease;
        }

        /* Make .ms-count-badge in the dock look and behave like a clickable button */
        .ms-count-badge {
            cursor: pointer;
        }

        /* ===== FILTER TOGGLE BUTTON ===== */


        .logo-img {
            height: 40px;
            width: auto;
            margin-right: 0px;
            object-fit: contain;
        }

        .brand .logo-img {
            height: 40px;
            width: auto;
        }
        #map .if-map-town-seal {
            position: absolute;
            right: 8px;
            bottom: var(--if-map-seal-bottom-offset);
            z-index: 1;
            pointer-events: none;
            display: block;
            width: auto;
            height: 36px;
            object-fit: contain;
        }
        @media (max-width: 768px) {
            #map {
                --if-map-seal-attribution-bottom-inset: 5px;
                --if-map-seal-attribution-touch-height: 28px;
                --if-map-seal-attribution-gap: 7px;
                --if-map-seal-bottom-offset: 40px;
            }
            .brand .logo-img { height: 28px; width: auto; }
            #map .if-map-town-seal { right: 6px; bottom: var(--if-map-seal-bottom-offset); height: 24px; }
        }

        /* ===== UNIFIED BUTTON SYSTEM ===== */
        /* GIS unification: canonical Eliot glass-pill toolbar button */
        .btn-toggle {
            height: 26px;
            padding: 4px 8px;
            color: #e2e8f0;
            font-size: 9.5px;
            font-weight: 800;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            background: linear-gradient(160deg, rgba(30, 64, 110, 0.48) 0%, rgba(15, 42, 80, 0.32) 100%);
            border: 1px solid rgba(201, 169, 98, 0.25);
            border-radius: 10px;
            cursor: pointer;
            white-space: nowrap;
            -webkit-backdrop-filter: blur(26px) saturate(180%);
            backdrop-filter: blur(26px) saturate(180%);
            box-shadow: 0 6px 18px rgba(2, 6, 23, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.28);
            text-shadow: 0 1px 1px rgba(2, 6, 23, 0.5);
            transition: background 160ms ease, border-color 180ms ease, color 160ms ease, transform 160ms ease;
        }

        /* shimmer pseudo-element retired in favor of the glass treatment */
        .btn-toggle::before {
            display: none;
        }

        .btn-toggle:hover {
            background: linear-gradient(160deg, rgba(201, 169, 98, 0.28) 0%, rgba(233, 198, 107, 0.10) 100%);
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
            border-color: rgba(233, 198, 107, 0.70);
            color: #f1f5f9;
        }

        .btn-toggle:hover::before {
            opacity: 1;
        }

        .btn-toggle:active {
            transform: translateY(0);
            box-shadow: var(--shadow-sm);
        }

        .btn-toggle.active {
            background: linear-gradient(160deg, rgba(201, 169, 98, 0.72) 0%, rgba(138, 98, 6, 0.56) 100%);
            border-color: rgba(233, 198, 107, 0.80);
            box-shadow: 0 10px 24px rgba(138, 98, 6, 0.40), inset 0 1px 0 rgba(255, 255, 255, 0.30);
            color: #0d1421;
        }

        .btn-toggle.active::before {
            opacity: 0.2;
        }

        /* Dock Mode Button States */
        .btn-toggle.dock-mode-dock {
            background: linear-gradient(160deg, rgba(201, 169, 98, 0.72) 0%, rgba(138, 98, 6, 0.56) 100%);
            border-color: rgba(233, 198, 107, 0.80);
            color: #0d1421;
            box-shadow: 0 10px 24px rgba(138, 98, 6, 0.40), inset 0 1px 0 rgba(255, 255, 255, 0.30);
        }

        .btn-toggle.dock-mode-popup {
            background: linear-gradient(160deg, rgba(201, 169, 98, 0.28) 0%, rgba(233, 198, 107, 0.10) 100%);
            border-color: rgba(233, 198, 107, 0.70);
        }

        .btn-toggle.dock-mode-off {
            background: linear-gradient(160deg, rgba(100, 116, 139, 0.30) 0%, rgba(71, 85, 105, 0.16) 100%);
            border-color: rgba(148, 163, 184, 0.35);
            opacity: 0.85;
        }

        #clear-selection-btn {
            background: linear-gradient(160deg, rgba(239, 68, 68, 0.55) 0%, rgba(185, 28, 28, 0.42) 100%) !important;
            border-color: rgba(254, 202, 202, 0.55) !important;
            color: #fff !important;
        }
        #clear-selection-btn:hover {
            background: linear-gradient(160deg, rgba(239, 68, 68, 0.75) 0%, rgba(185, 28, 28, 0.62) 100%) !important;
            border-color: rgba(254, 202, 202, 0.80) !important;
        }

        /* Slightly darker background for TIF, COMPARE, STATS, RANKINGS, MORTGAGE, GROWTH */
        .btn-toggle.btn-toggle-nav-feature {
            background: linear-gradient(160deg, rgba(30, 64, 110, 0.48) 0%, rgba(15, 42, 80, 0.32) 100%);
            border: 1px solid rgba(201, 169, 98, 0.25);
        }
        .btn-toggle.btn-toggle-nav-feature:hover {
            background: linear-gradient(160deg, rgba(201, 169, 98, 0.28) 0%, rgba(233, 198, 107, 0.10) 100%);
            border-color: rgba(233, 198, 107, 0.70);
        }

        /* Navbar button with icon and animated text */
        .btn-toggle {
            display: inline-flex;
            align-items: center;
            gap: 5px;
        }

        .btn-toggle svg {
            flex-shrink: 0;
            width: 16px;
            height: 16px;
        }

        .btn-text {
            display: inline-block;
            white-space: nowrap;
            overflow: hidden;
            max-width: 120px;
            opacity: 1;
            transition: max-width 0.8s ease-out, opacity 0.8s ease-out;
        }

        .btn-toggle:hover .btn-text {
            max-width: 120px !important;
            opacity: 1 !important;
        }

        .btn-text.intro-done {
            max-width: 0;
            opacity: 0;
        }

        /* ===== USER PROFILE DROPDOWN ===== */
        #user-profile-nav {
            cursor: pointer;
            user-select: none;
            position: relative !important;
            z-index: 2147483647 !important;
            /* iOS touch fixes */
            -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
            touch-action: manipulation;
            -webkit-touch-callout: none;
            -webkit-user-select: none;
        }

        #user-profile-nav:focus {
            outline: none;
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.25);
        }

        #user-profile-dropdown {
            display: none;
            position: fixed !important;
            top: 0;
            left: 0;
            min-width: 190px;
            padding: 6px;
            background: rgba(15, 23, 42, 0.98);
            border: 2px solid rgba(255, 255, 255, 0.35);
            border-radius: 10px;
            box-shadow: var(--shadow-lg), 0 0 0 1px rgba(52, 152, 219, 0.2);
            z-index: 2147483647 !important;
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }

        #user-profile-dropdown.user-profile-dropdown-open {
            display: block;
        }

        .user-profile-dropdown-header {
            display: flex;
            flex-direction: column;
            gap: 2px;
            padding: 10px 12px 10px 12px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.15);
            margin-bottom: 4px;
            pointer-events: none;
        }
        .user-profile-dropdown-header #user-email-display {
            font-size: 12px;
            font-weight: 600;
            color: #e2e8f0;
            max-width: 220px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .user-profile-dropdown-header #user-role-display {
            font-size: 10px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .user-profile-dropdown-item {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px 12px;
            background: transparent;
            border: 0;
            border-radius: 8px;
            color: #fff;
            cursor: pointer;
            font-size: 12px;
            font-weight: 700;
            text-align: left;
            text-decoration: none;
            /* iOS touch fixes */
            -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
            touch-action: manipulation;
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            user-select: none;
        }

        .user-profile-dropdown-item:hover,
        .user-profile-dropdown-item:active {
            background: rgba(255, 255, 255, 0.08);
        }

        .user-profile-dropdown-item.logout {
            color: #ffb4aa;
        }

        .user-profile-dropdown-item.logout:hover,
        .user-profile-dropdown-item.logout:active {
            background: rgba(231, 76, 60, 0.18);
            color: #fff;
        }

        .user-profile-caret {
            opacity: 0.7;
            margin-left: 6px;
        }

        @keyframes navTextFade {

            0%,
            75% {
                max-width: 120px;
                opacity: 1;
            }

            100% {
                max-width: 0;
                opacity: 0;
            }
        }

        #zone-selector {
            background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: var(--color-white);
            padding: var(--space-sm) var(--space-md);
            border-radius: var(--radius-md);
            cursor: pointer;
            font-size: var(--font-size-base);
            font-weight: var(--font-weight-medium);
            max-width: 150px;
            box-shadow: var(--shadow-sm);
            transition: all var(--transition-base);
        }

        #zone-selector option {
            background-color: var(--bg-primary);
            color: var(--color-gray-900);
        }

        #zone-selector:hover {
            background: linear-gradient(135deg, #3d566e 0%, #34495e 100%);
            border-color: rgba(255, 255, 255, 0.15);
            box-shadow: var(--shadow-md);
        }

        #zone-selector:focus {
            outline: none;
            border-color: var(--color-primary-light);
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.25);
        }


        .layer-toggle {
            display: flex;
            align-items: center;
            font-size: 0.9em;
            cursor: pointer;
            user-select: none;
            white-space: nowrap;
            color: var(--color-gray-700);
        }

        .layer-toggle input {
            margin-right: 8px;
            cursor: pointer;
            width: 16px;
            height: 16px;
            accent-color: var(--color-primary);
        }

        /* ===== MAP LAYER CONTROLS ===== */
        /* GIS unification: push OL zoom + control cluster below the floating toolbar */
        .ol-zoom { top: calc(var(--toolbar-h) + 6px) !important; left: 8px !important; }

        .map-layer-controls {
            position: absolute;
            top: calc(var(--toolbar-h) + 6px);
            right: var(--space-sm);
            left: auto;
            background: var(--bg-primary);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border-radius: var(--radius-xl);
            padding: var(--space-md) var(--space-lg);
            box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-light);
            z-index: 400;
            display: flex;
            flex-direction: column;
            gap: var(--space-sm);
            border: 1px solid var(--border-medium);
            width: 220px;
            max-height: calc(100% - 40px);
            overflow-y: auto;
            transition: all var(--transition-slow);
        }

        /* Mobile landscape mode: compact controls */
        @media screen and (max-height: 500px) and (orientation: landscape) {
            .map-layer-controls {
                top: 10px;
                left: 10px;
                padding: 8px 10px;
                width: auto;
                min-width: 160px;
                max-height: calc(100vh - 80px);
                gap: 4px;
                font-size: 11px;
            }

            .map-layer-controls .controls-collapse-btn {
                padding: 4px 6px;
                font-size: 14px;
            }

            .map-layer-controls .btn-label {
                font-size: 11px;
                margin-left: 6px;
            }

            .map-layer-controls .layer-toggle {
                font-size: 11px;
                padding: 2px 0;
            }

            .map-layer-controls .layer-toggle input {
                width: 14px;
                height: 14px;
                margin-right: 6px;
            }

            .map-layer-controls .layer-color-dot {
                width: 8px;
                height: 8px;
                margin-right: 6px;
            }

            .map-layer-controls .map-layer-controls-header {
                font-size: 9px;
                margin-bottom: 2px;
                padding-bottom: 4px;
            }

            .map-layer-controls .basemap-switcher {
                gap: 2px;
            }

            .map-layer-controls .basemap-btn {
                padding: 4px 6px;
                font-size: 9px;
            }

            .map-layer-controls .map-action-btn {
                padding: 6px 8px;
                font-size: 10px;
            }

            .map-shortcuts {
                gap: 2px;
            }



            .map-layer-controls.collapsed {
                min-width: 0 !important;
                width: auto !important;
                padding: 4px !important;
            }
        }

        .map-layer-controls.collapsed {
            padding: 8px;
            width: auto;
            min-width: 0;
            max-height: none;
            overflow: visible;
            flex-direction: column;
            /* Keep vertical when collapsed */
            align-items: center;
        }

        .map-layer-controls.collapsed .controls-content {
            display: none;
        }

        .map-layer-controls.collapsed .controls-divider {
            display: none;
        }

        .map-layer-controls.collapsed .dark-mode-toggle-row {
            flex-direction: column;
            gap: 8px;
            padding: 8px 0;
        }

        .map-layer-controls.collapsed .dark-mode-toggle-info {
            gap: 0;
        }

        /* Shortcuts Container */
        .map-shortcuts {
            display: flex;
            flex-direction: column;
            gap: 4px;
            width: 100%;
        }

        .map-layer-controls.collapsed .map-shortcuts {
            display: none !important;
        }

        /* Button Label */
        .btn-label {
            margin-left: 10px;
            font-size: 13px;
            font-weight: 500;
            white-space: nowrap;
        }

        .map-layer-controls.collapsed .btn-label {
            display: none;
        }

        .controls-header-row {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
        }

        .controls-collapse-btn {
            background: var(--bg-secondary);
            border: 1px solid var(--border-light);
            cursor: pointer;
            padding: var(--space-sm) var(--space-md);
            color: var(--color-gray-600);
            font-size: var(--font-size-base);
            font-weight: var(--font-weight-medium);
            line-height: 1;
            border-radius: var(--radius-md);
            transition: all var(--transition-base);
            display: flex;
            align-items: center;
            justify-content: flex-start;
            width: 100%;
            box-shadow: var(--shadow-sm);
        }

        .map-layer-controls.collapsed .controls-collapse-btn {
            width: auto;
            padding: var(--space-sm);
            justify-content: center;
        }

        .controls-collapse-btn:hover {
            background: var(--bg-primary);
            color: var(--color-primary);
            border-color: var(--color-primary);
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }

        .controls-collapse-btn:active {
            transform: translateY(0);
        }

        .map-layer-controls.collapsed #controls-collapse-btn {
            transform: rotate(180deg);
        }

        .map-layer-controls.collapsed #controls-collapse-btn:hover {
            transform: rotate(180deg) scale(1.1);
        }

        .controls-collapse-btn svg {
            transition: transform var(--transition-base);
        }

        /* Mobile: Collapse controls into single downward caret icon */
        @media (max-width: 768px), (max-height: 600px) {
            .map-layer-controls.collapsed {
                padding: 6px !important;
                width: auto !important;
                min-width: 0 !important;
                border-radius: 12px !important;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
            }

            .map-layer-controls.collapsed .controls-header-row {
                display: flex !important;
                flex-direction: column !important;
                align-items: center !important;
                justify-content: center !important;
                gap: 6px !important;
            }

            /* Hide all buttons except collapse + clear selection when collapsed on mobile */
            .map-layer-controls.collapsed .controls-header-row > button:not(#controls-collapse-btn):not(#overlay-clear-selection-btn) {
                display: none !important;
            }

            /* Keep clear selection visible in collapsed mobile overlay */
            .map-layer-controls.collapsed #overlay-clear-selection-btn {
                width: 36px !important;
                height: 36px !important;
                padding: 0 !important;
                border-radius: 50% !important;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
            }

            /* Make collapse button circular and show only downward caret */
            .map-layer-controls.collapsed #controls-collapse-btn {
                width: 36px !important;
                height: 36px !important;
                padding: 0 !important;
                border-radius: 50% !important;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                transform: rotate(0deg) !important;
                background: var(--bg-primary) !important;
                border: 2px solid var(--border-medium) !important;
                box-shadow: var(--shadow-md) !important;
            }

            .map-layer-controls.collapsed #controls-collapse-btn:hover {
                transform: rotate(0deg) scale(1.1) !important;
            }

            .map-layer-controls.collapsed #controls-collapse-btn svg {
                width: 20px !important;
                height: 20px !important;
            }

            /* Hide dark mode toggle and shortcuts when collapsed on mobile */
            .map-layer-controls.collapsed .dark-mode-toggle-row,
            .map-layer-controls.collapsed .map-shortcuts {
                display: none !important;
            }

            /* When expanded on mobile, show all controls */
            .map-layer-controls:not(.collapsed) {
                width: 90% !important;
                max-width: 300px !important;
                max-height: calc(100vh - 40px) !important;
            }
        }

        .controls-content {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        /* Left-edge control rail — the bottom-left action buttons (street view,
           geolocate, Drone) are collected into one flex column by map-left-rail.js and
           anchored just above the search box, so they never overlap each other or the
           search overlay on any screen height. Children are flattened out of their own
           absolute positioning here. */
        #map-left-stack {
            position: fixed;
            left: 14px;
            z-index: 1100;
            display: flex;
            flex-direction: column;
            gap: 8px;
            align-items: flex-start;
            pointer-events: none;
        }
        /* Collapsible group of the action buttons — expands upward above the toggle. */
        #map-rail-items {
            display: flex;
            flex-direction: column;
            gap: 8px;
            align-items: flex-start;
            overflow: hidden;
            pointer-events: auto;
            max-height: 360px;
            opacity: 1;
            transition: max-height 0.22s ease, opacity 0.18s ease;
        }
        #map-left-stack:not(.is-expanded) #map-rail-items {
            max-height: 0;
            opacity: 0;
            pointer-events: none;
        }
        /* Flatten the relocated overlays so flex can stack them (they were absolute). */
        #map-left-stack .streetview-overlay,
        #map-left-stack .geolocate-overlay,
        #map-left-stack #drone-launch {
            position: static !important;
            left: auto !important;
            right: auto !important;
            top: auto !important;
            bottom: auto !important;
            margin: 0 !important;
            pointer-events: auto;
        }
        /* Disclosure toggle — dark-glass to match the marker-tools cluster. */
        #map-rail-toggle {
            pointer-events: auto;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 10px;
            cursor: pointer;
            color: #cfe0ef;
            background: rgba(13, 24, 36, 0.92);
            border: 1px solid rgba(120, 180, 220, 0.32);
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
            -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
            transition: background 0.12s ease, border-color 0.12s ease;
        }
        #map-rail-toggle:hover { border-color: rgba(120, 180, 220, 0.6); color: #fff; }
        #map-rail-toggle .mrt-chev { transition: transform 0.2s ease; }
        #map-left-stack.is-expanded #map-rail-toggle .mrt-chev { transform: rotate(180deg); }
        @media (prefers-reduced-motion: reduce) {
            #map-rail-items, #map-rail-toggle .mrt-chev { transition: none; }
        }

        /* Marker-tools cluster: vertically centred on normal monitors (where it's clear of
           both the top controls and the bottom-left stack), but on genuinely short screens
           it tucks just below the top-left controls so it can't drift into the bottom stack. */
        @media (max-height: 700px) {
            .pmt-cluster {
                top: calc(var(--toolbar-h, 48px) + 120px) !important;
                transform: none !important;
            }
        }

        /* Geolocation Overlay */
        .geolocate-overlay {
            position: absolute;
            bottom: 160px;
            left: 20px;
            top: auto;
            right: auto;
            z-index: 1000;
        }

        .geolocate-btn {
            width: 36px;
            height: 36px;
            background: var(--bg-primary);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border: 1px solid var(--border-light);
            border-radius: var(--radius-md);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            transition: all var(--transition-base);
            box-shadow: var(--shadow-md);
            color: var(--color-gray-700);
        }

        .geolocate-btn:hover {
            background: var(--bg-primary);
            transform: translateY(-2px) scale(1.05);
            box-shadow: var(--shadow-lg);
            border-color: var(--color-primary);
            color: var(--color-primary);
        }

        .geolocate-btn:active {
            transform: translateY(0) scale(1);
        }

        .streetview-overlay {
            position: absolute;
            bottom: 200px;
            left: 20px;
            top: auto;
            right: auto;
            z-index: 1000;
        }

        .streetview-btn {
            width: 36px;
            height: 36px;
            background: var(--bg-primary);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border: 1px solid var(--border-light);
            border-radius: var(--radius-md);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all var(--transition-base);
            box-shadow: var(--shadow-md);
            color: var(--color-gray-700);
        }

        .streetview-btn:hover {
            background: var(--bg-primary);
            transform: translateY(-2px) scale(1.05);
            box-shadow: var(--shadow-lg);
            border-color: var(--color-primary);
            color: var(--color-primary);
        }

        .streetview-btn:active {
            transform: translateY(0) scale(1);
        }

        .streetview-btn.active {
            background: var(--color-primary);
            color: white;
            border-color: var(--color-primary);
        }

        .streetview-btn.active:hover {
            background: var(--color-primary);
            opacity: 0.9;
        }

        .map-layer-controls-header {
            font-size: 11px;
            font-weight: 700;
            color: var(--color-gray-500);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 2px;
            padding-bottom: 6px;
            border-bottom: 1px solid var(--border-light);
        }

        .map-layer-controls .layer-toggle {
            padding: 4px 0;
            transition: color 0.2s;
        }

        .map-layer-controls .layer-toggle:hover {
            color: var(--color-primary);
        }

        .color-mode-toggle {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 6px 0;
            font-size: 12px;
            color: var(--color-gray-600);
        }

        .toggle-switch {
            position: relative;
            width: 36px;
            height: 20px;
            background: var(--color-gray-300);
            border-radius: 10px;
            cursor: pointer;
            transition: background 0.3s;
        }

        .toggle-switch.active {
            background: var(--color-primary);
        }

        .toggle-switch::after {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            width: 16px;
            height: 16px;
            background: var(--color-white);
            border-radius: 50%;
            transition: transform 0.3s;
            box-shadow: var(--shadow-sm);
        }

        .toggle-switch.active::after {
            transform: translateX(16px);
        }

        .layer-color-dot {
            width: 10px;
            height: 10px;
            border-radius: 3px;
            margin-right: 8px;
            flex-shrink: 0;
        }

        .layer-color-dot.parcels {
            background: linear-gradient(135deg, #3498db 20%, #27ae60 20%, #27ae60 40%, #00bcd4 40%, #00bcd4 60%, #f39c12 60%, #f39c12 80%, #9b59b6 80%);
            border: 1px solid var(--border-medium);
        }

        .layer-color-dot.anchors {
            background-color: #e67e22;
            border: 1px solid #d35400;
        }

        .layer-color-dot.critical {
            background-color: #e74c3c;
            border: 1px solid #c0392b;
        }

        .layer-color-dot.v2 {
            background-color: #9b59b6;
            border: 1px solid #8e44ad;
        }

        .layer-color-dot.media {
            background-color: rgba(52, 152, 219, 0.9);
            border: 2px solid var(--bg-primary);
            border-radius: 50%;
        }

        /* Fully tax-exempt parcels — matches PIATaxExempt.COLOR (#db2777). */
        .layer-color-dot.tax-exempt {
            background-color: #db2777;
            border: 1px solid #831843;
        }

        /* Parcel count shown after a layer name, e.g. "Tax Exempt   89". */
        .layer-toggle-count {
            margin-left: auto;
            padding-left: 10px;
            font-size: 0.85em;
            font-variant-numeric: tabular-nums;
            color: var(--color-gray-500);
        }

        .parcel-legend {
            display: flex;
            flex-direction: column;
            gap: 4px;
            padding: 8px 0;
            margin-left: 24px;
            font-size: 11px;
        }

        .parcel-legend-item {
            display: flex;
            align-items: center;
            gap: 6px;
            color: var(--color-gray-600);
        }

        .parcel-legend-color {
            width: 12px;
            height: 12px;
            border-radius: 2px;
            flex-shrink: 0;
        }

        .parcel-legend-color.downtown {
            background-color: var(--color-primary);
        }

        .parcel-legend-color.lands {
            background-color: #27ae60;
        }

        .parcel-legend-color.town-owned {
            background-color: #f39c12;
        }

        .parcel-legend-color.lakefront {
            background-color: #00bcd4;
        }

        .parcel-legend-color.other {
            background-color: #9b59b6;
        }

        .basemap-switcher {
            display: flex;
            gap: 4px;
            padding: 4px 0;
        }

        .basemap-btn {
            flex: 1;
            padding: var(--space-sm) var(--space-sm);
            font-size: var(--font-size-xs);
            font-weight: var(--font-weight-semibold);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            border: 1px solid var(--border-medium);
            background: var(--bg-secondary);
            color: var(--color-gray-700);
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all var(--transition-base);
            box-shadow: var(--shadow-sm);
        }

        .basemap-btn:hover {
            background: var(--bg-primary);
            border-color: var(--color-primary);
            color: var(--color-primary);
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }

        .basemap-btn.active {
            background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
            color: var(--color-white);
            border-color: var(--color-primary);
            box-shadow: 0 0 8px rgba(52, 152, 219, 0.4), var(--shadow-md);
        }

        .map-action-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: var(--space-sm);
            padding: var(--space-sm) var(--space-md);
            font-size: var(--font-size-sm);
            font-weight: var(--font-weight-medium);
            border: 1px solid var(--border-medium);
            background: var(--bg-secondary);
            color: var(--color-gray-900);
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all var(--transition-base);
            width: 100%;
            box-shadow: var(--shadow-sm);
        }

        .map-action-btn:hover {
            background: var(--bg-primary);
            border-color: var(--color-primary);
            color: var(--color-primary);
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }

        .map-action-btn:active {
            transform: translateY(0);
            box-shadow: var(--shadow-sm);
        }

        .map-action-btn svg {
            width: 14px;
            height: 14px;
            transition: transform var(--transition-base);
        }

        .map-action-btn:hover svg {
            transform: scale(1.1);
        }

        .controls-divider {
            height: 1px;
            background: var(--border-light);
            margin: 4px 0;
        }

        /* ===== GUIDED HELP OVERLAY ===== */
        #help-overlay {
            position: fixed;
            inset: 0;
            z-index: 2147483600;
            display: none;
            overflow: hidden;
            animation: fadeIn var(--transition-base) ease;
        }

        #help-overlay.show {
            display: block;
        }

        .help-overlay-dim {
            position: absolute;
            inset: 0;
            background: rgba(17, 24, 39, 0.32);
            backdrop-filter: blur(1px);
            -webkit-backdrop-filter: blur(1px);
        }

        .help-navbar-callouts {
            position: absolute;
            inset: 0;
            pointer-events: none;
            z-index: 2;
        }

        .help-navbar-callout {
            position: fixed;
            left: 0;
            transform: translateX(-50%);
            background: rgba(15, 23, 42, 0.92);
            color: #f8fafc;
            border: 1px solid rgba(148, 163, 184, 0.45);
            border-radius: 8px;
            font-size: 11px;
            line-height: 1.15;
            font-weight: 700;
            letter-spacing: 0.02em;
            padding: 7px 9px;
            white-space: nowrap;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
            max-width: 130px;
            text-align: center;
            text-wrap: balance;
        }

        .help-navbar-callout.below::before {
            content: '';
            position: absolute;
            top: -18px;
            left: 50%;
            width: 2px;
            height: 16px;
            background: rgba(248, 250, 252, 0.72);
            transform: translateX(-50%);
        }

        .help-navbar-callout.below::after {
            content: '';
            position: absolute;
            top: -7px;
            left: 50%;
            transform: translateX(-50%);
            width: 0;
            height: 0;
            border-left: 6px solid transparent;
            border-right: 6px solid transparent;
            border-bottom: 8px solid rgba(248, 250, 252, 0.78);
        }

        .help-navbar-callout.above::before {
            content: '';
            position: absolute;
            bottom: -18px;
            left: 50%;
            width: 2px;
            height: 16px;
            background: rgba(248, 250, 252, 0.72);
            transform: translateX(-50%);
        }

        .help-navbar-callout.above::after {
            content: '';
            position: absolute;
            bottom: -7px;
            left: 50%;
            transform: translateX(-50%);
            width: 0;
            height: 0;
            border-left: 6px solid transparent;
            border-right: 6px solid transparent;
            border-top: 8px solid rgba(248, 250, 252, 0.78);
        }

        .help-panel {
            position: fixed;
            left: 50%;
            top: 56%;
            transform: translate(-50%, -50%);
            z-index: 3;
            width: min(980px, 94vw);
            max-height: min(44vh, 420px);
            background: var(--bg-primary);
            border-radius: 14px;
            border: 1px solid var(--border-medium);
            box-shadow: var(--shadow-xl);
            overflow: hidden;
            animation: modalSlideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        @keyframes modalSlideUp {
            from {
                opacity: 0;
                transform: translateY(30px) scale(0.95);
            }

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

        .help-panel-header {
            padding: 14px 18px;
            border-bottom: 1px solid var(--border-light);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
        }

        .help-panel-header h2 {
            margin: 0;
            font-size: 18px;
            font-weight: var(--font-weight-semibold);
            color: var(--color-dark-alt);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .help-panel-header h2 svg {
            width: 22px;
            height: 22px;
            color: var(--color-primary);
        }

        .help-close {
            background: none;
            border: none;
            font-size: 26px;
            color: var(--color-gray-400);
            cursor: pointer;
            padding: 2px;
            line-height: 1;
            border-radius: var(--radius-md);
            transition: all var(--transition-base);
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .help-close:hover {
            background: var(--color-gray-50);
            color: var(--color-gray-900);
            transform: scale(1.1);
        }

        .help-panel-body {
            padding: 12px 16px 6px;
            overflow-y: auto;
            max-height: calc(min(44vh, 420px) - 100px);
        }

        .help-shortcuts-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 14px;
        }

        .help-shortcuts-column {
            min-width: 0;
        }

        .shortcuts-section-title {
            font-size: 11px;
            font-weight: 700;
            color: var(--color-gray-500);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin: 0 0 8px;
        }

        .shortcut-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 8px;
            padding: 7px 0;
            border-bottom: 1px solid var(--border-light);
        }

        .shortcut-row:last-child {
            border-bottom: none;
        }

        .shortcut-desc {
            color: var(--color-gray-700);
            font-size: 13px;
            font-weight: 500;
        }

        .shortcut-keys {
            display: flex;
            gap: 4px;
            align-items: center;
        }

        .key {
            background: var(--bg-secondary);
            border: 1px solid var(--border-medium);
            border-radius: 4px;
            padding: 4px 8px;
            font-size: 12px;
            font-family: var(--font-family-mono);
            font-weight: 700;
            color: var(--color-gray-900);
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
            min-width: 24px;
            text-align: center;
        }

        .key-plus {
            color: var(--color-gray-400);
            font-size: 12px;
        }

        .help-panel-footer {
            padding: 10px 16px 12px;
            background: var(--bg-secondary);
            border-top: 1px solid var(--border-light);
            border-radius: 0 0 12px 12px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            font-size: 12px;
            color: var(--color-gray-500);
            font-weight: 500;
        }

        .help-never-show {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: var(--color-gray-700);
            user-select: none;
            cursor: pointer;
            font-size: 12px;
            font-weight: 600;
        }

        .help-never-show input {
            width: 14px;
            height: 14px;
            accent-color: var(--color-primary);
        }

        .help-footer-hint {
            font-size: 11px;
            color: var(--color-gray-500);
            text-align: right;
        }

        @media (max-width: 1100px) {
            .help-navbar-callout {
                max-width: 98px;
                padding: 6px 6px;
                font-size: 10px;
            }
        }

        @media (max-width: 900px), (max-height: 760px) {
            .help-panel {
                top: auto;
                bottom: 14px;
                transform: translateX(-50%);
                max-height: min(40vh, 350px);
            }

            .help-panel-body {
                max-height: calc(min(40vh, 350px) - 100px);
            }
        }

        @media (max-width: 780px) {
            .help-shortcuts-grid {
                grid-template-columns: 1fr;
                gap: 8px;
            }

            .help-panel {
                width: min(96vw, 680px);
                max-height: min(45vh, 360px);
            }

            .help-panel-body {
                max-height: calc(min(45vh, 360px) - 100px);
            }

            .help-navbar-callout {
                top: 56px;
                max-width: 76px;
                font-size: 9px;
                padding: 5px 5px;
            }
        }

        .hint-text {
            color: var(--color-gray-500);
            font-size: 0.85em;
            margin-right: 20px;
            display: none;
            /* Hide by default, will rely on toast instead */
        }

        #file-name-display {
            font-style: italic;
            color: var(--color-gray-500);
            font-size: 0.9em;
        }

        .stats {
            margin-left: auto;
            font-size: 0.9em;
        }

        #row-count {
            font-weight: 800;
            color: var(--color-primary);
        }

        .ol-popup {
            position: absolute;
            background: var(--bg-primary);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            box-shadow: var(--shadow-xl), 0 0 0 1px var(--border-light);
            border-radius: var(--radius-xl);
            border: 1px solid var(--border-medium);
            bottom: 12px;
            left: -50px;
            min-width: 360px;
            z-index: 1000;
            overflow: hidden;
            pointer-events: auto;
            animation: popupSlideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        @keyframes popupSlideUp {
            from {
                opacity: 0;
                transform: translateY(10px) scale(0.98);
            }

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

        .ol-popup-closer {
            text-decoration: none;
            position: absolute;
            top: var(--space-sm);
            right: var(--space-sm);
            color: var(--color-gray-400);
            font-size: 22px;
            font-weight: bold;
            cursor: pointer;
            z-index: 10000;
            line-height: 32px;
            width: 32px;
            height: 32px;
            text-align: center;
            border-radius: var(--radius-md);
            transition: all var(--transition-base);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .ol-popup-closer:hover {
            color: var(--color-accent-red);
            background-color: rgba(231, 76, 60, 0.1);
            transform: scale(1.1);
        }

        .ol-popup-docker {
            text-decoration: none;
            position: absolute;
            top: var(--space-sm);
            right: 44px;
            color: var(--color-gray-400);
            font-size: 18px;
            font-weight: bold;
            cursor: pointer;
            z-index: 10000;
            line-height: 32px;
            width: 32px;
            height: 32px;
            text-align: center;
            border-radius: var(--radius-md);
            transition: all var(--transition-base);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .ol-popup-docker:hover {
            color: var(--color-primary);
            background-color: rgba(52, 152, 219, 0.1);
            transform: scale(1.1);
        }

        .parcel-tip {
            font-family: var(--font-family);
            background-color: var(--bg-tertiary);
            width: 100%;
            font-size: var(--font-size-sm);
            line-height: 1.5;
            display: flex;
            flex-direction: column;
        }

        /* Tabulator Custom Styles */
        .tabulator {
            border: none;
            background-color: transparent;
        }

        .tabulator .tabulator-header {
            font-weight: 700;
            color: var(--color-dark);
            background-color: var(--bg-secondary);
            border-bottom: 1px solid var(--border-light);
        }

        .tabulator .tabulator-header .tabulator-col {
            background-color: var(--bg-secondary);
            border-right: 1px solid var(--border-light);
        }

        .tabulator-row {
            border-bottom: 1px solid var(--border-light);
            background-color: var(--bg-primary);
        }

        .tabulator-row.tabulator-selected {
            background-color: #fef3c7 !important;
            color: #92400e !important;
        }

        .tabulator-row.tabulator-selected:hover {
            background-color: #fde68a !important;
        }

        .tabulator-row.tabulator-selectable:hover {
            background-color: var(--bg-secondary);
            cursor: pointer;
        }

        .tabulator-row.tabulator-selected .tabulator-cell {
            border-right: 1px solid #fde68a;
        }

        /* Hide filters by default until class is added */
        .tabulator .tabulator-header .tabulator-header-filter {
            display: none;
        }

        .filters-visible .tabulator .tabulator-header .tabulator-header-filter {
            display: block;
        }

        .parcel-header {
            padding: var(--space-lg) var(--space-xl) var(--space-md) var(--space-xl);
            background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
            border-bottom: 1px solid var(--border-light);
        }

        .parcel-header h3 {
            margin: 0;
            color: var(--color-dark-alt);
            font-size: var(--font-size-md);
            font-weight: var(--font-weight-semibold);
            padding-right: 70px;
        }

        .parcel-header p {
            margin: var(--space-xs) 0 0 0;
            color: var(--color-gray-500);
            font-size: var(--font-size-base);
        }

        /* Enhanced Image Container Styles */
        .hidden {
            display: none !important;
        }

        .popup-image-container {
            width: 100%;
            height: 180px;
            overflow: hidden;
            background-color: var(--bg-secondary);
            position: relative;
            border-bottom: 1px solid var(--border-light);
            cursor: pointer;
        }

        .popup-image-container.no-image {
            height: 60px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }

        .popup-image-container.no-image .no-image-text {
            color: rgba(255, 255, 255, 0.8);
            font-size: 12px;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .popup-image-container.no-image .no-image-text svg {
            width: 16px;
            height: 16px;
            opacity: 0.7;
        }

        /* Image Loading States */
        .popup-image-wrapper {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }

        .popup-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s ease, opacity 0.3s ease;
            opacity: 0;
        }

        .popup-img.loaded {
            opacity: 1;
        }

        .popup-img.hover {
            transform: scale(1.05);
        }

        /* Image Loading Spinner */
        .image-loader {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }

        .image-loader.hidden {
            display: none;
        }

        .image-spinner {
            width: 30px;
            height: 30px;
            border: 3px solid rgba(0, 0, 0, 0.1);
            border-top-color: #3498db;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

        .image-loader-text {
            font-size: 11px;
            color: #888;
        }

        /* Image Error State */
        .image-error {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: #f8f9fa;
            color: #999;
            gap: 8px;
        }

        .image-error.show {
            display: flex;
        }

        .image-error svg {
            width: 32px;
            height: 32px;
            opacity: 0.5;
        }

        .image-error span {
            font-size: 12px;
        }

        .image-error button {
            margin-top: 4px;
            padding: 4px 12px;
            font-size: 11px;
            background: #3498db;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            transition: background 0.2s;
        }

        .image-error button:hover {
            background: #2980b9;
        }

        /* View Full Image Button */
        .view-full-btn {
            position: absolute;
            bottom: 8px;
            right: 8px;
            background: rgba(0, 0, 0, 0.7);
            color: white;
            border: none;
            padding: 6px 10px;
            border-radius: 4px;
            font-size: 11px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 4px;
            opacity: 0;
            transition: opacity 0.2s, background 0.2s;
        }

        .popup-image-container:hover .view-full-btn {
            opacity: 1;
        }

        .view-full-btn:hover {
            background: rgba(0, 0, 0, 0.9);
        }

        .view-full-btn svg {
            width: 14px;
            height: 14px;
        }

        /* Image Counter Badge */
        .image-badge {
            position: absolute;
            top: 8px;
            left: 8px;
            background: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 10px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .image-badge svg {
            width: 12px;
            height: 12px;
        }

        /* Media marker tooltip */
        .media-tooltip {
            position: absolute;
            background: var(--bg-primary);
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
            padding: 0;
            z-index: 1500;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.2s;
            overflow: hidden;
            max-width: 200px;
        }

        .media-tooltip.show {
            opacity: 1;
        }

        .media-tooltip img {
            width: 200px;
            height: 150px;
            object-fit: cover;
            display: block;
        }

        .media-tooltip-label {
            padding: 8px 12px;
            font-size: 12px;
            font-weight: 600;
            color: var(--color-gray-800);
            background: var(--bg-secondary);
            border-top: 1px solid var(--border-light);
        }

        /* ===== LIGHTBOX MODAL ===== */
        #lightbox-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.96);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            z-index: var(--z-lightbox);
            display: none;
            justify-content: center;
            align-items: center;
            animation: fadeIn var(--transition-slow) ease;
        }

        #lightbox-modal.show {
            display: flex;
        }

        .lightbox-content {
            position: relative;
            max-width: 95vw;
            max-height: 95vh;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .lightbox-image-container {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .lightbox-img {
            max-width: 90vw;
            max-height: 85vh;
            object-fit: contain;
            border-radius: 4px;
            box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .lightbox-img.loaded {
            opacity: 1;
        }

        .lightbox-loader {
            position: absolute;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
        }

        .lightbox-loader.hidden {
            display: none;
        }

        .lightbox-spinner {
            width: 50px;
            height: 50px;
            border: 4px solid rgba(255, 255, 255, 0.2);
            border-top-color: #3498db;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

        .lightbox-loader-text {
            color: rgba(255, 255, 255, 0.7);
            font-size: 14px;
        }

        .lightbox-close {
            position: absolute;
            top: var(--space-xl);
            right: var(--space-xl);
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: var(--color-white);
            width: 48px;
            height: 48px;
            border-radius: var(--radius-full);
            font-size: 28px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all var(--transition-base);
            z-index: 10;
            box-shadow: var(--shadow-lg);
        }

        .lightbox-close:hover {
            background: rgba(255, 255, 255, 0.25);
            transform: scale(1.1) rotate(90deg);
            border-color: rgba(255, 255, 255, 0.3);
        }

        .lightbox-close:active {
            transform: scale(1);
        }

        .lightbox-info {
            margin-top: 16px;
            color: white;
            text-align: center;
        }

        .lightbox-title {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 4px;
        }

        .lightbox-subtitle {
            font-size: 14px;
            color: rgba(255, 255, 255, 0.7);
        }

        .lightbox-actions {
            display: flex;
            gap: 12px;
            margin-top: 16px;
        }

        .lightbox-btn {
            background: rgba(255, 255, 255, 0.12);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: var(--color-white);
            padding: var(--space-sm) var(--space-lg);
            border-radius: var(--radius-lg);
            font-size: var(--font-size-base);
            font-weight: var(--font-weight-medium);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: var(--space-sm);
            transition: all var(--transition-base);
            box-shadow: var(--shadow-md);
        }

        .lightbox-btn:hover {
            background: rgba(255, 255, 255, 0.22);
            border-color: rgba(255, 255, 255, 0.35);
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

        .lightbox-btn:active {
            transform: translateY(0);
        }

        .lightbox-btn svg {
            width: 16px;
            height: 16px;
            transition: transform var(--transition-base);
        }

        .lightbox-btn:hover svg {
            transform: scale(1.1);
        }

        /* Photo Grid Styles */
        .photo-thumb {
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }
        .photo-thumb:hover {
            transform: scale(1.05);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
            z-index: 1;
        }
        .photo-thumb img {
            transition: transform 0.3s ease;
        }
        .photo-thumb:hover img {
            transform: scale(1.1);
        }

        /* Upload Modal Styles */
        #upload-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 25000;
            display: none;
            justify-content: center;
            align-items: center;
            animation: fadeIn 0.2s ease;
        }

        #upload-modal.show {
            display: flex;
        }

        .upload-modal-content {
            background: var(--bg-primary);
            border-radius: var(--radius-xl);
            width: 90%;
            max-width: 600px;
            max-height: 85vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: var(--shadow-xl);
        }

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

        .upload-modal-header h2 {
            margin: 0;
            font-size: 20px;
            color: var(--color-gray-900);
        }

        .upload-modal-close {
            background: none;
            border: none;
            font-size: 28px;
            color: #999;
            cursor: pointer;
            padding: 0;
            line-height: 1;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.2s;
        }

        .upload-modal-close:hover {
            background: var(--bg-secondary);
            color: var(--color-gray-800);
        }

        .upload-modal-body {
            padding: 24px;
            flex: 1;
            overflow-y: auto;
        }

        .upload-parcel-info {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 16px 20px;
            border-radius: 10px;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .upload-parcel-info .parcel-icon {
            width: 40px;
            height: 40px;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .upload-parcel-info .parcel-details {
            flex: 1;
        }

        .upload-parcel-info .parcel-lot {
            font-size: 18px;
            font-weight: 700;
        }

        #zone-selector {
            background: var(--bg-primary);
            color: var(--color-gray-900);
            border: 1px solid var(--border-medium);
            border-radius: var(--radius-md);
            padding: 8px 12px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all var(--transition-base);
            box-shadow: var(--shadow-sm);
            min-width: 140px;
        }

        #zone-selector:hover {
            border-color: var(--color-gray-400);
            background: var(--bg-secondary);
        }

        .map-search-overlay {
            position: absolute;
            /* --ipad-kb-h is set by JS from visualViewport so the overlay rides
               above the on-screen keyboard on iPad/iOS instead of being covered. */
            bottom: calc(20px + var(--ipad-kb-h, 0px));
            left: 20px;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: auto;
            transition: bottom 200ms ease;
        }

        .map-search-container {
            display: flex;
            align-items: center;
            background: var(--bg-primary);
            border-radius: var(--radius-md);
            padding: 5px;
            box-shadow: var(--shadow-lg);
            border: 1px solid var(--border-medium);
            min-width: 300px;
        }

        .map-search-container .search-input {
            border: none;
            padding: 8px 12px;
            font-size: 16px; /* Minimum 16px prevents iOS auto-zoom on focus */
            outline: none;
            flex: 1;
            background: transparent;
            color: var(--color-gray-900);
            touch-action: manipulation; /* Prevent double-tap zoom on iOS */
        }

        .map-search-container .search-input::placeholder {
            color: var(--color-gray-500);
        }

        .map-filter-controls {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .map-overlay-btn {
            background: var(--bg-primary);
            border: 1px solid var(--border-light);
            border-radius: var(--radius-md);
            padding: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: var(--shadow-sm);
            transition: all var(--transition-base);
            color: var(--color-gray-700);
        }

        .map-overlay-btn:hover {
            background: var(--bg-secondary);
            transform: translateY(-1px);
        }

        .map-overlay-btn.active {
            background: var(--color-primary);
            color: white;
            border-color: var(--color-primary);
        }

        .map-overlay-btn svg {
            width: 18px;
            height: 18px;
        }

        .upload-dropzone {
            border: 2px dashed var(--border-medium);
            border-radius: var(--radius-xl);
            padding: 40px 20px;
            text-align: center;
            cursor: pointer;
            transition: all var(--transition-base);
            position: relative;
            background: var(--bg-secondary);
        }

        .upload-dropzone:hover {
            border-color: #3498db;
            background: #f0f7ff;
        }

        .upload-dropzone.dragover {
            border-color: #3498db;
            background: #e8f4fc;
            transform: scale(1.01);
        }

        .upload-dropzone svg {
            color: #bbb;
            margin-bottom: 12px;
        }

        .upload-dropzone p {
            margin: 0 0 8px 0;
            color: #555;
            font-size: 15px;
        }

        .upload-dropzone .upload-hint {
            color: #999;
            font-size: 12px;
        }

        .upload-dropzone input {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            opacity: 0;
            cursor: pointer;
        }

        .upload-preview-list {
            margin-top: 20px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .upload-preview-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            background: var(--bg-secondary);
            border-radius: 8px;
            border: 1px solid var(--border-light);
        }

        .upload-preview-thumb {
            width: 60px;
            height: 60px;
            border-radius: 6px;
            object-fit: cover;
            flex-shrink: 0;
        }

        .upload-preview-info {
            flex: 1;
            min-width: 0;
        }

        .upload-preview-name {
            font-size: 14px;
            font-weight: 500;
            color: var(--color-gray-900);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .upload-preview-size {
            font-size: 12px;
            color: var(--color-gray-500);
            margin-top: 2px;
        }

        .upload-preview-remove {
            background: none;
            border: none;
            color: #e74c3c;
            cursor: pointer;
            padding: 8px;
            border-radius: 6px;
            transition: background 0.2s;
        }

        .upload-preview-remove:hover {
            background: rgba(231, 76, 60, 0.1);
        }

        .upload-modal-footer {
            padding: 16px 24px;
            border-top: 1px solid var(--border-light);
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            background: var(--bg-secondary);
        }

        .upload-cancel-btn {
            padding: 10px 20px;
            border: 1px solid var(--border-medium);
            background: var(--bg-primary);
            color: var(--color-gray-600);
            border-radius: 8px;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .upload-cancel-btn:hover {
            background: var(--bg-secondary);
            border-color: var(--color-gray-400);
        }

        .upload-submit-btn {
            padding: 10px 24px;
            border: none;
            background: linear-gradient(135deg, #3498db, #2980b9);
            color: white;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.2s;
        }

        .upload-submit-btn:hover:not(:disabled) {
            background: linear-gradient(135deg, #2980b9, #1a5276);
            transform: translateY(-1px);
        }

        .upload-submit-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .tab-header {
            display: flex;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-light);
        }

        /* ===== TAB NAVIGATION ===== */
        .tab-btn {
            flex: 1;
            padding: var(--space-md) var(--space-sm);
            border: none;
            background: transparent;
            cursor: pointer;
            font-weight: var(--font-weight-bold);
            color: var(--color-gray-600);
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.8px;
            transition: all var(--transition-base);
            border-bottom: 3px solid transparent;
            position: relative;
        }

        .tab-btn::before {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 3px;
            background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
            transform: scaleX(0);
            transition: transform var(--transition-base);
        }

        .tab-btn:hover {
            background: linear-gradient(135deg, rgba(52, 152, 219, 0.08) 0%, rgba(39, 174, 96, 0.08) 100%);
            color: var(--color-primary);
            transform: translateY(-1px);
        }

        .tab-btn.active {
            color: var(--color-primary);
            background: linear-gradient(135deg, rgba(52, 152, 219, 0.12) 0%, rgba(39, 174, 96, 0.12) 100%);
            box-shadow: inset 0 -3px 0 0 var(--color-primary);
        }

        .tab-btn.active::before {
            transform: scaleX(1);
        }

        .tab-body {
            padding: var(--space-lg);
            overflow-y: auto;
            max-height: 280px;
            background: var(--bg-primary);
        }

        .tab-content {
            display: none;
            animation: fadeIn 0.3s;
        }

        .tab-content.active {
            display: block;
        }

        /* GIS unification: single-page scroll dock with a STICKY tab bar
           (matches Richmond). The whole #dock-content scrolls as one page — the
           parcel header scrolls away and the tab bar sticks to the top; each tab
           scroll-links to its section with scrollspy highlighting (see
           attachTabListeners). Scoped to #dock-content so the floating popup
           keeps its paginated tabs. */
        /* Collapse the nested .tab-body scroller so #dock-content scrolls as one. */
        #dock-content .parcel-tip { display: block !important; flex: none !important; min-height: 0 !important; }
        #dock-content .tab-body {
            flex: none !important;
            overflow: visible !important;
            min-height: 0 !important;
            max-height: none !important;
        }
        #dock-content .tab-content { display: block !important; animation: none; }
        #dock-content .tab-content + .tab-content {
            border-top: 1px solid rgba(255, 255, 255, 0.08);
        }
        /* Sticky tab bar: unhide it and pin it to the top of the scrolling dock.
           The bar carries an inline `background: var(--bg-primary)` so scrolled
           content doesn't bleed through; flex-direction:row overrides the old
           narrow-dock column stacking. */
        #dock-content .tab-header {
            display: grid !important;
            position: sticky;
            top: 0;
            z-index: 20;
            flex-direction: row;
            border-radius: 12px 12px 0 0;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.30);
        }

        /* ===== GLOBAL ANIMATIONS ===== */
        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        @keyframes fadeInScale {
            from {
                opacity: 0;
                transform: scale(0.95);
            }

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

        @keyframes shimmer {
            0% {
                background-position: -1000px 0;
            }

            100% {
                background-position: 1000px 0;
            }
        }

        @keyframes pulse {

            0%,
            100% {
                opacity: 1;
            }

            50% {
                opacity: 0.7;
            }
        }

        /* Smooth scroll behavior */
        * {
            scroll-behavior: smooth;
        }

        /* Focus visible for accessibility */
        *:focus-visible {
            outline: 2px solid var(--color-primary);
            outline-offset: 2px;
        }

        /* Reduce motion for accessibility */
        @media (prefers-reduced-motion: reduce) {

            *,
            *::before,
            *::after {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
            }
        }

        .parcel-tip h4 {
            margin: 0 0 var(--space-md) 0;
            color: var(--color-dark-alt);
            font-size: var(--font-size-md);
            font-weight: var(--font-weight-semibold);
            border-bottom: 1px solid var(--border-light);
            padding-bottom: var(--space-sm);
        }

        .grade-box {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: linear-gradient(135deg, rgba(39, 174, 96, 0.08) 0%, rgba(39, 174, 96, 0.15) 100%);
            border: 1px solid rgba(39, 174, 96, 0.25);
            border-radius: var(--radius-lg);
            padding: var(--space-md);
            margin-bottom: var(--space-lg);
        }

        .grade-letter {
            font-size: 38px;
            font-weight: var(--font-weight-extrabold);
            color: var(--color-secondary-dark);
            line-height: 1;
            text-shadow: 0 2px 8px rgba(39, 174, 96, 0.2);
        }

        .grade-rank {
            font-size: var(--font-size-sm);
            font-weight: var(--font-weight-medium);
            color: var(--color-gray-700);
            text-align: right;
        }

        .grade-rank strong {
            font-size: var(--font-size-md);
            font-weight: var(--font-weight-bold);
            color: var(--color-secondary-dark);
        }

        .parcel-tip ul {
            margin: 0;
            padding: 0;
            list-style-type: none;
        }

        .parcel-tip li {
            margin-bottom: var(--space-sm);
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid rgba(0, 0, 0, 0.04);
            padding-bottom: var(--space-sm);
            transition: background var(--transition-fast);
        }

        .parcel-tip li:hover {
            background: rgba(52, 152, 219, 0.04);
            margin-left: calc(-1 * var(--space-sm));
            margin-right: calc(-1 * var(--space-sm));
            padding-left: var(--space-sm);
            padding-right: var(--space-sm);
            border-radius: var(--radius-sm);
        }

        .parcel-tip li:last-child {
            border-bottom: none;
        }

        .parcel-tip li span:first-child {
            color: var(--color-gray-700);
            font-size: var(--font-size-base);
        }

        .parcel-tip .score-value {
            font-weight: var(--font-weight-bold);
            color: var(--color-primary-dark);
            background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(52, 152, 219, 0.15) 100%);
            padding: var(--space-xs) var(--space-sm);
            border-radius: var(--radius-sm);
            font-family: var(--font-family-mono);
            font-size: var(--font-size-base);
            border: 1px solid rgba(52, 152, 219, 0.2);
        }

        .parcel-tip .data-value {
            color: var(--color-dark-alt);
            font-weight: var(--font-weight-medium);
            text-align: right;
            max-width: 60%;
            font-size: var(--font-size-base);
        }

        .highlight-value {
            color: var(--color-accent-red);
            font-weight: var(--font-weight-bold);
        }

        /* Sales History Styles */
        .sales-history-container {
            max-height: 240px;
            overflow-y: auto;
        }

        .sales-stats-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: var(--space-sm);
            margin-bottom: var(--space-md);
        }

        .sales-stat-box {
            background: linear-gradient(135deg, rgba(39, 174, 96, 0.08) 0%, rgba(39, 174, 96, 0.15) 100%);
            border: 1px solid rgba(39, 174, 96, 0.2);
            border-radius: var(--radius-md);
            padding: var(--space-md);
            text-align: center;
            transition: all var(--transition-base);
        }

        .sales-stat-box:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-sm);
        }

        .sales-stat-box.highlight {
            background: linear-gradient(135deg, rgba(52, 152, 219, 0.08) 0%, rgba(52, 152, 219, 0.15) 100%);
            border-color: rgba(52, 152, 219, 0.2);
        }

        .sales-stat-value {
            font-size: var(--font-size-lg);
            font-weight: var(--font-weight-bold);
            color: var(--color-secondary-dark);
            font-family: var(--font-family-mono);
        }

        .sales-stat-box.highlight .sales-stat-value {
            color: var(--color-primary-dark);
        }

        .sales-stat-label {
            font-size: var(--font-size-xs);
            color: var(--color-gray-600);
        }

        .sales-stat-label-text {
            text-transform: uppercase;
            letter-spacing: 0.5px;
            font-weight: var(--font-weight-medium);
        }

        /* Superuser Profile Icon */
        #superuser-profile-icon {
            position: fixed;
            top: 20px;
            right: 80px;
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffa500 100%);
            border: 3px solid rgba(255, 215, 0, 0.5);
            box-shadow: 0 4px 20px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 215, 0, 0.3);
            display: none;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 1001;
            animation: pulse-glow 2s ease-in-out infinite;
            position: relative;
        }

        #superuser-profile-icon.show {
            display: flex;
        }

        #superuser-profile-icon::before {
            content: '👑';
            font-size: 24px;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
        }

        #superuser-profile-icon::after {
            content: '';
            position: absolute;
            top: -2px;
            right: -2px;
            width: 16px;
            height: 16px;
            background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
            border-radius: 50%;
            border: 2px solid white;
            animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
        }

        @keyframes pulse-glow {

            0%,
            100% {
                box-shadow: 0 4px 20px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 215, 0, 0.3);
                transform: scale(1);
            }

            50% {
                box-shadow: 0 4px 30px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 215, 0, 0.5);
                transform: scale(1.05);
            }
        }

        @keyframes ping {

            75%,
            100% {
                transform: scale(2);
                opacity: 0;
            }
        }

        /* Welcome Animation Overlay */
        #superuser-welcome-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, rgba(10, 15, 26, 0.95) 0%, rgba(26, 35, 50, 0.95) 100%);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            z-index: 99999;
            display: none;
            align-items: center;
            justify-content: center;
            animation: fadeIn 0.5s ease-out;
        }

        #superuser-welcome-overlay.show {
            display: flex;
        }

        #superuser-welcome-close {
            position: absolute;
            top: 16px;
            right: 20px;
            background: rgba(255, 255, 255, 0.12);
            border: 1px solid rgba(255, 255, 255, 0.22);
            color: #fff;
            font-size: 22px;
            line-height: 1;
            width: 36px;
            height: 36px;
            border-radius: 10px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 100001;
            transition: background 0.15s;
        }
        #superuser-welcome-close:hover { background: rgba(255,255,255,0.22); }

        .welcome-content {
            text-align: center;
            color: white;
            animation: slideInUp 0.8s ease-out;
        }

        .welcome-crown {
            font-size: 120px;
            margin-bottom: 20px;
            animation: crownFloat 3s ease-in-out infinite, crownRotate 10s linear infinite;
            filter: drop-shadow(0 10px 30px rgba(255, 215, 0, 0.8));
        }

        .welcome-title {
            font-size: 3rem;
            font-weight: 800;
            background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffa500 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 10px;
            letter-spacing: 2px;
            text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
        }

        .welcome-subtitle {
            font-size: 1.5rem;
            color: #e2e8f0;
            margin-bottom: 10px;
            font-weight: 300;
            letter-spacing: 1px;
        }

        .welcome-role {
            font-size: 1.2rem;
            color: #94a3b8;
            margin-bottom: 40px;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 3px;
        }

        .welcome-sparkles {
            position: absolute;
            width: 100%;
            height: 100%;
            pointer-events: none;
        }

        .sparkle {
            position: absolute;
            width: 4px;
            height: 4px;
            background: #ffd700;
            border-radius: 50%;
            animation: sparkle 2s ease-in-out infinite;
            box-shadow: 0 0 10px #ffd700;
        }

        @keyframes crownFloat {

            0%,
            100% {
                transform: translateY(0) scale(1);
            }

            50% {
                transform: translateY(-20px) scale(1.1);
            }
        }

        @keyframes crownRotate {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }

        @keyframes slideInUp {
            from {
                opacity: 0;
                transform: translateY(50px);
            }

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

        @keyframes sparkle {

            0%,
            100% {
                opacity: 0;
                transform: scale(0);
            }

            50% {
                opacity: 1;
                transform: scale(1);
            }
        }

        /* Superuser Badge in Toolbar */
        .superuser-badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 6px 12px;
            background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 165, 0, 0.2) 100%);
            border: 1px solid rgba(255, 215, 0, 0.4);
            border-radius: 20px;
            font-size: 0.875rem;
            font-weight: 600;
            color: #ffd700;
            text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
            box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
        }

        .superuser-badge::before {
            content: '👑';
            font-size: 1rem;
        }

        .sales-timeline {
            position: relative;
            padding-left: var(--space-xl);
        }

        .sales-timeline::before {
            content: '';
            position: absolute;
            left: var(--space-sm);
            top: var(--space-sm);
            bottom: var(--space-sm);
            width: 2px;
            background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-secondary) 100%);
            border-radius: 2px;
        }

        .sale-item {
            position: relative;
            padding: var(--space-md);
            margin-bottom: var(--space-sm);
            background: var(--bg-secondary);
            border-radius: var(--radius-md);
            border-left: 3px solid var(--color-primary);
            transition: all var(--transition-base);
        }

        .sale-item:hover {
            background: var(--bg-primary);
            transform: translateX(2px);
            box-shadow: var(--shadow-sm);
        }

        .sale-item:last-child {
            margin-bottom: 0;
        }

        .sale-item::before {
            content: '';
            position: absolute;
            left: -21px;
            top: 14px;
            width: 10px;
            height: 10px;
            background: var(--color-primary);
            border-radius: var(--radius-full);
            border: 2px solid var(--bg-primary);
            box-shadow: 0 0 0 2px var(--color-primary);
        }

        .sale-date {
            font-size: var(--font-size-sm);
            color: var(--color-gray-500);
            font-family: var(--font-family-mono);
            margin-bottom: var(--space-xs);
        }

        .sale-price {
            font-size: var(--font-size-md);
            font-weight: var(--font-weight-bold);
            color: var(--color-secondary);
            font-family: var(--font-family-mono);
        }

        .sale-price.no-price {
            color: var(--color-gray-400);
            font-style: italic;
            font-weight: var(--font-weight-normal);
        }

        .sale-parties {
            font-size: var(--font-size-sm);
            color: var(--color-gray-600);
            margin-top: var(--space-xs);
            line-height: 1.5;
        }

        .sale-parties strong {
            color: var(--color-gray-800);
        }

        .no-sales-message {
            text-align: center;
            padding: var(--space-xl);
            color: var(--color-gray-500);
            font-style: italic;
        }

        .no-sales-message svg {
            width: 36px;
            height: 36px;
            margin-bottom: var(--space-md);
            opacity: 0.4;
        }

        /* Sales Color Mode Legend */
        .sales-legend {
            display: flex;
            flex-direction: column;
            gap: var(--space-xs);
            padding: var(--space-sm) 0;
            margin-left: var(--space-2xl);
            font-size: var(--font-size-sm);
        }

        .sales-legend-item {
            display: flex;
            align-items: center;
            gap: var(--space-sm);
            color: var(--color-gray-600);
            transition: color var(--transition-fast);
        }

        .sales-legend-item:hover {
            color: var(--color-gray-900);
        }

        .sales-legend-color {
            width: 14px;
            height: 14px;
            border-radius: var(--radius-sm);
            flex-shrink: 0;
            box-shadow: var(--shadow-sm);
        }

        .sales-legend-color.recent {
            background: linear-gradient(135deg, #e74c3c, #c0392b);
        }

        .sales-legend-color.year {
            background: linear-gradient(135deg, #f39c12, #d68910);
        }

        .sales-legend-color.older {
            background: linear-gradient(135deg, #27ae60, #229954);
        }

        .sales-legend-color.none {
            background: linear-gradient(135deg, #95a5a6, #7f8c8d);
        }

        /* Toast & Loader */
        #toast-container {
            position: fixed;
            top: 80px;
            right: 20px;
            z-index: 10000;
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: none;
        }

        /* ===== TOAST NOTIFICATIONS ===== */
        .toast {
            background: var(--color-gray-900);
            color: var(--color-white);
            padding: var(--space-lg) var(--space-xl);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-xl);
            display: flex;
            align-items: center;
            gap: var(--space-md);
            min-width: 300px;
            max-width: 420px;
            pointer-events: auto;
            animation: toastSlideIn var(--transition-slow) cubic-bezier(0.34, 1.56, 0.64, 1);
            transition: opacity var(--transition-slow), transform var(--transition-slow);
            border: 1px solid rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
        }

        .toast.hiding {
            opacity: 0;
            transform: translateX(120%);
        }

        @keyframes toastSlideIn {
            from {
                opacity: 0;
                transform: translateX(120%) scale(0.9);
            }

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

        .toast-icon {
            width: 24px;
            height: 24px;
            flex-shrink: 0;
        }

        .toast-content {
            flex: 1;
        }

        .toast-title {
            font-weight: 600;
            font-size: 14px;
            margin-bottom: 2px;
        }

        .toast-message {
            font-size: 13px;
            opacity: 0.9;
        }

        .toast-close {
            background: none;
            border: none;
            color: white;
            opacity: 0.7;
            cursor: pointer;
            padding: 4px;
            font-size: 18px;
            line-height: 1;
        }

        .toast-close:hover {
            opacity: 1;
        }

        .toast.success {
            background: linear-gradient(135deg, #27ae60, #2ecc71);
        }

        .toast.error {
            background: linear-gradient(135deg, #c0392b, #e74c3c);
        }

        .toast.warning {
            background: linear-gradient(135deg, #d35400, #e67e22);
        }

        .toast.info {
            background: linear-gradient(135deg, #2980b9, #3498db);
        }



        .layer-toggle.loading::after {
            content: "";
            display: inline-block;
            width: 12px;
            height: 12px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-top-color: white;
            border-radius: 50%;
            margin-left: 6px;
            animation: spin 0.8s linear infinite;
        }

        /* Mobile Layout Adjustments (Landscape) */
        @media only screen and (max-height: 600px) and (orientation: landscape) {
            :root { --toolbar-h: 48px; }
            #toolbar {
                height: var(--toolbar-h);
                padding: 0 10px;
            }

            .brand {
                font-size: 1.1em;
                white-space: nowrap;
            }

            .logo-img {
                height: 28px;
            }

            .btn-toggle {
                padding: 4px 8px;
                font-size: 0.8em;
            }

            #search-input {
                width: 140px;
                padding: 4px;
                font-size: 16px; /* Minimum 16px prevents iOS auto-zoom on focus */
            }

            .stats {
                display: none;
            }



            .map-layer-controls {
                top: 5px;
                left: 10px;
                right: auto;
                max-height: 80vh;
            }
        }


        /* ===== MORTGAGE CALCULATOR MODAL ===== */
        #mortgage-calc-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: var(--bg-overlay);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            z-index: var(--z-modal);
            display: none;
            justify-content: center;
            align-items: center;
            animation: fadeIn var(--transition-base) ease;
        }

        #mortgage-calc-modal.show {
            display: flex;
        }

        .mortgage-calc-content {
            background: var(--bg-primary);
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-xl);
            max-width: 900px;
            width: 90%;
            max-height: 90vh;
            overflow-y: auto;
            animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .mortgage-calc-header {
            padding: var(--space-xl) var(--space-2xl);
            border-bottom: 1px solid var(--border-light);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
        }

        .mortgage-calc-header h2 {
            margin: 0;
            font-size: var(--font-size-xl);
            font-weight: var(--font-weight-semibold);
            color: var(--color-dark-alt);
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }

        .mortgage-calc-header h2 svg {
            width: 24px;
            height: 24px;
            color: var(--color-primary);
        }

        .mortgage-calc-close {
            background: none;
            border: none;
            font-size: 28px;
            color: var(--color-gray-400);
            cursor: pointer;
            padding: var(--space-xs);
            line-height: 1;
            border-radius: var(--radius-md);
            transition: all var(--transition-base);
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .mortgage-calc-close:hover {
            background: var(--color-gray-50);
            color: var(--color-gray-900);
            transform: scale(1.1);
        }

        .mortgage-calc-body {
            padding: var(--space-2xl);
            display: flex;
            gap: var(--space-2xl);
            flex-wrap: wrap;
        }

        .calc-inputs-column {
            flex: 1;
            min-width: 240px;
        }

        .calc-results-column {
            flex: 3;
            min-width: 400px;
        }

        .calc-form-group {
            margin-bottom: var(--space-xl);
        }

        .calc-form-group label {
            display: block;
            font-weight: var(--font-weight-semibold);
            color: var(--color-gray-900);
            margin-bottom: var(--space-sm);
            font-size: var(--font-size-md);
        }

        .calc-form-group .label-subtitle {
            font-size: var(--font-size-sm);
            color: var(--color-gray-600);
            font-weight: var(--font-weight-normal);
            margin-left: var(--space-xs);
        }

        .calc-input-wrapper {
            position: relative;
            display: flex;
            align-items: center;
        }

        .calc-input-prefix,
        .calc-input-suffix {
            position: absolute;
            color: var(--color-gray-600);
            font-weight: var(--font-weight-medium);
            font-size: var(--font-size-md);
        }

        .calc-input-prefix {
            left: var(--space-md);
        }

        .calc-input-suffix {
            right: var(--space-md);
        }

        .calc-input {
            width: 100%;
            padding: var(--space-md) var(--space-lg);
            border: 1px solid var(--border-dark);
            border-radius: var(--radius-md);
            font-size: var(--font-size-md);
            font-family: var(--font-family);
            transition: all var(--transition-base);
            background: var(--bg-primary);
            color: var(--color-gray-900);
            box-shadow: var(--shadow-sm);
        }

        .calc-input.has-prefix {
            padding-left: 2.5rem;
        }

        .calc-input.has-suffix {
            padding-right: 2.5rem;
        }

        .calc-input:hover {
            border-color: var(--color-primary);
        }

        .calc-input:focus {
            outline: none;
            border-color: var(--color-primary);
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2), var(--shadow-md);
        }

        .calc-grid {
            display: flex;
            flex-direction: column;
            gap: 0;
        }

        .calc-results {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: var(--radius-lg);
            padding: var(--space-xl);
            margin-bottom: var(--space-xl);
            color: var(--color-white);
        }

        .calc-results h3 {
            margin: 0 0 var(--space-lg) 0;
            font-size: var(--font-size-xl);
            font-weight: var(--font-weight-bold);
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }

        .calc-results h3 svg {
            width: 24px;
            height: 24px;
        }

        .calc-result-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: var(--space-lg);
        }

        .calc-result-item {
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border-radius: var(--radius-md);
            padding: var(--space-lg);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .calc-result-label {
            font-size: var(--font-size-sm);
            opacity: 0.9;
            margin-bottom: var(--space-xs);
        }

        .calc-result-value {
            font-size: var(--font-size-2xl);
            font-weight: var(--font-weight-bold);
            font-family: var(--font-family-mono);
        }

        .calc-result-breakdown {
            margin-top: var(--space-lg);
            padding-top: var(--space-lg);
            border-top: 1px solid rgba(255, 255, 255, 0.2);
        }

        .calc-breakdown-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: var(--space-sm) 0;
            font-size: var(--font-size-base);
        }

        .calc-breakdown-item .label {
            opacity: 0.9;
        }

        .calc-breakdown-item .value {
            font-weight: var(--font-weight-semibold);
            font-family: var(--font-family-mono);
        }

        .calc-info-box {
            background: var(--bg-secondary);
            border-left: 4px solid var(--color-primary);
            border-radius: var(--radius-md);
            padding: var(--space-lg);
            margin-top: var(--space-lg);
        }

        .calc-info-box p {
            margin: 0;
            color: var(--color-gray-700);
            font-size: var(--font-size-base);
            line-height: 1.6;
        }

        .calc-chart-section {
            background: var(--bg-primary);
            border-radius: var(--radius-lg);
            padding: var(--space-xl);
            border: 1px solid var(--border-medium);
        }

        .calc-chart-section h3 {
            margin: 0 0 var(--space-lg) 0;
            font-size: var(--font-size-lg);
            font-weight: var(--font-weight-semibold);
            color: var(--color-dark-alt);
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }

        .calc-chart-section h3 svg {
            width: 20px;
            height: 20px;
            color: var(--color-primary);
        }

        #mill-rate-chart {
            width: 100%;
            height: 450px;
            position: relative;
        }

        .chart-bar {
            transition: all var(--transition-base);
        }

        .chart-bar:hover {
            opacity: 0.8;
        }

        .chart-highlight {
            fill: var(--color-primary);
        }

        .chart-normal {
            fill: var(--color-gray-400);
        }

        .chart-text {
            font-family: var(--font-family);
            font-size: 14px;
            fill: var(--color-gray-700);
        }

        .chart-value-text {
            font-family: var(--font-family-mono);
            font-size: 12px;
            font-weight: var(--font-weight-semibold);
            fill: var(--color-gray-900);
        }

        .chart-axis-line {
            stroke: var(--color-gray-300);
            stroke-width: 1;
        }

        .chart-grid-line {
            stroke: var(--color-gray-200);
            stroke-width: 1;
            stroke-dasharray: 2, 2;
        }

        @media (max-width: 768px) {
            .mortgage-calc-body {
                flex-direction: column;
            }

            .calc-inputs-column,
            .calc-results-column {
                min-width: 100%;
            }

            .calc-result-grid {
                grid-template-columns: 1fr;
            }

            #mill-rate-chart {
                height: 250px;
            }
        }

        /* ===== GROWTH CALCULATOR MODAL ===== */
        #growth-calc-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: var(--bg-overlay);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            z-index: var(--z-modal);
            display: none;
            justify-content: center;
            align-items: center;
            animation: fadeIn var(--transition-base) ease;
        }

        #growth-calc-modal.show {
            display: flex;
        }

        .growth-calc-content {
            background: var(--bg-primary);
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-xl);
            max-width: 900px;
            width: 95%;
            max-height: 90vh;
            overflow-y: auto;
            animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .growth-calc-header {
            padding: var(--space-xl) var(--space-2xl);
            border-bottom: 1px solid var(--border-light);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: linear-gradient(135deg, #059669 0%, #10b981 100%);
        }

        .growth-calc-header h2 {
            margin: 0;
            font-size: var(--font-size-xl);
            font-weight: var(--font-weight-bold);
            color: white;
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }

        .growth-calc-header h2 svg {
            width: 24px;
            height: 24px;
        }

        .growth-calc-close {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            font-size: 24px;
            color: white;
            cursor: pointer;
            padding: var(--space-xs);
            line-height: 1;
            border-radius: var(--radius-md);
            transition: all var(--transition-base);
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .growth-calc-close:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: scale(1.1);
        }

        .growth-calc-body {
            padding: var(--space-2xl);
        }

        .growth-inputs-row {
            display: flex;
            gap: var(--space-xl);
            margin-bottom: var(--space-xl);
            flex-wrap: wrap;
        }

        .growth-input-group {
            flex: 1;
            min-width: 180px;
        }

        .growth-input-group label {
            display: block;
            font-weight: var(--font-weight-semibold);
            color: var(--color-gray-700);
            margin-bottom: var(--space-sm);
            font-size: var(--font-size-sm);
        }

        .growth-input {
            width: 100%;
            padding: var(--space-md);
            border: 1px solid var(--border-dark);
            border-radius: var(--radius-md);
            font-size: var(--font-size-md);
            font-family: var(--font-family-mono);
            background: var(--bg-primary);
            color: var(--color-gray-900);
            transition: all var(--transition-base);
        }

        .growth-input:focus {
            outline: none;
            border-color: #10b981;
            box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
        }

        .growth-zones-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: var(--space-lg);
            margin-bottom: var(--space-xl);
        }

        .growth-zone-card {
            background: var(--bg-secondary);
            border-radius: var(--radius-lg);
            padding: var(--space-lg);
            border: 1px solid var(--border-light);
            transition: all var(--transition-base);
        }

        .growth-zone-card:hover {
            box-shadow: var(--shadow-md);
            border-color: var(--color-primary);
        }

        .growth-zone-header {
            display: flex;
            align-items: center;
            gap: var(--space-sm);
            margin-bottom: var(--space-md);
        }

        .growth-zone-dot {
            width: 12px;
            height: 12px;
            border-radius: var(--radius-full);
        }

        .growth-zone-dot.downtown { background: #2980b9; }
        .growth-zone-dot.lakefront { background: #0097a7; }
        .growth-zone-dot.thelands { background: #27ae60; }
        .growth-zone-dot.townowned { background: #d68910; }
        .growth-zone-dot.treegrowth { background: #8e44ad; }

        .growth-zone-name {
            font-weight: var(--font-weight-bold);
            color: var(--color-gray-900);
            font-size: var(--font-size-md);
        }

        .growth-zone-stats {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: var(--space-sm);
            margin-bottom: var(--space-md);
        }

        .growth-zone-stat {
            padding: var(--space-sm);
            background: var(--bg-primary);
            border-radius: var(--radius-sm);
        }

        .growth-zone-stat-label {
            font-size: var(--font-size-xs);
            color: var(--color-gray-500);
            text-transform: uppercase;
            font-weight: var(--font-weight-semibold);
        }

        .growth-zone-stat-value {
            font-size: var(--font-size-md);
            font-weight: var(--font-weight-bold);
            color: var(--color-gray-900);
            font-family: var(--font-family-mono);
        }

        .growth-zone-rate-input {
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }

        .growth-zone-rate-input label {
            font-size: var(--font-size-sm);
            color: var(--color-gray-600);
            white-space: nowrap;
        }

        .growth-zone-rate-input input {
            width: 80px;
            padding: var(--space-sm);
            border: 1px solid var(--border-medium);
            border-radius: var(--radius-sm);
            font-size: var(--font-size-sm);
            font-family: var(--font-family-mono);
            text-align: center;
            background: var(--bg-primary);
            color: var(--color-gray-900);
        }

        .growth-zone-rate-input input:focus {
            outline: none;
            border-color: #10b981;
            box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
        }

        .growth-zone-future {
            margin-top: var(--space-md);
            padding: var(--space-md);
            background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
            border-radius: var(--radius-md);
            border: 1px solid rgba(16, 185, 129, 0.3);
        }

        .growth-zone-future-label {
            font-size: var(--font-size-xs);
            color: #059669;
            text-transform: uppercase;
            font-weight: var(--font-weight-bold);
            margin-bottom: var(--space-xs);
        }

        .growth-zone-future-value {
            font-size: var(--font-size-lg);
            font-weight: var(--font-weight-extrabold);
            color: #059669;
            font-family: var(--font-family-mono);
        }

        .growth-zone-gain {
            font-size: var(--font-size-xs);
            color: #10b981;
            margin-top: var(--space-xs);
        }

        .growth-total-section {
            background: linear-gradient(135deg, #059669 0%, #10b981 100%);
            border-radius: var(--radius-lg);
            padding: var(--space-xl);
            color: white;
            margin-top: var(--space-xl);
        }

        .growth-total-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: var(--space-lg);
        }

        .growth-total-title {
            font-size: var(--font-size-lg);
            font-weight: var(--font-weight-bold);
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }

        .growth-total-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: var(--space-lg);
        }

        .growth-total-item {
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(8px);
            border-radius: var(--radius-md);
            padding: var(--space-lg);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .growth-total-label {
            font-size: var(--font-size-sm);
            opacity: 0.9;
            margin-bottom: var(--space-xs);
        }

        .growth-total-value {
            font-size: var(--font-size-2xl);
            font-weight: var(--font-weight-extrabold);
            font-family: var(--font-family-mono);
        }

        /* Valuation Chart Section */
        .valuation-chart-section {
            margin-bottom: var(--space-xl);
            background: var(--bg-secondary);
            border-radius: var(--radius-lg);
            padding: var(--space-lg);
            border: 1px solid var(--border-light);
        }

        .valuation-chart-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: var(--space-md);
            flex-wrap: wrap;
            gap: var(--space-md);
        }

        .valuation-chart-title {
            font-size: var(--font-size-lg);
            font-weight: var(--font-weight-bold);
            color: var(--color-gray-900);
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }

        .valuation-chart-title svg {
            color: #059669;
        }

        .valuation-chart-controls {
            display: flex;
            align-items: center;
            gap: var(--space-lg);
            flex-wrap: wrap;
        }

        .valuation-chart-controls label {
            display: flex;
            align-items: center;
            gap: var(--space-sm);
            font-size: var(--font-size-sm);
            color: var(--color-gray-700);
            cursor: pointer;
        }

        .valuation-chart-controls input[type="checkbox"] {
            width: 18px;
            height: 18px;
            accent-color: #10b981;
            cursor: pointer;
        }

        .valuation-chart-controls input[type="number"] {
            width: 70px;
            padding: var(--space-xs) var(--space-sm);
            border: 1px solid var(--border-medium);
            border-radius: var(--radius-sm);
            font-size: var(--font-size-sm);
            font-family: var(--font-family-mono);
            text-align: center;
        }

        .valuation-chart-controls input[type="number"]:focus {
            outline: none;
            border-color: #10b981;
            box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
        }

        .valuation-chart-container {
            height: 380px;
            background: var(--bg-primary);
            border-radius: var(--radius-md);
            padding: var(--space-md);
        }

        .valuation-legend {
            display: flex;
            justify-content: center;
            gap: var(--space-xl);
            margin-top: var(--space-md);
            flex-wrap: wrap;
        }

        .valuation-legend-item {
            display: flex;
            align-items: center;
            gap: var(--space-xs);
            font-size: var(--font-size-sm);
            color: var(--color-gray-700);
        }

        .valuation-legend-dot {
            width: 12px;
            height: 12px;
            border-radius: var(--radius-full);
        }

        .valuation-legend-dot.historical {
            background: #3b82f6;
        }

        .valuation-legend-dot.projected {
            background: #10b981;
        }

        .valuation-legend-dot.mill-rate {
            background: #f59e0b;
        }

        .valuation-legend-dot.state-valuation {
            background: #8b5cf6;
        }

        .valuation-legend-dot.shortfall {
            background: linear-gradient(135deg, #ef4444 50%, transparent 50%);
            border: 1px solid #ef4444;
        }

        .valuation-legend-dot.state-projected {
            background: #a78bfa;
            border: 2px dashed #8b5cf6;
        }

        .valuation-stats-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: var(--space-md);
            margin-top: var(--space-lg);
            padding-top: var(--space-lg);
            border-top: 1px solid var(--border-light);
        }

        .valuation-stat-card {
            text-align: center;
            padding: var(--space-md);
            background: var(--bg-primary);
            border-radius: var(--radius-md);
            border: 1px solid var(--border-light);
        }

        .valuation-stat-label {
            font-size: var(--font-size-xs);
            color: var(--color-gray-500);
            text-transform: uppercase;
            font-weight: var(--font-weight-semibold);
            margin-bottom: var(--space-xs);
        }

        .valuation-stat-value {
            font-size: var(--font-size-lg);
            font-weight: var(--font-weight-bold);
            color: var(--color-gray-900);
            font-family: var(--font-family-mono);
        }

        .valuation-stat-value.positive {
            color: #10b981;
        }

        .valuation-stat-value.negative {
            color: #ef4444;
        }

        /* Collapsible Section Styles */
        .collapsible-section {
            border: 1px solid var(--border-light);
            border-radius: var(--radius-lg);
            overflow: hidden;
            margin-top: var(--space-xl);
        }

        .collapsible-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: var(--space-md) var(--space-lg);
            background: var(--bg-secondary);
            cursor: pointer;
            transition: background 0.2s;
            user-select: none;
        }

        .collapsible-header:hover {
            background: var(--bg-tertiary, #e5e7eb);
        }

        .collapsible-header-title {
            display: flex;
            align-items: center;
            gap: var(--space-sm);
            font-weight: var(--font-weight-semibold);
            color: var(--color-gray-800);
        }

        .collapsible-header-title svg {
            color: #8b5cf6;
        }

        .collapsible-toggle {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            border-radius: var(--radius-full);
            background: var(--bg-primary);
            transition: transform 0.3s ease;
        }

        .collapsible-toggle svg {
            width: 16px;
            height: 16px;
            color: var(--color-gray-600);
            transition: transform 0.3s ease;
        }

        .collapsible-section.collapsed .collapsible-toggle svg {
            transform: rotate(-90deg);
        }

        .collapsible-content {
            max-height: 2000px;
            overflow: hidden;
            transition: max-height 0.4s ease-out, padding 0.3s ease;
            padding: var(--space-lg);
        }

        .collapsible-section.collapsed .collapsible-content {
            max-height: 0;
            padding-top: 0;
            padding-bottom: 0;
        }

        /* Combined Growth Chart Section */
        .combined-growth-chart-section {
            margin-top: var(--space-xl);
            background: var(--bg-secondary);
            border-radius: var(--radius-lg);
            padding: var(--space-lg);
            border: 1px solid var(--border-light);
        }

        .combined-growth-chart-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: var(--space-md);
        }

        .combined-growth-chart-title {
            font-size: var(--font-size-lg);
            font-weight: var(--font-weight-bold);
            color: var(--color-gray-900);
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }

        .combined-growth-chart-title svg {
            color: #10b981;
        }

        .combined-growth-chart-container {
            height: 350px;
            background: var(--bg-primary);
            border-radius: var(--radius-md);
            padding: var(--space-md);
        }

        .combined-growth-legend {
            display: flex;
            justify-content: center;
            gap: var(--space-lg);
            margin-top: var(--space-md);
            flex-wrap: wrap;
        }

        .combined-growth-legend-item {
            display: flex;
            align-items: center;
            gap: var(--space-xs);
            font-size: var(--font-size-sm);
            color: var(--color-gray-700);
        }

        .combined-growth-legend-dot {
            width: 12px;
            height: 12px;
            border-radius: var(--radius-full);
        }

        .combined-growth-legend-dot.downtown { background: #2980b9; }
        .combined-growth-legend-dot.lakefront { background: #0097a7; }
        .combined-growth-legend-dot.thelands { background: #27ae60; }
        .combined-growth-legend-dot.townowned { background: #d68910; }
        .combined-growth-legend-dot.treegrowth { background: #8e44ad; }
        .combined-growth-legend-dot.total { background: #059669; }

        .combined-growth-legend-item.toggle-item {
            cursor: pointer;
            padding: 4px 8px;
            border-radius: var(--radius-sm);
            transition: all 0.2s;
            border: 1px solid transparent;
        }

        .combined-growth-legend-item.toggle-item:hover {
            background: var(--bg-secondary);
            border-color: var(--border-light);
        }

        .combined-growth-legend-item.toggle-item input[type="checkbox"] {
            width: 14px;
            height: 14px;
            accent-color: #10b981;
            cursor: pointer;
            margin-right: 4px;
        }

        .combined-growth-legend-item.toggle-item:has(input:not(:checked)) {
            opacity: 0.5;
        }

        .combined-growth-legend-item.total-item {
            padding: 4px 8px;
            background: rgba(5, 150, 105, 0.1);
            border-radius: var(--radius-sm);
            border: 1px solid rgba(5, 150, 105, 0.3);
            font-weight: var(--font-weight-semibold);
        }

        @media (max-width: 768px) {
            .growth-calc-content {
                width: 98%;
                max-height: 95vh;
            }

            .growth-zones-grid {
                grid-template-columns: 1fr;
            }

            .valuation-chart-container {
                height: 250px;
            }

            .valuation-chart-header {
                flex-direction: column;
                align-items: flex-start;
            }

            .growth-inputs-row {
                flex-direction: column;
            }

            .growth-total-grid {
                grid-template-columns: 1fr;
            }
        }

        /* ===== SELECTION GROUPS MODAL ===== */
        #groups-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: var(--bg-overlay);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            z-index: var(--z-modal);
            display: none;
            justify-content: center;
            align-items: center;
            animation: fadeIn var(--transition-base) ease;
        }

        #groups-modal.show {
            display: flex;
        }

        .groups-modal-content {
            background: var(--bg-primary);
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-xl);
            max-width: 600px;
            width: 90%;
            max-height: 85vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .groups-modal-header {
            padding: var(--space-xl) var(--space-2xl);
            border-bottom: 1px solid var(--border-light);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
        }

        .groups-modal-header h2 {
            margin: 0;
            font-size: var(--font-size-xl);
            font-weight: var(--font-weight-semibold);
            color: var(--color-dark-alt);
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }

        .groups-modal-header h2 svg {
            width: 24px;
            height: 24px;
            color: var(--color-primary);
        }

        .groups-modal-close {
            background: none;
            border: none;
            font-size: 28px;
            color: var(--color-gray-400);
            cursor: pointer;
            padding: var(--space-xs);
            line-height: 1;
            border-radius: var(--radius-md);
            transition: all var(--transition-base);
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .groups-modal-close:hover {
            background: var(--color-gray-50);
            color: var(--color-gray-900);
            transform: scale(1.1);
        }

        .groups-modal-body {
            padding: var(--space-2xl);
            overflow-y: auto;
            flex: 1;
        }

        .groups-save-section {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: var(--radius-lg);
            padding: var(--space-xl);
            margin-bottom: var(--space-xl);
            color: var(--color-white);
        }

        .groups-save-section h3 {
            margin: 0 0 var(--space-md) 0;
            font-size: var(--font-size-lg);
            font-weight: var(--font-weight-semibold);
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }

        .groups-save-form {
            display: flex;
            gap: var(--space-md);
        }

        .groups-save-form input {
            flex: 1;
            padding: var(--space-sm) var(--space-md);
            border: 1px solid rgba(255, 255, 255, 0.3);
            border-radius: var(--radius-md);
            background: rgba(255, 255, 255, 0.1);
            color: var(--color-white);
            font-size: var(--font-size-md);
        }

        .groups-save-form input::placeholder {
            color: rgba(255, 255, 255, 0.6);
        }

        .groups-save-form button {
            padding: var(--space-sm) var(--space-lg);
            border: none;
            border-radius: var(--radius-md);
            background: rgba(255, 255, 255, 0.2);
            color: var(--color-white);
            font-weight: var(--font-weight-semibold);
            cursor: pointer;
            transition: all var(--transition-base);
        }

        .groups-save-form button:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        .groups-list-section h3 {
            margin: 0 0 var(--space-md) 0;
            font-size: var(--font-size-lg);
            font-weight: var(--font-weight-semibold);
            color: var(--color-dark-alt);
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }

        .groups-list {
            display: flex;
            flex-direction: column;
            gap: var(--space-md);
        }

        .group-card {
            background: var(--bg-secondary);
            border: 1px solid var(--border-medium);
            border-radius: var(--radius-lg);
            padding: var(--space-lg);
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: all var(--transition-base);
        }

        .group-card:hover {
            border-color: var(--color-primary);
            box-shadow: var(--shadow-md);
        }

        .group-info h4 {
            margin: 0 0 var(--space-xs) 0;
            font-size: var(--font-size-md);
            font-weight: var(--font-weight-semibold);
            color: var(--color-dark-alt);
        }

        .group-info p {
            margin: 0;
            font-size: var(--font-size-sm);
            color: var(--color-gray-600);
        }

        .group-actions {
            display: flex;
            gap: var(--space-sm);
        }

        .group-action-btn {
            padding: var(--space-sm) var(--space-md);
            border: 1px solid var(--border-medium);
            border-radius: var(--radius-md);
            background: var(--bg-primary);
            color: var(--color-gray-700);
            font-size: var(--font-size-sm);
            cursor: pointer;
            transition: all var(--transition-base);
            display: flex;
            align-items: center;
            gap: var(--space-xs);
        }

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

        .group-action-btn.delete:hover {
            border-color: var(--color-accent-red);
            color: var(--color-accent-red);
        }

        .group-action-btn svg {
            width: 14px;
            height: 14px;
        }

        .groups-empty {
            text-align: center;
            padding: var(--space-2xl);
            color: var(--color-gray-500);
        }

        .groups-import-section {
            margin-top: var(--space-xl);
            padding-top: var(--space-xl);
            border-top: 1px solid var(--border-light);
            display: flex;
            justify-content: center;
            gap: var(--space-md);
        }

        .groups-import-btn {
            padding: var(--space-sm) var(--space-lg);
            border: 1px solid var(--border-medium);
            border-radius: var(--radius-md);
            background: var(--bg-primary);
            color: var(--color-gray-700);
            font-size: var(--font-size-md);
            cursor: pointer;
            transition: all var(--transition-base);
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }

        .groups-import-btn:hover {
            border-color: var(--color-primary);
            color: var(--color-primary);
            background: var(--color-primary-bg);
        }

        .groups-import-btn svg {
            width: 16px;
            height: 16px;
        }

        /* ===== STACK RANKING MODAL ===== */
        .stack-ranking-modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(8px);
            z-index: var(--z-modal);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .stack-ranking-modal {
            background: var(--bg-primary);
            width: 100%;
            max-width: 1200px;
            max-height: 90vh;
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-xl);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            border: 1px solid var(--border-light);
        }

        .stack-ranking-header {
            background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
            color: white;
            padding: 20px 24px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
        }

        .stack-ranking-title-area {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .stack-ranking-icon {
            background: rgba(99, 102, 241, 0.2);
            padding: 10px;
            border-radius: 12px;
        }

        .stack-ranking-controls {
            background: var(--bg-secondary);
            padding: 16px 24px;
            border-bottom: 1px solid var(--border-light);
            display: flex;
            flex-wrap: wrap;
            gap: 16px;
            align-items: center;
        }

        .stack-ranking-control-group {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .stack-ranking-control-group label {
            font-size: 12px;
            font-weight: 700;
            color: var(--color-gray-600);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .stack-ranking-control-group select,
        .stack-ranking-control-group input[type="number"] {
            background: var(--bg-primary);
            border: 1px solid var(--border-light);
            border-radius: 6px;
            padding: 8px 12px;
            font-size: 13px;
            color: var(--color-gray-900);
            outline: none;
            transition: border-color 0.2s;
        }

        .stack-ranking-control-group select:focus,
        .stack-ranking-control-group input[type="number"]:focus {
            border-color: var(--color-primary);
        }

        .stack-ranking-toggle-group {
            display: flex;
            background: var(--bg-primary);
            border: 1px solid var(--border-light);
            border-radius: 8px;
            overflow: hidden;
        }

        .stack-ranking-toggle-btn {
            padding: 8px 16px;
            font-size: 12px;
            font-weight: 600;
            border: none;
            background: transparent;
            color: var(--color-gray-600);
            cursor: pointer;
            transition: all 0.2s;
        }

        .stack-ranking-toggle-btn.active {
            background: var(--color-primary);
            color: white;
        }

        .stack-ranking-toggle-btn:hover:not(.active) {
            background: var(--bg-secondary);
        }

        .stack-ranking-body {
            flex: 1;
            overflow: auto;
            padding: 24px;
            background: var(--bg-secondary);
        }

        .stack-ranking-summary {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 16px;
            margin-bottom: 24px;
        }

        .stack-ranking-stat-card {
            background: var(--bg-primary);
            border: 1px solid var(--border-light);
            border-radius: 12px;
            padding: 16px;
            text-align: center;
        }

        .stack-ranking-stat-label {
            font-size: 11px;
            font-weight: 700;
            color: var(--color-gray-500);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 8px;
        }

        .stack-ranking-stat-value {
            font-size: 24px;
            font-weight: 800;
            color: var(--color-gray-900);
            font-family: var(--font-family-mono);
        }

        .stack-ranking-chart-container {
            background: var(--bg-primary);
            border: 1px solid var(--border-light);
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 24px;
        }

        .stack-ranking-chart-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
        }

        .stack-ranking-chart-title {
            font-size: 14px;
            font-weight: 700;
            color: var(--color-gray-800);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .stack-ranking-bar-chart {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .stack-ranking-bar-row {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .stack-ranking-bar-rank {
            width: 32px;
            font-size: 12px;
            font-weight: 800;
            color: var(--color-gray-500);
            text-align: center;
            flex-shrink: 0;
        }

        .stack-ranking-bar-label {
            width: 140px;
            font-size: 12px;
            font-weight: 600;
            color: var(--color-gray-800);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex-shrink: 0;
        }

        .stack-ranking-bar-track {
            flex: 1;
            height: 28px;
            background: var(--bg-secondary);
            border-radius: 6px;
            overflow: hidden;
            position: relative;
        }

        .stack-ranking-bar-fill {
            height: 100%;
            border-radius: 6px;
            transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            align-items: center;
            justify-content: flex-end;
            padding-right: 8px;
        }

        .stack-ranking-bar-value {
            font-size: 11px;
            font-weight: 700;
            color: white;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
            white-space: nowrap;
        }

        .stack-ranking-bar-value-outside {
            position: absolute;
            left: 8px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 11px;
            font-weight: 700;
            color: var(--color-gray-600);
        }

        .stack-ranking-group-section {
            background: var(--bg-primary);
            border: 1px solid var(--border-light);
            border-radius: 12px;
            margin-bottom: 16px;
            overflow: hidden;
        }

        .stack-ranking-group-header {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
            padding: 16px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            transition: background 0.2s;
        }

        .stack-ranking-group-header:hover {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
        }

        .stack-ranking-group-name {
            font-size: 15px;
            font-weight: 700;
            color: var(--color-gray-900);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .stack-ranking-group-count {
            font-size: 12px;
            font-weight: 600;
            color: var(--color-primary);
            background: rgba(99, 102, 241, 0.1);
            padding: 4px 10px;
            border-radius: 20px;
        }

        .stack-ranking-group-stats {
            display: flex;
            gap: 20px;
        }

        .stack-ranking-group-stat {
            text-align: right;
        }

        .stack-ranking-group-stat-label {
            font-size: 10px;
            font-weight: 600;
            color: var(--color-gray-500);
            text-transform: uppercase;
        }

        .stack-ranking-group-stat-value {
            font-size: 14px;
            font-weight: 800;
            color: var(--color-gray-900);
            font-family: var(--font-family-mono);
        }

        .stack-ranking-group-content {
            padding: 16px 20px;
            max-height: 400px;
            overflow-y: auto;
        }

        .stack-ranking-table {
            width: 100%;
            border-collapse: collapse;
        }

        .stack-ranking-table th {
            text-align: left;
            padding: 10px 12px;
            font-size: 11px;
            font-weight: 700;
            color: var(--color-gray-500);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-light);
            position: sticky;
            top: 0;
        }

        .stack-ranking-table th.sortable {
            cursor: pointer;
            transition: color 0.2s;
        }

        .stack-ranking-table th.sortable:hover {
            color: var(--color-primary);
        }

        .stack-ranking-table th.sorted {
            color: var(--color-primary);
        }

        .stack-ranking-table td {
            padding: 12px;
            font-size: 13px;
            color: var(--color-gray-800);
            border-bottom: 1px solid var(--border-light);
        }

        .stack-ranking-table tr:hover {
            background: var(--bg-secondary);
        }

        .stack-ranking-table .numeric {
            text-align: right;
            font-family: var(--font-family-mono);
            font-weight: 600;
        }

        .stack-ranking-table .rank-cell {
            font-weight: 800;
            color: var(--color-gray-500);
            width: 50px;
        }

        .stack-ranking-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 11px;
            font-weight: 700;
        }

        .stack-ranking-badge.top {
            background: rgba(16, 185, 129, 0.15);
            color: #059669;
        }

        .stack-ranking-badge.bottom {
            background: rgba(239, 68, 68, 0.15);
            color: #dc2626;
        }

        .stack-ranking-legend {
            display: flex;
            gap: 16px;
            margin-top: 16px;
            padding-top: 16px;
            border-top: 1px solid var(--border-light);
        }

        .stack-ranking-legend-item {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            color: var(--color-gray-600);
        }

        .stack-ranking-legend-color {
            width: 16px;
            height: 16px;
            border-radius: 4px;
        }

        .stack-ranking-search-group {
            position: relative;
            display: flex;
            align-items: center;
            flex: 1;
            min-width: 220px;
            max-width: 400px;
        }

        .stack-ranking-search-group .search-icon {
            position: absolute;
            left: 10px;
            color: var(--color-gray-500);
            pointer-events: none;
            display: flex;
            align-items: center;
        }

        .stack-ranking-search-group input[type="text"] {
            width: 100%;
            background: var(--bg-primary);
            border: 1px solid var(--border-light);
            border-radius: 8px;
            padding: 8px 12px 8px 34px;
            font-size: 13px;
            color: var(--color-gray-900);
            outline: none;
            transition: border-color 0.2s, box-shadow 0.2s;
        }

        .stack-ranking-search-group input[type="text"]:focus {
            border-color: var(--color-primary);
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
        }

        .stack-ranking-search-group input[type="text"]::placeholder {
            color: var(--color-gray-400);
        }

        .stack-ranking-search-clear {
            position: absolute;
            right: 8px;
            background: rgba(99, 102, 241, 0.1);
            border: none;
            border-radius: 50%;
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: var(--color-gray-500);
            transition: all 0.2s;
            padding: 0;
        }

        .stack-ranking-search-clear:hover {
            background: rgba(99, 102, 241, 0.2);
            color: var(--color-primary);
        }

        .stack-ranking-search-info {
            position: absolute;
            right: 34px;
            font-size: 11px;
            font-weight: 600;
            color: var(--color-gray-400);
            pointer-events: none;
            white-space: nowrap;
        }

        .stack-ranking-search-info.has-match {
            color: #10b981;
        }

        .stack-ranking-search-info.no-match {
            color: #ef4444;
        }

        .stack-ranking-table tr.search-highlight td {
            background: rgba(250, 204, 21, 0.18) !important;
            border-top: 2px solid #eab308;
            border-bottom: 2px solid #eab308;
        }

        .stack-ranking-table tr.search-highlight td:first-child {
            border-left: 3px solid #eab308;
        }

        .stack-ranking-bar-row.search-highlight {
            background: rgba(250, 204, 21, 0.15);
            border-radius: 6px;
            outline: 2px solid #eab308;
            outline-offset: -1px;
        }

        .stack-ranking-bar-row.search-highlight .stack-ranking-bar-label {
            color: #a16207;
            font-weight: 800;
        }

        .stack-ranking-bar-row.search-highlight .stack-ranking-bar-rank {
            color: #a16207;
            font-weight: 900;
        }

        .stack-ranking-search-nav {
            display: flex;
            align-items: center;
            gap: 2px;
            position: absolute;
            right: 32px;
        }

        .stack-ranking-search-nav button {
            background: rgba(99, 102, 241, 0.1);
            border: none;
            border-radius: 4px;
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: var(--color-gray-500);
            transition: all 0.2s;
            padding: 0;
        }

        .stack-ranking-search-nav button:hover {
            background: rgba(99, 102, 241, 0.25);
            color: var(--color-primary);
        }

        .stack-ranking-search-nav .search-nav-count {
            font-size: 11px;
            font-weight: 600;
            color: var(--color-gray-500);
            padding: 0 4px;
            white-space: nowrap;
        }

        /* Mobile Scroll Hint */
        #toolbar-scroll-hint {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: var(--toolbar-h);
            background: rgba(10, 15, 26, 0.7);
            z-index: 100;
            display: none;
            align-items: center;
            justify-content: center;
            pointer-events: none;
            transition: opacity 0.5s ease;
        }

        .scroll-hint-animation {
            display: flex;
            align-items: center;
            gap: 10px;
            color: rgba(255, 255, 255, 0.9);
            font-weight: 500;
            font-size: 14px;
        }

        .scroll-hint-hand {
            width: 24px;
            height: 24px;
            animation: swipe-hint 1.5s infinite ease-in-out;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
        }

        @keyframes swipe-hint {
            0% {
                transform: translateX(10px);
                opacity: 0;
            }

            50% {
                opacity: 1;
            }

            100% {
                transform: translateX(-10px);
                opacity: 0;
            }
        }

        #dock-content .parcel-tip {
            max-height: none !important;
            flex: 1;
            display: flex;
            flex-direction: column;
            min-height: 0;
            border-radius: 0 !important;
            box-shadow: none !important;
            margin: 0 !important;
            background: transparent !important;
        }

        #dock-content .popup-image-container {
            height: 120px !important;
            min-height: 120px !important;
            display: block !important;
            flex: none !important;
        }

        #dock-content .parcel-header h3 {
            font-size: 16px;
        }

        /* Tabulator Custom Styles */
        .tabulator {
            border: none;
            background-color: transparent;
        }

        .tabulator .tabulator-header {
            font-weight: 700;
            color: var(--color-dark);
            background-color: var(--bg-secondary);
            border-bottom: 1px solid var(--border-light);
        }

        .tabulator .tabulator-header .tabulator-col {
            background-color: var(--bg-secondary);
            border-right: 1px solid var(--border-light);
        }

        .tabulator-row {
            border-bottom: 1px solid var(--border-light);
            background-color: var(--color-white);
        }

        .tabulator-row.tabulator-selected {
            background-color: #fef3c7 !important;
            color: #92400e !important;
        }

        .tabulator-row.tabulator-selected:hover {
            background-color: #fde68a !important;
        }

        .tabulator-row.tabulator-selectable:hover {
            background-color: var(--bg-secondary);
            cursor: pointer;
        }

        .tabulator-row.tabulator-selected .tabulator-cell {
            border-right: 1px solid #fde68a;
        }

        /* Hide filters by default until class is added */
        .tabulator .tabulator-header .tabulator-header-filter {
            display: none;
        }

        .filters-visible .tabulator .tabulator-header .tabulator-header-filter {
            display: block;
        }

        /* ===== MOBILE RESPONSIVE STYLES ===== */
        @media (max-width: 768px) {
            /* Prevent iOS Safari auto-zoom on input focus (requires 16px minimum) */
            input[type="text"],
            input[type="search"],
            input[type="email"],
            input[type="number"],
            input[type="tel"],
            input[type="url"],
            input[type="password"],
            textarea,
            select {
                font-size: 16px !important;
                touch-action: manipulation; /* Prevent double-tap zoom */
            }

            /* Center popup on mobile screens */
            .ol-popup {
                position: fixed !important;
                top: 50% !important;
                left: calc(12px + env(safe-area-inset-left)) !important;
                right: calc(12px + env(safe-area-inset-right)) !important;
                transform: translateY(-50%) !important;
                bottom: auto !important;
                margin: 0 !important;
                width: auto !important;
                min-width: 0 !important;
                max-width: 100% !important;
                max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
                overflow-y: auto !important;
                overflow-x: hidden !important;
                z-index: 10000 !important;
                box-sizing: border-box !important;
                animation: none !important;   /* owner: no mobile animations */
            }
            
            @keyframes mobilePopupFadeIn {
                from {
                    opacity: 0;
                    transform: translateY(-50%) scale(0.95);
                }
                to {
                    opacity: 1;
                    transform: translateY(-50%) scale(1);
                }
            }

            /* TIF Impact Summary Bar: prevent overlap and ensure legibility on iPad portrait / narrow */
            .tif-impact-summary-bar {
                box-sizing: border-box;
            }
            @media (orientation: portrait), (max-width: 1023px) {
                .tif-impact-summary-bar .grid {
                    display: flex !important;
                    flex-direction: column !important;
                    align-items: center !important;
                    gap: 0.75rem !important;
                }
                .tif-impact-summary-bar {
                    padding: 0.75rem 0.5rem !important;
                }
            }

            /* Ensure popup content is scrollable on mobile and doesn't overflow horizontally */
            .ol-popup .parcel-tip {
                max-height: calc(100dvh - 92px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
                overflow-y: auto;
                overflow-x: hidden;
                width: 100%;
                box-sizing: border-box;
            }
            
            /* Ensure all popup content respects container width */
            .ol-popup * {
                max-width: 100%;
                box-sizing: border-box;
            }
            
            /* Ensure images don't overflow */
            .ol-popup img {
                max-width: 100% !important;
                height: auto !important;
                object-fit: cover;
            }
            
            /* Ensure popup image container fits properly */
            .ol-popup .popup-image-container {
                width: 100% !important;
                max-width: 100% !important;
            }
            
            /* Ensure parcel header doesn't overflow */
            .ol-popup .parcel-header {
                width: 100%;
                max-width: 100%;
                word-wrap: break-word;
                overflow-wrap: break-word;
            }
            
            .ol-popup .parcel-header h3,
            .ol-popup .parcel-header p {
                max-width: 100%;
                overflow: visible;
                text-overflow: unset;
                white-space: normal;
            }

            /* Ensure summary header text can wrap and is never clipped */
            .ol-popup .parcel-header > div {
                flex-wrap: wrap;
                gap: 8px;
            }

            .ol-popup .parcel-header > div > div:first-child {
                min-width: 0;
                width: 100%;
            }

            /* Make docked panel use bottom 40% of screen on mobile */
            #dock-panel {
                width: 100% !important;
                max-width: 100% !important;
                height: 40vh; /* No !important so JS can resize it */
                min-height: 20vh;
                max-height: 80vh;
                position: fixed !important;
                top: auto !important;
                left: 0 !important;
                right: 0 !important;
                bottom: 0 !important;
                z-index: 9999 !important;
                border-top: 2px solid var(--border-medium) !important;
                border-left: none !important;
            }

            /* Stack all dock content vertically as a single scrollable column */
            #dock-content {
                display: flex !important;
                flex-direction: column !important;
                overflow-y: auto !important;
                height: 100% !important;
            }

            #dock-content .parcel-tip {
                display: flex !important;
                flex-direction: column !important;
                width: 100% !important;
            }

            /* Make tabs stack vertically */
            #dock-content .tab-header {
                flex-direction: column !important;
                width: 100% !important;
            }

            #dock-content .tab-btn {
                width: 100% !important;
                text-align: center !important;
                font-size: 14px !important;
                padding: 12px !important;
            }

            /* Ensure proper spacing for mobile dock */
            #dock-content .parcel-header {
                padding: 16px !important;
            }

            #dock-content .parcel-header h3 {
                font-size: 16px !important;
            }

            #dock-content .parcel-header p {
                font-size: 13px !important;
            }

            #dock-content .tab-body {
                padding: 16px !important;
                font-size: 14px !important;
            }

            #dock-content .tab-body h4 {
                font-size: 14px !important;
            }

            #dock-content .tab-body ul li {
                font-size: 13px !important;
                padding: 8px 0 !important;
            }

            /* Show image in dock on mobile */
            #dock-content .popup-image-container {
                display: block !important;
                height: 200px !important;
            }

            /* Improve dock header visibility on mobile */
            .dock-header {
                padding: 16px !important;
                position: sticky !important;
                top: 0 !important;
                z-index: 10 !important;
                background: var(--bg-primary) !important;
            }

            .dock-header h3 {
                font-size: 18px !important;
            }

            .dock-close-btn {
                font-size: 24px !important;
                width: 40px !important;
                height: 40px !important;
            }

            /* Mobile dock resize handle */
            #dock-panel #resize-handle {
                display: none !important;
            }

            /* Create a visible drag handle at the top of mobile dock */
            #dock-panel::before {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                height: 24px;
                background: var(--bg-secondary);
                border-top: 2px solid var(--border-medium);
                border-bottom: 1px solid var(--border-light);
                cursor: ns-resize;
                touch-action: none;
                z-index: 100;
                display: flex;
                align-items: center;
                justify-content: center;
            }

            #dock-panel::after {
                content: '...';
                position: absolute;
                top: 0;
                left: 50%;
                transform: translateX(-50%);
                height: 24px;
                color: var(--color-gray-500);
                font-size: 20px;
                font-weight: bold;
                line-height: 24px;
                pointer-events: none;
                z-index: 101;
            }

            /* Adjust dock content to account for drag handle */
            #dock-panel .dock-header {
                margin-top: 24px !important;
            }
        }

        /* ===== PROXIMITY FILTER ===== */
        .proximity-select {
            width: 100%;
            margin-top: 4px;
            padding: 4px 6px;
            font-size: var(--font-size-xs);
            border: 1px solid var(--border-medium);
            border-radius: var(--radius-md);
            background: var(--bg-secondary);
            color: var(--color-gray-700);
            cursor: pointer;
        }
        .proximity-select:disabled {
            opacity: 0.4;
            cursor: default;
        }
        .proximity-layer-dot {
            display: inline-block;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            margin-right: 6px;
            flex-shrink: 0;
        }

        /* ===== GROWTH CALCULATOR — Richmond-style layout (ported) ===== */
        .growth-scope-badge {
            display: inline-flex;
            align-items: center;
            margin-left: 10px;
            padding: 4px 10px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            background: rgba(34, 197, 94, 0.18);
            border: 1px solid rgba(34, 197, 94, 0.45);
            color: #bbf7d0;
        }

        .growth-main-layout {
            display: grid;
            grid-template-columns: 220px minmax(0, 1fr);
            gap: var(--space-lg);
            align-items: start;
            margin-top: var(--space-xl);
        }

        .growth-left-controls {
            background: var(--bg-secondary);
            border: 1px solid var(--border-light);
            border-radius: var(--radius-lg);
            padding: var(--space-md);
            display: flex;
            flex-direction: column;
            gap: var(--space-md);
        }

        .growth-left-controls .growth-inputs-row {
            display: grid;
            grid-template-columns: 1fr;
            gap: var(--space-sm);
            margin: 0;
        }

        .growth-left-controls .growth-actions-row {
            margin: 0;
            display: flex;
        }

        .growth-left-controls .growth-action-btn {
            width: 100%;
            justify-content: center;
        }

        .growth-left-controls .growth-saved-group-row {
            grid-template-columns: 1fr;
        }

        .growth-left-controls .growth-saved-group-row .growth-action-btn {
            width: 100%;
        }

        .growth-right-panels {
            display: flex;
            flex-direction: column;
            gap: var(--space-md);
            min-width: 0;
        }

        .growth-right-panels .growth-total-section {
            width: 100%;
            margin-top: 0;
            box-sizing: border-box;
        }

        .growth-actions-row {
            display: flex;
            flex-wrap: wrap;
            gap: var(--space-md);
            margin-bottom: var(--space-xl);
            align-items: flex-end;
        }

        .growth-action-btn {
            padding: 12px 20px;
            background: #22d3ee;
            color: white;
            border: none;
            border-radius: var(--radius-md);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .growth-action-btn:hover {
            filter: brightness(0.95);
            transform: translateY(-1px);
        }

        .growth-add-group-panel {
            background: var(--bg-secondary);
            border: 1px solid var(--border-light);
            border-radius: var(--radius-lg);
            padding: var(--space-lg);
            margin-bottom: var(--space-xl);
        }

        .growth-add-group-title {
            margin: 0 0 var(--space-md) 0;
            font-size: var(--font-size-md);
            font-weight: var(--font-weight-semibold);
            color: var(--color-gray-800);
        }

        .growth-saved-group-row {
            display: grid;
            grid-template-columns: 1fr auto;
            gap: var(--space-md);
            align-items: end;
        }

        .growth-saved-group-row select {
            width: 100%;
            padding: var(--space-md);
            border: 1px solid var(--border-dark);
            border-radius: var(--radius-md);
            font-size: var(--font-size-md);
            background: var(--bg-primary);
            color: var(--color-gray-900);
        }

        @media (max-width: 768px) {
            .growth-main-layout { grid-template-columns: 1fr; }
            .growth-saved-group-row { grid-template-columns: 1fr; }
        }

        /* Zone-card extras for the Richmond-style "All lots + custom groups"
           model: editable totalValue/acreage inputs, a Remove button on
           custom group cards, etc. */
        .growth-zone-title {
            display: flex;
            align-items: center;
            gap: var(--space-sm);
            min-width: 0;
        }
        .growth-zone-dot {
            width: 12px;
            height: 12px;
            border-radius: 999px;
            flex-shrink: 0;
        }
        .growth-zone-remove {
            border: 1px solid #fca5a5;
            color: #dc2626;
            background: #fef2f2;
            border-radius: var(--radius-sm);
            font-size: var(--font-size-xs);
            font-weight: 600;
            cursor: pointer;
            padding: 4px 8px;
        }
        .growth-zone-remove:hover { background: #fee2e2; }
        .growth-zone-inputs {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: var(--space-sm);
            margin-bottom: var(--space-sm);
        }
        .growth-zone-inputs .growth-zone-rate-input { grid-column: span 2; }
        .growth-zone-field-label {
            font-size: var(--font-size-xs);
            color: var(--color-gray-500);
            text-transform: uppercase;
            font-weight: 600;
            margin-bottom: 4px;
        }
        .growth-zone-inputs input {
            width: 100%;
            padding: var(--space-sm);
            border: 1px solid var(--border-medium);
            border-radius: var(--radius-sm);
            font-size: var(--font-size-sm);
            font-family: var(--font-family-mono);
            background: var(--bg-primary);
            color: var(--color-gray-900);
        }
        .growth-zone-card.is-custom { border-color: var(--color-primary); }
        @media (max-width: 768px) {
            .growth-zone-inputs { grid-template-columns: 1fr; }
            .growth-zone-inputs .growth-zone-rate-input { grid-column: span 1; }
        }

        /* Map fullscreen toggle (top-right of #map). */
        .map-fullscreen-btn {
            position: absolute;
            top: 66px;
            right: 10px;
            z-index: 60;
            width: 36px;
            height: 36px;
            border-radius: 8px;
            background: rgba(13, 31, 51, 0.85);
            color: #e8edf6;
            border: 1px solid rgba(255, 255, 255, 0.15);
            display: grid;
            place-items: center;
            cursor: pointer;
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            transition: background 150ms ease, transform 100ms ease;
        }
        .map-fullscreen-btn:hover { background: rgba(13, 31, 51, 0.95); }
        .map-fullscreen-btn:active { transform: scale(0.96); }
        .map-fullscreen-btn:focus-visible { outline: 2px solid #c9a962; outline-offset: 2px; }
        #map:fullscreen .map-fullscreen-btn,
        #map:-webkit-full-screen .map-fullscreen-btn { top: 14px; right: 14px; }

        /* ===== Multi-payer popup section ===== */
        .mp-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-light); }
        .mp-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; margin-bottom: 10px; }
        .mp-chip.pc-condo                   { background: rgba(59,130,246,0.15);  color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
        .mp-chip.pc-time_share              { background: rgba(168,85,247,0.15);  color: #c084fc; border: 1px solid rgba(168,85,247,0.3); }
        .mp-chip.pc-pud                     { background: rgba(20,184,166,0.15);  color: #2dd4bf; border: 1px solid rgba(20,184,166,0.3); }
        .mp-chip.pc-mobile_home_pad         { background: rgba(245,158,11,0.15);  color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
        .mp-chip.pc-multi_tenant_commercial { background: rgba(34,197,94,0.15);   color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
        .mp-chip.pc-other                   { background: rgba(148,163,184,0.1);  color: var(--color-gray-500); border: 1px solid var(--border-light); }
        .mp-totals { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; margin: 0 0 10px; padding: 10px 12px; background: var(--bg-secondary); border-radius: 8px; border: 1px solid var(--border-light); font-size: 12px; }
        .mp-totals dt { color: var(--color-gray-500); }
        .mp-totals dd { margin: 0; font-weight: 700; color: var(--color-gray-900); text-align: right; font-variant-numeric: tabular-nums; }
        .mp-payers-hdr { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-gray-500); margin-bottom: 6px; }
        .mp-search { width: 100%; box-sizing: border-box; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border-light); background: var(--bg-secondary); color: var(--color-gray-900); font-size: 12px; margin-bottom: 6px; }
        .mp-payers-list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
        .mp-payer-row { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 8px; align-items: center; padding: 6px 10px; border-radius: 7px; background: var(--bg-secondary); border: 1px solid var(--border-light); text-decoration: none; color: inherit; font-size: 12px; transition: background 120ms; }
        .mp-payer-row:hover { background: rgba(var(--color-primary-rgb, 201,169,98),0.12); }
        a.mp-payer-row { cursor: pointer; }
        .mp-payer-name { font-weight: 600; color: var(--color-gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .mp-payer-acct { font-size: 10px; color: var(--color-gray-500); white-space: nowrap; }
        .mp-payer-tax  { font-weight: 700; color: var(--color-primary, #c9a962); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ─────────────────────────────────────────────────────────────────────────
   MOBILE: fit the floating marker-tool panels (Anchor + Critical Lots — both
   render as .pm-panel from parcel-markers.js) to the screen. Off-mobile they
   dock to the left edge at left:60px;width:312px, which overflows a narrow
   phone (60 + 312 ≈ 372px on a 360px screen). On mobile present them as a
   full-width iOS bottom sheet that clears the gis-pwa bottom nav. Self-contained
   (literal values; --gpwa-h falls back to 52px when gis-pwa isn't lifting it).
   Mirrors the Richmond critical-lots panel fix. ───────────────────────────── */
@media (max-width: 768px) {
    .pm-panel {
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        bottom: calc(var(--gpwa-h, 52px) + env(safe-area-inset-bottom, 0px)) !important;
        transform: none !important;
        margin-top: 0 !important;            /* cancel .pm-panel--critical_lot's 30px nudge */
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        height: auto !important;
        max-height: calc(72dvh - var(--gpwa-h, 52px) - env(safe-area-inset-bottom, 0px)) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 22px 22px 0 0 !important;
        border-top: 1px solid rgba(201, 169, 98, 0.20) !important;
        border-left: none !important;
        border-right: none !important;
        border-bottom: none !important;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.60),
                    0 -2px 0 rgba(201, 169, 98, 0.16),
                    inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
    }
    /* iOS drag-handle pill above the panel header (flex column → first child) */
    .pm-panel::before {
        content: '' !important;
        display: block !important;
        width: 40px !important;
        height: 4px !important;
        background: rgba(148, 163, 184, 0.40) !important;
        border-radius: 100px !important;
        margin: 10px auto 0 !important;
        flex-shrink: 0 !important;
        pointer-events: none !important;
    }
    /* safe-area clearance at the bottom of the panel body */
    .pm-panel__body > *:last-child {
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px) !important;
    }
}

/* ─────────────────────────────────────────────────────────────────────────
   EDIT-mode cluster flyout  (#pmt-edit-flyout)
   Relocated #lot-map-edit-section lives here after the EDIT cluster button is
   first toggled.  Positioned fixed to the right of the .pmt-cluster column by
   inline JS; z-index 8500 matches .pm-panel so it floats above the map.
   Enter: scaleX from left-center + opacity fade (matches the admin flyout).
   Reduced-motion: opacity-only fade.
   ─────────────────────────────────────────────────────────────────────────── */
#pmt-edit-flyout {
    position: fixed;
    /* left/top set by inline JS to track the EDIT button position */
    z-index: 8500;
    width: 270px;
    max-width: calc(100vw - 72px);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 14px 14px 16px;
    background: rgba(13, 24, 36, .96);
    border: 1px solid rgba(120, 180, 220, .28);
    border-radius: 12px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #e7eff7;
    font: 13px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
    /* Enter: collapsed from left edge (scaleX 0 → 1) + fade in */
    transform-origin: left center;
    transform: scaleX(0);
    opacity: 0;
    pointer-events: none;
    transition: transform .22s cubic-bezier(.22,.61,.36,1),
                opacity   .18s ease;
}
#pmt-edit-flyout.is-open {
    transform: scaleX(1);
    opacity: 1;
    pointer-events: auto;
}
/* The node's own inline display:none must be cleared when moved into flyout */
#pmt-edit-flyout #lot-map-edit-section {
    display: block !important;
    margin: 0 !important;
}
/* Suppress the "Edit map lots" sub-header that duplicates the button label */
#pmt-edit-flyout .lot-map-edit-section > .map-layer-controls-header:first-child {
    display: none;
}
/* Reduced-motion: skip the scale transform, keep the opacity fade only.
   Visibility is driven entirely by .is-open — no JS hidden attribute used. */
@media (prefers-reduced-motion: reduce) {
    #pmt-edit-flyout {
        transform: scaleX(1);   /* no collapse — just fade */
        transition: opacity .18s ease;
    }
    #pmt-edit-flyout.is-open {
        opacity: 1;
        pointer-events: auto;
    }
    #pmt-edit-flyout:not(.is-open) {
        opacity: 0;
        pointer-events: none;
    }
}

/* ─────────────────────────────────────────────────────────────────────────
   OWNER REQUEST (2026-06-06): NO motion on mobile for the Island Falls GIS.
   Kill every entrance / pulse / slide / transition on phones (intro slide,
   popup fade, toasts, gis-pwa sheet slides, etc.). animation-duration:0s (NOT
   animation:none) preserves any forwards-fill end state; the one !important
   literal animation (mobilePopupFadeIn on .ol-popup) is neutralised at source.
   No JS waits on animationend/transitionend (verified) → safe. ─────────────── */
@media (max-width: 768px) {
    *, *::before, *::after {
        animation-duration: 0s !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}


/* ═══════════════════════════════════════════════════════════════
   FISCAL IMPACT COMMAND CENTER — CSS ported from Richmond 2026-07-03
   ═══════════════════════════════════════════════════════════════ */
        .map-selection-overlay .scenario-legend {
            margin-top: 4px;
            display: inline-flex;
            gap: 8px;
            align-items: center;
            font-size: 9px;
            color: rgba(191, 219, 254, 0.9);
        }

        .map-selection-overlay .scenario-legend .legend-down {
            color: #22c55e;
        }

        .map-selection-overlay .scenario-legend .legend-up {
            color: #f97316;
        }

        .lot-scenario-dashboard {
            position: absolute;
            top: calc(var(--toolbar-h) + 76px);
            left: 50px;
            z-index: 1013;
            min-width: 320px;
            max-width: min(380px, calc(100vw - 24px));
            border-radius: 14px;
            border: 1px solid rgba(148, 163, 184, 0.34);
            background: linear-gradient(160deg, rgba(15, 23, 42, 0.95) 0%, rgba(17, 24, 39, 0.9) 100%);
            box-shadow: 0 14px 30px rgba(2, 6, 23, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.16);
            color: rgba(241, 245, 249, 0.96);
            backdrop-filter: blur(12px) saturate(130%);
            -webkit-backdrop-filter: blur(12px) saturate(130%);
            padding: 10px 12px;
            display: none;
            pointer-events: auto;
            font-size: 11px;
            line-height: 1.35;
        }

        .lot-scenario-dashboard .dash-title {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            font-size: 11px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.045em;
            margin-bottom: 8px;
        }

        .lot-scenario-dashboard .dash-selection-label {
            font-size: 10px;
            color: rgba(191, 219, 254, 0.9);
            margin-bottom: 6px;
            text-transform: uppercase;
            letter-spacing: .035em;
            padding: 4px 8px;
            border-radius: 999px;
            border: 1px solid rgba(147, 197, 253, 0.36);
            background: rgba(30, 64, 175, 0.24);
            display: inline-flex;
            max-width: 100%;
        }

        .lot-scenario-dashboard .dash-section-title {
            font-size: 10px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: .05em;
            color: rgba(191, 219, 254, 0.95);
            margin-bottom: 8px;
        }

        .lot-scenario-dashboard .dash-pills {
            display: inline-flex;
            border-radius: 999px;
            border: 1px solid rgba(148, 163, 184, 0.45);
            overflow: hidden;
        }

        .lot-scenario-dashboard .dash-pill {
            border: none;
            background: rgba(51, 65, 85, 0.68);
            color: rgba(226, 232, 240, 0.86);
            font-size: 10px;
            font-weight: 700;
            padding: 4px 8px;
            cursor: pointer;
        }

        .lot-scenario-dashboard .dash-pill.active {
            background: rgba(37, 99, 235, 0.55);
            color: #eff6ff;
        }

        .lot-scenario-dashboard .dash-section {
            border-top: 1px solid rgba(148, 163, 184, 0.26);
            padding-top: 8px;
            margin-top: 8px;
        }

        .lot-scenario-dashboard .dash-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 6px 10px;
        }

        .lot-scenario-dashboard .dash-k {
            color: rgba(203, 213, 225, 0.86);
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 0.035em;
        }

        .lot-scenario-dashboard .dash-v {
            text-align: right;
            font-family: var(--font-family-mono);
            font-weight: 800;
            color: #f8fafc;
            font-size: 11px;
        }

        .lot-scenario-dashboard .dash-control-row {
            display: grid;
            grid-template-columns: 82px 30px 1fr 30px;
            gap: 8px;
            align-items: center;
            margin-bottom: 8px;
        }

        .lot-scenario-dashboard .dash-control-label {
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            color: rgba(191, 219, 254, 0.9);
        }

        .lot-scenario-dashboard .dash-control-btn {
            width: 30px;
            height: 28px;
            border-radius: 8px;
            border: 1px solid rgba(148, 163, 184, 0.4);
            background: rgba(51, 65, 85, 0.7);
            color: #fff;
            font-weight: 800;
            cursor: pointer;
        }

        .lot-scenario-dashboard .dash-control-value {
            text-align: center;
            font-family: var(--font-family-mono);
            font-weight: 800;
            font-size: 12px;
        }

        .lot-scenario-dashboard .dash-reset {
            width: 100%;
            margin-top: 6px;
            border-radius: 9px;
            border: 1px solid rgba(248, 113, 113, 0.5);
            background: rgba(127, 29, 29, 0.24);
            color: #fecaca;
            font-size: 10px;
            font-weight: 800;
            text-transform: uppercase;
            padding: 6px 8px;
            cursor: pointer;
        }

        .lot-scenario-dashboard .dash-control-input-row {
            grid-template-columns: 82px 1fr;
        }

        .lot-scenario-dashboard .dash-control-input {
            width: 100%;
            min-height: 30px;
            border-radius: 8px;
            border: 1px solid rgba(148, 163, 184, 0.4);
            background: rgba(15, 23, 42, 0.72);
            color: #f8fafc;
            font-size: 12px;
            font-weight: 700;
            padding: 6px 10px;
            outline: none;
            box-sizing: border-box;
        }

        .lot-scenario-dashboard .dash-control-input:focus {
            border-color: rgba(56, 189, 248, 0.85);
            box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
        }

        .lot-scenario-dashboard .dash-control-input:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .lot-scenario-dashboard .dash-control-hint {
            margin-top: 6px;
            font-size: 10px;
            color: rgba(191, 219, 254, 0.74);
        }

        .lot-scenario-dashboard.command-center {
            top: auto;
            bottom: var(--fiscal-command-bottom, 14px);
            left: var(--fiscal-command-left, 14px);
            right: var(--fiscal-command-right, 14px);
            width: auto;
            max-width: none;
            min-width: 0;
            padding: 0;
            overflow: hidden;
            border-radius: 16px;
            background:
                linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(15, 23, 42, 0.9) 100%),
                radial-gradient(circle at 30% 0%, rgba(37, 99, 235, 0.22), transparent 34%);
        }

        html.fiscal-impact-active .lot-scenario-dashboard.command-center {
            border: 1px solid rgba(56, 189, 248, 0.52);
            box-shadow:
                0 0 0 1px rgba(56, 189, 248, 0.22),
                0 12px 30px rgba(15, 23, 42, 0.45),
                0 0 24px rgba(37, 99, 235, 0.35);
        }

        html.fiscal-impact-active .lot-scenario-dashboard.command-center .command-shell {
            background:
                linear-gradient(180deg, rgba(2, 6, 23, 0.2) 0%, rgba(2, 6, 23, 0.05) 100%),
                radial-gradient(circle at 18% 0%, rgba(56, 189, 248, 0.16), transparent 48%);
        }

        .lot-scenario-dashboard .command-shell {
            position: relative;
            display: grid;
            grid-template-rows: auto auto auto minmax(0, 1fr) auto;
            max-height: var(--fiscal-command-max-height, min(62vh, 680px));
        }

        .lot-scenario-dashboard .command-resize-handle {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 6px;
            z-index: 3;
            cursor: ns-resize;
            border-radius: 16px 16px 0 0;
        }

        .lot-scenario-dashboard .command-resize-handle:hover {
            background: rgba(96, 165, 250, 0.22);
        }

        .lot-scenario-dashboard .command-resize-left-handle {
            position: absolute;
            top: 6px;
            left: 0;
            bottom: 0;
            width: 6px;
            z-index: 3;
            cursor: ew-resize;
        }

        .lot-scenario-dashboard .command-resize-left-handle:hover {
            background: rgba(96, 165, 250, 0.2);
        }

        .lot-scenario-dashboard .command-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 14px;
            padding: 12px 14px;
            border-bottom: 1px solid rgba(148, 163, 184, 0.24);
            background: rgba(15, 23, 42, 0.7);
        }

        .lot-scenario-dashboard .command-title {
            display: flex;
            flex-direction: column;
            gap: 2px;
            min-width: 0;
        }

        .lot-scenario-dashboard .command-title strong {
            font-size: 13px;
            letter-spacing: .06em;
            text-transform: uppercase;
        }

        .lot-scenario-dashboard .command-title span {
            color: rgba(203, 213, 225, 0.82);
            font-size: 10px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .lot-scenario-dashboard .command-actions {
            display: flex;
            gap: 8px;
            align-items: center;
            flex-wrap: wrap;
            justify-content: flex-end;
        }

        .lot-scenario-dashboard .scenario-manager {
            display: inline-flex;
            gap: 6px;
            align-items: center;
            flex-wrap: wrap;
        }

        .lot-scenario-dashboard .scenario-select {
            min-width: 220px;
            border: 1px solid rgba(148, 163, 184, 0.34);
            background: rgba(30, 41, 59, 0.76);
            color: #e2e8f0;
            border-radius: 10px;
            padding: 6px 10px;
            font-size: 11px;
            font-weight: 700;
        }

        .lot-scenario-dashboard .command-btn {
            border: 1px solid rgba(148, 163, 184, 0.34);
            background: rgba(30, 41, 59, 0.76);
            color: rgba(241, 245, 249, 0.96);
            border-radius: 999px;
            padding: 6px 10px;
            font-size: 10px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: .04em;
            cursor: pointer;
        }

        .lot-scenario-dashboard .command-btn.pin-active {
            border-color: rgba(56, 189, 248, 0.86);
            color: #e0f2fe;
            background: rgba(30, 64, 175, 0.45);
        }

        .lot-scenario-dashboard .command-kpis {
            display: grid;
            grid-template-columns: repeat(6, minmax(0, 1fr));
            border-bottom: 1px solid rgba(148, 163, 184, 0.24);
        }

        .lot-scenario-dashboard .command-kpi {
            padding: 10px 12px;
            border-right: 1px solid rgba(148, 163, 184, 0.18);
            background: rgba(15, 23, 42, 0.45);
            min-width: 0;
        }

        .lot-scenario-dashboard .command-kpi:last-child {
            border-right: none;
        }

        .lot-scenario-dashboard .command-kpi-label {
            font-size: 9px;
            color: rgba(148, 163, 184, 0.88);
            text-transform: uppercase;
            letter-spacing: .05em;
            margin-bottom: 4px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .lot-scenario-dashboard .command-kpi-value {
            font-family: var(--font-family-mono);
            font-size: 18px;
            font-weight: 900;
            line-height: 1.05;
            color: #f8fafc;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .lot-scenario-dashboard .command-kpi-sub {
            margin-top: 3px;
            font-size: 9px;
            color: rgba(203, 213, 225, 0.7);
        }

        .lot-scenario-dashboard .command-kpi.neutral .command-kpi-value { color: #93c5fd; }
        .lot-scenario-dashboard .command-kpi.good .command-kpi-value { color: #22c55e; }
        .lot-scenario-dashboard .command-kpi.warn .command-kpi-value { color: #fb923c; }

        .lot-scenario-dashboard .command-controls-inline {
            padding: 8px 12px;
            border-top: 1px solid rgba(148, 163, 184, 0.18);
            border-bottom: 1px solid rgba(148, 163, 184, 0.18);
            background: rgba(15, 23, 42, 0.6);
        }

        .lot-scenario-dashboard .command-dollar-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(150px, 1fr));
            gap: 8px 12px;
            align-items: center;
        }

        .lot-scenario-dashboard .command-dollar-label {
            font-size: 10px;
            font-weight: 800;
            color: rgba(191, 219, 254, 0.92);
            text-transform: uppercase;
            letter-spacing: 0.04em;
            margin: 0;
        }

        .lot-scenario-dashboard .command-dollar-input {
            width: 100%;
        }

        .lot-scenario-dashboard .command-dollar-hint {
            grid-column: 1 / -1;
            font-size: 10px;
            color: rgba(191, 219, 254, 0.72);
            line-height: 1.25;
        }

        .scenario-impact-tooltip {
            min-width: 220px;
            max-width: 280px;
            border-radius: 12px;
            border: 1px solid rgba(96, 165, 250, 0.5);
            background: linear-gradient(160deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.84) 100%);
            color: #f8fafc;
            padding: 10px 12px;
            box-shadow: 0 16px 30px rgba(2, 6, 23, 0.5);
            font-size: 11px;
            line-height: 1.35;
        }

        .scenario-impact-tooltip .title {
            font-weight: 900;
            font-size: 12px;
            margin-bottom: 6px;
            letter-spacing: 0.02em;
        }

        .scenario-impact-tooltip .row {
            display: flex;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 4px;
        }

        .scenario-impact-tooltip .label {
            color: rgba(191, 219, 254, 0.84);
            font-weight: 700;
        }

        .scenario-impact-tooltip .value {
            font-weight: 800;
            font-family: var(--font-family-mono);
        }

        .lot-scenario-dashboard .command-body {
            display: grid;
            grid-template-columns: minmax(220px, 0.9fr) minmax(300px, 1.4fr) minmax(240px, 1fr);
            min-height: 220px;
            overflow: hidden;
        }

        .lot-scenario-dashboard .command-panel {
            padding: 12px;
            border-right: 1px solid rgba(148, 163, 184, 0.18);
            overflow: auto;
        }

        .lot-scenario-dashboard .command-panel:last-child {
            border-right: none;
        }

        .lot-scenario-dashboard .command-panel-title {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            margin-bottom: 10px;
            font-size: 10px;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: .06em;
            color: rgba(219, 234, 254, 0.96);
        }

        .lot-scenario-dashboard .impact-row {
            display: grid;
            grid-template-columns: minmax(66px, 1fr) auto;
            gap: 8px;
            align-items: center;
            padding: 7px 0;
            border-bottom: 1px solid rgba(148, 163, 184, 0.14);
        }

        .lot-scenario-dashboard .impact-row:last-child {
            border-bottom: none;
        }

        .lot-scenario-dashboard .impact-row.clickable {
            cursor: pointer;
        }

        .lot-scenario-dashboard .impact-row.clickable:hover {
            background: rgba(30, 41, 59, 0.42);
            border-radius: 8px;
        }

        .lot-scenario-dashboard .impact-id {
            font-weight: 900;
            color: #f8fafc;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .lot-scenario-dashboard .impact-meta {
            margin-top: 2px;
            color: rgba(203, 213, 225, 0.66);
            font-size: 9px;
        }

        .lot-scenario-dashboard .impact-delta {
            font-family: var(--font-family-mono);
            font-weight: 900;
            font-size: 11px;
            text-align: right;
        }

        .lot-scenario-dashboard .impact-delta.down { color: #22c55e; }
        .lot-scenario-dashboard .impact-delta.up { color: #fb923c; }

        .lot-scenario-dashboard .lot-tune-card {
            border: 1px solid rgba(148, 163, 184, 0.18);
            border-radius: 12px;
            background: rgba(15, 23, 42, 0.42);
            padding: 10px;
            margin-bottom: 10px;
        }

        .lot-scenario-dashboard .lot-tune-header {
            display: flex;
            justify-content: space-between;
            gap: 10px;
            align-items: baseline;
            margin-bottom: 8px;
        }

        .lot-scenario-dashboard .lot-tune-id {
            font-weight: 900;
            color: #f8fafc;
            letter-spacing: .01em;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        .lot-scenario-dashboard .pin-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 1px 5px;
            border-radius: 999px;
            border: 1px solid rgba(56, 189, 248, 0.5);
            background: rgba(37, 99, 235, 0.28);
            color: rgba(186, 230, 253, 0.95);
            font-size: 9px;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            line-height: 1.2;
        }

        .lot-scenario-dashboard .lot-tune-id.clickable {
            cursor: pointer;
            text-decoration: underline;
            text-underline-offset: 2px;
        }

        .lot-scenario-dashboard .lot-tune-tax {
            font-family: var(--font-family-mono);
            font-size: 10px;
            font-weight: 900;
            color: rgba(191, 219, 254, 0.95);
            white-space: nowrap;
        }

        .lot-scenario-dashboard .lot-tune-tax.down { color: #22c55e; }
        .lot-scenario-dashboard .lot-tune-tax.up { color: #fb923c; }

        .lot-scenario-dashboard .lot-tune-row {
            display: grid;
            grid-template-columns: 78px 28px minmax(52px, 1fr) 28px;
            gap: 7px;
            align-items: center;
            margin-top: 7px;
        }

        .lot-scenario-dashboard .lot-tune-label {
            color: rgba(203, 213, 225, 0.82);
            font-size: 9px;
            font-weight: 800;
            letter-spacing: .04em;
            text-transform: uppercase;
        }

        .lot-scenario-dashboard .lot-tune-btn {
            border: 1px solid rgba(96, 165, 250, 0.36);
            border-radius: 8px;
            background: rgba(37, 99, 235, 0.18);
            color: #dbeafe;
            font-weight: 900;
            min-height: 26px;
            cursor: pointer;
        }

        .lot-scenario-dashboard .lot-tune-value {
            text-align: center;
            font-family: var(--font-family-mono);
            font-size: 10px;
            font-weight: 900;
            color: #f8fafc;
            padding: 5px 4px;
            border-radius: 8px;
            background: rgba(30, 41, 59, 0.58);
        }

        .lot-scenario-dashboard .lot-tune-reset {
            margin-top: 8px;
            width: 100%;
            border: 1px solid rgba(148, 163, 184, 0.28);
            border-radius: 9px;
            background: rgba(51, 65, 85, 0.62);
            color: rgba(226, 232, 240, 0.9);
            font-size: 10px;
            font-weight: 800;
            padding: 6px 8px;
            cursor: pointer;
        }

        .lot-scenario-dashboard .command-map-proxy {
            min-height: 100%;
            border-radius: 12px;
            border: 1px solid rgba(96, 165, 250, 0.26);
            background:
                radial-gradient(circle at 55% 45%, rgba(59, 130, 246, 0.28), transparent 30%),
                linear-gradient(145deg, rgba(15, 23, 42, 0.3), rgba(30, 41, 59, 0.72));
            padding: 12px;
            display: grid;
            align-content: space-between;
            gap: 12px;
        }

        .lot-scenario-dashboard .command-map-note {
            color: rgba(219, 234, 254, 0.88);
            font-weight: 800;
            font-size: 11px;
            line-height: 1.45;
        }

        .lot-scenario-dashboard .mini-chart {
            margin-bottom: 12px;
        }

        .lot-scenario-dashboard .mini-chart-label {
            display: flex;
            justify-content: space-between;
            font-size: 10px;
            color: rgba(203, 213, 225, 0.84);
            margin-bottom: 5px;
        }

        .lot-scenario-dashboard .mini-bar {
            height: 9px;
            border-radius: 999px;
            background: rgba(51, 65, 85, 0.82);
            overflow: hidden;
            border: 1px solid rgba(148, 163, 184, 0.18);
        }

        .lot-scenario-dashboard .mini-fill {
            height: 100%;
            border-radius: inherit;
            background: linear-gradient(90deg, #38bdf8, #2563eb);
        }

        .lot-scenario-dashboard .mini-fill.good { background: linear-gradient(90deg, #34d399, #16a34a); }
        .lot-scenario-dashboard .mini-fill.warn { background: linear-gradient(90deg, #fbbf24, #f97316); }

        .lot-scenario-dashboard .command-tabs {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 8px 10px;
            border-top: 1px solid rgba(148, 163, 184, 0.2);
            background: rgba(15, 23, 42, 0.72);
            overflow-x: auto;
        }

        .lot-scenario-dashboard .command-tab {
            border: 1px solid rgba(148, 163, 184, 0.24);
            background: rgba(30, 41, 59, 0.7);
            color: rgba(226, 232, 240, 0.88);
            border-radius: 999px;
            padding: 6px 10px;
            font-size: 10px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: .035em;
            cursor: pointer;
            white-space: nowrap;
        }

        .lot-scenario-dashboard .command-tab.active {
            background: rgba(37, 99, 235, 0.62);
            color: #eff6ff;
            border-color: rgba(147, 197, 253, 0.45);
        }

        .lot-scenario-dashboard.command-center-slid {
            left: auto !important;
            right: 6px !important;
            bottom: 14px !important;
            min-width: 44px;
            max-width: 44px;
            z-index: 1205;
            border-radius: 12px;
            border-color: rgba(96, 165, 250, 0.55);
            background: linear-gradient(180deg, rgba(15, 23, 42, 0.97) 0%, rgba(30, 41, 59, 0.95) 100%);
            box-shadow: 0 12px 22px rgba(2, 6, 23, 0.48);
        }

        .lot-scenario-dashboard .slide-shell {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            gap: 8px;
            padding: 8px 4px;
            min-height: 180px;
        }

        .lot-scenario-dashboard .slide-rail-btn {
            writing-mode: vertical-rl;
            transform: rotate(180deg);
            border: 1px solid rgba(147, 197, 253, 0.6);
            background: linear-gradient(180deg, rgba(37, 99, 235, 0.58), rgba(30, 64, 175, 0.62));
            color: #eff6ff;
            border-radius: 10px;
            padding: 8px 6px;
            font-size: 10px;
            font-weight: 900;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            cursor: pointer;
            min-height: 148px;
            width: 32px;
        }

        .lot-scenario-dashboard .slide-rail-lot {
            writing-mode: vertical-rl;
            transform: rotate(180deg);
            font-size: 9px;
            font-weight: 800;
            color: rgba(191, 219, 254, 0.9);
            letter-spacing: 0.04em;
            max-height: 170px;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        @media (max-width: 768px) {
            .lot-scenario-dashboard {
                top: calc(var(--toolbar-h) + 64px);
                left: 10px;
                right: 10px;
                min-width: 0;
                max-width: none;
                width: auto;
                padding: 12px 12px 11px;
                border-radius: 12px;
                max-height: min(68vh, 560px);
                overflow-y: auto;
            }

            .lot-scenario-dashboard .dash-title {
                flex-wrap: wrap;
                gap: 8px 10px;
                margin-bottom: 10px;
            }

            .lot-scenario-dashboard .dash-title > span {
                font-size: 11px;
                line-height: 1.2;
            }

            .lot-scenario-dashboard .dash-pills {
                width: 100%;
            }

            .lot-scenario-dashboard .dash-pill {
                flex: 1 1 0;
                text-align: center;
                min-height: 34px;
                font-size: 11px;
                padding: 7px 10px;
            }

            .lot-scenario-dashboard .dash-selection-label {
                font-size: 10px;
                margin-bottom: 10px;
            }

            .lot-scenario-dashboard .dash-grid {
                gap: 8px 10px;
            }

            .lot-scenario-dashboard .dash-k {
                font-size: 10px;
                line-height: 1.2;
            }

            .lot-scenario-dashboard .dash-v {
                font-size: 12px;
            }

            .lot-scenario-dashboard .dash-section {
                margin-top: 10px;
                padding-top: 10px;
            }

            .lot-scenario-dashboard .dash-section-title {
                font-size: 10px;
                margin-bottom: 9px;
            }

            .lot-scenario-dashboard .dash-control-row {
                grid-template-columns: minmax(86px, 1fr) 38px minmax(66px, auto) 38px;
                gap: 8px;
                margin-bottom: 10px;
            }

            .lot-scenario-dashboard .dash-control-label {
                font-size: 11px;
            }

            .lot-scenario-dashboard .dash-control-btn {
                width: 38px;
                height: 36px;
                border-radius: 10px;
                font-size: 18px;
                line-height: 1;
            }

            .lot-scenario-dashboard .dash-control-value {
                font-size: 13px;
                padding: 6px 4px;
                border-radius: 8px;
                background: rgba(30, 41, 59, 0.44);
                border: 1px solid rgba(148, 163, 184, 0.3);
            }

            .lot-scenario-dashboard .dash-reset {
                min-height: 38px;
                margin-top: 8px;
                font-size: 11px;
                padding: 9px 10px;
            }

            .lot-scenario-dashboard .command-shell {
                max-height: var(--fiscal-command-max-height, min(72vh, 720px));
            }

            .lot-scenario-dashboard .command-header {
                align-items: flex-start;
                flex-direction: column;
                padding: 11px 12px;
            }

            .lot-scenario-dashboard .command-actions {
                width: 100%;
                justify-content: stretch;
            }

            .lot-scenario-dashboard .scenario-select {
                min-width: 0;
                width: 100%;
                flex: 1 1 100%;
            }

            .lot-scenario-dashboard .command-btn {
                flex: 1 1 auto;
                min-height: 34px;
            }

            .lot-scenario-dashboard .command-kpis {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            .lot-scenario-dashboard .command-kpi {
                border-bottom: 1px solid rgba(148, 163, 184, 0.16);
            }

            .lot-scenario-dashboard .command-kpi-value {
                font-size: 16px;
            }

            .lot-scenario-dashboard .command-body {
                grid-template-columns: 1fr;
                overflow: auto;
            }

            .lot-scenario-dashboard .command-dollar-grid {
                grid-template-columns: repeat(2, minmax(110px, 1fr));
            }

            .lot-scenario-dashboard .command-panel {
                border-right: none;
                border-bottom: 1px solid rgba(148, 163, 184, 0.18);
                overflow: visible;
            }

            .lot-scenario-dashboard .command-map-proxy {
                min-height: 150px;
            }

            .lot-scenario-dashboard .command-tabs {
                padding: 8px;
            }
        }

        @media (max-width: 520px) {
            .lot-scenario-dashboard .dash-grid {
                grid-template-columns: minmax(0, 1fr);
                gap: 5px;
            }

            .lot-scenario-dashboard .dash-k {
                color: rgba(191, 219, 254, 0.9);
                margin-top: 3px;
            }

            .lot-scenario-dashboard .dash-v {
                text-align: left;
                margin-bottom: 3px;
            }

            .lot-scenario-dashboard .dash-control-row {
                grid-template-columns: minmax(82px, 1fr) 36px minmax(64px, auto) 36px;
            }
        }

        @keyframes lotOverlayAppear {
            0% {
                opacity: 0;
                transform: translateY(8px) scale(0.98);
            }
            100% {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }
