/**
 * Estilos del Diseñador de Mapa Solar.
 *
 * H4: Integración del Mapa de Google Maps y Buscador de Direcciones.
 *
 * Layout responsive: sidebar izquierda + mapa a la derecha.
 *
 * @package TodoFotovoltaica
 * @since   1.0.0
 */

/* ═══════════════════════════════════════════════════════════════
   Contenedor principal (Flex layout)
   ═══════════════════════════════════════════════════════════════ */

.tfv-disenador {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;    /* menú y mapa comparten alto; sin brechas ni recortes */
    width: 100%;
    min-height: 0;
    /* H277 (#2066, 2026-09-22, Sergio): alto único del mapa. Lo consumen el mapa
       (.tfv-map-pane .tfv-map-container) y el max-height de la barra lateral, para
       que la barra de scroll llegue justo al borde inferior del mapa.
       H278 (2026-09-22, Samuel): el tope también respeta el alto de la ventana.
       H281 (2026-09-22, Samuel): en pantallas bajas H278 dejaba el panel diminuto
       (p. ej. 280 px a 1280×720, que es el viewport CSS real de Windows a 150 %).
       Ahora se reserva menos (300 px en vez de 360) y se pone un SUELO de 420 px:
       `max(420px, min(640px, 100vh - 300px))`. A 720 da 420 (cabe: 296+420=716),
       a 768 da 468, a 900 da 600 y a 1080 mantiene 640. En pantallas muy bajas el
       panel conserva 420 px y la página desplaza (mejor que un panel inservible).
       H313 (#2119, 2026-09-23, Sergio): el SUELO sube de 420 a 520 px. Sergio lo ve
       todo a 1280×720 (portátil 1920×1080 al 150 %) y con 420 px apenas veía opciones
       de inicio. Ahora: a 720 da 520, a 768 da 520, a 900 da 600 y a 1080 mantiene el
       techo de 640. El CTA queda a ~96 px de scroll de página (criterio H281 intacto).
       La 1ª declaración es el fallback para navegadores sin `min()`/`max()`. */
    --tfv-map-h: 640px;
    --tfv-map-h: max(520px, min(640px, calc(100vh - 300px)));
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: visible;          /* el scroll lo hace la página, nada se corta */
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ═══════════════════════════════════════════════════════════════
   Sidebar (Panel lateral izquierdo)
   ═══════════════════════════════════════════════════════════════ */

.tfv-sidebar {
    width: 460px;              /* más ancho (hay hueco en la web) */
    min-width: 400px;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e0e0e0;
    background: #fafafa;
    height: auto;
    /* H273: el panel vuelve a tener SU PROPIO scroll (es cómodo: no alarga la
       página 3.200 px), pero dimensionado para que quepa en pantalla: así el
       bloque de acción anclado abajo queda siempre visible y el último botón
       (p. ej. «+ Añadir» del inversor) no se corta.
       H277 (#2066, 2026-09-22, Sergio): el tope es el alto del mapa (--tfv-map-h)
       para que la barra de scroll acabe justo al borde inferior del mapa.
       H278: al ser --tfv-map-h un `min()` con la ventana, la barra también cabe
       en pantallas bajas (nada cortado por abajo) y sigue alineada con el mapa.
       H281: --tfv-map-h lleva suelo de 420 px (ver arriba), así que el panel nunca
       se queda diminuto en pantallas bajas/high-DPI.
       H313 (#2119, 2026-09-23, Sergio): el suelo sube a 520 px (mismo valor que el
       token) para que a 1280×720 se vean más opciones de inicio.
       En móvil sigue sin tope (ver @media 768px). */
    max-height: var(--tfv-map-h);
    min-height: 520px; /* H279: fallback sin `min()` · H313: mismo suelo que el token */
    min-height: min(520px, var(--tfv-map-h));
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    /* Margen inferior del panel (el pie de acción va al final, sin anclajes). */
    padding-bottom: 28px;
    scroll-padding-bottom: 28px;
}

.tfv-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
}

.tfv-sidebar-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

/* ── Sección de búsqueda (H4-T3: Places Autocomplete) ── */

.tfv-search-section {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
}

.tfv-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.tfv-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.tfv-search-input {
    width: 100%;
    padding: 10px 40px 10px 14px;
    font-size: 15px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    color: #333;
}

.tfv-search-input:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

.tfv-search-input::placeholder {
    color: #999;
}

.tfv-search-icon {
    position: absolute;
    right: 12px;
    font-size: 16px;
    color: #999;
    pointer-events: none;
}

.tfv-search-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: #999;
    line-height: 1.4;
}

/* ── Placeholder de controles futuros ── */

.tfv-controls-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}

.tfv-placeholder-text {
    font-size: 13px;
    color: #aaa;
    text-align: center;
    font-style: italic;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════
   Mapa (Panel derecho)
   ═══════════════════════════════════════════════════════════════ */

.tfv-map-container {
    flex: 1;
    position: relative;
    min-width: 0; /* Flex fix para que no desborde */
    background: #e8eaed; /* Fondo Google Maps mientras carga */
}

/* Columna derecha (mapa arriba + diagrama de inclinación abajo) */
.tfv-map-pane {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;   /* La tarjeta no debe cortarse: crece la página */
}

.tfv-map-pane .tfv-map-container {
    flex: none;               /* no se estira con el ancho del panel lateral */
    height: var(--tfv-map-h); /* mapa: alto de trabajo (H277: token compartido con la barra) */
    min-height: 0;
}

/* Tarjeta estática bajo el mapa con el diagrama que iba en el informe */
.tfv-tilt-output {
    padding: 12px 12px 16px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    flex: 0 0 auto;     /* La tarjeta tiene su propio alto; el mapa se adapta */
}

.tfv-tilt-output-empty {
    font-size: 13px;
    color: #888;
}

.tfv-map-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #e8eaed;
    z-index: 1;
}

.tfv-map-container.tfv-map-loaded .tfv-map-loading {
    display: none;
}

.tfv-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #2e7d32;
    border-radius: 50%;
    animation: tfv-spin 0.8s linear infinite;
}

@keyframes tfv-spin {
    to {
        transform: rotate(360deg);
    }
}

.tfv-map-loading p {
    margin-top: 12px;
    color: #666;
    font-size: 14px;
}

/* ── Google Places Autocomplete dropdown styling ── */

.pac-container {
    border-radius: 0 0 6px 6px;
    border: 1px solid #d0d0d0;
    border-top: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    z-index: 9999 !important;
}

.pac-item {
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
}

.pac-item:hover {
    background-color: #f0f9f0;
}

.pac-item-selected {
    background-color: #e8f5e9;
}

.pac-icon {
    margin-right: 10px;
}

.pac-item-query {
    font-size: 15px;
    color: #222;
}

.pac-matched {
    font-weight: 600;
}

/* ── H15: Doble CTA — Botones ── */

.tfv-cta-section {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* H273: en flujo normal al final del panel. Con el scroll propio del panel
       (restaurado) se llega a él deslizando, y así no se monta encima de los
       controles de arriba (el sticky tapaba el buscador de direcciones). */
}

/* H275: modal de inversor — el diálogo completo hace scroll y se limita a la
   altura de la ventana, de modo que el pie (Cancelar / Guardar en catálogo)
   siempre es alcanzable y no se corta (bug reportado en la web pública). */
#tfv-inverter-modal-dialog {
    max-height: calc(100vh - 60px);
    overflow-y: auto;
}

/* H279: barra de scroll del panel — más gruesa y visible.
   - Antes: `scrollbar-width: thin` + `scrollbar-color` (Firefox) y `::-webkit-scrollbar`.
     En Chromium/Edge/Opera declarar `scrollbar-width`/`scrollbar-color` DESACTIVA el
     estilado de `::-webkit-scrollbar`, así que la barra salía fina también en Chrome/Edge.
   - Ahora: `::-webkit-scrollbar` (16px) solo donde existe (Chromium/WebKit) y, solo en
     Firefox, `scrollbar-width: auto` + `scrollbar-color`. */
.tfv-sidebar,
#tfv-inverter-modal-dialog {
    scrollbar-gutter: stable;
}

@supports selector(::-webkit-scrollbar) {
    .tfv-sidebar::-webkit-scrollbar,
    #tfv-inverter-modal-dialog::-webkit-scrollbar {
        width: 16px;
        height: 16px;
    }
    .tfv-sidebar::-webkit-scrollbar-track,
    #tfv-inverter-modal-dialog::-webkit-scrollbar-track {
        background: #eceff1;
        border-radius: 8px;
    }
    .tfv-sidebar::-webkit-scrollbar-thumb,
    #tfv-inverter-modal-dialog::-webkit-scrollbar-thumb {
        background: #9aa0a6;
        border: 2px solid #eceff1;
        border-radius: 8px;
        background-clip: padding-box;
    }
    .tfv-sidebar::-webkit-scrollbar-thumb:hover,
    #tfv-inverter-modal-dialog::-webkit-scrollbar-thumb:hover {
        background: #6b7280;
        border-color: #eceff1;
        background-clip: padding-box;
    }
}

@supports not selector(::-webkit-scrollbar) {
    .tfv-sidebar,
    #tfv-inverter-modal-dialog {
        scrollbar-width: auto;
        scrollbar-color: #9aa0a6 #eceff1;
    }
}

/* H269: el tema aplica `overflow-x: hidden` a `.container`, lo que crea un
   scrollport y DEJA SIN EFECTO `position: sticky` del pie de acción. `clip`
   recorta igual el desbordamiento horizontal pero no crea scrollport, así que el
   botón «Descargar Informe» queda anclado abajo y siempre accesible. Se limita a
   las páginas con el diseñador y degrada solo (si el navegador no soporta :has,
   simplemente no se ancla, pero el panel ya no tiene scroll propio).
   H279: además de `:has` (navegadores modernos) se usa la clase de body
   `tfv-disenador-active` que añade el plugin, para no depender de `:has`
   (Firefox <121, Edge/Opera antiguos, etc.). */
body.tfv-disenador-active .container,
body.tfv-disenador-active .container_inner,
body:has(.tfv-disenador) .container,
body:has(.tfv-disenador) .container_inner {
    overflow-x: clip !important;
}

/* H279/H281: el banner de cookies (plugin GDPR, `position:fixed` abajo con z-index
   enorme) tapa la parte baja del panel. Reservamos su alto SOLO en pantallas altas
   (≥950 px), donde sobra sitio; en pantallas bajas NO se reserva (antes bajaba el
   panel a 280 px a 1280×720 y se veía fatal): preferimos un panel usable y el banner
   se cierra al aceptar. Al ocultarse (`display:none`) la regla deja de aplicar sola. */
@media (min-width: 769px) and (min-height: 950px) {
    body:has(#gdpr-cookie-consent-bar:not([style*="display: none"])) .tfv-disenador {
        --tfv-map-h: 640px;
        --tfv-map-h: max(520px, min(640px, calc(100vh - 480px))); /* H313: suelo 520 */
    }
}

.tfv-cta-summary {
    font-size: 13px;
    color: #666;
    margin: 0 0 5px;
    text-align: center;
    line-height: 1.4;
}

.tfv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
    text-align: center;
    width: 100%;
}

.tfv-btn:active {
    transform: scale(0.98);
}

.tfv-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tfv-btn-primary {
    background: #2e7d32;
    color: #fff;
}

.tfv-btn-primary:hover:not(:disabled) {
    background: #256b28;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.28);
}

.tfv-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.tfv-btn-secondary:hover:not(:disabled) {
    background: #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ── H15-T1: Modal overlay ── */

.tfv-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tfv-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    animation: tfv-modal-in 0.25s ease-out;
}

@keyframes tfv-modal-in {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tfv-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.tfv-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.tfv-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}

.tfv-modal-close:hover {
    color: #333;
}

.tfv-modal-body {
    padding: 16px 24px;
}

.tfv-modal-description {
    font-size: 14px;
    color: #666;
    margin: 0 0 16px;
    line-height: 1.5;
}

.tfv-modal-footer {
    display: flex;
    gap: 10px;
    padding: 0 24px 20px;
}

.tfv-modal-footer .tfv-btn {
    width: auto;
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
}

/* ── H15: Form fields inside modal ── */

.tfv-form-row {
    margin-bottom: 14px;
}

.tfv-form-label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.tfv-form-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    color: #333;
    box-sizing: border-box;
}

.tfv-form-input:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.tfv-form-error {
    display: none;
    font-size: 12px;
    color: #dc2626;
    margin-top: 4px;
}

.tfv-form-consent {
    margin: 16px 0;
}

.tfv-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    line-height: 1.4;
}

.tfv-checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

/* ── H15: Modal feedback ── */

.tfv-modal-feedback {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    margin-top: 8px;
}

.tfv-feedback-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.tfv-feedback-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ═══════════════════════════════════════════════════════════════
   H5: Roof Designer Controls
   ═══════════════════════════════════════════════════════════════ */

.tfv-roof-section {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
}

.tfv-section-title {
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.tfv-control-group {
    margin-bottom: 16px;
}

.tfv-control-group:last-child {
    margin-bottom: 0;
}

.tfv-btn-group {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.tfv-btn-tool {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: #f5f5f5;
    color: #333;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.tfv-btn-tool:hover {
    background: #e8e8e8;
    border-color: #bbb;
}

.tfv-btn-tool:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.tfv-hint {
    margin: 6px 0 0 0;
    font-size: 12px;
    color: #777;
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════
   H225 (2026-09-14, Samuel): orden + filtro por potencia en el
   selector de modelo de panel del diseñador.
   ═══════════════════════════════════════════════════════════════ */
.tfv-panel-filters {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px 8px;
    margin: 6px 0 8px;
}

.tfv-panel-filter {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    color: #555;
    min-width: 0;
}

.tfv-panel-filter > span {
    font-weight: 500;
}

.tfv-select-sm {
    font-size: 12px;
    padding: 3px 4px;
}

.tfv-panel-wp-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 12px;
    padding: 3px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.tfv-panel-wp-reset {
    grid-column: 1 / -1;
    justify-self: start;
    font-size: 11px;
    padding: 0;
    background: none;
    border: 0;
    color: #2e7d32;
    cursor: pointer;
    text-decoration: underline;
}

.tfv-panel-wp-reset:hover {
    color: #1b5e20;
}

/* Slider rows */
.tfv-slider-row {
    margin-bottom: 12px;
}

.tfv-slider-row label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    margin-bottom: 4px;
}

.tfv-slider-row label span {
    font-weight: 600;
    color: #1e8e3e;
    min-width: 40px;
    text-align: right;
}

.tfv-slider-row input[type="range"] {
    width: 100%;
    height: 6px;
    margin: 0;   /* H278: el margen por defecto (2px) desbordaba la fila 4px y el
                    `overflow-x:hidden` del panel recortaba el deslizador a la derecha */
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.tfv-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2e7d32;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.tfv-slider-row input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2e7d32;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* H206: Generate button eliminado (redundante: auto-update ya cubre) */

/* Summary box */
.tfv-summary-box {
    padding: 12px 16px;
    background: #f0f9f0;
    border: 1px solid #cfe8d4;
    border-radius: 6px;
    margin-top: 12px;
}

.tfv-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 13px;
    color: #444;
}

.tfv-summary-row strong {
    color: #1e8e3e;
    font-size: 14px;
}

.tfv-summary-row + .tfv-summary-row {
    border-top: 1px solid #cfe8d4;
}

/* ═══════════════════════════════════════════════════════════════
   H7: IDAE Spacing Controls
   ═══════════════════════════════════════════════════════════════ */

.tfv-radio-group {
    display: flex;
    gap: 16px;
    margin-top: 4px;
}

.tfv-radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    cursor: pointer;
}

.tfv-radio-label input[type="radio"] {
    accent-color: #2e7d32;
    width: 16px;
    height: 16px;
}

.tfv-idae-result {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    margin-top: 8px;
}

.tfv-idae-label {
    font-size: 12px;
    color: #856404;
}

.tfv-idae-value {
    font-size: 16px;
    color: #856404;
}

/* Spacing slider disabled state (IDAE mode) */
.tfv-slider-row.disabled-slider {
    opacity: 0.5;
    pointer-events: none;
}

.tfv-slider-row.disabled-slider input[type="range"] {
    background: #ccc;
}

/* ═══════════════════════════════════════════════════════════════
   H5-T4: Panel Orientation Controls
   ═══════════════════════════════════════════════════════════════ */

.tfv-orientation-group,
.tfv-angle-group {
    margin-top: 2px;
}

.tfv-orientation-group .tfv-hint,
.tfv-angle-group .tfv-hint {
    font-size: 11px;
    color: #777;
    margin: 4px 0 0;
    line-height: 1.4;
}

.tfv-slider-row .tfv-hint {
    font-size: 11px;
    color: #777;
    margin: 2px 0 0;
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════
   H9: PVGIS Solar Radiation Section
   ═══════════════════════════════════════════════════════════════ */

.tfv-pvgis-section {
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    background: #f8fdf8;
}

.tfv-pvgis-section .tfv-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 6px;
}

.tfv-pvgis-section .tfv-hint {
    font-size: 11px;
    color: #777;
    margin: 0 0 10px;
    line-height: 1.4;
}

.tfv-pvgis-section .tfv-btn {
    margin-bottom: 6px;
}

/* H9: PVGIS parameter sliders */
.tfv-pvgis-params {
    padding: 8px 0;
    margin-bottom: 8px;
    border-bottom: 1px dashed #dde;
}

.tfv-pvgis-params .tfv-slider-row {
    margin-bottom: 8px;
}

.tfv-pvgis-params .tfv-slider-row:last-child {
    margin-bottom: 0;
}

.tfv-pvgis-params .tfv-slider-row label {
    font-size: 12px;
    font-weight: 500;
    color: #444;
}

/* H31: PVGIS locked sliders (tilt + azimut sincronizados con diseño) */
.tfv-pvgis-locked {
    opacity: 0.65;
    pointer-events: none;
}

.tfv-pvgis-locked input[type="range"] {
    background: #dde;
    cursor: not-allowed;
}

.tfv-pvgis-lock-icon {
    font-size: 11px;
    margin-left: 4px;
    opacity: 0.7;
}

/* H28: Botón alinear con tejado */
.tfv-btn-sm {
    font-size: 12px;
    padding: 4px 10px;
    width: auto;
    display: inline-block;
}

/* H87: Botón toggle activo (modo arrastre de panel) */
.tfv-btn-active {
    background-color: #ff9800 !important;
    border-color: #e68900 !important;
    color: #fff !important;
}

/* H87: Cursores para paneles arrastrables (Google Maps Polygon maneja esto nativamente
   vía draggableCursor/draggingCursor, pero incluimos las clases por si hay overlays DOM) */
.tfv-panel-draggable {
    cursor: grab;
}

.tfv-panel-dragging {
    cursor: grabbing;
}

.tfv-pvgis-params .tfv-slider-row input[type="range"] {
    width: 100%;
    margin-top: 2px;
    accent-color: #2e7d32;
}

.tfv-pvgis-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.tfv-spinner-sm {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-top-color: #2e7d32;
    border-radius: 50%;
    animation: tfv-spin 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

.tfv-pvgis-status {
    font-size: 12px;
    color: #666;
    margin: 4px 0;
    min-height: 18px;
}

.tfv-pvgis-results {
    margin-top: 12px;
}

.tfv-pvgis-annual,
.tfv-pvgis-specific,
.tfv-pvgis-areas-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #e8ede8;
}

/* H276 (#2062, 2026-09-22, Sergio): total de producción de todas las áreas,
   al final de la sección PVGIS (justo debajo de «Detalles del cálculo»). */
.tfv-pvgis-areas-total {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e8ede8;
    border-bottom: none;
}

.tfv-pvgis-label {
    font-size: 12px;
    color: #555;
}

.tfv-pvgis-value {
    font-size: 14px;
    color: #1e8e3e;
}

.tfv-pvgis-table-wrapper {
    max-height: 220px;
    overflow-y: auto;
    margin-top: 8px;
}

.tfv-pvgis-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.tfv-pvgis-table th {
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: 600;
    padding: 4px 6px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

.tfv-pvgis-table td {
    padding: 3px 6px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
}

.tfv-pvgis-table tbody tr:nth-child(even) {
    background: #f9fdf9;
}

.tfv-pvgis-table tbody tr:hover {
    background: #e8f5e9;
}

/* ═══════════════════════════════════════════════════════════════
   H5-T6: Selector de Modelo de Panel
   ═══════════════════════════════════════════════════════════════ */

.tfv-panel-selector-group {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #dde;
}

.tfv-panel-selector-group .tfv-label {
    font-size: 12px;
    font-weight: 500;
    color: #444;
    margin-bottom: 4px;
}

.tfv-select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    color: #333;
    background: #fff;
    cursor: pointer;
    max-width: 100%;
    box-sizing: border-box;
}

.tfv-select:focus {
    border-color: #2e7d32;
    outline: none;
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.15);
}

.tfv-panel-selector-group .tfv-hint {
    font-size: 11px;
    color: #888;
    margin: 4px 0 0;
    line-height: 1.3;
}

/* ═══════════════════════════════════════════════════════════════
   H5-T5: Rotación Individual de Panel
   ═══════════════════════════════════════════════════════════════ */

.tfv-individual-rotation {
    background: #e8f5e9;
    border: 1px solid #2e7d32;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.tfv-individual-rotation .tfv-label {
    color: #1b5e20;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}

.tfv-individual-rotation .tfv-hint {
    font-size: 11px;
    color: #00838f;
    margin: 2px 0 8px;
    line-height: 1.4;
}

.tfv-individual-rotation .tfv-slider-row {
    margin-bottom: 4px;
}

.tfv-individual-rotation .tfv-slider-row label {
    font-size: 12px;
    font-weight: 500;
    color: #006064;
}

.tfv-individual-rotation .tfv-slider-row input[type="range"] {
    width: 100%;
    margin-top: 2px;
    accent-color: #00acc1;
}

/* ═══════════════════════════════════════════════════════════════
   H5-T7: Modo de colocación (Auto / Personalizado)
   ═══════════════════════════════════════════════════════════════ */







/* ═══════════════════════════════════════════════════════════════
   H5-T7/T8: Controles de modo manual (Personalizado)
   ═══════════════════════════════════════════════════════════════ */







.tfv-btn-group-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.tfv-manual-btn {
    width: 100%;
    justify-content: center;
    font-size: 12px;
    padding: 7px 10px;
}

.tfv-manual-status {
    font-size: 12px;
    color: #1b5e20;
    background: #c8e6c9;
    padding: 6px 8px;
    border-radius: 4px;
    margin: 8px 0;
    line-height: 1.4;
}

.tfv-btn-secondary {
    background: #fff;
    color: #333;
    border: 2px solid #43a047;
    font-weight: 600;
}

.tfv-btn-secondary:hover {
    background: #e8f5e9;
    border-color: #2e7d32;
}

/* ═══════════════════════════════════════════════════════════════
   H84: Latitud Display (IDAE + PVGIS)
   ═══════════════════════════════════════════════════════════════ */

.tfv-lat-display {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    margin-top: 4px;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 4px;
    font-size: 12px;
    color: #2e7d32;
}

.tfv-lat-display strong {
    font-size: 13px;
    font-weight: 700;
    color: #1b5e20;
}

.tfv-gps-display {
    background: #e8f5e9;
    border-color: #a5d6a7;
    color: #1b5e20;
    margin-bottom: 6px;
}

.tfv-gps-display strong {
    color: #0a3d0a;
}

/* ═══════════════════════════════════════════════════════════════
   H84: Sección colapsable de Cálculos (Auditoría)
   ═══════════════════════════════════════════════════════════════ */

.tfv-calc-section {
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
}

.tfv-calc-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 16px;
    background: #f5f0e8;
    border: none;
    border-bottom: 1px solid #e0d8c8;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #5d4e37;
    text-align: left;
    transition: background 0.2s;
}

.tfv-calc-toggle:hover {
    background: #ede0cc;
}

.tfv-calc-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.tfv-calc-arrow.open {
    transform: rotate(90deg);
}

.tfv-calc-body {
    padding: 8px 12px;
    max-height: 420px;
    overflow-y: auto;
}

.tfv-calc-subsection {
    margin-bottom: 10px;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}

.tfv-calc-subtitle {
    margin: 0;
    padding: 6px 10px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    font-size: 11px;
    font-weight: 700;
    color: #444;
}

.tfv-calc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.tfv-calc-table td {
    padding: 3px 8px;
    border-bottom: 1px solid #f4f4f4;
    color: #333;
}

.tfv-calc-table td:first-child {
    width: 55%;
    color: #666;
    font-weight: 500;
}

.tfv-calc-table td:last-child {
    font-weight: 600;
    color: #1a1a1a;
    text-align: right;
    font-family: 'Consolas', 'Monaco', monospace;
}

.tfv-calc-empty {
    text-align: center !important;
    color: #999 !important;
    font-style: italic;
    padding: 8px !important;
    font-family: inherit !important;
}

.tfv-calc-highlight {
    color: #e65100 !important;
    font-weight: 700 !important;
}

/* ═══════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .tfv-disenador {
        flex-direction: column;
        height: auto;           /* en móvil la página hace scroll, no un alto fijo */
        min-height: auto;
        --tfv-map-h: 640px;    /* H278: en móvil el mapa conserva su alto de trabajo */
    }

    .tfv-sidebar {
        width: 100%;
        min-width: 0;          /* móvil: ocupa toda la columna, sin mínimo ancho */
        max-width: none;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        max-height: none;      /* en móvil crece y la página desplaza */
    }

    .tfv-map-container {
        min-height: 400px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   H-CALC-AHORRO (2026-09-11, Sergio): Calculadora de Ahorro Fotovoltaico
   ═══════════════════════════════════════════════════════════════ */

.tfv-ahorro-section {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fff;
}

.tfv-ahorro-block {
    margin-top: 10px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    overflow: hidden;
}

.tfv-ahorro-block .tfv-calc-subtitle {
    margin-bottom: 0;
}

.tfv-ahorro-field {
    padding: 6px 10px;
}

.tfv-ahorro-field label {
    display: block;
    font-size: 11px;
    color: #444;
    margin-bottom: 4px;
}

.tfv-ahorro-field input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 12px;
    box-sizing: border-box;
}

.tfv-ahorro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
    padding: 4px 0 6px 0;
}

.tfv-ahorro-results {
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
    background: #f0f9f0;
    border: 1px solid #cfe8d4;
    font-size: 12px;
    line-height: 1.6;
    color: #2e7d32;
}

.tfv-ahorro-results strong {
    color: #1b5e20;
}

/* ═══════════════════════════════════════════════════════════════
   H224 (2026-09-14, Samuel): Comparativa de tarifas (elegir la más rentable)
   ═══════════════════════════════════════════════════════════════ */

.tfv-ahorro-compare {
    margin-top: 12px;
    padding: 10px;
    border-radius: 6px;
    background: #fbfaf3;
    border: 1px solid #e8e0c8;
    font-size: 11px;
    color: #3a3325;
}

.tfv-ahorro-cmp-title {
    font-weight: 600;
    color: #6b5a1f;
    margin-bottom: 6px;
}

.tfv-ahorro-cmp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10.5px;
}

.tfv-ahorro-cmp-table th,
.tfv-ahorro-cmp-table td {
    padding: 4px 5px;
    text-align: left;
    border-bottom: 1px solid #ece5d0;
}

.tfv-ahorro-cmp-table th {
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #8a7a4a;
}

.tfv-ahorro-cmp-num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.tfv-ahorro-cmp-current {
    background: #eef7ee;
}

.tfv-ahorro-cmp-badge {
    display: inline-block;
    font-size: 8.5px;
    background: #2e7d32;
    color: #fff;
    border-radius: 3px;
    padding: 0 4px;
    margin-left: 2px;
    vertical-align: middle;
}

.tfv-ahorro-cmp-warn {
    cursor: help;
}

#tfv-ahorro-pick-best {
    margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   H226/H227/H228 (2026-09-15, Sergio): tarifa manual, fuente de
   precios, comparador A/B e impuestos.
   ═══════════════════════════════════════════════════════════════ */

.tfv-ahorro-source {
    background: #f6f8fb;
    border-left: 3px solid #94a3b8;
    padding: 6px 8px;
    margin: 4px 10px 8px 10px;
    border-radius: 0 6px 6px 0;
    font-size: 10.5px;
    line-height: 1.35;
}

.tfv-ahorro-subblock {
    border-top: 1px dashed #e2e8f0;
    padding-top: 6px;
    margin-top: 6px;
}

.tfv-ahorro-subblock:first-of-type {
    border-top: 0;
    margin-top: 0;
}

.tfv-ahorro-subtitle {
    font-size: 11.5px;
    font-weight: 600;
    color: #2e7d32;
    margin: 2px 10px 2px 10px;
}

.tfv-ahorro-tax-hint {
    padding: 4px 10px 6px 10px;
    font-style: italic;
}

.tfv-ahorro-bills {
    margin: 4px 0;
    padding: 6px 8px;
    background: #f1f5f9;
    border-radius: 6px;
}

.tfv-hint-inline {
    font-size: 9.5px;
    color: #64748b;
}

/* H229 (2026-09-15, Sergio): botón «Actualizar» + sello de hora + nota resumen. */

.tfv-ahorro-refresh-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #e2e8f0;
}

.tfv-ahorro-refresh-row .tfv-btn {
    width: auto;
    white-space: nowrap;
}

.tfv-ahorro-updated-at {
    font-size: 9.5px;
    color: #64748b;
}

.tfv-ahorro-note {
    margin: 8px 0 0 0;
    padding-top: 6px;
    border-top: 1px dashed #e2e8f0;
    font-size: 9.5px;
    line-height: 1.35;
    color: #64748b;
}

/* ═══════════════════════════════════════════════════════════════
   H-CALC-AHORRO-2 (2026-09-14, Sergio): Perfil diario de consumo (visual)
   ═══════════════════════════════════════════════════════════════ */

.tfv-ahorro-profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tfv-ahorro-profile-summary {
    flex: 1;
    font-size: 12px;
    color: #2e7d32;
    font-weight: 600;
    line-height: 1.3;
}

.tfv-ahorro-profile-row .tfv-btn {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
}

/* Modal del perfil: más ancho que el modal de informe. */
.tfv-modal.tfv-modal-wide {
    max-width: 720px;
}

.tfv-ahorro-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.tfv-ahorro-presets .tfv-preset-btn {
    width: auto;
    flex: 0 1 auto;
    font-size: 12px;
    padding: 6px 10px;
    background: #f5f6f8;
    color: #2c3e50;
    border: 1px solid #d9dde3;
}

.tfv-ahorro-presets .tfv-preset-btn:hover {
    background: #eceff3;
}

.tfv-ahorro-presets .tfv-preset-btn.is-active {
    background: #e8f5e9;
    border-color: #2e7d32;
    color: #1b5e20;
    font-weight: 700;
}

.tfv-ahorro-perfil-chart {
    width: 100%;
    height: 220px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 12px;
}

.tfv-ahorro-profile-sliders {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    max-height: 340px;
    overflow-y: auto;
    padding-right: 2px;
}

.tfv-ahorro-slider-cell {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 6px 8px;
    background: #fff;
}

.tfv-ahorro-slider-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 4px;
}

.tfv-ahorro-slider-hour {
    font-size: 11px;
    color: #111827;
    font-weight: 600;
}

.tfv-ahorro-slider-pct {
    font-size: 10px;
    color: #6b7280;
}

.tfv-ahorro-profile-sliders input[type="range"] {
    width: 100%;
    margin: 0;
    accent-color: #2e7d32;
}

/* ═══════════════════════════════════════════════════════════════
   H247 (2026-09-17, Sergio): reparto mensual del consumo editable
   ═══════════════════════════════════════════════════════════════ */

.tfv-ahorro-month-line {
    margin-top: 2px;
}

.tfv-ahorro-month-block {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fbfcfe;
}

.tfv-ahorro-month-title {
    margin: 0 0 4px 0;
    font-size: 12px;
    font-weight: 700;
    color: #2e7d32;
}

.tfv-ahorro-month-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin: 8px 0;
}

.tfv-ahorro-month-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 5px 7px;
    background: #fff;
}

.tfv-ahorro-month-label {
    font-size: 10px;
    font-weight: 600;
    color: #374151;
}

.tfv-ahorro-month-cell input[type="number"] {
    width: 100%;
    padding: 2px 4px;
    font-size: 12px;
    border: 1px solid #d9dde3;
    border-radius: 6px;
}

.tfv-ahorro-month-pct {
    font-size: 10px;
    color: #6b7280;
}

.tfv-ahorro-month-note {
    margin: 4px 0 8px 0;
    font-size: 10px;
    line-height: 1.35;
    color: #64748b;
}

.tfv-ahorro-month-note.is-warn {
    color: #b45309;
    font-weight: 600;
}

/* H-CALC-18 (2026-09-18, Sergio): pestañas de mes + perfil horario propio por mes. */
.tfv-ahorro-month-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 10px 0 6px;
}

.tfv-ahorro-month-tabs .tfv-month-tab {
    width: auto;
    flex: 0 1 auto;
    font-size: 11px;
    padding: 4px 8px;
    background: #f5f6f8;
    color: #2c3e50;
    border: 1px solid #d9dde3;
    border-radius: 6px;
    cursor: pointer;
}

.tfv-ahorro-month-tabs .tfv-month-tab:hover {
    background: #eceff3;
}

.tfv-ahorro-month-tabs .tfv-month-tab.is-active {
    background: #e8f5e9;
    border-color: #2e7d32;
    color: #1b5e20;
    font-weight: 700;
}

/* H-CALC-19: nota de autoconsumo/cobertura mensual bajo la gráfica. */
.tfv-ahorro-month-stats {
    margin: 0 0 10px;
    font-size: 11px;
    color: #374151;
    text-align: center;
}

/* H-CALC-19: título del bloque de sliders horarios. */
#tfv-ahorro-sliders-title {
    margin: 8px 0 4px;
}

/* H-CALC-20: desplegable explicativo del autoconsumo directo.
   H326 (#2153, 2026-09-23, Sergio): la letra baja de 11 a 10 px a petición de Sergio.
   OJO: el tema (Bridge) tiene su propia regla `p { font-size }`, que GANA sobre la
   herencia del contenedor → hay que declarar el tamaño también en `p` y `summary`
   (si no, en la web pública se ve a 15,2 px, como se comprobó en H326). */
.tfv-ahorro-details {
    margin: 4px 0 6px;
    font-size: 10px;
    color: #475569;
}

.tfv-ahorro-details summary {
    cursor: pointer;
    color: #2e7d32;
    font-size: 10px;
    font-weight: 600;
}

.tfv-ahorro-details p {
    margin: 4px 0 0;
    font-size: 10px;
    line-height: 1.35;
}

@media (max-width: 600px) {
    .tfv-ahorro-profile-sliders {
        grid-template-columns: repeat(3, 1fr);
    }

    .tfv-ahorro-month-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .tfv-modal.tfv-modal-wide {
        max-width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════════
   H256 (2026-09-21, Sergio): tarjetas de súper-sección de la
   columna de introducción de datos.

   SOLO presentación: agrupa visualmente los bloques que ya existían
   (#tfv-roof-section > Diseño · Producción/PVGIS · Eléctrica · Ahorro)
   y unifica la paleta con el verde que ya usa el plugin (los azules de
   UI pasan a la familia #2e7d32 / #1e8e3e / #f0f9f0).

   No cambia ids, ni orden, ni visibilidad, ni lógica: los envoltorios
   <section class="tfv-sec ..."> del PHP no alteran las funciones.
   ═══════════════════════════════════════════════════════════════ */

.tfv-disenador {
    --tfv-green-dark: #2e7d32;   /* cabeceras y textos de marca */
    --tfv-green: #1e8e3e;        /* acentos y valores */
    --tfv-green-bg: #f0f9f0;     /* fondo de cabecera de tarjeta */
    --tfv-green-line: #cfe8d4;   /* líneas y bordes verdes */
}

/* El fondo del sidebar pasa a ser el lienzo: las tarjetas flotan sobre él. */
.tfv-roof-section {
    padding: 16px 20px;
    background: transparent;
    border-bottom: 0;
}

.tfv-sec {
    margin: 0 0 20px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e3efe4;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(20, 45, 25, 0.06);
}

.tfv-sec:last-child {
    margin-bottom: 0;
}

/* Cabecera de tarjeta: ocupa todo el ancho de la tarjeta (full-bleed). */
.tfv-sec > .tfv-sec-title {
    margin: -14px -16px 12px;
    padding: 11px 14px;
    background: var(--tfv-green-bg);
    border-bottom: 1px solid var(--tfv-green-line);
    border-radius: 9px 9px 0 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--tfv-green-dark);
    letter-spacing: 0.2px;
}

/* Los bloques internos pierden su marco: ahora el marco es la tarjeta. */
.tfv-sec--pvgis > .tfv-pvgis-section,
.tfv-sec--ahorro > .tfv-ahorro-section {
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

/* «Cálculos (auditoría)»: panel integrado dentro de Producción, con
   jerarquía visual menor (sigue colapsable y con su propia lógica). */
.tfv-sec--pvgis > .tfv-calc-section {
    margin-top: 14px;
    background: #fbfbfb;
    border: 1px solid #eef0ee;
    border-radius: 8px;
    overflow: hidden;
}

/* Jerarquía interna: subtítulo de bloque por encima del label de campo. */
.tfv-sec .tfv-calc-subtitle {
    color: #4a5a4c;
}

.tfv-sec .tfv-ahorro-subtitle,
.tfv-sec .tfv-ahorro-month-title {
    color: #2e7d32;
}

/* En móvil la tarjeta pierde aire lateral. */
@media (max-width: 768px) {
    .tfv-roof-section {
        padding: 12px;
    }

    .tfv-sec {
        margin-bottom: 14px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   H257 (2026-09-21, Sergio): banda sticky del selector de área.

   Es el bloque #tfv-areas-control movido fuera de la tarjeta Diseño
   a una banda propia entre el buscador y las tarjetas. Solo CSS: los
   chips los sigue generando renderAreaChips() en el mismo #tfv-area-list.
   ═══════════════════════════════════════════════════════════════ */

.tfv-area-band {
    position: sticky;
    top: 0;
    z-index: 6;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    /* H275-T6 (#2057, 2026-09-22, Sergio): banda más compacta (menos alto). */
    gap: 4px 8px;
    margin: 0;
    padding: 0 20px 8px;
    background: #fff;
    border-bottom: 1px solid var(--tfv-green-line);
    box-shadow: 0 2px 4px rgba(20, 45, 25, 0.06);
}

/* H260 (2026-09-21, Sergio): la cabecera de la banda usa el MISMO estilo que las
   cabeceras de las tarjetas de sección (fondo #f0f9f0, verde oscuro, 15px/700). */
.tfv-area-band .tfv-label {
    flex: 0 0 100%;
    /* H275-T6 (#2057): cabecera más baja para reducir el alto total de la banda. */
    margin: 0 -20px 4px;
    padding: 7px 20px;
    background: var(--tfv-green-bg);
    border-bottom: 1px solid var(--tfv-green-line);
    font-size: 15px;
    font-weight: 700;
    color: var(--tfv-green-dark);
    letter-spacing: 0.2px;
}

.tfv-area-band .tfv-btn-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
}

/* H275 (#2057, 2026-09-22, Sergio): cada grupo en su propia fila. Los chips
   A1/A2/A3 van arriba y ➕ Añadir área / 🗑️ Borrar área SIEMPRE debajo, sin
   depender de que los chips llenen la fila (antes bajaban solo cuando ya no
   cabían). El markup ya va en ese orden: #tfv-area-list + grupo de botones. */
.tfv-area-band > .tfv-btn-group {
    flex: 0 0 100%;
}

/* H275-T5/T6 (#2057, 2026-09-22, Sergio): los dos botones en UNA SOLA fila. La base
   `.tfv-btn` tiene `width: 100%`, así que con `flex: 0 0 auto` cada botón ocupaba el
   ancho del grupo y se apilaban uno debajo del otro; con `flex: 1 1 0` se repartían a
   mitades y ocupaban toda la fila.
   H314 (#2121, 2026-09-23, Sergio): a ANCHO NATURAL (`flex: 0 1 auto` + `width: auto`)
   ocupan lo que mide su texto (~130 px + ~120 px de los 460 de la fila), el resto queda
   libre y van alineados a la izquierda; además bajan de padding y de fuente. */
.tfv-area-band .tfv-btn-tool {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    padding: 6px 10px;
    font-size: 12px;
}

/* H260: pill de área — un único control con un solo borde/fondo. Antes cada área
   eran dos botones (etiqueta + ✕) y se veía como una caja doble. */
.tfv-area-chip {
    flex: 0 0 auto;
    min-width: 42px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--tfv-green-dark);
    background: #fff;
    border: 1px solid #a5d6a7;
    border-radius: 999px;
    cursor: pointer;
    line-height: 1.2;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.tfv-area-chip:hover {
    background: var(--tfv-green-bg);
    border-color: var(--tfv-green-dark);
}

/* Área seleccionada: que se note bien (sin cambiar el tamaño de la pill). */
.tfv-area-chip-active {
    background: #cdeccf;
    border-color: #14532d;
    color: #0d3318;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px #14532d, 0 0 0 2px rgba(27, 94, 32, 0.18);
}

.tfv-area-band .tfv-hint {
    flex: 0 0 100%;
    margin: 2px 0 0;
    font-size: 11px;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .tfv-area-band {
        gap: 4px 8px;
        padding: 0 12px 8px;
    }

    .tfv-area-band .tfv-label {
        margin: 0 -12px 4px;
        padding: 7px 12px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   H358/H361 (2026-09-25): informe + bloque de consulta con pestañas
   (instalación solar | tarifa de luz). Botones moderados.
   ═══════════════════════════════════════════════════════════════ */

.tfv-report-cta {
    margin: 10px 0 12px;
}

.tfv-cta-login {
    margin: 0 0 8px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.5;
    color: #555;
    text-align: center;
    background: #fff8e5;
    border: 1px solid #ffe0a3;
    border-radius: 6px;
}

.tfv-cta-login a {
    color: #2e7d32;
    text-decoration: none;
}

.tfv-pvgis-notice {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.4;
    color: #b00020;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   H359 (2026-09-28, Sergio): banner de acceso pintado por el plugin
   (solo sin sesión). Se usan LAS MISMAS clases que el snippet WPCode
   #3709 a propósito: el snippet comprueba `strpos($content,
   'tfv-designer-access')` y, si ya está, no añade el suyo (sin
   duplicados) y su aviso «Hola, {nombre}» sigue vivo al entrar.
   ═══════════════════════════════════════════════════════════════ */

.tfv-designer-access {
    box-sizing: border-box;
    max-width: 1220px;
    margin: 0 auto 18px;
    border: 1px solid #cfe7d5;
    border-left: 6px solid #249348;
    background: linear-gradient(135deg, #f6fffa, #eef8ff);
    border-radius: 16px;
    padding: 22px 26px;
    color: #15324a;
}

.tfv-designer-access__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    flex-wrap: wrap;
}

.tfv-designer-access h2 {
    margin: 0 0 6px;
    font-size: 24px;
    color: #123d61;
}

.tfv-designer-access p {
    margin: 0;
    line-height: 1.55;
}

.tfv-designer-button {
    display: inline-block;
    background: #22a550;
    color: #fff !important;
    border-radius: 9px;
    padding: 12px 18px;
    font-weight: 800;
    text-decoration: none !important;
    white-space: nowrap;
}

/* H359: realce temporal del aviso cuando se intenta descargar sin sesión. */
.tfv-flash {
    animation: tfv-flash 0.6s ease-in-out 3;
}

@keyframes tfv-flash {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 165, 80, 0); }
    50% { box-shadow: 0 0 0 4px rgba(34, 165, 80, 0.35); }
}

/* ═══════════════════════════════════════════════════════════════
   H360 (2026-09-28, Sergio): limpieza de la columna izquierda y de
   la sección eléctrica. Todo lo oculto aquí se recupera quitando su
   regla (no se borra nada de la lógica).
   ═══════════════════════════════════════════════════════════════ */

/* 3B: aviso «Teclas con el ratón sobre el plano…» — oculto de momento. */
#tfv-keys-hint {
    display: none;
}

/* 4B: resumen de strings («String s1 (8 p · N · A1) ✔ compatible»). */
#tfv-strings-summary {
    display: none !important;
}

/* 4C: el cálculo eléctrico (tabla de strings, comprobaciones C1-C6 y reparto de
   MPPT) queda oculto de momento. Se mantienen la selección de inversor, el
   cableado (caídas de tensión), los AVISOS de incompatibilidad y las notas.
   Para volver a mostrar el cálculo, quitar esta regla. */
.tfv-elec-calc {
    display: block;
    max-height: 520px;
    overflow: auto;
}

/* 4C: notas fijas de la sección eléctrica. */
.tfv-elec-notes {
    margin-top: 8px;
    padding: 8px 10px;
    border-left: 3px solid #90caf9;
    background: #f3f8ff;
    border-radius: 4px;
    font-size: 10.5px;
    line-height: 1.5;
    color: #1f3b57;
}

.tfv-elec-notes b {
    color: #123d61;
}

/* H361 (2026-09-28, Sergio): contacto opcional del bloque de conversión. Aparece al
   pulsar WhatsApp/email y solo sin sesión; se puede rellenar o ignorar. */
.tfv-conv-contact {
    margin: 0 0 8px;
    padding: 9px 10px;
    border: 1px dashed #cfe6cf;
    background: #f7fdf7;
    border-radius: 8px;
}

.tfv-conv-contact__title {
    margin: 0 0 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: #1b5e20;
}

.tfv-conv-contact__title span {
    font-weight: 400;
    color: #6b7c6b;
}

.tfv-conv-contact input {
    width: 100%;
    margin-bottom: 6px;
}

.tfv-conv-contact__note {
    margin: 0;
    font-size: 10px;
    line-height: 1.4;
    color: #6b7c6b;
}

.tfv-conv-contact__ok {
    margin: 6px 0 0;
    font-size: 11px;
    font-weight: 600;
    color: #1b5e20;
}

@media (max-width: 767px) {
    .tfv-designer-access {
        margin: 0 0 16px;
        padding: 18px;
    }

    .tfv-designer-access h2 {
        font-size: 21px;
    }

    .tfv-designer-button {
        width: 100%;
        margin-top: 8px;
        text-align: center;
    }
}

.tfv-btn-block {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.3;
}

.tfv-btn:disabled,
.tfv-btn.is-blocked {
    opacity: .55;
    cursor: not-allowed;
}

.tfv-conv {
    margin: 6px 0 4px;
}

.tfv-conv-title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    color: #1f2d3d;
}

.tfv-conv-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.tfv-conv-tab {
    flex: 1 1 0;
    padding: 9px 8px;
    font-size: 13px;
    font-weight: 600;
    color: #2b5d2b;
    background: #eef4ee;
    border: 1px solid #cfe0cf;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: background-color .2s, color .2s;
}

.tfv-conv-tab.is-active {
    color: #fff;
    background: #2e7d32;
    border-color: #2e7d32;
}

.tfv-conv-panel[hidden] {
    display: none !important;
}

.tfv-conv-sim {
    margin: 0 0 8px;
    font-size: 12px;
    color: #2b5d2b;
    text-align: center;
}

.tfv-conv-sep {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
    font-size: 11px;
    color: #8a8f98;
}

.tfv-conv-sep::before,
.tfv-conv-sep::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: #dfe3e8;
}

/* H360 (2026-09-28, Sergio): WhatsApp y email en la MISMA fila. Se reduce la letra y
   el padding para que quepan los dos (el email es largo) y se recorta con «…» si aun
   así no cabe, sin romper la fila. */
.tfv-conv-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    margin-bottom: 8px;
}

.tfv-conv-row > .tfv-btn {
    flex: 1 1 0;
    min-width: 0;
}

.tfv-conv-row .tfv-sm-text {
    font-size: 10.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tfv-btn-sm {
    justify-content: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.tfv-conv-row .tfv-btn-sm {
    gap: 5px;
    padding: 7px 6px;
    font-size: 11px;
}

.tfv-btn-wa {
    background: #25d366;
    color: #fff;
}

.tfv-btn-wa:hover {
    background: #1ebe5b;
}

.tfv-btn-mail {
    background: #eef1f5;
    color: #333;
    border: 1px solid #d5dae1;
}

.tfv-btn-mail:hover {
    background: #e2e7ee;
}

.tfv-btn-outline {
    background: #fff;
    color: #2e7d32;
    border: 1px solid #2e7d32;
}

.tfv-btn-outline:hover {
    background: #f2f8f2;
}

.tfv-wa-ico {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

.tfv-sm-ico {
    flex: 0 0 auto;
    font-size: 14px;
    line-height: 1;
}

.tfv-sm-text {
    overflow-wrap: anywhere;
}

.tfv-conv-h {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    color: #1f2d3d;
}

/* QLWapp: ocultar el botón flotante de WhatsApp SOLO en el diseñador
   (el bloque de conversión ya ofrece WhatsApp contextual). Esta hoja solo
   se carga en páginas con el diseñador. */
body.tfv-disenador-active .qlwapp,
body:has(.tfv-disenador) .qlwapp {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   H400 (2026-10-17, Jorge): asistente por pantallas.
   - Menú lateral de secciones + UNA sección visible a la vez.
   - Flechas «Anterior / Siguiente» + contador de paso.
   - Se reducen los márgenes laterales del tema SOLO en el diseñador.
   - Móvil: pills horizontales y mapa debajo del contenido.
   No se mueve ningún id ni nodo: sólo se alterna `.tfv-wiz-hidden`;
   así toda la lógica existente (mapa, áreas, PVGIS, PDF…) sigue igual.
   ═══════════════════════════════════════════════════════════════ */

/* Más ancho útil: fuera los márgenes laterales del tema en el diseñador. */
body.tfv-disenador-active .container,
body.tfv-disenador-active .container_inner {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    box-sizing: border-box;
}

/* Pantalla oculta del asistente. */
.tfv-wiz-hidden {
    display: none !important;
}

/* ── Menú lateral de secciones ── */
.tfv-wiz-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-sizing: border-box;
}

.tfv-wiz-nav__item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #344034;
    font: inherit;
    font-size: 13px;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.tfv-wiz-nav__item:hover {
    background: #f2f8f2;
}

.tfv-wiz-nav__item.is-active {
    background: #e8f5e9;
    border-color: #cfe8d4;
    color: #1b5e20;
    font-weight: 600;
}

.tfv-wiz-nav__icon {
    flex: 0 0 auto;
}

.tfv-wiz-nav__label {
    flex: 1 1 auto;
    white-space: normal;
}

/* ── Pie con flechas y contador ── */
.tfv-wiz-foot {
    position: sticky;
    bottom: 0;
    z-index: 7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 14px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
}

.tfv-wiz-foot__btn {
    flex: 0 0 auto;
    padding: 8px 12px;
    border: 1px solid #cfe8d4;
    border-radius: 6px;
    background: #fff;
    color: #1b5e20;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.tfv-wiz-foot__btn:hover:not(:disabled) {
    background: #f2f8f2;
}

.tfv-wiz-foot__btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.tfv-wiz-foot__count {
    flex: 1 1 auto;
    text-align: center;
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

/* La banda de áreas deja de ser sticky dentro del asistente. */
.tfv-wiz-on #tfv-areas-control {
    position: static;
}

/* ── Escritorio: menú · contenido · mapa (mapa siempre visible) ── */
@media (min-width: 1025px) {
    .tfv-disenador.tfv-wiz-on {
        display: grid;
        grid-template-columns: 208px 420px minmax(0, 1fr);
        align-items: start;
    }

    .tfv-disenador.tfv-wiz-on .tfv-wiz-nav {
        position: sticky;
        top: 16px;
        max-height: var(--tfv-map-h);
        overflow-y: auto;
    }

    .tfv-disenador.tfv-wiz-on .tfv-sidebar {
        width: 100%;
        min-width: 0;
        max-width: none;
        padding-bottom: 0;
    }

    .tfv-disenador.tfv-wiz-on .tfv-map-pane {
        min-width: 0;
    }
}

/* ── Tablet/móvil: pills horizontales arriba, contenido y mapa debajo ── */
@media (max-width: 1024px) {
    .tfv-disenador.tfv-wiz-on {
        display: flex;
        flex-direction: column;
    }

    .tfv-disenador.tfv-wiz-on .tfv-wiz-nav {
        position: static;
        flex-direction: row;
        gap: 6px;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 10px 12px;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        border-top: 0;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .tfv-disenador.tfv-wiz-on .tfv-wiz-nav__item {
        width: auto;
        flex: 0 0 auto;
        white-space: nowrap;
        scroll-snap-align: start;
    }

    .tfv-disenador.tfv-wiz-on .tfv-sidebar {
        width: 100%;
        min-width: 0;
        max-width: none;
        max-height: none;
        overflow: visible;
        border-right: 0;
        border-bottom: 1px solid #e0e0e0;
        padding-bottom: 0;
    }

    .tfv-disenador.tfv-wiz-on .tfv-wiz-foot {
        position: static;
        margin-top: 12px;
    }
}

/* Móvil: aún menos margen lateral. */
@media (max-width: 768px) {
    body.tfv-disenador-active .container,
    body.tfv-disenador-active .container_inner {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
}

/* H404 (2026-10-17, Jorge): sin desplegables.
   «Datos para completar el informe» y «Detalles del cálculo» se muestran
   siempre abiertos; se ocultan las flechas y los botones de plegado. */
#tfv-rd-toggle {
    cursor: default !important;
}

#tfv-rd-toggle .tfv-rd-arrow {
    display: none !important;
}

#tfv-rd-body {
    display: block !important;
}

#tfv-calc-toggle {
    display: none !important;
}

#tfv-calc-body {
    display: block !important;
}

/* H406 (2026-10-17, Jorge): sin cableado CC visible (caídas de tensión). */
.tfv-elec-cables,
.tfv-elec-cc-params {
    display: none !important;
}

/* H407 (2026-10-17, Jorge): en móvil el mapa se ve dentro de «Diseño del
   Tejado», encima de «Configuración de Paneles». En escritorio sigue en la
   columna derecha (el JS lo devuelve a su sitio). */
@media (max-width: 1024px) {
    .tfv-disenador.tfv-wiz-on .tfv-sec--design .tfv-map-pane {
        width: 100%;
        margin: 10px 0 14px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        overflow: hidden;
    }

    .tfv-disenador.tfv-wiz-on .tfv-sec--design .tfv-map-pane .tfv-map-container {
        height: 360px;
        min-height: 300px;
    }
}

/* H408 (2026-10-17, Jorge): editor de inversión en el bloque de ahorro. */
.tfv-ahorro-capex-modes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 12px;
    margin: 6px 0 8px;
}

.tfv-ahorro-capex-modes label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.tfv-ahorro-capex-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
}

.tfv-ahorro-capex-fields > div {
    flex: 1 1 180px;
}

.tfv-ahorro-capex-fields label {
    display: block;
    font-size: 11px;
    color: #555;
}

.tfv-ahorro-capex-fields input {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.tfv-ahorro-capex-summary {
    margin-top: 8px;
    padding: 8px 10px;
    background: #e8f5e9;
    border: 1px solid #cfe8d4;
    border-radius: 6px;
    font-size: 12px;
    color: #1b5e20;
}

.tfv-capex-parts {
    margin-top: 6px;
}

.tfv-capex-part {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px 76px auto 22px;
    gap: 4px;
    align-items: center;
    margin-bottom: 4px;
}

.tfv-capex-part input {
    width: 100%;
    box-sizing: border-box;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 11px;
}

.tfv-capex-part-total {
    font-size: 11px;
    white-space: nowrap;
    color: #1b5e20;
}

.tfv-capex-part button {
    border: none;
    background: none;
    color: #c0392b;
    cursor: pointer;
    font-size: 13px;
}

/* H414 (2026-10-17, Jorge): precios estimados editables por el usuario. */
.tfv-capex-est-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 8px 0;
}

.tfv-capex-est-grid label {
    display: block;
    font-size: 11px;
    color: #555;
}

.tfv-capex-est-grid input {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

/* H425 (2026-10-18, Jorge): KPIs y gráficos del bloque de ahorro. */
.tfv-ahorro-selected {
    font-size: 12px;
    color: #1b5e20;
    margin: 6px 0;
}

.tfv-ahorro-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 8px 0;
}

.tfv-ahorro-kpis > div {
    background: #f7faf7;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px 10px;
}

.tfv-ahorro-kpis span {
    display: block;
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tfv-ahorro-kpis strong {
    display: block;
    margin-top: 2px;
    font-size: 14px;
    color: #1b5e20;
}

.tfv-ahorro-chart-block {
    margin: 12px 0;
}

.tfv-ahorro-chart-title {
    font-size: 12px;
    font-weight: 700;
    color: #1b5e20;
    margin-bottom: 4px;
}

.tfv-ahorro-chart-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tfv-ahorro-chart {
    width: 100%;
    height: 240px;
}

.tfv-ahorro-chart svg {
    display: block;
    width: 100%;
    height: 100%;
}

.tfv-ahorro-chart--cashflow {
    min-width: 520px;
}

.tfv-ahorro-chart--daily {
    min-width: 720px;
}

.tfv-ahorro-chart--year {
    min-width: 1200px;
}

#tfv-ahorro-chart-mode {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 12px;
    background: #fff;
}

#tfv-ahorro-daily-date-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tfv-ahorro-daily-controls {
    flex-wrap: wrap;
}

/* H427 (2026-10-18, Jorge): giro de paneles oculto temporalmente. */
#tfv-rotation-control,
#tfv-panel-rotate-card {
    display: none !important;
}

#tfv-individual-rotation > .tfv-label,
#tfv-individual-rotation > .tfv-hint,
#tfv-individual-rotation > .tfv-slider-row {
    display: none !important;
}

/* H428 (2026-10-18, Jorge): opción de obstáculos oculta temporalmente. */
#tfv-add-obstacle,
#tfv-add-obstacle-rect,
#tfv-clear-obstacles,
div:has(> #tfv-add-obstacle) {
    display: none !important;
}

.tfv-ahorro-daily-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 4px;
}

.tfv-ahorro-daily-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tfv-ahorro-daily-controls button {
    border: 1px solid #cfe8d4;
    background: #fff;
    color: #1b5e20;
    border-radius: 6px;
    padding: 4px 9px;
    font-size: 14px;
    cursor: pointer;
}

.tfv-ahorro-daily-controls input[type="date"] {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 12px;
    max-width: 150px;
}

@media (max-width: 768px) {
    .tfv-ahorro-kpis {
        grid-template-columns: 1fr;
    }

    .tfv-ahorro-chart {
        height: 220px;
    }

    .tfv-ahorro-daily-head {
        align-items: flex-start;
    }

    .tfv-ahorro-daily-controls {
        width: 100%;
        justify-content: space-between;
    }
}

/* Revisión eléctrica: legibilidad en escritorio y móvil. */
#tfv-electrical-checks { font-family: system-ui, -apple-system, Segoe UI, sans-serif; line-height: 1.5; }
#tfv-electrical-checks div, #tfv-electrical-checks span, #tfv-electrical-checks td { font-size: 13px !important; line-height: 1.5; }
#tfv-electrical-checks .tfv-elec-calc td { text-align: left; padding: 6px 4px; vertical-align: top; }
#tfv-electrical-checks .tfv-elec-calc table { margin: 0; }

/* Propuesta comercial: el Diseñador se abre directamente; la vía «Oferta rápida» queda oculta. */
#tfv-offer-shell {
    display: none !important;
}
#tfv-disenador-wrapper,
#tfv-disenador-wrapper[hidden] {
    display: block !important;
}
