/* MEXSEG — mobile v2 | mantém a experiência desktop */
@media (max-width:900px){
 html{overflow-x:clip} body{min-width:0!important;overflow-x:clip;padding-bottom:calc(76px + env(safe-area-inset-bottom,0px))}
 .sistema{display:block!important;min-width:0!important;width:100%!important}
 .sistema>.main,.main,main.main,.content-wrapper,.main-content{margin-left:0!important;width:100%!important;max-width:100%!important;min-width:0!important;flex:1 1 100%!important}
 .topbar,.top-bar,.header-top{position:relative!important;display:flex!important;align-items:center!important;flex-wrap:nowrap!important;min-height:54px!important;height:auto!important;padding:9px 12px 9px 62px!important;gap:8px!important}
 .topbar h2,.topbar h1{font-size:0!important;line-height:1.2!important;min-width:0!important}
 .topbar h2::after,.topbar h1::after{content:'MEXSEG';font-size:16px;font-weight:700;color:#202020}
 .topbar .usuario{margin-left:auto!important;gap:9px!important;flex-shrink:0}
 .topbar .usuario span{display:none!important}
 .topbar .sair{font-size:12px!important}
 /* O botão original passa a fazer parte do cabeçalho quando ele existe. */
 .topbar>.mexseg-mobile-menu-button,.topbar>.mex-mobile-toggle{position:absolute!important;top:50%!important;left:11px!important;transform:translateY(-50%)!important;z-index:5!important;width:40px!important;height:40px!important;box-shadow:none!important}
 body.mex-menu-open .topbar>.mexseg-mobile-menu-button{left:11px!important}
 .mexseg-mobile-menu-button,.mex-mobile-toggle{width:42px;height:42px;touch-action:manipulation}
 .conteudo,.content,.page-content,.container-fluid{min-width:0!important;max-width:100%!important;padding:12px!important}
 .boas-vindas{margin-bottom:12px!important}.boas-vindas h1{font-size:21px!important;margin-bottom:3px!important}.boas-vindas p{font-size:12px!important}
 .cards{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important;margin-bottom:13px!important}
 .cards>.card{min-width:0!important;min-height:95px!important;padding:12px!important;border-radius:10px!important;overflow-wrap:anywhere}
 .cards>.card h3{font-size:10px!important;line-height:1.25!important;margin-bottom:6px!important}
 .cards>.card .numero{font-size:22px!important;line-height:1.15!important}
 .cards>.card .detalhe{font-size:10px!important;line-height:1.3!important;margin-top:5px!important}
 .grid{grid-template-columns:minmax(0,1fr)!important;gap:12px!important}
 .painel{min-width:0!important;padding:15px!important;border-radius:11px!important}.painel h2{font-size:16px!important;margin-bottom:12px!important}
 /* Atalhos em duas colunas, sem os estilos inline-flex antigos. */
 .sistema>.main .painel-atalhos{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important;align-content:start!important}
 .sistema>.main .painel-atalhos>h2{grid-column:1/-1!important;margin-bottom:2px!important}
 .sistema>.main .painel-atalhos>a.atalho{display:flex!important;flex-direction:column!important;justify-content:center!important;width:100%!important;min-width:0!important;min-height:78px!important;margin:0!important;padding:11px!important;overflow-wrap:anywhere}
 .sistema>.main .painel-atalhos>a.atalho strong{font-size:12px!important;line-height:1.3!important}
 .sistema>.main .painel-atalhos>a.atalho span{font-size:10px!important;line-height:1.3!important}
 /* Resumo meteorológico: duas métricas por linha em telas pequenas. */
 .clima-painel.clima-compacto{padding:14px!important;margin-bottom:13px!important;border-radius:11px!important}
 .clima-compacto .clima-topo{display:flex!important;align-items:center!important;gap:8px!important;margin-bottom:10px!important}
 .clima-compacto .clima-topo h2{font-size:14px!important;line-height:1.3!important}
 .clima-compacto .clima-topo p{font-size:11px!important;line-height:1.4!important}
 .clima-compacto .clima-abrir{width:auto!important;min-height:38px!important;padding:8px 11px!important;font-size:12px!important}
 .clima-compacto .clima-dados{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
 .clima-compacto .clima-metrica{padding:9px 10px!important;min-width:0!important}
 .clima-compacto .clima-metrica small{font-size:10px!important;margin-bottom:3px!important}
 .clima-compacto .clima-metrica strong{font-size:16px!important;overflow-wrap:anywhere}
 .clima-compacto .clima-aviso{font-size:10px!important;line-height:1.4!important}
 .clima-modal{padding:7px!important}.clima-modal-caixa{max-height:94dvh!important;padding:12px!important;overflow:auto!important}
 .clima-form label{min-width:0!important;flex:1 1 100%!important}
 .clima-tabela-scroll{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
 .mexseg-mobile-bottom{min-height:60px!important;padding-bottom:max(7px,env(safe-area-inset-bottom,0px))!important}
 .mexseg-mobile-bottom a,.mexseg-mobile-bottom button{min-width:0!important;min-height:46px!important;font-size:19px!important;gap:4px!important}
 .mexseg-mobile-bottom small{font-size:10px!important}
 img,video,canvas,svg{max-width:100%}
 input:not([type=checkbox]):not([type=radio]),select,textarea{max-width:100%;min-width:0;font-size:16px!important}
 .mex-mobile-table-scroll{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;border-radius:8px}
 .mex-mobile-table-scroll>table{width:max-content;min-width:100%}
}
@media(max-width:370px){.sistema>.main .painel-atalhos>a.atalho{padding:9px!important}.clima-compacto .clima-metrica strong{font-size:14px!important}}
@media(min-width:901px){.mex-mobile-toggle,.mex-mobile-shade{display:none!important}}

/* MEXSEG v3 — cabeçalho sem duplicação e indicadores compactos */
.mexseg-title-mobile{display:none}
@media(max-width:900px){
 .topbar .mexseg-topbar-title{font-size:16px!important;line-height:1.2!important;max-width:none!important;white-space:nowrap!important}
 .topbar .mexseg-topbar-title::after{content:none!important;display:none!important}
 .mexseg-title-desktop{display:none!important}
 .mexseg-title-mobile{display:inline!important;font-size:16px!important;font-weight:700!important}
 .clima-compacto .clima-topo{margin-bottom:8px!important}
 .clima-compacto .clima-abrir{min-height:34px!important;padding:7px 10px!important}
 .clima-compacto .clima-metrica{padding:8px 9px!important}
 .clima-compacto .clima-metrica small{margin-bottom:2px!important}
 .clima-compacto .clima-aviso{margin-top:7px!important}
 .mexseg-mobile-bottom a,.mexseg-mobile-bottom button{font-family:Arial,sans-serif!important;font-size:14px!important;line-height:1!important}
 .mexseg-mobile-bottom .mex-nav-icon{width:21px;height:21px;display:block;flex-shrink:0;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
 .mexseg-mobile-bottom small{font-size:10px!important;font-weight:500}
}

/* Correção global de navegação: nunca ocupar altura da página no mobile. */
@media(max-width:900px){
 body #mexseg-navigation.mexseg-menu-lateral{position:fixed!important;display:block!important;top:0!important;left:0!important;bottom:0!important;right:auto!important;width:min(310px,86vw)!important;height:100dvh!important;max-height:none!important;min-height:0!important;transform:translate3d(-110%,0,0)!important;visibility:hidden!important;pointer-events:none!important;z-index:10002!important;margin:0!important}
 body.mex-menu-open #mexseg-navigation.mexseg-menu-lateral{transform:translate3d(0,0,0)!important;visibility:visible!important;pointer-events:auto!important}
}

/* MEXSEG v4: barra inferior global com 3 ações */
@media(max-width:900px){
 body{padding-bottom:calc(86px + env(safe-area-inset-bottom,0px))!important}
 #mexseg-bottom-v4{position:fixed!important;left:0;right:0;bottom:0;z-index:10001;display:grid!important;grid-template-columns:1fr 1fr 1fr;align-items:center;background:#fff;border-top:1px solid #e6e6e6;box-shadow:0 -2px 10px #0000000a;padding:5px 10px max(8px,env(safe-area-inset-bottom,0px))!important}
 #mexseg-bottom-v4 a,#mexseg-bottom-v4 button{border:0;background:transparent;text-decoration:none;color:#444;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:53px;padding:2px;cursor:pointer}
 #mexseg-bottom-v4 .mexseg-nav-emoji{font-size:25px;line-height:1}
 #mexseg-bottom-v4 .mexseg-mic-circle{background:#79243e;color:#fff;border-radius:50%;width:43px;height:43px;display:grid;place-items:center;font-size:23px;box-shadow:0 3px 10px #79243e33}
 #mexseg-bottom-v4 small{font-size:11px!important;font-weight:600}
 .mexseg-assistente-overlay:not([hidden]){display:flex!important;position:fixed;inset:0;z-index:11000;background:#0007;align-items:flex-end;justify-content:center}
 .mexseg-assistente-sheet{background:#fff;color:#242424;border-radius:18px 18px 0 0;padding:18px 16px calc(22px + env(safe-area-inset-bottom,0px));width:100%;max-height:85dvh;overflow:auto;box-shadow:0 -5px 30px #0002}
 .mexseg-assistente-head{display:flex;align-items:center;justify-content:space-between;font-size:18px}
 #mexseg-assistente-fechar{border:0;background:#f1f1f1;border-radius:50%;font-size:26px;width:36px;height:36px}
 .mexseg-assistente-sheet p{font-size:13px;line-height:1.45;color:#666;margin:12px 0}
 .mexseg-assistente-form{display:flex;gap:8px;align-items:stretch}
 #mexseg-assistente-pergunta{flex:1;min-width:0;border:1px solid #ccc;border-radius:10px;padding:11px;font-size:16px}
 #mexseg-assistente-voz{border:1px solid #ddd;border-radius:10px;background:#f7f7f7;width:50px;font-size:22px}
 #mexseg-assistente-enviar{margin-top:12px;background:#79243e;color:#fff;border:0;border-radius:10px;padding:12px 18px;font-weight:700;width:100%}
 #mexseg-assistente-resposta{font-size:13px;margin-top:12px;line-height:1.5}
}
@media(min-width:901px){#mexseg-bottom-v4,.mexseg-assistente-overlay{display:none!important}}
