/* Shared mobile shell: safe areas, on-screen keyboard and touch controls. */
:root{--app-height:100dvh;--viewport-top:0px}
.mobile-install{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--forest);font-size:12px;font-weight:600}
.mobile-install[hidden],.connection-notice[hidden]{display:none}
.connection-notice{position:relative;z-index:80;padding:10px max(16px,env(safe-area-inset-right)) 10px max(16px,env(safe-area-inset-left));background:#fff1cc;color:#493b15;text-align:center;font-size:13px}
.install-help{position:fixed;inset:0;z-index:200;display:grid;place-items:center;padding:24px;background:#102f2677}
.install-help>section{width:min(100%,420px);max-height:calc(var(--app-height) - 48px);overflow:auto;background:var(--paper);border-radius:22px;padding:26px}
.install-help p{margin:14px 0;line-height:1.7}
.app-installed .portal-hero,.app-installed .portal-benefits,.app-installed .portal #planos,.app-installed #open-auth{display:none}
.app-installed .portal-access{margin-top:24px}
@media(pointer:coarse){input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px!important}}
@media(max-width:760px){
 html{scroll-padding-bottom:110px;overscroll-behavior-y:none}
 body{padding-top:env(safe-area-inset-top);padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
 .shell{min-height:100svh;min-height:100dvh}
 .workspace{min-width:0;padding-bottom:calc(110px + env(safe-area-inset-bottom))}
 .topbar,.portal-nav{height:auto;min-height:76px;flex-wrap:wrap;padding-block:12px;gap:12px}
 .top-actions{flex-wrap:wrap;gap:8px;max-width:100%}
 .mobile-install{font-size:11px}
 .mobile-nav{padding-left:max(9px,env(safe-area-inset-left));padding-right:max(9px,env(safe-area-inset-right))}
 .mobile-nav a{min-height:48px;min-width:0}
 .modal-backdrop{top:var(--viewport-top);bottom:auto;height:var(--app-height);padding:12px max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));overscroll-behavior:contain}
 #modal-root .modal{max-height:100%;overflow:auto;overscroll-behavior:contain;min-width:0}
 input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px!important;max-width:100%;scroll-margin-block:80px}
 button,.icon-button,summary{min-height:44px;touch-action:manipulation}
 .icon-button{min-width:44px}
 .card,.page-heading>div,main,.portal-access>*,.form-grid>*{min-width:0}
 .page-heading,.section-head,.button-row,.modal-actions{flex-wrap:wrap}
 .tabs{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
 .tabs .tab{flex-shrink:0}
 .keyboard-open .mobile-nav{visibility:hidden;pointer-events:none}
 #toast{max-width:calc(100vw - 32px);bottom:calc(100px + env(safe-area-inset-bottom));overflow-wrap:anywhere}
 .install-help{top:var(--viewport-top);bottom:auto;height:var(--app-height)}
}
