/*
|--------------------------------------------------------------------------
| ESSAYDEW ACADEMIC COPILOT PWA
|--------------------------------------------------------------------------
*/


#essaydew-network-status[hidden],
.essaydew-install-prompt[hidden],
.essaydew-mini-install[hidden],
.essaydew-ios-install-guide[hidden] {
    display: none !important;
}


/* =========================================================
   NETWORK STATUS
   ========================================================= */

.essaydew-network-status {
    position: fixed;

    left: 50%;

    bottom:
        max(
            14px,
            env(safe-area-inset-bottom)
        );

    z-index: 999999;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    max-width:
        calc(
            100vw - 24px
        );

    min-height: 38px;

    padding:
        8px
        13px;

    border-radius:
        999px;

    background:
        rgba(
            7,
            17,
            31,
            .94
        );

    border:
        1px solid
        rgba(
            255,
            255,
            255,
            .08
        );

    color:
        #ffffff;

    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size:
        13px;

    font-weight:
        700;

    line-height:
        1.2;

    text-align:
        center;

    box-shadow:
        0
        8px
        28px
        rgba(
            0,
            0,
            0,
            .24
        );

    backdrop-filter:
        blur(
            10px
        );

    -webkit-backdrop-filter:
        blur(
            10px
        );

    transform:
        translateX(
            -50%
        );

    pointer-events:
        none;
}


.essaydew-network-status__dot {

    width:
        8px;

    height:
        8px;

    flex:
        0 0 8px;

    border-radius:
        50%;

    background:
        currentColor;
}


.essaydew-network-status__text {

    display:
        block;

    overflow:
        hidden;

    white-space:
        nowrap;

    text-overflow:
        ellipsis;
}


.essaydew-network-status.is-offline {

    color:
        #ffd36a;

    border-color:
        rgba(
            255,
            211,
            106,
            .18
        );

    background:
        linear-gradient(
            180deg,
            rgba(
                20,
                24,
                31,
                .97
            ),
            rgba(
                8,
                15,
                26,
                .97
            )
        );
}


.essaydew-network-status.is-online {

    color:
        #8ef0b5;

    border-color:
        rgba(
            142,
            240,
            181,
            .18
        );

    background:
        linear-gradient(
            180deg,
            rgba(
                13,
                32,
                26,
                .97
            ),
            rgba(
                7,
                18,
                21,
                .97
            )
        );
}


/* =========================================================
   LARGE INSTALL CARD
   ========================================================= */

.essaydew-install-prompt {

    position:
        fixed;

    left:
        0;

    right:
        0;

    bottom:
        0;

    z-index:
        1000000;

    display:
        flex;

    justify-content:
        center;

    padding:
        12px
        12px
        max(
            12px,
            env(safe-area-inset-bottom)
        );

    pointer-events:
        none;
}


.ed-install-card {

    position:
        relative;

    width:
        min(
            100%,
            390px
        );

    padding:
        14px;

    border-radius:
        22px;

    background:

        radial-gradient(
            circle at 12% 0%,
            rgba(
                240,
                180,
                47,
                .12
            ),
            transparent 34%
        ),

        linear-gradient(
            180deg,
            rgba(
                12,
                22,
                34,
                .985
            ),
            rgba(
                5,
                12,
                20,
                .99
            )
        );

    border:
        1px solid
        rgba(
            226,
            164,
            38,
            .22
        );

    box-shadow:

        0
        18px
        55px
        rgba(
            0,
            0,
            0,
            .38
        ),

        inset
        0
        1px
        0
        rgba(
            255,
            255,
            255,
            .035
        );

    backdrop-filter:
        blur(
            18px
        );

    -webkit-backdrop-filter:
        blur(
            18px
        );

    transform:
        translateY(
            calc(
                100% + 30px
            )
        );

    opacity:
        0;

    transition:
        transform .22s ease,
        opacity .18s ease;

    pointer-events:
        auto;
}


.essaydew-install-prompt.is-visible
.ed-install-card {

    transform:
        translateY(
            0
        );

    opacity:
        1;
}


.ed-install-close {

    position:
        absolute;

    top:
        8px;

    right:
        9px;

    width:
        30px;

    height:
        30px;

    padding:
        0;

    border:
        0;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    border-radius:
        50%;

    background:
        rgba(
            255,
            255,
            255,
            .055
        );

    color:
        #97a3b4;

    font-size:
        20px;

    cursor:
        pointer;
}


.ed-install-top {

    display:
        flex;

    align-items:
        center;

    gap:
        11px;

    padding-right:
        34px;
}


.ed-install-icon {

    width:
        52px;

    height:
        52px;

    flex:
        0 0 52px;

    border-radius:
        14px;

    box-shadow:
        0
        7px
        20px
        rgba(
            184,
            121,
            14,
            .18
        );
}


.ed-install-copy {

    min-width:
        0;

    text-align:
        left;
}


.ed-install-brand {

    color:
        #ffffff;

    font-size:
        17px;

    font-weight:
        850;

    letter-spacing:
        -.025em;
}


.ed-install-brand span {

    color:
        #f5c451;
}


.ed-install-subtitle {

    margin-top:
        4px;

    color:
        #8996a8;

    font-size:
        10px;

    font-weight:
        750;

    letter-spacing:
        .09em;

    text-transform:
        uppercase;
}


.ed-install-title {

    margin-top:
        13px;

    color:
        #f7f5ef;

    font-size:
        17px;

    font-weight:
        850;

    line-height:
        1.18;

    letter-spacing:
        -.025em;
}


.ed-install-text {

    margin-top:
        6px;

    color:
        #95a2b4;

    font-size:
        12.5px;

    line-height:
        1.45;
}


.ed-install-action {

    width:
        100%;

    min-height:
        45px;

    margin-top:
        12px;

    border:
        1px solid
        rgba(
            255,
            220,
            132,
            .50
        );

    border-radius:
        13px;

    background:
        linear-gradient(
            180deg,
            #f8cf6b,
            #e5a324 58%,
            #c98210
        );

    color:
        #161005;

    font:
        inherit;

    font-size:
        13.5px;

    font-weight:
        850;

    cursor:
        pointer;

    transition:
        transform .12s ease;
}


.ed-install-action:active {

    transform:
        scale(
            .985
        );
}


.ed-install-later {

    width:
        100%;

    margin-top:
        3px;

    padding:
        7px;

    border:
        0;

    background:
        transparent;

    color:
        #788598;

    font:
        inherit;

    font-size:
        11.5px;

    font-weight:
        700;

    cursor:
        pointer;
}


/* =========================================================
   TINY INSTALL BUTTON
   =========================================================
   Hidden normally.
   Appears briefly during interaction.
   ========================================================= */

.essaydew-mini-install {

    position:
        fixed;

    /*
     * Immediately below the EssayDew header,
     * near the right/mobile-menu side.
     */
    top:
        calc(
            max(
                8px,
                env(safe-area-inset-top)
            ) +
            76px
        );

    right:
        max(
            8px,
            env(safe-area-inset-right)
        );

    z-index:
        999990;

    width:
        32px;

    height:
        32px;

    padding:
        0;

    display:
        inline-flex;

    align-items:
        center;

    justify-content:
        center;

    border-radius:
        11px;

    border:
        1px solid
        rgba(
            239,
            186,
            67,
            .26
        );

    background:
        linear-gradient(
            180deg,
            rgba(
                32,
                28,
                18,
                .43
            ),
            rgba(
                6,
                13,
                21,
                .38
            )
        );

    color:
        #efbd4f;

    box-shadow:

        0
        5px
        16px
        rgba(
            0,
            0,
            0,
            .13
        ),

        inset
        0
        1px
        0
        rgba(
            255,
            255,
            255,
            .05
        );

    backdrop-filter:
        blur(
            8px
        );

    -webkit-backdrop-filter:
        blur(
            8px
        );

    opacity:
        0;

    transform:
        translateY(
            -4px
        )
        scale(
            .92
        );

    cursor:
        pointer;

    pointer-events:
        none;

    -webkit-tap-highlight-color:
        transparent;

    transition:
        opacity .18s ease,
        transform .18s ease;
}


.essaydew-mini-install.is-visible {

    opacity:
        .78;

    transform:
        translateY(
            0
        )
        scale(
            1
        );

    pointer-events:
        auto;
}


.essaydew-mini-install:active {

    opacity:
        1;

    transform:
        scale(
            .91
        );
}


.essaydew-mini-install svg {

    width:
        16px;

    height:
        16px;

    display:
        block;

    fill:
        none;

    stroke:
        currentColor;

    stroke-width:
        1.9;

    stroke-linecap:
        round;

    stroke-linejoin:
        round;
}


/* =========================================================
   IPHONE INSTALL GUIDE
   ========================================================= */

.essaydew-ios-install-guide {

    position:
        fixed;

    /*
     * Upper-left of the actual webpage,
     * just underneath Safari's browser chrome.
     */
    top:
        max(
            10px,
            env(safe-area-inset-top)
        );

    left:
        max(
            10px,
            env(safe-area-inset-left)
        );

    z-index:
        1000001;

    width:
        min(
            260px,
            calc(
                100vw - 24px
            )
        );

    padding:
        11px;

    border-radius:
        17px;

    background:

        radial-gradient(
            circle at 0% 0%,
            rgba(
                233,
                174,
                49,
                .13
            ),
            transparent 36%
        ),

        linear-gradient(
            160deg,
            rgba(
                11,
                22,
                34,
                .97
            ),
            rgba(
                5,
                11,
                18,
                .965
            )
        );

    border:
        1px solid
        rgba(
            231,
            175,
            55,
            .25
        );

    box-shadow:
        0
        14px
        38px
        rgba(
            0,
            0,
            0,
            .30
        );

    backdrop-filter:
        blur(
            16px
        );

    -webkit-backdrop-filter:
        blur(
            16px
        );

    color:
        #f6f2e8;

    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    opacity:
        0;

    transform:
        translateY(
            -8px
        )
        scale(
            .97
        );

    transition:
        opacity .18s ease,
        transform .20s ease;
}


.essaydew-ios-install-guide.is-visible {

    opacity:
        1;

    transform:
        translateY(
            0
        )
        scale(
            1
        );
}


.ed-ios-guide__head {

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        8px;
}


.ed-ios-guide__brand {

    min-width:
        0;

    display:
        flex;

    align-items:
        center;

    gap:
        8px;
}


.ed-ios-guide__brand img {

    width:
        30px;

    height:
        30px;

    flex:
        0 0 30px;

    border-radius:
        9px;
}


.ed-ios-guide__brand div {

    min-width:
        0;
}


.ed-ios-guide__brand strong {

    display:
        block;

    color:
        #ffffff;

    font-size:
        13px;

    line-height:
        1.15;

    font-weight:
        850;
}


.ed-ios-guide__brand small {

    display:
        block;

    margin-top:
        2px;

    color:
        #9b8f75;

    font-size:
        9px;

    font-weight:
        700;

    text-transform:
        uppercase;

    letter-spacing:
        .07em;
}


.ed-ios-guide__close {

    width:
        27px;

    height:
        27px;

    flex:
        0 0 27px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    padding:
        0;

    border:
        0;

    border-radius:
        50%;

    background:
        rgba(
            255,
            255,
            255,
            .055
        );

    color:
        #8996a7;

    font-size:
        18px;

    cursor:
        pointer;
}


.ed-ios-guide__steps {

    margin-top:
        10px;

    display:
        grid;

    gap:
        6px;
}


.ed-ios-guide__step {

    display:
        grid;

    grid-template-columns:
        23px
        1fr;

    align-items:
        center;

    gap:
        7px;

    min-height:
        29px;

    padding:
        4px
        6px;

    border-radius:
        9px;

    background:
        rgba(
            255,
            255,
            255,
            .025
        );

    color:
        #c8c2b4;

    font-size:
        11px;

    line-height:
        1.25;
}


.ed-ios-guide__step > span {

    width:
        22px;

    height:
        22px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    border-radius:
        7px;

    background:
        rgba(
            224,
            165,
            39,
            .09
        );

    border:
        1px solid
        rgba(
            224,
            165,
            39,
            .17
        );

    color:
        #f2bd4c;

    font-size:
        10px;

    font-weight:
        900;
}


.ed-ios-guide__step strong {

    color:
        #f2d58c;

    font-weight:
        850;
}


.ed-ios-guide__hint {

    margin-top:
        8px;

    color:
        #706b62;

    font-size:
        9.5px;

    line-height:
        1.25;

    text-align:
        center;
}


/* =========================================================
   SMALL PHONES
   ========================================================= */

@media (
    max-width:
    380px
) {

    .essaydew-network-status {

        max-width:
            calc(
                100vw - 16px
            );

        min-height:
            36px;

        padding:
            7px
            11px;

        font-size:
            12.5px;
    }


    .essaydew-mini-install {

        right:
            6px;

        width:
            30px;

        height:
            30px;

        border-radius:
            10px;
    }


    .essaydew-ios-install-guide {

        width:
            min(
                245px,
                calc(
                    100vw - 20px
                )
            );

        left:
            8px;

        padding:
            10px;
    }
}


/* =========================================================
   SHORT PHONES
   ========================================================= */

@media (
    max-height:
    620px
) {

    .essaydew-install-prompt {

        padding-top:
            7px;
    }


    .ed-install-card {

        padding:
            11px
            12px;

        border-radius:
            18px;
    }


    .ed-install-icon {

        width:
            45px;

        height:
            45px;

        flex-basis:
            45px;

        border-radius:
            12px;
    }


    .ed-install-title {

        margin-top:
            9px;

        font-size:
            15px;
    }


    .ed-install-text {

        font-size:
            11.5px;
    }


    .ed-install-action {

        min-height:
            41px;

        margin-top:
            9px;
    }


    .essaydew-ios-install-guide {

        top:
            6px;
    }


    .ed-ios-guide__steps {

        gap:
            4px;
    }


    .ed-ios-guide__step {

        min-height:
            26px;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (
    prefers-reduced-motion:
    reduce
) {

    .essaydew-network-status,

    .ed-install-card,

    .ed-install-action,

    .essaydew-mini-install,

    .essaydew-ios-install-guide {

        transition:
            none !important;

        animation:
            none !important;
    }
}