/* Mobile overrides only; desktop geometry stays in its existing stylesheets. */
.mobile-menu-toggle,.mobile-menu-close,.mobile-nav-backdrop{display:none}
@media(max-width:720px){
 html{scroll-padding-top:12px}body{min-width:0}input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px!important;max-width:100%;min-width:0}button,.btn{touch-action:manipulation}.btn{min-height:44px}a,button{ -webkit-tap-highlight-color:transparent }
 html.embedded .app-main,.app-main{padding:16px 12px 28px;min-width:0}.app-main h1{font-size:24px;overflow-wrap:anywhere}.panel{max-width:100%;overflow-x:auto}.app-topbar{flex-wrap:wrap;gap:10px}.app-topbar .brand{min-width:0}.app-topbar .app-user{flex-wrap:wrap}
 body:has(.layout){padding:0;height:100dvh;min-height:0;overflow:hidden}.layout{display:flex;height:100vh;height:100dvh;border:0;border-radius:0}.layout>.content-area{height:100%;min-height:0;flex:1}.layout .workspace-stage{flex:1;min-height:0;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch}.layout .content-frame{height:100%;min-height:0}.layout .main-content{padding:18px 12px 32px;min-width:0}
 .layout>.sidebar{position:fixed;inset:0 auto 0 0;width:min(320px,88vw);height:100vh;height:100dvh;max-height:none;padding:16px;display:flex;z-index:302;transform:translateX(-105%);visibility:hidden;transition:transform .2s,visibility .2s;background:#edf4fa;border-right:1px solid #b7cddd;box-shadow:10px 0 35px #18315333;overscroll-behavior:contain}.mobile-nav-open .layout>.sidebar{transform:none;visibility:visible}.layout .sidebar nav{display:flex;flex-direction:column;gap:4px}.layout .sidebar nav a{min-height:44px;font-size:16px;padding:10px}.layout .sidebar nav .nav-child{min-height:42px;font-size:15px}.layout .sidebar .nav-label{font-size:12px}.layout .sidebar-footer{display:block;padding-bottom:env(safe-area-inset-bottom)}.layout .sidebar-footer a{padding:8px 0;min-height:40px}.layout .sidebar-brand{padding-right:36px}
 .mobile-menu-toggle,.mobile-menu-close{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;border:1px solid #c7d9e8;border-radius:11px;background:#f4f9fd;color:#24587d;font:inherit;cursor:pointer;flex-shrink:0}.mobile-menu-close{position:absolute;right:14px;top:14px;z-index:3;font-size:24px}.mobile-nav-backdrop:not([hidden]){display:block;position:fixed;inset:0;border:0;background:#142d4966;backdrop-filter:blur(2px);z-index:301;width:100%;height:100%}
 .layout .global-topbar{padding:8px 12px;gap:8px;min-height:0;height:auto;display:flex;flex-wrap:wrap}.layout .topbar-actions{margin-left:auto;gap:6px;min-width:0}.layout .period-pill{min-height:40px;font-size:12px;padding:4px 7px}.layout .user-pill{padding:4px;border:0;background:transparent}.layout .user-pill>span:not(.top-avatar){display:none}.layout .user-pill .top-avatar{display:grid;flex-shrink:0}.layout .global-search{order:3;flex:1 1 100%;max-width:none;margin:0}.layout .global-search input{height:42px}.layout .global-search-results{max-height:55dvh}.layout .section-head,.layout .dashboard-head{flex-direction:column;align-items:stretch;gap:10px}.layout .dashboard-head>div{min-width:0}.layout .department-grid,.layout .snapshot-grid,.layout .budget-summary-grid,.layout .budget-department-grid{grid-template-columns:minmax(0,1fr)}.layout .overview-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.layout .overview-card{padding:14px 12px}.layout .overview-number{font-size:27px}.layout .overview-label{font-size:14px}.layout .budget-department-totals{gap:8px;grid-template-columns:1fr}.layout .budget-department-total{display:flex;justify-content:space-between;gap:10px}.layout .budget-department-total strong{white-space:normal;overflow-wrap:anywhere;font-size:16px}.layout .project-budget-row{grid-template-columns:1fr}.layout .project-budget-values{text-align:left;white-space:normal}.layout .project-budget-sub{white-space:normal}.layout .quick-actions .btn{flex:1 1 140px}.layout .snapshot-card{padding:16px}.layout .alert-item{flex-wrap:wrap}.layout .updated-at{text-align:left}
 .allocation-chart{padding:16px 12px;min-width:0}.allocation-chart h3{font-size:19px;line-height:1.5}.ac-layout{flex-direction:column;gap:16px}.ac-pie{width:min(190px,75vw)}.ac-table{width:100%;max-height:360px;overflow-y:auto}.ac-table table,.ac-table tbody{display:block}.ac-table thead{display:none}.ac-table tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;padding:12px 2px;border-bottom:1px solid #e0eaf2}.ac-table td{padding:0;border:0;min-width:0!important;white-space:normal!important}.ac-table td:first-child{grid-column:1/-1}.ac-table td:nth-child(2){text-align:left;font-size:15px}.ac-table td:nth-child(2)::before{content:'งบที่ได้รับ ';color:#657c90;font-size:13px}.ac-table td:nth-child(3){text-align:right;font-size:15px}.ac-table td:nth-child(3)::before{content:'สัดส่วน ';color:#657c90;font-size:13px}.ac-caption{line-height:1.65}
 .wf-projects>.wf-project{grid-template-columns:minmax(0,1fr);padding:16px 12px;gap:12px}.wf-project h3{overflow-wrap:anywhere}.wf-project-summary .wf-balances{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.wf-project-summary .wf-balances div{padding:11px 9px}.wf-project-summary .wf-balances strong{font-size:19px;overflow-wrap:anywhere}.wf-project-controls{display:block}.wf-project-controls .wf-actions{margin-top:12px;justify-content:flex-start}.wf-actions .btn{flex:1 1 130px;min-height:44px}.wf-grid{grid-template-columns:minmax(0,1fr)}.wf-wide{grid-column:auto}.wf-item-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.wf-item-grid label:first-child{grid-column:1/-1}.wf-tools input{max-width:none;width:100%}.wf-notice--alert{flex-direction:column;align-items:flex-start}.wf-notice--alert .btn{margin-left:0}.wf-project-controls .wf-allocation{margin-top:12px;flex-wrap:wrap}.wf-allocation label{flex-basis:100%}.wf-allocation .btn{width:100%}.wf-line-items{max-width:100%;overflow-x:auto}.wf-detail-table{min-width:480px}.wf-owner-choices{grid-template-columns:1fr}.wf-funding{grid-template-columns:minmax(0,1fr)}.wf-funding-row{font-size:16px;flex-wrap:wrap}
 .wf-modal,.pb-dialog,.ak-dialog{max-height:90vh;max-height:90dvh;width:calc(100% - 20px);padding:16px 12px}.wf-modal .wf-actions,.pb-actions,.ak-footer{gap:8px}.wf-modal .wf-actions .btn,.pb-actions .btn{flex:1 1 130px;white-space:normal}.ak-toolbar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch}.ak-toolbar label{grid-column:1/-1;min-width:0}.ak-toolbar button{justify-content:center;min-height:44px}.ak-row{flex-wrap:wrap}.ak-row b{margin-left:30px}.ak-impact{grid-template-columns:1fr}.ak-footer button{min-height:44px}.ak-footer>span{flex-basis:100%}.ak-title h2{font-size:22px}.ak-title .ak-skull{font-size:36px}.ak-dialog .ak-selection-summary{font-size:13px}
 .page .hero,.page .head{align-items:stretch;flex-direction:column}.page .hero .actions{width:100%}.page .hero .actions>*{flex:1;min-width:0}.page .toolbar{flex-direction:column}.page .toolbar input,.page .toolbar select{width:100%;min-width:0}.page .grid,.page .roles{grid-template-columns:minmax(0,1fr)}.page .summary{grid-template-columns:repeat(2,minmax(0,1fr))}.page .view{padding:14px 10px}.page .metric{padding:12px}.page .metric strong{overflow-wrap:anywhere;font-size:19px}.page .modal{padding:18px 12px;max-height:90dvh}.page .audit{grid-template-columns:1fr}.page .modal-actions{flex-wrap:wrap}.page .modal-actions .btn{flex:1 1 120px}.page .projects{grid-template-columns:minmax(0,1fr)}
 .expense-form-grid{grid-template-columns:1fr}.expense-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.expense-summary-card strong{white-space:normal;overflow-wrap:anywhere}.project-actions{flex-wrap:wrap}.project-actions .btn{flex:1 1 120px}.expense-modal-head{flex-wrap:wrap}.expense-modal-body{max-height:75dvh}.project-card{min-width:0}.project-name{overflow-wrap:anywhere}
}
@media(max-width:650px){.ak-hero-panel{padding:165px 18px 22px;background-size:100% 190px,auto 190px;background-image:linear-gradient(180deg,transparent 55px,#071b17 180px),url('/images/avada-duel-hero.webp')}.ak-hero-content{gap:12px}.ak-hero-panel .ak-image-button{width:min(100%,360px)}.ak-hero-panel .ak-admin-hint{font-size:15px}.sn-panel{top:116px;max-height:calc(100dvh - 130px)}.sn-list{max-height:calc(100dvh - 215px)}}
@media(prefers-reduced-motion:reduce){.mobile-nav-open .layout>.sidebar{transition:none}}
