/* SMART Plus+ GPS Command Center V8: full-canvas map + floating intelligence panels.
   Based on user's public mobility-map reference layout, without copying third-party assets. */
body.cmd-map-immersive .app-shell>.sidebar{display:none!important}
body.cmd-map-immersive .main{width:100%;min-width:0}
body.cmd-map-immersive .topbar{height:66px;padding:10px 24px}
body.cmd-map-immersive .content:has(.cmd-v8){width:100%;padding:0!important;max-width:none!important;min-height:calc(100vh - 65px)}
body.cmd-map-immersive footer{display:none}
.content:has(.cmd-v8){padding:0!important;max-width:none!important;background:#e6f0f8!important}
.cmd-v8{position:relative;isolation:isolate;color:#153451;font-family:'IBM Plex Sans Thai',sans-serif;background:#e5f0fa;padding:13px 16px 18px}
.cmd-v8 .cmd-titlebar{margin:0 0 12px;display:flex;align-items:center;gap:15px;justify-content:space-between;background:linear-gradient(110deg,#082e50,#0c4863 72%,#176751);border-radius:14px;padding:13px 19px;color:#fff;box-shadow:0 9px 22px #082c4c2a}
.cmd-v8 .cmd-titleblock .cmd-kicker{color:#7ae8cb;font-size:9px;letter-spacing:1.5px}
.cmd-v8 .cmd-titleblock h2{font:600 clamp(18px,2vw,25px) Kanit,sans-serif;margin:2px 0;color:#fff}
.cmd-v8 .cmd-titleblock h2 svg{color:#72e4bd}
.cmd-v8 .cmd-titleblock p{color:#c6e1e7;line-height:1.5;font-size:10px}
.cmd-v8 .cmd-source-tag{background:#ffffff19;border-color:#a7f1dd55;color:#d6fff2;font-size:10px}
.cmd-v8 .cmd-button{font-size:11px;white-space:nowrap;min-height:38px}
.cmd-v8 .cmd-titlebar .cmd-button-wide{background:#ffffff14;color:white;border-color:#ffffff54}
.cmd-v8 .cmd-titlebar .cmd-button-primary{background:#0da87a;border-color:#25be8f;color:white}
.cmd-v8 .cmd-main-grid{display:block!important;position:relative;min-height:calc(100vh - 180px)}
.cmd-v8 .cmd-main-grid>.cmd-map-stage{display:block!important;position:relative!important;top:auto!important;grid-column:auto!important;grid-row:auto!important;width:100%;background:#c8dced;border:0;border-radius:15px;overflow:hidden;box-shadow:0 15px 35px #123e5921}
.cmd-v8 .cmd-map-frame{height:calc(100vh - 174px)!important;min-height:650px!important;max-height:none!important;position:relative;border-radius:15px;background:#bfd4e8;overflow:hidden}
.cmd-v8 #commandMap{position:absolute;inset:0;width:100%;height:100%;z-index:1;background:#c3dbe9}
.cmd-v8 .cmd-map-hero{position:absolute;z-index:620;left:27px;top:28px;pointer-events:none;max-width:min(410px,46%);filter:drop-shadow(0 8px 18px #031a3035);background:linear-gradient(135deg,#082d48dd,#0e4063b8);border:1px solid #8ec7df3b;padding:16px 18px 14px;border-radius:18px;backdrop-filter:blur(5px)}
.cmd-v8 .cmd-hero-overline{display:inline-flex;align-items:center;color:#eafff6;background:#083c5bdc;padding:6px 10px;border-radius:6px;font-size:9px;letter-spacing:1.5px;font-weight:750}
.cmd-v8 .cmd-hero-pulse{background:#38e9b0;width:6px;height:6px;border-radius:50%;margin-left:12px;box-shadow:0 0 0 4px #0bb98555}
.cmd-v8 .cmd-map-hero h3{font:700 clamp(19px,2.5vw,34px)/1.15 Kanit;color:#fff;text-shadow:0 2px 10px #001524bf;margin:10px 0 8px}
.cmd-v8 .cmd-map-hero h3 span{color:#bbfff0}
.cmd-v8 .cmd-map-hero p{font-size:11px;line-height:1.6;max-width:335px;color:#ecf7ff;font-weight:600;margin:0;text-shadow:0 2px 6px #0014239e}
.cmd-v8 .cmd-hero-info{display:flex;gap:5px;flex-wrap:wrap;margin-top:10px}.cmd-v8 .cmd-hero-info span{display:inline-block;background:#ffffff16;border:1px solid #d6eef54d;border-radius:999px;padding:5px 9px;font-size:10px;font-weight:700;color:#e8fbff}
.cmd-v8 .cmd-map-tools{z-index:1250;right:360px;top:22px;display:flex;align-items:center;gap:7px}
.cmd-v8 .cmd-map-exitbar{position:absolute;z-index:1248;right:360px;top:72px;display:flex;gap:8px;opacity:0;pointer-events:none;transform:translateY(-6px);transition:.18s ease}
.cmd-v8 .cmd-map-frame.cmd-map-maximized .cmd-map-exitbar,.cmd-v8 body.cmd-map-immersive .cmd-map-exitbar,body.cmd-map-immersive .cmd-v8 .cmd-map-exitbar{opacity:1;pointer-events:auto;transform:none}
.cmd-v8 .cmd-chip-btn{display:inline-flex;align-items:center;gap:6px;border:1px solid #c7dbeb;background:#fff;color:#124a6e;border-radius:999px;padding:8px 12px;font:600 11px 'IBM Plex Sans Thai';box-shadow:0 6px 18px #07253d1f;cursor:pointer}
.cmd-v8 .cmd-chip-btn:hover{background:#eef7ff}
body.cmd-map-screen-lock{overflow:hidden}

.cmd-v8 .cmd-map-tools button{background:#fff;color:#145279;border:1px solid #d1e3ed;border-radius:9px;width:38px;height:38px;box-shadow:0 2px 10px #12436626}
.cmd-v8 .cmd-map-tools button:hover{background:#ecf7ff}
.cmd-v8 .cmd-view-switch{display:flex;background:#fff;border:1px solid #cedee9;box-shadow:0 2px 10px #12436624;border-radius:9px;padding:3px}
.cmd-v8 .cmd-view-switch button{background:transparent;border:0!important;box-shadow:none!important;color:#50718b;width:auto;height:32px;white-space:nowrap;padding:5px 11px}
.cmd-v8 .cmd-view-switch button.selected{background:#0b5b8b;color:white}
.cmd-v8 .cmd-map-corner{top:auto;bottom:12px;left:auto;right:350px;z-index:740;display:flex;align-items:flex-end;gap:5px}
.cmd-v8 .cmd-map-corner>.cmd-map-data{background:#fff;color:#12486a;border-color:#d4e4e6;box-shadow:0 3px 9px #092a4523;font-size:9px;white-space:nowrap}
.cmd-v8 .cmd-map-corner>span:last-child{background:#104c70d9;color:#fff;font-size:9px}
.cmd-v8 .cmd-map-bottom{position:absolute;z-index:710;left:20px;bottom:55px;width:min(560px,calc(100% - 415px));border-radius:15px;overflow:hidden;box-shadow:0 17px 40px #042d5270;background:#fff;pointer-events:auto}
.cmd-v8 .cmd-map-bottom-title{padding:12px 17px;background:linear-gradient(105deg,#082e58,#075174);color:#fff;display:flex;align-items:center;justify-content:space-between;gap:10px}
.cmd-v8 .cmd-map-bottom-title b{font:600 17px Kanit}.cmd-v8 .cmd-map-bottom-title small{font-size:9px;color:#c7e4f4;text-align:right}
.cmd-v8 .cmd-metric-grid{display:grid;position:static;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;margin:0}
.cmd-v8 .cmd-metric{min-width:0;min-height:100px;border:0;border-right:1px solid #e6edf3;border-radius:0;padding:12px 9px 10px;background:white;box-shadow:none}
.cmd-v8 .cmd-metric:before{height:3px;width:100%}
.cmd-v8 .cmd-metric span{font-size:9px;color:#678093;line-height:1.4}.cmd-v8 .cmd-metric strong{font:700 26px/1.2 Kanit;color:#0b486b;margin:6px 0 3px}
.cmd-v8 .cmd-metric small{font-size:9px;line-height:1.4;color:#8496a3}
.cmd-v8 .cmd-map-footer{position:absolute;bottom:0;left:0;right:0;z-index:600;padding:7px 14px;background:#0b3550ed;border:0;display:flex;align-items:center;gap:10px;color:#bbd3df;font-size:9px}
.cmd-v8 .cmd-map-footer .cmd-legends{display:flex;align-items:center;gap:12px}
.cmd-v8 .cmd-map-footer .cmd-legend-dot{width:25px}
.cmd-v8 .cmd-map-footer .cmd-legend-dot.main{background:#05e191;height:4px}
.cmd-v8 .cmd-map-footer .cmd-legend-dot.car{height:0;border-top:3px dashed #5abaff;background:transparent}
.cmd-v8 .cmd-map-footer .cmd-legend-dot.warning{width:9px;height:9px;background:#ff5266}
.cmd-v8 .cmd-main-grid>.cmd-intel-rail{position:absolute!important;z-index:900!important;right:17px;top:17px;bottom:42px;width:317px;max-height:none!important;height:auto;overflow-y:auto;display:flex!important;flex-direction:column;gap:10px;background:#f8fcffec;backdrop-filter:blur(12px);border:1px solid #d5e2ea;box-shadow:0 17px 40px #0b355144;border-radius:15px;padding:0 9px 12px!important;scrollbar-width:thin;scrollbar-color:#a7c4d4 transparent}
.cmd-v8 .cmd-rail-head{position:sticky;top:0;z-index:4;background:#092e57;color:#fff;padding:14px 15px 12px;margin:0 -9px;border-radius:14px 14px 0 0;box-shadow:0 3px 10px #0d42762b}
.cmd-v8 .cmd-rail-head span{font-size:9px;letter-spacing:1.2px;color:#8fe6d1;font-weight:750}.cmd-v8 .cmd-rail-head h3{font:650 19px Kanit;margin:3px 0;color:white}.cmd-v8 .cmd-rail-head p{font-size:10px;color:#bbdae5;line-height:1.5;margin:0}
.cmd-v8 .cmd-rail-shortcuts{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;position:sticky;top:87px;z-index:3;background:#f8fcff;padding:7px 1px}
.cmd-v8 .cmd-rail-shortcuts button{background:#e7f2f7;border:1px solid #cadde7;color:#175278;border-radius:7px;padding:7px 2px;font:600 10px 'IBM Plex Sans Thai';cursor:pointer}
.cmd-v8 .cmd-intel-rail .cmd-panel{background:white;border:1px solid #e2ebf1;border-radius:11px;padding:13px 11px!important;box-shadow:0 3px 13px #144d7110;overflow:visible}
.cmd-v8 .cmd-panel-head h3{font-size:13px;color:#133f63;line-height:1.5}.cmd-v8 .cmd-panel-head h3 svg{color:#0b75aa}.cmd-v8 .cmd-panel-head>div>span{color:#7a98a7}
.cmd-v8 .cmd-waypoints{display:grid;gap:5px}.cmd-v8 .cmd-waypoint{min-height:47px;border:1px solid #e0edf1;background:#f6fbfd;border-radius:8px;padding:8px}.cmd-v8 .cmd-waypoint:hover,.cmd-v8 .cmd-waypoint.selected{background:#e5f8ef;border-color:#5ccc9d}
.cmd-v8 .cmd-waypoint-meta b{font-weight:700;font-size:11px;color:#174e65;white-space:normal;overflow-wrap:break-word}.cmd-v8 .cmd-waypoint-meta small{font-size:9px;color:#8296a3}
.cmd-v8 .cmd-station-number{background:#0a7ca3;width:29px;height:29px;border-radius:8px}.cmd-v8 .cmd-station-number.last{background:#e68a3a}.cmd-v8 .cmd-station-number.first{background:#009b78}
.cmd-v8 .cmd-point-detail{background:#eaf5fa;border-color:#cadee8;color:#135174}.cmd-v8 .cmd-point-detail span,.cmd-v8 .cmd-point-detail small{color:#5c7890}
.cmd-v8 .cmd-weather-row b{font-size:11px}.cmd-v8 .cmd-weather-row strong{color:#125d80}.cmd-v8 .cmd-weather-row small{line-height:1.5}.cmd-v8 .cmd-reports{max-height:240px}
.cmd-v8 .cmd-report-intro{background:#ebf4f7;border-color:#cbdde7;color:#466578}.cmd-v8 .cmd-report-intro strong{color:#185a72}
.cmd-v8 .cmd-layers-panel .cmd-layer-controls{gap:8px}
.cmd-v8 .cmd-layers-panel .cmd-layer-item{display:grid;grid-template-columns:auto auto 1fr;align-items:center;gap:10px;border:1px solid #dfebf2;background:#f7fbfe;border-radius:12px;padding:10px 11px;min-height:unset;color:#264e6a}
.cmd-v8 .cmd-layers-panel .cmd-layer-item input{margin:0;inline-size:18px;block-size:18px}
.cmd-v8 .cmd-layer-swatch{display:grid;place-items:center;min-width:32px}
.cmd-v8 .cmd-layer-meta{display:grid;gap:2px}
.cmd-v8 .cmd-layer-meta b{font-size:11px;color:#134f75}
.cmd-v8 .cmd-layer-meta small{font-size:9px;color:#728b9d;line-height:1.45}
.cmd-v8 .cmd-guide-list{display:grid;gap:10px}
.cmd-v8 .cmd-guide-list>div{border:1px solid #e2ebf1;background:#f7fbfe;border-radius:12px;padding:10px 11px}
.cmd-v8 .cmd-guide-list b{display:block;color:#124f74;font-size:11px;margin-bottom:3px}
.cmd-v8 .cmd-guide-list small{display:block;color:#708798;font-size:9px;line-height:1.6}
.cmd-v8 .cmd-panel-note{color:#78909c}
.cmd-v8 #commandMap .cmd-map-point-name,.cmd-v8 #commandMap .leaflet-tooltip.cmd-map-point-name{white-space:nowrap!important;overflow-wrap:normal!important;word-break:keep-all!important;max-width:none!important;min-width:0!important;width:max-content!important;display:inline-block;padding:4px 7px!important;font:700 10px/1.2 'IBM Plex Sans Thai',sans-serif!important;color:#103e5a!important;border:1.5px solid #04ae91!important;border-radius:7px;background:#ffffffee!important;box-shadow:0 2px 8px #052d4860!important}
.cmd-v8 #commandMap .cmd-map-point-name:before{border-top-color:#04ae91}
.cmd-v8 #commandMap .cmd-point-icon{background:transparent;border:0}
.cmd-v8 .cmd-pulse{width:45px;height:45px}.cmd-v8 .cmd-pulse-core{border-width:2px}
.cmd-v8 .cmd-map-maximized{position:fixed!important;inset:8px!important;height:calc(100vh - 16px)!important;z-index:9999!important;box-shadow:0 0 0 100vmax #071d35c9}
.cmd-v8 .cmd-gps-actions{background:#0a4053}
@media (max-width:1100px){
 .cmd-v8 .cmd-map-hero{max-width:35%;left:15px;top:17px}.cmd-v8 .cmd-map-hero h3{font-size:23px}
 .cmd-v8 .cmd-map-hero p{font-size:10px}.cmd-v8 .cmd-hero-info{display:none}
 .cmd-v8 .cmd-main-grid>.cmd-intel-rail{width:288px;right:10px;top:10px}
 .cmd-v8 .cmd-map-tools{right:310px;top:12px}
 .cmd-v8 .cmd-map-exitbar{right:310px;top:60px}
 .cmd-v8 .cmd-map-bottom{width:min(480px,calc(100% - 330px));left:12px;bottom:50px}
 .cmd-v8 .cmd-map-corner{right:313px;bottom:8px}
 .cmd-v8 .cmd-map-bottom-title{padding:10px 12px}.cmd-v8 .cmd-metric{padding:11px 7px}.cmd-v8 .cmd-metric span{font-size:9px}.cmd-v8 .cmd-metric strong{font-size:23px}
}
@media (max-width:760px){
 .cmd-v8{padding:7px}.cmd-v8 .cmd-titlebar{border-radius:10px;padding:10px;flex-wrap:wrap;gap:8px}.cmd-v8 .cmd-titleblock h2{font-size:20px}.cmd-v8 .cmd-titleblock p{font-size:9px}
 .cmd-v8 .cmd-title-actions{width:100%;justify-content:flex-start;gap:6px;flex-wrap:wrap}
 .cmd-v8 .cmd-map-frame{min-height:510px!important;height:68vh!important}
 .cmd-v8 .cmd-main-grid>.cmd-intel-rail{position:relative!important;top:auto;right:auto;bottom:auto;width:100%;height:auto;max-height:none!important;overflow:visible;margin-top:9px;background:#f8fcff;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));padding:10px!important;gap:9px}
 .cmd-v8 .cmd-rail-head{position:relative;top:auto;margin:-10px -10px 0;grid-column:1/-1;border-radius:10px 10px 0 0}
 .cmd-v8 .cmd-rail-shortcuts{grid-column:1/-1;position:relative;top:auto}
 .cmd-v8 .cmd-waypoints-panel,.cmd-v8 .cmd-layers-panel{grid-column:1/-1}
 .cmd-v8 .cmd-map-tools{right:9px;top:9px}
 .cmd-v8 .cmd-map-exitbar{right:9px;top:52px;flex-wrap:wrap;max-width:calc(100% - 18px)}
 .cmd-v8 .cmd-map-hero{top:10px;left:9px;max-width:calc(100% - 180px)}.cmd-v8 .cmd-map-hero h3{font-size:17px}.cmd-v8 .cmd-map-hero p{display:none}
 .cmd-v8 .cmd-map-bottom{width:calc(100% - 18px);left:9px;bottom:40px}.cmd-v8 .cmd-map-bottom-title small{display:none}.cmd-v8 .cmd-metric{min-height:78px}.cmd-v8 .cmd-metric strong{font-size:22px}.cmd-v8 .cmd-metric small{font-size:8px}
 .cmd-v8 .cmd-map-corner{left:auto;right:9px;bottom:175px}
 .cmd-v8 .cmd-map-footer{flex-direction:column;align-items:flex-start;gap:3px;padding:6px 10px;font-size:8px}
 .cmd-v8 #commandMap .leaflet-tooltip.cmd-map-point-name{display:none!important}
}
@media (max-width:480px){
 .cmd-v8 .cmd-map-frame{height:570px!important;min-height:570px!important}
 .cmd-v8 .cmd-view-switch button{font-size:9px;padding:4px 6px}.cmd-v8 .cmd-map-tools{top:8px;right:8px;gap:4px}.cmd-v8 .cmd-map-tools button{width:32px;height:32px}.cmd-v8 .cmd-map-exitbar{right:8px;top:48px}
 .cmd-v8 .cmd-map-hero h3{font-size:15px}.cmd-v8 .cmd-map-hero{max-width:calc(100% - 165px)}.cmd-v8 .cmd-hero-overline{font-size:7px;padding:5px}
 .cmd-v8 .cmd-main-grid>.cmd-intel-rail{grid-template-columns:1fr}
 .cmd-v8 .cmd-metric-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.cmd-v8 .cmd-metric{padding:8px 5px}.cmd-v8 .cmd-metric span{font-size:8px}
 .cmd-v8 .cmd-map-bottom-title b{font-size:14px}
}
@media(prefers-reduced-motion:reduce){.cmd-v8 .cmd-hero-pulse{box-shadow:none}}

.cmd-v8 .cmd-point-detail{padding:12px 13px;gap:8px}
.cmd-v8 .cmd-point-detail span{font-size:10px;line-height:1.55}
