/* ================================================
   CSS Principal - AstroCarta Premium v2.0
   Paleta: Negro · Azul Eléctrico · Amarillo Dorado
   ================================================ */

:root {
    /* Colores base */
    --bg-deep:      #05070F;
    --bg-dark:      #080D1A;
    --bg-card:      #0C1428;
    --bg-card-2:    #0E1830;
    --sidebar-bg:   #060A16;

    /* Acentos */
    --yellow:       #F5C518;
    --yellow-dim:   rgba(245, 197, 24, 0.12);
    --yellow-glow:  rgba(245, 197, 24, 0.25);
    --blue:         #1A6EFF;
    --blue-dim:     rgba(26, 110, 255, 0.12);
    --blue-glow:    rgba(26, 110, 255, 0.25);
    --cyan:         #00E5FF;
    --cyan-dim:     rgba(0, 229, 255, 0.10);

    /* Bordes */
    --border:       rgba(26, 110, 255, 0.18);
    --border-hover: rgba(26, 110, 255, 0.40);
    --border-yellow:rgba(245, 197, 24, 0.30);

    /* Texto */
    --text:         #EEF2FF;
    --text-muted:   #5A6A8A;
    --text-soft:    #8898BB;

    /* Efectos */
    --success:      #22c55e;
    --error:        #ef4444;

    /* Colores zodiacales/aspectos (se mantienen en SVG) */
    --color-conj:   #F5C518;
    --color-arm:    #1A6EFF;
    --color-inarm:  #ef4444;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-deep);
    background-image:
        radial-gradient(ellipse 60% 50% at 10% 0%, rgba(26,110,255,0.10) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 90% 100%, rgba(245,197,24,0.06) 0%, transparent 60%);
    color: var(--text);
    min-height: 100vh;
    overflow: hidden;
}

/* ── App Layout ── */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ================================================
   SIDEBAR
   ================================================ */
.sidebar {
    width: 230px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: relative;
    z-index: 50;
}

/* Logo */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 28px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.logo-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--yellow) 0%, #e8a800 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #000;
    box-shadow: 0 4px 16px var(--yellow-glow);
    flex-shrink: 0;
}

.logo-text-wrap {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.3px;
}

.logo-badge {
    font-size: 10px;
    font-weight: 600;
    color: var(--yellow);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Nav */
.sidebar-nav {
    flex: 1;
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 0 8px;
    margin-bottom: 6px;
    margin-top: 4px;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--text-soft);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
}

.nav-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.nav-label {
    flex: 1;
}

.nav-tab:hover {
    color: var(--text);
    background: var(--blue-dim);
    border-color: var(--border);
}

.nav-tab:hover .nav-icon {
    background: var(--blue-dim);
    color: var(--blue);
}

.nav-tab.active {
    color: var(--text);
    background: var(--blue-dim);
    border-color: var(--border-hover);
    border-left: 3px solid var(--yellow);
    padding-left: 10px;
}

.nav-tab.active .nav-icon {
    background: var(--yellow-dim);
    color: var(--yellow);
}

/* Footer sidebar */
.sidebar-footer {
    padding: 16px 20px 0 20px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.sidebar-footer-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--text-muted);
}

.sidebar-footer-badge i {
    color: var(--success);
    font-size: 12px;
}

/* ================================================
   MAIN WRAPPER
   ================================================ */
.main-wrapper {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-width: 0;
}

/* ================================================
   CONTROL PANEL (Forms)
   ================================================ */
.control-panel {
    width: 340px;
    flex-shrink: 0;
    background: var(--bg-dark);
    border-right: 1px solid var(--border);
    padding: 28px 22px;
    overflow-y: auto;
}

/* Form hero header */
.form-hero {
    margin-bottom: 24px;
}

.form-hero h2 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 4px;
}

.form-hero-sub {
    font-size: 13px;
    color: var(--text-muted);
}

.text-yellow { color: var(--yellow); }
.text-blue   { color: var(--blue);   }
.text-cyan   { color: var(--cyan);   }

/* Form elements */
.form-container { display: none; }
.form-container.active {
    display: block;
    animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.form-group {
    margin-bottom: 16px;
    position: relative;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group { flex: 1; }

label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

label i { margin-right: 5px; color: var(--blue); }

input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"] {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.25s ease;
    color-scheme: dark;
}

input:focus {
    outline: none;
    border-color: var(--blue);
    background: var(--blue-dim);
    box-shadow: 0 0 0 3px rgba(26,110,255,0.12);
}

/* CTA Button */
.btn-calculate {
    width: 100%;
    padding: 13px 20px;
    background: var(--yellow);
    border: none;
    border-radius: 12px;
    color: #000;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.3px;
}

.btn-calculate:hover {
    background: #FFD740;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--yellow-glow);
}

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

/* ================================================
   AUTOCOMPLETE
   ================================================ */
.autocomplete-suggestions,
.autocomplete-suggestions-current,
.autocomplete-suggestions-a,
.autocomplete-suggestions-b,
.autocomplete-suggestions-transit {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0A1020;
    border: 1px solid var(--border-hover);
    border-radius: 10px;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 12px 32px rgba(0,0,0,0.6), 0 0 0 1px var(--border);
    display: none;
}

.suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13.5px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.15s ease;
    color: var(--text-soft);
}

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

.suggestion-item:hover {
    background: var(--blue-dim);
    color: var(--text);
}

/* ================================================
   WORKSPACE PANEL
   ================================================ */
.workspace-panel {
    flex: 1;
    background: transparent;
    padding: 32px;
    overflow-y: auto;
    min-width: 0;
}

/* ── Welcome Screen ── */
.welcome-screen {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    color: var(--text-muted);
    position: relative;
}

.welcome-screen.active { display: flex; }

.welcome-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(26,110,255,0.06) 0%, transparent 70%);
    pointer-events: none;
}

.welcome-icon {
    font-size: 72px;
    color: var(--blue);
    filter: drop-shadow(0 0 24px rgba(26,110,255,0.4));
    margin-bottom: 24px;
    position: relative;
}

.welcome-screen h2 {
    font-size: 36px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 12px;
    position: relative;
}

.welcome-screen p {
    max-width: 480px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-soft);
    margin-bottom: 40px;
    position: relative;
}

.welcome-stats {
    display: flex;
    gap: 20px;
    position: relative;
}

.welcome-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 13px;
    color: var(--text-soft);
    font-weight: 500;
}

/* ── Loader ── */
.loader-screen {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    gap: 16px;
}

.loader-screen.active { display: flex; }

.spinner-ring {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid var(--border);
    border-top-color: var(--yellow);
    border-right-color: var(--blue);
    animation: spin 1s linear infinite;
    position: relative;
}

.spinner-inner {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: rgba(245,197,24,0.4);
    animation: spin 0.6s linear infinite reverse;
}

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

.loader-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
}

.loader-sub {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ================================================
   RESULTS SCREEN
   ================================================ */
.results-screen { display: none; }
.results-screen.active { display: block; }

/* Results Header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.title-meta h2 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 4px;
}

.title-meta p {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-action {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-soft);
    padding: 10px 18px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-action:hover {
    background: var(--blue-dim);
    border-color: var(--blue);
    color: var(--text);
}

.btn-pdf {
    background: rgba(245, 197, 24, 0.08);
    border-color: var(--border-yellow);
    color: var(--yellow);
}

.btn-pdf:hover {
    background: var(--yellow-dim);
    border-color: var(--yellow);
}

/* ── Results Grid ── */
.results-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

/* ── Cards ── */
.chart-box,
.side-info-box,
.interpretations-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    transition: border-color 0.3s ease;
}

.chart-box:hover,
.side-info-box:hover {
    border-color: var(--border-hover);
}

.card-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i {
    color: var(--blue);
    font-size: 13px;
}

/* SVG Container */
.chart-canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    aspect-ratio: 1;
    max-height: 580px;
    background: rgba(0,0,0,0.15);
    border-radius: 14px;
    padding: 10px;
}

/* ── Technical Table ── */
.technical-table-container {
    max-height: 200px;
    overflow-y: auto;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.tech-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.tech-table th,
.tech-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

.tech-table th {
    background: rgba(26,110,255,0.08);
    color: var(--blue);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: sticky;
    top: 0;
}

.tech-table tr:last-child td { border-bottom: none; }

.tech-table td { color: var(--text-soft); }

.tech-table tbody tr:hover td {
    background: var(--blue-dim);
    color: var(--text);
}

/* ── Aspects Grid ── */
.aspect-grid-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.12);
    border-radius: 12px;
    padding: 16px;
    overflow-x: auto;
}

.aspect-grid-table { border-collapse: collapse; }

.aspect-grid-cell {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255,255,255,0.04);
    text-align: center;
    vertical-align: middle;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aspect-grid-cell.header-cell {
    background: rgba(26,110,255,0.06);
    font-weight: 600;
    cursor: default;
    color: var(--text-muted);
}

.aspect-grid-cell:not(.header-cell):not(.empty-cell):hover {
    background: rgba(255,255,255,0.12);
    transform: scale(1.12);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 2;
    position: relative;
    border-radius: 4px;
}

.aspect-grid-cell.empty-cell {
    border: none;
    background: transparent;
    cursor: default;
}

.aspect-symbol { font-weight: bold; }
.aspect-symbol.conj  { color: var(--yellow); }
.aspect-symbol.arm   { color: var(--blue); }
.aspect-symbol.inarm { color: var(--error); }

/* ================================================
   INTERPRETATIONS
   ================================================ */
.interpretations-box { margin-top: 0; }

.interpretation-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 4px;
}

.interp-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 9px 16px;
    border-radius: 8px;
    transition: all 0.25s ease;
}

.interp-tab-btn.active {
    color: #000;
    background: var(--yellow);
    box-shadow: 0 4px 12px var(--yellow-glow);
}

.interpretation-content {
    line-height: 1.75;
    font-size: 14.5px;
    color: var(--text-soft);
}

.interp-item {
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    padding-bottom: 20px;
}

.interp-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.interp-item h4 {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.interp-item p { text-align: justify; }

/* ================================================
   PROFILES & SUBSECTIONS
   ================================================ */
.profile-sub-section { padding: 10px 0; }

.profile-sub-section h3 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.border-top {
    border-top: 1px solid var(--border);
    margin-top: 16px;
    padding-top: 16px;
}

.margin-top-20 { margin-top: 20px; }

/* ================================================
   HISTORY
   ================================================ */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.25s ease;
}

.history-item:hover {
    background: var(--blue-dim);
    border-color: var(--border-hover);
}

.history-meta h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
}

.history-meta p {
    font-size: 12px;
    color: var(--text-muted);
}

.history-actions { display: flex; gap: 8px; }

.btn-history-load {
    background: var(--blue-dim);
    border: 1px solid rgba(26,110,255,0.3);
    color: #7ab4ff;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    font-weight: 600;
}

.btn-history-load:hover {
    background: rgba(26,110,255,0.25);
}

.btn-history-delete {
    background: rgba(239,68,68,0.10);
    border: 1px solid rgba(239,68,68,0.25);
    color: #fca5a5;
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
}

.btn-history-delete:hover {
    background: rgba(239,68,68,0.25);
}

.empty-message {
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    padding: 24px 0;
    border: 1px dashed var(--border);
    border-radius: 12px;
}

/* ================================================
   SCROLLBAR CUSTOM
   ================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(26,110,255,0.2);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(26,110,255,0.4); }

/* ================================================
   MOBILE HEADER (solo visible en móvil)
   ================================================ */
.mobile-header {
    display: none;
}

/* ================================================
   BOTTOM NAV (solo visible en móvil)
   ================================================ */
.mobile-bottom-nav {
    display: none;
}

/* ================================================
   TABLET BREAKPOINT (≤ 1100px)
   ================================================ */
@media (max-width: 1100px) {
    /* Sidebar colapsa a solo iconos */
    .sidebar {
        width: 68px;
    }

    .logo-text-wrap,
    .nav-label,
    .nav-section-label,
    .sidebar-footer {
        display: none;
    }

    .sidebar-logo {
        justify-content: center;
        padding: 0 0 20px 0;
    }

    .nav-tab {
        justify-content: center;
        padding: 12px;
        border-left: none !important;
        padding-left: 12px !important;
    }

    .nav-tab.active {
        border-left: none;
        border-bottom: 2px solid var(--yellow);
    }

    .nav-icon {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }

    .control-panel {
        width: 300px;
        padding: 20px 16px;
    }

    .workspace-panel {
        padding: 20px;
    }
}

/* ================================================
   MOBILE BREAKPOINT (≤ 700px)
   ================================================ */
@media (max-width: 700px) {

    /* Desactivar overflow oculto en body para scroll normal */
    body {
        overflow: auto;
    }

    /* App container: columna vertical */
    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        padding-bottom: 70px; /* espacio para bottom nav */
    }

    /* Ocultar sidebar en móvil */
    .sidebar {
        display: none;
    }

    /* Main wrapper: columna */
    .main-wrapper {
        flex-direction: column;
        overflow: visible;
        height: auto;
    }

    /* ── Mobile Header ── */
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 20px;
        background: var(--sidebar-bg);
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        z-index: 200;
    }

    .mobile-logo {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-logo-icon {
        width: 34px;
        height: 34px;
        border-radius: 9px;
        background: linear-gradient(135deg, var(--yellow) 0%, #e8a800 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 15px;
        color: #000;
        box-shadow: 0 3px 10px var(--yellow-glow);
    }

    .mobile-logo-text {
        font-size: 16px;
        font-weight: 700;
        color: var(--text);
    }

    .mobile-logo-text span {
        color: var(--yellow);
    }

    /* Botón de toggle form ↔ results en móvil */
    .mobile-toggle-btn {
        background: var(--blue-dim);
        border: 1px solid var(--border-hover);
        color: var(--blue);
        padding: 8px 14px;
        border-radius: 8px;
        font-family: inherit;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        display: none; /* solo visible cuando hay resultados */
    }

    .mobile-toggle-btn.visible {
        display: block;
    }

    /* ── Control Panel: full width ── */
    .control-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 20px 16px;
        overflow-y: visible;
    }

    /* Ocultar control panel cuando se muestran resultados en móvil */
    .app-container.mobile-results .control-panel {
        display: none;
    }

    /* ── Workspace Panel ── */
    .workspace-panel {
        width: 100%;
        padding: 20px 16px;
        overflow-y: visible;
        min-height: 60vh;
    }

    /* Ocultar workspace hasta que haya resultados en móvil */
    .app-container:not(.mobile-results) .workspace-panel {
        display: none;
    }

    /* Pero mostrar siempre si hay una pantalla activa */
    .app-container:not(.mobile-results) .workspace-panel:has(.welcome-screen.active),
    .app-container:not(.mobile-results) .workspace-panel:has(.loader-screen.active) {
        display: none;
    }

    /* Welcome screen en móvil */
    .welcome-screen h2 {
        font-size: 26px;
    }

    .welcome-stats {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .welcome-stat {
        justify-content: center;
    }

    /* Results header apilado */
    .results-header {
        flex-direction: column;
        gap: 14px;
        align-items: flex-start;
    }

    .action-buttons {
        width: 100%;
    }

    .btn-action {
        flex: 1;
        justify-content: center;
        font-size: 13px;
        padding: 10px 12px;
    }

    /* Titles más compactos */
    .title-meta h2 {
        font-size: 20px;
    }

    /* Cards */
    .chart-box,
    .side-info-box,
    .interpretations-box {
        border-radius: 14px;
        padding: 16px;
    }

    .chart-canvas-container {
        max-height: 360px;
    }

    /* Form hero */
    .form-hero h2 {
        font-size: 20px;
    }

    /* Form row en columna */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* ── Bottom Navigation ── */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--sidebar-bg);
        border-top: 1px solid var(--border);
        z-index: 200;
        padding: 6px 0 8px 0;
        justify-content: space-around;
    }

    .mob-nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        background: transparent;
        border: none;
        color: var(--text-muted);
        font-family: inherit;
        font-size: 10px;
        font-weight: 600;
        cursor: pointer;
        padding: 4px 10px;
        border-radius: 10px;
        transition: all 0.2s ease;
        min-width: 56px;
    }

    .mob-nav-btn i {
        font-size: 18px;
        margin-bottom: 1px;
    }

    .mob-nav-btn.active {
        color: var(--yellow);
    }

    .mob-nav-btn.active i {
        filter: drop-shadow(0 0 6px var(--yellow-glow));
    }

    /* Aspect grid en móvil: más pequeña */
    .aspect-grid-cell {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }

    /* Tabla técnica */
    .technical-table-container {
        max-height: 160px;
    }

    .tech-table th,
    .tech-table td {
        padding: 8px 10px;
        font-size: 12px;
    }

    /* Interp tabs */
    .interp-tab-btn {
        font-size: 12.5px;
        padding: 8px 10px;
    }

    .interpretation-content {
        font-size: 13.5px;
    }
}

/* ================================================
   SMALL MOBILE (≤ 400px)
   ================================================ */
@media (max-width: 400px) {
    .mobile-header {
        padding: 12px 14px;
    }

    .chart-canvas-container {
        max-height: 300px;
    }

    .mob-nav-btn {
        font-size: 9px;
        min-width: 46px;
        padding: 4px 6px;
    }

    .mob-nav-btn i {
        font-size: 16px;
    }
}

