.search-page {
            min-height: calc(100vh - 73px);
            background: var(--color-bg);
        }
        
        .search-header {
            background:
                radial-gradient(135% 120% at 50% -10%, rgba(59,168,168,0.28) 0%, rgba(59,168,168,0) 55%),
                linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
            padding: 4.5rem var(--space-6) 3.5rem;
            position: relative;
            z-index: 10;
        }
        .search-header::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
            opacity: 0.5;
        }
        .search-header > * {
            position: relative;
            z-index: 1;
        }
        
        .search-box {
            max-width: 700px;
            margin: 0 auto;
        }
        
        .search-input-wrap {
            display: flex;
            gap: var(--space-2);
            background: white;
            border: 2px solid var(--color-border);
            border-radius: var(--radius-lg);
            padding: var(--space-1);
        }
        
        .search-input-wrap:focus-within {
            border-color: var(--color-primary);
        }
        
        .search-input {
            flex: 1;
            width: 100%;          /* fill .autocomplete-container (which isn't a flex parent, so flex:1 alone did nothing → input stayed ~214px and text was cut off on desktop) */
            border: none;
            background: transparent;
            padding: var(--space-3) var(--space-4);
            font-size: 1rem;
            color: var(--color-text);
        }
        
        .search-input:focus {
            outline: none;
        }
        
        .search-btn {
            padding: var(--space-3) var(--space-6);
            background: var(--color-primary);
            color: white;
            border: none;
            border-radius: var(--radius);
            font-weight: 600;
            cursor: pointer;
        }
        
        .search-btn:hover {
            background: var(--color-primary-dark);
        }
        
        /* Autocomplete dropdown */
        .autocomplete-container {
            position: relative;
        }
        
        .autocomplete-dropdown {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: var(--color-surface);
            border: 1px solid var(--color-border);
            border-radius: var(--radius);
            box-shadow: var(--shadow-md);
            z-index: 100;
            max-height: 300px;
            overflow-y: auto;
            display: none;
        }
        
        .autocomplete-dropdown.show {
            display: block;
        }
        
        .autocomplete-item {
            padding: var(--space-3) var(--space-4);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: var(--space-2);
        }
        
        .autocomplete-item:hover,
        .autocomplete-item.selected {
            background: var(--color-surface-alt);
        }
        
        .autocomplete-item .type-badge {
            font-size: 0.7rem;
            padding: 2px 6px;
            border-radius: var(--radius-sm);
            background: var(--color-primary);
            color: white;
            opacity: 0.8;
        }
        
        .autocomplete-item .type-badge.dev-type {
            background: var(--color-accent);
        }
        
        .filters {
            display: flex;
            gap: var(--space-4);
            margin-top: var(--space-4);
            flex-wrap: wrap;
            justify-content: center;
        }
        
        .filter-group {
            display: flex;
            align-items: center;
            gap: var(--space-2);
        }
        
        /* Fix Font Awesome icon positioning in filters */
        .filter-group i.fa-solid,
        .filter-field-label i.fa-solid {
            position: static !important;
            display: inline !important;
            margin-right: 0.25rem;
        }
        
        /* Fix all icons inside buttons */
        .btn i.fa-solid,
        button i.fa-solid {
            position: static !important;
            display: inline !important;
            margin-right: 0.25rem;
        }
        
        /* Time buttons */
        .time-buttons {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-bottom: 1rem;
        }
        
        .time-btn {
            padding: 0.4rem 0.75rem;
            border: 1px solid var(--color-border);
            border-radius: var(--radius);
            background: var(--color-bg);
            color: var(--color-text);
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.15s;
        }

        .time-btn:hover {
            border-color: var(--color-primary);
            background: var(--color-surface-alt);
        }

        .time-btn.active {
            background: var(--color-primary);
            border-color: var(--color-primary);
            color: white;
            font-weight: 600;
        }
        
        
        .filter-label {
            font-size: 0.8125rem;
            color: var(--color-text-muted);
        }
        
        .filter-select {
            padding: var(--space-2) var(--space-3);
            border: 1px solid var(--color-border);
            border-radius: var(--radius);
            font-size: 0.875rem;
            background: white;
        }
        
        /* Filter autocomplete inputs */
        .filter-autocomplete {
            position: relative;
        }
        
        .filter-autocomplete input {
            padding: var(--space-2) var(--space-3);
            padding-right: 28px;
            border: 1px solid var(--color-border);
            border-radius: var(--radius);
            font-size: 0.875rem;
            background: white;
            width: 140px;
            transition: border-color 0.15s;
        }
        
        .filter-autocomplete input:focus {
            outline: none;
            border-color: var(--color-primary);
        }
        
        .filter-autocomplete input.has-value {
            background: var(--color-primary-bg);
            border-color: var(--color-primary);
        }
        
        .filter-autocomplete .clear-btn {
            position: absolute;
            right: 6px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: var(--color-text-muted);
            cursor: pointer;
            padding: 2px 6px;
            font-size: 0.75rem;
            display: none;
        }
        
        .filter-autocomplete .clear-btn:hover {
            color: var(--color-text);
        }
        
        .filter-autocomplete input.has-value + .clear-btn {
            display: block;
        }
        
        /* Multi-select Filter Styles */
        .multi-select-container {
            display: flex;
            flex-direction: column;
            gap: var(--space-2);
        }
        
        .multi-select-wrapper {
            position: relative;
            min-width: 200px;
        }
        
        .multi-select-input-area {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            padding: 6px 8px;
            border: 1px solid var(--color-border);
            border-radius: var(--radius);
            background: white;
            min-height: 38px;
            cursor: text;
            transition: border-color 0.15s;
        }
        
        .multi-select-input-area:focus-within {
            border-color: var(--color-primary);
        }
        
        .multi-select-input-area.has-selections {
            background: #f8fafc;
        }
        
        .multi-select-pill {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 3px 8px;
            background: var(--color-primary);
            color: white;
            border-radius: var(--radius-full);
            font-size: 0.8rem;
            font-weight: 500;
            white-space: nowrap;
            animation: pill-pop 0.15s ease-out;
        }
        
        @keyframes pill-pop {
            0% { transform: scale(0.8); opacity: 0; }
            100% { transform: scale(1); opacity: 1; }
        }
        
        .multi-select-pill.authority { background: #3b82f6; }
        .multi-select-pill.dev-type { background: var(--color-accent); }
        .multi-select-pill.lifecycle { background: #8b5cf6; }
        .multi-select-pill.app-type { background: #f59e0b; }
        
        .multi-select-pill .remove-pill {
            background: none;
            border: none;
            color: rgba(255,255,255,0.8);
            cursor: pointer;
            padding: 0;
            font-size: 1rem;
            line-height: 1;
            margin-left: 2px;
        }
        
        .multi-select-pill .remove-pill:hover {
            color: white;
        }
        
        .multi-select-input {
            flex: 1;
            border: none;
            background: transparent;
            outline: none;
            font-size: 0.875rem;
            min-width: 80px;
            padding: 2px 4px;
        }
        
        .multi-select-input::placeholder {
            color: var(--color-text-muted);
        }
        
        .multi-select-dropdown {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: var(--color-surface);
            border: 1px solid var(--color-border);
            border-radius: var(--radius);
            box-shadow: var(--shadow-lg);
            z-index: 100;
            max-height: 280px;
            overflow-y: auto;
            display: none;
            margin-top: 4px;
        }
        
        .multi-select-dropdown.show {
            display: block;
        }
        
        .multi-select-dropdown-item {
            padding: 10px 12px;
            cursor: pointer;
            font-size: 0.875rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: background 0.1s;
        }
        
        .multi-select-dropdown-item:hover {
            background: var(--color-surface-alt);
        }
        
        .multi-select-dropdown-item.selected {
            background: rgba(34, 197, 94, 0.15);
            cursor: pointer;
        }
        
        .multi-select-dropdown-item.selected::after {
            content: '✓';
            color: #22c55e;
            font-weight: 600;
            margin-left: auto;
        }
        
        .multi-select-dropdown-item.highlighted {
            background: var(--color-surface-alt);
        }
        
        /* Hide the old check-icon, use ::after instead */
        .multi-select-dropdown-item .check-icon {
            display: none;
        }
        
        .multi-select-dropdown-item .count {
            font-size: 0.75rem;
            color: var(--color-text-muted);
        }
        
        .multi-select-clear {
            background: none;
            border: none;
            color: var(--color-text-muted);
            cursor: pointer;
            padding: 4px;
            font-size: 0.75rem;
            white-space: nowrap;
        }
        
        .multi-select-clear:hover {
            color: var(--color-text);
            text-decoration: underline;
        }
        
        /* Filter bar below dark hero */
        .search-filters {
            background: var(--color-surface);
            border-bottom: 1px solid var(--color-border);
            padding: var(--space-4) var(--space-6);
        }
        .search-filters-inner {
            max-width: 700px;
            margin: 0 auto;
        }

        /* Filter row layout for multi-selects */
        .filters-advanced {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: var(--space-4);
            margin-top: var(--space-4);
            padding: var(--space-4);
            background: var(--color-surface-alt);
            border-radius: var(--radius-lg);
            border: 1px solid var(--color-border-light);
        }
        
        .filter-field {
            display: flex;
            flex-direction: column;
            gap: var(--space-2);
        }
        
        .filter-field-label {
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.03em;
            color: var(--color-text-muted);
        }
        
        @media (max-width: 768px) {
            .filters-advanced {
                grid-template-columns: 1fr;
            }
        }
        
        .filter-dropdown {
            position: absolute;
            top: 100%;
            left: 0;
            min-width: 200px;
            background: var(--color-surface);
            border: 1px solid var(--color-border);
            border-radius: var(--radius);
            box-shadow: var(--shadow-md);
            z-index: 100;
            max-height: 250px;
            overflow-y: auto;
            display: none;
        }
        
        .filter-dropdown.show {
            display: block;
        }
        
        .filter-dropdown-item {
            padding: var(--space-2) var(--space-3);
            cursor: pointer;
            font-size: 0.875rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .filter-dropdown-item:hover,
        .filter-dropdown-item.selected {
            background: var(--color-surface-alt);
        }
        
        .filter-dropdown-item .count {
            font-size: 0.75rem;
            color: var(--color-text-muted);
        }
        
        .date-pills {
            display: flex;
            gap: var(--space-1);
        }
        
        .date-pill {
            padding: var(--space-2) var(--space-3);
            border: 1px solid var(--color-border);
            border-radius: var(--radius-full);
            font-size: 0.8125rem;
            background: var(--color-surface);
            cursor: pointer;
            transition: all 0.15s;
        }
        
        .date-pill:hover {
            border-color: var(--color-primary);
        }
        
        .date-pill.active {
            background: var(--color-primary);
            color: white;
            border-color: var(--color-primary);
        }
        
        .results-area {
            max-width: 820px;
            margin: 0 auto;
            padding: var(--space-6);
        }
        
        .results-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: var(--space-4);
        }
        
        .results-list {
            background: #ffffff;
            border: 1px solid var(--color-border);
            border-radius: var(--radius-lg);
            overflow: hidden;
        }

        .result-item {
            display: block;
            padding: var(--space-3) var(--space-4);
            border-bottom: 1px solid var(--color-border-light);
            cursor: pointer;
            transition: background 0.15s;
            text-decoration: none;
            color: inherit;
        }
        
        .result-item:hover {
            background: var(--color-surface-alt);
        }
        
        .result-item:last-child {
            border-bottom: none;
        }
        
        .result-item.highlighted {
            background: rgba(20, 184, 166, 0.15);
            border-left: 3px solid var(--color-primary);
            animation: highlight-pulse 2s ease-out;
        }
        
        @keyframes highlight-pulse {
            0% { background: rgba(20, 184, 166, 0.3); }
            100% { background: rgba(20, 184, 166, 0.15); }
        }
        
        .result-ref {
            font-family: var(--font-mono);
            font-weight: 600;
            color: var(--color-primary);
        }
        
        .result-authority {
            font-size: 0.8125rem;
            color: var(--color-text-muted);
        }
        
        /* Editorial badges — tint background + colored ink, sharp corners (mirrors application.html) */
        .dev-type-badge {
            font-size: 0.6875rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            padding: 2px 8px;
            border-radius: var(--radius);
            background: var(--color-success-bg);
            color: var(--color-accent-dark);
        }

        .app-type-badge {
            font-size: 0.6875rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            padding: 2px 8px;
            border-radius: var(--radius);
            background: var(--color-surface-alt);
            color: var(--color-text-secondary);
            border: 1px solid var(--color-border);
        }

        .lifecycle-badge {
            display: inline-block;
            padding: 0.2em 0.6em;
            font-size: 0.7rem;
            font-weight: 700;
            border-radius: var(--radius);
            text-transform: uppercase;
            letter-spacing: 0.06em;
            background: var(--color-surface-alt);
            color: var(--color-text);
        }
        .lifecycle-badge.active { background: var(--color-success-bg); color: var(--color-success); }
        .lifecycle-badge.lapsed { background: var(--color-surface-alt); color: var(--color-text-muted); }
        .lifecycle-badge.pending { background: var(--color-surface-alt); color: var(--color-text); }
        .lifecycle-badge.overdue { background: var(--color-danger-bg); color: var(--color-danger); }
        .lifecycle-badge.refused { background: var(--color-danger-bg); color: var(--color-danger); }
        .lifecycle-badge.withdrawn { background: var(--color-surface-alt); color: var(--color-text-muted); }
        .lifecycle-badge.invalid { background: var(--color-warning-bg); color: var(--color-warning); }
        .lifecycle-badge.dormant { background: var(--color-surface-alt); color: var(--color-text-muted); }

        /* Unified single status badge (replaces lifecycle-badge + meta status dot duplication) */
        .status-badge {
            display: inline-block; padding: 0.2em 0.6em; font-size: 0.7rem; font-weight: 700;
            border-radius: var(--radius); text-transform: uppercase; letter-spacing: 0.06em;
            background: var(--color-surface-alt); color: var(--color-text);
        }
        .status-badge.granted { background: var(--color-success-bg); color: var(--color-success); }
        .status-badge.refused { background: var(--color-danger-bg); color: var(--color-danger); }
        .status-badge.pending { background: var(--color-surface-alt); color: var(--color-text); }
        .status-badge.info { background: var(--color-warning-bg); color: var(--color-warning); }
        .status-badge.appeal { background: var(--color-primary); color: #fff; }
        .status-badge.other { background: var(--color-surface-alt); color: var(--color-text-muted); }

        /* Results sort control */
        .results-sort { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; color: var(--color-text-muted); }
        .results-sort select { font: inherit; font-size: 0.8125rem; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 5px 8px; background: #fff; color: var(--color-text); cursor: pointer; }

        /* Loading skeleton for searches (~2s, no index yet) */
        .skel-row { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border-light); }
        .skel-line { height: 12px; border-radius: 4px; margin: 7px 0; background: linear-gradient(90deg,#eef1f0 25%,#e2e7e5 37%,#eef1f0 63%); background-size: 400% 100%; animation: skel 1.2s ease-in-out infinite; }
        .skel-badges { width: 40%; } .skel-title { width: 55%; height: 16px; } .skel-desc { width: 85%; }
        @keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

        .property-details {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: var(--space-2);
            background: #f7f8f8;
            padding: var(--space-3);
            border: 1px solid var(--color-border-light);
            border-radius: var(--radius);
        }
        
        .property-detail-item {
            display: flex;
            flex-direction: column;
        }
        
        .property-detail-label {
            font-size: 0.75rem;
            color: var(--color-text-muted);
        }
        
        .property-detail-value {
            font-weight: 500;
        }
        
        .timeline {
            position: relative;
            padding-left: var(--space-6);
        }
        
        .timeline::before {
            content: '';
            position: absolute;
            left: 8px;
            top: 4px;
            bottom: 4px;
            width: 2px;
            background: var(--color-border);
        }
        
        .timeline-item {
            position: relative;
            padding-bottom: var(--space-3);
        }
        
        .timeline-item::before {
            content: '';
            position: absolute;
            left: calc(-1 * var(--space-6) + 4px);
            top: 6px;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: var(--color-border);
        }
        
        .timeline-item.completed::before {
            background: var(--color-success);
        }

        .timeline-item.current::before {
            background: var(--color-accent);
            box-shadow: 0 0 0 3px rgba(45, 139, 139, 0.25);
        }

        .timeline-item.future::before {
            background: var(--color-border);
            border: 2px dashed var(--color-text-muted);
        }
        
        .timeline-date {
            font-size: 0.8125rem;
            color: var(--color-text-muted);
        }
        
        .timeline-label {
            font-weight: 500;
        }
        
        /* PPR Timeline (accent) */
        #detail-ppr-timeline::before {
            background: var(--color-accent);
        }

        #detail-ppr-timeline .timeline-item::before {
            background: var(--color-accent);
        }

        #detail-ppr-timeline .timeline-item {
            cursor: pointer;
        }

        #detail-ppr-timeline .timeline-item:hover {
            background: var(--color-surface-alt);
            margin: 0 calc(-1 * var(--space-2));
            padding-left: var(--space-2);
            padding-right: var(--space-2);
            border-radius: var(--radius);
        }
        
        .ppr-price {
            font-weight: 600;
            color: var(--color-accent);
        }
        
        /* PPR Sale Modal */
        .ppr-modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 2000;
            backdrop-filter: blur(4px);
        }
        
        .ppr-modal-overlay.active {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: var(--space-4);
        }
        
        .ppr-modal {
            background: var(--color-surface);
            border-radius: var(--radius-lg);
            max-width: 500px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
        }
        
        .ppr-modal-header {
            padding: var(--space-5);
            border-bottom: 1px solid var(--color-border);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        
        .ppr-modal-title {
            font-size: 1.25rem;
            font-weight: 600;
            color: var(--color-accent);
            display: flex;
            align-items: center;
            gap: var(--space-2);
        }
        
        .ppr-modal-close {
            background: none;
            border: none;
            font-size: 1.5rem;
            color: var(--color-text-muted);
            cursor: pointer;
            padding: var(--space-2);
            line-height: 1;
        }
        
        .ppr-modal-close:hover {
            color: var(--color-text);
        }
        
        .ppr-modal-body {
            padding: var(--space-5);
        }
        
        .ppr-detail-row {
            display: flex;
            padding: var(--space-3) 0;
            border-bottom: 1px solid var(--color-border-light);
        }
        
        .ppr-detail-row:last-child {
            border-bottom: none;
        }
        
        .ppr-detail-label {
            width: 120px;
            flex-shrink: 0;
            font-size: 0.875rem;
            color: var(--color-text-muted);
        }
        
        .ppr-detail-value {
            flex: 1;
            font-size: 0.9375rem;
            color: var(--color-text);
        }
        
        .ppr-price-large {
            font-size: 2rem;
            font-weight: 700;
            color: var(--color-accent);
            margin-bottom: var(--space-4);
        }
        
        .ppr-modal-footer {
            padding: var(--space-4) var(--space-5);
            border-top: 1px solid var(--color-border);
            background: var(--color-background);
            border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        }
        
        .appeal-section {
            background: var(--color-surface);
            border: 1px solid var(--color-border);
            border-left: 3px solid var(--color-danger);
            border-radius: var(--radius);
            padding: var(--space-4);
        }

        .appeal-section .detail-section-title {
            color: var(--color-danger);
        }
        
        .area-info {
            display: flex;
            gap: var(--space-4);
            font-size: 0.875rem;
            color: var(--color-text-muted);
            margin-top: var(--space-1);
        }
        
        .area-info i {
            color: var(--color-primary);
            margin-right: var(--space-1);
        }
        
        .result-title {
            font-family: var(--font-body);
            font-size: 1rem;
            font-weight: 600;
            color: var(--color-text);
            margin: var(--space-1) 0 2px;
            line-height: 1.3;
        }

        .result-desc {
            color: var(--color-text-secondary);
            font-size: 0.875rem;
            line-height: 1.45;
            margin: 2px 0 var(--space-1);
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        .plan-ref-link {
            color: var(--color-accent-dark);
            text-decoration: none;
            font-weight: 600;
            background: var(--color-success-bg);
            padding: 0.1em 0.3em;
            border-radius: var(--radius);
        }
        .plan-ref-link:hover {
            text-decoration: underline;
        }
        .abp-ref-link {
            color: var(--color-danger);
            text-decoration: none;
            font-weight: 600;
            background: var(--color-danger-bg);
            padding: 0.1em 0.3em;
            border-radius: var(--radius);
        }
        .abp-ref-link:hover {
            text-decoration: underline;
        }
        
        .result-meta {
            display: flex;
            align-items: center;
            gap: var(--space-3);
            font-size: 0.75rem;
            color: var(--color-text-muted);
            flex-wrap: wrap;
        }
        
        .status-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            display: inline-block;
            margin-right: var(--space-1);
        }
        
        .status-granted { background: #22c55e; }
        .status-refused { background: #ef4444; }
        .status-pending { background: #3b82f6; }
        .status-fi { background: #eab308; }

        .invalid-date {
            font-style: italic;
            color: var(--color-text-muted);
        }
        .status-other { background: #a1a1aa; }
        
        .empty-state {
            text-align: center;
            padding: var(--space-6) var(--space-16) var(--space-16);
            color: var(--color-text-muted);
        }
        
        .empty-icon {
            font-size: 3rem;
            margin-bottom: var(--space-4);
        }
        
        /* Detail Panel */
        .detail-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.5);
            z-index: 200;
            opacity: 0;
            visibility: hidden;
            transition: all 0.2s;
        }
        
        .detail-overlay.open {
            opacity: 1;
            visibility: visible;
        }
        
        .detail-panel {
            position: fixed;
            top: 60px;
            right: 0;
            bottom: 0;
            width: 100%;
            max-width: 550px;
            background: #ffffff;
            z-index: 201;
            transform: translateX(100%);
            transition: transform 0.3s ease;
            overflow-y: auto;
        }
        
        .detail-overlay.open .detail-panel {
            transform: translateX(0);
        }
        
        .detail-header {
            padding: var(--space-6);
            border-bottom: 2px solid var(--color-text);
            position: sticky;
            top: 0;
            background: #ffffff;
            z-index: 10;
        }
        
        .detail-close {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            border: none;
            background: var(--color-surface-alt);
            cursor: pointer;
            font-size: 1.25rem;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--color-text-muted);
        }
        .detail-close:hover {
            background: var(--color-border);
            color: var(--color-text);
        }
        
        .detail-ref {
            font-family: var(--font-mono);
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--color-primary);
        }
        
        .detail-body {
            padding: var(--space-6);
        }
        
        .detail-section {
            margin-bottom: var(--space-6);
        }
        
        .detail-section-title {
            font-family: var(--font-body);
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: var(--color-text);
            margin-bottom: var(--space-3);
            padding-bottom: var(--space-2);
            border-bottom: 1px solid var(--color-border);
        }
        
        .detail-row {
            display: flex;
            justify-content: space-between;
            padding: var(--space-3) 0;
            border-bottom: 1px solid var(--color-border-light);
        }
        
        .detail-row:last-child { border-bottom: none; }
        
        .detail-label { color: var(--color-text-muted); }
        .detail-value { font-weight: 500; text-align: right; max-width: 60%; }
        
        .detail-actions {
            padding: var(--space-6);
            border-top: 1px solid var(--color-border);
            background: #ffffff;
            display: flex;
            gap: var(--space-3);
        }
        
        .detail-actions .btn { flex: 1; }

        .report-error-link {
            display: block;
            margin-top: var(--space-3);
            font-size: 0.8125rem;
            color: var(--color-text-muted);
            text-decoration: none;
            cursor: pointer;
            text-align: center;
            padding: 0 var(--space-6) var(--space-4);
        }
        .report-error-link:hover { color: var(--color-accent); }
        .report-error-link i { margin-right: var(--space-1); }

        /* Report Error Modal */
        .report-error-overlay {
            display: none; position: fixed; inset: 0;
            background: rgba(0,0,0,0.5); z-index: 9999;
            justify-content: center; align-items: center;
        }
        .report-error-overlay.active { display: flex; }
        .report-error-modal {
            background: var(--color-surface); border-radius: var(--radius-lg, 12px);
            width: 90%; max-width: 480px; max-height: 90vh;
            overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.2);
        }
        .report-error-modal-header {
            display: flex; justify-content: space-between; align-items: center;
            padding: var(--space-4) var(--space-4) 0;
        }
        .report-error-modal-header h3 { margin: 0; font-size: 1.125rem; }
        .report-error-modal-close {
            background: none; border: none; font-size: 1.5rem;
            cursor: pointer; color: var(--color-text-muted); line-height: 1;
        }
        .report-error-modal-body { padding: var(--space-4); }
        .report-error-modal-body label {
            display: block; font-size: 0.8125rem; font-weight: 600;
            margin-bottom: var(--space-1); color: var(--color-text);
        }
        .report-error-modal-body .input,
        .report-error-modal-body select,
        .report-error-modal-body textarea {
            width: 100%; margin-bottom: var(--space-3); padding: 8px 12px;
            border: 1px solid var(--color-border); border-radius: var(--radius);
            font-size: 0.875rem; font-family: inherit;
            background: var(--color-bg); color: var(--color-text); box-sizing: border-box;
        }
        .report-error-modal-body textarea { resize: vertical; min-height: 100px; }
        .report-error-modal-footer {
            padding: 0 var(--space-4) var(--space-4);
            display: flex; gap: var(--space-2); justify-content: flex-end;
        }
        .report-error-modal-footer .btn-primary {
            padding: 8px 20px; border: none; border-radius: var(--radius);
            background: var(--color-accent); color: #fff; font-size: 0.875rem;
            cursor: pointer; font-weight: 600;
        }
        .report-error-modal-footer .btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
        .report-error-modal-footer .btn-secondary {
            padding: 8px 20px; border: 1px solid var(--color-border);
            border-radius: var(--radius); background: transparent;
            color: var(--color-text); font-size: 0.875rem; cursor: pointer;
        }

        .upgrade-banner {
            background: linear-gradient(135deg, #f0fdfa 0%, #ecfeff 100%);
            border: 1px solid var(--color-primary);
            border-radius: var(--radius-lg);
            padding: var(--space-6);
            text-align: center;
            margin-top: var(--space-8);
        }
        
        @media (max-width: 640px) {
            .filters { flex-direction: column; align-items: stretch; }
            .filter-group { justify-content: space-between; }
            .detail-panel { max-width: 100%; overflow-x: hidden; }
            .results-area { padding: var(--space-2); }
            .result-item { padding: var(--space-3); }
            .multi-select-wrapper { min-width: 0; }
            .search-header { padding: var(--space-5) var(--space-3) var(--space-4); }
        }
        
        .search-counter {
            display: flex;
            align-items: center;
            gap: var(--space-3);
            padding: var(--space-3) var(--space-4);
            background: var(--color-info-bg);
            border-radius: var(--radius);
            font-size: 0.875rem;
            margin-bottom: var(--space-4);
        }
        .search-counter i { color: var(--color-info); }
        .search-counter a { 
            margin-left: auto; 
            color: var(--color-primary);
            font-weight: 500;
        }
        .search-counter.warning {
            background: var(--color-warning-bg);
        }
        .search-counter.warning i { color: var(--color-warning); }
        
        .search-limit-warning {
            display: flex;
            align-items: center;
            gap: var(--space-3);
            padding: var(--space-3) var(--space-4);
            background: #fef3c7;
            border: 1px solid #f59e0b;
            border-radius: var(--radius);
            font-size: 0.875rem;
            margin-bottom: var(--space-4);
        }
        .search-limit-warning i { color: #f59e0b; }
        .search-limit-warning a { 
            margin-left: auto; 
            color: var(--color-primary);
            font-weight: 500;
            white-space: nowrap;
        }
        
        .upgrade-panel {
            background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
            border: 1px solid var(--color-primary);
            border-radius: var(--radius-lg);
            margin-bottom: var(--space-4);
        }
        
        .search-box.disabled .search-input,
        .search-box.disabled .search-btn,
        .search-box.disabled .time-btn,
        .search-box.disabled .multi-select-input,
        .search-box.disabled .multi-select-input-area,
        .search-box.disabled .multi-select-wrapper,
        .search-box.disabled .filter-select,
        .search-box.disabled .filter-autocomplete,
        .search-box.disabled select,
        .search-box.disabled input,
        .search-box.disabled button:not(.search-limit-warning a) {
            opacity: 0.5;
            pointer-events: none;
        }
        
        .pagination {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: var(--space-4);
            padding: var(--space-6) 0;
            border-top: 1px solid var(--color-border);
            margin-top: var(--space-4);
        }
        
        .export-info {
            display: flex;
            align-items: center;
            gap: var(--space-3);
            padding: var(--space-3) var(--space-4);
            background: var(--color-surface-alt);
            border-radius: var(--radius);
            font-size: 0.8125rem;
            margin-bottom: var(--space-4);
            border: 1px solid var(--color-border-light);
        }
        .export-info i { color: var(--color-accent); }
        .export-info a { 
            margin-left: auto; 
            color: var(--color-primary);
            font-weight: 500;
        }
        .export-info.disabled {
            background: var(--color-warning-bg);
            border-color: var(--color-warning);
        }
        .export-info.disabled i { color: var(--color-warning); }
        
        .btn-sm {
            padding: var(--space-2) var(--space-3);
            font-size: 0.8125rem;
        }
        
        /* Hide Leaflet attribution/logo outside of map containers */
        .leaflet-control-attribution,
        .leaflet-control-container {
            display: none !important;
        }
        #detail-map .leaflet-control-attribution,
        #detail-map .leaflet-control-container {
            display: block !important;
        }
    
    /* .nav-login-link is defined once in theme.css (the canonical green button).
       The old override here made the home/search page's login button a different
       size + colour to every other page — removed for consistency. */

    /* ===== Search-first homepage ===== */
    /* Pricing / rate-limit UI stripped for now — search is the hook */
    #search-limit-warning, #search-counter, #upgrade-panel, #upgrade-banner { display: none !important; }

    /* Pristine homepage: don't reserve a full viewport (was leaving a big gap above the footer) */
    .search-page.pristine { min-height: auto; }

    .home-hero { transition: padding 0.25s ease; }
    .hero-intro { text-align: center; max-width: 820px; margin: 0 auto var(--space-7); }
    .hero-tagline {
        font-family: var(--font-display);
        color: #fff;
        font-size: 2.25rem;
        line-height: 1.2;
        letter-spacing: -0.01em;
        margin: 0 0 var(--space-3);
    }
    .hero-trust { color: rgba(255,255,255,0.7); font-size: 0.95rem; margin: 0; letter-spacing: 0.01em; }

    .search-input-wrap { align-items: center; }
    .search-input-icon { color: var(--color-text-muted); font-size: 1.05rem; margin-left: var(--space-3); }

    /* ===== Tabs attached to the box ===== */
    .search-box { max-width: 820px; margin: 0 auto; }
    .search-tabs { display: flex; gap: 3px; padding-left: 6px; }
    .stab {
        font-size: 0.8125rem; color: rgba(255,255,255,0.7);
        background: rgba(255,255,255,0.08); border: none;
        border-radius: 8px 8px 0 0; padding: 8px 14px; cursor: pointer;
        display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-body);
    }
    .stab:hover { color: #fff; background: rgba(255,255,255,0.14); }
    .stab.active { color: var(--color-text); background: #fff; font-weight: 500; }
    /* box connects under the tabs (square the top-left so the first/active tab joins) */
    .search-tabs + .autocomplete-container .search-input-wrap { border-radius: 0 8px 8px 8px; }
    .search-use-loc {
        background: none; border: 1px solid var(--color-border-secondary); color: var(--color-accent);
        font-size: 0.78rem; border-radius: 6px; padding: 6px 9px; cursor: pointer; white-space: nowrap;
        display: inline-flex; align-items: center; gap: 5px; margin-right: 4px;
    }
    .search-use-loc:hover { border-color: var(--color-accent); }
    .search-use-loc .ul-text { white-space: nowrap; }

    /* under-box tools */
    .search-undertools { display: flex; align-items: center; gap: var(--space-4); margin-top: var(--space-4); padding-left: 2px; }
    .undertool-btn {
        background: none; border: none; color: rgba(255,255,255,0.78); cursor: pointer;
        font-size: 0.8125rem; font-family: var(--font-body); display: inline-flex; align-items: center; gap: 6px; padding: 2px 0;
    }
    .undertool-btn:hover { color: #fff; }
    .undertool-count {
        background: var(--color-accent); color: #fff; font-size: 0.68rem; font-weight: 600;
        min-width: 1.05rem; height: 1.05rem; padding: 0 0.3rem; border-radius: var(--radius-full);
        display: inline-flex; align-items: center; justify-content: center;
    }

    /* hero dropdowns (filters / save alert) */
    .hero-dropdown {
        max-width: 820px; margin: var(--space-2) auto 0; background: #fff;
        border: 1px solid var(--color-border); border-radius: var(--radius-lg);
        padding: var(--space-4); text-align: left; box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    }
    .hfd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-3); }
    .hfd-empty { font-size: 0.8125rem; color: var(--color-text-muted); }
    .hfd-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--color-surface-alt); color: var(--color-accent-dark); border-radius: var(--radius-full); font-size: 0.8125rem; padding: 3px 10px; }
    .hfd-chip button { background: none; border: none; color: inherit; cursor: pointer; font-size: 0.9rem; line-height: 1; opacity: 0.7; padding: 0; }
    .hfd-chip button:hover { opacity: 1; }
    .hfd-add { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
    .hfd-add-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); }
    /* Custom multi-select (Narrow by) — styled to match the autocomplete dropdown, with ticks */
    .ms-row { position: relative; }
    .ms-trigger { width: 100%; display: flex; align-items: center; gap: 8px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 10px 13px; font: inherit; font-size: 0.9375rem; color: var(--color-text-secondary); cursor: pointer; }
    .ms-trigger:hover, .ms-trigger.open { border-color: var(--color-accent); }
    .ms-caret { margin-left: auto; font-size: 0.7rem; color: var(--color-text-muted); transition: transform 0.15s; }
    .ms-trigger.open .ms-caret { transform: rotate(180deg); }
    .ms-trig-count { background: var(--color-accent); color: #fff; font-size: 0.7rem; font-weight: 600; border-radius: var(--radius-full); min-width: 1.1rem; height: 1.1rem; padding: 0 0.3rem; display: inline-flex; align-items: center; justify-content: center; }
    .ms-trig-count + .ms-caret { margin-left: 6px; }
    .ms-pop { border: 1px solid var(--color-border); border-radius: var(--radius); margin-top: 4px; background: #fff; overflow: hidden; box-shadow: var(--shadow-sm); }
    .ms-search { width: 100%; border: none; border-bottom: 1px solid var(--color-border-light); padding: 10px 13px; font: inherit; font-size: 0.9375rem; outline: none; box-sizing: border-box; }
    .ms-list { max-height: 240px; overflow-y: auto; }
    .ms-opt { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: none; padding: 11px 14px; font: inherit; font-size: 0.9375rem; color: var(--color-text); cursor: pointer; text-align: left; }
    .ms-opt:hover { background: var(--color-surface-alt); }
    .ms-tick { font-size: 0.8rem; color: var(--color-accent); opacity: 0; flex-shrink: 0; width: 14px; text-align: center; }
    .ms-opt.sel .ms-tick { opacity: 1; }
    .ms-opt.sel { font-weight: 500; color: var(--color-accent-dark); }
    .ms-empty { padding: 14px; text-align: center; color: var(--color-text-muted); font-size: 0.875rem; }
    /* ticks in the main-box autocomplete (Authority tab multi-select) */
    .autocomplete-item .ac-check { margin-left: auto; color: var(--color-accent); opacity: 0; }
    .autocomplete-item.sel .ac-check { opacity: 1; }
    .autocomplete-item.sel span { font-weight: 500; }
    .hfd-title { font-size: 0.95rem; font-weight: 500; color: var(--color-text); }
    .hfd-sub { font-size: 0.8125rem; color: var(--color-text-muted); margin: 2px 0 var(--space-3); }
    .hfd-input { width: 100%; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 10px 12px; font-size: 0.9rem; font-family: var(--font-body); box-sizing: border-box; margin-bottom: var(--space-3); }
    .hfd-freq { display: flex; gap: 6px; margin-bottom: var(--space-4); flex-wrap: wrap; }
    .hfd-freq-btn { font-size: 0.8125rem; border: 1px solid var(--color-border); background: var(--color-surface); border-radius: var(--radius-full); padding: 5px 12px; cursor: pointer; color: var(--color-text-secondary); }
    .hfd-freq-btn.active { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
    .hfd-actions { display: flex; justify-content: flex-end; gap: var(--space-2); }
    .hfd-cancel { background: none; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 8px 14px; cursor: pointer; font-size: 0.8125rem; color: var(--color-text-secondary); }
    .hfd-save { background: var(--color-accent); color: #fff; border: none; border-radius: var(--radius); padding: 8px 16px; cursor: pointer; font-size: 0.8125rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
    .hfd-save:hover { background: var(--color-accent-dark); }

    /* time-period control (in filters dropdown) */
    .hfd-time { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-3); padding-bottom: var(--space-3); border-bottom: 1px solid var(--color-border-light); }
    .hfd-time-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); margin-right: 4px; }
    .hfd-time-btn { font-size: 0.8125rem; border: 1px solid var(--color-border); background: var(--color-surface); border-radius: var(--radius-full); padding: 5px 12px; cursor: pointer; color: var(--color-text-secondary); }
    .hfd-time-btn.active { background: var(--color-accent); border-color: var(--color-accent); color: #fff; font-weight: 500; }

    /* Consolidated filter system: chevron, always-visible chip bar, clear-all, hide legacy filters */
    .undertool-chev { font-size: 0.7rem; transition: transform 0.15s ease; opacity: 0.8; }
    .hero-active-chips { max-width: 820px; margin: var(--space-3) auto 0; display: flex; flex-wrap: wrap; gap: 6px; }
    .hero-active-chips:empty { display: none; }
    .hfd-foot { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--color-border-light); display: flex; justify-content: flex-end; }
    .hfd-clear { background: none; border: none; color: var(--color-text-secondary); font-size: 0.8125rem; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
    .hfd-clear:hover { color: var(--color-danger); }
    /* legacy filter UI replaced by the hero "Show filters" dropdown — kept in DOM for the engine, hidden from view */
    #search-toolbar, #filters-panel { display: none !important; }
    /* Near me is spatial-only: Narrow-by (authority/type/status/agent) doesn't apply there — only When + Radius */
    .search-page.nearme .hfd-add { display: none; }

    /* mobile: tabs share the row evenly so all four fit; icon tab stays compact */
    @media (max-width: 768px) {
        .search-header { padding: 2.75rem var(--space-4) 2.5rem; }
        .search-tabs { gap: 3px; padding-left: 3px; }
        .stab { flex: 1 1 0; justify-content: center; padding: 9px 6px; font-size: 0.75rem; gap: 5px; white-space: nowrap; }
        .stab[data-mode="all"] { flex: 0 0 auto; padding-left: 12px; padding-right: 12px; }
        .search-undertools { gap: var(--space-3); }
        .hero-tagline { font-size: 1.7rem; }
        .hero-trust { font-size: 0.85rem; }
        .search-use-loc { padding: 7px 9px; margin-right: 2px; }
        .search-use-loc .ul-text { display: none; } /* icon-only on mobile so the input keeps its width */
        .search-use-loc i { font-size: 0.95rem; }
        .search-input { min-width: 0; } /* let the input shrink instead of pushing text out of view */
    }

    /* Compact footer + no white strip between the hero and the footer */
    body { background: #ffffff; } /* Lab C is a clean white page */
    /* Desktop alignment: nav/footer a touch wider than the ~820px search column */
    .nav-container, .footer-content { max-width: 1100px; }
    .footer { margin-top: 0 !important; padding-top: var(--space-5) !important; padding-bottom: var(--space-4) !important; }
    .footer .footer-content { gap: var(--space-3) var(--space-5) !important; }
    .footer .footer-bottom { margin-top: var(--space-3) !important; padding-top: var(--space-3) !important; }
    @media (max-width: 768px) {
        .footer { padding-top: var(--space-4) !important; }
        .footer .footer-content { justify-content: center !important; text-align: center; }
    }

    .hero-examples {
        display: flex; flex-wrap: wrap; gap: var(--space-2);
        justify-content: center; align-items: center;
        margin-top: var(--space-3);
    }
    .hero-examples-label { color: rgba(255,255,255,0.6); font-size: 0.8125rem; }
    .example-chip {
        background: rgba(255,255,255,0.08);
        border: 1px solid rgba(255,255,255,0.25);
        color: rgba(255,255,255,0.9);
        font-size: 0.8125rem;
        padding: 0.35rem 0.8rem;
        border-radius: var(--radius-full);
        cursor: pointer;
        font-family: var(--font-body);
        transition: background 0.15s, border-color 0.15s;
    }
    .example-chip:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.5); }

    /* Trending searches (in hero) */
    .hero-trending {
        display: flex; flex-wrap: wrap; gap: var(--space-2);
        justify-content: center; align-items: center; margin-top: var(--space-4);
    }
    .hero-trending-label { color: rgba(255,255,255,0.6); font-size: 0.8125rem; display: inline-flex; align-items: center; gap: 0.3rem; }
    .trend-chip {
        background: rgba(255,255,255,0.08);
        border: 1px solid rgba(255,255,255,0.25);
        color: rgba(255,255,255,0.9);
        font-size: 0.8125rem; padding: 0.35rem 0.8rem; border-radius: var(--radius-full);
        cursor: pointer; font-family: var(--font-body);
        transition: background 0.15s, border-color 0.15s;
    }
    .trend-chip:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.5); }

    /* Recent searches (in hero, pristine only) */
    .hero-recent { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; align-items: center; margin-top: var(--space-2); }
    .hero-recent:empty { display: none; }
    .hero-recent-label { color: rgba(255,255,255,0.5); font-size: 0.8125rem; display: inline-flex; align-items: center; gap: 0.3rem; }
    .recent-chip { background: none; border: 1px solid rgba(255,255,255,0.18); color: rgba(255,255,255,0.78); font-size: 0.8125rem; padding: 0.3rem 0.75rem; border-radius: var(--radius-full); cursor: pointer; font-family: var(--font-body); display: inline-flex; align-items: center; gap: 0.35rem; }
    .recent-chip:hover { background: rgba(255,255,255,0.12); color: #fff; }
    .recent-chip i { font-size: 0.7rem; opacity: 0.7; }

    /* Start here: curated entry points (clean homepage only) */
    /* No background — inherit the page (white) so the empty area matches the
       filter/tabs area above; an explicit --color-bg here created a tonal step. */
    .start-here { display: none; }
    .search-page.pristine .start-here { display: block; }
    .start-here-inner { max-width: 480px; margin: 0 auto; padding: var(--space-16) var(--space-6); text-align: center; }
    .start-here-hint {
        font-size: 1rem; line-height: 1.6; color: var(--color-text-muted);
        margin: 0;
    }
    .start-here-label {
        font-size: 0.95rem; color: var(--color-text-secondary);
        margin-bottom: var(--space-4); text-align: center;
    }
    .start-here-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--space-2); }
    .start-tile {
        display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
        border: 1px solid var(--color-border); border-radius: var(--radius-lg);
        background: var(--color-surface); padding: var(--space-4) var(--space-2);
        cursor: pointer; font-family: var(--font-body); color: var(--color-text);
        transition: border-color 0.15s, background 0.15s;
    }
    .start-tile:hover { border-color: var(--color-accent); background: var(--color-surface-alt); }
    .start-tile i { font-size: 1.15rem; color: var(--color-accent); }
    .start-tile span { font-size: 0.8125rem; font-weight: 500; }
    @media (max-width: 640px) {
        .start-here-grid { grid-template-columns: repeat(3, 1fr); }
    }

    /* ===== Near me (in-context assistant) ===== */
    /* Match the main search wrap so the list width (and row wrapping) is identical */
    .near-me { display: none; max-width: 1280px; margin: 0 auto; padding: 0 40px var(--space-8); }
    .search-page.nearme #start-here,
    .search-page.nearme #search-toolbar,
    .search-page.nearme .lc-tabs,
    .search-page.nearme .lc-meta,
    .search-page.nearme .results-area { display: none !important; }
    .search-page.nearme .near-me { display: block; }
    /* In near-me mode the location button is the active state — keep it but mark it */
    .search-page.nearme .lc-nearme { background:var(--lc-teal); color:#06231F; border-color:var(--lc-teal); }
    /* Near-me keeps the main filter bar — Time / Decision / Type / Agent all apply.
       Only Authority is dropped (the location already defines the area). The
       "Clear all filters" button would exit near-me, so hide just that; the
       Save-as-alert option stays. */
    .search-page.nearme .lc-fdrop:has(> .lc-fbtn[data-f="authority"]) { display: none !important; }
    .search-page.nearme .lc-clear { display: none !important; }
    .near-me-bar { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) 0 var(--space-3); }
    .nm-where { flex: 1; min-width: 0; font-size: 0.95rem; color: var(--color-text); display: inline-flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
    .nm-where i { color: var(--color-accent); }
    .nm-bar-actions { display: flex; align-items: center; gap: var(--space-3); flex-shrink: 0; margin-left: auto; }
    .nm-locedit-row { display: flex; align-items: center; gap: 0.5rem; flex: 1 1 220px; min-width: 0; }
    .nm-locedit-row input { flex: 1; min-width: 0; }
    .nm-change { background: none; border: none; color: var(--color-accent); font-size: 0.8125rem; text-decoration: underline; cursor: pointer; }
    .nm-radius { margin-left: auto; display: flex; align-items: center; gap: 0.4rem; }
    .nm-radius-label { font-size: 0.75rem; color: var(--color-text-muted); }
    .nm-rad, .nm-when { font-size: 0.8125rem; color: var(--color-text-secondary); border: 1px solid var(--color-border); background: var(--color-surface); border-radius: var(--radius-full); padding: 0.25rem 0.7rem; cursor: pointer; }
    .nm-rad.active, .nm-when.active { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
    .nm-hint { font-size: 0.75rem; color: var(--color-text-muted); display: inline-flex; align-items: center; gap: 0.35rem; }
    .nm-controls { display: flex; flex-wrap: wrap; gap: var(--space-5); padding-bottom: var(--space-3); }
    .nm-ctrl-group { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
    .nm-ctrl-label { font-size: 0.8125rem; color: var(--color-text-muted); }
    .nm-time { font-size: 0.8125rem; color: var(--color-text-secondary); border: 1px solid var(--color-border); background: var(--color-surface); border-radius: var(--radius-full); padding: 0.25rem 0.7rem; cursor: pointer; }
    .nm-time.active { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
    .nm-change { background: none; border: none; color: var(--color-accent); font-size: 0.8125rem; text-decoration: underline; cursor: pointer; }
    .nm-locedit { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 0.5rem 0.75rem; margin-bottom: var(--space-3); }
    .nm-locedit > i { color: var(--color-text-muted); }
    #nm-loc-input { flex: 1; min-width: 180px; border: none; outline: none; background: transparent; font-size: 0.9375rem; font-family: var(--font-body); padding: 4px 0; }
    .nm-loc-go { background: var(--color-accent); color: #fff; border: none; border-radius: var(--radius-sm); font-weight: 600; padding: 7px 14px; cursor: pointer; }
    .nm-loc-gps { background: none; border: 1px solid var(--color-border); border-radius: var(--radius-sm); color: var(--color-text-secondary); padding: 6px 12px; cursor: pointer; font-size: 0.8125rem; display: inline-flex; align-items: center; gap: 0.35rem; }
    .nm-loc-gps:hover { border-color: var(--color-accent); }
    .nm-loc-msg { font-size: 0.8125rem; color: var(--color-text-muted); }
    .nm-exit { background: none; border: none; color: var(--color-text-muted); cursor: pointer; font-size: 1.1rem; }
    /* The near-me "table heading" — same row as the main search meta: count on the
       left, sort indicator on the right (distance-sorted, so a static label). */
    .near-me-summary { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 14px 0; font-size: 14px; color: var(--color-text); }
    .near-me-summary strong { font-weight: 800; }
    .near-me-summary .nm-sort { color: var(--color-text-muted); flex-shrink: 0; }
    .near-me-summary i { color: var(--color-accent); }
    /* Results state → labelled section header ("APPLICATIONS" + count), matching .lc-section-head */
    .near-me-summary:has(.nm-head-meta) { padding: 20px 4px 6px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--color-text-muted); border-bottom: 1px solid var(--color-border); }
    .near-me-summary .nm-head-meta { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--color-text-muted); flex-shrink: 0; }
    .near-me-summary .nm-head-meta strong { font-weight: 800; color: var(--color-text); }
    /* List-primary: the map is an aid on top; the list flows below exactly like the
       main search results (no bordered scroll-box). */
    .near-me-body { display: block; }
    .near-me-map { height: 320px; border-radius: var(--radius-lg); border: 1px solid var(--color-border); overflow: hidden; z-index: 0; margin-bottom: var(--space-4); }
    /* Fills below the fixed nav (top set in JS to the nav height) so the exit control stays visible; below the detail overlay at z-index 200. */
    .near-me-map.nm-map-full { position: fixed !important; top: 0; left: 0 !important; right: 0 !important; bottom: 0 !important; height: auto !important; width: auto !important; z-index: 150 !important; border: none !important; border-radius: 0 !important; margin: 0 !important; }
    body.nm-map-fs-open { overflow: hidden; }
    .nm-fs { border: none !important; }
    .nm-fs button { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: #fff; border: none; border-radius: 4px; cursor: pointer; color: var(--color-text); font-size: 13px; box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
    .nm-fs button:hover { background: var(--color-surface-alt); }
    .near-me-list { background: #fff; }
    .nm-item { display: flex; gap: 0.6rem; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border-light); cursor: pointer; }
    .nm-item:last-child { border-bottom: none; }
    .nm-item:hover { background: var(--color-surface-alt); }
    .nm-num { width: 20px; height: 20px; border-radius: 50%; background: var(--color-primary); color: #fff; font-size: 0.7rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
    .nm-dist { margin-left: auto; font-size: 0.75rem; color: var(--color-text-muted); white-space: nowrap; }
    /* this map needs its controls + attribution (global rule hides them elsewhere) */
    #nm-map .leaflet-control-container, #nm-map .leaflet-control-attribution { display: block !important; }
    @media (max-width: 768px) {
        .near-me { padding: 0 16px var(--space-8); }
        .near-me-map { height: 240px; }
    }

    /* ===== Picker (in-context Authority / Agent finder) ===== */
    .picker { display: none; max-width: 720px; margin: 0 auto; padding: var(--space-5) var(--space-4) var(--space-8); }
    .search-page.picking #start-here,
    .search-page.picking #search-toolbar,
    .search-page.picking .results-area { display: none !important; }
    .search-page.picking .picker { display: block; }
    .picker-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
    .picker-title { font-size: 1.0625rem; font-weight: 500; color: var(--color-text); }
    .picker-search { display: flex; align-items: center; gap: 0.6rem; background: #fff; border: 1px solid var(--color-border-secondary); border-radius: var(--radius); padding: 0 12px; margin-bottom: var(--space-3); }
    .picker-search i { color: var(--color-text-muted); }
    .picker-search input { flex: 1; border: none; outline: none; background: transparent; padding: 11px 0; font-size: 0.9375rem; font-family: var(--font-body); }
    .picker-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .picker-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--color-border-tertiary); border-radius: var(--radius); padding: 11px 13px; cursor: pointer; background: #fff; text-align: left; font-family: var(--font-body); }
    .picker-item:hover { border-color: var(--color-accent); background: var(--color-surface-alt); }
    .picker-item .pk-name { font-size: 0.875rem; color: var(--color-text); display: flex; align-items: center; gap: 8px; min-width: 0; }
    .picker-item .pk-name i { color: var(--color-accent); flex-shrink: 0; }
    .picker-item .pk-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .picker-item .pk-meta { font-size: 0.75rem; color: var(--color-text-muted); white-space: nowrap; flex-shrink: 0; }
    .picker-empty { grid-column: 1 / -1; padding: var(--space-6); text-align: center; color: var(--color-text-muted); font-size: 0.875rem; }
    @media (max-width: 640px) { .picker-list { grid-template-columns: 1fr; } }

    /* ===== Reference helper ===== */
    .ref-helper { display: none; }
    .search-page.refmode #start-here,
    .search-page.refmode #search-toolbar,
    .search-page.refmode .results-area { display: none !important; }
    .search-page.refmode .ref-helper { display: block; }
    .ref-inner { max-width: 520px; margin: 0 auto; padding: var(--space-8) var(--space-4); text-align: center; position: relative; }
    .ref-close { position: absolute; top: var(--space-3); right: var(--space-3); }
    .ref-icon { font-size: 1.6rem; color: var(--color-accent); }
    .ref-title { font-size: 1.25rem; font-weight: 500; margin: var(--space-3) 0 var(--space-1); }
    .ref-sub { font-size: 0.875rem; color: var(--color-text-muted); margin: 0 0 var(--space-5); }
    .ref-input-wrap { display: flex; align-items: center; gap: 0.6rem; background: #fff; border: 2px solid var(--color-accent); border-radius: var(--radius); padding: 0 6px 0 14px; }
    .ref-input-wrap > i { color: var(--color-accent); }
    .ref-input-wrap input { flex: 1; border: none; outline: none; background: transparent; padding: 13px 0; font-size: 1rem; font-family: var(--font-mono); }
    .ref-go { background: var(--color-accent); color: #fff; border: none; border-radius: var(--radius-sm); font-weight: 600; padding: 9px 18px; cursor: pointer; }
    .ref-go:hover { background: var(--color-accent-dark); }
    .ref-detect { min-height: 1.2rem; font-size: 0.8125rem; color: var(--color-accent-dark); margin-top: var(--space-2); }
    .ref-examples { display: flex; align-items: center; gap: 0.4rem; justify-content: center; flex-wrap: wrap; margin-top: var(--space-4); }
    .ref-ex-label { font-size: 0.75rem; color: var(--color-text-muted); }
    .ref-ex { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--color-text-secondary); border: 1px solid var(--color-border); background: var(--color-surface); border-radius: var(--radius-full); padding: 0.3rem 0.7rem; cursor: pointer; }
    .ref-ex:hover { border-color: var(--color-accent); }
    .ref-recent { margin-top: var(--space-5); text-align: left; }
    .ref-recent-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0; font-size: 0.875rem; color: var(--color-text); cursor: pointer; border-bottom: 1px solid var(--color-border-light); }
    .ref-recent-item:hover { color: var(--color-accent); }
    .ref-recent-item i { color: var(--color-text-muted); font-size: 0.8rem; }

    /* ===== Context refine bar (Decisions / Big builds) ===== */
    .context-bar { max-width: 900px; margin: 0 auto; padding: 0 var(--space-6); }
    .ctx-inner { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding-top: var(--space-4); }
    .ctx-label { font-size: 0.8125rem; color: var(--color-text-muted); display: inline-flex; align-items: center; gap: 0.35rem; margin-right: 0.2rem; }
    .ctx-label i { color: var(--color-accent); }
    .ctx-btn { font-size: 0.8125rem; color: var(--color-text-secondary); border: 1px solid var(--color-border); background: var(--color-surface); border-radius: var(--radius-full); padding: 0.3rem 0.8rem; cursor: pointer; font-family: var(--font-body); }
    .ctx-btn.active { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
    .ctx-btn:hover:not(.active) { border-color: var(--color-accent); }

    /* Grouped autocomplete */
    .ac-group-header {
        padding: 8px 14px 4px; font-size: 10px; letter-spacing: 0.05em;
        text-transform: uppercase; color: var(--color-text-muted);
        border-top: 1px solid var(--color-border-light);
    }
    .ac-group-header:first-child { border-top: none; }
    .autocomplete-item.ac-primary { background: var(--color-surface-alt); font-weight: 500; }
    .autocomplete-item .ac-ic { width: 18px; text-align: center; color: var(--color-text-muted); flex-shrink: 0; }
    .autocomplete-item .ac-count { margin-left: auto; font-size: 0.75rem; color: var(--color-text-muted); white-space: nowrap; }
    .autocomplete-item .ac-kbd {
        margin-left: auto; font-size: 0.7rem; border: 1px solid var(--color-border);
        border-radius: 4px; padding: 1px 6px; font-family: var(--font-mono); color: var(--color-text-muted);
    }
    .ac-hint { padding: 9px 14px; font-size: 0.78rem; color: var(--color-text-muted); border-top: 1px solid var(--color-border-light); background: #fbfcfb; display: flex; align-items: center; gap: 8px; }

    /* Collapsed hero after a search */
    .search-page.searched .hero-intro,
    .search-page.searched .hero-examples,
    .search-page.searched .hero-trending,
    .search-page.searched .hero-recent { display: none; }
    .search-page.searched .home-hero {
        padding-top: var(--space-4);
        padding-bottom: var(--space-4);
    }

    /* Pristine homepage: search box + quick filters — no toolbar/results until a search.
       (#filters-panel stays accessible via "More filters"; it's hidden by its own [hidden] attr.) */
    .search-page.pristine #search-toolbar,
    .search-page.pristine .results-area { display: none !important; }
    .search-page.pristine .home-hero { padding-bottom: var(--space-6); }

    /* Toolbar (filters button + active chips) */
    .search-toolbar {
        max-width: 900px; margin: 0 auto;
        padding: var(--space-4) var(--space-6) 0;
        display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
    }
    .filters-toggle {
        display: inline-flex; align-items: center; gap: 0.4rem;
        background: var(--color-surface); border: 1px solid var(--color-border);
        color: var(--color-text); font-size: 0.875rem; font-weight: 500;
        padding: 0.5rem 0.9rem; border-radius: var(--radius); cursor: pointer;
        white-space: nowrap;
    }
    .filters-toggle:hover { border-color: var(--color-accent); }
    .filters-toggle.active { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
    .filters-count-badge {
        background: var(--color-accent); color: #fff; font-size: 0.7rem; font-weight: 600;
        min-width: 1.15rem; height: 1.15rem; padding: 0 0.3rem; border-radius: var(--radius-full);
        display: inline-flex; align-items: center; justify-content: center;
    }
    .filters-toggle.active .filters-count-badge { background: #fff; color: var(--color-accent); }

    /* Active filter chips */
    .active-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
    .active-chip {
        display: inline-flex; align-items: center; gap: 0.45rem;
        background: var(--color-surface-alt); color: var(--color-accent-dark);
        border: 1px solid var(--color-border-light);
        font-size: 0.8125rem; padding: 0.3rem 0.65rem; border-radius: var(--radius-full);
    }
    .active-chip button {
        background: none; border: none; color: inherit; cursor: pointer;
        padding: 0; font-size: 0.95rem; line-height: 1; opacity: 0.65;
    }
    .active-chip button:hover { opacity: 1; }
    .active-chip-clear {
        background: none; border: none; color: var(--color-text-muted);
        cursor: pointer; font-size: 0.8125rem; text-decoration: underline; padding: 0.2rem;
    }
    .active-chip-clear:hover { color: var(--color-text); }

    .search-filters-inner { max-width: 900px; }
    .filters-panel-footer {
        display: flex; justify-content: space-between; gap: var(--space-3);
        margin-top: var(--space-4);
    }

    /* Mobile: filters panel as a bottom sheet */
    @media (max-width: 768px) {
        .hero-tagline { font-size: 1.4rem; }
        .hero-intro { margin-bottom: var(--space-4); }
        .search-toolbar { padding: var(--space-3) var(--space-3) 0; }
        #filters-panel.sheet-open {
            position: fixed; left: 0; right: 0; bottom: 0; top: auto;
            z-index: 300; max-height: 85vh; overflow-y: auto;
            border-radius: var(--radius-lg) var(--radius-lg) 0 0;
            box-shadow: 0 -8px 30px rgba(0,0,0,0.25);
        }
        .sheet-backdrop { position: fixed; inset: 0; background: rgba(26,35,50,0.45); z-index: 299; }
    }

    /* ============================================================
       Lab C — persistent smart filter bar + scoped vertical tabs
       (clean white/editorial page; tokens mirror the Paper canvas)
       ============================================================ */
    :root {
        --lc-ink:#16202E; --lc-muted:#5E6B7B; --lc-line:#D7DEE6; --lc-fog:#F4F6F8; --lc-fog2:#E7ECF1;
        --lc-teal:#13B8A6; --lc-teal-deep:#0E8C7E; --lc-amber:#E0A23B; --lc-grant:#1FA971; --lc-refuse:#D8604B;
        --lc-pill:999px;
    }
    /* The search page becomes a clean light page (no navy hero) */
    .search-page.labc { background:#fff; min-height:auto; }
    .labc .lc-wrap { max-width:1280px; margin:0 auto; padding:0 40px; }

    /* Search box (full width) */
    .labc .lc-box { display:flex; align-items:center; gap:12px; border:1px solid var(--lc-line); border-radius:14px; padding:14px 18px; box-shadow:0 10px 34px rgba(15,27,45,.06); margin:28px 0 0; }
    .labc .lc-box:focus-within { border-color:var(--lc-ink); }
    .labc .lc-box svg { width:20px; height:20px; flex-shrink:0; }
    .labc .lc-box input { flex:1; border:none; outline:none; font:inherit; font-size:16px; color:var(--lc-ink); background:transparent; }
    /* "Near me" entry — opens the location search mode */
    .labc .lc-nearme { flex-shrink:0; display:inline-flex; align-items:center; gap:6px; border:1px solid var(--lc-line); background:var(--lc-fog2); color:var(--lc-teal-deep); border-radius:10px; padding:7px 12px; font:inherit; font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap; }
    .labc .lc-nearme:hover { background:#fff; border-color:var(--lc-teal-deep); }
    .labc .lc-box .lc-nearme svg { width:17px; height:17px; }
    @media (max-width: 768px) { .labc .lc-nearme { padding:7px 9px; } .labc .lc-nearme-label { display:none; } }

    /* Scoped vertical tabs */
    .labc .lc-tabs { display:flex; gap:28px; border-bottom:1px solid var(--lc-line); padding-top:18px; margin-top:14px; overflow-x:auto; }
    .labc .lc-tab { display:flex; align-items:center; gap:8px; padding:0 0 13px; border:none; border-bottom:2px solid transparent; background:none; cursor:pointer; white-space:nowrap; font:inherit; }
    .labc .lc-tab-label { font-size:15px; font-weight:500; color:var(--lc-muted); }
    .labc .lc-tab-count { display:inline-block; box-sizing:border-box; min-width:42px; text-align:center; background:var(--lc-fog2); color:var(--lc-muted); border-radius:var(--lc-pill); padding:2px 8px; font-size:11px; font-weight:700; line-height:14px; }
    .labc .lc-tab-count:empty { visibility:hidden; }
    .labc .lc-tab.active { border-bottom-color:var(--lc-teal); }
    .labc .lc-tab.active .lc-tab-label { color:var(--lc-ink); font-weight:700; }
    .labc .lc-tab.active .lc-tab-count { background:var(--lc-teal); color:#06231F; }

    /* Persistent filter bar */
    .labc .lc-bar { display:flex; align-items:center; gap:10px; border-bottom:1px solid var(--lc-line); padding:16px 0; position:relative; }
    .labc .lc-fbtns { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
    .labc .lc-fbtn { display:flex; align-items:center; gap:7px; background:#fff; border:1px solid var(--lc-line); border-radius:var(--lc-pill); padding:9px 15px; font:inherit; font-size:14px; font-weight:600; color:var(--lc-ink); cursor:pointer; white-space:nowrap; }
    .labc .lc-fbtn:hover { border-color:var(--lc-muted); }
    .labc .lc-fbtn .chev { font-size:9px; opacity:.5; margin-left:2px; }
    .labc .lc-fbtn.set { background:var(--lc-ink); border-color:var(--lc-ink); color:#fff; }
    .labc .lc-fbtn.set .chev { opacity:.7; }
    .labc .lc-bar-right { display:flex; align-items:center; gap:16px; margin-left:auto; }
    .labc .lc-clear { background:none; border:none; font:inherit; font-size:13px; font-weight:600; color:var(--lc-teal-deep); cursor:pointer; display:none; }
    .labc .lc-clear.show { display:inline; }
    .labc .lc-alert { display:flex; align-items:center; gap:7px; background:#fff; border:1px solid var(--lc-line); border-radius:var(--lc-pill); padding:8px 13px; font:inherit; font-size:13px; font-weight:600; color:var(--lc-ink); cursor:pointer; }
    .labc .lc-alert svg { width:14px; height:14px; flex-shrink:0; }

    /* Popover */
    .labc .lc-pop { position:absolute; top:calc(100% + 8px); min-width:260px; max-width:340px; background:#fff; border:1px solid var(--lc-line); border-radius:12px; box-shadow:0 22px 50px rgba(15,27,45,.18); z-index:60; overflow:hidden; }
    .labc .lc-pop.fade { animation:lcfade .16s ease; }
    @keyframes lcfade { from{opacity:0;transform:translateY(-4px)} to{opacity:1;transform:none} }
    .labc .lc-popsearch { width:100%; border:none; border-bottom:1px solid var(--lc-line); padding:11px 14px; font:inherit; font-size:14px; outline:none; box-sizing:border-box; }
    .labc .lc-poplist { max-height:300px; overflow-y:auto; padding:6px; }
    .labc .lc-opt { display:flex; align-items:center; gap:10px; padding:9px 12px; font-size:14px; color:var(--lc-ink); cursor:pointer; border-radius:8px; }
    .labc .lc-opt:hover { background:var(--lc-fog); }
    .labc .lc-opt-dis { opacity:.4; cursor:default; pointer-events:none; }
    .labc .lc-opt .lc-cnt { margin-left:auto; font-size:12px; color:var(--lc-muted); font-variant-numeric:tabular-nums; }
    .labc .lc-cbox { width:17px; height:17px; border-radius:5px; border:1.5px solid #C5CFDA; flex-shrink:0; display:flex; align-items:center; justify-content:center; }
    .labc .lc-opt.on .lc-cbox { background:var(--lc-teal); border-color:var(--lc-teal); }
    .labc .lc-opt.on .lc-cbox::after { content:"✓"; color:#fff; font-size:11px; font-weight:800; }
    .labc .lc-radio { width:16px; height:16px; border-radius:50%; border:1.5px solid #C5CFDA; flex-shrink:0; }
    .labc .lc-opt.on .lc-radio { border:5px solid var(--lc-teal-deep); }
    .labc .lc-pophead { font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--lc-muted); padding:10px 14px 4px; }
    .labc .lc-empty { padding:16px; text-align:center; color:var(--lc-muted); font-size:13px; }
    /* Agent option (avatar + stats) */
    .labc .lc-agent { display:flex; align-items:center; gap:11px; padding:9px 12px; cursor:pointer; border-radius:8px; }
    .labc .lc-agent:hover { background:var(--lc-fog); }
    .labc .lc-av { width:32px; height:32px; border-radius:50%; background:var(--lc-ink); color:#fff; font-size:12px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
    .labc .lc-agent-name { font-size:14px; font-weight:600; color:var(--lc-ink); }
    .labc .lc-agent-sub { font-size:12px; color:var(--lc-muted); margin-top:1px; }
    .labc .lc-agent .lc-tick { margin-left:auto; color:var(--lc-teal); opacity:0; }
    .labc .lc-agent.on .lc-tick { opacity:1; }

    /* Count + sort row */
    .labc .lc-meta { display:flex; align-items:center; justify-content:space-between; padding:14px 0; }
    .labc .lc-count { font-size:14px; color:var(--lc-ink); }
    .labc .lc-count b { font-weight:800; }
    .labc .lc-sort { font:inherit; font-size:13px; color:var(--lc-muted); border:none; background:none; cursor:pointer; }

    /* Results — applications rows */
    .labc .lc-results { }
    .labc .lc-row { display:flex; align-items:center; gap:16px; border-bottom:1px solid var(--lc-line); padding:16px 4px; text-decoration:none; }
    .labc .lc-row:hover { background:var(--lc-fog); }
    .labc .lc-ref { width:130px; flex-shrink:0; font-size:12px; font-weight:700; color:var(--lc-muted); }
    .labc .lc-main { flex:1; min-width:0; overflow:hidden; }
    .labc .lc-addr { font-size:16px; font-weight:600; color:var(--lc-ink); overflow-wrap:anywhere; }
    .labc .lc-submeta { font-size:13px; color:var(--lc-muted); margin-top:2px; overflow-wrap:anywhere; }
    .labc .lc-status { flex-shrink:0; border-radius:var(--lc-pill); padding:5px 11px; font-size:11px; font-weight:700; white-space:nowrap; }
    .lc-st-grant{ color:var(--lc-grant); background:rgba(31,169,113,.12); }
    .lc-st-refuse{ color:var(--lc-refuse); background:rgba(216,96,75,.13); }
    .lc-st-fi{ color:var(--lc-amber); background:rgba(224,162,59,.16); }
    .lc-st-pend{ color:var(--lc-muted); background:var(--lc-fog2); }
    .lc-st-appeal{ color:var(--lc-teal-deep); background:rgba(19,184,166,.14); }
    /* avatar + link used in Architects/Authorities/Appeals rows */
    .labc .lc-rowav { width:38px; height:38px; border-radius:50%; background:var(--lc-ink); color:#fff; font-size:13px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
    .labc .lc-link { flex-shrink:0; color:var(--lc-teal-deep); font-size:13px; font-weight:600; white-space:nowrap; }
    .labc .lc-row:hover .lc-link { text-decoration:underline; }
    /* Subtle brand-tint search highlight (replaces the loud default yellow <mark>) */
    .labc mark { background:rgba(19,184,166,.16); color:inherit; border-radius:3px; padding:0 1px; }

    /* Appeals table (Phase 2) */
    .labc .lc-thead { display:flex; gap:16px; padding:10px 4px; font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--lc-muted); border-bottom:1px solid var(--lc-line); }
    .labc .lc-appeal-c-ref { width:118px; flex-shrink:0; }
    .labc .lc-appeal-c-main { flex:1; min-width:0; }
    .labc .lc-appeal-c-board { width:180px; flex-shrink:0; display:flex; flex-direction:column; align-items:flex-end; justify-content:center; gap:3px; text-align:right; }
    .labc .lc-appeal-when { font-size:12px; color:var(--lc-muted); white-space:nowrap; }
    .labc .lc-appeal-row .lc-status { white-space:nowrap; }
    .labc .lc-section { margin-bottom:6px; }
    .labc .lc-section-head { display:flex; align-items:center; justify-content:space-between; padding:20px 4px 6px; font-size:12px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--lc-muted); border-bottom:1px solid var(--lc-line); }
    .labc .lc-section-more { color:var(--lc-teal-deep); text-decoration:none; font-size:12px; font-weight:600; text-transform:none; letter-spacing:0; }
    .labc .lc-section-more:hover { text-decoration:underline; }

    /* Reuse the engine's results-area, aligned to the Lab C column; hide its legacy header (we use .lc-meta) */
    .search-page.labc .results-area { max-width:1280px; margin:0 auto; padding:0 40px 56px; background:#fff; }
    .search-page.labc .results-header { display:none; }
    /* Clean, borderless results — no mint box, no green; rows carry their own hairline (.lc-row) */
    .search-page.labc #results-list, .search-page.labc .results-list { background:#fff; border:none; border-radius:0; overflow:visible; }
    .search-page.labc .empty-state { padding:64px 0; border:none; background:none; color:var(--lc-muted); }
    .search-page.labc .empty-state .empty-icon { display:none; }
    /* Clean pagination (no green) */
    .search-page.labc .pagination { border:none !important; background:none; gap:14px; padding:18px 0; }
    .search-page.labc .pagination .btn, .search-page.labc .pagination .btn-secondary { background:#fff; border:1px solid var(--lc-line); color:var(--lc-ink); border-radius:var(--radius-sm); box-shadow:none; }
    .search-page.labc .pagination .btn:hover:not(:disabled) { border-color:var(--lc-ink); }
    .search-page.labc .pagination .btn:disabled { opacity:.45; }
    .search-page.labc .page-input-field { border:1px solid var(--lc-line) !important; }
    /* Pin the footer to the bottom so there's never a white void below it */
    body { display:flex; flex-direction:column; min-height:100vh; }
    body > .search-page.labc { flex:1 0 auto; }
    body > footer { flex-shrink:0; }
    @media (max-width:768px){ .search-page.labc .results-area { padding:0 16px 40px; } }

    @media (max-width:768px) {
        .labc .lc-wrap { padding:0 16px; }
        .labc .lc-box { margin-top:16px; padding:12px 14px; }
        .labc .lc-tabs { gap:18px; }
        .labc .lc-bar { flex-wrap:wrap; }
        .labc .lc-fbtns { flex-wrap:nowrap; overflow-x:auto; width:100%; padding-bottom:4px; -webkit-overflow-scrolling:touch; }
        .labc .lc-bar-right { width:100%; margin-left:0; justify-content:space-between; }
        .labc .lc-pop:not(.lc-sort-drop) { left:16px !important; right:16px !important; min-width:0; max-width:none; }
    .labc .lc-sort-drop { right:0 !important; left:auto !important; min-width:170px; max-width:calc(100vw - 32px); }
    .labc .lc-popsearch, .labc .search-input { font-size:16px; }
        .labc .lc-ref { width:96px; }
        .labc .lc-appeal-head { display:none; }
        .labc .lc-appeal-row { flex-wrap:wrap; gap:6px 12px; align-items:flex-start; }
        .labc .lc-appeal-c-ref { width:auto; order:1; }
        .labc .lc-appeal-c-board { width:auto; order:2; margin-left:auto; align-items:flex-end; }
        .labc .lc-appeal-c-main { flex:1 1 100%; order:3; }
    }

    /* ===== Funnel dressing (pristine homepage only): hero + example chips + sample alert ===== */
    /* Hero: a real h1 + proof line above the box. Compact — must not push the box below the fold on mobile. */
    .labc .lc-hero { display:none; text-align:center; padding-top:34px; }
    .search-page.pristine .lc-hero { display:block; }
    .labc .lc-hero-title { font-family:var(--font-display); font-size:2rem; font-weight:700; letter-spacing:-0.01em; line-height:1.2; color:var(--lc-ink); margin:0; }
    .labc .lc-hero-proof { font-size:0.875rem; color:var(--lc-muted); margin:10px 0 0; }
    .labc .lc-hero-proof #lc-proof-apps { color:var(--lc-teal-deep); font-weight:700; }

    /* Example-query chips seeding the empty search box */
    .labc .lc-examples { display:none; align-items:center; justify-content:center; flex-wrap:wrap; gap:8px; padding:2px 0 12px; }
    .search-page.pristine .lc-examples { display:flex; }
    .labc .lc-examples-label { font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--lc-muted); }
    .labc .lc-example { font:inherit; font-size:13px; font-weight:600; color:var(--lc-teal-deep); background:#fff; border:1px solid var(--lc-line); border-radius:var(--lc-pill); padding:7px 14px; cursor:pointer; transition:border-color .15s, background .15s; }
    .labc .lc-example:hover { border-color:var(--lc-teal-deep); background:var(--lc-fog); }

    /* Sample alert email: a stylised mini-mock of the real daily digest (src/alert_emails.py) */
    .sample-alert { display:none; max-width:480px; margin:0 auto; padding:0 24px 72px; text-align:center; }
    .search-page.pristine .sample-alert { display:block; }
    .sample-alert-caption { font-size:0.95rem; line-height:1.6; color:var(--color-text-secondary); margin:0 0 var(--space-5); }
    .sample-alert-caption a { color:var(--lc-teal-deep); font-weight:600; }
    /* The whole mock is one link to /alerts.html — the "View All Matches" button
       inside looked clickable but was a dead div (decorative content stays
       aria-hidden; the wrapping link carries the accessible label). */
    .sample-alert-link { display:block; text-decoration:none; color:inherit; cursor:pointer; }
    .sample-alert-link:focus-visible { outline:2px solid var(--lc-teal-deep); outline-offset:4px; border-radius:16px; }
    .sample-alert-mock { text-align:left; border:1px solid var(--lc-line); border-radius:16px; overflow:hidden; box-shadow:0 14px 40px rgba(15,27,45,.10); background:#fff; transition:transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
    .sample-alert-link:hover .sample-alert-mock { transform:translateY(-2px); box-shadow:0 18px 48px rgba(15,27,45,.14); border-color:var(--lc-teal-deep); }
    .sample-alert-link:hover .sam-cta { background:var(--lc-teal); color:#06231F; }
    .sam-head { display:flex; align-items:center; gap:8px; background:#1a2332; color:#fff; padding:14px 20px; font-size:14px; font-weight:700; }
    .sam-head i { color:var(--lc-teal); }
    .sam-body { padding:18px 20px 20px; }
    .sam-sub { font-size:12px; color:var(--lc-muted); margin-bottom:12px; }
    .sam-alert-head { display:flex; align-items:center; justify-content:space-between; border-bottom:2px solid var(--lc-teal-deep); padding-bottom:8px; margin-bottom:10px; }
    .sam-alert-name { font-size:14px; font-weight:700; color:#1a2332; }
    .sam-pill { background:var(--lc-teal-deep); color:#fff; border-radius:12px; font-size:11px; font-weight:700; padding:2px 10px; }
    .sam-card { background:#f9fafb; border-radius:8px; padding:12px 14px; margin-bottom:8px; }
    .sam-addr { font-size:13px; font-weight:600; color:#1a2332; }
    .sam-desc { font-size:12px; color:#4b5563; line-height:1.4; margin-top:3px; }
    .sam-meta { font-size:11px; color:#9ca3af; margin-top:6px; }
    .sam-cta { background:var(--lc-teal-deep); color:#fff; text-align:center; border-radius:8px; padding:11px 0; font-size:13px; font-weight:600; margin-top:14px; }
    @media (max-width:768px) {
        .labc .lc-hero { padding-top:20px; }
        .labc .lc-hero-title { font-size:1.35rem; }
        .labc .lc-hero-proof { font-size:0.8125rem; margin-top:8px; }
        .sample-alert { padding-bottom:56px; }
    }

    /* ===== Authorities explorer (choropleth map + dropdown picker) ===== */
    .lc-auth-explore { padding: var(--space-4) 0 var(--space-8); }
    .lc-auth-hint { font-size: 0.95rem; color: var(--color-text-secondary); margin: 0 0 var(--space-4); }
    .lc-auth-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-4); }
    .lc-auth-shadeby { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-text-muted); }
    .lc-auth-metrics { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); }
    /* Rounded, editorial pills (consistent with the filter pills) — active uses the
       teal tint, not a hard square block. */
    .lc-auth-metric {
        font: inherit; font-size: 0.8125rem; font-weight: 600; padding: 5px 14px; cursor: pointer;
        background: #fff; color: var(--color-text-secondary);
        border: 1px solid var(--color-border); border-radius: var(--radius-full);
        transition: background 0.15s, border-color 0.15s, color 0.15s;
    }
    .lc-auth-metric:hover { border-color: var(--color-accent); color: var(--color-text); }
    .lc-auth-metric.on { background: var(--color-success-bg); border-color: var(--color-accent); color: var(--color-accent-dark); }
    .lc-auth-map { height: 460px; border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; z-index: 0; }
    .lc-auth-legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-top: var(--space-3); font-size: 0.8125rem; color: var(--color-text-muted); }
    .lc-auth-legend span { display: inline-flex; align-items: center; gap: 6px; }
    .lc-auth-legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
    @media (max-width: 600px) {
        .lc-auth-map { height: 380px; }
        .lc-auth-controls { gap: var(--space-2); }
    }
