/* SMART Plus+ V25 — responsive layout for iPhone/Android, tablets and desktop. */
html{scroll-padding-top:86px;-webkit-text-size-adjust:100%}
body{min-width:0;overflow-x:hidden}
button,a,summary{-webkit-tap-highlight-color:transparent;touch-action:manipulation}
button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #22aa79;outline-offset:3px}
.content,.content>*,.main,.panel,.hero,.grid>*,.stats>*{min-width:0}
.content .table-wrap{max-width:100%;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
.content table{max-width:none}
.content img,.content svg{max-width:100%}
.content [style*="width: 700px"]{max-width:100%}
.sidebar-close,.sidebar-backdrop,.mobile-bottom-nav{display:none}
.mobile-bottom-nav svg,.menu-btn svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.mobile-tab{font-family:'IBM Plex Sans Thai',system-ui,sans-serif}
/* Better touch areas for every screen size */
.content button,.topbar button{min-height:42px}
.content input:not([type=checkbox]),.content select,.content textarea{min-height:44px}
.leaflet-container img,.leaflet-container svg{max-width:none}
@media (max-width:900px){
 .app-shell{display:block;min-height:100svh}
 .main{min-width:0;width:100%}
 .sidebar{position:fixed!important;top:0;bottom:0;left:0!important;right:auto;z-index:81;
   width:min(340px,88vw)!important;min-height:0;max-height:100dvh;overflow-y:auto;
   overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;
   padding-top:24px;padding-bottom:calc(22px + env(safe-area-inset-bottom,0px));
   transform:translateX(-105%);visibility:hidden;transition:transform .24s ease,visibility .24s;
   box-shadow:14px 0 60px #04251e55}
 .sidebar.open{transform:translateX(0);visibility:visible}
 .sidebar .brand{padding-right:50px}
 .sidebar-close{display:grid;place-items:center;position:absolute;right:12px;top:17px;z-index:2;
   width:42px;height:42px;border-radius:13px;color:#e6fff3;border:1px solid #ffffff43;
   background:#ffffff19;font-size:19px;cursor:pointer}
 .sidebar-backdrop:not([hidden]){display:block;position:fixed;inset:0;z-index:79;width:100%;height:100dvh;
   background:#031e1bc0;border:0;margin:0;padding:0;backdrop-filter:blur(3px)}
 body.mobile-menu-open{overflow:hidden;touch-action:none}
 body.mobile-menu-open .sidebar{touch-action:pan-y}
 .menu-btn{display:grid!important;place-items:center;flex:none;width:44px;height:44px;padding:8px;
   background:#eff8f2;color:#075d44;border:1px solid #d3eade;border-radius:13px;cursor:pointer}
 .topbar{height:auto;min-height:74px;position:sticky;top:0;z-index:60;align-items:center;
   padding:10px max(12px,env(safe-area-inset-left,0px)) 10px max(12px,env(safe-area-inset-right,0px));
   gap:10px;box-shadow:0 3px 18px #0f473310}
 .topbar-title{min-width:0;flex:1}
 .topbar h1{font-size:clamp(16px,3.5vw,21px);line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .topbar .eyebrow{font-size:9px;letter-spacing:.65px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .top-actions{flex:none;gap:6px;margin-left:0}
 .user-pill{font-size:12px;min-height:43px;max-width:135px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
   border-radius:12px;padding:9px 10px}
 .clock{display:none}
 .live-pill{font-size:0!important;padding:9px!important;min-width:33px;min-height:33px;display:grid;place-items:center}
 .live-pill i{width:9px;height:9px;margin:0}
 .content{padding:18px 14px calc(100px + env(safe-area-inset-bottom,0px));max-width:100%}
 .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
 .stat{min-height:118px;padding:15px;border-radius:16px}
 .stat .value{font-size:30px}
 .stat .label{font-size:11px}
 .hero{padding:20px;border-radius:19px}
 .hero-row{gap:10px}
 .hero h2{font-size:clamp(20px,4.3vw,26px);line-height:1.35}
 .hero p{font-size:12px;line-height:1.8;overflow-wrap:anywhere}
 .hero .actions{margin-top:15px}
 .two-col,.three-col{grid-template-columns:minmax(0,1fr)}
 .panel{padding:16px;overflow-wrap:anywhere}
 .panel-head{flex-wrap:wrap;gap:10px}
 .panel-head h3{font-size:17px}
 .actions{flex-wrap:wrap;gap:9px}
 .actions button,.actions a{min-height:44px;flex:1 1 142px}
 .field-row{grid-template-columns:repeat(2,minmax(0,1fr))}
 .map{height:clamp(280px,44svh,430px)}
 .overview-map-feature-body{grid-template-columns:minmax(0,1fr)}
 .overview-map-feature .map{height:clamp(285px,45svh,430px)}
 .route-layout{grid-template-columns:minmax(0,1fr)}
 .route-layout .map-expanded{height:53svh;min-height:340px}
 .cmd-main-grid{grid-template-columns:minmax(0,1fr)!important}
 .cmd-main-grid>.cmd-map-stage{grid-column:1!important;grid-row:1!important;position:relative!important;top:auto!important}
 .cmd-main-grid>.cmd-intel-rail{grid-column:1!important;grid-row:2!important;max-height:none!important;overflow:visible!important;padding:0!important}
 .cmd-map-frame{height:clamp(350px,58svh,660px)!important;min-height:350px!important}
 .cmd-workspace{min-width:0}
 .cmd-map-header{gap:7px}
 .cmd-map-footer{flex-wrap:wrap;gap:11px}
 .cmd-titlebar{flex-wrap:wrap}
 .cmd-map-maximized{inset:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)!important;border-radius:0!important}
 .mobile-bottom-nav{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));position:fixed;z-index:62;
   left:0;right:0;bottom:0;min-height:calc(66px + env(safe-area-inset-bottom,0px));
   padding:5px max(6px,env(safe-area-inset-right,0px)) calc(5px + env(safe-area-inset-bottom,0px)) max(6px,env(safe-area-inset-left,0px));
   border-top:1px solid #d9e9df;background:#ffffffed;backdrop-filter:blur(18px);box-shadow:0 -5px 26px #073c2920}
 .mobile-tab{min-width:0;min-height:56px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;
   border:0;border-radius:14px;background:transparent;color:#608478;padding:5px 2px;cursor:pointer;
   font-weight:650;font-size:11px;line-height:1.2}
 .mobile-tab svg{width:22px;height:22px;flex:none}
 .mobile-tab span{white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
 .mobile-tab.active{color:#075d42;background:#e8f7ef}
 .mobile-tab-alert{color:#b84d4f}
 .mobile-tab-alert.active{color:#9f2537;background:#fff0f0}
 footer{padding:15px 15px calc(96px + env(safe-area-inset-bottom,0px));font-size:10px;line-height:1.6}
 .toast{bottom:calc(85px + env(safe-area-inset-bottom,0px));left:12px;right:12px;width:auto;max-width:none}
}
@media(max-width:560px){
 .content{padding:12px 10px calc(95px + env(safe-area-inset-bottom,0px))}
 .topbar{min-height:68px;gap:7px;padding-left:9px;padding-right:9px}
 .menu-btn{width:42px;height:42px}
 .topbar h1{font-size:16px}
 .topbar .eyebrow{font-size:8px}
 .user-pill{max-width:105px;padding:7px 8px;font-size:11px}
 .top-actions{gap:5px}
 .live-pill{display:none}
 .hero{padding:16px;border-radius:17px}
 .hero h2{font-size:21px}
 .stats{gap:9px}
 .stat{padding:13px;min-height:105px}
 .stat .value{font-size:27px}
 .stat .label{font-size:10px}
 .stat .sub{font-size:10px;line-height:1.5}
 .stat:nth-child(5){grid-column:1/-1}
 .panel{padding:12px;border-radius:14px}
 .panel-head h3{font-size:16px}
 .field-row{grid-template-columns:minmax(0,1fr)}
 .map{height:300px}
 .overview-map-feature-body{padding:10px}
 .overview-map-feature .map{height:305px}
 .cmd-titleblock h2{font-size:21px}
 .cmd-title-actions{flex-wrap:wrap}
 .cmd-map-frame{height:48svh!important;min-height:325px!important}
 .cmd-map-header{flex-wrap:wrap;min-height:65px;height:auto}
 .cmd-map-footer{flex-direction:column;align-items:start}
 .cmd-map-tools button{width:41px;height:41px}
 .cmd-view-switch button{min-height:36px}
 .cmd-side-right,.cmd-side-left{grid-template-columns:minmax(0,1fr)!important}
 .mobile-tab{font-size:10px}
 .mobile-tab svg{width:22px;height:22px}
 .dialog-card{width:calc(100vw - 20px);max-height:calc(100svh - 35px);overflow-y:auto;padding:20px;border-radius:18px}
 .dialog-card input{min-height:48px;font-size:16px}
 .dialog-card .primary-btn{width:100%;min-height:48px}
}
@media(max-width:375px){
 .topbar .eyebrow{display:none}
 .mobile-tab{font-size:9px;gap:5px}
 .menu-btn{width:40px;height:40px}
 .stat .value{font-size:25px}
 .content{padding-left:9px;padding-right:9px}
}
@media(orientation:landscape) and (max-height:520px) and (max-width:900px){
 .mobile-bottom-nav{min-height:54px;padding:3px}
 .mobile-tab{min-height:48px;flex-direction:row;gap:6px}
 .mobile-tab svg{width:18px;height:18px}
 .content{padding-bottom:85px}
 .cmd-map-frame{height:66svh!important;min-height:280px!important}
}
@media(prefers-reduced-motion:reduce){.sidebar{transition:none!important}.mobile-tab{transition:none}}
