/**
 * Cromo móvil compartido (landing, RGA, login).
 * No altera desktop. Breakpoint 720px salvo donde se indica.
 */
@media (max-width: 720px) {
    #ep-mobile-menu-panel {
        width: min(20rem, 92vw);
        padding: 1rem 1.1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
    }
    #ep-mobile-menu-panel .ep-logo {
        margin-bottom: 0.75rem;
        padding-bottom: 0.65rem;
    }
    #ep-mobile-menu-panel a:not(.ep-btn) {
        padding: 0.55rem 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    .dark-mode-toggle,
    #ep-translate-wrap,
    .ep-sound-toggle {
        display: none !important;
    }

    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="file"]),
    select,
    textarea {
        font-size: 16px !important;
    }

    .g_id_signin,
    .g_id_signin > div,
    .g_id_signin iframe {
        max-width: 100% !important;
    }
}

@media (max-width: 720px) {
    .ep-ticker {
        transition: transform 0.22s ease, opacity 0.22s ease;
    }
    .ep-ticker.is-scrolled-away {
        transform: translateY(-110%);
        opacity: 0;
        pointer-events: none;
    }
}

@media (max-width: 639px) {
    .ep-mobile-jump {
        display: none !important;
    }
}

#ep-mobile-menu-panel .ep-menu-tool {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 0;
    border: 0;
    border-bottom: 1px solid var(--slate-100, #f1f5f9);
    background: none;
    color: var(--slate-700, #334155);
    font: inherit;
    font-size: 0.9375rem;
    text-align: left;
    cursor: pointer;
}
#ep-mobile-menu-panel .ep-menu-langs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.45rem 0 0.75rem;
}
#ep-mobile-menu-panel .ep-menu-langs button {
    appearance: none;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 2.5rem;
}
html[data-theme="dark"] #ep-mobile-menu-panel .ep-menu-tool {
    color: #e2e8f0;
    border-bottom-color: #334155;
}
html[data-theme="dark"] #ep-mobile-menu-panel .ep-menu-langs button {
    background: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

/* ── Dock inferior: espacio para chat + Gerbi ── */
@media (max-width: 720px) {
    body:has(#ep-chat-hub) {
        padding-bottom: calc(6.25rem + env(safe-area-inset-bottom, 0px));
    }
    body.ep-home:has(#ep-chat-hub):has(.ep-sticky-cta.is-visible) {
        padding-bottom: calc(10rem + env(safe-area-inset-bottom, 0px));
    }
    body:has(#ep-chat-hub) .ep-gerbi.ep-gerbi--static {
        bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
        left: max(0.45rem, env(safe-area-inset-left, 0px));
        z-index: 85;
    }
    body.ep-home:has(.ep-sticky-cta.is-visible) .ep-gerbi.ep-gerbi--static {
        bottom: calc(4.35rem + env(safe-area-inset-bottom, 0px));
    }
}

/* ── Saludo diario Gerbi (modal) ── */
@media (max-width: 720px) {
    .ep-saludo-overlay {
        align-items: flex-end;
        justify-content: stretch;
        padding: 0;
        padding-top: env(safe-area-inset-top, 0px);
    }
    .ep-saludo-card {
        max-width: none;
        width: 100%;
        max-height: min(92dvh, 100%);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 1.25rem 1.25rem 0 0;
        padding: 1.1rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
        animation: none;
    }
    .ep-saludo-gerbi {
        flex: 0 0 100%;
        justify-content: flex-start;
    }
    .ep-saludo-gerbi img {
        width: 72px;
    }
    .ep-saludo-body {
        flex: 1 1 100%;
    }
    .ep-saludo-body h2 {
        font-size: 1.25rem;
    }
    .ep-saludo-frase-text,
    .ep-saludo-cafe {
        font-size: 0.9375rem;
    }
    .ep-saludo-weather {
        font-size: 0.8125rem;
    }
    .ep-saludo-btn,
    .ep-saludo-btn-secondary {
        min-height: 44px;
        font-size: 0.875rem;
    }
    .ep-saludo-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .ep-saludo-btn-secondary {
        margin-left: 0;
        width: 100%;
    }
    .ep-saludo-palabra-word {
        font-size: 0.9375rem;
    }
    .ep-saludo-palabra-def {
        font-size: 0.8125rem;
    }
}
html[data-theme="dark"] .ep-saludo-card {
    background: linear-gradient(165deg, #1e293b 0%, #0f172a 55%, #1e293b 100%);
    border-color: #334155;
    color: #e2e8f0;
}
html[data-theme="dark"] .ep-saludo-body h2,
html[data-theme="dark"] .ep-saludo-frase-text,
html[data-theme="dark"] .ep-saludo-cafe,
html[data-theme="dark"] .ep-saludo-weather {
    color: #f1f5f9;
}
html[data-theme="dark"] .ep-saludo-quote p {
    color: #e2e8f0;
}
html[data-theme="dark"] .ep-saludo-palabra {
    background: #0f172a;
    border-color: #334155;
}
html[data-theme="dark"] .ep-saludo-palabra-word {
    color: #f1f5f9;
}
html[data-theme="dark"] .ep-saludo-btn-secondary {
    background: #1e293b;
    color: #7dd3fc;
    border-color: #475569;
}

/* ── Panel alumno: nav horizontal ── */
@media (max-width: 720px) {
    .pp-nav-inner {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.35rem;
        padding: 0.45rem 0.65rem;
        padding-bottom: calc(0.45rem + env(safe-area-inset-bottom, 0px));
    }
    .pp-nav-inner::-webkit-scrollbar {
        display: none;
    }
    .pp-nav-group {
        flex-shrink: 0;
        border-left: none !important;
        margin-left: 0 !important;
        padding-left: 0 !important;
        gap: 0.2rem;
    }
    .pp-nav-group + .pp-nav-group {
        padding-left: 0.35rem;
        margin-left: 0.15rem;
        border-left: 1px solid rgba(15, 23, 42, 0.08) !important;
    }
    .pp-nav-link {
        padding: 0.42rem 0.65rem;
        font-size: 0.78rem;
        min-height: 44px;
    }
    .pp-nav-link span {
        display: inline;
        max-width: 4.5rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    section[id] {
        scroll-margin-top: 4.5rem;
    }
    .examen-input {
        font-size: 16px !important;
    }
    section > .bg-white:hover,
    section > div > .bg-white:hover {
        transform: none;
    }
}
html[data-theme="dark"] .pp-nav {
    background-color: rgba(15, 23, 42, 0.92);
    border-bottom-color: #334155;
}
html[data-theme="dark"] .pp-nav-link {
    color: #cbd5e1;
}
html[data-theme="dark"] .pp-nav-link.active {
    color: #7dd3fc;
    background: rgba(0, 112, 176, 0.22);
}
