/* Shared phone/tablet adaptations; keep desktop and print layouts intact. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-top:90px}
body{min-width:0}
button,input,select,textarea,a,summary{-webkit-tap-highlight-color:rgba(139,92,246,.16)}
button,a,summary{touch-action:manipulation}
img,svg,iframe{max-width:100%}
input,select,textarea{scroll-margin-top:120px;scroll-margin-bottom:120px}
@media screen and (max-width:1024px){
 .page-dashboard .main,.page-dashboard .panel,.page-dashboard .product-panel,.page-dashboard .dash-panel,.page-dashboard .grid-2,.page-dashboard .grid-3,.page-dashboard .ctwa-layout,.page-dashboard .dash-grid,.page-dashboard .dash-grid-main{min-width:0;max-width:100%}
 .page-dashboard .table-container,.page-dashboard .product-table-wrap,.page-dashboard .table-wrap,.page-embedded .table-wrap{min-width:0;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;scrollbar-width:thin}
 .mobile-table-hint{font:12px/1.5 system-ui;color:#75708e;margin:8px 0}
 .page-dashboard .backdrop{padding-top:env(safe-area-inset-top,0px)}
 .page-dashboard .drawer{height:100%;max-height:100dvh;overscroll-behavior-y:contain;padding-bottom:calc(24px + env(safe-area-inset-bottom,0px))}
 .page-dashboard .drawer-content{overflow-wrap:anywhere}
 .page-dashboard .tactive-account-bar{padding-bottom:calc(8px + env(safe-area-inset-bottom,0px));padding-left:max(12px,env(safe-area-inset-left,0px));padding-right:max(12px,env(safe-area-inset-right,0px));gap:8px}
 .page-dashboard .tactive-account-bar span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .page-dashboard .tactive-account-bar button{min-height:44px;min-width:70px;flex-shrink:0;font-size:14px}
 .page-dashboard{padding-bottom:var(--account-bar-height,80px)}
}
@media screen and (max-width:900px){
 .page-dashboard .sidebar{padding-top:calc(10px + env(safe-area-inset-top,0px));padding-left:max(14px,env(safe-area-inset-left,0px));padding-right:max(14px,env(safe-area-inset-right,0px))}
 .page-dashboard .ux-sidebar-head{min-height:46px;gap:16px}
 .page-dashboard .sidebar .brand{min-width:0;flex:1}
 .page-dashboard .ux-menu-toggle{min-height:44px;flex-shrink:0}
 .page-dashboard .ux-nav-region{max-height:calc(100vh - var(--mobile-header-height,76px) - var(--account-bar-height,80px));max-height:calc(100dvh - var(--mobile-header-height,76px) - var(--account-bar-height,80px));overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch}
 .page-dashboard .sidebar .nav{width:100%;overflow:visible;justify-content:stretch}
 .page-dashboard .sidebar .nav-btn{justify-content:flex-start;min-height:48px;text-align:left}
 .page-dashboard .main{width:100%;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
 .page-dashboard .grid-2,.page-dashboard .grid-3{grid-template-columns:minmax(0,1fr)}
 .page-dashboard .status-layout,.page-dashboard .dash-status-layout{flex-wrap:wrap}
}
@media screen and (max-width:768px){
 input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea{font-size:16px!important;min-height:46px}
 input[type=checkbox],input[type=radio]{min-width:20px;min-height:20px}
 .page-dashboard .btn,.page-dashboard .table-btn,.page-dashboard summary,.page-dashboard .ux-remove-item,.page-embedded .btn{min-height:44px;height:auto;white-space:normal;line-height:1.4;padding-top:10px;padding-bottom:10px}
 .page-dashboard .product-actions,.page-dashboard .top-actions,.page-dashboard .ux-page-actions{gap:10px}
 .page-dashboard .product-actions .btn{flex:1 1 auto;justify-content:center}
 .page-dashboard .control{min-width:0;max-width:100%}
 .page-dashboard .filter-card{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 .page-dashboard .control.search{grid-column:1/-1}
 .page-dashboard .control.slim{max-width:none}
 .page-dashboard .product-fields,.page-dashboard .ctwa-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
 .page-dashboard .ops-item-row{grid-template-columns:repeat(2,minmax(0,1fr))}
 .page-dashboard .ops-item-row>*{min-width:0}
 .page-dashboard .ops-item-row>:first-child{grid-column:1/-1}
 .page-dashboard .ux-work-tabs{max-width:100%;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
 .page-dashboard .ux-work-tabs .btn{flex:0 0 auto}
 .page-dashboard .ux-data-popover{width:min(280px,calc(100vw - 32px));min-width:0;max-height:65dvh;overflow:auto;z-index:50}
 .page-dashboard .tactive-account-bar span:nth-child(2){display:none}
 .page-dashboard .tactive-account-bar span:first-child{flex:1}
 .page-dashboard .dash-trend{overflow:hidden}
 .page-login{min-height:100vh;min-height:100svh;align-items:start;padding:calc(24px + env(safe-area-inset-top,0px)) max(16px,env(safe-area-inset-right,0px)) calc(24px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px))}
 .page-login .box{padding:28px 24px;margin-block:auto;min-width:0}
 .page-login .switch,.page-login .back{min-height:44px;display:inline-flex;align-items:center;justify-content:center}
 .page-login .back{display:flex}
 .page-login .submit{min-height:48px}
 .page-login h1{font-size:26px}
 .page-login .bottom{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:0 6px}
 .page-home .wrap{padding-left:max(18px,env(safe-area-inset-left,0px));padding-right:max(18px,env(safe-area-inset-right,0px))}
 .page-home nav{padding-top:env(safe-area-inset-top,0px)}
 .page-home nav .wrap{height:auto;min-height:72px;gap:12px;flex-wrap:wrap;padding-block:10px}
 .page-home nav .logo{min-width:0;flex:1 1 130px}
 .page-home nav .brand-logo{width:170px;max-width:100%}
 .page-home nav .nav-right{flex-shrink:0;gap:8px}
 .page-home .btn{min-height:46px;justify-content:center}
 .page-home nav .btn{min-height:44px;padding:10px 12px}
 .page-home .hero{padding:45px 0 34px}
 .page-home .hero-grid{gap:25px}
 .page-home h1{font-size:clamp(32px,8vw,44px);line-height:1.15;overflow-wrap:break-word}
 .page-home h1 br{display:none}
 .page-home .lead{font-size:16px}
 .page-home .hero-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .page-home .hero-foot{align-items:flex-start;font-size:13px}
 .page-home .avatars{flex-shrink:0}
 .page-home .hero-visual{height:310px;max-width:420px;width:100%;margin:auto}
 .page-home .hero-core{width:195px;height:195px}
 .page-home .panel{padding:13px 14px}
 .page-home .panel b{font-size:22px}
 .page-home .p1{left:0;width:150px;top:10px;z-index:1}
 .page-home .p2{right:0;width:140px;top:100px;z-index:1}
 .page-home .p3{left:8px;bottom:0;width:155px;z-index:1}
 .page-home section{padding:48px 0}
 .page-home .sec-head{margin-bottom:28px}
 .page-home .grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
 .page-home .card{padding:20px;min-width:0}
 .page-home .split{gap:28px}
 .page-home .mock{padding:16px;min-width:0}
 .page-home .mock-item{gap:14px;flex-wrap:wrap}
 .page-home .cta{padding:30px 20px}
 .page-home .cta h2{font-size:27px}
 .page-home .rules{grid-template-columns:repeat(2,minmax(0,1fr))}
 .page-home footer{padding-bottom:calc(30px + env(safe-area-inset-bottom,0px))}
 .page-embedded main{min-width:0;max-width:100%;width:calc(100% - 24px)}
 .page-embedded .dashboard,.page-embedded .two{grid-template-columns:minmax(0,1fr)}
}
@media screen and (max-width:540px){
 .page-dashboard .product-fields,.page-dashboard .ctwa-fields,.page-dashboard .ctwa-results,.page-dashboard .ux-item-row{grid-template-columns:minmax(0,1fr)}
 .page-dashboard .ux-item-row .ux-remove-item{grid-column:auto;justify-self:stretch}
 .page-dashboard .ux-item-row .ux-remove-item{min-height:44px}
 .page-dashboard .ops-detail-grid{grid-template-columns:minmax(0,1fr)}
 .page-dashboard .keyval{grid-template-columns:minmax(0,1fr);gap:5px}
 .page-dashboard .drawer{width:100%}
 .page-dashboard .kpi-value,.page-dashboard .fin-value{overflow-wrap:anywhere}
 .page-dashboard .top-actions>.btn{flex:1 1 130px;justify-content:center}
 .page-dashboard .top-actions .ux-data-menu{margin-left:0}
 .page-dashboard .dash-extra-fields>.product-field{min-width:0;flex-basis:100%}
 .page-dashboard .dash-filters>.product-field,.page-dashboard .dash-more-filters{min-width:0;flex-basis:100%}
 .page-dashboard .dash-filter-actions{flex-wrap:wrap}
 .page-dashboard .dash-stock-list>div{flex-wrap:wrap}
 .page-dashboard .sidebar .nav{grid-template-columns:minmax(0,1fr)}
 .page-dashboard .ux-csv-links{grid-template-columns:minmax(0,1fr)}
 .page-home .grid,.page-home .rules{grid-template-columns:minmax(0,1fr)}
 .page-home .steps{padding:14px}
 .page-home .sec-head h2,.page-home .split h2{font-size:28px}
 .page-home .card h3{font-size:18px}
 .page-home .card p{font-size:15px}
 .page-home .hero-foot{flex-wrap:wrap}
}
@media screen and (max-width:359px){
 .page-dashboard .kpi-grid,.page-dashboard .dash-kpis,.page-dashboard .fin-grid,.page-dashboard .filter-card{grid-template-columns:minmax(0,1fr)}
 .page-home nav .brand-logo{width:138px}
 .page-home nav .btn{padding:10px;font-size:12px}
 .page-home .hero-actions{grid-template-columns:minmax(0,1fr)}
 .page-login .box{padding:24px 18px}
}
@media print{.mobile-table-hint,.tactive-account-bar{display:none!important}}
