/* Elite Academy — RC.3.2, mobile-first */

.eps-guide-panel[hidden]{display:none!important}
.eps-guide-panel,.eps-guide-panel *{box-sizing:border-box}
.eps-guide-panel{position:fixed;z-index:100020;inset:0;display:flex;align-items:flex-end;justify-content:center;color:#152338;font-family:var(--eps-site-font,Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif)}
.eps-guide-backdrop{position:absolute;inset:0;background:rgba(6,20,34,.58);backdrop-filter:blur(9px)}
.eps-guide-dialog{position:relative;width:100%;height:min(92dvh,820px);display:grid;grid-template-rows:auto minmax(0,1fr);overflow:hidden;border-radius:26px 26px 0 0;background:#f7f9fc;box-shadow:0 -28px 90px rgba(6,20,34,.28)}
.eps-guide-dialog>header{min-height:68px;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 14px 12px 18px;background:linear-gradient(135deg,#0d243b,#173f61);color:#fff}
.eps-guide-dialog header small{display:block;color:#dfc15d;font-size:8px;font-weight:900;letter-spacing:.13em}
.eps-guide-dialog header strong{display:block;margin-top:4px;font-size:15px}
.eps-guide-dialog header button{width:40px;height:40px;display:grid;place-items:center;border:1px solid rgba(255,255,255,.15);border-radius:13px;background:rgba(255,255,255,.08);color:#fff;padding:0;cursor:pointer}
.eps-guide-dialog header svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}
.eps-guide-library,.eps-guide-stage{min-height:0;overflow:auto;-webkit-overflow-scrolling:touch;padding:18px 14px max(22px,env(safe-area-inset-bottom))}
.eps-guide-eyebrow{color:#9a721a;font-size:8px;font-weight:900;letter-spacing:.12em}
.eps-guide-library-head h2{margin:5px 0 0;color:#12243a;font-size:28px;line-height:1.05;letter-spacing:-.045em}
.eps-guide-library-head p{margin:8px 0 15px;color:#718095;font-size:11px;line-height:1.5}
.eps-guide-search{height:46px;display:flex;align-items:center;gap:9px;border:1px solid #dfe5ec;border-radius:14px;background:#fff;padding:0 12px;box-shadow:0 7px 24px rgba(8,25,43,.045)}
.eps-guide-search span{color:#8290a2;font-size:18px}
.eps-guide-search input{min-width:0;flex:1;border:0!important;outline:0!important;background:transparent!important;color:#17283d;font:600 13px/1.3 inherit;box-shadow:none!important}
.eps-guide-search input::placeholder{color:#9aa6b5}
.eps-guide-filters{display:flex;gap:7px;margin:12px 0 15px;overflow-x:auto;scrollbar-width:none}
.eps-guide-filters::-webkit-scrollbar{display:none}
.eps-guide-filters button{flex:0 0 auto;min-height:34px;border:1px solid #dfe5ec;border-radius:999px;background:#fff;color:#647489;padding:7px 11px;font-size:9px;font-weight:800;cursor:pointer}
.eps-guide-filters button.is-active{border-color:#0e2a44;background:#0e2a44;color:#fff}
.eps-guide-grid{display:grid;grid-template-columns:1fr;gap:9px}
.eps-guide-card{width:100%;min-height:82px;display:grid;grid-template-columns:46px minmax(0,1fr) auto;align-items:center;gap:11px;border:1px solid #e0e6ed;border-radius:17px;background:#fff;padding:12px;text-align:start;box-shadow:0 8px 25px rgba(8,25,43,.04);cursor:pointer}
.eps-guide-card:active{transform:scale(.99)}
.eps-guide-card-icon{width:46px;height:46px;display:grid;place-items:center;border-radius:14px;background:#102c46;color:#e0c15d;font-size:18px}
.eps-guide-card-copy{min-width:0;display:grid;gap:4px}
.eps-guide-card strong{color:#17283d;font-size:11px}
.eps-guide-card small{color:#78879a;font-size:8px;line-height:1.45}
.eps-guide-card i{height:4px;overflow:hidden;border-radius:999px;background:#edf0f4}
.eps-guide-card i em{width:var(--guide-card-progress);height:100%;display:block;border-radius:inherit;background:linear-gradient(90deg,#ab7b12,#e0c15d)}
.eps-guide-card b{color:#9b741b;font-size:15px}
.eps-guide-no-results{min-height:220px;display:grid;place-content:center;justify-items:center;gap:10px;color:#738296;text-align:center}
.eps-guide-no-results span{width:54px;height:54px;display:grid;place-items:center;border-radius:17px;background:#edf1f5;font-size:24px}
.eps-guide-mobile-handle{width:44px;height:4px;margin:-7px auto 13px;border-radius:999px;background:#d9dfe6}
.eps-guide-step-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.eps-guide-step-top button{border:0;background:transparent;color:#5f7085;padding:4px 0;font-size:9px;font-weight:850;cursor:pointer}
.eps-guide-step-top span{color:#8491a2;font-size:8px;font-weight:800}
.eps-guide-progress{height:6px;margin:11px 0 18px;overflow:hidden;border-radius:999px;background:#e4e9ef}
.eps-guide-progress i{width:var(--progress);height:100%;display:block;border-radius:inherit;background:linear-gradient(90deg,#a97810,#dfc15c);transition:width .2s ease}
.eps-guide-step-card{padding:22px 18px;border:1px solid #e0e6ed;border-radius:21px;background:#fff;text-align:center;box-shadow:0 13px 35px rgba(8,25,43,.055)}
.eps-guide-step-icon{width:58px;height:58px;display:grid;place-items:center;margin:0 auto 15px;border-radius:18px;background:#102c46;color:#e0c15d;font-size:23px}
.eps-guide-step-card>small{color:#a17718;font-size:8px;font-weight:900;letter-spacing:.08em}
.eps-guide-step-card h2{margin:7px auto 0;max-width:560px;color:#13253b;font-size:26px;line-height:1.08;letter-spacing:-.04em}
.eps-guide-step-card p{max-width:600px;margin:10px auto 0;color:#6f7f93;font-size:11px;line-height:1.6}
.eps-guide-primary-action{min-height:42px;width:max-content;max-width:100%;display:inline-flex;align-items:center;justify-content:center;margin-top:17px;border-radius:13px;background:linear-gradient(145deg,#a97911,#dcc05d);color:#102035;padding:9px 15px;font-size:9px;font-weight:900;text-decoration:none}
.eps-guide-response-options{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}
.eps-guide-response-options button{min-height:42px;border:1px solid #dfe5ec;border-radius:13px;background:#fff;color:#586a80;padding:8px 10px;font-size:9px;font-weight:850;cursor:pointer}
.eps-guide-response-options button.is-success{grid-column:1/-1;border-color:#d4ecdf;background:#edf9f3;color:#237452}
.eps-guide-inline-tip{margin-top:10px;padding:13px;border:1px solid #ebdfba;border-radius:14px;background:#fff9e9}
.eps-guide-inline-tip strong{color:#806014;font-size:9px}
.eps-guide-inline-tip p{margin:5px 0 0;color:#716446;font-size:9px;line-height:1.5}
.eps-guide-stage footer{position:sticky;bottom:-22px;display:grid;grid-template-columns:1fr 1.4fr;gap:9px;margin-top:17px;padding:11px 0 max(1px,env(safe-area-inset-bottom));background:linear-gradient(180deg,rgba(247,249,252,0),#f7f9fc 22%)}
.eps-guide-stage footer button,.eps-guide-complete button{min-height:46px;border:1px solid #dce3ea;border-radius:14px;background:#fff;color:#5b6c81;padding:9px 12px;font-size:9px;font-weight:900;cursor:pointer}
.eps-guide-stage footer button.is-primary{border-color:#102c46;background:#102c46;color:#fff}
.eps-guide-stage footer button:disabled{opacity:.42}
.eps-guide-complete{min-height:70%;display:grid;place-content:center;justify-items:center;gap:11px;text-align:center}
.eps-guide-complete>span{width:68px;height:68px;display:grid;place-items:center;border-radius:22px;background:#eaf8f1;color:#1e7c54;font-size:29px}
.eps-guide-complete h2{margin:0;color:#14263c;font-size:25px}
.eps-guide-complete p{max-width:360px;margin:0;color:#718095;font-size:10px}
.eps-guide-highlight{position:relative!important;z-index:100021!important;outline:4px solid rgba(218,177,54,.62)!important;outline-offset:5px!important;border-radius:12px!important}
.eps-guide-open{overflow:hidden}
.eps-ai-guide-shortcut button,.eps-ai-guide-action{width:100%;min-height:38px;display:flex;align-items:center;justify-content:center;gap:8px;border:1px solid rgba(201,168,76,.25)!important;border-radius:11px!important;background:#fff9e9!important;color:#79570c!important;font-size:9px!important;font-weight:850!important;cursor:pointer}

@media(min-width:700px){
.eps-guide-panel{align-items:center;padding:24px}
.eps-guide-dialog{width:min(900px,100%);height:min(720px,calc(100dvh - 48px));border-radius:25px}
.eps-guide-library,.eps-guide-stage{padding:24px}
.eps-guide-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.eps-guide-dialog>header{min-height:76px;padding:14px 16px 14px 23px}
.eps-guide-response-options{grid-template-columns:repeat(3,1fr)}
.eps-guide-response-options button.is-success{grid-column:auto}
.eps-guide-stage footer{bottom:-24px}
.eps-guide-mobile-handle{display:none}
.eps-guide-step-card{padding:30px 34px}
.eps-guide-step-card h2{font-size:31px}
}
@media(min-width:1080px){.eps-guide-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){.eps-guide-panel *{transition:none!important;animation:none!important}}
[dir="rtl"] .eps-guide-card,[dir="rtl"] .eps-guide-step-card{text-align:right}


/* ==========================================================================
 * SPRINT 31.5 — MOBILE GUIDED HELP REPAIR
 * --------------------------------------------------------------------------
 * INCIDENT:
 * `.eps-guide-highlight` historically used z-index:100021 while the Academy
 * panel used z-index:100020. A highlighted field from the page therefore
 * rendered ABOVE the help dialog and visually cut through the guide.
 *
 * MOBILE CONTRACT:
 * - Elite Academy is always the top interaction layer while open.
 * - Page targets may be outlined, but must remain behind the Academy.
 * - The step area owns its scroll.
 * - The navigation footer participates in normal flow on mobile and cannot
 *   cover "Já fiz isso / Explicar melhor / Não encontrei o botão".
 * - Safari safe areas are respected.
 *
 * Do not fix this by raising target z-index again.
 * ========================================================================== */
@media (max-width: 699px){

    html.eps-guide-open,
    html.eps-guide-open body{
        overflow:hidden!important;
        overscroll-behavior:none!important;
    }

    .eps-guide-panel{
        z-index:2147483000!important;
        align-items:stretch!important;
        padding:
            max(8px,env(safe-area-inset-top))
            0
            0!important;
        overflow:hidden!important;
        isolation:isolate!important;
    }

    .eps-guide-backdrop{
        z-index:0!important;
        background:rgba(6,20,34,.66)!important;
    }

    .eps-guide-dialog{
        z-index:2!important;
        align-self:end!important;
        width:100%!important;
        height:calc(100dvh - max(8px,env(safe-area-inset-top)))!important;
        max-height:none!important;
        min-height:0!important;
        grid-template-rows:auto minmax(0,1fr)!important;
        border-radius:24px 24px 0 0!important;
        overflow:hidden!important;
        contain:layout paint!important;
    }

    /*
     * Header stays fixed inside the guide grid.
     */
    .eps-guide-dialog>header{
        position:relative!important;
        z-index:4!important;
        flex:0 0 auto!important;
        min-height:74px!important;
        padding:12px 14px 12px 18px!important;
    }

    .eps-guide-dialog header small{
        font-size:10px!important;
    }

    .eps-guide-dialog header strong{
        font-size:17px!important;
        line-height:1.2!important;
    }

    .eps-guide-dialog header button{
        flex:0 0 44px!important;
        width:44px!important;
        height:44px!important;
        border-radius:14px!important;
    }

    /*
     * Only this region scrolls. The browser page under the modal does not.
     */
    .eps-guide-library,
    .eps-guide-stage{
        position:relative!important;
        z-index:3!important;
        min-height:0!important;
        height:100%!important;
        overflow-x:hidden!important;
        overflow-y:auto!important;
        overscroll-behavior:contain!important;
        -webkit-overflow-scrolling:touch!important;
        padding:
            16px
            14px
            calc(22px + env(safe-area-inset-bottom))!important;
        scroll-padding-top:14px!important;
        scroll-padding-bottom:24px!important;
    }

    .eps-guide-mobile-handle{
        margin:0 auto 14px!important;
    }

    .eps-guide-step-top{
        position:relative!important;
        z-index:2!important;
        min-height:28px!important;
    }

    .eps-guide-step-top button{
        font-size:12px!important;
        padding:5px 0!important;
    }

    .eps-guide-step-top span{
        font-size:11px!important;
    }

    .eps-guide-progress{
        margin:8px 0 14px!important;
    }

    .eps-guide-step-card{
        position:relative!important;
        z-index:2!important;
        padding:20px 16px!important;
        border-radius:19px!important;
        overflow:hidden!important;
    }

    .eps-guide-step-icon{
        width:54px!important;
        height:54px!important;
        margin-bottom:12px!important;
    }

    .eps-guide-step-card>small{
        font-size:10px!important;
    }

    .eps-guide-step-card h2{
        margin-top:7px!important;
        font-size:25px!important;
        line-height:1.08!important;
        overflow-wrap:anywhere!important;
    }

    .eps-guide-step-card p{
        margin-top:9px!important;
        font-size:13px!important;
        line-height:1.55!important;
    }

    .eps-guide-primary-action{
        min-height:44px!important;
        margin-top:14px!important;
        padding:10px 14px!important;
        font-size:11px!important;
    }

    /*
     * Responses remain fully visible before navigation.
     */
    .eps-guide-response-options{
        position:relative!important;
        z-index:2!important;
        grid-template-columns:1fr 1fr!important;
        gap:8px!important;
        margin-top:12px!important;
    }

    .eps-guide-response-options button{
        min-height:46px!important;
        font-size:11px!important;
        line-height:1.25!important;
        padding:9px 8px!important;
    }

    .eps-guide-response-options button.is-success{
        grid-column:1/-1!important;
    }

    /*
     * Critical mobile change:
     * Sticky footer caused overlap on short Safari viewports. It now follows
     * the content naturally, while remaining easy to reach.
     */
    .eps-guide-stage footer{
        position:relative!important;
        inset:auto!important;
        bottom:auto!important;
        z-index:2!important;
        display:grid!important;
        grid-template-columns:minmax(0,1fr) minmax(0,1.4fr)!important;
        gap:9px!important;
        margin:16px 0 0!important;
        padding:0 0 max(4px,env(safe-area-inset-bottom))!important;
        background:transparent!important;
    }

    .eps-guide-stage footer button{
        min-height:50px!important;
        font-size:11px!important;
        line-height:1.2!important;
    }

    /*
     * Never allow a page element to cross the Academy modal.
     * The outline can remain for when the guide is closed/navigated, but the
     * target remains in its natural stacking context underneath the backdrop.
     */
    body .eps-guide-highlight,
    .eps-guide-highlight{
        z-index:auto!important;
        isolation:auto!important;
    }
}

/*
 * Global safety invariant:
 * The modal itself must always beat a highlighted target, desktop included.
 */
.eps-guide-panel:not([hidden]){
    z-index:2147483000!important;
}

.eps-guide-panel:not([hidden]) ~ .eps-guide-highlight,
body:has(.eps-guide-panel:not([hidden])) .eps-guide-highlight{
    z-index:auto!important;
}
