/* ==========================================================================
   H3 MAIL — TOPBAR LIMPA E ESTÁVEL
   ==========================================================================

   Estrutura:
   [ Logo/sidebar ] [ Pesquisar ] [ espaço flexível ] [ Conta + tema ]

   O aviso de lançamento NÃO existe mais na topbar.
   ========================================================================== */


/* --------------------------------------------------------------------------
   DESKTOP
   -------------------------------------------------------------------------- */

@media (min-width: 881px) {

    html body.mail-app .topbar {
        position: fixed !important;
        z-index: 80 !important;

        top: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        left: 0 !important;

        width: 100% !important;
        max-width: 100% !important;
        height: var(--topbar-h) !important;

        display: grid !important;

        grid-template-columns:
            var(--nav-w)
            minmax(220px, 520px)
            minmax(24px, 1fr)
            max-content !important;

        align-items: center !important;

        gap: 14px !important;

        box-sizing: border-box !important;

        margin: 0 !important;

        padding:
            0
            16px
            0
            0 !important;

        overflow: hidden !important;
    }


    /*
    | Logo / área da sidebar.
    */

    html body.mail-app
    .topbar
    .topbar-brand {
        grid-column: 1 !important;

        position: static !important;

        min-width: 0 !important;

        transform: none !important;
    }


    /*
    | Pesquisa.
    */

    html body.mail-app
    .topbar
    .global-search {
        grid-column: 2 !important;

        position: static !important;

        width: 100% !important;
        min-width: 0 !important;
        max-width: 520px !important;

        margin: 0 !important;

        transform: none !important;
    }


    /*
    | Conta + tema.
    */

    html body.mail-app
    .topbar
    .topbar-actions {
        grid-column: 4 !important;

        position: static !important;

        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;

        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;

        gap: 8px !important;

        justify-self: end !important;

        margin: 0 !important;
        padding: 0 !important;

        transform: none !important;
    }

    html body.mail-app
    .topbar
    .topbar-account-summary {
        width: auto !important;
        min-width: 0 !important;
        max-width: 190px !important;

        margin: 0 !important;

        padding:
            4px
            9px !important;

        box-sizing: border-box !important;
    }


    /*
    | Páginas sem pesquisa.
    */

    html body.mail-app.settings-page
    .topbar
    .global-search,

    html body.mail-app.support-page
    .topbar
    .global-search {
        visibility: hidden !important;
        pointer-events: none !important;
    }
}


/* --------------------------------------------------------------------------
   NOTEBOOK
   -------------------------------------------------------------------------- */

@media (max-width: 1250px) and (min-width: 1001px) {

    html body.mail-app .topbar {
        grid-template-columns:
            var(--nav-w)
            minmax(200px, 360px)
            minmax(18px, 1fr)
            max-content !important;

        gap: 10px !important;
    }

    html body.mail-app
    .topbar
    .topbar-account-summary {
        max-width: 145px !important;
    }

    html body.mail-app
    .topbar
    .topbar-account-summary span {
        display: none !important;
    }
}


/* --------------------------------------------------------------------------
   DESKTOP ESTREITO
   -------------------------------------------------------------------------- */

@media (max-width: 1000px) and (min-width: 881px) {

    html body.mail-app .topbar {
        grid-template-columns:
            var(--nav-w)
            minmax(160px, 280px)
            minmax(10px, 1fr)
            max-content !important;

        gap: 8px !important;

        padding-right: 10px !important;
    }

    html body.mail-app
    .topbar
    .topbar-account-summary {
        max-width: 105px !important;
    }

    html body.mail-app
    .topbar
    .topbar-account-summary span,

    html body.mail-app
    .topbar
    .topbar-account-summary small {
        display: none !important;
    }
}


/* --------------------------------------------------------------------------
   MOBILE
   -------------------------------------------------------------------------- */

@media (max-width: 880px) {

    /*
    | O comportamento mobile original continua sendo controlado pelo app.css.
    | Apenas garantimos que nenhuma regra desktop deste arquivo interfira.
    */

    html body.mail-app
    .topbar
    .topbar-account-summary {
        display: none !important;
    }
}
