/* DEC480: RAiN Field Ops stylesheet, extracted verbatim from interior/RAiN_Field.html (pristine Walmart copy) so the
 * proven field interface hosts ORB. Asset paths are root-absolute because this file is served from /Orb/research/. */
        :root {
            /* RAiN Portal Design System - Neutral Base with Subtle Accents */
            --brand-primary: #4CA6EA;         /* Picton Blue - highlights */
            --brand-accent: #48c8b2;          /* Teal - active states */
            --brand-success: #48bb78;         /* Green - accept/success */
            --brand-warning: #eab308;         /* Yellow - warning */
            --brand-error: #e37263;           /* Coral - error/danger */
            
            /* Neutral Grays (Portal palette) */
            --gray-900: #0f172a;              /* Darkest */
            --gray-800: #1e293b;
            --gray-700: #334155;
            --gray-600: #475569;
            --gray-500: #64748b;
            --gray-400: #94a3b8;
            --gray-300: #cbd5e1;
            --gray-200: #e2e8f0;
            --gray-100: #f1f5f9;
            
            /* Backgrounds */
            --bg-deep: #1a1f2e;
            --bg-surface: rgba(71, 85, 105, 0.85);
            --bg-card: rgba(51, 65, 85, 0.65);
            --bg-card-solid: rgba(71, 85, 105, 0.92);
            --bg-card-hover: rgba(100, 116, 139, 0.75);
            
            /* Borders */
            --border-subtle: rgba(148, 163, 184, 0.25);
            --border-active: rgba(76, 166, 234, 0.5);
            --border-glow: rgba(72, 200, 178, 0.4);
            
            /* Client Colors (kept for compatibility) */
            --walmart-color: #5B9BD5;
            --retail-color: #E85D5D;
            
            /* Text */
            --text-primary: #f1f5f9;
            --text-secondary: #94a3b8;
            --text-muted: #64748b;
            --text-link: #4CA6EA;
            
            /* Status */
            --success: #48bb78;
            --warning: #eab308;
            --error: #e37263;
            
            /* Aliases for compatibility */
            --fm-blue: var(--brand-primary);
            --fm-green: var(--success);
            --fm-red: var(--error);
            --accent-blue: var(--brand-primary);
            --rain-orange: var(--brand-primary);  /* Aliased for backward compat */
            --rain-orange-light: #5eb8f0;
            --rain-orange-dark: #3b8ac7;
            
            /* Layout */
            --safe-top: env(safe-area-inset-top, 0px);
            --safe-bottom: env(safe-area-inset-bottom, 0px);
            --header-height: 44px;
        }
        
        * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
        html, body { width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
        body { 
            font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif; 
            background: var(--bg-deep); 
            color: var(--text-primary);
            -webkit-user-select: none;
            user-select: none;
        }
        
        /* Allow text selection in all input fields */
        input, textarea, [contenteditable="true"] {
            -webkit-user-select: text;
            user-select: text;
            -webkit-touch-callout: default;
        }
        
        .app-container { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; }
        .map-area { 
            flex: 1; 
            position: relative; 
            min-height: 0;
            /* Prevent iOS text selection and callout */
            -webkit-user-select: none;
            -webkit-touch-callout: none;
            -webkit-tap-highlight-color: transparent;
            user-select: none;
            touch-action: manipulation;
        }
        #cesiumContainer { 
            width: 100%; 
            height: 100%;
            /* Prevent iOS text selection and callout */
            -webkit-user-select: none;
            -webkit-touch-callout: none;
            -webkit-tap-highlight-color: transparent;
            user-select: none;
        }
        
        /* Hide Cesium UI */
        .cesium-viewer-toolbar, .cesium-viewer-animationContainer, .cesium-viewer-timelineContainer,
        .cesium-viewer-fullscreenContainer, .cesium-viewer-vrContainer, .cesium-viewer-geocoderContainer,
        .cesium-viewer-navigationHelpButton, .cesium-credit-logoContainer, .cesium-credit-textContainer,
        .cesium-viewer-bottom { display: none !important; }
        
        /* Prevent iOS selection on Cesium canvas */
        .cesium-viewer, .cesium-widget, .cesium-widget canvas {
            -webkit-user-select: none;
            -webkit-touch-callout: none;
            -webkit-tap-highlight-color: transparent;
            user-select: none;
            touch-action: manipulation;
        }
        
        /* ═══════════════════════════════════════════════════════════════
           COMPACT TOP HEADER - Frosted Glass Style (Portal Design)
           ═══════════════════════════════════════════════════════════════ */
        .top-header {
            position: absolute; top: 0; left: 0; right: 0;
            height: calc(var(--header-height) + var(--safe-top));
            padding-top: var(--safe-top);
            background: rgba(30, 41, 59, 0.85);
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
            border-bottom: 1px solid var(--border-subtle);
            display: flex; align-items: center;
            justify-content: space-between;
            padding-left: 8px; padding-right: 8px;
            z-index: 100;
        }
        
        .header-left, .header-right {
            display: flex; align-items: center; gap: 2px;
        }
        
        .header-title {
            font-size: 15px; font-weight: 500;
            color: var(--text-primary);
            display: flex; align-items: center; gap: 8px;
            letter-spacing: 0.02em;
        }
        .header-title img { height: 20px; }
        
        .header-btn {
            width: 36px; height: 36px;
            background: transparent;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            color: var(--text-secondary);
            cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            transition: all 0.2s ease;
        }
        .header-btn img {
            width: 20px; height: 20px;
            object-fit: contain;
            opacity: 0.8;
            transition: opacity 0.2s ease;
        }
        .header-btn:hover img,
        .header-btn.active img {
            opacity: 1;
        }
        .header-btn:hover {
            background: rgba(100, 116, 139, 0.3);
            color: var(--text-primary);
        }
        .header-btn:active { 
            background: rgba(100, 116, 139, 0.5); 
            color: var(--text-primary);
        }
        .header-btn.active {
            color: var(--brand-accent);
            background: rgba(72, 200, 178, 0.15);
        }
        .header-btn { position: relative; }
        .sync-badge-header {
            position: absolute;
            top: 2px; right: 2px;
            background: #ef4444;
            color: white;
            font-size: 10px;
            font-weight: 600;
            min-width: 16px;
            height: 16px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0 4px;
        }
        
        /* ═══════════════════════════════════════════════════════════════
           MAP CONTROLS (GPS, Compass) - Portal Frosted Glass
           ═══════════════════════════════════════════════════════════════ */
        .map-controls {
            position: absolute; right: 16px; 
            top: calc(var(--header-height) + var(--safe-top) + 16px);
            display: flex; flex-direction: column; gap: 8px; z-index: 95;
            transition: top 0.3s ease;
        }
        /* Move controls down when banner is visible */
        .map-area.banner-visible .map-controls {
            top: calc(var(--header-height) + var(--safe-top) + 56px);
        }
        
        .btn-icon {
            width: 40px; height: 40px; 
            background: rgba(51, 65, 85, 0.75);
            border: 1px solid var(--border-subtle); 
            border-radius: 8px;
            font-size: 16px; cursor: pointer; 
            display: flex; align-items: center; justify-content: center;
            box-shadow: 0 4px 12px rgba(0,0,0,0.25); 
            flex-shrink: 0; 
            transition: all 0.2s ease;
            color: var(--text-primary);
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
        }
        .btn-icon:hover { background: rgba(71, 85, 105, 0.85); }
        .btn-icon:active { background: rgba(100, 116, 139, 0.75); transform: scale(0.96); }
        .btn-icon.active { 
            background: var(--brand-accent); 
            border-color: var(--border-glow); 
            color: white; 
            box-shadow: 0 4px 16px rgba(72, 200, 178, 0.4);
        }
        
        /* GPS Mode Colors */
        .btn-icon.gps-mode-1 { 
            background: rgba(66, 133, 244, 0.85); /* Blue - Show Location */
            border-color: rgba(66, 133, 244, 0.6);
            box-shadow: 0 4px 16px rgba(66, 133, 244, 0.4);
        }
        .btn-icon.gps-mode-2 { 
            background: rgba(52, 168, 83, 0.85); /* Green - Center on Me */
            border-color: rgba(52, 168, 83, 0.6);
            box-shadow: 0 4px 16px rgba(52, 168, 83, 0.4);
        }
        .btn-icon.gps-mode-3 { 
            background: rgba(251, 188, 4, 0.85); /* Yellow/Gold - Follow + Heading */
            border-color: rgba(251, 188, 4, 0.6);
            box-shadow: 0 4px 16px rgba(251, 188, 4, 0.4);
        }
        .btn-icon.gps-mode-1 img,
        .btn-icon.gps-mode-2 img,
        .btn-icon.gps-mode-3 img { 
            opacity: 1; 
            filter: brightness(1.2);
        }
        
        .btn-icon img {
            width: 20px; height: 20px;
            object-fit: contain;
            opacity: 0.8;
            transition: opacity 0.2s ease, filter 0.2s ease;
        }
        .btn-icon:hover img,
        .btn-icon.active img { opacity: 1; }
        
        .compass-indicator {
            width: 40px; height: 40px; 
            background: rgba(51, 65, 85, 0.75);
            border: 1px solid var(--border-subtle);
            border-radius: 50%;
            box-shadow: 0 4px 12px rgba(0,0,0,0.25); 
            display: none; align-items: center; justify-content: center; cursor: pointer;
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
        }
        .compass-indicator.visible { display: flex; }
        .compass-indicator svg { width: 20px; height: 20px; transition: transform 0.1s ease-out; }
        
        /* ═══════════════════════════════════════════════════════════════
           BOTTOM CONTROLS (Add Button) - Portal Accent Style
           ═══════════════════════════════════════════════════════════════ */
        .bottom-controls {
            position: absolute; right: 16px;
            bottom: calc(16px + var(--safe-bottom) + var(--panel-offset, 0px));
            display: flex; flex-direction: column; gap: 8px; z-index: 90;
            transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        /* --panel-offset is set by JS (see PanelOffsetTracker below) to the actual measured
           height of any visible .slider-panel. Drives the lift-above-panel UX so the +
           Add Feature button stays reachable while Layers / Search / Feature panels are open.
           Falls back to 0px when no panel is visible. */
        
        .add-btn {
            width: 56px; height: 56px; 
            background: linear-gradient(135deg, #5eb8d4, #3b8ac7);
            border: none; 
            border-radius: 50%;
            color: white; font-size: 32px; font-weight: 300; cursor: pointer;
            box-shadow: 0 4px 20px rgba(76, 166, 234, 0.4); 
            display: flex; align-items: center; justify-content: center;
            transition: all 0.2s ease;
            line-height: 1;
        }
        .add-btn:hover { box-shadow: 0 6px 24px rgba(76, 166, 234, 0.5); transform: translateY(-1px); }
        .add-btn:active { transform: scale(0.96); box-shadow: 0 2px 12px rgba(76, 166, 234, 0.3); }
        .add-btn.hidden { display: none; }
        
        /* ═══════════════════════════════════════════════════════════════
           LOCATION BANNER (GPS Accuracy) - Portal Frosted Glass
           ═══════════════════════════════════════════════════════════════ */
        .location-banner {
            position: absolute; 
            top: calc(var(--header-height) + var(--safe-top)); 
            left: 0; right: 0;
            background: rgba(51, 65, 85, 0.85);
            padding: 6px 16px; 
            display: none; 
            justify-content: center;
            z-index: 85; 
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
            border-bottom: 1px solid var(--border-subtle);
        }
        .location-banner.visible { display: flex; }
        .location-banner.accurate .loc-text { color: var(--success); }
        .location-banner.inaccurate .loc-text { color: var(--error); }
        
        .loc-text { font-size: 12px; font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace; letter-spacing: 0.02em; }
        .loc-text .required { color: var(--text-muted); }
        
        /* ═══════════════════════════════════════════════════════════════
           GEOMETRY DRAWING CONTROLS - Portal Style Buttons
           ═══════════════════════════════════════════════════════════════ */
        .geometry-controls {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
            padding: 10px;
            background: rgba(51, 65, 85, 0.5);
            border-radius: 12px;
            border: 1px solid var(--border-subtle);
        }
        .geometry-controls .btn {
            flex: 1;
            padding: 10px;
            border-radius: 8px;
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            border: 1px solid var(--border-subtle);
            background: rgba(71, 85, 105, 0.6);
            color: var(--text-primary);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: all 0.2s ease;
        }
        .geometry-controls .btn:hover { background: rgba(100, 116, 139, 0.6); }
        .geometry-controls .btn:active { background: rgba(100, 116, 139, 0.8); }
        .geometry-controls .btn.primary {
            background: var(--brand-primary);
            border-color: var(--brand-primary);
            color: white;
        }
        .geometry-controls .btn.primary:hover { background: #3b8ac7; }
        .geometry-controls .btn.danger {
            color: var(--error);
            border-color: rgba(227, 114, 99, 0.3);
        }
        .geometry-controls .btn.danger:hover { background: rgba(227, 114, 99, 0.15); }
        .geometry-controls .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        
        .geometry-status {
            text-align: center;
            font-size: 12px;
            color: var(--text-secondary);
            padding: 8px;
            background: rgba(51, 65, 85, 0.5);
            border-radius: 8px;
            margin-bottom: 12px;
        }
        .geometry-status .count {
            font-weight: 600;
            color: var(--brand-primary);
        }
        
        .geometry-type-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 10px;
            padding: 2px 8px;
            border-radius: 4px;
            background: var(--bg-surface);
            color: var(--text-muted);
            margin-left: 8px;
        }
        .geometry-type-badge.point { background: rgba(34,197,94,0.15); color: #22c55e; }
        .geometry-type-badge.line { background: rgba(59,130,246,0.15); color: #3b82f6; }
        .geometry-type-badge.polygon { background: rgba(168,85,247,0.15); color: #a855f7; }
        
        /* ═══════════════════════════════════════════════════════════════
           SUBTYPE PICKER - Portal Card Style
           ═══════════════════════════════════════════════════════════════ */
        .subtype-section {
            padding: 0;
        }
        .subtype-header {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 0;
            border-bottom: 1px solid var(--border-subtle);
            margin-bottom: 12px;
        }
        .subtype-header span {
            font-weight: 500;
            font-size: 14px;
            color: var(--text-primary);
        }
        .back-btn-small {
            width: 28px;
            height: 28px;
            background: rgba(71, 85, 105, 0.6);
            border: 1px solid var(--border-subtle);
            border-radius: 6px;
            color: var(--text-primary);
            font-size: 14px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }
        .back-btn-small:hover { background: rgba(100, 116, 139, 0.6); }
        .back-btn-small:active { background: rgba(100, 116, 139, 0.8); }
        
        .subtype-list {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
        }
        .subtype-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            padding: 16px 10px;
            background: rgba(71, 85, 105, 0.5);
            border: 1px solid var(--border-subtle);
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .subtype-item:hover {
            background: rgba(100, 116, 139, 0.5);
            border-color: rgba(148, 163, 184, 0.4);
        }
        .subtype-item:active {
            transform: scale(0.97);
            background: rgba(100, 116, 139, 0.7);
        }
        .subtype-item .icon {
            width: 44px;
            height: 44px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 22px;
            overflow: hidden;
        }
        .subtype-item .icon img {
            width: 32px;
            height: 32px;
            object-fit: contain;
        }
        .subtype-item .label {
            font-size: 12px;
            font-weight: 500;
            color: var(--text-primary);
            text-align: center;
            line-height: 1.2;
        }
        
        /* Required field indicator */
        .form-group label.required::after {
            content: ' *';
            color: var(--error);
        }
        .form-group input.invalid,
        .form-group select.invalid,
        .form-group textarea.invalid {
            border-color: var(--error);
        }
        
        /* ═══════════════════════════════════════════════════════════════
           CROSSHAIR - Shows feature placement location
           Crosshair always centered in map view
           ═══════════════════════════════════════════════════════════════ */
        .crosshair {
            position: absolute; 
            top: calc(50% - var(--crosshair-offset, 0px)); 
            left: 50%; 
            transform: translate(-50%, -50%);
            pointer-events: none; z-index: 95; display: none;
            transition: top 0.3s ease;
        }
        .crosshair.visible { display: block; }
        .crosshair svg { width: 80px; height: 80px; }
        /* Snapped state - highlight the plus sign */
        .crosshair.snapped svg line[stroke="#666"] {
            stroke: var(--brand-accent);
        }
        
        /* Snap Edit Button - shows when snapped to existing feature */
        .snap-edit-btn {
            position: absolute;
            top: calc(50% - var(--crosshair-offset, 0px) + 50px);
            left: 50%;
            transform: translateX(-50%);
            padding: 8px 16px;
            background: rgba(30, 41, 59, 0.95);
            backdrop-filter: blur(20px);
            border: 1px solid var(--border-subtle);
            border-radius: 20px;
            color: var(--brand-accent);
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            display: none;
            align-items: center;
            gap: 6px;
            z-index: 96;
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
            transition: all 0.2s ease;
        }
        .snap-edit-btn:hover {
            background: rgba(50, 61, 79, 0.95);
            border-color: var(--brand-accent);
        }
        
        /* ═══════════════════════════════════════════════════════════════
           UNIFIED BOTTOM SLIDER PANEL - Portal Frosted Glass
           ═══════════════════════════════════════════════════════════════ */
        .slider-panel {
            position: fixed; bottom: 0; left: 0; right: 0;
            background: rgba(71, 85, 105, 0.92);
            backdrop-filter: blur(30px) saturate(180%);
            -webkit-backdrop-filter: blur(30px) saturate(180%);
            border: 1px solid var(--border-subtle);
            border-bottom: none;
            border-radius: 20px 20px 0 0; z-index: 150;
            --panel-height: 35vh;
            height: var(--panel-height);
            max-height: 80vh;
            min-height: 60px;
            display: flex; flex-direction: column; 
            box-shadow: 0 -8px 40px rgba(0,0,0,0.4);
            /* Slide animation */
            transform: translateY(100%);
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
            visibility: hidden;
        }
        .slider-panel.visible { 
            transform: translateY(0); 
            visibility: visible;
        }
        
        /* When dragging, disable transition for smooth resize */
        .slider-panel.dragging {
            transition: none;
        }
        
        /* Minimized state - just show handle */
        .slider-panel.minimized {
            --panel-height: 60px;
        }
        
        /* Taller panels override */
        .slider-panel.tall {
            --panel-height: 45vh;
        }
        
        .slider-handle { 
            padding: 12px 16px; 
            display: flex; justify-content: center; flex-shrink: 0; 
            cursor: ns-resize;
            -webkit-tap-highlight-color: transparent;
            touch-action: none;
            user-select: none;
        }
        .slider-handle::before { 
            content: ''; width: 36px; height: 5px; 
            background: var(--gray-400); border-radius: 3px; opacity: 0.5;
            transition: opacity 0.15s, background 0.15s;
        }
        .slider-handle:active::before,
        .slider-panel.dragging .slider-handle::before {
            opacity: 1;
            background: var(--brand-accent);
        }
        
        .slider-header {
            display: flex; align-items: center; justify-content: space-between;
            padding: 0 16px 12px; flex-shrink: 0;
            border-bottom: 1px solid var(--border-subtle);
        }
        .slider-header h3 { font-size: 15px; font-weight: 500; color: var(--text-primary); letter-spacing: 0.02em; }
        .slider-header .close-btn { 
            background: none; border: none; 
            font-size: 18px; color: #f9f9f9; cursor: pointer; 
            padding: 0;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            transition: color 0.2s, background 0.2s;
        }
        .slider-header .close-btn:hover { 
            color: #ffffff; 
            background: rgba(255,255,255,0.08);
        }
        
        .slider-content { 
            flex: 1; overflow-y: auto; padding: 12px 16px; 
            padding-bottom: calc(12px + var(--safe-bottom));
            -webkit-overflow-scrolling: touch; 
        }

        /* ═══════════════════════════════════════════════════════════════
           SYNC PANEL (Collected Features) - Portal Button Style
           ═══════════════════════════════════════════════════════════════ */
        .sync-toolbar {
            display: flex; gap: 8px; flex-wrap: wrap;
            padding: 10px 16px 12px;
            border-bottom: 1px solid var(--border-subtle);
            flex-shrink: 0;
        }
        .sync-btn {
            background: rgba(100, 116, 139, 0.4);
            border: 1px solid var(--border-subtle);
            color: var(--text-primary);
            font-family: inherit;
            font-size: 12px;
            padding: 8px 10px;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .sync-btn:hover { background: rgba(100, 116, 139, 0.6); }
        .sync-btn:active { background: rgba(100, 116, 139, 0.75); }
        .sync-btn.danger { background: rgba(227, 114, 99, 0.15); border-color: rgba(227, 114, 99, 0.3); }
        .sync-btn.danger:hover { background: rgba(227, 114, 99, 0.25); }
        .sync-btn.ok { background: rgba(72, 187, 120, 0.15); border-color: rgba(72, 187, 120, 0.3); }
        .sync-btn.ok:hover { background: rgba(72, 187, 120, 0.25); }
        .sync-btn.primary { 
            background: linear-gradient(135deg, #5eb8d4, #3b8ac7);
            border-color: var(--brand-primary);
            color: #fff;
            font-weight: 500;
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }
        .sync-btn.primary:hover { box-shadow: 0 4px 12px rgba(76, 166, 234, 0.3); }
        .sync-btn.primary:active { opacity: 0.85; }
        .sync-btn.primary:disabled { opacity: 0.5; cursor: not-allowed; }
        .sync-btn .btn-icon { font-size: 14px; }
        
        /* Syncing animation for header button */
        #syncBtn.syncing {
            animation: pulse-sync 1s ease-in-out infinite;
        }
        @keyframes pulse-sync {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }

        /* Cloud Sync Section */
        .sync-cloud-section {
            padding: 14px 16px;
            background: rgba(76, 166, 234, 0.08);
            border-bottom: 1px solid rgba(76, 166, 234, 0.2);
        }
        .sync-cloud-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
        }
        .sync-cloud-title {
            font-weight: 700;
            font-size: 14px;
            color: var(--text-primary);
        }
        .sync-status {
            font-size: 12px;
            padding: 3px 10px;
            border-radius: 999px;
            background: rgba(34,197,94,0.12);
            border: 1px solid rgba(34,197,94,0.25);
        }
        .sync-status.syncing {
            background: rgba(59,130,246,0.12);
            border-color: rgba(59,130,246,0.25);
            animation: pulse 1.5s infinite;
        }
        .sync-status.error {
            background: rgba(239,68,68,0.12);
            border-color: rgba(239,68,68,0.25);
        }
        .sync-status.offline {
            background: rgba(107,114,128,0.12);
            border-color: rgba(107,114,128,0.25);
        }
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.6; }
        }
        .sync-cloud-user {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            color: var(--text-secondary);
            margin-bottom: 12px;
        }
        .sync-cloud-user .user-icon {
            font-size: 14px;
        }
        .sync-cloud-actions {
            display: flex;
            gap: 8px;
        }
        .sync-cloud-actions .sync-btn {
            flex: 1;
        }
        .sync-cloud-info {
            font-size: 11px;
            color: var(--text-secondary);
            margin-top: 10px;
            text-align: center;
        }

        .sync-summary {
            display: flex; align-items: center; justify-content: space-between;
            padding: 10px 16px;
            color: var(--text-secondary);
            font-size: 12px;
            border-bottom: 1px solid var(--border-subtle);
            flex-shrink: 0;
        }
        .sync-list { padding: 10px 16px; }
        .sync-item {
            border: 1px solid var(--border-subtle);
            background: rgba(15, 22, 32, 0.7);
            border-radius: 12px;
            padding: 10px;
            margin-bottom: 10px;
        }
        .sync-item-top {
            display: flex; justify-content: space-between; gap: 10px;
            align-items: flex-start;
        }
        .sync-item-title {
            font-weight: 700; font-size: 13px; color: var(--text-primary);
        }
        .sync-item-meta {
            font-size: 11px; color: var(--text-secondary);
            margin-top: 4px;
        }
        .sync-pill {
            font-size: 10px;
            padding: 2px 8px;
            border-radius: 999px;
            border: 1px solid var(--border-subtle);
            color: var(--text-primary);
            white-space: nowrap;
        }
        .sync-pill.pending { background: rgba(234,179,8,0.12); border-color: rgba(234,179,8,0.25); }
        .sync-pill.synced { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.25); }
        
        /* Collector badge for features from other users */
        .collector-badge {
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 4px;
            background: rgba(96, 165, 250, 0.15);
            border: 1px solid rgba(96, 165, 250, 0.3);
            color: #60a5fa;
            margin-left: 6px;
            font-weight: 500;
        }
        .sync-item.other-user {
            border-color: rgba(96, 165, 250, 0.25);
        }

        .sync-item-actions {
            display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap;
        }
        .sync-action {
            background: transparent;
            border: 1px solid var(--border-subtle);
            color: var(--text-primary);
            font-family: inherit;
            font-size: 12px;
            padding: 6px 10px;
            border-radius: 10px;
            cursor: pointer;
        }
        .sync-action:active { background: var(--bg-card-hover); }
        .sync-action.danger { border-color: rgba(239,68,68,0.25); }
        .sync-action.ok { border-color: rgba(34,197,94,0.25); }
        
        /* ═══════════════════════════════════════════════════════════════
           SEARCH PANEL (in slider) - Portal Style
           ═══════════════════════════════════════════════════════════════ */
        .search-input-wrap { padding: 0 16px 12px; flex-shrink: 0; }
        .search-input {
            width: 100%; height: 40px; padding: 0 36px 0 14px;
            background: rgba(51, 65, 85, 0.6);
            border: 1px solid var(--border-subtle); 
            border-radius: 8px;
            font-family: inherit;
            font-size: 14px; 
            color: var(--text-primary);
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
        }
        .search-input::placeholder { color: var(--text-muted); }
        .search-input:focus { 
            outline: none; 
            border-color: var(--brand-primary); 
            box-shadow: 0 0 0 2px rgba(76, 166, 234, 0.2);
        }
        
        .search-result-item {
            padding: 10px 12px; 
            border-bottom: 1px solid var(--border-subtle);
            cursor: pointer; display: flex; align-items: center; gap: 10px;
            transition: background 0.2s ease; border-radius: 8px; margin: 2px 0;
        }
        .search-result-item:last-child { border-bottom: none; }
        .search-result-item:hover { background: rgba(100, 116, 139, 0.3); }
        .search-result-item:active { background: rgba(100, 116, 139, 0.5); }
        
        .search-section-header {
            font-size: 10px; 
            color: var(--text-muted); 
            text-transform: uppercase;
            letter-spacing: 0.5px;
            font-weight: 500;
            padding: 12px 4px 6px;
            border-bottom: 1px solid var(--border-subtle);
            margin-bottom: 4px;
        }
        .search-section-header:first-child {
            padding-top: 0;
        }
        
        .store-icon { 
            width: 32px; height: 32px; border-radius: 8px; 
            display: flex; align-items: center; justify-content: center; 
            font-size: 14px; flex-shrink: 0; 
        }
        .store-icon.retail { background: rgba(232, 93, 93, 0.15); color: var(--retail-color); }
        .store-icon.supply { background: rgba(91, 155, 213, 0.15); color: var(--walmart-color); }
        
        .store-info { flex: 1; min-width: 0; }
        .store-id { font-weight: 500; color: var(--text-primary); font-size: 13px; }
        .store-name { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .search-no-results, .search-loading { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }
        
        /* ═══════════════════════════════════════════════════════════════
           LAYERS CONTENT (in slider) - Portal Style
           ═══════════════════════════════════════════════════════════════ */
        .layers-section { margin-bottom: 16px; }
        .layers-section-header { 
            font-size: 10px; color: var(--text-muted); text-transform: uppercase; 
            margin-bottom: 8px; font-weight: 500; letter-spacing: 0.5px; 
        }
        
        .layer-item {
            display: flex; align-items: center; justify-content: space-between;
            padding: 10px; margin: 4px 0;
            background: rgba(51, 65, 85, 0.5);
            border-radius: 8px;
            border: 1px solid var(--border-subtle);
            transition: background 0.2s ease;
        }
        .layer-item:hover { background: rgba(71, 85, 105, 0.6); }
        
        .layer-info { display: flex; align-items: center; gap: 10px; flex: 1; }
        .layer-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
        .layer-icon.error { color: var(--error); }
        .layer-name { font-size: 13px; color: var(--text-primary); }
        .layer-status { font-size: 11px; color: var(--text-secondary); }
        .layer-error { font-size: 11px; color: var(--error); }
        
        /* Toggle switch - Portal teal accent */
        .toggle-switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
        .toggle-switch input { opacity: 0; width: 0; height: 0; }
        .toggle-slider {
            position: absolute; cursor: pointer; inset: 0;
            background: var(--gray-500); border-radius: 24px; transition: 0.25s;
        }
        .toggle-slider::before {
            content: ''; position: absolute; height: 18px; width: 18px;
            left: 3px; bottom: 3px; background: white; border-radius: 50%;
            transition: 0.25s; box-shadow: 0 2px 4px rgba(0,0,0,0.3);
        }
        .toggle-switch input:checked + .toggle-slider { background: var(--brand-accent); }
        .toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }
        
        /* ═══════════════════════════════════════════════════════════════
           FEATURE PANEL (Store Details - in slider) - Portal Style
           ═══════════════════════════════════════════════════════════════ */
        .feature-header { 
            display: flex; align-items: center; gap: 10px; 
            padding-bottom: 10px; border-bottom: 1px solid var(--border-subtle); 
            margin-bottom: 10px; 
        }
        .feature-symbol { 
            width: 40px; height: 40px; border-radius: 8px; 
            display: flex; align-items: center; justify-content: center; 
            font-size: 20px; flex-shrink: 0; 
        }
        .feature-title h3 { font-size: 15px; font-weight: 500; margin-bottom: 2px; color: var(--text-primary); }
        .feature-title p { font-size: 12px; color: var(--text-secondary); }
        
        .action-toolbar { 
            display: flex; gap: 2px; padding: 8px 0; 
            border-bottom: 1px solid var(--border-subtle); 
            margin-bottom: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; 
        }
        .action-btn {
            display: flex; flex-direction: column; align-items: center; gap: 2px;
            padding: 8px 10px; background: none; border: none; color: var(--brand-primary);
            font-family: inherit; font-size: 10px; cursor: pointer; border-radius: 6px; min-width: 52px; flex-shrink: 0;
            transition: background 0.2s ease, color 0.2s ease;
        }
        .action-btn:active { background: rgba(212, 133, 74, 0.15); }
        .action-btn .icon { font-size: 18px; }
        
        .detail-row { display: flex; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
        .detail-row:last-child { border-bottom: none; }
        .detail-label { width: 80px; font-size: 11px; color: var(--text-muted); flex-shrink: 0; text-transform: uppercase; letter-spacing: 0.5px; }
        .detail-value { flex: 1; font-size: 13px; color: var(--text-primary); }
        
        /* ═══════════════════════════════════════════════════════════════
           COLLECTION PANEL (New Feature - in slider)
           ═══════════════════════════════════════════════════════════════ */
        .collection-header {
            display: flex; align-items: center; justify-content: space-between;
            padding: 0 16px 10px; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0;
        }
        .collection-header .cancel-btn { 
            padding: 6px 12px; background: none; border: none; 
            color: var(--text-secondary); font-family: inherit; font-size: 14px; cursor: pointer;
            transition: color 0.2s;
        }
        .collection-header .cancel-btn:hover { color: var(--text-primary); }
        .collection-header h3 { font-size: 15px; font-weight: 500; color: var(--text-primary); }
        .collection-header-actions {
            display: flex;
            gap: 8px;
            align-items: center;
        }
        .collection-header .delete-btn {
            padding: 6px 12px;
            background: rgba(239, 68, 68, 0.15);
            border: 1px solid rgba(239, 68, 68, 0.3);
            border-radius: 6px;
            color: #EF4444;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: background 0.2s, border-color 0.2s;
        }
        .collection-header .delete-btn:hover {
            background: rgba(239, 68, 68, 0.25);
            border-color: rgba(239, 68, 68, 0.5);
        }
        .collection-header .submit-btn { 
            padding: 6px 14px; 
            background: var(--brand-primary); 
            border: none; 
            border-radius: 6px; 
            color: white; 
            font-size: 14px; 
            font-weight: 500; 
            cursor: pointer;
            transition: background 0.2s, box-shadow 0.2s;
        }
        .collection-header .submit-btn:hover { box-shadow: 0 4px 12px rgba(76, 166, 234, 0.3); }
        .collection-header .submit-btn:disabled { background: var(--text-muted); opacity: 0.5; }
        .collection-header .submit-btn:active { background: #3b8ac7; }
        
        /* Template List */
        .template-filter {
            background: var(--bg-surface); 
            border: 1px solid var(--border-subtle); 
            border-radius: 8px;
            padding: 10px 14px; width: 100%; font-family: inherit; font-size: 14px; margin-bottom: 12px;
            color: var(--text-primary);
        }
        .template-filter::placeholder { color: var(--text-muted); }
        .template-filter:focus { outline: none; border-color: var(--border-glow); }
        
        .template-group { margin-bottom: 6px; }
        .template-group-header {
            font-size: 10px; color: var(--text-muted); padding: 8px 0 4px;
            text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
        }
        
        .template-list-item {
            display: flex; align-items: center; gap: 10px;
            padding: 10px;
            background: rgba(51, 65, 85, 0.5);
            cursor: pointer;
            border-radius: 8px;
            margin: 3px 0;
            border: 1px solid transparent;
            transition: all 0.2s ease;
        }
        .template-list-item:hover { background: rgba(71, 85, 105, 0.6); }
        .template-list-item:active { background: rgba(100, 116, 139, 0.6); }
        .template-list-item.selected { background: rgba(76, 166, 234, 0.12); border-color: var(--brand-primary); }
        
        .template-list-item .icon {
            width: 28px; height: 28px; border-radius: 6px; 
            display: flex; align-items: center; justify-content: center; 
            font-size: 14px; flex-shrink: 0;
            overflow: hidden;
        }
        .template-list-item .icon img {
            width: 20px; height: 20px;
            object-fit: contain;
        }
        .template-list-item > span:not(.icon):not(.geometry-type-badge) {
            font-size: 14px; color: var(--text-primary); font-weight: 500; 
            flex: 1; 
        }
        .template-list-item > .geometry-type-badge { 
            flex-shrink: 0;
        }
        
        .form-section { display: none; }
        .form-section.visible { display: block; }
        .form-group { margin-bottom: 12px; }
        .form-group label { 
            display: block; 
            font-size: 10px; 
            color: var(--text-muted); 
            text-transform: uppercase; 
            margin-bottom: 6px;
            font-weight: 500;
            letter-spacing: 0.5px;
        }
        .form-group label.required::after { content: ' *'; color: var(--error); }
        .form-group input, .form-group select, .form-group textarea {
            width: 100%; padding: 10px 12px; 
            background: rgba(51, 65, 85, 0.5);
            border: 1px solid var(--border-subtle); 
            border-radius: 8px; 
            font-family: inherit;
            font-size: 14px; 
            color: var(--text-primary); 
            -webkit-appearance: none;
            transition: border-color 0.2s, box-shadow 0.2s;
            /* Allow text selection in inputs */
            -webkit-user-select: text;
            user-select: text;
        }
        .form-group input:focus, .form-group select:focus, .form-group textarea:focus { 
            border-color: var(--brand-primary); 
            box-shadow: 0 0 0 2px rgba(76, 166, 234, 0.2);
            outline: none; 
        }
        .form-group textarea { min-height: 80px; resize: vertical; }
        .form-group select { 
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 12px center;
            padding-right: 36px;
        }
        
        .photo-section h4 { font-size: 10px; color: var(--text-muted); text-transform: uppercase; margin: 14px 0 8px; font-weight: 500; letter-spacing: 0.5px; }
        .photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
        .photo-item { aspect-ratio: 1; background: rgba(51, 65, 85, 0.5); border-radius: 6px; overflow: hidden; }
        .photo-item img { width: 100%; height: 100%; object-fit: cover; }
        .photo-item.add-photo {
            display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
            cursor: pointer; border: 2px dashed var(--border-subtle); background: transparent; 
            font-size: 10px; color: var(--text-muted);
            transition: all 0.2s ease;
        }
        .photo-item.add-photo:hover { border-color: var(--brand-primary); background: rgba(76, 166, 234, 0.05); }
        .photo-item.add-photo:active { background: rgba(76, 166, 234, 0.1); border-color: var(--brand-primary); }
        .photo-item.add-photo .icon { font-size: 20px; color: var(--brand-primary); }
        
        /* ═══════════════════════════════════════════════════════════════
           FIELD MAPS STYLE - Feature Info & Actions
           ═══════════════════════════════════════════════════════════════ */
        .feature-info-header {
            display: flex; align-items: center; gap: 12px;
            padding-bottom: 12px; margin-bottom: 12px;
            border-bottom: 1px solid var(--border-subtle);
        }
        .feature-info-icon {
            width: 40px; height: 40px;
            background: var(--error);
            border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-size: 18px; flex-shrink: 0;
            overflow: hidden;
        }
        .feature-info-icon img {
            width: 28px; height: 28px;
            object-fit: contain;
        }
        .feature-info-details { flex: 1; min-width: 0; }
        .feature-info-title {
            font-size: 15px; font-weight: 600; color: var(--text-primary);
            margin-bottom: 2px;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .feature-info-coords {
            font-size: 12px; color: var(--text-secondary);
            font-family: 'JetBrains Mono', monospace;
        }
        .feature-info-menu {
            width: 32px; height: 32px;
            background: none; border: none;
            color: var(--brand-primary); font-size: 18px;
            cursor: pointer; border-radius: 6px;
        }
        .feature-info-menu:active { background: rgba(212, 133, 74, 0.15); }
        
        /* Point Action Buttons (Add / Update) */
        .point-action-buttons {
            display: grid;
            grid-template-columns: 1fr;
            gap: 10px;
            margin-bottom: 12px;
        }
        .point-btn {
            padding: 14px 16px;
            background: linear-gradient(135deg, #5eb8d4, #3b8ac7);
            border: none; border-radius: 8px;
            color: white; font-family: inherit;
            font-size: 15px; font-weight: 600;
            cursor: pointer;
            display: flex; align-items: center; justify-content: center; gap: 8px;
            transition: all 0.15s;
            box-shadow: 0 2px 8px rgba(76, 166, 234, 0.3);
        }
        .point-btn:hover { box-shadow: 0 4px 12px rgba(76, 166, 234, 0.4); }
        .point-btn:active { transform: scale(0.98); }
        .point-btn.active {
            box-shadow: 0 0 0 3px rgba(76, 166, 234, 0.4);
        }
        .point-btn .icon { font-size: 16px; }
        .point-btn.update-mode {
            background: linear-gradient(135deg, #48c8b2, #35a89a);
        }
        
        .collect-action-row {
            display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
            margin-bottom: 12px;
        }
        .collect-action-btn {
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            gap: 4px; padding: 14px 12px;
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            color: var(--brand-primary);
            font-family: inherit; font-size: 13px; font-weight: 500;
            cursor: pointer;
            transition: all 0.15s;
        }
        .collect-action-btn:active { 
            background: var(--bg-card-hover); 
            border-color: var(--brand-primary);
        }
        .collect-action-btn .icon { font-size: 22px; }
        
        /* Photo grid when it has photos */
        .photo-grid:not(:empty) {
            margin-bottom: 16px;
        }
        
        /* ═══════════════════════════════════════════════════════════════
           GEOREFERENCE VIEW (Full screen overlay)
           ═══════════════════════════════════════════════════════════════ */
        .georef-view { position: fixed; inset: 0; background: var(--bg-deep); z-index: 500; display: none; flex-direction: column; }
        .georef-view.visible { display: flex; }
        .georef-header {
            display: flex; align-items: center; gap: 12px;
            padding: 10px 16px; padding-top: calc(10px + var(--safe-top));
            background: var(--bg-surface); 
            border-bottom: 1px solid var(--border-subtle);
            color: var(--text-primary); flex-shrink: 0;
        }
        .georef-header .back-btn {
            width: 32px; height: 32px; 
            background: var(--bg-card); 
            border: 1px solid var(--border-subtle); 
            border-radius: 6px;
            color: var(--text-primary); font-size: 16px; cursor: pointer; 
            display: flex; align-items: center; justify-content: center;
            transition: all 0.15s;
        }
        .georef-header .back-btn:active { background: var(--bg-card-hover); }
        .georef-header h2 { font-size: 15px; font-weight: 600; flex: 1; }
        .georef-iframe { flex: 1; border: none; width: 100%; }
        
        /* ═══════════════════════════════════════════════════════════════
           OVERFLOW MENU - Portal Frosted Glass
           ═══════════════════════════════════════════════════════════════ */
        .menu-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); z-index: 400; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
        .menu-overlay.visible { opacity: 1; pointer-events: auto; }
        
        .overflow-menu {
            position: fixed; top: calc(var(--header-height) + var(--safe-top) + 4px); right: 8px; width: 200px;
            background: rgba(71, 85, 105, 0.95);
            backdrop-filter: blur(30px) saturate(180%);
            -webkit-backdrop-filter: blur(30px) saturate(180%);
            border: 1px solid var(--border-subtle);
            border-radius: 12px; 
            box-shadow: 0 8px 40px rgba(0,0,0,0.4);
            z-index: 450; transform: scale(0.9) translateY(-10px); opacity: 0; pointer-events: none;
            transition: all 0.2s ease; transform-origin: top right; overflow: hidden;
        }
        .overflow-menu.visible { transform: scale(1) translateY(0); opacity: 1; pointer-events: auto; }
        
        .menu-item {
            display: flex; align-items: center; gap: 12px; padding: 12px 16px;
            border: none; background: none; width: 100%; text-align: left; 
            font-family: inherit; font-size: 13px; color: var(--text-primary); cursor: pointer;
            transition: background 0.2s ease;
        }
        .menu-item:hover { background: rgba(100, 116, 139, 0.4); }
        .menu-item:active { background: rgba(100, 116, 139, 0.6); }
        .menu-item.active { 
            background: rgba(72, 200, 178, 0.15); 
            color: var(--brand-accent);
        }
        .menu-item.active .icon { opacity: 1; }
        .menu-item .icon { font-size: 16px; width: 20px; text-align: center; opacity: 0.8; }
        .menu-divider { height: 1px; background: var(--border-subtle); margin: 4px 0; }
        
        .admin-badge {
            font-size: 9px;
            background: var(--brand-primary);
            color: white;
            padding: 2px 6px;
            border-radius: 4px;
            margin-left: auto;
            font-weight: 500;
        }
        
        /* Admin Panel */
        .admin-panel {
            background: var(--bg-panel);
            border-radius: 16px;
            padding: 24px;
            width: 90%;
            max-width: 500px;
            border: 1px solid var(--border-subtle);
            box-shadow: 0 20px 60px rgba(0,0,0,0.5);
        }
        .admin-panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
        }
        .admin-panel-header h2 {
            margin: 0;
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
        }
        .admin-panel-header .close-btn {
            background: none;
            border: none;
            font-size: 24px;
            color: #f9f9f9;
            cursor: pointer;
            padding: 4px 8px;
            line-height: 1;
        }
        .admin-panel-header .close-btn:hover {
            color: #ffffff;
        }
        .admin-cards {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .admin-card {
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 12px;
            padding: 16px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 16px;
            transition: all 0.2s ease;
        }
        .admin-card:hover {
            background: rgba(76, 166, 234, 0.1);
            border-color: var(--brand-primary);
            transform: translateX(4px);
        }
        .admin-card:active {
            transform: scale(0.98);
        }
        .admin-card-icon {
            font-size: 32px;
            width: 48px;
            height: 48px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-deep);
            border-radius: 10px;
            flex-shrink: 0;
        }
        .admin-card-title {
            font-size: 16px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 4px;
        }
        .admin-card-desc {
            font-size: 12px;
            color: var(--text-secondary);
        }
        
        /* ═══════════════════════════════════════════════════════════════
           LAYER CONFIG PANEL (Full screen - Desktop Optimized)
           ═══════════════════════════════════════════════════════════════ */
        .layer-config-view { 
            position: fixed; inset: 0; 
            background: var(--bg-deep); 
            z-index: 500; 
            display: none; 
            flex-direction: column; 
        }
        .layer-config-view.visible { display: flex; }
        
        .layer-config-header {
            display: flex; align-items: center; gap: 12px;
            padding: 12px 20px; padding-top: calc(12px + var(--safe-top));
            background: rgba(30, 41, 59, 0.95);
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
            border-bottom: 1px solid var(--border-subtle);
            color: var(--text-primary); flex-shrink: 0;
        }
        .layer-config-header .back-btn {
            width: 36px; height: 36px; 
            background: rgba(51, 65, 85, 0.6);
            border: 1px solid var(--border-subtle); 
            border-radius: 8px;
            color: var(--text-primary); font-size: 18px; cursor: pointer; 
            display: flex; align-items: center; justify-content: center;
            transition: all 0.2s;
        }
        .layer-config-header .back-btn:hover { background: rgba(71, 85, 105, 0.7); }
        .layer-config-header h2 { font-size: 17px; font-weight: 500; flex: 1; }
        .layer-config-actions { display: flex; gap: 8px; align-items: center; }
        .layer-config-header .schema-btn {
            width: 36px; height: 36px;
            background: rgba(51, 65, 85, 0.6);
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            color: var(--text-secondary);
            font-size: 16px;
            cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            transition: all 0.2s;
        }
        .layer-config-header .schema-btn:hover { background: rgba(71, 85, 105, 0.7); color: var(--text-primary); }
        
        /* Save button with unsaved indicator */
        .layer-config-header .schema-save-btn {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 8px 14px;
            background: rgba(51, 65, 85, 0.6);
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            color: var(--text-secondary);
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
        }
        .layer-config-header .schema-save-btn:hover { background: rgba(71, 85, 105, 0.7); color: var(--text-primary); }
        .layer-config-header .schema-save-btn.has-changes {
            background: rgba(76, 166, 234, 0.2);
            border-color: var(--brand-primary);
            color: var(--brand-primary);
            animation: pulse-save 2s infinite;
        }
        .layer-config-header .schema-save-btn .unsaved-dot {
            display: none;
            width: 8px;
            height: 8px;
            background: #ef4444;
            border-radius: 50%;
            position: absolute;
            top: -2px;
            right: -2px;
        }
        .layer-config-header .schema-save-btn.has-changes .unsaved-dot { display: block; }
        @keyframes pulse-save {
            0%, 100% { box-shadow: 0 0 0 0 rgba(76, 166, 234, 0.4); }
            50% { box-shadow: 0 0 0 6px rgba(76, 166, 234, 0); }
        }
        
        .layer-config-header .add-layer-btn {
            padding: 10px 18px;
            background: var(--brand-primary);
            border: none;
            border-radius: 8px;
            color: white;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s;
        }
        .layer-config-header .add-layer-btn:hover { background: #3b8ac7; }
        
        /* Tab Navigation */
        .layer-config-tabs {
            display: flex;
            padding: 0 20px;
            background: rgba(30, 41, 59, 0.7);
            border-bottom: 1px solid var(--border-subtle);
        }
        .layer-config-tab {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 14px 20px;
            background: none;
            border: none;
            border-bottom: 2px solid transparent;
            color: var(--text-muted);
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }
        .layer-config-tab:hover { color: var(--text-secondary); }
        .layer-config-tab.active {
            color: var(--brand-primary);
            border-bottom-color: var(--brand-primary);
        }
        .layer-config-tab .tab-icon { font-size: 16px; }
        
        /* Two-column layout for desktop */
        .layer-config-body {
            flex: 1;
            display: flex;
            overflow: hidden;
        }
        
        /* Icon Library Panel (inline in Layer Config) */
        .icon-library-panel {
            flex: 1;
            display: flex;
            flex-direction: column;
            padding: 20px;
            overflow: hidden;
        }
        .icon-library-controls {
            display: flex;
            gap: 12px;
            margin-bottom: 16px;
            flex-wrap: wrap;
        }
        .icon-library-search {
            flex: 1;
            min-width: 200px;
            padding: 10px 14px;
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            color: var(--text-primary);
            font-size: 13px;
        }
        .icon-library-search:focus { outline: none; border-color: var(--brand-primary); }
        .icon-library-tabs {
            display: flex;
            gap: 6px;
            margin-bottom: 12px;
            flex-wrap: wrap;
        }
        .icon-library-tabs .icon-tab {
            padding: 8px 12px;
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 6px;
            color: var(--text-secondary);
            font-size: 12px;
            cursor: pointer;
            transition: all 0.15s;
        }
        .icon-library-tabs .icon-tab:hover { border-color: var(--text-muted); }
        .icon-library-tabs .icon-tab.active {
            background: var(--brand-primary);
            border-color: var(--brand-primary);
            color: white;
        }
        .icon-library-grid {
            flex: 1;
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
            gap: 10px;
            overflow-y: auto;
            padding: 4px;
            -webkit-overflow-scrolling: touch;
        }
        .icon-library-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 12px 8px;
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.15s;
        }
        .icon-library-item:hover { border-color: var(--brand-primary); background: rgba(76, 166, 234, 0.1); }
        .icon-library-item img {
            width: 40px;
            height: 40px;
            object-fit: contain;
            margin-bottom: 6px;
        }
        .icon-library-item .name {
            font-size: 10px;
            color: var(--text-muted);
            text-align: center;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 100%;
        }
        .icon-library-item.uploaded {
            border-color: rgba(72, 200, 178, 0.4);
            position: relative;
        }
        .icon-library-item .uploaded-badge {
            position: absolute;
            top: 4px;
            right: 4px;
            font-size: 10px;
        }
        
        /* Icon Upload Button */
        .icon-upload-btn {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 8px 14px;
            background: rgba(72, 200, 178, 0.15);
            border: 1px solid rgba(72, 200, 178, 0.4);
            border-radius: 8px;
            color: #48c8b2;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }
        .icon-upload-btn:hover { background: rgba(72, 200, 178, 0.25); }
        
        /* Icon Upload Drop Zone */
        .icon-upload-zone {
            margin-bottom: 12px;
            padding: 16px;
            background: rgba(51, 65, 85, 0.3);
            border: 2px dashed var(--border-subtle);
            border-radius: 10px;
            text-align: center;
            transition: all 0.2s;
        }
        .icon-upload-zone.drag-over {
            background: rgba(76, 166, 234, 0.15);
            border-color: var(--brand-primary);
        }
        .upload-zone-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
        }
        .upload-zone-content .upload-icon { font-size: 24px; opacity: 0.6; }
        .upload-zone-content .upload-text { font-size: 13px; color: var(--text-secondary); }
        .upload-zone-content .upload-hint { font-size: 11px; color: var(--text-muted); }
        .upload-progress {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }
        .upload-progress .progress-bar {
            width: 100%;
            max-width: 300px;
            height: 6px;
            background: rgba(51, 65, 85, 0.5);
            border-radius: 3px;
            overflow: hidden;
        }
        .upload-progress .progress-fill {
            height: 100%;
            background: var(--brand-primary);
            border-radius: 3px;
            transition: width 0.3s ease;
            width: 0%;
        }
        .upload-progress .progress-text { font-size: 12px; color: var(--text-secondary); }
        
        /* Left sidebar - Layer tree */
        .layer-config-sidebar {
            width: 340px;
            min-width: 280px;
            background: var(--bg-surface);
            border-right: 1px solid var(--border-subtle);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        .layer-config-sidebar-header {
            padding: 14px 16px;
            border-bottom: 1px solid var(--border-subtle);
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .layer-config-search {
            flex: 1;
            padding: 10px 14px;
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            color: var(--text-primary);
            font-size: 13px;
        }
        .layer-config-search:focus { outline: none; border-color: var(--brand-primary); }
        .layer-config-tree {
            flex: 1;
            overflow-y: auto;
            padding: 12px;
            -webkit-overflow-scrolling: touch;
        }
        
        /* Layer tree items */
        .layer-tree-section {
            margin-bottom: 16px;
        }
        .layer-tree-section-header {
            font-size: 10px;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            font-weight: 600;
            padding: 8px 4px 6px;
        }
        .layer-tree-item {
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 10px;
            margin-bottom: 6px;
            overflow: hidden;
            transition: all 0.15s;
        }
        .layer-tree-item.selected { border-color: var(--brand-primary); }
        .layer-tree-item-header {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            cursor: pointer;
            transition: background 0.1s;
        }
        .layer-tree-item-header:hover { background: var(--bg-card-hover); }
        .layer-tree-expand {
            width: 20px; height: 20px;
            display: flex; align-items: center; justify-content: center;
            color: var(--text-muted);
            font-size: 10px;
            transition: transform 0.2s;
        }
        .layer-tree-expand.expanded { transform: rotate(90deg); }
        .layer-tree-expand.hidden { visibility: hidden; }
        .layer-tree-icon {
            width: 32px; height: 32px;
            border-radius: 8px;
            display: flex; align-items: center; justify-content: center;
            font-size: 16px;
            flex-shrink: 0;
        }
        .layer-tree-info { flex: 1; min-width: 0; }
        .layer-tree-title { 
            font-size: 13px; 
            font-weight: 600; 
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .layer-tree-meta {
            font-size: 11px;
            color: var(--text-muted);
            margin-top: 2px;
        }
        .layer-tree-badge {
            font-size: 9px;
            padding: 2px 6px;
            border-radius: 4px;
            background: rgba(76, 166, 234, 0.12);
            color: var(--brand-primary);
            flex-shrink: 0;
        }
        .layer-tree-badge.custom {
            background: rgba(34,197,94,0.15);
            color: var(--success);
        }
        .layer-tree-badge.modified {
            background: rgba(234,179,8,0.15);
            color: #eab308;
        }
        
        /* Subtypes within layer */
        .layer-tree-subtypes {
            display: none;
            padding: 0 12px 10px 42px;
        }
        .layer-tree-item.expanded .layer-tree-subtypes { display: block; }
        .layer-tree-subtype {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 10px;
            background: var(--bg-surface);
            border-radius: 6px;
            margin-bottom: 4px;
            cursor: pointer;
            transition: background 0.1s;
        }
        .layer-tree-subtype:hover { background: var(--bg-card-hover); }
        .layer-tree-subtype.selected { background: rgba(76, 166, 234, 0.12); }
        .layer-tree-subtype-icon {
            width: 24px; height: 24px;
            border-radius: 6px;
            display: flex; align-items: center; justify-content: center;
            font-size: 12px;
        }
        .layer-tree-subtype-name { font-size: 12px; color: var(--text-primary); flex: 1; }
        .layer-tree-subtype-count { font-size: 10px; color: var(--text-muted); }
        
        /* Right panel - Editor */
        .layer-config-editor {
            flex: 1;
            overflow-y: auto;
            padding: 24px;
            -webkit-overflow-scrolling: touch;
        }
        .layer-config-editor-empty {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
            color: var(--text-muted);
            text-align: center;
        }
        .layer-config-editor-empty .icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
        .layer-config-editor-empty h3 { font-size: 16px; color: var(--text-secondary); margin-bottom: 8px; }
        .layer-config-editor-empty p { font-size: 13px; }
        
        /* Modified layer notice */
        .editor-modified-notice {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 16px;
            background: rgba(76, 166, 234, 0.1);
            border: 1px solid rgba(76, 166, 234, 0.3);
            border-radius: 10px;
            margin-bottom: 20px;
        }
        .editor-modified-notice .badge {
            padding: 4px 10px;
            background: var(--brand-primary);
            border-radius: 6px;
            color: white;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
        }
        .editor-modified-notice .text {
            flex: 1;
            font-size: 13px;
            color: var(--text-secondary);
        }
        .editor-modified-notice .reset-btn {
            padding: 8px 14px;
            background: rgba(239, 68, 68, 0.15);
            border: 1px solid rgba(239, 68, 68, 0.4);
            border-radius: 6px;
            color: #ef4444;
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s;
        }
        .editor-modified-notice .reset-btn:hover { background: rgba(239, 68, 68, 0.25); }
        
        /* Editor sections */
        .editor-section {
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 20px;
        }
        .editor-section-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 16px;
        }
        .editor-section-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .editor-section-title .icon { font-size: 16px; }
        .editor-section-actions {
            display: flex;
            gap: 8px;
        }
        
        /* Editor form elements */
        .editor-row {
            display: flex;
            gap: 16px;
            margin-bottom: 16px;
        }
        .editor-row:last-child { margin-bottom: 0; }
        .editor-field {
            flex: 1;
        }
        .editor-field.small { flex: 0 0 80px; }
        .editor-field.medium { flex: 0 0 160px; }
        .editor-label {
            display: block;
            font-size: 11px;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            font-weight: 600;
            margin-bottom: 6px;
        }
        .editor-input {
            width: 100%;
            padding: 10px 12px;
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            color: var(--text-primary);
            font-size: 14px;
            font-family: inherit;
            transition: border-color 0.15s;
        }
        .editor-input:focus { outline: none; border-color: var(--brand-primary); }
        .editor-input.icon-input {
            text-align: center;
            font-size: 20px;
        }
        .editor-input.color-input {
            padding: 4px;
            height: 42px;
            cursor: pointer;
        }
        .editor-select {
            width: 100%;
            padding: 10px 12px;
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            color: var(--text-primary);
            font-size: 14px;
            font-family: inherit;
            -webkit-appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 12px center;
            padding-right: 36px;
        }
        .editor-select:focus { outline: none; border-color: var(--brand-primary); }
        
        /* Subtypes list in editor */
        .subtypes-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 8px;
        }
        .subtype-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 10px;
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.15s;
        }
        .subtype-item:hover { border-color: var(--border-glow); }
        .subtype-item.selected { border-color: var(--brand-primary); background: rgba(76, 166, 234, 0.08); }
        .subtype-item-icon {
            width: 28px; height: 28px;
            border-radius: 6px;
            display: flex; align-items: center; justify-content: center;
            font-size: 14px;
            flex-shrink: 0;
            overflow: hidden;
        }
        .subtype-item-icon img {
            width: 20px; height: 20px;
            object-fit: contain;
        }
        .subtype-item-info { flex: 1; min-width: 0; overflow: hidden; }
        .subtype-item-name { font-size: 12px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .subtype-item-meta { display: none; }
        .subtype-item-actions {
            display: flex;
            gap: 4px;
            flex-shrink: 0;
        }
        .subtype-action-btn {
            width: 24px; height: 24px;
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 4px;
            color: var(--text-secondary);
            font-size: 11px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.15s;
        }
        .subtype-action-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); }
        .subtype-action-btn.danger:hover { color: var(--error); border-color: rgba(239,68,68,0.3); }
        
        /* Fields list in editor */
        .fields-config-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .field-config-item {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            padding: 14px;
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: 10px;
            transition: all 0.15s;
        }
        .field-config-item:hover { border-color: var(--border-glow); }
        .field-config-drag {
            width: 20px;
            color: var(--text-muted);
            font-size: 14px;
            cursor: grab;
            padding-top: 2px;
        }
        .field-config-main { flex: 1; }
        .field-config-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 8px;
        }
        .field-config-name {
            flex: 1;
            font-size: 14px;
            font-weight: 500;
            color: var(--text-primary);
        }
        .field-config-name input {
            width: 100%;
            padding: 6px 10px;
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 6px;
            color: var(--text-primary);
            font-size: 13px;
        }
        .field-config-name input:focus { outline: none; border-color: var(--brand-primary); }
        .field-config-type {
            font-size: 10px;
            padding: 3px 8px;
            background: rgba(139,92,246,0.15);
            color: #a78bfa;
            border-radius: 4px;
            text-transform: uppercase;
            font-weight: 600;
        }
        .field-config-required {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 11px;
            color: var(--text-muted);
        }
        .field-config-required input[type="checkbox"] {
            width: 16px; height: 16px;
            accent-color: var(--brand-primary);
        }
        .field-config-locked {
            font-size: 12px;
            padding: 2px 6px;
            background: rgba(245,158,11,0.15);
            border-radius: 4px;
            cursor: help;
        }
        .field-config-item input:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }
        .field-config-options {
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px solid var(--border-subtle);
        }
        .field-config-options-label {
            font-size: 10px;
            color: var(--text-muted);
            text-transform: uppercase;
            margin-bottom: 8px;
        }
        .field-options-list {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        .field-option-tag {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 5px 8px 5px 10px;
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 6px;
            font-size: 12px;
            color: var(--text-primary);
        }
        .field-option-remove {
            width: 16px; height: 16px;
            display: flex; align-items: center; justify-content: center;
            background: none;
            border: none;
            color: var(--text-muted);
            font-size: 12px;
            cursor: pointer;
            border-radius: 4px;
            transition: all 0.1s;
        }
        .field-option-remove:hover { background: rgba(239,68,68,0.2); color: var(--error); }
        .field-option-add {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 4px 8px;
            background: none;
            border: 1px dashed var(--border-subtle);
            border-radius: 6px;
            font-size: 12px;
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.15s;
        }
        .field-option-add:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
        .field-config-actions {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .field-delete-btn {
            width: 28px; height: 28px;
            background: none;
            border: 1px solid transparent;
            border-radius: 6px;
            color: var(--text-muted);
            font-size: 14px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.15s;
        }
        .field-delete-btn:hover { color: var(--error); border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.1); }
        
        /* Drag and drop reordering */
        .field-config-item[draggable="true"] {
            cursor: default;
        }
        .field-config-item.dragging {
            opacity: 0.5;
            border: 2px dashed var(--brand-primary);
            background: var(--bg-card);
        }
        .field-config-item.drag-over {
            border-top: 3px solid var(--brand-primary);
            margin-top: -2px;
            padding-top: 16px;
        }
        .field-config-item.drag-over-below {
            border-bottom: 3px solid var(--brand-primary);
            margin-bottom: -2px;
            padding-bottom: 16px;
        }
        .fields-config-list.drag-active .field-config-item {
            transition: transform 0.15s, border 0.15s, margin 0.15s, padding 0.15s;
        }
        .field-config-drag:active {
            cursor: grabbing;
        }
        
        /* Add field row */
        .add-field-row {
            display: flex;
            gap: 10px;
            padding: 12px;
            background: var(--bg-surface);
            border: 1px dashed var(--border-subtle);
            border-radius: 10px;
            margin-top: 12px;
        }
        .add-field-row input, .add-field-row select {
            flex: 1;
            padding: 10px 12px;
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 6px;
            color: var(--text-primary);
            font-size: 13px;
            font-family: inherit;
        }
        .add-field-row input:focus, .add-field-row select:focus { outline: none; border-color: var(--brand-primary); }
        .add-field-row select {
            -webkit-appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 10px center;
            padding-right: 30px;
        }
        .add-field-btn {
            padding: 10px 16px;
            background: var(--brand-primary);
            border: none;
            border-radius: 6px;
            color: white;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.15s;
        }
        .add-field-btn:hover { background: #3b8ac7; }
        
        /* Editor footer actions */
        .editor-footer {
            display: flex;
            gap: 12px;
            padding-top: 20px;
            border-top: 1px solid var(--border-subtle);
            margin-top: 20px;
        }
        .editor-btn {
            padding: 12px 20px;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            border: none;
            font-family: inherit;
            transition: all 0.15s;
        }
        .editor-btn.primary {
            background: var(--brand-primary);
            color: white;
        }
        .editor-btn.primary:hover { background: #3b8ac7; }
        .editor-btn.secondary {
            background: var(--bg-surface);
            color: var(--text-secondary);
            border: 1px solid var(--border-subtle);
        }
        .editor-btn.secondary:hover { background: var(--bg-card-hover); }
        .editor-btn.danger {
            background: rgba(239,68,68,0.1);
            color: var(--error);
            border: 1px solid rgba(239,68,68,0.3);
        }
        .editor-btn.danger:hover { background: rgba(239,68,68,0.2); }
        .editor-btn-spacer { flex: 1; }
        
        /* ═══════════════════════════════════════════════════════════════
           ICON LIBRARY & PICKER
           ═══════════════════════════════════════════════════════════════ */
        
        /* Icon picker trigger button */
        .icon-picker-trigger {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 14px;
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.15s;
            width: 100%;
        }
        .icon-picker-trigger:hover { border-color: var(--brand-primary); }
        .icon-picker-trigger .preview {
            width: 32px; height: 32px;
            border-radius: 6px;
            display: flex; align-items: center; justify-content: center;
            font-size: 18px;
            flex-shrink: 0;
        }
        .icon-picker-trigger .preview img {
            width: 28px; height: 28px;
            object-fit: contain;
        }
        .icon-picker-trigger .label {
            flex: 1;
            font-size: 13px;
            color: var(--text-secondary);
            text-align: left;
        }
        .icon-picker-trigger .change-btn {
            font-size: 11px;
            color: var(--brand-primary);
            font-weight: 600;
        }
        
        /* Icon picker modal */
        .icon-picker-modal {
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.8);
            backdrop-filter: blur(4px);
            z-index: 600;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        .icon-picker-modal.visible { display: flex; }
        
        .icon-picker-content {
            background: rgba(71, 85, 105, 0.95);
            backdrop-filter: blur(30px) saturate(180%);
            -webkit-backdrop-filter: blur(30px) saturate(180%);
            border: 1px solid var(--border-subtle);
            border-radius: 16px;
            width: 100%;
            max-width: 600px;
            max-height: 80vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: 0 20px 60px rgba(0,0,0,0.4);
        }
        
        .icon-picker-header {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-subtle);
            flex-shrink: 0;
        }
        .icon-picker-header h3 {
            flex: 1;
            font-size: 16px;
            font-weight: 500;
            color: var(--text-primary);
        }
        .icon-picker-close {
            width: 32px; height: 32px;
            background: rgba(100, 116, 139, 0.4);
            border: 1px solid var(--border-subtle);
            border-radius: 6px;
            color: #f9f9f9;
            cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            transition: all 0.2s;
        }
        .icon-picker-close:hover { background: rgba(100, 116, 139, 0.6); color: #ffffff; }
        
        .icon-picker-tabs {
            display: flex;
            gap: 4px;
            padding: 12px 20px;
            border-bottom: 1px solid var(--border-subtle);
            flex-shrink: 0;
            overflow-x: auto;
        }
        .icon-picker-tab {
            padding: 8px 14px;
            background: rgba(51, 65, 85, 0.5);
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.2s;
        }
        .icon-picker-tab:hover { border-color: var(--brand-primary); }
        .icon-picker-tab.active {
            background: rgba(76, 166, 234, 0.15);
            border-color: var(--brand-primary);
            color: var(--brand-primary);
        }
        
        .icon-picker-search {
            padding: 12px 20px;
            flex-shrink: 0;
        }
        .icon-picker-search input {
            width: 100%;
            padding: 10px 14px;
            background: rgba(51, 65, 85, 0.5);
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            color: var(--text-primary);
            font-size: 14px;
        }
        .icon-picker-search input:focus { 
            outline: none; 
            border-color: var(--brand-primary);
            box-shadow: 0 0 0 2px rgba(76, 166, 234, 0.2);
        }
        
        .icon-refresh-btn {
            width: 32px; height: 32px;
            background: rgba(100, 116, 139, 0.4);
            border: 1px solid var(--border-subtle);
            border-radius: 6px;
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 14px;
            display: flex; align-items: center; justify-content: center;
            transition: all 0.2s;
        }
        .icon-refresh-btn:hover { background: rgba(100, 116, 139, 0.6); color: var(--text-primary); }
        .icon-refresh-btn.loading { animation: spin 1s linear infinite; }
        
        .icon-picker-status {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 20px;
            background: rgba(51, 65, 85, 0.3);
            border-bottom: 1px solid var(--border-subtle);
            font-size: 12px;
            color: var(--text-secondary);
        }
        
        .icon-picker-grid {
            flex: 1;
            overflow-y: auto;
            padding: 12px 20px 20px;
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
            gap: 10px;
            align-content: start;
        }
        
        .icon-picker-item {
            aspect-ratio: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
            padding: 8px;
            background: var(--bg-surface);
            border: 2px solid transparent;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.15s;
        }
        .icon-picker-item:hover {
            background: var(--bg-card-hover);
            border-color: var(--border-subtle);
        }
        .icon-picker-item.selected {
            background: rgba(76, 166, 234, 0.12);
            border-color: var(--brand-primary);
        }
        .icon-picker-item img {
            width: 32px; height: 32px;
            object-fit: contain;
        }
        .icon-picker-item .emoji {
            font-size: 28px;
            line-height: 1;
        }
        .icon-picker-item .name {
            font-size: 9px;
            color: var(--text-muted);
            text-align: center;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        
        .icon-picker-footer {
            display: flex;
            gap: 12px;
            padding: 16px 20px;
            border-top: 1px solid var(--border-subtle);
            flex-shrink: 0;
        }
        .icon-picker-footer .selected-preview {
            display: flex;
            align-items: center;
            gap: 10px;
            flex: 1;
            padding: 8px 12px;
            background: var(--bg-surface);
            border-radius: 8px;
        }
        .icon-picker-footer .selected-preview img,
        .icon-picker-footer .selected-preview .emoji {
            width: 32px; height: 32px;
        }
        .icon-picker-footer .selected-preview .emoji { font-size: 24px; }
        .icon-picker-footer .selected-name {
            flex: 1;
            font-size: 13px;
            color: var(--text-primary);
        }
        
        /* Icon library loading state */
        .icon-picker-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 40px;
            color: var(--text-muted);
            gap: 12px;
        }
        .icon-picker-loading .spinner {
            width: 32px; height: 32px;
            border: 3px solid var(--border-subtle);
            border-top-color: var(--brand-primary);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        @keyframes spin { to { transform: rotate(360deg); } }
        
        /* Icon category badges */
        .icon-category-badge {
            font-size: 9px;
            padding: 2px 6px;
            border-radius: 4px;
            font-weight: 600;
            text-transform: uppercase;
        }
        .icon-category-badge.water { background: rgba(18,204,201,0.15); color: #12CCC9; }
        .icon-category-badge.sewer { background: rgba(9,189,69,0.15); color: #09BD45; }
        .icon-category-badge.storm { background: rgba(12,148,134,0.15); color: #0c9486; }
        .icon-category-badge.gas { background: rgba(222,24,210,0.15); color: #DE18D2; }
        .icon-category-badge.fire { background: rgba(123,36,24,0.15); color: #ef4444; }
        .icon-category-badge.electrical { background: rgba(219,154,0,0.15); color: #db9a00; }
        
        /* ═══════════════════════════════════════════════════════════════
           USER MANAGEMENT PANEL (Admin)
           ═══════════════════════════════════════════════════════════════ */
        .user-management-view {
            position: fixed; inset: 0;
            background: var(--bg-deep);
            z-index: 500;
            display: none;
            flex-direction: column;
        }
        .user-management-view.visible { display: flex; }
        
        .user-management-header {
            display: flex; align-items: center; gap: 12px;
            padding: 12px 20px; padding-top: calc(12px + var(--safe-top));
            background: var(--bg-surface);
            border-bottom: 1px solid var(--border-subtle);
            color: var(--text-primary); flex-shrink: 0;
        }
        .user-management-header .back-btn {
            width: 36px; height: 36px;
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            color: var(--text-primary); font-size: 18px; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
        }
        .user-management-header h2 { font-size: 17px; font-weight: 600; flex: 1; }
        
        .user-management-body {
            flex: 1;
            overflow-y: auto;
            padding: 16px 20px;
        }
        
        .user-add-section {
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 20px;
        }
        .user-add-section h4 {
            color: var(--text-primary);
            margin-bottom: 12px;
            font-size: 14px;
        }
        .user-add-row {
            display: flex;
            gap: 10px;
        }
        .user-add-row input {
            flex: 1;
            padding: 10px 14px;
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            color: var(--text-primary);
            font-size: 14px;
        }
        .user-add-row input:focus {
            outline: none;
            border-color: var(--brand-primary);
        }
        .user-add-row select {
            padding: 10px 14px;
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            color: var(--text-primary);
            font-size: 14px;
            min-width: 100px;
        }
        .user-add-btn {
            padding: 10px 16px;
            background: var(--brand-accent);
            border: none;
            border-radius: 8px;
            color: white;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            white-space: nowrap;
        }
        .user-add-btn:hover { opacity: 0.9; }
        
        .user-list-section h4 {
            color: var(--text-primary);
            margin-bottom: 12px;
            font-size: 14px;
        }
        .user-list {
            border: 1px solid var(--border-subtle);
            border-radius: 12px;
            background: var(--bg-card);
            overflow: hidden;
        }
        .user-list-empty {
            padding: 30px 20px;
            text-align: center;
            color: var(--text-muted);
            font-size: 13px;
        }
        .user-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 14px 16px;
            border-bottom: 1px solid var(--border-subtle);
        }
        .user-item:last-child { border-bottom: none; }
        .user-item-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            color: white;
            font-weight: 600;
        }
        .user-item-info {
            flex: 1;
            min-width: 0;
        }
        .user-item-email {
            color: var(--text-primary);
            font-size: 14px;
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .user-item-role {
            font-size: 12px;
            color: var(--text-secondary);
            margin-top: 2px;
        }
        .user-item-role.admin { color: var(--brand-accent); }
        .user-item-role.editor { color: var(--brand-primary); }
        .user-item-role.collector { color: #F59E0B; }
        .user-item-role.viewer { color: var(--text-muted); }
        .user-item-actions {
            display: flex;
            gap: 8px;
        }
        .user-item-btn {
            width: 32px;
            height: 32px;
            border-radius: 6px;
            border: 1px solid var(--border-subtle);
            background: var(--bg-surface);
            color: var(--text-secondary);
            font-size: 14px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .user-item-btn:hover { background: var(--bg-card); }
        .user-item-btn.delete { color: #ef4444; }
        .user-item-btn.delete:hover { background: rgba(239, 68, 68, 0.1); }
        
        /* Mobile responsive */
        @media (max-width: 768px) {
            .layer-config-body { flex-direction: column; }
            .layer-config-sidebar { 
                width: 100%; 
                min-width: unset;
                max-height: 40vh;
                border-right: none;
                border-bottom: 1px solid var(--border-subtle);
            }
            .layer-config-editor { padding: 16px; }
            .editor-row { flex-direction: column; gap: 12px; }
            .editor-field.small, .editor-field.medium { flex: 1; }
        }
        
        /* Legacy compatibility */
        .layer-config-content {
            flex: 1;
            overflow-y: auto;
            padding: 16px;
            -webkit-overflow-scrolling: touch;
        }
        .layer-config-item {
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 12px;
            padding: 12px;
            margin-bottom: 12px;
        }
        .layer-config-item-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 8px;
        }
        .layer-config-icon {
            width: 36px; height: 36px;
            border-radius: 8px;
            display: flex; align-items: center; justify-content: center;
            font-size: 18px;
        }
        .layer-config-title {
            flex: 1;
            font-weight: 600;
            font-size: 14px;
            color: var(--text-primary);
        }
        .layer-config-folder {
            font-size: 11px;
            color: var(--text-muted);
            font-family: 'JetBrains Mono', monospace;
        }
        .layer-config-fields {
            font-size: 12px;
            color: var(--text-secondary);
            margin-top: 6px;
        }
        .layer-config-actions {
            display: flex;
            gap: 8px;
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px solid var(--border-subtle);
        }
        .layer-config-btn {
            padding: 6px 12px;
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: 6px;
            color: var(--text-primary);
            font-size: 12px;
            cursor: pointer;
        }
        .layer-config-btn:active { background: var(--bg-card-hover); }
        .layer-config-btn.danger { color: var(--error); border-color: rgba(239,68,68,0.3); }
        .layer-config-badge {
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 4px;
            background: rgba(76, 166, 234, 0.12);
            color: var(--brand-primary);
        }
        .layer-config-badge.custom {
            background: rgba(34,197,94,0.15);
            color: var(--success);
        }
        
        /* ═══════════════════════════════════════════════════════════════
           PASSWORD MODAL
           ═══════════════════════════════════════════════════════════════ */
        .modal-overlay {
            position: fixed; inset: 0;
            background: rgba(0,0,0,0.7);
            z-index: 600;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        .modal-overlay.visible { display: flex; }
        
        .modal-content {
            background: var(--bg-card-solid);
            border: 1px solid var(--border-subtle);
            border-radius: 16px;
            padding: 24px;
            width: 100%;
            max-width: 320px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.5);
        }
        .modal-title {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .modal-subtitle {
            font-size: 13px;
            color: var(--text-secondary);
            margin-bottom: 20px;
        }
        .modal-input {
            width: 100%;
            padding: 12px 14px;
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            color: var(--text-primary);
            font-size: 14px;
            font-family: inherit;
            margin-bottom: 16px;
        }
        .modal-input:focus {
            outline: none;
            border-color: var(--brand-primary);
        }
        .modal-input.error {
            border-color: var(--error);
        }
        .modal-error {
            color: var(--error);
            font-size: 12px;
            margin-top: -12px;
            margin-bottom: 12px;
            display: none;
        }
        .modal-error.visible { display: block; }
        .modal-buttons {
            display: flex;
            gap: 10px;
        }
        .modal-btn {
            flex: 1;
            padding: 12px;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            border: none;
            font-family: inherit;
        }
        .modal-btn.cancel {
            background: var(--bg-surface);
            color: var(--text-secondary);
            border: 1px solid var(--border-subtle);
        }
        .modal-btn.confirm {
            background: var(--brand-primary);
            color: white;
        }
        
        /* ═══════════════════════════════════════════════════════════════
           LAYER EDITOR MODAL
           ═══════════════════════════════════════════════════════════════ */
        .layer-editor-modal {
            max-width: 400px;
            max-height: 80vh;
            overflow-y: auto;
        }
        .layer-editor-section {
            margin-bottom: 16px;
        }
        .layer-editor-section label {
            display: block;
            font-size: 12px;
            color: var(--text-secondary);
            margin-bottom: 6px;
            font-weight: 500;
        }
        .layer-editor-row {
            display: flex;
            gap: 10px;
        }
        .layer-editor-row .modal-input {
            margin-bottom: 0;
        }
        .icon-picker {
            width: 50px;
            text-align: center;
            font-size: 20px;
            cursor: pointer;
        }
        .color-picker {
            width: 50px;
            height: 44px;
            padding: 4px;
            cursor: pointer;
        }
        .fields-list {
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            padding: 8px;
            margin-bottom: 10px;
            max-height: 150px;
            overflow-y: auto;
        }
        .field-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 8px;
            background: var(--bg-card);
            border-radius: 6px;
            margin-bottom: 6px;
            font-size: 12px;
        }
        .field-item:last-child { margin-bottom: 0; }
        .field-item .field-name { flex: 1; color: var(--text-primary); }
        .field-item .field-type { color: var(--text-muted); font-size: 10px; }
        .field-item .remove-field {
            width: 20px; height: 20px;
            background: none; border: none;
            color: var(--error);
            cursor: pointer;
            font-size: 14px;
        }
        .add-field-row {
            display: flex;
            gap: 8px;
        }
        .add-field-row input, .add-field-row select {
            flex: 1;
            padding: 8px;
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: 6px;
            color: var(--text-primary);
            font-size: 12px;
        }
        .add-field-btn {
            padding: 8px 12px;
            background: var(--brand-primary);
            border: none;
            border-radius: 6px;
            color: white;
            font-size: 12px;
            cursor: pointer;
        }
        
        /* ═══════════════════════════════════════════════════════════════
           TOAST - Portal Frosted Glass
           ═══════════════════════════════════════════════════════════════ */
        .toast {
            position: fixed; bottom: calc(70px + var(--safe-bottom)); left: 50%;
            transform: translateX(-50%) translateY(20px); 
            background: rgba(71, 85, 105, 0.95);
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
            border: 1px solid var(--border-subtle);
            color: var(--text-primary);
            padding: 12px 20px; border-radius: 10px; font-size: 13px; z-index: 600;
            opacity: 0; transition: all 0.3s; max-width: 85%; text-align: center; pointer-events: none;
            box-shadow: 0 8px 32px rgba(0,0,0,0.4);
        }
        .toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
        
        /* ═══════════════════════════════════════════════════════════════
           PWA INSTALL PROMPT
           ═══════════════════════════════════════════════════════════════ */
        .install-prompt {
            position: fixed;
            bottom: calc(20px + var(--safe-bottom));
            left: 16px;
            right: 16px;
            background: rgba(30, 41, 59, 0.95);
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
            border: 1px solid var(--border-subtle);
            border-radius: 16px;
            padding: 16px;
            z-index: 550;
            box-shadow: 0 8px 32px rgba(0,0,0,0.5);
            display: none;
        }
        .install-prompt.visible { display: block; animation: slideUp 0.3s ease; }
        @keyframes slideUp {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .install-prompt-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 12px;
        }
        .install-prompt-icon {
            width: 44px;
            height: 44px;
            border-radius: 10px;
            background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 22px;
        }
        .install-prompt-title {
            font-size: 15px;
            font-weight: 600;
            color: var(--text-primary);
        }
        .install-prompt-subtitle {
            font-size: 12px;
            color: var(--text-secondary);
            margin-top: 2px;
        }
        .install-prompt-steps {
            font-size: 13px;
            color: var(--text-secondary);
            line-height: 1.5;
            margin-bottom: 12px;
        }
        .install-prompt-steps strong {
            color: var(--text-primary);
        }
        .install-prompt-dismiss {
            width: 100%;
            padding: 10px;
            background: rgba(71, 85, 105, 0.5);
            border: none;
            border-radius: 8px;
            color: var(--text-primary);
            font-size: 14px;
            font-family: inherit;
            cursor: pointer;
        }
        .install-prompt-dismiss:active { opacity: 0.8; }
        
        /* ═══════════════════════════════════════════════════════════════
           LOADING SCREEN - Portal Design
           ═══════════════════════════════════════════════════════════════ */
        .loading-overlay { 
            position: fixed; inset: 0; 
            background: var(--bg-deep); 
            z-index: 1000; 
            display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; 
        }
        .loading-overlay.hidden { display: none; }
        .loading-logo { 
            display: flex; align-items: center; gap: 10px;
        }
        .loading-logo img { height: 40px; }
        .loading-logo span { font-size: 24px; font-weight: 500; color: var(--brand-primary); letter-spacing: 0.02em; }
        .loading-spinner { 
            width: 36px; height: 36px; 
            border: 3px solid var(--border-subtle); 
            border-top-color: var(--brand-accent); 
            border-radius: 50%; 
            animation: spin 1s linear infinite; 
        }
        @keyframes spin { to { transform: rotate(360deg); } }
        .loading-status { color: var(--text-secondary); font-size: 13px; }
        
        /* ═══════════════════════════════════════════════════════════════
           BASEMAP PICKER
           ═══════════════════════════════════════════════════════════════ */
        .basemap-modal {
            position: fixed; inset: 0; background: rgba(0,0,0,0.6);
            z-index: 500; display: none; align-items: flex-end; justify-content: center;
            padding: 20px;
        }
        .basemap-modal.visible { display: flex; }
        .basemap-content {
            background: rgba(30, 41, 59, 0.95);
            backdrop-filter: blur(20px);
            border: 1px solid var(--border-subtle);
            border-radius: 16px;
            padding: 20px;
            width: 100%; max-width: 400px;
            animation: slideUp 0.2s ease;
        }
        @keyframes slideUp { from { transform: translateY(20px); opacity: 0; } }
        .basemap-header {
            display: flex; justify-content: space-between; align-items: center;
            margin-bottom: 16px;
        }
        .basemap-header h3 { font-size: 16px; font-weight: 500; color: var(--text-primary); }
        .basemap-close {
            background: none; border: none; color: #f9f9f9;
            font-size: 20px; cursor: pointer; padding: 4px;
        }
        .basemap-close:hover { color: #ffffff; }
        .basemap-grid {
            display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
        }
        .basemap-option {
            background: var(--bg-surface);
            border: 2px solid var(--border-subtle);
            border-radius: 12px;
            padding: 8px;
            cursor: pointer;
            transition: all 0.2s;
            text-align: center;
        }
        .basemap-option:hover { border-color: var(--brand-primary); }
        .basemap-option.active {
            border-color: var(--brand-accent);
            background: rgba(72, 200, 178, 0.1);
        }
        .basemap-option img {
            width: 100%; aspect-ratio: 1;
            border-radius: 8px; object-fit: cover;
            margin-bottom: 6px;
        }
        .basemap-option span {
            font-size: 11px; color: var(--text-secondary);
            display: block;
        }
        
        /* ═══════════════════════════════════════════════════════════════
           BOOKMARKS PANEL
           ═══════════════════════════════════════════════════════════════ */
        .bookmarks-panel {
            position: fixed; top: calc(var(--header-height) + var(--safe-top) + 8px);
            right: 8px; width: 280px; max-height: 60vh;
            background: rgba(30, 41, 59, 0.95);
            backdrop-filter: blur(20px);
            border: 1px solid var(--border-subtle);
            border-radius: 12px;
            z-index: 200;
            display: none; flex-direction: column;
            box-shadow: 0 8px 32px rgba(0,0,0,0.3);
        }
        .bookmarks-panel.visible { display: flex; }
        .bookmarks-header {
            display: flex; justify-content: space-between; align-items: center;
            padding: 12px 14px;
            border-bottom: 1px solid var(--border-subtle);
        }
        .bookmarks-header h3 { font-size: 14px; font-weight: 500; color: var(--text-primary); }
        .bookmarks-header button {
            background: none; border: none; color: #f9f9f9;
            cursor: pointer; font-size: 16px; padding: 2px;
        }
        .bookmarks-header button:hover { color: #ffffff; }
        .bookmarks-list {
            flex: 1; overflow-y: auto; padding: 8px;
            -webkit-overflow-scrolling: touch;
        }
        .bookmark-item {
            display: flex; align-items: center; gap: 10px;
            padding: 10px 12px;
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            margin-bottom: 6px;
            cursor: pointer;
            transition: all 0.2s;
        }
        .bookmark-item:hover { border-color: var(--brand-primary); }
        .bookmark-item .icon { font-size: 18px; }
        .bookmark-item .info { flex: 1; min-width: 0; }
        .bookmark-item .name {
            font-size: 13px; font-weight: 500; color: var(--text-primary);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .bookmark-item .date { font-size: 11px; color: var(--text-muted); }
        .bookmark-item .delete {
            background: none; border: none; color: var(--text-muted);
            cursor: pointer; font-size: 14px; padding: 4px;
            opacity: 0; transition: opacity 0.2s;
        }
        .bookmark-item:hover .delete { opacity: 1; }
        .bookmark-item .delete:hover { color: var(--error); }
        .bookmarks-empty {
            padding: 20px; text-align: center;
            color: var(--text-muted); font-size: 13px;
        }
        .bookmarks-actions {
            padding: 8px 12px;
            border-top: 1px solid var(--border-subtle);
        }
        .add-bookmark-btn {
            width: 100%;
            background: linear-gradient(135deg, #5eb8d4, #3b8ac7);
            border: none; border-radius: 8px;
            color: white; font-size: 13px; font-weight: 500;
            padding: 10px; cursor: pointer;
            transition: all 0.2s;
        }
        .add-bookmark-btn:hover { box-shadow: 0 4px 12px rgba(76, 166, 234, 0.3); }
        
        /* ═══════════════════════════════════════════════════════════════
           LEGEND PANEL
           ═══════════════════════════════════════════════════════════════ */
        .legend-panel {
            position: fixed; top: calc(var(--header-height) + var(--safe-top) + 8px);
            left: 8px; width: 240px; max-height: 70vh;
            background: rgba(30, 41, 59, 0.95);
            backdrop-filter: blur(20px);
            border: 1px solid var(--border-subtle);
            border-radius: 12px;
            z-index: 200;
            display: none; flex-direction: column;
            box-shadow: 0 8px 32px rgba(0,0,0,0.3);
        }
        .legend-panel.visible { display: flex; }
        .legend-header {
            display: flex; justify-content: space-between; align-items: center;
            padding: 12px 14px;
            border-bottom: 1px solid var(--border-subtle);
        }
        .legend-header h3 { font-size: 14px; font-weight: 500; color: var(--text-primary); }
        .legend-header button {
            background: none; border: none; color: #f9f9f9;
            cursor: pointer; font-size: 16px; padding: 2px;
        }
        .legend-header button:hover { color: #ffffff; }
        .legend-content {
            flex: 1; overflow-y: auto; padding: 12px;
            -webkit-overflow-scrolling: touch;
        }
        .legend-section {
            margin-bottom: 16px;
        }
        .legend-section-title {
            font-size: 11px; font-weight: 600; color: var(--text-muted);
            text-transform: uppercase; letter-spacing: 0.5px;
            margin-bottom: 8px;
        }
        .legend-item {
            display: flex; align-items: center; gap: 8px;
            padding: 4px 0;
        }
        .legend-item .swatch {
            width: 20px; height: 20px;
            border-radius: 4px;
            display: flex; align-items: center; justify-content: center;
            font-size: 12px;
        }
        .legend-item .swatch img {
            width: 16px; height: 16px; object-fit: contain;
        }
        .legend-item .label {
            font-size: 12px; color: var(--text-secondary);
        }
        
        /* ═══════════════════════════════════════════════════════════════
           MEASURE TOOL
           ═══════════════════════════════════════════════════════════════ */
        .measure-toolbar {
            position: fixed;
            bottom: calc(20px + var(--safe-bottom));
            left: 50%; transform: translateX(-50%);
            background: rgba(30, 41, 59, 0.95);
            backdrop-filter: blur(20px);
            border: 1px solid var(--border-subtle);
            border-radius: 12px;
            padding: 10px 16px;
            display: none; align-items: center; gap: 12px;
            z-index: 200;
            box-shadow: 0 8px 32px rgba(0,0,0,0.3);
        }
        .measure-toolbar.visible { display: flex; }
        .measure-info {
            font-size: 14px; font-weight: 500; color: var(--text-primary);
            min-width: 100px;
        }
        .measure-info small {
            display: block; font-size: 11px; color: var(--text-muted);
            font-weight: 400;
        }
        .measure-btn {
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            color: var(--text-primary);
            padding: 8px 12px;
            font-size: 12px;
            cursor: pointer;
            transition: all 0.2s;
        }
        .measure-btn:hover { background: rgba(100, 116, 139, 0.4); }
        .measure-btn.active {
            background: rgba(72, 200, 178, 0.2);
            border-color: var(--brand-accent);
            color: var(--brand-accent);
        }
        .measure-btn.danger { color: var(--error); }
        .measure-btn.danger:hover { background: rgba(239, 68, 68, 0.15); }
        
        /* ═══════════════════════════════════════════════════════════════
           SETTINGS PANEL
           ═══════════════════════════════════════════════════════════════ */
        .settings-panel {
            position: fixed; top: calc(var(--header-height) + var(--safe-top) + 8px);
            right: 8px; width: 300px; max-height: 70vh;
            background: rgba(30, 41, 59, 0.95);
            backdrop-filter: blur(20px);
            border: 1px solid var(--border-subtle);
            border-radius: 12px;
            z-index: 200;
            display: none; flex-direction: column;
            box-shadow: 0 8px 32px rgba(0,0,0,0.3);
        }
        .settings-panel.visible { display: flex; }
        .settings-header {
            display: flex; justify-content: space-between; align-items: center;
            padding: 12px 14px;
            border-bottom: 1px solid var(--border-subtle);
        }
        .settings-header h3 { font-size: 14px; font-weight: 500; color: var(--text-primary); }
        .settings-header button {
            background: none; border: none; color: #f9f9f9;
            cursor: pointer; font-size: 16px; padding: 2px;
        }
        .settings-header button:hover { color: #ffffff; }
        .settings-content {
            flex: 1; overflow-y: auto; padding: 12px;
            -webkit-overflow-scrolling: touch;
        }
        .settings-section {
            margin-bottom: 16px;
        }
        .settings-section-title {
            font-size: 11px; font-weight: 600; color: var(--text-muted);
            text-transform: uppercase; letter-spacing: 0.5px;
            margin-bottom: 10px;
        }
        .setting-row {
            display: flex; align-items: center; justify-content: space-between;
            padding: 10px 12px;
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            margin-bottom: 8px;
        }
        .setting-row .setting-info {
            flex: 1;
        }
        .setting-row .setting-label {
            font-size: 13px; font-weight: 500; color: var(--text-primary);
        }
        .setting-row .setting-desc {
            font-size: 11px; color: var(--text-muted); margin-top: 2px;
        }
        .setting-row .setting-value {
            font-size: 12px; color: var(--brand-accent);
            margin-left: 8px;
        }
        /* Toggle Switch (for JS-controlled toggles without input element) */
        .toggle-switch-js {
            position: relative;
            width: 44px; height: 24px;
            background: var(--bg-deep);
            border-radius: 12px;
            cursor: pointer;
            transition: background 0.2s;
            flex-shrink: 0;
        }
        .toggle-switch-js.active {
            background: var(--brand-accent);
        }
        .toggle-switch-js::after {
            content: '';
            position: absolute;
            top: 2px; left: 2px;
            width: 20px; height: 20px;
            background: white;
            border-radius: 50%;
            transition: transform 0.2s;
            box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        }
        .toggle-switch-js.active::after {
            transform: translateX(20px);
        }
        
        /* Settings Logout Button */
        .settings-logout-btn {
            width: 100%;
            padding: 12px 16px;
            background: rgba(239, 68, 68, 0.15);
            border: 1px solid rgba(239, 68, 68, 0.3);
            border-radius: 8px;
            color: #ef4444;
            font-size: 14px;
            font-weight: 500;
            font-family: inherit;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: all 0.2s ease;
        }
        .settings-logout-btn:hover {
            background: rgba(239, 68, 68, 0.25);
            border-color: rgba(239, 68, 68, 0.5);
        }
        .settings-logout-btn:active {
            transform: scale(0.98);
        }
        
        /* ═══════════════════════════════════════════════════════════════
           TABLE EDITOR (Desktop Only) - Bottom Panel Layout
           ═══════════════════════════════════════════════════════════════ */
        
        /* When table editor is open, adjust layout */
        .app-container.table-open .map-area {
            flex: 1 1 auto;
            min-height: 15vh;
            max-height: calc(100vh - 200px);
        }
        .app-container.table-open .table-editor-panel {
            display: flex !important;
            flex: 0 0 auto;
        }
        
        .table-editor-panel {
            display: none;
            flex-direction: column;
            height: 55vh;
            min-height: 200px;
            max-height: 85vh;
            background: #0f172a;
            position: relative;
            z-index: 100;
            border-top: 3px solid var(--brand-primary);
        }
        
        /* Resize handle at top */
        .table-resize-handle {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 8px;
            background: var(--brand-primary);
            cursor: ns-resize;
            z-index: 110;
            transition: background 0.15s;
        }
        .table-resize-handle:hover {
            background: #3b9ae0;
        }
        .table-resize-handle::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 40px;
            height: 4px;
            background: rgba(255,255,255,0.4);
            border-radius: 2px;
        }
        
        .table-editor-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 20px;
            padding-top: 14px; /* Account for resize handle */
            background: #1e293b;
            border-bottom: 1px solid #334155;
            gap: 16px;
            flex-shrink: 0;
        }
        .table-editor-title {
            font-size: 16px;
            font-weight: 600;
            color: #f1f5f9;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .table-editor-actions {
            display: flex;
            gap: 8px;
            align-items: center;
        }
        .table-editor-btn {
            padding: 8px 16px;
            border-radius: 6px;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            border: 1px solid #475569;
            background: #334155;
            color: #f1f5f9;
            transition: all 0.15s;
        }
        /* DEC539: added batch controls remain reachable in a narrow desktop/tablet panel. */
        .table-editor-header { flex-wrap: wrap; }
        .table-editor-header .table-editor-actions { flex: 1 1 420px; min-width: 0; overflow-x: auto; padding: 2px 0; }
        .table-editor-header .table-editor-btn { flex: 0 0 auto; min-height: 44px; white-space: nowrap; }
        .table-editor-btn:hover { background: #475569; }
        .table-editor-btn.primary {
            background: var(--brand-primary);
            border-color: var(--brand-primary);
            color: white;
        }
        .table-editor-btn.primary:hover { background: #3b9ae0; }
        .table-editor-btn.danger {
            background: #7f1d1d;
            border-color: #991b1b;
            color: #fecaca;
        }
        .table-editor-btn.danger:hover { background: #991b1b; }
        .table-editor-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        
        .table-editor-toolbar {
            display: flex;
            align-items: center;
            padding: 10px 20px;
            background: #1e293b;
            border-bottom: 1px solid #334155;
            gap: 12px;
            flex-wrap: wrap;
            flex-shrink: 0;
        }
        .table-editor-search {
            flex: 1;
            min-width: 200px;
            padding: 8px 12px;
            border-radius: 6px;
            border: 1px solid #475569;
            background: #0f172a;
            color: #f1f5f9;
            font-size: 13px;
        }
        .table-editor-search:focus {
            outline: none;
            border-color: var(--brand-primary);
        }
        .table-editor-filter {
            padding: 8px 12px;
            border-radius: 6px;
            border: 1px solid #475569;
            background: #0f172a;
            color: #f1f5f9;
            font-size: 13px;
        }
        .table-editor-stats {
            font-size: 12px;
            color: #94a3b8;
        }
        
        .table-editor-container {
            flex: 1;
            overflow: auto;
            background: #0f172a;
        }
        .table-editor-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
        }
        .table-editor-table th {
            position: sticky;
            top: 0;
            background: #1e293b;
            padding: 10px 12px;
            text-align: left;
            font-weight: 600;
            color: #94a3b8;
            border-bottom: 2px solid #334155;
            cursor: pointer;
            user-select: none;
            white-space: nowrap;
        }
        .table-editor-table th:hover { background: #334155; }
        .table-editor-table th.sorted-asc::after { content: ' ▲'; font-size: 10px; }
        .table-editor-table th.sorted-desc::after { content: ' ▼'; font-size: 10px; }
        
        .table-editor-table td {
            padding: 8px 12px;
            border-bottom: 1px solid #1e293b;
            color: #e2e8f0;
            max-width: 200px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .table-editor-table tr { cursor: pointer; background: #0f172a; }
        .table-editor-table tr:hover { background: #1e293b; }
        .table-editor-table tr.selected { 
            background: #1e3a5f !important;
            box-shadow: inset 4px 0 0 var(--brand-primary);
        }
        .table-editor-table tr.selected td {
            background: #1e3a5f;
            border-bottom-color: #2d4a6f;
        }
        .table-editor-table tr.selected td:first-child {
            border-left: 4px solid var(--brand-primary);
        }
        .table-editor-table tr.selected:hover { 
            background: #234876 !important; 
        }
        .table-editor-table tr.selected:hover td {
            background: #234876;
        }
        
        .table-editor-table td.editable {
            cursor: text;
            background: rgba(71, 85, 105, 0.2);
        }
        .table-editor-table td.editable:focus-visible { outline: 2px solid #75e3d0; outline-offset: -2px; }
        .table-editor-table td.editable:hover {
            background: rgba(71, 85, 105, 0.4);
        }
        .table-editor-table td.editing {
            padding: 4px 8px;
            background: #1e293b;
        }
        .table-editor-table td.editing input,
        .table-editor-table td.editing select {
            width: 100%;
            padding: 4px 8px;
            border: 1px solid var(--brand-primary);
            border-radius: 4px;
            background: #0f172a;
            color: #f1f5f9;
            font-size: 13px;
        }
        
        /* DEC537: explicit cell actions remain usable by touch and keyboard. */
        .table-editor-table td.editing { min-width: 190px; }
        .table-editor-table td.editing input,
        .table-editor-table td.editing select { min-height: 44px; font-size: 16px; }
        .table-editor-table td.editing button {
            min-height: 44px; min-width: 64px; margin: 6px 6px 0 0; padding: 8px 12px;
            border: 1px solid #64748b; border-radius: 6px; background: #24394d; color: #f1f5f9;
        }
        .table-editor-table td.editing button:focus-visible { outline: 2px solid #75e3d0; outline-offset: 2px; }
        .table-editor-table td.editing button:disabled { opacity: .6; }
        .table-editor-table td.editing [role="status"] { display: block; max-width: 320px; white-space: normal; font-size: 13px; line-height: 1.4; }

        .table-cell-icon {
            width: 24px;
            height: 24px;
            object-fit: contain;
        }
        
        .table-editor-checkbox {
            width: 18px;
            height: 18px;
            cursor: pointer;
            accent-color: var(--brand-primary);
        }
        
        .table-editor-empty {
            padding: 60px 20px;
            text-align: center;
            color: #64748b;
        }
        
        /* Bulk Edit Modal */
        .bulk-edit-modal {
            position: fixed;
            top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            background: #1e293b;
            border: 1px solid #475569;
            border-radius: 12px;
            padding: 24px;
            min-width: 320px;
            max-width: 450px;
            z-index: 2100;
            display: none;
            box-shadow: 0 20px 40px rgba(0,0,0,0.5);
        }
        .bulk-edit-modal { box-sizing: border-box; min-width: 0; width: min(450px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; }
        .bulk-edit-field input, .bulk-edit-field select, .bulk-edit-buttons button { min-height: 44px; }
        .bulk-edit-modal.visible { display: block; }
        .bulk-edit-backdrop {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.7);
            z-index: 2050;
            display: none;
        }
        .bulk-edit-backdrop.visible { display: block; }
        .bulk-edit-title {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 16px;
            color: #f1f5f9;
        }
        .bulk-edit-field {
            margin-bottom: 12px;
        }
        .bulk-edit-field label {
            display: block;
            font-size: 12px;
            color: #94a3b8;
            margin-bottom: 4px;
        }
        .bulk-edit-field select,
        .bulk-edit-field input {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid #475569;
            border-radius: 6px;
            background: #0f172a;
            color: #f1f5f9;
            font-size: 13px;
        }
        .bulk-edit-buttons {
            display: flex;
            gap: 8px;
            margin-top: 20px;
            justify-content: flex-end;
        }
        
        .bulk-edit-field input, .bulk-edit-field select { font-size: 16px; }

        /* Attribute Editor Panel (Right Side) */
        .attr-editor-panel {
            position: fixed;
            top: 0;
            right: 0;
            width: 380px;
            height: 100%;
            background: #1e293b;
            z-index: 2100;
            display: none;
            flex-direction: column;
            border-left: 2px solid var(--brand-primary);
            box-shadow: -4px 0 20px rgba(0,0,0,0.3);
        }
        .attr-editor-panel.visible { display: flex; }
        .attr-editor-header {
            padding: 16px 20px;
            background: #0f172a;
            border-bottom: 1px solid #334155;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
        }
        .attr-editor-title {
            font-size: 14px;
            font-weight: 600;
            color: #f1f5f9;
        }
        .attr-editor-subtitle {
            font-size: 11px;
            color: #64748b;
            margin-top: 2px;
        }
        .attr-editor-close {
            background: none;
            border: none;
            color: #f9f9f9;
            font-size: 24px;
            cursor: pointer;
            padding: 4px 8px;
            line-height: 1;
        }
        .attr-editor-close:hover { color: #ffffff; }
        .attr-editor-content {
            flex: 1;
            overflow-y: auto;
            padding: 16px 20px;
        }
        .attr-editor-section {
            margin-bottom: 20px;
        }
        .attr-editor-section-title {
            font-size: 11px;
            font-weight: 600;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 12px;
            padding-bottom: 8px;
            border-bottom: 1px solid #334155;
        }
        .attr-editor-field {
            margin-bottom: 14px;
        }
        .attr-editor-field label {
            display: block;
            font-size: 12px;
            font-weight: 500;
            color: #94a3b8;
            margin-bottom: 6px;
        }
        .attr-editor-field input,
        .attr-editor-field select,
        /* DEC538: native attribute controls fit touch input without changing stored precision. */
        .attr-editor-field input, .attr-editor-field select { min-height: 44px; font-size: 16px; }
        .attr-editor-actions .table-editor-btn { min-height: 44px; }
        .attr-editor-field textarea {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #475569;
            border-radius: 6px;
            background: #0f172a;
            color: #f1f5f9;
            font-size: 13px;
            font-family: inherit;
        }
        .attr-editor-field textarea {
            min-height: 80px;
            resize: vertical;
        }
        .attr-editor-field input:focus,
        .attr-editor-field select:focus,
        .attr-editor-field textarea:focus {
            outline: none;
            border-color: var(--brand-primary);
        }
        .attr-editor-field-readonly {
            padding: 10px 12px;
            background: #1e293b;
            border-radius: 6px;
            color: #94a3b8;
            font-size: 13px;
        }
        .attr-editor-actions {
            padding: 16px 20px;
            background: #0f172a;
            border-top: 1px solid #334155;
            display: flex;
            gap: 8px;
            flex-shrink: 0;
        }
        .attr-editor-actions .table-editor-btn {
            flex: 1;
        }

/* DEC528: persistent observation guidance stays readable after a value is entered. */
#fieldOpsRoot .field-form-help { margin: 6px 0 0; color: #bacbd6; font-size: 13px; line-height: 1.5; }

/* DEC544: template storage feedback stays separate from cloud synchronization. */
.schema-local-status { margin: 0; padding: 8px 16px; color: #e2e8f0; background: #132433; font-size: 13px; line-height: 1.5; }
.schema-local-status:empty { display: none; }

/* DEC545: expose stable data keys and keyboard/touch alternatives to dragging fields. */
.field-config-key { color: #a9c0ce; font-size: 12px; overflow-wrap: anywhere; }
.field-order-btn { min-width: 44px; min-height: 44px; border: 1px solid #64748b; border-radius: 6px; background: #24394d; color: #eef5fa; }
.field-order-btn:focus-visible { outline: 2px solid #75e3d0; outline-offset: 2px; }
.field-order-btn:disabled { opacity: .4; }

/* DEC547: persistent collection feedback remains readable inside the scrolling form. */
.field-collection-status { padding:12px; border:1px solid #eab36b; border-radius:10px; color:#ffe2ba; background:#342919; font-size:14px; line-height:1.5; overflow-wrap:anywhere; }
.field-collection-status[hidden] { display:none; }
#dynamicFormFields [aria-invalid="true"] { border-color:#f6b37a; outline:1px solid #f6b37a; }

/* DEC550: placement history is secondary to the explicit accuracy limitation. */
.field-placement-summary { margin-top:4px; color:var(--text-secondary, #d4dce5); font-size:12px; line-height:1.4; overflow-wrap:anywhere; }

/* DEC553: scope gets its own row so counts and storage status retain room on a phone. */
#syncPanel .sync-summary { flex-wrap:wrap; gap:4px 12px; }
#fieldRecordScope { flex-basis:100%; color:var(--text-primary); font-weight:600; }
