 /* --- Variables CSS --- */
 :root {
     --primary-color: #333333;
     /* Anthracite */
     --secondary-color: #666666;
     /* Medium Gray */
     --accent-color: #444444;
     /* Slate Gray */
     --light-color: #f5f5f5;
     /* Off-white */
     --dark-color: #1a1a1a;
     /* Almost Black */
     --danger-color: #333333;
     /* Red replaced by logic, but keeping base gray */
     --warning-color: #555555;
     --white-color: #ffffff;
     --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
     /* Subtle shadow for Paper look */
     --color-temp-cold: #0d47a1;
     /* Preserve Data Colors */
     --color-temp-medium: #ffee58;
     --color-temp-hot: #d50000;
     --ios-safe-area-top: env(safe-area-inset-top, 0px);
     --ios-safe-area-bottom: env(safe-area-inset-bottom, 0px);
     --ios-safe-area-left: env(safe-area-inset-left, 0px);
     --ios-safe-area-right: env(safe-area-inset-right, 0px);
     --form-element-height: 44px;
     /* Altura mínima recomendada para iOS */

     /* Nuevas variables para Popups JS */
     --popup-z-index: 9999;
     /* Muy alto para estar por encima de todo */
     --overlay-z-index: 9990;
     /* Debajo del popup pero encima del resto */
     --popup-bg: #1a1a1a;
     --popup-text-color: #e0e0e0;
     --popup-strong-color: #ffffff;
     --popup-mobile-max-height: 75vh;

     /* Tipografía Unificada */
     --font-primary: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
     --font-size-base: 16px;
     /* Base de referencia */
     --font-size-root: 100%;
     /* 16px */
     --font-size-h1: clamp(1.4rem, 4vw, 1.8rem);
     --font-size-h2: 1.25rem;
     --font-size-h3: 1.1rem;
     --font-size-body: 1rem;
     --font-size-small: 0.875rem;
     --font-size-xs: 0.75rem;
 }

 /* --- Reset Básico y Body --- */
 * {
     margin: 0;
     padding: 0;
     box-sizing: border-box;
     font-family: var(--font-primary);
 }

 body {
     background-color: var(--light-color);
     color: var(--dark-color);
     line-height: 1.6;
     font-size: var(--font-size-body);
     -webkit-text-size-adjust: 100%;
     /* Previene zoom automático en iOS al girar */
     touch-action: manipulation;
     /* Mejora respuesta táctil */
     overflow-x: hidden;
     /* Previene scroll horizontal */
 }

 /* --- Header --- */
 header {
     background-color: white;
     color: black;
     padding: 0.6rem 1rem;
     /* Reducido el padding vertical */
     box-shadow: var(--shadow);
     position: sticky;
     top: 0;
     z-index: 100;
     /* El popup tendrá z-index más alto */
     display: flex;
     /* Cambiado a flex display */
     flex-direction: row;
     /* Alineación horizontal */
     align-items: center;
     /* Alinea verticalmente al centro */
     margin-bottom: 0;
 }

 header h1 {
     font-size: var(--font-size-h1);
     margin-bottom: 0.5rem;
 }

 header p {
     font-size: var(--font-size-small);
     opacity: 0.9;
 }

 header>div {
     /* Se refiere al .header-text */
     /* text-align: center; */
     /* Cambiado por texto a la izquierda abajo */
     margin-left: 0;
     padding: 0 0.5rem;
     font-size: 90%;
 }

 header .header-logo {
     display: flex;
     align-items: center;
 }

 header img {
     max-height: 60px;
     /* Reducido para la versión final */
     width: auto;
     /* Mantener proporción */
 }

 header .header-text {
     display: flex;
     flex-direction: column;
     justify-content: center;
     /* Centrado vertical */
     text-align: left;
     /* Texto alineado a la izquierda */
     margin-left: 1rem;
     padding: 0;
     font-size: 90%;
     /* Tamaño base para textos internos */
 }

 header .header-title {
     font-weight: bold;
     font-size: 1rem;
     /* Ajustado */
 }

 header .header-subtitle {
     font-size: 0.9rem;
     /* Ajustado */
 }

 header .header-link {
     font-size: 0.85rem;
     /* Ajustado */
 }

 /* --- Layout Principal --- */
 .container {
     max-width: 1600px;
     margin: 1rem auto;
     /* Reducido el margen superior */
     padding: 0.8rem;
     display: grid;
     grid-template-columns: 1fr;
     gap: 0.8rem;
     /* Reducido el gap */
 }

 /* --- Paneles --- */
 .panel {
     background-color: var(--white-color);
     border: 1px solid #dddddd;
     /* Thin border instead of soft shadow */
     border-radius: 4px;
     /* Sharper corners */
     box-shadow: none;
     padding: 1.5rem;
     height: fit-content;
 }

 .panel h2 {
     color: var(--primary-color);
     margin-bottom: 1.5rem;
     padding-bottom: 0.75rem;
     border-bottom: 2px solid #333333;
     /* Stronger, darker line */
     font-size: var(--font-size-h2);
     display: flex;
     /* Para alinear icono */
     align-items: center;
     gap: 0.5rem;
 }

 aside.panel {
     position: static;
     max-height: none;
     overflow-y: visible;
     width: 100%;
     padding: 1rem;
 }

 /* --- Formulario --- */
 .form-group {
     margin-bottom: 1.0rem;
 }

 label {
     display: flex;
     align-items: center;
     gap: 0.4rem;
     margin-bottom: 0.4rem;
     font-weight: normal;
     font-size: var(--font-size-small);
     flex-wrap: nowrap;
 }

 input[type="number"],
 input[type="text"],
 select,
 textarea {
     width: 100%;
     padding: 0.7rem;
     border: 1px solid #ccc;
     border-radius: 8px;
     font-size: var(--font-size-body);
     /* Previene zoom en iOS */
     font-family: inherit;
     transition: border-color 0.3s, box-shadow 0.3s;
     min-height: var(--form-element-height);
 }

 input[readonly] {
     background-color: #f8f9fa;
     cursor: not-allowed;
     color: #555;
 }

 /* RESTAURACIÓN TOTAL DE SPIN BUTTONS (FLECHAS ARRIBA/ABAJO) */
 input[type="number"] {
     -webkit-appearance: auto !important;
     -moz-appearance: number-input !important;
     appearance: auto !important;
 }

 input[type="number"]::-webkit-inner-spin-button,
 input[type="number"]::-webkit-outer-spin-button {
     opacity: 1 !important;
     -webkit-appearance: inner-spin-button !important;
     display: block !important;
 }

 select {
     -webkit-appearance: auto !important;
     appearance: auto !important;
 }

 textarea {
     resize: vertical;
     min-height: 40px;
 }

 input[type="number"]:focus,
 input[type="text"]:focus,
 select:focus,
 textarea:focus {
     border-color: var(--secondary-color);
     box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.2);
     outline: none;
 }

 button[type="submit"] {
     background-color: #333333;
     color: var(--white-color);
     border: 1px solid #000000;
     padding: 0.8rem 1.5rem;
     border-radius: 4px;
     cursor: pointer;
     font-size: var(--font-size-body);
     font-weight: 600;
     margin-top: 1.5rem;
     width: 100%;
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 0.5rem;
     transition: background-color 0.3s, opacity 0.2s;
     min-height: var(--form-element-height);
 }

 button[type="submit"]:hover {
     background-color: #444444;
     transform: translateY(-1px);
 }

 button[type="submit"]:active {
     transform: translateY(0px);
 }

 .secondary-btn {
     background-color: var(--accent-color);
     color: var(--white-color);
     border: 1px solid rgba(0, 0, 0, 0.1);
     padding: 0.8rem 1.5rem;
     border-radius: 4px;
     cursor: pointer;
     font-size: var(--font-size-body);
     font-weight: 600;
     margin-top: 0.7rem;
     width: 100%;
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 0.5rem;
     transition: background-color 0.3s, opacity 0.2s, transform 0.1s;
     min-height: var(--form-element-height);
 }

 .secondary-btn:hover {
     opacity: 0.9;
     transform: translateY(-1px);
 }

 .secondary-btn:active {
     transform: translateY(0px);
 }

 fieldset {
     border: 1px solid #ddd;
     padding: 1rem;
     margin-bottom: 1rem;
     border-radius: 5px;
 }

 legend {
     font-weight: bold;
     color: var(--primary-color);
     padding: 0 0.5rem;
     font-size: var(--font-size-h3);
 }

 label small {
     color: #555;
     font-size: 0.8em;
     margin-left: auto;
     font-style: italic;
     flex-shrink: 0;
 }

 /* --- Info Box --- */
 .info-box,
 .info-box-small,
 .info-box-promotional {
     background-color: #f9f9f9;
     border: 1px solid #eeeeee;
     border-left: 4px solid #333333;
     padding: 1rem 1.2rem;
     margin-bottom: 1.5rem;
     border-radius: 2px;
     font-size: 0.9rem;
     color: #444444;
     line-height: 1.5;
 }

 .info-box-small {
     padding: 0.6rem 0.8rem;
     margin-bottom: 1rem;
     font-size: 0.85rem;
 }

 .info-box-promotional {
     background-color: #fcfcfc;
     border-color: #e0e0e0;
     border-left: 4px solid #444444;
 }

 .info-box h3 {
     color: #333333;
     margin-bottom: 0.5rem;
     display: flex;
     align-items: center;
     font-size: var(--font-size-body);
     font-weight: 600;
     border-bottom: none;
     padding-bottom: 0;
 }

 .info-box-promotional strong {
     color: #333333;
     font-weight: 600;
 }

 .info-box i,
 .info-box-promotional i {
     margin-right: 0.6rem;
     color: #666666;
 }

 /* --- Tooltips (Contenedor y preparación para JS) --- */
 .tooltip {
     position: relative;
     /* Necesario para el span oculto si JS falla */
     display: inline-flex;
     align-items: center;
     vertical-align: middle;
     /* No necesita cursor pointer aquí, lo ponemos en el icono */
 }

 .tooltip i.fa-info-circle {
     /* Más específico */
     color: var(--accent-color);
     cursor: pointer;
     /* Cambiado de help a pointer */
     font-size: 1.4em;
     flex-shrink: 0;
     padding: 4px 8px;
     user-select: none;
     /* Evitar selección del icono */
     -webkit-user-select: none;
     transition: color 0.2s;
 }

 .tooltip i.fa-info-circle:hover {
     color: var(--primary-color);
     /* Feedback visual al pasar por encima */
 }

 /* El span .tooltip-text ahora SOLO sirve como fuente de datos para JS */
 .tooltip .tooltip-text {
     display: none !important;
     /* Ocultarlo SIEMPRE visualmente */
     visibility: hidden;
     opacity: 0;
     position: absolute;
     z-index: -1;
     /* Asegurar que no interfiera */
     pointer-events: none;
     /* El resto de estilos visuales (fondo, padding, etc.) no son necesarios */
 }

 /* Ya no se necesita la regla :hover para mostrarlo */


 /* --- Popups de Información (JS Click) --- */

 /* Overlay (fondo oscuro SIEMPRE visible detrás del popup) */
 .info-popup-overlay {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background-color: rgba(0, 0, 0, 0.6);
     z-index: var(--overlay-z-index);
     cursor: pointer;
     opacity: 0;
     visibility: hidden;
     transition: opacity 0.3s ease, visibility 0s linear 0.3s;
 }

 .info-popup-overlay.visible {
     opacity: 1;
     visibility: visible;
     transition-delay: 0s;
 }

 /* Contenedor Base del Popup (Centrado, estado inicial oculto) */
 .info-popup {
     position: fixed;
     z-index: var(--popup-z-index);
     background-color: var(--popup-bg);
     color: var(--popup-text-color);
     border-radius: 8px;
     box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
     padding: 1.2rem 1.5rem;
     padding-right: 3rem;
     /* Espacio para el botón de cerrar */
     font-size: 0.9rem;
     line-height: 1.5;
     word-wrap: break-word;
     box-sizing: border-box;

     /* Posicionamiento centrado (siempre) */
     top: 50%;
     left: 50%;
     transform: translate(-50%, -50%) scale(0.95);
     /* Centrado inicial */

     /* --- TAMAÑO POR DEFECTO (ESCRITORIO) --- */
     max-width: 450px;
     /* Ancho máximo para pantallas grandes */
     width: auto;
     /* Se ajusta al contenido hasta max-width */
     /* ------------------------------------- */

     max-height: var(--popup-mobile-max-height);
     /* Límite alto */
     overflow-y: auto;
     -webkit-overflow-scrolling: touch;

     /* Estado inicial oculto */
     opacity: 0;
     visibility: hidden;
     pointer-events: none;
     transition: opacity 0.2s ease, visibility 0s linear 0.2s, transform 0.2s ease;
 }

 /* Estado VISIBLE del Popup */
 .info-popup.visible {
     opacity: 1;
     visibility: visible;
     transform: translate(-50%, -50%) scale(1);
     /* Estado final */
     pointer-events: auto;
     transition-delay: 0s;
 }

 /* --- AJUSTE DE ANCHO PARA MÓVILES --- */
 @media (max-width: 767px) {

     /* Aplica a pantallas hasta 767px de ancho */
     .info-popup {
         width: 85vw;
         /* Que ocupe el 85% del ancho disponible */
         max-width: 85vw;
         /* Asegura que no se pase (redundante pero seguro) */
     }
 }

 /* --- FIN AJUSTE MÓVILES --- */


 /* Botón de Cierre (SIEMPRE presente) */
 .info-popup .close-popup {
     position: absolute;
     top: 0.5rem;
     right: 0.5rem;
     background: none;
     border: none;
     color: var(--popup-text-color);
     font-size: 1.8rem;
     line-height: 1;
     font-weight: bold;
     cursor: pointer;
     padding: 0.2rem 0.5rem;
     opacity: 0.7;
     transition: opacity 0.2s;
     min-width: 44px;
     min-height: 44px;
     display: flex;
     align-items: center;
     justify-content: center;
 }

 .info-popup .close-popup:hover {
     opacity: 1;
 }

 /* Ajustes para el contenido del popup */
 .info-popup strong {
     color: var(--popup-strong-color);
     font-weight: 700;
 }

 .info-popup br {
     content: "";
     display: block;
     margin-bottom: 0.6em;
 }

 /* --- FIN POPUPS --- */

 /* --- Sección Principal (main) --- */
 main {
     display: flex;
     flex-direction: column;
     gap: 2rem;
 }

 /* --- Visualización 3D --- */
 .visualization {
     min-height: auto;
     display: flex;
     flex-direction: column;
     height: auto;
 }

 .visualization-header {
     display: flex;
     justify-content: space-between;
     align-items: center;
     margin-bottom: 1rem;
     flex-wrap: wrap;
     gap: 1rem;
 }

 .visualization-controls {
     display: flex;
     gap: 0.8rem;
 }

 .visualization-controls button,
 .toolbar button {
     background-color: var(--white-color);
     color: var(--primary-color);
     border: 1px solid #ccc;
     padding: 0.6rem 1rem;
     border-radius: 4px;
     cursor: pointer;
     font-size: 0.9rem;
     font-weight: 500;
     display: flex;
     align-items: center;
     gap: 0.4rem;
     width: auto;
     margin-top: 0;
     transition: background-color 0.3s, color 0.3s, border-color 0.3s;
     min-height: 44px;
     min-width: 44px;
     /* Mejora zona táctil */
 }

 .visualization-controls button:hover,
 .toolbar button:hover {
     background-color: #f0f0f0;
     border-color: #aaa;
 }

 .visualization-controls button i,
 .toolbar button i {
     opacity: 0.8;
 }

 .toolbar button.active {
     background-color: var(--accent-color);
     color: var(--white-color);
     border-color: var(--accent-color);
 }

 .visualization-container {
     flex-grow: 1;
     position: relative;
     overflow: hidden;
     border-radius: 8px;
     background-color: var(--white-color);
     box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
     min-height: auto;
     height: auto;
     width: 100%;
     touch-action: manipulation;
     /* Permite zoom y scroll pero evita lag de doble clic */
 }

 /* Estilos base para el Gráfico 4D (Escritorio - Ahora Dinámico) */
 #project-4d-graph {
     width: 100%;
     height: 65vh;
     /* Dinámico según el monitor */
     min-height: 500px;
     max-height: 1000px;
     overflow: hidden;
     margin-top: 20px;
     touch-action: auto !important;
     /* Asegura que Plotly capture los gestos */
 }

 #canvas-container {
     width: 100%;
     height: 100%;
     position: absolute;
     top: 0;
     left: 0;
 }

 canvas {
     display: block;
 }

 .overlay-info {
     position: absolute;
     top: 15px;
     left: 15px;
     background-color: rgba(255, 255, 255, 0.85);
     padding: 8px 12px;
     border-radius: 5px;
     box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
     z-index: 10;
     font-size: 0.9rem;
     pointer-events: none;
 }

 .overlay-info h3,
 .overlay-info p {
     margin: 0.2rem 0;
     font-weight: 600;
 }

 .overlay-info span {
     font-weight: normal;
 }

 .toolbar {
     position: absolute;
     bottom: 15px;
     left: 50%;
     transform: translateX(-50%);
     display: flex;
     gap: 8px;
     z-index: 10;
     background-color: rgba(255, 255, 255, 0.8);
     padding: 8px;
     border-radius: 5px;
     width: auto;
 }

 .time-controller {
     display: flex;
     align-items: center;
     margin-top: 1.5rem;
     padding-top: 1rem;
     border-top: 1px solid #eee;
 }

 .time-slider {
     flex-grow: 1;
     margin: 0 0.5rem;
     height: 10px;
     /* Más ancho para tocar */
     -webkit-appearance: none;
     appearance: none;
     background: #ddd;
     outline: none;
     border-radius: 3px;
     cursor: pointer;
     touch-action: manipulation;
 }

 .time-slider::-webkit-slider-thumb {
     -webkit-appearance: none;
     appearance: none;
     width: 26px;
     height: 26px;
     border-radius: 50%;
     background: #333333;
     cursor: pointer;
     border: 2px solid var(--white-color);
     box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
 }

 .time-slider::-moz-range-thumb {
     width: 26px;
     height: 26px;
     border-radius: 50%;
     background: var(--secondary-color);
     cursor: pointer;
     border: 2px solid var(--white-color);
     box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
 }

 .time-controller span {
     font-size: 0.9rem;
     color: #555;
 }

 .legend {
     display: flex;
     flex-wrap: wrap;
     gap: 1rem 1.5rem;
     margin-top: 1rem;
     padding-top: 1rem;
     font-size: 0.9rem;
 }

 .legend-item {
     display: flex;
     align-items: center;
 }

 .legend-color {
     width: 20px;
     height: 12px;
     border-radius: 3px;
     margin-right: 0.6rem;
     border: 1px solid #ccc;
     display: inline-block;
 }

 .temp-legend {
     border-top: 1px solid #eee;
     margin-top: 1rem;
     padding-top: 1rem;
 }

 .temp-legend .legend-item div {
     height: 15px;
 }

 .temp-legend .legend-gradient {
     width: 150px;
     background: linear-gradient(to right, var(--color-temp-cold), var(--color-temp-medium), var(--color-temp-hot));
 }

 /* --- Resultados (Tarjetas) --- */
 .results {
     display: grid;
     grid-template-columns: repeat(2, 1fr);
     gap: 0.8rem;
 }

 @media (max-width: 480px) {
     .results {
         grid-template-columns: 1fr;
     }
 }

 .result-card {
     overflow: visible;
     background-color: var(--white-color);
     border: 1px solid #eeeeee;
     border-radius: 4px;
     box-shadow: none;
     padding: 0.75rem;
     display: flex;
     flex-direction: column;
     text-align: center;
     transition: border-color 0.2s;
 }

 .result-card:hover {
     transform: translateY(-3px);
     box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
     z-index: 5;
     /* Popup debe tener z-index más alto */
 }

 .result-card h3 {
     color: var(--primary-color);
     margin: 0 0 0.6rem 0;
     padding-bottom: 0.4rem;
     border-bottom: 1px solid #eee;
     font-size: var(--font-size-small);
     font-weight: 600;
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 0.3rem;
     min-height: 2.8em;
     line-height: 1.2;
 }

 .result-card h3 i {
     /* Icono dentro del h3 de la tarjeta */
     color: var(--accent-color);
     font-size: 1em;
 }

 /* Aseguramos que el tooltip wrapper dentro de h3 no altere el layout */
 .result-card h3 .tooltip {
     display: inline-flex;
     /* O solo inline si no afecta */
     line-height: 1;
     /* Evitar que cambie altura h3 */
 }

 .result-value {
     font-size: 1.5rem;
     margin: auto 0;
     color: #333333;
     font-weight: 700;
     padding: 0.4rem 0;
 }

 .result-unit {
     font-size: 0.75rem;
     color: #555;
     margin-top: 0.2rem;
 }

 /* --- Pestañas y Gráficos --- */
 .tab-container {
     margin-top: 0;
     overflow: visible;
 }

 .tab-nav {
     display: flex;
     list-style: none;
     border-bottom: 2px solid #ddd;
     margin-bottom: 0;
     padding-left: 0;
     flex-wrap: wrap;
 }

 .tab-nav li {
     overflow: visible;
     padding: 0.6rem 0.8rem;
     cursor: pointer;
     border: 1px solid transparent;
     border-bottom: none;
     border-radius: 5px 5px 0 0;
     margin-right: 5px;
     margin-bottom: -2px;
     background-color: #f0f0f0;
     color: #555;
     transition: all 0.3s;
     font-weight: 500;
     display: flex;
     align-items: center;
     gap: 0.5rem;
     font-size: 0.8rem;
     flex: 1 1 auto;
     min-width: 120px;
     text-align: center;
     position: relative;
     /* Para que tooltips dentro se posicionen bien si se usan */
 }

 .tab-nav li label {
     margin-bottom: 0;
     font-weight: inherit;
     font-size: inherit;
     display: flex;
     align-items: center;
     gap: 0.5rem;
     justify-content: center;
     width: 100%;
     /* Asegurar que el label ocupa todo */
 }

 .tab-nav li.active {
     background-color: var(--white-color);
     color: var(--primary-color);
     border: 1px solid #333333;
     border-bottom-color: var(--white-color);
     font-weight: 600;
 }

 .tab-nav li:hover:not(.active) {
     background-color: #e5e5e5;
     color: var(--primary-color);
 }

 .tab-content {
     display: none;
     padding: 1rem 0.5rem;
     border: 1px solid #ddd;
     border-top: none;
     background-color: var(--white-color);
     border-radius: 0 0 5px 5px;
     /* Scrolling */
     overflow-y: auto;
     -webkit-overflow-scrolling: touch;
 }

 .tab-content.active {
     display: block;
 }

 .tab-content h3 {
     font-size: 1rem;
     font-weight: 600;
     color: var(--dark-color);
     margin-bottom: 1rem;
     text-align: center;
 }

 .charts-container {
     display: grid;
     grid-template-columns: 1fr;
     gap: 1.5rem;
     /* Scrolling */
     overflow-y: auto;
     -webkit-overflow-scrolling: touch;
 }

 .chart-panel {
     background-color: var(--white-color);
     border-radius: 8px;
     box-shadow: var(--shadow);
     padding: 1.5rem;
     overflow: visible;
 }

 .chart-panel h3 {
     font-size: 1.1rem;
     font-weight: 600;
     color: var(--primary-color);
     margin-bottom: 1rem;
     text-align: center;
     border-bottom: 1px solid #eee;
     padding-bottom: 0.5rem;
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 0.4rem;
     position: relative;
 }

 .chart-container {
     width: 100%;
     min-height: 250px;
     max-height: 65vh;
     height: 300px;
 }

 /* --- Footer --- */
 footer {
     background-color: var(--dark-color);
     color: var(--light-color);
     text-align: center;
     padding: 1.5rem 1rem;
     margin-top: 3rem;
     font-size: 0.9rem;
     opacity: 0.9;
     padding-bottom: max(1.5rem, var(--ios-safe-area-bottom, 0px));
 }

 /* --- Overlay Carga --- */
 #loading-overlay {
     position: fixed;
     top: 0;
     left: 0;
     right: 0;
     bottom: 0;
     background-color: rgba(255, 255, 255, 0.95);
     display: flex;
     justify-content: center;
     align-items: center;
     z-index: 10000;
     /* Debe estar debajo del popup de info */
     flex-direction: column;
     gap: 1rem;
     transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
     opacity: 1;
     visibility: visible;
     padding-top: env(safe-area-inset-top);
     padding-bottom: env(safe-area-inset-bottom);
 }

 #loading-overlay.hidden {
     opacity: 0;
     visibility: hidden;
     pointer-events: none;
 }

 .loader {
     border: 6px solid #f3f3f3;
     border-top: 6px solid var(--secondary-color);
     border-radius: 50%;
     width: 60px;
     height: 60px;
     animation: spin 1s linear infinite;
 }

 #loading-overlay p {
     font-size: 1.1rem;
     color: var(--dark-color);
     text-align: center;
     padding: 0 1rem;
 }

 @keyframes spin {
     0% {
         transform: rotate(0deg);
     }

     100% {
         transform: rotate(360deg);
     }
 }

 /* --- Botón Emergencia --- */
 #emergency-button {
     position: fixed;
     top: max(10px, env(safe-area-inset-top, 10px));
     right: max(10px, env(safe-area-inset-right, 10px));
     z-index: 10001;
     /* Encima del overlay de carga, debajo del popup info */
     background-color: var(--danger-color);
     color: white;
     padding: 10px;
     border: none;
     border-radius: 5px;
     cursor: pointer;
     font-size: 1rem;
     opacity: 0.8;
     min-width: 44px;
     min-height: 44px;
 }

 #emergency-button:hover {
     opacity: 1;
 }

 /* --- Mejoras específicas para CSV upload --- */
 .csv-fieldset {
     border: 1px solid var(--accent-color);
     background-color: #f0f8ff;
 }

 .file-input-wrapper {
     position: relative;
     margin-bottom: 10px;
 }

 .file-input {
     padding: 8px 5px;
     width: 100%;
     border: 1px solid #ccc;
     border-radius: 4px;
     font-size: var(--font-size-small);
     min-height: var(--form-element-height);
     line-height: var(--form-element-height);
     /* Ajustar línea texto */
 }

 .file-info {
     display: block;
     margin-top: 5px;
     color: var(--secondary-color);
     font-weight: bold;
     min-height: 1.2em;
 }

 .clear-file-btn {
     margin-top: 5px;
     padding: 8px 12px;
     font-size: 0.9rem;
     display: none;
     cursor: pointer;
     background-color: #eee;
     border: 1px solid #ccc;
     border-radius: 3px;
 }

 .csv-notice {
     display: block;
     font-size: 0.8em;
     color: #555;
 }

 /* Estilo para inputs deshabilitados por CSV */
 input[type="number"][disabled],
 input[type="text"][disabled] {
     background-color: #e9ecef;
     cursor: not-allowed;
     opacity: 0.7;
 }

 /* Nota visual para campos ignorados */
 .csv-override-note {
     display: none;
     /* Oculto por defecto, JS lo muestra */
     font-size: 0.75em;
     color: var(--warning-color);
     font-style: italic;
     margin-left: 5px;
     font-weight: normal;
 }


 /* Estilos para cuando el teclado está activo en iOS */
 .ios-keyboard-open {
     /* Prevenir scroll al enfocar inputs */
     overflow: auto;
     -webkit-overflow-scrolling: touch;
 }

 /* --- Clase para marcar elementos tocados --- */
 .touch-active {
     transition: transform 0.1s, background-color 0.1s;
 }

 /* Estilo para feedback visual del toque */
 .touch-feedback {
     position: absolute;
     opacity: 0;
     background-color: rgba(52, 152, 219, 0.2);
     border-radius: 50%;
     pointer-events: none;
     transform: translate(-50%, -50%);
     transition: opacity 0.3s, width 0.3s, height 0.3s;
 }

 /* Clase para feedback táctil */
 .touching {
     transform: scale(0.97);
     transition: transform 0.1s;
 }

 input[type="range"].touching {
     /* Ajustar thumb size al tocar? */
 }

 input[type="range"].touching::-webkit-slider-thumb {
     transform: scale(1.1);
 }

 input[type="range"].touching::-moz-range-thumb {
     transform: scale(1.1);
 }

 button.touching,
 .tab-nav li.touching {
     background-color: rgba(0, 0, 0, 0.05);
 }

 /* --- Media Queries --- */
 /* Tablet y escritorio */
 @media (min-width: 768px) {
     header {
         flex-direction: row;
         align-items: center;
         padding: 1rem;
     }

     header img {
         margin: 0;
         max-height: 80px;
         /* Ajustar si es necesario */
     }

     header>div {
         /* .header-text */
         text-align: left;
         margin-left: 1rem;
     }

     .container {
         grid-template-columns: 300px 1fr;
         padding: 1rem;
         gap: 1.5rem;
     }

     .results {
         grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
     }

     .chart-container {
         height: 320px;
     }

     .charts-container {
         grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
         overflow-y: visible;
     }

     aside.panel {
         position: sticky;
         top: 90px;
         /* Ajustar según altura header final */
         max-height: calc(100vh - 110px);
         /* Ajustar */
         overflow-y: auto;
         -webkit-overflow-scrolling: touch;
     }
 }

 @media (min-width: 1024px) {
     .container {
         grid-template-columns: 320px 1fr;
     }

     .results {
         grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
     }
 }

 /* Específico para iPads */
 @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
     .container {
         grid-template-columns: 280px 1fr;
     }

     .visualization-container {
         min-height: 1250px;
         height: auto;
     }

     .visualization {
         min-height: 1300px;
         height: auto;
     }

     .tab-nav li {
         font-size: 0.9rem;
     }

     @media (max-width: 830px) {

         /* iPad Mini */
         .container {
             grid-template-columns: 280px 1fr;
         }
     }

     @media (orientation: landscape) {
         .visualization-container {
             height: auto;
         }

         .results {
             grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
         }

         aside.panel {
             position: sticky;
             top: 90px;
             /* Ajustar */
             max-height: calc(100vh - 110px);
             /* Ajustar */
             overflow-y: auto;
             -webkit-overflow-scrolling: touch;
         }
     }

     @media (orientation: portrait) {
         aside.panel {
             position: static;
             max-height: none;
             overflow-y: visible;
         }
     }
 }

 /* Orientación portrait/landscape (Móviles principalmente) */
 @media screen and (max-width: 767px) {
     @media screen and (orientation: portrait) {
         .results {
             grid-template-columns: repeat(2, 1fr);
         }

         @media (min-width: 400px) {
             .results {
                 grid-template-columns: repeat(3, 1fr);
             }
         }

         header {
             padding: 0.5rem;
         }

         header img {
             max-height: 50px;
         }

         header .header-text {
             margin-left: 0.5rem;
         }

         header .header-title {
             font-size: 0.9rem;
         }

         header .header-subtitle {
             font-size: 0.8rem;
         }

         header .header-link {
             font-size: 0.75rem;
         }
     }

     @media screen and (orientation: landscape) {
         .results {
             grid-template-columns: repeat(4, 1fr);
         }

         @media (max-height: 450px) {

             /* Móviles pequeños landscape */
             header {
                 padding: 0.3rem 0.5rem;
             }

             header img {
                 max-height: 40px;
             }

             header .header-text {
                 margin-left: 0.3rem;
             }

             header .header-title {
                 font-size: 0.8rem;
             }

             header .header-subtitle {
                 font-size: 0.7rem;
                 line-height: 1.1;
             }

             header .header-link {
                 font-size: 0.7rem;
             }

             .container {
                 margin-top: 0.3rem;
                 gap: 0.5rem;
             }

             .visualization-container {
                 min-height: 180px;
                 height: auto;
             }

             .panel {
                 padding: 0.8rem;
             }

             .panel h2 {
                 font-size: 1.1rem;
                 margin-bottom: 0.8rem;
                 padding-bottom: 0.5rem;
             }

             aside.panel {
                 max-height: 85vh;
                 overflow-y: auto;
                 padding: 0.6rem;
             }

             .form-group {
                 margin-bottom: 0.5rem;
             }

             fieldset {
                 padding: 0.7rem;
                 margin-bottom: 0.7rem;
             }

             legend {
                 font-size: 0.9rem;
             }

             label {
                 font-size: 0.85rem;
                 margin-bottom: 0.2rem;
             }

             input,
             select,
             textarea {
                 padding: 0.5rem;
                 min-height: 40px;
             }

             button[type="submit"] {
                 font-size: 0.9rem;
                 padding: 0.6rem 1rem;
                 margin-top: 1rem;
             }

             .tab-nav li {
                 font-size: 0.75rem;
                 padding: 0.5rem;
                 min-width: 90px;
                 gap: 0.3rem;
             }

             .tab-nav li i {
                 font-size: 0.9em;
             }

             .tab-content h3 {
                 font-size: 0.9rem;
             }
         }
     }
 }

 /* Dispositivos muy pequeños */
 @media (max-width: 320px) {
     .result-card h3 {
         font-size: 0.7rem;
         min-height: 2.2em;
     }

     .result-value {
         font-size: 1.2rem;
     }

     .result-unit {
         font-size: 0.65rem;
     }

     label {
         font-size: 0.8rem;
     }

     input,
     select,
     textarea {
         font-size: var(--font-size-small);
     }
 }

 /* Dispositivos pequeños (genérico, < 480px) */
 @media (max-width: 480px) {
     .container {
         padding: 0.5rem;
         margin-top: 1rem;
     }

     .panel {
         padding: 1rem;
     }

     .panel h2 {
         font-size: 1.2rem;
         margin-bottom: 1rem;
     }

     button[type="submit"] {
         font-size: 1rem;
         padding: 0.8rem 1rem;
     }

     .result-value {
         font-size: 1.3rem;
     }

     .result-unit {
         font-size: 0.7rem;
     }

     .toolbar button {
         font-size: 0.8rem;
         padding: 0.4rem 0.6rem;
     }

     .tab-nav li {
         flex-grow: 1;
         text-align: center;
         margin-right: 0;
         margin-bottom: 2px;
         border-radius: 4px 4px 0 0;
     }
 }

 /* Pantallas grandes */
 @media (min-width: 1200px) {
     .results {
         grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
     }
 }

 /* Enlaces */
 .enlace-suave {
     text-decoration: none;
     color: #333;
     transition: color 0.3s ease;
 }

 .enlace-suave:hover {
     color: #0077cc;
     /* Un azul estándar */
 }

 /* Fix para algunos problemas de renderizado en Chrome/Android */
 @supports not (-webkit-touch-callout: none) {

     .result-card,
     .panel,
     .chart-panel,
     .tab-nav li,
     .tab-content {
         /* Potenciales fixes si hay problemas, pero pueden afectar sticky/fixed */
         /* backface-visibility: hidden; */
         /* transform: translateZ(0); */
     }
 }

 /* --- Estilos para la Tabla de Cargas Mensuales --- */
 .monthly-loads-table {
     display: flex;
     flex-direction: column;
     border: 1px solid #ddd;
     border-radius: 5px;
     overflow: hidden;
     margin-top: 1rem;
 }

 .monthly-loads-table .table-header,
 .monthly-loads-table .table-row {
     display: grid;
     grid-template-columns: 50px 1fr 1fr;
     align-items: center;
     text-align: center;
 }

 .monthly-loads-table .table-header {
     background-color: #f2f2f2;
     font-weight: bold;
     font-size: 0.9em;
 }

 .monthly-loads-table .table-header>div,
 .monthly-loads-table .table-row>div:first-child {
     padding: 0.6rem 0.4rem;
     border-right: 1px solid #ddd;
 }

 .monthly-loads-table .table-row {
     border-top: 1px solid #ddd;
 }

 .monthly-loads-table .table-row>div:last-child {
     border-right: none;
 }

 .monthly-loads-table .table-row input {
     border: none;
     border-radius: 0;
     text-align: center;
     padding: 0.6rem 0.2rem;
     font-size: var(--font-size-small);
     width: 100%;
     background-color: transparent;
 }

 .monthly-loads-table .table-row input:focus {
     box-shadow: inset 0 0 0 2px var(--secondary-color);
 }

 /* Leaflet Marker Logic: Turn Blue to Red using CSS Filter */
 .leaflet-marker-icon {
     filter: hue-rotate(140deg) brightness(0.9) saturate(1.5);
 }

 /* Adjust shadow to not look weird if needed, usually shadow is separate */
 .leaflet-marker-shadow {
     filter: none;
 }

 /* =================================================================== */
 /* === CORRECCIONES RESPONSIVE MÓVILES - ENERO 2026 ================== */
 /* =================================================================== */

 /* --- Prevenir Overflow Horizontal Global --- */
 html,
 body {
     max-width: 100%;
     overflow-x: hidden;
 }

 /* Todos los contenedores hijos no deben exceder el ancho disponible */
 .panel,
 .container,
 main,
 aside,
 fieldset,
 .form-group,
 .visualization,
 .visualization-container,
 .charts-container,
 .tab-container,
 .tab-content {
     max-width: 100%;
     box-sizing: border-box;
 }

 /* --- Tabla de Cargas Mensuales: Contenedor scrollable en móviles --- */
 @media (max-width: 480px) {
     .monthly-loads-table {
         overflow-x: auto;
         -webkit-overflow-scrolling: touch;
     }

     .monthly-loads-table .table-header,
     .monthly-loads-table .table-row {
         min-width: 280px;
         /* Ancho mínimo para evitar que se comprima demasiado */
         grid-template-columns: 40px 1fr 1fr;
         /* Columna mes más estrecha */
     }

     .monthly-loads-table .table-header>div,
     .monthly-loads-table .table-row>div:first-child {
         padding: 0.5rem 0.2rem;
         font-size: 0.85em;
     }

     .monthly-loads-table .table-row input {
         padding: 0.5rem 0.1rem;
         font-size: var(--font-size-small);
     }
 }

 /* --- Inputs y Fields: No desbordar --- */
 input[type="number"],
 input[type="text"],
 select,
 textarea {
     max-width: 100%;
     box-sizing: border-box;
 }

 /* --- Fieldsets: Prevenir overflow en textos largos --- */
 fieldset {
     min-width: 0;
     /* Fix para flexbox que causa overflow */
 }

 legend {
     max-width: 100%;
     word-wrap: break-word;
 }

 /* --- Labels: Wrap texto largo --- */
 label {
     word-wrap: break-word;
     overflow-wrap: break-word;
 }

 /* --- Columna Derecha (main): Scroll Vertical Mejorado en Móviles --- */
 @media (max-width: 767px) {

     /* 1. Prevención Global de Desbordamiento */
     html,
     body {
         max-width: 100% !important;
         width: 100% !important;
         overflow-x: hidden !important;
         position: relative;
         margin: 0 !important;
         padding: 0 !important;
     }

     /* 2. Estructura de Contenedores y Grid */
     .container {
         display: block !important;
         width: 100% !important;
         max-width: 100% !important;
         padding: 0.5rem !important;
         margin: 0 !important;
         box-sizing: border-box !important;
     }

     aside,
     main,
     section,
     .panel,
     .visualization,
     .visualization-container {
         display: block !important;
         width: 100% !important;
         max-width: 100% !important;
         margin: 0 0 1rem 0 !important;
         padding: 10px !important;
         box-sizing: border-box !important;
     }


     .form-row {
         display: flex !important;
         flex-wrap: wrap !important;
         gap: 10px !important;
     }

     .form-row>div {
         flex: 1 1 100% !important;
     }

     form,
     fieldset,
     .form-group {
         max-width: 100% !important;
         width: 100% !important;
         box-sizing: border-box !important;
     }


     /* Elementos de formulario */
     input,
     select,
     textarea,
     button {
         max-width: 100% !important;
         box-sizing: border-box !important;
     }

     /* Resultados y tabs */
     .results,
     .tab-container,
     .tab-content {
         max-width: 100% !important;
         width: 100% !important;

         box-sizing: border-box !important;
     }

     .tab-nav {
         display: flex !important;
         flex-wrap: nowrap !important;
         overflow-x: auto !important;
         -webkit-overflow-scrolling: touch !important;
         width: 100% !important;
         padding-bottom: 5px !important;
         border-bottom: 1px solid #ddd !important;
     }

     .tab-nav li {
         flex: 0 0 auto !important;
         min-width: 120px !important;
         white-space: nowrap !important;
         text-align: center !important;
     }

     /* Charts */
      .charts-container, .chart-panel, .chart-container, .js-plotly-plot, .plotly {
          max-width: 100% !important;
          width: 100% !important;
          height: auto !important;
          min-height: 250px;
          box-sizing: border-box !important;
          overflow: hidden !important;
      }

      .tab-container .tab-content .chart-container {
          height: 350px !important;
      }

     /* Títulos y textos largos */
     h1,
     h2,
     h3,
     h4,
     p,
     label,
     legend {
         max-width: 100% !important;
         word-wrap: break-word !important;
         overflow-wrap: break-word !important;
     }

     /* Info boxes */
     .info-box,
     .info-box-small,
     .info-box-promotional {
         max-width: 100% !important;
         width: 100% !important;
         box-sizing: border-box !important;
         overflow: hidden !important;
     }

     /* Canvas de Plotly */
     .js-plotly-plot,
     .plotly,
     .plot-container {
         max-width: 100% !important;
         width: 100% !important;
     }

     /* Paneles de visualización con altura controlada y scroll */
     .visualization-container {
         height: auto;
         min-height: 1200px;
         max-height: none;
         overflow-y: visible;
         overflow-x: hidden;
     }

     .visualization {
         min-height: 1250px;
         height: auto;
     }

     /* Mapa: altura fija razonable */
     #project-map-container {
         max-width: 100%;
     }

     #project-map {
         height: 300px !important;
         min-height: 250px;
         max-height: 350px;
         width: 100% !important;
         max-width: 100%;
     }

     /* Gráfica 4D: altura adaptable - SIN límites para verla completa */
     #project-4d-container {
         max-width: 100%;
         overflow-x: auto;
         -webkit-overflow-scrolling: touch;
         margin-bottom: 20px;
     }

     #project-4d-graph {
         height: 70vw !important;
         min-height: 400px;
         max-height: 80vh;
         width: 100% !important;
         max-width: 100%;
     }

     /* Charts containers: scroll horizontal si necesario */
     .charts-container {
         overflow-x: auto;
         overflow-y: visible;
         -webkit-overflow-scrolling: touch;
     }

     .chart-panel {
         min-width: 0;
         max-width: 100%;
     }

     .chart-container {
         min-height: 200px;
         height: auto;
         max-height: 300px;
         max-width: 100%;
     }

     /* =================================================================== */
     /* === SCROLL HORIZONTAL INTERNO PARA PANELES DE GRÁFICAS ============ */
     /* =================================================================== */


     .tab-container .tab-content .chart-container {
         width: 100% !important;
         max-width: 100% !important;
         height: 350px;
         /* Altura fija para evitar efecto estirado horizontal */
     }

     /* Elimino el min-width del canvas para evitar distorsión visual */
     /* Estilos para todos los canvas de gráficos */
     .chart-container canvas {
         display: block !important;
         width: 100%;
         height: 100%;
         max-width: 100%;
     }

     .tab-container .tab-content canvas,
     #panel-largo-plazo .chart-container canvas,
     .charts-container .chart-panel .chart-container canvas {
         width: 100%;
         height: 100%;
     }

     /* Tab content: scroll vertical interno */
     .tab-content {
         max-height: 70vh;
         overflow-y: auto;
         overflow-x: auto;
         -webkit-overflow-scrolling: touch;
     }

     /* Resultados (cards): evitar desbordamiento */
     .results {
         max-width: 100%;
         overflow-x: hidden;
     }

     .result-card {
         min-width: 0;
         word-wrap: break-word;
     }

     .result-card h3 {
         font-size: 0.75rem;
         word-wrap: break-word;
         overflow-wrap: break-word;
     }

     /* Info boxes: texto que no desborde */
     .info-box,
     .info-box-small,
     .info-box-promotional {
         max-width: 100%;
         word-wrap: break-word;
     }
 }

 /* --- Pantallas muy pequeñas (< 360px, ej. iPhone SE 1ª gen) --- */
 @media (max-width: 360px) {
     .panel {
         padding: 0.75rem;
     }

     fieldset {
         padding: 0.75rem;
     }

     .monthly-loads-table .table-header,
     .monthly-loads-table .table-row {
         grid-template-columns: 35px 1fr 1fr;
     }

     .monthly-loads-table .table-header>div,
     .monthly-loads-table .table-row>div:first-child {
         font-size: 0.8em;
         padding: 0.4rem 0.1rem;
     }

     #project-map {
         height: 250px !important;
     }

     #project-4d-graph {
         height: 75vw !important;
         min-height: 350px;
     }

     .visualization,
     .visualization-container {
         min-height: auto !important;
     }
 }


 /* --- iPHONE NOTCH / SAFE AREAS --- */
 @supports (padding: max(0px)) {
     @media (max-width: 767px) {
         body {
             padding-left: max(0.5rem, env(safe-area-inset-left));
             padding-right: max(0.5rem, env(safe-area-inset-right));
             padding-bottom: max(1rem, env(safe-area-inset-bottom));
         }

         .tab-content {
             padding-bottom: max(80px, env(safe-area-inset-bottom));
         }
     }
 }

 /* --- CUSTOM MOBILE STEPPERS --- */
 .stepper-wrapper {
     display: flex;
     align-items: stretch;
     width: 100%;
     gap: 0;
     border: 1px solid #ccc;
     border-radius: 8px;
     overflow: hidden;
 }

 .stepper-wrapper input[type="number"] {
     border: none !important;
     border-radius: 0 !important;
     text-align: center;
     order: 2;
     flex: 1;
     -moz-appearance: textfield !important;
     -webkit-appearance: none !important;
     appearance: none !important;
     margin: 0 !important;
 }

 .stepper-wrapper input[type="number"]::-webkit-inner-spin-button,
 .stepper-wrapper input[type="number"]::-webkit-outer-spin-button {
     -webkit-appearance: none !important;
     display: none !important;
 }

 .stepper-btn {
     background-color: #eee;
     border: none;
     color: #333;
     width: 44px;
     font-size: 1.2rem;
     font-weight: bold;
     cursor: pointer;
     display: flex;
     align-items: center;
     justify-content: center;
     transition: background 0.2s;
     padding: 0;
     margin: 0;
 }

 .stepper-btn:active {
     background-color: #ddd;
 }

 .stepper-btn.minus {
     order: 1;
     border-right: 1px solid #ccc;
 }

 .stepper-btn.plus {
     order: 3;
     border-left: 1px solid #ccc;
 }

 @media (min-width: 768px) {
     .stepper-wrapper {
         display: contents;
     }

     .stepper-wrapper input[type="number"] {
         border: 1px solid #ccc !important;
         border-radius: 8px !important;
         text-align: left;
     }

     .stepper-btn {
         display: none !important;
     }
 }

 /* --- VERTICAL STEPPER PARA TABLAS (SPIN ARRIBA/ABAJO) --- */
 .stepper-wrapper-vertical {
     display: flex;
     align-items: center;
     width: 100%;
     border: 1px solid #ccc;
     border-radius: 4px;
     /* Radio menor para tablas */
     overflow: hidden;
     background: #fff;
 }

 .stepper-wrapper-vertical input[type="number"] {
     border: none !important;
     border-radius: 0 !important;
     text-align: center;
     flex: 1;
     -moz-appearance: textfield !important;
     -webkit-appearance: none !important;
     appearance: none !important;
     margin: 0 !important;
     padding: 4px !important;
     /* Menor padding en tabla */
     min-width: 0 !important;
     /* Permitir shrink */
 }

 .stepper-wrapper-vertical input[type="number"]::-webkit-inner-spin-button,
 .stepper-wrapper-vertical input[type="number"]::-webkit-outer-spin-button {
     -webkit-appearance: none !important;
     display: none !important;
 }

 /* Contenedor de botones verticales */
 .stepper-btn-container {
     display: flex;
     flex-direction: column;
     width: 28px;
     border-left: 1px solid #ccc;
 }

 .stepper-btn-v {
     background-color: #f0f0f0;
     border: none;
     color: #000000 !important;
     /* Negro absoluto */
     width: 100%;
     height: 20px;
     font-size: 16px !important;
     /* Tamaño legible */
     font-family: monospace, sans-serif !important;
     /* Fuente segura */
     font-weight: 900 !important;
     /* Extra negrita */
     cursor: pointer;
     display: flex;
     align-items: center;
     justify-content: center;
     padding: 0;
     margin: 0;
     line-height: 1;
     text-indent: 0;
     /* Asegurar no indentación */
     -webkit-appearance: none;
     /* Quitar estilos iOS */
     appearance: none;
     opacity: 1 !important;
     visibility: visible !important;
 }

 .stepper-btn-v.up {
     border-bottom: 1px solid #ccc;
 }

 .stepper-btn-v:active {
     background: #ddd;
 }

 @media (min-width: 768px) {

     .stepper-wrapper,
     .stepper-wrapper-vertical {
         display: contents;
     }

     .stepper-wrapper input[type="number"],
     .stepper-wrapper-vertical input[type="number"] {
         border: 1px solid #ccc !important;
         border-radius: 8px !important;
         text-align: left;
     }

     .monthly-loads-table input {
         text-align: center;
     }

     .stepper-btn,
     .stepper-btn-v,
     .stepper-btn-container {
         display: none !important;
     }
 }