/* HypeFlow mobile operation layer. Desktop remains owned by the existing theme. */
.mobile-appbar,.mobile-dock,.mobile-nav-backdrop{display:none}

@media (max-width:1023px){
  :root{--mobile-appbar-h:64px;--mobile-dock-h:72px;--mobile-safe-bottom:env(safe-area-inset-bottom,0px)}
  html{overflow-x:clip;scroll-padding-top:calc(var(--mobile-appbar-h) + 12px)}
  body.cosmic-admin{min-width:0;overflow-x:clip;padding:0!important}
  body.cosmic-admin *{min-width:0;box-sizing:border-box}
  body.cosmic-admin button,body.cosmic-admin a,body.cosmic-admin input,body.cosmic-admin select,body.cosmic-admin textarea{touch-action:manipulation}
  body.cosmic-admin input,body.cosmic-admin select,body.cosmic-admin textarea{font-size:16px!important}

  .mobile-appbar{position:fixed;z-index:8800;inset:0 0 auto;display:grid;grid-template-columns:44px auto 1fr 44px;align-items:center;gap:9px;height:var(--mobile-appbar-h);padding:8px max(12px,env(safe-area-inset-right)) 8px max(12px,env(safe-area-inset-left));border-bottom:1px solid rgba(121,226,142,.18);background:linear-gradient(110deg,rgba(9,32,16,.92),rgba(16,54,23,.9));box-shadow:0 12px 34px rgba(2,17,6,.28);backdrop-filter:blur(24px) saturate(150%);-webkit-backdrop-filter:blur(24px) saturate(150%)}
  .mobile-menu-trigger,.mobile-account-trigger{width:44px;height:44px;display:grid;place-items:center;border:1px solid rgba(143,245,163,.15);border-radius:14px;color:#E1FBE6;background:rgba(125,228,146,.06);text-decoration:none}
  .mobile-menu-trigger svg{width:21px;height:21px}.mobile-appbar-brand{display:flex;align-items:center;gap:7px;color:#fff;text-decoration:none}.mobile-appbar-brand>span{width:31px;height:31px;display:grid;place-items:center;border-radius:10px;color:#fff;font-weight:800;background:linear-gradient(145deg,#4fdf6c,#58da72 63%,#ff7c62)}.mobile-appbar-brand b{display:none;font:750 .86rem var(--font-display)}
  .mobile-appbar-route{display:grid;justify-items:start;line-height:1.08}.mobile-appbar-route small{color:#759B7C;font:600 .48rem var(--font-mono);letter-spacing:.13em}.mobile-appbar-route strong{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#F6FEF7;font:720 .9rem var(--font-display)}
  .mobile-account-avatar{width:30px;height:30px;display:grid;place-items:center;border-radius:10px;color:#fff;font-size:.72rem;font-weight:800;background:linear-gradient(145deg,#5fe379,#f05d93)}

  .mobile-nav-backdrop{position:fixed;z-index:8890;inset:0;display:block;border:0;opacity:0;visibility:hidden;pointer-events:none;background:rgba(3,14,6,.72);backdrop-filter:blur(8px);transition:.24s ease}
  body.mobile-nav-open .mobile-nav-backdrop{opacity:1;visibility:visible;pointer-events:auto}
  .admin-shell{display:block!important;min-height:100dvh!important}
  .admin-sidebar{position:fixed!important;z-index:8900!important;inset:0 auto 0 0!important;width:min(88vw,360px)!important;height:100dvh!important;padding:18px 16px calc(28px + env(safe-area-inset-bottom))!important;border:0!important;border-right:1px solid rgba(121,226,142,.17)!important;border-radius:0 24px 24px 0!important;overflow-y:auto!important;overscroll-behavior:contain;background:linear-gradient(165deg,rgba(9,33,16,.99),rgba(13,54,21,.99) 70%,rgba(12,41,20,.99))!important;box-shadow:32px 0 80px rgba(0,0,0,.48)!important;transform:translateX(-106%);transition:transform .3s cubic-bezier(.2,.8,.2,1)}
  body.mobile-nav-open{overflow:hidden}.mobile-nav-open .admin-sidebar{transform:translateX(0)}
  .admin-sidebar .brand{position:sticky;top:-18px;z-index:3;margin:-2px -2px 8px!important;padding:15px 5px 12px!important;background:linear-gradient(180deg,#092110 76%,transparent)!important}.admin-sidebar .brand strong{font-size:1rem}.admin-sidebar .brand small{font-size:.58rem}
  .admin-sidebar .admin-user{order:0!important}.admin-sidebar .sidebar-system-card{order:1!important}.admin-sidebar .admin-nav{order:2!important;overflow:visible!important;padding-bottom:24px!important}.admin-nav>a,.admin-nav-toggle{min-height:48px!important}.admin-nav-sub a{min-height:44px!important;font-size:.82rem!important}.admin-nav-section{padding-top:20px!important}

  .mobile-dock{position:fixed;z-index:8700;inset:auto 8px max(8px,var(--mobile-safe-bottom));display:grid;grid-template-columns:repeat(5,1fr);height:var(--mobile-dock-h);padding:6px;border:1px solid rgba(136,245,158,.16);border-radius:22px;background:linear-gradient(115deg,rgba(11,38,19,.94),rgba(17,63,26,.93));box-shadow:0 18px 55px rgba(0,0,0,.42);backdrop-filter:blur(22px) saturate(160%);-webkit-backdrop-filter:blur(22px) saturate(160%)}
  .mobile-dock a{position:relative;display:grid;place-items:center;align-content:center;gap:3px;min-height:55px;border-radius:16px;color:#85A98C;text-decoration:none;font-size:.57rem;font-weight:650;transition:.2s}.mobile-dock a svg{width:21px;height:21px}.mobile-dock a.active{color:#C4FACF;background:linear-gradient(145deg,rgba(88,212,113,.16),rgba(90,226,117,.17));box-shadow:inset 0 0 0 1px rgba(117,225,139,.14)}.mobile-dock a.active::before{content:'';position:absolute;top:3px;width:18px;height:2px;border-radius:2px;background:#76E18B;box-shadow:0 0 12px #76E18B}.mobile-queue-count{position:absolute;top:5px;right:15%;min-width:17px;height:17px;display:grid;place-items:center;padding:0 4px;border-radius:999px;color:#0d2c13;background:#ffd077;font-size:.52rem}
  body.mobile-dialog-open .mobile-dock{transform:translateY(130%);opacity:0;pointer-events:none}

  .admin-main{width:100%!important;max-width:100%!important;margin:0!important;padding:calc(var(--mobile-appbar-h) + 14px) 12px calc(var(--mobile-dock-h) + 30px + var(--mobile-safe-bottom))!important;overflow:visible!important}
  .admin-main>.view,.admin-main>.view.active{width:100%!important;max-width:100%!important;margin-inline:0!important}
  .global-plan-island{top:calc(var(--mobile-appbar-h) + 8px)!important;margin:0 0 12px!important;border-radius:16px!important}

  /* Readable, thumb-friendly content */
  .admin-header,.sessions-hero-v3,.groups-hero-v3,.queue-page-hero-v3,.history-hero-v3,.dashboard-command-hero{padding:20px 16px!important;border-radius:20px!important;gap:16px!important}
  .admin-header{align-items:stretch!important}.admin-header h1,.sessions-hero-v3 h1,.groups-hero-v3 h1,.queue-page-hero-v3 h1,.history-hero-v3 h1,.dashboard-command-hero h1{font-size:clamp(1.75rem,8vw,2.65rem)!important;line-height:1.02!important;overflow-wrap:anywhere}.admin-header p,.sessions-hero-v3 p,.groups-hero-v3 p,.queue-page-hero-v3 p,.history-hero-v3 p{font-size:.86rem!important;line-height:1.58!important}
  .admin-header-actions,.queue-hero-actions-v3,.sessions-hero-actions,.groups-hero-actions{width:100%!important;display:grid!important;grid-template-columns:1fr!important;gap:9px!important}.admin-header-actions>* ,.queue-hero-actions-v3>* ,.sessions-hero-actions>* ,.groups-hero-actions>*{width:100%!important;min-height:48px!important;justify-content:center!important}
  button,.btn,[role="button"]{min-height:44px}

  .grid,.grid-2,.grid-3,.grid-4,.stats-grid,.metric-grid,.metrics-grid,.dashboard-metric-grid,.dashboard-command-grid,.dashboard-control-grid,.dashboard-intelligence-grid,.dashboard-bottom-grid,.sessions-grid,.session-grid,.groups-grid,.group-grid,.platform-grid,.templates-grid,.template-grid,.settings-grid,.cards-grid,.overview-grid,.history-grid,.queue-overview-v3,.queue-workspace-grid-v3,.queue-page-hero-v3,.history-hero-v3,.groups-hero-v3,.sessions-hero-v3,.dashboard-command-hero,.dashboard-command-columns,.dashboard-command-summary,.dashboard-flow-grid,.detail-grid,.form-grid,.form-row{grid-template-columns:1fr!important}
  .dashboard-command-summary,.queue-overview-v3,.metric-grid,.stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .panel,.card,.glass-card,.stat-card,.metric-card{border-radius:17px!important}.panel-header,.panel-body{padding-inline:14px!important}.panel-header{min-height:58px!important}
  .tabs,.filter-tabs,.queue-view-tabs,.template-tabs,.group-modal-tabs{max-width:100%;overflow-x:auto!important;overflow-y:hidden;scrollbar-width:none;white-space:nowrap;overscroll-behavior-x:contain;scroll-snap-type:x proximity}.tabs::-webkit-scrollbar,.filter-tabs::-webkit-scrollbar,.queue-view-tabs::-webkit-scrollbar{display:none}.tabs>*,.filter-tabs>*,.queue-view-tabs>*{flex:0 0 auto;scroll-snap-align:start;min-height:42px}

  /* Dense operations become clear vertical workspaces */
  .queue-flow-map-v3{overflow-x:auto;padding-bottom:4px}.queue-overview-v3{gap:8px!important}.queue-overview-v3 article{padding:13px!important;min-height:104px!important}.queue-operation-bar-v3{align-items:flex-start!important;gap:12px!important;padding:14px!important}.queue-operation-bar-v3,.queue-operation-bar-v3>div:first-child{flex-direction:column!important}.queue-view-tabs{width:100%;justify-content:stretch}.queue-view-tabs button{flex:1}.queue-workspace-v3{min-height:0!important}.queue-workspace-toolbar-v3{position:sticky;top:calc(var(--mobile-appbar-h) + 8px);z-index:8;align-items:stretch!important;gap:12px!important;padding:13px!important;backdrop-filter:blur(18px)}.queue-workspace-toolbar-v3>div{width:100%!important;flex-wrap:wrap!important}.queue-filter-tools-v3{display:grid!important;grid-template-columns:1fr auto!important}.queue-search-v3{grid-column:1/-1;width:100%!important}.queue-custom-select-v3{width:100%!important}.queue-clear-toolbar-v3{width:auto!important;min-width:48px!important}.queue-clear-toolbar-v3>span{display:none!important}.queue-workspace-grid-v3{display:flex!important;flex-direction:column!important}.queue-stream-v3,.queue-preview-v3{width:100%!important;min-height:0!important}.queue-preview-v3{position:relative!important;top:auto!important;max-height:none!important;margin-top:12px}.queue-preview-v3>header{position:sticky;top:calc(var(--mobile-appbar-h) + 70px);z-index:4}.queue-preview-v3 #queue-preview{max-height:none!important;overflow:visible!important}#queue-grid.queue-grid{max-height:none!important;min-height:0!important;overflow:visible!important}
  #queue-grid .queue-card-rich{grid-template-columns:72px minmax(0,1fr) 30px!important;gap:0 10px!important;min-height:118px!important;padding:11px!important}#queue-grid .queue-card-rich .queue-card-thumb{width:72px!important;height:82px!important;min-height:82px!important}#queue-grid .queue-capture-media.compact{height:82px!important;min-height:82px!important}#queue-grid .queue-card-rich .queue-card-content{display:block!important}#queue-grid .queue-card-head{padding-right:2px}#queue-grid .queue-card-rich strong{margin:5px 0!important;font-size:.83rem!important;white-space:normal!important;display:-webkit-box!important;-webkit-line-clamp:2;-webkit-box-orient:vertical}#queue-grid .queue-source{font-size:.64rem!important}#queue-grid .queue-live-stage{justify-self:start!important;max-width:100%!important;margin-top:7px!important}#queue-grid .queue-card-meta{grid-column:1/-1!important;margin-top:7px!important}.queue-card-head .ai-badge,.queue-card-head .queue-category-badge{max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

  /* Cards and tables */
  .groups-list,.groups-card-grid,.group-cards{grid-template-columns:1fr!important}.group-card,.group-row{width:100%!important}.group-card{padding:14px!important}.group-card-stats{grid-template-columns:repeat(3,minmax(0,1fr))!important}.group-card-actions{gap:8px!important}.group-card-actions button{min-width:44px}
  .table-wrap,.data-table-wrap,.history-table-wrap,.admin-table-wrap{max-width:100%;overflow-x:auto!important;overscroll-behavior-x:contain;scrollbar-width:thin;border-radius:16px}.table-wrap table,.data-table-wrap table,.history-table-wrap table,.admin-table-wrap table{min-width:760px}.table-wrap::after,.history-table-wrap::after{content:'Arraste para ver mais →';position:sticky;left:12px;display:inline-block;margin:8px 0 4px;padding:5px 8px;border-radius:999px;color:#93C19C;background:rgba(14,42,22,.86);font-size:.58rem}

  /* Forms */
  form,.form-section,.settings-section{max-width:100%}.form-group,.field{width:100%}.form-actions,.modal-actions,.action-row{display:grid!important;grid-template-columns:1fr!important;gap:9px!important}.form-actions>*,.modal-actions>*,.action-row>*{width:100%!important;justify-content:center!important}.editor-grid,.template-editor-grid,.manual-dispatch-grid{grid-template-columns:1fr!important}.whatsapp-preview{max-width:100%!important}

  /* Modals: focused workspace instead of tiny desktop windows. */
  .modal,.modal-overlay{padding:0!important;place-items:end center!important;align-items:flex-end!important}.modal-backdrop{background:rgba(2,13,5,.82)!important;backdrop-filter:blur(10px)!important}.modal-card,.modal-overlay>.modal,.modal-overlay>[role="dialog"]{width:100%!important;max-width:none!important;margin:0!important;border-radius:24px 24px 0 0!important;border-bottom:0!important;box-shadow:0 -25px 70px rgba(0,0,0,.48)!important}
  .modal.mobile-workspace-sheet .modal-card,.mobile-workspace-sheet,.modal-overlay>.modal:not(.mobile-confirm-sheet){height:100dvh!important;max-height:100dvh!important;border-radius:0!important}.modal.mobile-confirm-sheet .modal-card,.mobile-confirm-sheet{height:auto!important;max-height:min(82dvh,680px)!important}
  .modal-card>header,.modal-overlay .modal>header,.dashboard-modal-header{position:sticky!important;top:0!important;z-index:20!important;min-height:66px!important;padding:12px 14px!important;border-bottom:1px solid rgba(125,228,146,.13)!important;background:rgba(10,36,18,.94)!important;backdrop-filter:blur(22px)!important}.modal-card>header::before,.modal-overlay .modal>header::before{content:'';position:absolute;top:7px;left:50%;width:38px;height:4px;border-radius:4px;background:rgba(176,222,185,.28);transform:translateX(-50%)}.modal-card>header h3,.dashboard-modal-header h2{max-width:calc(100% - 54px);font-size:1rem!important;line-height:1.25!important}.modal-close,[data-modal-close]{min-width:44px!important;width:44px!important;height:44px!important;border-radius:13px!important}.modal-body,.dashboard-command-body{max-height:calc(100dvh - 66px)!important;padding:15px!important;overflow-y:auto!important;overscroll-behavior:contain}.modal-foot,.modal-footer{position:sticky!important;bottom:0!important;z-index:20!important;padding:11px 14px calc(11px + env(safe-area-inset-bottom))!important;background:rgba(10,36,18,.95)!important;backdrop-filter:blur(20px)!important}.modal-foot>*,.modal-footer>*{min-height:48px!important}
  .modal.template-editor-open .modal-card{width:100%!important;max-height:100dvh!important;height:100dvh!important;border-radius:0!important}.modal.template-editor-open .template-editor-grid{grid-template-columns:1fr!important}.modal.template-editor-open #template-content{min-height:230px!important}.modal.template-editor-open .template-preview-card{min-height:320px}
  .cmd-palette{padding:0!important}.cmd-card{width:100%!important;height:100dvh!important;max-height:100dvh!important;border-radius:0!important}.cmd-input{position:sticky;top:0;padding-top:max(14px,env(safe-area-inset-top))}.integrity-gate{padding:0!important}.integrity-gate-card{width:100%!important;max-height:100dvh!important;min-height:100dvh!important;border-radius:0!important;padding:18px 14px!important;overflow-y:auto}.toast-container{left:12px!important;right:12px!important;bottom:calc(var(--mobile-dock-h) + 20px + var(--mobile-safe-bottom))!important}.toast{width:100%!important;max-width:none!important}
}

@media (max-width:520px){
  .mobile-appbar{grid-template-columns:44px 36px 1fr 44px}.mobile-appbar-brand b{display:none}.dashboard-command-summary,.queue-overview-v3,.metric-grid,.stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.group-card-stats{grid-template-columns:1fr 1fr!important}.queue-page-hero-v3 br,.groups-hero-v3 br,.history-hero-v3 br{display:none}.admin-main{padding-inline:9px!important}.panel,.queue-workspace-v3{border-radius:18px!important}.queue-overview-v3 article strong{font-size:1.55rem!important}.mobile-dock{inset-inline:6px}.mobile-dock a span{font-size:.54rem}#queue-grid .queue-card-rich{grid-template-columns:60px minmax(0,1fr) 28px!important}#queue-grid .queue-card-rich .queue-card-thumb{width:60px!important;height:72px!important;min-height:72px!important}#queue-grid .queue-capture-media.compact{height:72px!important;min-height:72px!important}}

@media (prefers-reduced-motion:reduce){.admin-sidebar,.mobile-nav-backdrop,.mobile-dock{transition:none!important}}
