/* Controles que precisam continuar legíveis e alcançáveis em telas estreitas. */
.esd-suite-dock .esd-apps-grid{display:grid!important;flex:0 0 20px;width:20px!important;height:20px!important;grid-template-columns:repeat(3,4px)!important;grid-template-rows:repeat(3,4px)!important;gap:3px!important}
.esd-suite-dock .esd-apps-grid i{display:block!important;width:4px!important;height:4px!important;min-width:4px;min-height:4px;background:currentColor;border-radius:1px}
.esd-os-window-loader.has-load-error>span{display:none}
.esd-os-loader-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;max-width:100%;padding:12px}
.esd-os-loader-actions[hidden]{display:none}
.esd-os-loader-actions :is(button,a){display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 14px;border:1px solid #2455df;border-radius:8px;background:#fff;color:#1743a7;font:600 13px Sora,Arial,sans-serif;text-decoration:none;cursor:pointer}
.esd-os-window-loader strong{max-width:90%;font-size:13px;text-align:center}
.esd-response-pagination,.esun-task-pagination{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:12px;padding:16px 4px;font-size:13px}
@media(max-width:600px){
    .esd-desktop-icons button{height:auto;min-height:104px;align-content:start;gap:7px;padding:6px 3px}
    .esd-desktop-icons strong{display:block;width:100%;max-width:100%;overflow:visible;white-space:normal;overflow-wrap:anywhere;font-size:11px;line-height:1.35;-webkit-line-clamp:unset;line-clamp:unset}
    .esd-studio label,.esd-studio-public label{font-size:12px;line-height:1.4}
    .esd-studio :is(button,.esd-studio-secondary),.esd-studio-public button{min-height:44px}
    .esd-studio :is(input,select,textarea),.esd-studio-public :is(input,select,textarea){font-size:16px}
    .esd-slides-ribbon-tabs button{flex:0 0 auto;min-height:44px}
}

/* Login shared by the desktop and mobile portal. */
.esd-desktop-login { overflow-y:auto; padding:24px; }
.esd-desktop-login .esd-portal-login {
    display:grid; width:min(920px,100%); max-width:none; min-height:500px;
    grid-template-columns:minmax(0,1fr) minmax(340px,.9fr); margin:auto;
    overflow:hidden; border:1px solid rgba(165,195,241,.24); border-radius:24px;
    background:#fff; padding:0; box-shadow:0 28px 90px rgba(0,0,0,.4);
    font-family:Sora,Arial,sans-serif;
}
.esd-login-intro { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; padding:clamp(30px,5vw,64px); background:radial-gradient(circle at 85% 15%,rgba(79,136,232,.42),transparent 35%),linear-gradient(155deg,#0b214c,#0c1530 80%); color:#f9fbff; }
.esd-login-intro img { width:66px; height:66px; margin-bottom:28px; object-fit:contain; }
.esd-login-intro>span,.esd-login-eyebrow { color:#d99c08; font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.esd-login-intro>span { color:#ffd775; }
.esd-login-intro h1 { max-width:360px; margin:14px 0 12px; color:#fff; font-size:clamp(27px,3.2vw,38px); line-height:1.18; letter-spacing:-.045em; }
.esd-login-intro p { max-width:350px; margin:0; color:#c9d7f0; font-size:14px; line-height:1.7; }
.esd-login-intro-foot { margin-top:auto; padding-top:48px; color:#aebedc; font-size:11px; }
.esd-login-panel { display:flex; flex-direction:column; justify-content:center; min-width:0; padding:clamp(28px,5vw,58px); }
.esd-login-panel-head h2 { margin:7px 0 8px; color:#122047; font-size:27px; letter-spacing:-.03em; }
.esd-login-panel-head p { margin:0 0 22px; color:#5b6981; font-size:13px; line-height:1.5; }
.esd-login-error { border:1px solid #e8b3b5; border-radius:9px; background:#fff2f1; padding:11px 13px; color:#80262c; font-size:12px; line-height:1.45; }
.esd-login-panel .login-username,.esd-login-panel .login-password { margin:0 0 16px; }
.esd-login-panel label { display:block; margin:0 0 7px; color:#263550; font-size:12px; font-weight:700; }
.esd-login-panel input[type=text],.esd-login-panel input[type=password] { width:100%; min-height:48px; border:1px solid #cbd5e4; border-radius:10px; background:#fff; padding:10px 13px; color:#17243d; font:500 14px Sora,Arial,sans-serif; }
.esd-login-panel input:focus-visible,.esd-login-panel a:focus-visible { outline:2px solid #285ed5; outline-offset:2px; }
.esd-login-panel .login-remember { margin:8px 0 19px; }
.esd-login-panel .login-remember label { display:inline-flex; align-items:center; gap:9px; margin:0; color:#52617a; font-weight:500; }
.esd-login-panel .login-remember input { width:17px; height:17px; margin:0; accent-color:#1b55bb; }
.esd-login-panel .login-submit { margin:0; }
.esd-login-panel input[type=submit] { width:100%; min-height:48px; border:0; border-radius:10px; background:#efb321; color:#132143; font-size:13px; font-weight:800; cursor:pointer; }
.esd-login-panel input[type=submit]:hover { background:#ffd15c; }
.esd-login-help { display:flex; flex-direction:column; align-items:center; gap:18px; margin-top:18px; color:#75829a; font-size:11px; text-align:center; }
.esd-login-help a { color:#194fa9; font-weight:700; text-decoration:none; }
.esd-login-challenge { max-width:100%; margin:12px 0; }

@media (max-width:760px) {
    .esd-desktop-login { inset:0!important; display:flex; align-items:flex-start; justify-content:center; min-height:100dvh; overflow-x:hidden; overflow-y:auto; padding:max(18px,env(safe-area-inset-top)) 13px max(22px,env(safe-area-inset-bottom)); }
    .esd-desktop-login .esd-portal-login { width:min(480px,100%); min-height:0; grid-template-columns:1fr; border-radius:18px; }
    .esd-login-intro { padding:23px 24px 19px; }
    .esd-login-intro img { width:48px; height:48px; margin-bottom:12px; }
    .esd-login-intro h1 { margin:8px 0; font-size:23px; }
    .esd-login-intro p { font-size:12px; line-height:1.5; }
    .esd-login-intro-foot { display:none; }
    .esd-login-panel { padding:25px 24px 30px; }
    .esd-login-panel-head h2 { font-size:23px; }
    .esd-login-panel input[type=text],.esd-login-panel input[type=password] { font-size:16px; }

    body.esd-os-shell .esd-desktop-area:not(.esd-desktop-login) { overflow-y:auto; overscroll-behavior:contain; }
    .esd-desktop-icons { grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px 7px; padding:98px 14px 90px; }
    .esd-desktop-icons button { min-height:94px; height:auto; gap:7px; padding:7px 3px; touch-action:manipulation; }
    .esd-desktop-icons button>span { width:60px; height:60px; }
    .esd-desktop-icons img { width:55px; height:55px; }
    .esd-desktop-icons strong { max-width:100%; font-size:11px; line-height:1.25; white-space:normal; text-shadow:0 1px 5px #0a1733; }
    .esd-desktop-clock-widget>span,.esd-desktop-clock-widget small { font-size:10px; }
    .esd-mobile-home-button { min-width:44px; min-height:44px; }
    .esd-suite-dock { min-height:calc(62px + env(safe-area-inset-bottom)); gap:4px; padding:7px max(10px,env(safe-area-inset-right)) max(7px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left)); scrollbar-width:none; }
    .esd-suite-dock::-webkit-scrollbar { display:none; }
    .esd-suite-dock>button,.esd-suite-dock .esd-dock-launcher { min-width:46px; width:46px; height:46px; flex-basis:46px; }
    .esd-suite-dock>button img { width:40px; height:40px; }
    .esd-global-launcher.esd-start-menu { top:max(8px,env(safe-area-inset-top)); bottom:calc(70px + env(safe-area-inset-bottom)); padding:16px 13px 0; }
    .esd-start-search input { font-size:16px!important; }
    .esd-start-section h2 { font-size:16px; }
    .esd-start-section>header>button,.esd-start-section>header label,.esd-start-section>header select { min-height:40px; font-size:11px!important; }
    .esd-start-pinned-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
    .esd-start-app { min-height:126px; padding:12px 8px; }
    .esd-start-app img { width:56px; height:56px; }
    .esd-start-app strong { font-size:12px; }
    .esd-start-app small { font-size:10px; line-height:1.3; }
    .esd-start-category { min-height:150px; }
    .esd-start-category strong { font-size:12px; }
    .esd-start-category p { font-size:10px; line-height:1.4; }
    .esd-start-category-open,.esd-start-category-app-wrap>button[data-esd-open-app] { min-width:44px; min-height:44px; }
    .esd-start-pin-toggle.is-tile-control,.esd-start-pin-toggle.is-category-control { min-width:32px; min-height:32px; }
    .esd-start-user strong { font-size:12px; }
    .esd-start-user small { font-size:10px; }
    .esd-start-actions>a,.esd-start-actions>button { width:44px; height:44px; }
    .esd-start-footer { min-height:74px; }
    .esd-start-menu .esd-start-profile-menu { bottom:74px; max-height:60dvh; overflow:auto; }
    .esd-system-fullscreen-button { display:none; }
    .esd-user-menu { max-height:calc(100dvh - 90px); overflow:auto; }
    .esd-chromeless .esd-portal-shell>.esd-wrap { padding:12px; }
    .esd-chromeless .esd-suite-hero-copy h1 { font-size:24px; }
    .esd-chromeless .esd-quick-action,.esd-chromeless .esd-portal-shell :is(.button,button,select) { min-height:44px; }
    .esd-chromeless :is(.esd-docs-library-head p,.esd-sheets-library-head p,.esd-sheet-file-table td:before,.esd-portal-table td:before) { font-size:11px; }
    .esd-chromeless :is(.esd-docs-library-nav nav,.esd-sheets-library-nav nav,.esd-sheet-ribbon-tabs,.esd-sheet-toolbar) { overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; }
    .esd-chromeless .esd-sheet-tabs .esd-sheet-view-controls button { min-width:40px; min-height:40px; }
    .esd-chromeless .esd-portal-table .esd-actions a { min-height:44px; align-items:center; }
    .esd-chromeless .esd-sheet-file-table tr { grid-template-columns:1fr; }
    .esd-chromeless .esd-sheet-file-table td { grid-column:1/-1; }
    .esd-chromeless .esd-sheet-toolbar :is(button,select) { font-size:12px; }
    .esd-chromeless .esd-sheet-grid-wrap { min-height:300px; height:calc(100dvh - 288px); }
}
@media (max-width:370px) {
    .esd-start-category-grid { grid-template-columns:1fr; }
    .esd-login-intro h1 { font-size:21px; }
    .esd-login-panel { padding:22px 18px 27px; }
    .esd-chromeless .esd-docs-create { grid-template-columns:1fr; }
}

/* Mobile workspace: the dock owns its space; every app gets a real phone viewport. */
@media (max-width:760px) {
    body.esd-os-shell { overflow:hidden; }
    body.esd-os-shell .esd-portal-app { height:100dvh; overflow:hidden; }
    .esd-desktop-area:not(.esd-desktop-login) {
        inset:env(safe-area-inset-top) 0 calc(64px + env(safe-area-inset-bottom))!important;
        width:100%;
        height:auto;
    }
    .esd-portal-app.is-mobile-app-open .esd-desktop-area:not(.esd-desktop-login) { overflow:hidden!important; }
    .esd-desktop-area .esd-os-window {
        inset:0!important;
        width:100%!important;
        height:100%!important;
        min-width:0!important;
        grid-template-columns:minmax(0,1fr);
        grid-template-rows:50px minmax(0,1fr)!important;
    }
    .esd-desktop-area .esd-os-window-titlebar {
        display:grid!important;
        min-width:0;
        min-height:50px;
        grid-template-columns:minmax(0,1fr) auto auto;
        grid-row:1;
        gap:3px;
        padding:3px 7px 3px 55px;
    }
    .esd-desktop-area .esd-os-window-body {
        grid-column:1;
        grid-row:2!important;
        min-width:0;
        width:100%;
        overflow:hidden;
    }
    .esd-desktop-area .esd-os-window-body iframe {
        display:block;
        width:100%!important;
        max-width:100%;
        min-width:0!important;
        height:100%;
    }
    .esd-desktop-area .esd-os-window-title { grid-column:1; min-width:0; }
    .esd-desktop-area .esd-os-window-title strong { font-size:11px; }
    .esd-desktop-area .esd-os-window-tools { grid-column:2; gap:2px; }
    .esd-desktop-area .esd-os-window-tools button,
    .esd-desktop-area .esd-os-window-controls button { min-width:40px; min-height:40px; width:40px; height:40px; border-radius:9px!important; }
    .esd-desktop-area .esd-os-window-tools button { font-size:18px; }
    .esd-desktop-area .esd-os-window-controls { grid-column:3; }
    .esd-desktop-area .esd-os-window-controls .is-maximize { display:none; }
    .esd-desktop-area .esd-os-window-controls .is-close { background:rgba(241,85,97,.18)!important; }
    .esd-desktop-area .esd-os-window-controls .is-close:after { color:#ffb9be; font-size:24px; }
    .esd-desktop-area .esd-os-window-controls .is-minimize:after { font-size:22px; }
    .esd-mobile-home-button { top:calc(3px + env(safe-area-inset-top)); left:5px; width:44px; height:44px; border-radius:9px; }
    .esd-suite-dock {
        right:0!important;
        bottom:0!important;
        left:0!important;
        box-sizing:border-box;
        width:100vw!important;
        max-width:100vw!important;
        height:calc(64px + env(safe-area-inset-bottom));
        min-height:0;
        justify-content:flex-start!important;
        overflow-x:auto!important;
        overflow-y:hidden;
        border-radius:0!important;
        padding:7px max(10px,env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));
        transform:none!important;
        touch-action:pan-x;
        -webkit-overflow-scrolling:touch;
    }
    .esd-suite-dock>button,.esd-suite-dock .esd-dock-launcher { flex:0 0 46px!important; width:46px!important; height:46px!important; min-width:46px; }
    .esd-suite-dock .esd-dock-launcher { position:sticky; left:0; z-index:2; background:rgba(11,30,64,.96); }
    .esd-suite-dock .esd-dock-separator { display:none; }
    .esd-suite-dock>button[hidden] { display:none!important; }
    .esd-suite-dock>button:hover,.esd-suite-dock>button:focus { transform:none; }
    .esd-desktop-icons button,.esd-desktop-icons button img { -webkit-user-select:none; user-select:none; -webkit-user-drag:none; -webkit-touch-callout:none; }
    .esd-desktop-icons button { touch-action:none!important; }
    .esd-desktop-icons button.is-mobile-dragging {
        position:fixed!important;
        z-index:600!important;
        pointer-events:none;
        opacity:.92;
        background:rgba(65,111,187,.4);
        box-shadow:0 18px 45px rgba(0,0,0,.38),inset 0 0 0 1px rgba(255,255,255,.35);
        transform:scale(1.06);
    }
    .esd-mobile-icon-placeholder { display:block; min-height:94px; border:2px dashed rgba(147,199,255,.6); border-radius:14px; background:rgba(38,101,190,.16); }
    html:has(body.esd-chromeless),body.esd-chromeless { max-width:100%; min-width:0!important; overflow-x:hidden; }
    body.esd-chromeless :is(.esd-chromeless-main,.esd-portal-shell,.esd-portal-wrap,.esd-docs-library,.esd-sheets-library) { min-width:0!important; max-width:100%; width:100%; }
    /* Native scrolling belongs to each in-frame module, not to the locked desktop. */
    html:has(> body.esd-chromeless):not(.esun-modal-open):not(.esun-pipeline-modal-open),
    body.esd-chromeless:not(.esun-modal-open) {
        height:auto!important;
        min-height:100%;
        overflow-y:auto!important;
        -webkit-overflow-scrolling:touch;
    }
    body.esd-chromeless .esd-chromeless-main { min-height:100dvh; height:auto; overflow:visible; }
    body.esd-chromeless .esd-portal-shell :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { font-size:16px!important; }
    body.esd-chromeless :is(.esd-docs-library-nav nav,.esd-sheets-library-nav nav,.esd-crm-hub-sidebar nav) { -webkit-overflow-scrolling:touch; }
}
@media (max-width:390px) {
    .esd-desktop-area .esd-os-window-titlebar { padding-left:49px; }
    .esd-desktop-area .esd-os-window-tools [data-esd-window-reload] { display:none; }
    .esd-desktop-area .esd-os-window-tools button,.esd-desktop-area .esd-os-window-controls button { min-width:36px; width:36px; }
}
