/* ============================================================
   RNA Explorer — Design System (Material Design 3 / Guid'Asso)
   Primary: #82C341 · Surface: #F8FAFC · Font: Outfit + Inter
   ============================================================ */

:root {
    --bg:                #F8FAFC;
    --surface:           #FFFFFF;
    --border:            #E2E8F0;
    --border-hover:      #CBD5E1;
    --text-primary:      #1E293B;
    --text-secondary:    #64748B;
    --text-tertiary:     #94A3B8;

    --primary:           #82C341;
    --primary-hover:     #71b230;
    --primary-glow:      rgba(130, 195, 65, 0.14);
    --primary-container: #F4F9ED;
    --on-primary-container: #2D4525;

    --success:           #10B981;
    --error:             #EF4444;
    --warning:           #F59E0B;

    --font-head: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --radius-sm:  8px;
    --radius-md:  16px;
    --radius-lg:  24px;
    --radius-xl:  32px;
    --radius-pill: 100px;

    --shadow-sm:  0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.03);
    --shadow-md:  0 4px 12px rgba(0,0,0,.06), 0 2px 4px rgba(0,0,0,.04);
    --shadow-lg:  0 10px 30px rgba(0,0,0,.08), 0 4px 8px rgba(0,0,0,.04);
}

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

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-body);
}

/* ── Background décor ───────────────────────────────────────── */
.background-decor {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: .07;
}
.orb-1 { top: -12%; right: 10%; width: 520px; height: 520px; background: var(--primary); }
.orb-2 { bottom: 0; left: -8%;  width: 420px; height: 420px; background: #3b82f6; }

/* ── Layout ─────────────────────────────────────────────────── */
.container {
    width: 100%;
    height: 100vh;
    max-width: 100%;
    padding: 1rem 1.25rem .75rem;
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
    text-align: center;
    animation: fadeInDown .7s cubic-bezier(.16,1,.3,1) both;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: .7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .5rem;
    box-shadow: var(--shadow-sm);
}
.hero-badge .material-symbols-rounded {
    font-size: 14px;
    color: var(--primary);
}

.hero h1 {
    font-family: var(--font-head);
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.2;
    margin-bottom: .25rem;
    color: var(--text-primary);
}
.hero-accent {
    background: linear-gradient(135deg, var(--primary) 20%, #4ade80 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    font-size: .9rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ── Search section ─────────────────────────────────────────── */
.search-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    animation: fadeInUp .7s cubic-bezier(.16,1,.3,1) .08s both;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1.5px solid var(--border);
    padding: .35rem .5rem;
    border-radius: var(--radius-pill);
    width: 100%;
    max-width: 800px;
    box-shadow: var(--shadow-md);
    transition: border-color .25s, box-shadow .25s;
}
.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow), var(--shadow-md);
}

/* Input wrapper */
.input-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}
.field-icon {
    font-size: 18px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    margin-left: .6rem;
    user-select: none;
    transition: color .2s;
}
.input-wrapper:focus-within .field-icon {
    color: var(--primary);
}
.input-wrapper input,
.input-wrapper select {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    padding: 1.2rem .65rem .3rem .45rem;
    letter-spacing: .01em;
    min-width: 0;
}
.input-wrapper select { appearance: none; cursor: pointer; }

.input-wrapper label {
    position: absolute;
    left: 2.35rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: .9rem;
    font-family: var(--font-body);
    transition: all .18s ease;
    pointer-events: none;
    white-space: nowrap;
}
.input-wrapper input:focus ~ label,
.input-wrapper input:not([type="date"]):valid ~ label,
.input-wrapper select ~ label {
    top: 28%;
    font-size: .7rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.input-wrapper input:focus ~ label,
.input-wrapper select:focus ~ label {
    color: var(--primary);
}
.input-wrapper input[type="date"] { font-size: .9rem; color: var(--text-secondary); }
.input-wrapper input[type="date"]:focus,
.input-wrapper input[type="date"]:valid { color: var(--text-primary); }
.input-wrapper input[type="date"] ~ label { top: 28%; font-size: .7rem; font-weight: 600; }
.input-wrapper input[type="date"]:focus ~ label { color: var(--primary); }
.input-wrapper input::placeholder { color: transparent; }
.input-wrapper input:focus::placeholder { color: var(--text-tertiary); }

/* Select caret */
.select-wrapper { position: relative; }
.select-wrapper::after {
    content: "";
    position: absolute;
    right: .75rem;
    top: 55%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-top-color: var(--text-tertiary);
    pointer-events: none;
    transition: transform .2s, border-top-color .2s;
}
.select-wrapper:focus-within::after {
    transform: translateY(-75%) rotate(180deg);
    border-top-color: var(--primary);
}

.input-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
    flex-shrink: 0;
    align-self: center;
}

/* Search button */
.btn-search {
    display: flex;
    align-items: center;
    gap: .4rem;
    background: var(--primary);
    color: #fff;
    border: none;
    outline: none;
    padding: .7rem 1.5rem;
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: .95rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .2s, transform .15s, box-shadow .2s;
}
.btn-search .material-symbols-rounded { font-size: 20px; }
.btn-search:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(130,195,65,.3);
}
.btn-search:active { transform: translateY(0); box-shadow: none; }

/* Custom dates */
.custom-dates-container {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1.5px solid var(--border);
    padding: .35rem .6rem;
    border-radius: var(--radius-pill);
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-sm);
    animation: fadeIn .25s ease-out;
}

/* Search options */
.search-options { display: flex; justify-content: center; }
.checkbox-container {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    cursor: pointer;
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-secondary);
    user-select: none;
    padding: .3rem .85rem;
    border-radius: var(--radius-pill);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all .2s;
}
.checkbox-container:hover {
    border-color: var(--primary);
    background: var(--primary-container);
    color: var(--on-primary-container);
}
.checkbox-container input { position: absolute; opacity: 0; width: 0; height: 0; }

.checkmark {
    position: relative;
    width: 32px; height: 18px;
    background: #CBD5E1;
    border-radius: var(--radius-pill);
    transition: background .22s cubic-bezier(.4,0,.2,1);
    flex-shrink: 0;
}
.checkmark::after {
    content: "";
    position: absolute;
    left: 2px; top: 2px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform .22s cubic-bezier(.4,0,.2,1);
}
.checkbox-container input:checked ~ .checkmark { background: var(--primary); }
.checkbox-container input:checked ~ .checkmark::after { transform: translateX(14px); }

/* ── Compact search bar (results mode) ─────────────────────── */
.compact-search {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    padding: .35rem .4rem .35rem 1rem;
    box-shadow: var(--shadow-sm);
    animation: fadeInDown .3s cubic-bezier(.16,1,.3,1) both;
    flex-shrink: 0;
    gap: .75rem;
}
.compact-search-info {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
    overflow: hidden;
}
.compact-search-info > .material-symbols-rounded {
    font-size: 17px;
    color: var(--primary);
    flex-shrink: 0;
}
.compact-zip {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    flex-shrink: 0;
}
.compact-chip {
    background: var(--primary-container);
    color: var(--on-primary-container);
    border-radius: var(--radius-pill);
    padding: .18rem .65rem;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}
.compact-edit-btn {
    display: flex;
    align-items: center;
    gap: .3rem;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: .42rem .9rem;
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: all .2s;
}
.compact-edit-btn .material-symbols-rounded { font-size: 15px; }
.compact-edit-btn:hover {
    background: var(--primary-container);
    border-color: var(--primary);
    color: var(--primary);
}

/* ── Results section ────────────────────────────────────────── */
.results-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ── Loading state ──────────────────────────────────────────── */
.loading-state {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 3rem 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin: auto;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-md);
    animation: fadeInUp .35s cubic-bezier(.16,1,.3,1);
    text-align: center;
}

.spinner {
    position: relative;
    width: 56px; height: 56px;
    flex-shrink: 0;
}
.spinner::before, .spinner::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: var(--primary);
    animation: spin 1.1s cubic-bezier(.68,-.55,.27,1.55) infinite;
}
.spinner::after {
    border-top-color: var(--text-primary);
    animation-delay: -.55s;
}

.loading-content { display: flex; flex-direction: column; gap: .35rem; align-items: center; }
.loading-title {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.loading-subtitle {
    font-size: .82rem;
    color: var(--text-secondary);
    animation: pulseText 1.8s ease-in-out infinite;
}

/* Geocoding progress bar */
.geocoding-progress {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-top: .5rem;
    width: 220px;
}
.progress-track {
    flex: 1;
    height: 5px;
    background: var(--border);
    border-radius: var(--radius-pill);
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-pill);
    width: 0%;
    transition: width .3s ease;
}
.progress-text {
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 40px;
    text-align: right;
}

/* ── Error state ────────────────────────────────────────────── */
.error-card {
    background: rgba(239,68,68,.04);
    border: 1px solid rgba(239,68,68,.15);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    flex-direction: column;
    align-items: center;
    gap: .65rem;
    max-width: 480px;
    margin: 2rem auto;
}
.error-ms-icon {
    font-size: 48px;
    color: var(--error);
    font-variation-settings: 'FILL' 0;
}
.error-card h3 {
    font-family: var(--font-head);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--error);
}
.error-card p { color: var(--text-secondary); font-size: .9rem; }

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: 3rem 2rem;
    text-align: center;
    flex: 1;
}
.empty-visual {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--primary-container);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .25rem;
}
.empty-icon {
    font-size: 40px;
    color: var(--primary);
    font-variation-settings: 'FILL' 0, 'wght' 300;
}
.empty-title {
    font-family: var(--font-head);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}
.empty-desc {
    font-size: .88rem;
    color: var(--text-secondary);
    max-width: 380px;
    line-height: 1.55;
}

/* ── Stats bar ──────────────────────────────────────────────── */
.stats-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: .55rem 1rem .55rem 1.1rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: .5rem;
    animation: fadeInUp .35s cubic-bezier(.16,1,.3,1);
    flex-shrink: 0;
}
.stats-chips {
    display: flex;
    align-items: center;
    gap: .65rem;
}
.stat-chip {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .8rem;
    color: var(--text-secondary);
}
.stat-chip .material-symbols-rounded {
    font-size: 16px;
    color: var(--text-tertiary);
}
.stat-chip strong {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text-primary);
}
.stat-chip--green strong { color: var(--success); }
.stat-chip--green .material-symbols-rounded { color: var(--success); }

.stat-sep { color: var(--border-hover); font-weight: 700; user-select: none; }

.stats-location {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--primary-container);
    padding: .25rem .7rem;
    border-radius: var(--radius-pill);
}
.stats-location .material-symbols-rounded { font-size: 14px; color: var(--primary); }
.stats-zip-text { color: var(--on-primary-container); }

/* ── Results container ──────────────────────────────────────── */
.results-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    animation: fadeInUp .5s cubic-bezier(.16,1,.3,1) .1s both;
}
.results-grid { display: none; } /* currently unused */

.map-container {
    flex: 1;
    width: 100%;
    min-height: 0;
    position: relative;
}
#map {
    width: 100%;
    height: 100%;
    min-height: 250px;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 5;
    background: #f1f5f9;
}

/* Leaflet pin cursor */
.custom-pin-icon { cursor: pointer !important; }

/* ── Leaflet overrides ──────────────────────────────────────── */
.leaflet-popup-content-wrapper {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
    font-family: var(--font-body) !important;
    padding: .4rem !important;
}
.leaflet-popup-tip { background: var(--surface) !important; }
.leaflet-container a.leaflet-popup-close-button {
    color: var(--text-secondary) !important;
    top: 8px !important; right: 8px !important;
}

/* ── Map legend ─────────────────────────────────────────────── */
.leaflet-control.map-legend {
    background: rgba(255,255,255,.97) !important;
    border: 1.5px solid var(--border) !important;
    padding: .85rem 1rem !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
    max-width: 340px !important;
    width: 340px !important;
    font-family: var(--font-body) !important;
    font-size: .74rem !important;
    color: var(--text-primary) !important;
    margin-bottom: 20px !important;
    margin-left: 10px !important;
    pointer-events: auto !important;
    backdrop-filter: blur(8px) !important;
}
.leaflet-control.map-legend h3 {
    font-family: var(--font-head) !important;
    font-size: .82rem !important;
    font-weight: 700 !important;
    margin: 0 0 .55rem 0 !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border) !important;
    padding-bottom: .35rem !important;
}
.legend-list { display: flex !important; flex-direction: column !important; gap: .35rem !important; }
.legend-row {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    height: 20px !important;
    cursor: pointer !important;
    transition: opacity .2s, transform .2s, background-color .2s !important;
    padding: .1rem .25rem !important;
    margin: 0 -.25rem !important;
    border-radius: 6px !important;
}
.legend-row:hover { background: rgba(0,0,0,.04) !important; transform: translateX(2px) !important; }
.legend-list:has(.legend-row.active) .legend-row:not(.active) { opacity: .3 !important; }
.legend-row.active { opacity: 1 !important; background: rgba(0,0,0,.07) !important; }
.legend-color-dot {
    display: inline-block !important;
    width: 8px !important; height: 8px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    box-shadow: 0 0 0 1.5px rgba(0,0,0,.12) !important;
    margin-right: .4rem !important;
}
.legend-text {
    white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important;
    font-weight: 600 !important; color: var(--text-secondary) !important;
    font-size: .7rem !important; min-width: 95px !important; max-width: 110px !important;
}
.legend-bar-wrapper {
    flex: 1 !important; height: 5px !important;
    background: #F1F5F9 !important; border-radius: var(--radius-pill) !important;
    overflow: hidden !important; margin: 0 .45rem !important; min-width: 36px !important;
}
.legend-bar-fill { height: 100% !important; border-radius: var(--radius-pill) !important; }
.legend-numbers {
    display: flex !important; align-items: center !important; gap: .15rem !important;
    font-size: .68rem !important; min-width: 52px !important; justify-content: flex-end !important;
}
.legend-count { color: var(--text-primary) !important; font-weight: 700 !important; }
.legend-pct { color: var(--text-secondary) !important; font-size: .62rem !important; }

/* Map tooltip */
.custom-map-tooltip {
    background: rgba(255,255,255,.98) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 8px 12px !important;
    font-family: var(--font-body) !important;
    pointer-events: none !important;
}
.custom-map-tooltip::before {
    border-top-color: rgba(255,255,255,.98) !important;
    border-width: 6px !important; margin-left: -6px !important;
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.25rem;
    animation: fadeIn .25s ease both;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 32px 64px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.06);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 680px;
    position: relative;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp .35s cubic-bezier(.16,1,.3,1) both;
}

/* Scrollable body inside modal */
#modalBody { overflow-y: auto; flex: 1; }

.modal-close-btn {
    position: absolute;
    top: 1rem; right: 1rem;
    background: rgba(255,255,255,.9);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all .2s;
    z-index: 10;
    backdrop-filter: blur(4px);
}
.modal-close-btn .material-symbols-rounded { font-size: 20px; }
.modal-close-btn:hover { background: #F1F5F9; color: var(--text-primary); border-color: var(--border-hover); }

/* Modal accent bar */
.modal-accent-bar {
    height: 5px;
    width: 100%;
    flex-shrink: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Modal header */
.modal-header-section {
    padding: 1.75rem 2rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.modal-header-meta {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
    flex-wrap: wrap;
}
.modal-sector-badge {
    display: inline-block;
    padding: .2rem .7rem;
    border-radius: var(--radius-pill);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    border: 1px solid;
}

.modal-content h2 {
    font-family: var(--font-head);
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.25;
    color: var(--text-primary);
    margin-bottom: .25rem;
    margin-right: 2.5rem;
}
.modal-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: .75rem;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .75rem;
}
.modal-tag {
    font-size: .75rem;
    background: var(--primary-container);
    border: 1px solid rgba(130,195,65,.15);
    padding: .25rem .7rem;
    border-radius: var(--radius-pill);
    color: var(--on-primary-container);
    font-weight: 600;
}
.badge-active {
    background: #E6F6ED !important;
    border-color: rgba(16,185,129,.2) !important;
    color: #059669 !important;
}
.badge-dissoute {
    background: #FDF2F2 !important;
    border-color: rgba(239,68,68,.15) !important;
    color: #DC2626 !important;
}
.badge-rup {
    background: #EEF2FF !important;
    border-color: rgba(79,70,229,.15) !important;
    color: #4f46e5 !important;
}

/* Modal body content */
.modal-body-content { padding: 1.5rem 2rem 2rem; }
.modal-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 560px) {
    .modal-details-grid { grid-template-columns: repeat(2, 1fr); }
    .full-width { grid-column: span 2; }
}

.detail-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.15rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.detail-card h3 {
    font-family: var(--font-head);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-tertiary);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    padding-bottom: .4rem;
}
.objet-text {
    font-size: .9rem;
    line-height: 1.65;
    color: var(--text-primary);
}
.obj-code {
    font-size: .8rem;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .35rem .6rem;
}
.address-text { font-size: .9rem; line-height: 1.55; color: var(--text-primary); font-weight: 500; }
.sub-info { font-size: .75rem; color: var(--text-tertiary); font-weight: 500; }

.info-table { display: flex; flex-direction: column; gap: .55rem; }
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: .85rem;
    border-bottom: 1px dashed var(--border);
    padding-bottom: .4rem;
    gap: .75rem;
}
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-label { color: var(--text-secondary); font-weight: 500; flex-shrink: 0; }
.info-value { color: var(--text-primary); font-weight: 600; text-align: right; }
.modal-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}
.modal-link:hover { color: var(--primary-hover); border-bottom-color: var(--primary-hover); }
.observation-text { font-style: italic; color: var(--text-secondary) !important; font-size: .88rem; line-height: 1.6; }

/* ── Badge (used in map tooltips) ───────────────────────────── */
.badge-tag {
    display: inline-block;
    padding: .2rem .6rem;
    background: #F1F5F9;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: .68rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ── Utility ────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Keyframes ──────────────────────────────────────────────── */
@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(28px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pulseText {
    0%, 100% { opacity: .65; }
    50%       { opacity: 1; }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .container { padding: .75rem; gap: .5rem; }
    .hero h1 { font-size: 1.35rem; }
    .search-box {
        flex-direction: column;
        align-items: stretch;
        border-radius: var(--radius-lg);
        padding: .75rem;
        gap: .5rem;
    }
    .input-divider { display: none; }
    .input-wrapper input, .input-wrapper select { padding: 1.1rem .5rem .25rem 2.2rem; }
    .btn-search { justify-content: center; width: 100%; }
    .stats-bar { flex-direction: column; align-items: flex-start; gap: .5rem; }
    .modal-content h2 { font-size: 1.35rem; }
    .modal-header-section, .modal-body-content { padding: 1.25rem; }
    .leaflet-control.map-legend { max-width: 270px !important; width: 270px !important; }
}

@media (max-width: 480px) {
    .stats-chips { flex-wrap: wrap; gap: .4rem; }
}
