/* Tipografía: Inter (archivos propios en fuentes/, sin CDN) */
@font-face { font-family: 'Inter'; src: url('fuentes/inter-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fuentes/inter-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fuentes/inter-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fuentes/inter-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fuentes/inter-latin-800-normal.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }

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

body, html {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a202c;
    overflow: hidden; 
}

#container {
    display: flex;
    height: 100vh;
    position: relative; 
}

#map {
    flex-grow: 1;
    z-index: 1;
}

#sidebar {
    width: 380px;
    background: #f8fafc;
    border-left: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    z-index: 2;
    box-shadow: -2px 0 10px rgba(0,0,0,0.05);
}

.sidebar-header {
    padding: 24px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: #2d3748;
}

#record-count {
    font-size: 0.85rem;
    color: #718096;
}

.filter-section {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ---------------------------------
   PANEL DE DETALLES E INTERACCIÓN
------------------------------------*/
#detail-panel {
    position: absolute;
    top: 0;
    left: -450px; 
    width: 420px;
    height: 100vh;
    background: #ffffff;
    box-shadow: 4px 0 25px rgba(0,0,0,0.15);
    z-index: 1000; 
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e2e8f0;
}

#detail-panel.open {
    left: 0;
}

.detail-header {
    padding: 20px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-header h2 {
    font-size: 1.2rem;
    color: #2b6cb0;
    margin: 0;
}

#close-details {
    background: none;
    border: none;
    font-size: 2rem;
    color: #a0aec0;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

#close-details:hover {
    color: #e53e3e;
}

.detail-content {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-section-title {
    margin-top: 4px;
    font-weight: 800;
    font-size: 0.92rem;
    color: #2d3748;
}

.detail-timeline {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #ffffff;
    padding: 14px;
}

.detail-timeline__title {
    font-weight: 700;
    color: #2d3748;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.detail-timeline__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #edf2f7;
}

.timeline-item__badge {
    min-width: 36px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    color: #1a365d;
    background: rgba(49, 130, 206, 0.14);
    border: 1px solid rgba(49, 130, 206, 0.22);
}

.timeline-item__main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.timeline-item__date {
    color: #4a5568;
    font-weight: 650;
    font-size: 0.88rem;
}

.timeline-item__amount {
    color: #1a202c;
    font-weight: 800;
    font-size: 0.95rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 12px;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 0.82rem;
    font-weight: 650;
    text-transform: none;
    letter-spacing: normal;
    color: #718096;
}

.detail-value {
    font-size: 0.95rem;
    color: #1a202c;
    line-height: 1.5;
    word-break: break-word;
}

.detail-value.metric {
    font-weight: 800;
    color: #1a365d;
}

.detail-value.muted {
    color: #4a5568;
}

.detail-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e0;
    background: #ffffff;
    color: #2b6cb0;
    text-decoration: none;
    font-weight: 700;
}

.detail-link:hover {
    background: #edf2f7;
}

.detail-value.edicto-text {
    font-size: 0.85rem;
    color: #4a5568;
    background: #f7fafc;
    padding: 12px;
    border-radius: 6px;
    border: 1px dashed #cbd5e0;
    white-space: pre-wrap; 
    margin-top: 4px;
}

/* CAJA DE REVISIÓN EN EL PANEL LATERAL */
.review-section {
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.review-section h3 {
    margin: 0 0 5px 0;
    color: #2b6cb0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.review-section label {
    color: #2c5282;
    font-size: 0.85rem;
    font-weight: bold;
}

.review-section textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}

.review-section textarea:focus {
    border-color: #3182ce;
}

.save-rev-btn {
    background: #3182ce;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 5px;
}

.save-rev-btn:hover {
    background: #2b6cb0;
}


.data-btn {
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.reconnect-btn {
    background: #dd6b20;
    color: white;
    border: none;
    animation: pulse 2s infinite;
}

.reconnect-btn:hover {
    background: #c05621;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(221, 107, 32, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(221, 107, 32, 0); }
    100% { box-shadow: 0 0 0 0 rgba(221, 107, 32, 0); }
}

.export-btn {
    background: #3182ce;
    color: white;
    border: none;
}

.export-btn:hover {
    background: #2b6cb0;
}

.import-btn {
    background: #edf2f7;
    color: #4a5568;
    border: 1px solid #cbd5e0;
}

.import-btn:hover {
    background: #e2e8f0;
}

/* ---------------------------------
   DISEÑO DE TAGS
------------------------------------*/
.tag-input-wrapper {
    background: #fff;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 0.2s;
}

.tag-input-wrapper:focus-within {
    border-color: #3182ce;
}

.active-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.active-tags-container:empty {
    display: none;
}

.custom-tag {
    font-size: 0.75rem;
    background: #3182ce;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

#gravamen-tags-container .custom-tag,
#rematante-tags-container .custom-tag {
    background: #e53e3e; 
}

.custom-tag-close {
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    line-height: 0.8;
}

.custom-tag-close:hover {
    color: #fed7d7;
}

.tag-text-input {
    border: none;
    background: transparent;
    padding: 4px 2px;
    font-family: inherit;
    font-size: 0.85rem;
    color: #2d3748;
    outline: none;
    width: 100%;
}

/* ---------------------------------
   ACORDEÓN DE UBICACIÓN
------------------------------------*/
.custom-accordion {
    background: white;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
}

.accordion-header {
    padding: 12px 15px;
    font-size: 0.85rem;
    font-weight: 650;
    text-transform: none;
    letter-spacing: normal;
    color: #4a5568;
    background: #edf2f7;
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 6px;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: #e2e8f0;
}

.accordion-header.open {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: 1px solid #e2e8f0;
}

.toggle-icon {
    font-size: 1.2rem;
    font-weight: normal;
    color: #718096;
    line-height: 1;
}

.accordion-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8fafc;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* ---------------------------------
   ESTILOS AIRBNB: SLIDER E HISTOGRAMA
------------------------------------*/
.slider-container {
    background: white;
    padding: 15px 12px 10px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
}

.histogram {
    display: flex;
    align-items: flex-end;
    height: 50px;
    gap: 2px;
    margin-bottom: -4px;
    padding: 0 10px;
}

.hist-bar {
    flex: 1;
    background-color: #e2e8f0;
    border-radius: 2px 2px 0 0;
    transition: background-color 0.2s ease;
}

.hist-bar.active {
    background-color: #3182ce;
}

.noUi-target {
    background: #e2e8f0;
    border: none;
    box-shadow: none;
    height: 4px;
    margin: 0 10px;
}

.noUi-connects {
    border-radius: 2px;
}

.noUi-connect {
    background: #3182ce;
}

.noUi-handle {
    width: 24px !important;
    height: 24px !important;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #3182ce;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    top: -10px !important;
    right: -12px !important;
    cursor: grab;
}

.noUi-handle:before, .noUi-handle:after {
    display: none;
}

.noUi-handle:active {
    cursor: grabbing;
}

.price-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    gap: 10px;
}

.input-wrapper {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 6px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: border-color 0.2s;
    width: 48%;
}

.input-wrapper:focus-within {
    border-color: #3182ce;
}

.currency-symbol {
    font-size: 0.85rem;
    color: #718096;
    font-weight: 600;
}

.price-input {
    border: none;
    background: transparent;
    font-weight: 600;
    color: #2d3748;
    width: 100%;
    outline: none;
    font-size: 0.85rem;
    font-family: inherit;
}

/* ---------------------------------
   ESTILOS PARA FECHAS
------------------------------------*/
.date-inputs-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.date-field {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px 10px;
    transition: border-color 0.2s;
}

.date-field:focus-within {
    border-color: #3182ce;
}

.date-label {
    font-size: 0.8rem;
    color: #718096;
    font-weight: 600;
    width: 55px;
}

.date-field input[type="date"] {
    flex: 1;
    border: none;
    background: transparent;
    padding: 6px 0;
    font-family: inherit;
    font-size: 0.85rem;
    color: #2d3748;
    outline: none;
    cursor: pointer;
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-group label {
    cursor: pointer;
    text-transform: none;
    font-weight: 500;
    letter-spacing: normal;
}

label {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    color: #4a5568;
}

select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #cbd5e0;
    background: white;
    font-size: 0.9rem;
    outline: none;
}

select:focus {
    border-color: #3182ce;
}



.leaflet-popup-content-wrapper {
    border-radius: 6px;
    padding: 0;
}

/* Basemap switch (Map / Satellite) */
.basemap-switch {
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
    display: inline-flex;
    gap: 0;
}

.basemap-switch__btn {
    width: 120px;
    height: 36px;
    padding: 0 10px;
    border: 0;
    background: rgba(255, 255, 255, 0.92);
    color: #334155;
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s ease, color 0.15s ease;
}

.basemap-switch__btn + .basemap-switch__btn {
    border-left: 1px solid rgba(148, 163, 184, 0.35);
}

.basemap-switch__btn:hover {
    background: rgba(237, 242, 247, 0.95);
}

.basemap-switch__btn:focus {
    outline: none;
}

.basemap-switch__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
}

.basemap-switch__label {
    line-height: 1;
}

.basemap-switch__btn.active {
    background: rgba(49, 130, 206, 0.14);
    color: #1a365d;
}

.popup-container {
    padding: 12px;
    min-width: 200px;
}

.popup-header {
    font-weight: bold;
    color: #2b6cb0;
    border-bottom: 1px solid #edf2f7;
    margin-bottom: 8px;
    padding-bottom: 4px;
}

.price-tag {
    display: inline-block;
    background: #f0fff4;
    color: #276749;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    margin-top: 4px;
}

.ver-mas-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 12px;
    background: #3182ce;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    text-align: center;
}

.ver-mas-btn:hover {
    background: #2b6cb0;
}

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-top: 8px;
    color: white;
}

/* ---------------------------------
   DARK MODE (DEFAULT)
   Overrides only — keeps JS intact
------------------------------------*/

/* Theme toggle button (header) */
.sidebar-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(203, 213, 225, 0.8);
    background: rgba(237, 242, 247, 0.9);
    color: #2d3748;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.8rem;
}

.theme-toggle:hover {
    background: #e2e8f0;
}

/* Segmented control (used for Moneda) */
.segmented-control {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.seg-btn {
    padding: 10px 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e0;
    background: #ffffff;
    color: #2d3748;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.82rem;
    text-align: center;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.seg-btn:hover {
    background: #edf2f7;
}

.seg-btn:active {
    transform: translateY(1px);
}

.seg-btn.active {
    border-color: #3182ce;
    background: rgba(49, 130, 206, 0.12);
    color: #1a365d;
}

/* ---------------------------------
   DARK THEME (opt-in via data-theme)
------------------------------------*/

html[data-theme="dark"], html[data-theme="dark"] body {
    background: #0b1220;
    color: #e5e7eb;
}

html[data-theme="dark"] #sidebar {
    background: #0f172a;
    border-left-color: rgba(148, 163, 184, 0.18);
    box-shadow: -2px 0 18px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .sidebar-header {
    background: rgba(15, 23, 42, 0.9);
    border-bottom-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] .sidebar-header h2 {
    color: #e5e7eb;
}

html[data-theme="dark"] #record-count {
    color: #94a3b8;
}
.busqueda-actual { display: flex; align-items: baseline; gap: 0 4px; flex-wrap: wrap; }
.busqueda-actual__nombre { color: #1e3a5f; font-weight: 700; overflow-wrap: anywhere; }
.busqueda-actual__nombre--suelta { color: #4a5568; font-weight: 600; }
html[data-theme="dark"] .busqueda-actual__nombre { color: #e2e8f0; }
html[data-theme="dark"] .busqueda-actual__nombre--suelta { color: #cbd5e1; }

html[data-theme="dark"] label {
    color: #cbd5e1;
}

html[data-theme="dark"] select,
html[data-theme="dark"] .input-wrapper,
html[data-theme="dark"] .tag-input-wrapper,
html[data-theme="dark"] .date-field,
html[data-theme="dark"] .review-section textarea {
    background: rgba(2, 6, 23, 0.65);
    color: #e5e7eb;
    border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] select:focus,
html[data-theme="dark"] .input-wrapper:focus-within,
html[data-theme="dark"] .tag-input-wrapper:focus-within,
html[data-theme="dark"] .date-field:focus-within,
html[data-theme="dark"] .review-section textarea:focus {
    border-color: rgba(56, 189, 248, 0.75);
}

html[data-theme="dark"] .currency-symbol,
html[data-theme="dark"] .date-label {
    color: #94a3b8;
}

html[data-theme="dark"] .price-input,
html[data-theme="dark"] .tag-text-input,
html[data-theme="dark"] .date-field input[type="date"] {
    color: #e5e7eb;
}

html[data-theme="dark"] .custom-accordion {
    background: rgba(2, 6, 23, 0.35);
    border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .accordion-header {
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
}

html[data-theme="dark"] .accordion-header:hover {
    background: rgba(148, 163, 184, 0.16);
}

html[data-theme="dark"] .toggle-icon {
    color: #94a3b8;
}

html[data-theme="dark"] .accordion-content {
    background: rgba(2, 6, 23, 0.35);
}



html[data-theme="dark"] #detail-panel {
    background: #0b1220;
    border-right-color: rgba(148, 163, 184, 0.18);
    box-shadow: 4px 0 28px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .detail-header {
    background: rgba(15, 23, 42, 0.92);
    border-bottom-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] .detail-header h2 {
    color: #7dd3fc;
}

html[data-theme="dark"] #close-details {
    color: #94a3b8;
}

html[data-theme="dark"] #close-details:hover {
    color: #fb7185;
}

html[data-theme="dark"] .detail-item {
    border-bottom-color: rgba(148, 163, 184, 0.14);
}

html[data-theme="dark"] .detail-label {
    color: #94a3b8;
}

html[data-theme="dark"] .detail-value {
    color: #e5e7eb;
}

html[data-theme="dark"] .detail-value.metric {
    color: #e5e7eb;
}

html[data-theme="dark"] .detail-value.muted {
    color: #cbd5e1;
}

html[data-theme="dark"] .detail-section-title {
    color: #e5e7eb;
}

html[data-theme="dark"] .detail-timeline {
    background: rgba(2, 6, 23, 0.55);
    border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .detail-timeline__title {
    color: #e5e7eb;
}

html[data-theme="dark"] .timeline-item {
    background: rgba(2, 6, 23, 0.4);
    border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] .timeline-item__badge {
    color: #e5e7eb;
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.25);
}

html[data-theme="dark"] .timeline-item__date {
    color: #cbd5e1;
}

html[data-theme="dark"] .timeline-item__amount {
    color: #e5e7eb;
}

html[data-theme="dark"] .detail-link {
    background: rgba(2, 6, 23, 0.55);
    border-color: rgba(148, 163, 184, 0.22);
    color: #7dd3fc;
}

html[data-theme="dark"] .detail-link:hover {
    background: rgba(148, 163, 184, 0.12);
}

html[data-theme="dark"] .detail-value.edicto-text {
    background: rgba(2, 6, 23, 0.55);
    border-color: rgba(148, 163, 184, 0.22);
    color: #cbd5e1;
}

html[data-theme="dark"] .review-section {
    background: rgba(14, 116, 144, 0.14);
    border-color: rgba(56, 189, 248, 0.25);
}

html[data-theme="dark"] .review-section h3 {
    color: #7dd3fc;
}

html[data-theme="dark"] .review-section label {
    color: #cbd5e1;
}

html[data-theme="dark"] .save-rev-btn {
    background: #0ea5e9;
}

html[data-theme="dark"] .save-rev-btn:hover {
    background: #0284c7;
}


html[data-theme="dark"] .import-btn {
    background: rgba(148, 163, 184, 0.12);
    color: #e5e7eb;
    border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .import-btn:hover {
    background: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] .slider-container {
    background: rgba(2, 6, 23, 0.55);
    border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .hist-bar {
    background-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .hist-bar.active {
    background-color: #38bdf8;
}

html[data-theme="dark"] .noUi-target {
    background: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .noUi-connect {
    background: #38bdf8;
}

html[data-theme="dark"] .noUi-handle {
    background: #0b1220;
    border-color: #38bdf8;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .leaflet-popup-content-wrapper,
html[data-theme="dark"] .leaflet-popup-tip {
    background: #0b1220;
    color: #e5e7eb;
}

html[data-theme="dark"] .basemap-switch {
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .basemap-switch__btn {
    background: rgba(2, 6, 23, 0.82);
    color: #cbd5e1;
}

html[data-theme="dark"] .basemap-switch__btn + .basemap-switch__btn {
    border-left-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .basemap-switch__btn:hover {
    background: rgba(148, 163, 184, 0.14);
}

html[data-theme="dark"] .basemap-switch__btn.active {
    background: rgba(56, 189, 248, 0.14);
    color: #e5e7eb;
}

html[data-theme="dark"] .popup-header {
    color: #7dd3fc;
    border-bottom-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] .price-tag {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
}

html[data-theme="dark"] .ver-mas-btn {
    background: #0ea5e9;
}

html[data-theme="dark"] .ver-mas-btn:hover {
    background: #0284c7;
}

html[data-theme="dark"] .theme-toggle {
    border-color: rgba(148, 163, 184, 0.22);
    background: rgba(2, 6, 23, 0.55);
    color: #e5e7eb;
}

html[data-theme="dark"] .theme-toggle:hover {
    background: rgba(148, 163, 184, 0.12);
}

html[data-theme="dark"] .seg-btn {
    background: rgba(2, 6, 23, 0.55);
    color: #e5e7eb;
    border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .seg-btn:hover {
    background: rgba(148, 163, 184, 0.12);
}

html[data-theme="dark"] .seg-btn.active {
    border-color: rgba(56, 189, 248, 0.75);
    background: rgba(56, 189, 248, 0.12);
    color: #e5e7eb;
}
/* ---------------------------------
   SESIÓN (Supabase, auth.js)
------------------------------------*/
/* Pantalla de inicio de sesión: tapa toda la app hasta que haya sesión */
body.sin-sesion { overflow: hidden; }

.login-screen {
    position: fixed;
    inset: 0;
    z-index: 5000; /* por encima de Leaflet y del panel de detalle */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow: hidden;
    /* Identidad de Remate Radar (igual que el video): azul marino con anillos y barrido de radar dorados.
       Es igual en tema claro y oscuro; lo que cambia con el tema es la tarjeta. */
    background: radial-gradient(circle at 50% 38%, #1f3d63 0%, #0c1a30 58%, #070f1d 100%);
}
.login-screen::before,
.login-screen::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 38%;
    width: 1600px;
    height: 1600px;
    margin: -800px 0 0 -800px;
    border-radius: 50%;
    pointer-events: none;
}
.login-screen::before {
    background: repeating-radial-gradient(circle, transparent 0 118px, rgba(212, 175, 55, 0.13) 118px 120px);
    -webkit-mask-image: radial-gradient(circle, #000 25%, transparent 70%);
    mask-image: radial-gradient(circle, #000 25%, transparent 70%);
}
.login-screen::after {
    background: conic-gradient(from 0deg, rgba(212, 175, 55, 0.16), transparent 55deg, transparent 360deg);
    -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 68%);
    mask-image: radial-gradient(circle, #000 20%, transparent 68%);
    animation: login-barrido 14s linear infinite;
}
@keyframes login-barrido { to { transform: rotate(360deg); } }

.login-screen[hidden],
.login-screen [hidden] { display: none !important; }

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 32px 28px;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    text-align: center;
    position: relative; /* encima de los anillos del fondo */
    z-index: 1;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

/* Fuente de la marca (Inter ExtraBold, licencia OFL; copia de marca/fuentes) solo para el nombre */
@font-face { font-family: 'Inter Marca'; src: url('fuentes/inter-latin-800-normal.woff2') format('woff2'); font-weight: 800; font-display: swap; }
/* Los botones y campos no heredan la letra por defecto: que usen Inter también */
button, input, select, textarea { font-family: inherit; }

@media (prefers-reduced-motion: reduce) { .login-screen::after { animation: none; } }

.login-card h1 { font-family: 'Inter Marca', 'Inter', -apple-system, sans-serif; font-size: 1.7rem; font-weight: 800; letter-spacing: -0.045em; color: #0f172a; margin-bottom: 4px; }
.login-marca__radar { color: #b7791f; } /* "Oro sobre claro" de la guía de marca */
.login-marca__cr {
    display: inline-block;
    margin-left: 2px;
    padding: 1px 6px;
    border: 1.5px solid currentColor;
    border-radius: 6px;
    font-size: 0.55em;
    font-weight: 800;
    letter-spacing: 0.04em;
    vertical-align: 0.35em;
    color: #b7791f;
}
.login-sub { font-size: 0.88rem; color: #64748b; margin-bottom: 24px; }
.login-checking { font-size: 0.9rem; color: #718096; }
/* Mientras se revisa la sesión (menos de un segundo) no se muestra nada: ni la tarjeta ni
   "Verificando sesión...". Si no hay sesión, aparece el login; si hay, la app. */
.login-screen.verificando { opacity: 0; pointer-events: none; }

.auth-form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.auth-form label { font-size: 0.82rem; font-weight: 600; color: #4a5568; }

.auth-form input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
}

.auth-form input:focus { outline: 2px solid #1e3a5f; outline-offset: 1px; border-color: #1e3a5f; }

.auth-form button {
    padding: 11px 12px;
    border: none;
    border-radius: 6px;
    background: #1e3a5f;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
}

.auth-form button:hover { background: #16304f; }
.auth-form button:focus-visible, .auth-google:focus-visible, .auth-tab:focus-visible { outline: 3px solid #d4af37; outline-offset: 2px; }
.auth-form button:disabled { opacity: 0.6; cursor: wait; }

.login-help { font-size: 0.76rem; color: #718096; line-height: 1.4; }

.auth-msg { margin-top: 14px; font-size: 0.85rem; }
.auth-msg[data-tipo="ok"] { color: #2f855a; }
.auth-msg[data-tipo="error"] { color: #c53030; }

/* Aviso legal después de iniciar sesión (auth.js: mostrarAvisoLegal) */
.aviso-legal {
    position: fixed;
    inset: 0;
    z-index: 6000; /* por encima de la pantalla de login y del mapa */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.72);
}
.aviso-legal[hidden] { display: none !important; }
.aviso-legal__card {
    width: 100%;
    max-width: 480px;
    background: #ffffff;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}
.aviso-legal__franja {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    background: #1e3a5f;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.aviso-legal__icono { width: 22px; height: 22px; flex: none; color: #f0d27a; }
.aviso-legal__cuerpo { padding: 22px 22px 8px; color: #1a202c; font-size: 0.95rem; line-height: 1.55; }
.aviso-legal__cuerpo p + p { margin-top: 12px; }
.aviso-legal__pie { display: flex; justify-content: flex-end; padding: 14px 22px 20px; }
#aviso-legal-aceptar {
    padding: 10px 26px;
    border: none;
    border-radius: 4px;
    background: #1e3a5f;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
}
#aviso-legal-aceptar.listo:hover .aviso-legal__barra { background: #16304f; }
#aviso-legal-aceptar:focus-visible { outline: 3px solid #c9a227; outline-offset: 2px; }
#aviso-legal-aceptar { position: relative; overflow: hidden; min-width: 150px; transition: background-color 0.25s, transform 0.25s; }
#aviso-legal-texto { position: relative; font-variant-numeric: tabular-nums; }
/* Bloqueado 3 s: botón gris con una barra azul que se llena de izquierda a derecha */
#aviso-legal-aceptar:disabled { background: #94a3b8; cursor: not-allowed; }
.aviso-legal__barra {
    position: absolute;
    inset: 0;
    background: #1e3a5f;
    transform: scaleX(0);
    transform-origin: left center;
}
#aviso-legal-aceptar.esperando .aviso-legal__barra { animation: aviso-legal-llenar 3s linear forwards; }
#aviso-legal-aceptar.listo .aviso-legal__barra { transform: scaleX(1); }
#aviso-legal-aceptar.listo { animation: aviso-legal-listo 0.35s ease-out; }
@keyframes aviso-legal-llenar { to { transform: scaleX(1); } }
@keyframes aviso-legal-listo { 50% { transform: scale(1.06); } }
.aviso-legal:not([hidden]) .aviso-legal__card { animation: aviso-legal-entrar 0.25s ease-out; }
@keyframes aviso-legal-entrar { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
    .aviso-legal:not([hidden]) .aviso-legal__card,
    #aviso-legal-aceptar.listo { animation: none; }
}
html[data-theme="dark"] .aviso-legal__card { background: #111827; border-color: rgba(148, 163, 184, 0.25); }
html[data-theme="dark"] .aviso-legal__cuerpo { color: #e2e8f0; }

html[data-theme="dark"] .login-card { background: #0f1b2e; border-color: rgba(212, 175, 55, 0.3); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); }
html[data-theme="dark"] .login-card h1 { color: #f1f5f9; }
html[data-theme="dark"] .login-marca__radar,
html[data-theme="dark"] .login-marca__cr { color: #d4af37; }
html[data-theme="dark"] .auth-form button { background: #d4af37; color: #0c1a30; }
html[data-theme="dark"] .auth-form button:hover { background: #e0bf4f; }
html[data-theme="dark"] .auth-form input:focus { outline-color: #d4af37; border-color: #d4af37; }
html[data-theme="dark"] .login-sub,
html[data-theme="dark"] .login-checking,
html[data-theme="dark"] .login-help { color: #94a3b8; }
html[data-theme="dark"] .auth-form label { color: #cbd5e1; }
html[data-theme="dark"] .auth-form input { background: rgba(15, 23, 42, 0.6); color: #e5e7eb; border-color: rgba(148, 163, 184, 0.3); }
html[data-theme="dark"] .auth-msg[data-tipo="ok"] { color: #68d391; }
html[data-theme="dark"] .auth-msg[data-tipo="error"] { color: #fc8181; }

/* Usuario con sesión, en el encabezado de la barra lateral */
.auth-box { margin-top: 12px; font-size: 0.8rem; color: #4a5568; }
.auth-box[hidden], .auth-box [hidden] { display: none !important; }
.auth-user { display: flex; align-items: center; gap: 8px; }
.auth-user span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.auth-user button {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e0;
    background: #edf2f7;
    color: #2d3748;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
}

.auth-user button:hover { background: #e2e8f0; }
html[data-theme="dark"] .auth-box { color: #cbd5e1; }
html[data-theme="dark"] .auth-user button { background: rgba(148, 163, 184, 0.12); color: #e5e7eb; border-color: rgba(148, 163, 184, 0.22); }
html[data-theme="dark"] .auth-user button:hover { background: rgba(148, 163, 184, 0.22); }

/* Estado de sincronización de revisiones (app.js, Supabase) */

/* Login: Google, pestañas, enlaces (auth.js) */
.auth-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 6px;
    border: 1px solid #cbd5e0;
    background: #ffffff;
    color: #2d3748;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
}
.auth-google:hover { background: #f7fafc; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    color: #a0aec0;
    font-size: 0.78rem;
}
.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; }

.auth-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 14px;
    border-radius: 6px;
    background: #edf2f7;
}
.auth-tab {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #4a5568;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}
.auth-tab.activa { background: #ffffff; color: #1a202c; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }

.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-form-title { font-size: 0.85rem; color: #4a5568; line-height: 1.4; }

.auth-links { display: flex; justify-content: center; }
.auth-form .auth-link {
    padding: 4px;
    border: none;
    background: none;
    color: #1e3a5f;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
}
.auth-form .auth-link:hover { background: none; text-decoration: underline; }

html[data-theme="dark"] .auth-google { background: rgba(15, 23, 42, 0.6); color: #e5e7eb; border-color: rgba(148, 163, 184, 0.3); }
html[data-theme="dark"] .auth-google:hover { background: rgba(148, 163, 184, 0.15); }
html[data-theme="dark"] .auth-divider { color: #64748b; }
html[data-theme="dark"] .auth-divider::before,
html[data-theme="dark"] .auth-divider::after { background: rgba(148, 163, 184, 0.25); }
html[data-theme="dark"] .auth-tabs { background: rgba(15, 23, 42, 0.6); }
html[data-theme="dark"] .auth-tab { color: #94a3b8; }
html[data-theme="dark"] .auth-tab.activa { background: rgba(148, 163, 184, 0.18); color: #f1f5f9; }
html[data-theme="dark"] .auth-form-title { color: #cbd5e1; }
html[data-theme="dark"] .auth-form .auth-link,
html[data-theme="dark"] .auth-form .auth-link:hover { color: #e0bf4f; background: none; }

/* Enlace a la página de administración (solo administradores) */
.auth-user .auth-user__admin {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e0;
    background: #edf2f7;
    color: #2d3748;
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none;
    white-space: nowrap;
}
.auth-user .auth-user__admin:hover { background: #e2e8f0; }
.auth-user .auth-user__admin[hidden] { display: none; }
html[data-theme="dark"] .auth-user .auth-user__admin { background: rgba(148, 163, 184, 0.12); color: #e5e7eb; border-color: rgba(148, 163, 184, 0.22); }
html[data-theme="dark"] .auth-user .auth-user__admin:hover { background: rgba(148, 163, 184, 0.22); }

/* Enlace a la política de privacidad en la pantalla de inicio */
.login-legal { margin-top: 18px; font-size: 0.78rem; text-align: center; }
.login-legal { color: #718096; line-height: 1.5; }
.login-legal a { color: #718096; }
html[data-theme="dark"] .login-legal a { color: #94a3b8; }

/* Acceso por usuario (auth.js): pantalla de acceso vencido y días restantes */
.acceso-panel[hidden] { display: none; }
.acceso-titulo { font-size: 1.02rem; font-weight: 700; color: #1a202c; }
.acceso-texto { font-size: 0.86rem; color: #4a5568; line-height: 1.45; }
.acceso-info {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
    margin-top: 8px; font-size: 0.8rem; color: #4a5568;
}
.acceso-info[hidden] { display: none; }
.acceso-info[data-nivel="bajo"] #acceso-dias { color: #c05621; font-weight: 700; }
.acceso-info .auth-link {
    padding: 0; border: none; background: none;
    color: #3182ce; font-weight: 600; font-size: 0.8rem; cursor: pointer;
}
.acceso-info .auth-link:hover { text-decoration: underline; }
html[data-theme="dark"] .acceso-titulo { color: #f1f5f9; }
html[data-theme="dark"] .acceso-texto,
html[data-theme="dark"] .acceso-info { color: #cbd5e1; }
html[data-theme="dark"] .acceso-info[data-nivel="bajo"] #acceso-dias { color: #fbbf24; }
html[data-theme="dark"] .acceso-info .auth-link { color: #63b3ed; }

/* ---------------------------------
   PANELES OCULTABLES (app.js: initPanelesOcultables)
------------------------------------*/
#container { overflow: hidden; }
#sidebar { transition: margin-right 0.25s ease; }
#container.filtros-ocultos #sidebar { margin-right: -380px; box-shadow: none; }

.panel-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001; /* sobre el mapa y el panel de detalle */
    width: 24px;
    height: 60px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #4a5568;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}
.panel-toggle:hover { background: #edf2f7; color: #2b6cb0; }
.panel-toggle:focus-visible { outline: 2px solid #3182ce; outline-offset: 2px; }
.panel-toggle[hidden] { display: none; }

.panel-toggle--der {
    right: 380px;
    border-right: none;
    border-radius: 8px 0 0 8px;
    transition: right 0.25s ease;
}
#container.filtros-ocultos .panel-toggle--der { right: 0; }

.panel-toggle--izq {
    left: 0;
    border-left: none;
    border-radius: 0 8px 8px 0;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.panel-toggle--izq.abierto { left: 420px; }

html[data-theme="dark"] .panel-toggle { background: #111827; color: #cbd5e1; border-color: rgba(148, 163, 184, 0.25); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
html[data-theme="dark"] .panel-toggle:hover { background: #1f2937; color: #93c5fd; }

/* ---------------------------------
   PREFERENCIAS DE FILTROS (app.js): búsquedas guardadas y predeterminados
------------------------------------*/
.presets-bar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    border: 1px dashed #cbd5e0;
    border-radius: 6px;
    background: #ffffff;
}
.presets-row { display: flex; gap: 6px; align-items: center; }
.presets-row[hidden] { display: none; }
.presets-row select { flex: 1; min-width: 0; padding: 6px 8px; font-size: 0.82rem; }
.presets-row input {
    flex: 1; min-width: 0;
    padding: 6px 8px; font-size: 0.82rem;
    border: 1px solid #cbd5e0; border-radius: 6px; outline: none;
}
.presets-row input:focus { border-color: #3182ce; }
.presets-row button {
    padding: 6px 9px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background: #edf2f7;
    color: #2d3748;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}
.presets-row button:hover { background: #e2e8f0; }
.presets-row button[hidden] { display: none; }
.presets-msg { font-size: 0.75rem; color: #718096; }
.presets-msg[hidden] { display: none; }
.presets-msg[data-tipo="ok"] { color: #2f855a; }
.presets-msg[data-tipo="error"] { color: #c53030; }

.filter-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.guardar-default {
    flex-shrink: 0;
    padding: 0;
    border: none;
    background: none;
    color: #3182ce;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.guardar-default:hover { text-decoration: underline; }
.guardar-default[hidden] { display: none; }
.guardar-default[data-estado="guardado"] { color: #2f855a; cursor: default; text-decoration: none; }

html[data-theme="dark"] .presets-bar { background: rgba(15, 23, 42, 0.6); border-color: rgba(148, 163, 184, 0.3); }
html[data-theme="dark"] .presets-row input { background: rgba(15, 23, 42, 0.8); color: #e5e7eb; border-color: rgba(148, 163, 184, 0.3); }
html[data-theme="dark"] .presets-row button { background: rgba(148, 163, 184, 0.12); color: #e5e7eb; border-color: rgba(148, 163, 184, 0.25); }
html[data-theme="dark"] .presets-row button:hover { background: rgba(148, 163, 184, 0.22); }
html[data-theme="dark"] .presets-msg { color: #94a3b8; }
html[data-theme="dark"] .presets-msg[data-tipo="ok"] { color: #68d391; }
html[data-theme="dark"] .presets-msg[data-tipo="error"] { color: #fc8181; }
html[data-theme="dark"] .guardar-default { color: #63b3ed; }
html[data-theme="dark"] .guardar-default[data-estado="guardado"] { color: #68d391; }

/* Búsquedas guardadas al final de los filtros */
.presets-bar { margin-top: 6px; }

/* ---------------------------------
   MIS REVISIONES (revisiones.js): lista + detalle, sin el mapa
------------------------------------*/
.vista-rev {
    --vr-fondo: #f1f5f9;
    --vr-panel: #ffffff;
    --vr-borde: #e2e8f0;
    --vr-texto: #1a202c;
    --vr-suave: #64748b;
    --vr-acento: #2b6cb0;
    --vr-acento-fondo: rgba(49, 130, 206, 0.10);
    --vr-potencial: #38a169;
    --vr-descartado: #a0aec0;
    --vr-sin-revisar: #e53e3e;
    position: fixed;
    inset: 0;
    z-index: 2000; /* sobre el mapa y los paneles; debajo del login (5000) */
    display: flex;
    flex-direction: column;
    background: var(--vr-fondo);
    color: var(--vr-texto);
}
.vista-rev[hidden] { display: none; }
html[data-theme="dark"] .vista-rev {
    --vr-fondo: #0b1220;
    --vr-panel: #0f172a;
    --vr-borde: rgba(148, 163, 184, 0.2);
    --vr-texto: #e5e7eb;
    --vr-suave: #94a3b8;
    --vr-acento: #7dd3fc;
    --vr-acento-fondo: rgba(56, 189, 248, 0.12);
    --vr-descartado: #94a3b8;
    --vr-sin-revisar: #f56565;
}

.vr-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    padding: 14px 24px;
    background: var(--vr-panel);
    border-bottom: 1px solid var(--vr-borde);
}
.vr-header__fila { display: flex; align-items: center; gap: 14px; }
.vr-header h1 { font-size: 1.2rem; font-weight: 800; }
.vr-herramientas { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.vr-controles { display: flex; align-items: center; gap: 10px; }

.vr-volver, .vr-atras, .vr-boton {
    border: 1px solid var(--vr-borde);
    background: var(--vr-panel);
    color: var(--vr-acento);
    font: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 7px 12px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}
.vr-volver:hover, .vr-atras:hover, .vr-boton:hover { background: var(--vr-acento-fondo); }
.vr-boton[hidden] { display: none; }

.vr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vr-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--vr-borde);
    background: var(--vr-panel);
    color: var(--vr-texto);
    font: inherit;
    font-size: 0.83rem;
    font-weight: 600;
    padding: 6px 11px;
    border-radius: 6px;
    cursor: pointer;
}
.vr-chip:hover { border-color: var(--vr-acento); }
.vr-chip[aria-pressed="true"] { background: var(--vr-acento-fondo); border-color: var(--vr-acento); color: var(--vr-acento); }
.vr-chip__n { color: var(--vr-suave); font-weight: 700; font-variant-numeric: tabular-nums; }
.vr-chip[aria-pressed="true"] .vr-chip__n { color: inherit; }

.vr-punto { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.vr-punto--potencial { background: var(--vr-potencial); }
.vr-punto--descartado { background: var(--vr-descartado); }
.vr-punto--sin-revisar { background: var(--vr-sin-revisar); }

.vr-buscar, .vr-orden select {
    font: inherit;
    font-size: 0.85rem;
    color: var(--vr-texto);
    background: var(--vr-panel);
    border: 1px solid var(--vr-borde);
    border-radius: 6px;
    padding: 7px 10px;
}
.vr-buscar { width: 280px; }
.vr-buscar:focus, .vr-orden select:focus { outline: 2px solid var(--vr-acento); outline-offset: -1px; }
.vr-orden { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--vr-suave); font-weight: 600; }

.vr-cuerpo { flex: 1; min-height: 0; display: flex; }

.vr-lista {
    width: 420px;
    flex: none;
    overflow-y: auto;
    padding: 12px 14px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-right: 1px solid var(--vr-borde);
}
.vr-grupo {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--vr-suave);
    padding: 10px 4px 2px;
}
.vr-grupo:first-child { padding-top: 2px; }

.vr-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    text-align: left;
    font: inherit;
    color: var(--vr-texto);
    background: var(--vr-panel);
    border: 1px solid var(--vr-borde);
    border-radius: 6px;
    padding: 11px 13px;
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.vr-card:hover { box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08); }
.vr-card:focus-visible { outline: 2px solid var(--vr-acento); outline-offset: 2px; }
.vr-card--sel { border-color: var(--vr-acento); box-shadow: 0 0 0 1px var(--vr-acento); }

.vr-card__arriba { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.vr-estado { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 700; color: var(--vr-suave); }
.vr-card__fecha { font-size: 0.78rem; font-weight: 700; color: var(--vr-acento); white-space: nowrap; }
.vr-card__fecha--pasado { color: var(--vr-suave); font-weight: 600; }
.vr-card__titulo { font-weight: 700; font-size: 0.95rem; }
.vr-card__sub {
    font-size: 0.82rem;
    color: var(--vr-suave);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.vr-card__precio { font-weight: 800; font-size: 0.95rem; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 8px; }
.vr-card__ordinal { font-size: 0.72rem; font-weight: 600; color: var(--vr-suave); }
.vr-card__nota {
    margin-top: 2px;
    font-size: 0.84rem;
    line-height: 1.45;
    white-space: pre-line;
    word-break: break-word;
    padding: 7px 9px;
    border-radius: 6px;
    background: var(--vr-acento-fondo);
}
.vr-card__nota-texto {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.vr-card__pie { font-size: 0.72rem; color: var(--vr-suave); }

.vr-detalle { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--vr-panel); }
.vr-detalle__cab {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 28px;
    border-bottom: 1px solid var(--vr-borde);
}
.vr-detalle__titulos { flex: 1; min-width: 0; }
.vr-detalle__titulos h2 { font-size: 1.1rem; font-weight: 800; color: var(--vr-texto); }
.vr-detalle__titulos p { font-size: 0.82rem; color: var(--vr-suave); margin-top: 2px; }
.vr-detalle__contenido { max-width: 860px; width: 100%; padding: 22px 28px 40px; }
.vr-atras { display: none; }

.vr-vacio { text-align: center; padding: 48px 16px; color: var(--vr-suave); display: flex; flex-direction: column; gap: 10px; align-items: center; font-size: 0.9rem; }
.vr-vacio__titulo { font-weight: 800; font-size: 1rem; color: var(--vr-texto); }
.vr-cargando { color: var(--vr-suave); font-size: 0.9rem; padding: 12px 4px; }

/* Entrada en el mapa (debajo de Mapa / Satélite) */
.vr-entrada { border-radius: 6px; overflow: hidden; box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18); }
.vr-entrada__btn {
    width: 240px;
    height: 36px;
    border: 0;
    background: rgba(255, 255, 255, 0.92);
    color: #1a365d;
    font-weight: 800;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.vr-entrada__btn:hover { background: rgba(237, 242, 247, 0.95); }
html[data-theme="dark"] .vr-entrada { box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5); }
html[data-theme="dark"] .vr-entrada__btn { background: rgba(15, 23, 42, 0.92); color: #e5e7eb; }
html[data-theme="dark"] .vr-entrada__btn:hover { background: rgba(30, 41, 59, 0.95); }

/* Pantallas angostas: una columna; el detalle tapa la lista */
@media (max-width: 860px) {
    .vr-header { padding: 12px 14px; }
    .vr-herramientas, .vr-controles { width: 100%; }
    .vr-controles { flex-wrap: wrap; }
    .vr-buscar { flex: 1 1 100%; width: auto; min-width: 0; }
    .vr-lista { width: 100%; border-right: 0; }
    .vr-detalle { display: none; }
    .vista-rev.vr--detalle .vr-lista { display: none; }
    .vista-rev.vr--detalle .vr-detalle { display: flex; }
    .vr-atras { display: inline-block; }
    .vr-detalle__cab { padding: 12px 14px; flex-wrap: wrap; justify-content: space-between; }
    .vr-detalle__titulos { order: 3; flex-basis: 100%; }
    .vr-detalle__contenido { padding: 16px 14px 32px; }
}

/* Botón "Copiar" junto a la etiqueta (edicto completo) */
.detail-label--accion { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.copiar-btn {
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #cbd5e0;
    background: #ffffff;
    color: #2b6cb0;
    cursor: pointer;
    white-space: nowrap;
}
.copiar-btn:hover { background: #edf2f7; }
.copiar-btn--ok { color: #2f855a; border-color: #9ae6b4; }
html[data-theme="dark"] .copiar-btn { background: rgba(2, 6, 23, 0.6); color: #7dd3fc; border-color: rgba(148, 163, 184, 0.3); }
html[data-theme="dark"] .copiar-btn:hover { background: rgba(148, 163, 184, 0.15); }
html[data-theme="dark"] .copiar-btn--ok { color: #68d391; border-color: rgba(104, 211, 145, 0.4); }
/* ★ = la búsqueda guardada que se aplica al abrir la app */
#preset-inicial { font-size: 1rem; line-height: 1; }
#preset-inicial[aria-pressed="true"] { color: #d69e2e; }

/* Frente a calle (experimental, solo admins) */
#frente-group[hidden] { display: none; }
.frente-nota { font-size: 0.75rem; color: #718096; margin-top: 2px; }
.frente-sub { font-size: 0.82rem; color: #4a5568; }
html[data-theme="dark"] .frente-sub, html[data-theme="dark"] .frente-nota { color: #94a3b8; }

/* Tooltips cortos del mapa (medida de un lado, línea de frente) */
.leaflet-tooltip.tip-corto { padding: 3px 7px; font-size: 0.78rem; line-height: 1.3; white-space: nowrap; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); }
.leaflet-tooltip.tip-corto b { font-weight: 700; }

/* Frente a calle: fuentes del filtro (selección múltiple) */

/* Frente a calle: ficha del detalle */
.frente-ficha { display: flex; flex-direction: column; gap: 6px; }
.dimensiones { display: flex; flex-direction: column; gap: 10px; }
.dimensiones__subtitulo { font-size: 0.78rem; font-weight: 700; color: #4a5568; margin-bottom: -4px; }
html[data-theme="dark"] .dimensiones__subtitulo { color: #a0aec0; }
.frente-renglon { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 4px 10px; padding: 7px 10px; border-radius: 6px; background: #f8fafc; border: 1px solid #e2e8f0; }
.frente-renglon--acceso { border: 1px dashed #d97706; background: #fffbeb; }
.frente-renglon__m { font-weight: 800; font-variant-numeric: tabular-nums; color: #1a202c; }
.frente-renglon__rumbo { font-size: 0.82rem; color: #4a5568; }
.frente-renglon__tags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.frente-tag { font-size: 0.7rem; font-weight: 700; padding: 2px 7px; border-radius: 5px; white-space: nowrap; max-width: 210px; overflow: hidden; text-overflow: ellipsis; border: 1px solid transparent; }
.frente-tag--catastro { background: #dcfce7; color: #166534; }
.frente-tag--osm { background: #dbeafe; color: #1e40af; }
.frente-tag--edicto { background: #f3e8ff; color: #6b21a8; }
.frente-tag--acceso { background: #fef3c7; color: #92400e; }
.frente-tag--gris { background: #edf2f7; color: #4a5568; }
.frente-tag--esquinero { background: #fff; color: #15803d; border-color: #86efac; }
.frente-tag--alerta { background: #fee2e2; color: #991b1b; }
.frente-vacio { font-size: 0.85rem; color: #718096; font-style: italic; padding: 4px 0; }
.frente-nota-ficha { font-size: 0.78rem; color: #718096; }
.frente-pie { display: flex; flex-wrap: wrap; gap: 4px; }
.frente-pie .frente-tag { max-width: none; white-space: normal; }
html[data-theme="dark"] .frente-renglon { background: rgba(2, 6, 23, 0.5); border-color: rgba(148, 163, 184, 0.2); }
html[data-theme="dark"] .frente-renglon--acceso { background: rgba(217, 119, 6, 0.1); border-color: #f59e0b; }
html[data-theme="dark"] .frente-renglon__m { color: #f1f5f9; }
html[data-theme="dark"] .frente-tag--catastro { background: rgba(22, 163, 74, 0.2); color: #86efac; }
html[data-theme="dark"] .frente-tag--osm { background: rgba(37, 99, 235, 0.22); color: #93c5fd; }
html[data-theme="dark"] .frente-tag--edicto { background: rgba(147, 51, 234, 0.22); color: #d8b4fe; }
html[data-theme="dark"] .frente-tag--acceso { background: rgba(217, 119, 6, 0.22); color: #fcd34d; }
html[data-theme="dark"] .frente-tag--gris { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }
html[data-theme="dark"] .frente-tag--esquinero { background: transparent; color: #86efac; border-color: rgba(134, 239, 172, 0.5); }
html[data-theme="dark"] .frente-tag--alerta { background: rgba(220, 38, 38, 0.2); color: #fca5a5; }

/* ↻ Actualizar «búsqueda»: aparece al cambiar algo de una búsqueda guardada */
.preset-actualizar {
    padding: 6px 10px; border: 1px solid #90cdf4; border-radius: 6px;
    background: #ebf8ff; color: #2b6cb0; font-size: 0.8rem; font-weight: 700;
    cursor: pointer; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.preset-actualizar:hover { background: #bee3f8; }
.preset-actualizar[hidden] { display: none; }
html[data-theme="dark"] .preset-actualizar { background: rgba(66, 153, 225, 0.15); color: #90cdf4; border-color: rgba(144, 205, 244, 0.4); }
html[data-theme="dark"] .preset-actualizar:hover { background: rgba(66, 153, 225, 0.25); }

/* 🔔 búsqueda con alerta por correo encendida */
.presets-row button#preset-alerta.activa { background: #fefcbf; border-color: #f6e05e; }
html[data-theme="dark"] .presets-row button#preset-alerta.activa { background: rgba(214, 158, 46, 0.2); border-color: rgba(246, 224, 94, 0.45); }

/* Contacto del juzgado en el detalle (app.js: nodoJuzgado) */
.juzgado-ficha { display: flex; flex-direction: column; gap: 6px; }
.juzgado-ficha__nombre { font-weight: 700; }
.juzgado-ficha__lineas { display: flex; flex-wrap: wrap; gap: 6px; }
.juzgado-dato { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 5px; background: #ebf8ff; border: 1px solid #bee3f8; color: #2b6cb0; font-size: 0.82rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
a.juzgado-dato:hover, .juzgado-dato a:hover { text-decoration: underline; }
.juzgado-dato a { color: inherit; text-decoration: none; }
.juzgado-dato--correo { white-space: normal; word-break: break-all; }
.juzgado-dato .copiar-btn { margin-left: 2px; }
.juzgado-ficha__ext, .juzgado-ficha__notas { font-size: 0.78rem; color: #718096; }
.juzgado-ficha__notas { white-space: pre-wrap; }
.juzgado-agregar { display: inline-block; margin-left: 8px; font-size: 0.75rem; font-weight: 600; color: #2b6cb0; text-decoration: none; }
.juzgado-agregar:hover { text-decoration: underline; }
html[data-theme="dark"] .juzgado-dato { background: rgba(66, 153, 225, 0.14); border-color: rgba(144, 205, 244, 0.35); color: #90cdf4; }
html[data-theme="dark"] .juzgado-ficha__ext, html[data-theme="dark"] .juzgado-ficha__notas { color: #a0aec0; }
html[data-theme="dark"] .juzgado-agregar { color: #90cdf4; }

/* Aviso legal al pie del detalle del remate (app.js: construirDetalle) */
.detalle-aviso { margin: 14px 0 4px; padding: 8px 10px; border-radius: 6px; background: #fffaf0; border: 1px solid #fbd38d; color: #744210; font-size: 0.74rem; line-height: 1.45; }
.detalle-aviso a { color: inherit; font-weight: 600; }
html[data-theme="dark"] .detalle-aviso { background: rgba(214, 158, 46, 0.12); border-color: rgba(246, 224, 94, 0.3); color: #f6e05e; }

/* Mini Street View en la esquina inferior derecha del mapa (app.js: ControlStreetView) */
.sv-mapa { width: var(--sv-ancho, 340px); background: #1f2937; border-radius: 6px; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25); overflow: hidden; margin-bottom: 6px !important; }
.sv-mapa[hidden] { display: none; }
/* El iframe es 80 px más alto y sube 80 px: oculta el recuadro de Google con la dirección
   y "View on Google Maps" (arriba a la izquierda). La barra legal de abajo queda visible. */
.sv-mapa__marco { position: relative; height: var(--sv-alto, 210px); overflow: hidden; background: #e2e8f0; }
.sv-mapa iframe { display: block; width: 100%; height: calc(var(--sv-alto, 210px) + 80px); margin-top: -80px; border: 0; }
.sv-mapa__cerrar { position: absolute; top: 6px; left: 40px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: #1a202c; font-size: 0.85rem; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
.sv-mapa__cerrar:hover { background: #ffffff; }
.sv-mapa__cerrar:focus-visible { outline: 2px solid #90cdf4; outline-offset: 2px; }
@media (max-width: 860px) { .sv-mapa { width: var(--sv-ancho, min(260px, 70vw)); } .sv-mapa__marco { height: var(--sv-alto, 150px); } .sv-mapa iframe { height: calc(var(--sv-alto, 150px) + 80px); } }
/* Agarradera para cambiar el tamaño (arriba a la izquierda; la ✕ va a su lado) */
.sv-mapa__tamano { position: absolute; top: 6px; left: 6px; width: 28px; height: 28px; border: 0; border-radius: 50%; display: grid; place-items: center;
    background: rgba(255, 255, 255, 0.92); color: #1a202c; cursor: nwse-resize; touch-action: none; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
.sv-mapa__tamano:hover { background: #ffffff; }
.sv-mapa__tamano:focus-visible { outline: 2px solid #90cdf4; outline-offset: 2px; }
.sv-mapa--redimensionando iframe { pointer-events: none; }
.sv-mapa--redimensionando, .sv-mapa--redimensionando * { user-select: none; }
/* Muñequito de la vista de calle (dibujo propio, SVG en línea) */
.sv-munequito { background: none; border: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45)); }
.sv-munequito svg { display: block; }
.sv-munequito--otro { cursor: pointer; opacity: 0.85; }
.sv-munequito--otro:hover { opacity: 1; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6)); }

/* =====================================================
   BÚSQUEDA DE REMATES (arriba, a la izquierda de Mapa/Satélite)
   ===================================================== */
.barra-mapa { display: flex; align-items: flex-start; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.busqueda-mapa { position: relative; display: flex; width: 340px; height: 36px; border-radius: 6px; background: rgba(255, 255, 255, 0.96); box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18); }
.busqueda-mapa__campo { border: 0; border-right: 1px solid rgba(148, 163, 184, 0.35); background: transparent; color: #334155; font: inherit; font-size: 0.78rem; font-weight: 700; padding: 0 6px 0 10px; border-radius: 8px 0 0 8px; cursor: pointer; max-width: 112px; }
.busqueda-mapa__texto { flex: 1; min-width: 0; border: 0; background: transparent; color: #1a202c; font: inherit; font-size: 0.85rem; padding: 0 12px 0 10px; border-radius: 0 8px 8px 0; }
.busqueda-mapa__campo:focus-visible, .busqueda-mapa__texto:focus-visible { outline: 2px solid #3182ce; outline-offset: -2px; }
.busqueda-mapa__lista { position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 4px; list-style: none; background: #ffffff; border-radius: 6px; box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22); max-height: 60vh; overflow-y: auto; z-index: 1000; }
.busqueda-mapa__lista[hidden] { display: none; }
.busqueda-mapa__item { padding: 7px 9px; border-radius: 5px; cursor: pointer; }
.busqueda-mapa__item:hover, .busqueda-mapa__item.activo { background: #ebf4ff; }
.busqueda-mapa__l1 { display: flex; justify-content: space-between; gap: 8px; font-size: 0.82rem; color: #1a202c; }
.busqueda-mapa__fecha { color: #4a5568; white-space: nowrap; font-size: 0.75rem; }
.busqueda-mapa__exp { font-weight: 500; }
/* Lo que calza con la búsqueda, en negrita */
.busqueda-mapa__lista strong { font-weight: 800; color: #1a202c; background: rgba(250, 204, 21, 0.28); border-radius: 2px; }
.busqueda-mapa__campo-nombre { color: #718096; }
.busqueda-mapa__l2 { font-size: 0.74rem; color: #4a5568; margin-top: 2px; }
.busqueda-mapa__vacio { padding: 7px 9px; font-size: 0.78rem; color: #4a5568; }
html[data-theme="dark"] .busqueda-mapa { background: rgba(17, 24, 39, 0.94); }
html[data-theme="dark"] .busqueda-mapa__campo { color: #e5e7eb; border-right-color: rgba(75, 85, 99, 0.6); }
html[data-theme="dark"] .busqueda-mapa__campo option { background: #111827; }
html[data-theme="dark"] .busqueda-mapa__texto { color: #f9fafb; }
html[data-theme="dark"] .busqueda-mapa__lista { background: #111827; }
html[data-theme="dark"] .busqueda-mapa__item:hover, html[data-theme="dark"] .busqueda-mapa__item.activo { background: #1f2937; }
html[data-theme="dark"] .busqueda-mapa__l1 { color: #f9fafb; }
html[data-theme="dark"] .busqueda-mapa__fecha, html[data-theme="dark"] .busqueda-mapa__l2, html[data-theme="dark"] .busqueda-mapa__vacio { color: #cbd5e0; }
@media (max-width: 860px) {
    .busqueda-mapa { width: min(340px, calc(100vw - 80px)); }
}

/* Mi Revisión: estado del guardado automático */
.rev-estado { min-height: 1.2em; margin-top: 6px; font-size: 0.78rem; color: #4a5568; }
.rev-estado--ok { color: #2f855a; }
.rev-estado--error { color: #c53030; }
.rev-reintentar { border: 0; background: none; color: #2b6cb0; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0; }
html[data-theme="dark"] .rev-estado { color: #cbd5e0; }
html[data-theme="dark"] .rev-estado--ok { color: #68d391; }
html[data-theme="dark"] .rev-estado--error { color: #fc8181; }
html[data-theme="dark"] .rev-reintentar { color: #90cdf4; }
html[data-theme="dark"] .busqueda-mapa__lista strong { color: #ffffff; background: rgba(250, 204, 21, 0.25); }
html[data-theme="dark"] .busqueda-mapa__campo-nombre { color: #a0aec0; }

/* Notificación efímera sobre el mapa */
.notificacion-mapa { position: absolute; top: calc(100% + 8px); left: 0; right: 0; transform: translateY(-6px); z-index: 1100;
    background: #1a202c; color: #ffffff; font-size: 0.85rem; padding: 9px 14px; border-radius: 6px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
    opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; }
.notificacion-mapa.visible { opacity: 1; transform: translateY(0); }

/* Aviso en el detalle: el remate no calza con los filtros */
.aviso-filtros { margin: 0 0 14px; padding: 10px 12px; border-radius: 6px; background: #fffaf0; border: 1px solid #fbd38d; color: #744210; font-size: 0.85rem; }
.aviso-filtros__cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.aviso-filtros__titulo { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: inherit; cursor: default; text-align: left; }
.aviso-filtros--chico { display: inline-block; padding: 4px 8px; margin-bottom: 10px; }
.aviso-filtros--chico .aviso-filtros__titulo { cursor: pointer; font-size: 0.78rem; }
.aviso-filtros__acciones { display: inline-flex; gap: 2px; }
.aviso-filtros__acciones button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 0.9rem; line-height: 1; padding: 2px 6px; border-radius: 4px; }
.aviso-filtros__acciones button:hover { background: rgba(116, 66, 16, 0.12); }
.aviso-filtros ul { margin: 6px 0 0; padding-left: 18px; }
.aviso-filtros li + li { margin-top: 2px; }
html[data-theme="dark"] .aviso-filtros { background: #2d2412; border-color: #975a16; color: #fbd38d; }
html[data-theme="dark"] .aviso-filtros__acciones button:hover { background: rgba(251, 211, 141, 0.15); }

/* Login en dos pasos: "Continuar con correo" debajo de Google, del mismo tamaño */
.auth-correo { margin-top: 10px; }
.auth-form[hidden] { display: none !important; }

/* =====================================================
   VISTA DE CELULAR (pantallas de 760 px o menos; la computadora no cambia)
   Filtros a pantalla completa con el botón "Filtros"; detalle como hoja desde abajo.
   ===================================================== */
.btn-filtros-movil, .cerrar-filtros-movil, .hoja-agarradera { display: none; }

@media (max-width: 760px) {
    #container { display: block; }
    #map { position: absolute; inset: 0; }

    /* Filtros: cerrados; se abren a pantalla completa */
    #sidebar { position: fixed; inset: 0; width: 100%; z-index: 1500; margin-right: 0 !important; border-left: 0; box-shadow: none;
        transform: translateX(100%); transition: transform 0.25s ease; }
    body.filtros-abiertos-movil #sidebar { transform: none; }
    .sidebar-header { padding: 14px 16px; }
    .filter-section { padding: 14px 16px 90px; }
    .cerrar-filtros-movil { display: inline-flex; align-items: center; padding: 7px 12px; white-space: nowrap; flex-shrink: 0; border-radius: 6px; border: 1px solid #1e3a5f;
        background: #1e3a5f; color: #ffffff; font-weight: 700; font-size: 0.85rem; cursor: pointer; }
    .panel-toggle { display: none !important; }

    .btn-filtros-movil { display: inline-flex; align-items: center; gap: 8px; position: fixed; left: 12px; bottom: calc(18px + env(safe-area-inset-bottom));
        z-index: 1100; padding: 10px 16px; border-radius: 6px; border: 0; background: #1e3a5f; color: #ffffff; font-weight: 700; font-size: 0.9rem;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.3); cursor: pointer; }
    .btn-filtros-movil__conteo { background: rgba(255, 255, 255, 0.18); border-radius: 5px; padding: 1px 7px; font-size: 0.8rem; }
    .btn-filtros-movil__conteo:empty { display: none; }
    body.detalle-abierto .btn-filtros-movil, body.filtros-abiertos-movil .btn-filtros-movil { display: none; }

    /* Detalle: hoja que sube desde abajo (alto variable: se arrastra la agarradera o el encabezado, ver initHojaArrastrable) */
    #detail-panel { top: auto; bottom: 0; left: 0 !important; width: 100%; height: var(--hoja-alto, 58vh); border-right: 0;
        border-radius: 8px 8px 0 0; box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.2);
        transform: translateY(105%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s ease; }
    #detail-panel.open { transform: none; }
    body.hoja-arrastrando #detail-panel { transition: none; }
    body.hoja-arrastrando { user-select: none; }
    #detail-panel .detail-header { touch-action: none; }
    .hoja-agarradera { display: flex; justify-content: center; align-items: center; width: 100%; height: 26px; touch-action: none; cursor: grab; padding: 0; border: 0; background: transparent; flex-shrink: 0; }
    .hoja-agarradera span { width: 42px; height: 5px; border-radius: 3px; background: #cbd5e0; }
    .detail-header { padding: 4px 16px 10px; }
    .detail-header h2 { font-size: 1.05rem; }
    .detail-content { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

    /* Street View chico: encima de la hoja; con la hoja grande no hay lugar */
    body.detalle-abierto .leaflet-bottom.leaflet-right { bottom: var(--hoja-alto, 58vh); }
    body.detalle-expandido .sv-mapa { display: none !important; }

    /* Barra de arriba compacta: búsqueda a lo ancho; Mapa/Satélite y Mis revisiones solo con ícono */
    .leaflet-control-zoom { display: none; }
    .leaflet-top.leaflet-right { left: 0; }
    .leaflet-top.leaflet-right .leaflet-control { margin-right: 10px; margin-top: 10px; }
    .barra-mapa { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
    .busqueda-mapa { width: calc(100vw - 20px); }
    .busqueda-mapa__campo { max-width: 92px; }
    .basemap-switch__btn { width: 44px; padding: 0; }
    .basemap-switch__label { display: none; }
    .vr-entrada__btn { width: 44px; }
    .vr-entrada__btn > span:not(.vr-entrada__icono) { display: none; }
}
html[data-theme="dark"] .hoja-agarradera span { background: #475569; }
html[data-theme="dark"] .btn-filtros-movil, html[data-theme="dark"] .cerrar-filtros-movil { background: #d4af37; border-color: #d4af37; color: #0c1a30; }
