.cm-touch[hidden],.cm-touch [hidden]{display:none!important;}
.cm-touch{position:fixed;inset:0;z-index:2147483100;pointer-events:none;color:#edf0df;font:12px/1.3 system-ui,sans-serif;user-select:none;-webkit-user-select:none;}
.cm-touch button{pointer-events:auto;touch-action:none;-webkit-tap-highlight-color:transparent;min-height:42px;border:1px solid #c4d3ab66;border-radius:10px;background:#14261ee6;color:#edf0df;font:600 11px/1.3 system-ui,sans-serif;box-shadow:0 3px 18px #0003;padding:8px 11px;}
.cm-touch button:active,.cm-touch button[aria-pressed=true]{background:#b7c99d;color:#12221a;border-color:#e1e8ca;}
.cm-touch button:focus-visible{outline:2px solid #e2edc5;outline-offset:3px;}
.cm-touch-nav{position:absolute;right:max(12px,env(safe-area-inset-right));top:max(12px,env(safe-area-inset-top));display:flex;gap:7px;}
.cm-touch-nav button{min-width:48px;padding:9px 12px;}
.cm-touch-left,.cm-touch-right{position:absolute;bottom:max(16px,env(safe-area-inset-bottom));display:flex;align-items:center;flex-direction:column;gap:10px;}
.cm-touch-left{left:max(16px,env(safe-area-inset-left));}
.cm-touch-right{right:max(16px,env(safe-area-inset-right));}
.cm-touch-stick{position:relative;pointer-events:auto;touch-action:none;width:116px;height:116px;border-radius:50%;border:1px solid #becda268;background:radial-gradient(ellipse,#1e342a4d,#0e211dd1);box-shadow:inset 0 0 0 13px #bed4a50a,0 6px 26px #0004;overflow:visible;}
.cm-touch-stick:before,.cm-touch-stick:after{position:absolute;content:'';background:#d2dfb51f;pointer-events:none;}
.cm-touch-stick:before{left:50%;top:15%;height:70%;width:1px;}
.cm-touch-stick:after{top:50%;left:15%;width:70%;height:1px;}
.cm-touch-stick>i{position:absolute;width:42px;height:42px;left:calc(50% - 21px);top:calc(50% - 21px);border-radius:50%;background:#cad9b384;border:1px solid #deebc39c;transform:translate(var(--stick-x,0px),var(--stick-y,0px));pointer-events:none;box-shadow:0 3px 12px #0004;}
.cm-touch-stick>span{position:absolute;bottom:7px;left:0;right:0;text-align:center;font-size:8px;letter-spacing:.7px;color:#e1ebd1c9;pointer-events:none;}
.cm-touch-stick.held{border-color:#e2efc9;background:radial-gradient(ellipse,#78956657,#14291ed9);}
.cm-touch-stick.held>i{background:#dbe9c2df;}
.cm-touch-modifiers,.cm-touch-actions{display:flex;gap:7px;}
.cm-touch-modifiers button,.cm-touch-actions button{min-width:51px;max-width:78px;padding:8px 9px;}
.cm-touch-actions [data-touch-action=use]{background:#c4d4a6e8;color:#17251b;min-width:56px;}
.cm-touch-build{position:absolute;bottom:18px;left:50%;transform:translateX(-50%);display:none;gap:6px;}
.cm-touch[data-mode=build] .cm-touch-build{display:flex;}
.cm-touch[data-mode=build] .cm-touch-build button{max-width:95px;font-size:10px;}
.cm-touch[data-mode=vehicle] .cm-touch-modifiers,.cm-touch[data-mode=vehicle] [data-touch-action=reload]{display:none;}
.cm-touch-back{position:absolute;top:max(12px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));min-height:38px!important;z-index:2;}
.cm-touch-talk{position:absolute;left:50%;bottom:max(24px,env(safe-area-inset-bottom));transform:translateX(-50%);min-width:55px;}
.cm-touch-talk.speaking{background:#b9cea2;color:#14251b;}
.cm-touch[data-mode=build] .cm-touch-talk{display:none;}
.cm-touch-quick{position:absolute;left:50%;bottom:max(31px,env(safe-area-inset-bottom));transform:translateX(-50%);pointer-events:auto;}
.cm-touch-quick button{min-width:52px;min-height:48px;border-radius:24px;}
.cm-touch[data-mode=build] .cm-touch-quick,.cm-touch[data-mode=vehicle] .cm-touch-quick{display:none;}
.cm-touch-talk{bottom:max(91px,calc(env(safe-area-inset-bottom) + 75px));border-radius:24px!important;}
.cm-touch button{min-height:46px;border-radius:14px;background:linear-gradient(150deg,#233c30ee,#10271fe8);border-color:#d5e1ba75;box-shadow:0 4px 16px #0005,inset 0 1px #e1edc017;}
.cm-touch-stick{width:132px;height:132px;opacity:.78;border-color:#ccd8b887;box-shadow:inset 0 0 0 15px #d9e4c30a,0 5px 25px #0004;}
.cm-touch-stick.held{opacity:1;}
.cm-touch-stick>i{width:48px;height:48px;left:calc(50% - 24px);top:calc(50% - 24px);transform:translate(calc(var(--origin-x,0px) + var(--stick-x,0px)),calc(var(--origin-y,0px) + var(--stick-y,0px)));background:radial-gradient(circle at 35% 30%,#d5e0b7dc,#80997bbd);border:1px solid #e5edcfbb;}
.cm-touch-stick>span{font-size:9px;letter-spacing:.8px;}
.cm-touch-modifiers button,.cm-touch-actions button{min-height:46px;min-width:56px;font-size:11px;}
@media(max-width:390px){.cm-touch-stick{width:108px;height:108px;}.cm-touch-left{left:max(10px,env(safe-area-inset-left));}.cm-touch-right{right:max(10px,env(safe-area-inset-right));}.cm-touch-modifiers,.cm-touch-actions{gap:5px;}.cm-touch-modifiers button,.cm-touch-actions button{min-width:50px;padding:8px 7px;font-size:10px;}}
@media(orientation:landscape) and (max-height:500px){.cm-touch-stick{width:108px;height:108px;}.cm-touch button{min-height:42px;}.cm-touch-left,.cm-touch-right{bottom:max(10px,env(safe-area-inset-bottom));gap:8px;}.cm-touch-quick{bottom:max(19px,env(safe-area-inset-bottom));}.cm-touch-talk{bottom:max(76px,calc(env(safe-area-inset-bottom) + 64px));}}
.cm-touch-menu{position:absolute;inset:0;display:grid;place-items:center;pointer-events:auto;touch-action:pan-y;background:#06100ed4;backdrop-filter:blur(6px);padding:18px max(14px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));}
.cm-touch-menu-card{width:min(570px,100%);max-height:100%;overflow:auto;overscroll-behavior:contain;border:1px solid #9cad8766;border-radius:12px;background:linear-gradient(140deg,#25372d,#10231e);padding:18px;box-shadow:0 25px 90px #0009;}
.cm-touch-menu-card header{display:flex;justify-content:space-between;align-items:center;gap:12px;}
.cm-touch-menu-card header small{font-size:8px;letter-spacing:2px;color:#b4c49b;}
.cm-touch-menu-card h2{font-size:20px;font-weight:500;margin:6px 0;}
.cm-touch-menu-card header button{font-size:23px;min-width:42px;}
.cm-touch-menu-card p,.cm-touch-menu-card>small{font-size:11px;color:#c4cdb5;line-height:1.6;}
.cm-touch-menu-card>small{display:block;margin-top:14px;}
.cm-touch-menu-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:15px;}
.cm-touch-menu-grid button{text-align:left;min-height:44px;background:#1c3029;}
.cm-touch-menu-grid button[data-touch-action=pause]{border-color:#d0c48f;color:#e8dfb6;}

/* Capability detection adds this class only for a primary coarse touch pointer. */
body.cm-touch-device #game{touch-action:none;}
body.cm-touch-device .hud .brand{font-size:11px;letter-spacing:1.5px;}
body.cm-touch-device .topbar{top:max(14px,env(safe-area-inset-top));left:max(14px,env(safe-area-inset-left));right:14px;}
body.cm-touch-device .topbar .sub{font-size:8px;max-width:150px;}
body.cm-touch-device #controlsButton,body.cm-touch-device .cm-pause-toggle,body.cm-touch-device .voice-button,body.cm-touch-device .cm-online-button{display:none!important;}
body.cm-touch-device .status{top:max(66px,calc(env(safe-area-inset-top) + 56px));bottom:auto;left:max(12px,env(safe-area-inset-left));width:132px;padding:7px 9px;background:#10231bad;}
body.cm-touch-device .stat{grid-template-columns:44px 1fr 0;gap:4px;margin:4px 0;font-size:7px;}
body.cm-touch-device .track{height:4px;}
body.cm-touch-device .weaponPanel{top:max(66px,calc(env(safe-area-inset-top) + 56px));bottom:auto;right:max(12px,env(safe-area-inset-right));min-width:0;width:142px;padding:7px 9px;background:#10231bad;}
body.cm-touch-device #weaponText{font-size:10px;letter-spacing:.7px;}
body.cm-touch-device #ammoText{font-size:9px;margin-top:4px;}
body.cm-touch-device #noiseText{font-size:7px;margin-top:5px;}
body.cm-touch-device .world-clock{top:auto;bottom:max(213px,calc(env(safe-area-inset-bottom) + 205px));left:max(12px,env(safe-area-inset-left));right:auto;transform:none;font-size:9px;max-width:calc(100% - 24px);}
body.cm-touch-device .world-clock small{display:none;}
body.cm-touch-device .territoryHud{top:43px;bottom:auto;left:max(14px,env(safe-area-inset-left));font-size:7px;max-width:160px;padding:3px 5px;}
body.cm-touch-device .survival-state{top:150px;bottom:auto;left:12px;right:12px;max-width:none;}
body.cm-touch-device .survival-chip{font-size:8px;padding:3px 5px;}
body.cm-touch-device .prompt{bottom:max(207px,calc(env(safe-area-inset-bottom) + 200px));max-width:65%;font-size:9px;line-height:1.5;text-align:center;padding:6px 9px;letter-spacing:.3px;}
body.cm-touch-device .toast{top:160px;max-width:90vw;min-width:180px;font-size:11px;padding:7px 10px;}
body.cm-touch-device .mapTag{top:max(15px,env(safe-area-inset-top));font-size:9px;max-width:55%;}
body.cm-touch-device .survivor-overlay:not(.is-title){padding:50px 10px 10px;}
body.cm-touch-device .survivor-overlay:not(.is-title) .survivor-shell{width:100%;height:100%;max-height:100%;}
body.cm-touch-device .survivor-header{padding:11px 13px;gap:8px;flex-wrap:wrap;}
body.cm-touch-device .survivor-header h1{font-size:20px;}
body.cm-touch-device .survivor-header nav{flex-wrap:wrap;}
body.cm-touch-device .survivor-header nav button{min-height:36px;padding:8px 10px;font-size:11px;}
body.cm-touch-device .survivor-header kbd{display:none;}
body.cm-touch-device .survivor-overlay:not(.is-title) .inventory-grid{display:flex;flex-direction:column;overflow:auto;overscroll-behavior:contain;min-height:0;}
body.cm-touch-device .vicinity-panel{min-height:150px;max-height:none;flex-shrink:0;border-bottom:1px solid #74836544;}
body.cm-touch-device .vicinity-items{max-height:180px;min-height:80px;grid-template-columns:repeat(3,minmax(0,1fr));}
body.cm-touch-device .character-panel{height:480px;min-height:480px;flex-shrink:0;}
body.cm-touch-device .carried-panel{min-height:460px;flex-shrink:0;}
body.cm-touch-device .carried-items{max-height:260px;min-height:120px;}
body.cm-touch-device .item-grid{grid-template-columns:repeat(3,minmax(0,1fr));}
body.cm-touch-device .equipment-grid{grid-template-columns:repeat(3,minmax(0,1fr));}
body.cm-touch-device .item-filters button,body.cm-touch-device .detail-actions button,body.cm-touch-device .search-button{min-height:36px;}
body.cm-touch-device .survivor-footer{padding:8px;font-size:8px;}
body.cm-touch-device .survivor-footer kbd{display:none;}
body.cm-touch-device .loot-overlay,body.cm-touch-device .corpse-overlay,body.cm-touch-device .construction-overlay,body.cm-touch-device .voice-overlay,body.cm-touch-device .cm-pause-overlay,body.cm-touch-device .settings-overlay{padding:52px 10px max(10px,env(safe-area-inset-bottom));}
body.cm-touch-device .loot-shell,body.cm-touch-device .corpse-panel,body.cm-touch-device .voice-shell,body.cm-touch-device .construction-shell,body.cm-touch-device .settings-shell,body.cm-touch-device .cm-pause-card{max-height:100%;overflow:auto;overscroll-behavior:contain;}
body.cm-touch-device .loot-row{flex-wrap:wrap;padding:8px 0;}
body.cm-touch-device .loot-row button{min-height:36px;}
body.cm-touch-device .loot-shell header{padding:16px;}
body.cm-touch-device .loot-shell h1{font-size:21px;margin-right:70px;}
body.cm-touch-device .loot-shell header>button{right:12px;top:14px;}
body.cm-touch-device .voice-shell{padding:18px;}
body.cm-touch-device .cm-pause-card{padding:20px;}
body.cm-touch-device .cm-pause-card h1{margin:8px 0;}
body.cm-touch-device .cm-pause-card button{padding:12px;margin:8px 0;}
body.cm-touch-device .construction-bar{left:12px;right:12px;top:165px;bottom:auto;width:auto;max-width:none;max-height:calc(100dvh - 375px);overflow:auto;overscroll-behavior:contain;padding:10px;}
body.cm-touch-device .kit-recipes{grid-template-columns:repeat(4,minmax(0,1fr));}
body.cm-touch-device .kit-header strong{font-size:13px;}
body.cm-touch-device .kit-recipes button{min-width:0;padding:6px;min-height:49px;}
body.cm-touch-device .kit-recipes b{font-size:10px;}
body.cm-touch-device .kit-recipes button>span{font-size:8px;}
body.cm-touch-device .kit-tools button{font-size:10px;min-height:32px;padding:6px;}
body.cm-touch-device .kit-message{font-size:10px;}
body.cm-touch-device .construction-bar footer>span{display:none;}
body.cm-touch-device .construction-bar footer button{min-height:32px;font-size:10px;}
@media(min-width:700px){
 body.cm-touch-device .survivor-overlay:not(.is-title) .inventory-grid{display:grid;grid-template-columns:.9fr 1.05fr 1.1fr;overflow:auto;}
 body.cm-touch-device .vicinity-panel{max-height:none;border-right:1px solid #74836544;}
 body.cm-touch-device .character-panel{min-height:430px;height:auto;}
 body.cm-touch-device .carried-panel{min-height:430px;}
}
@media(max-width:350px){
 .cm-touch-stick{width:100px;height:100px;}
 .cm-touch-left{left:12px;}.cm-touch-right{right:12px;}
 .cm-touch-modifiers,.cm-touch-actions{gap:5px;}
 .cm-touch-modifiers button,.cm-touch-actions button{min-width:46px;max-width:64px;font-size:10px;padding:6px;}
 .cm-touch-nav{gap:5px;}.cm-touch-nav button{padding:8px;font-size:10px;}
 .cm-touch-build{bottom:120px;}.cm-touch-build button{min-height:33px;font-size:9px!important;padding:6px;}
 body.cm-touch-device .status{width:120px;}
 body.cm-touch-device .weaponPanel{width:128px;}
}
@media(orientation:landscape) and (max-height:550px){
 .cm-touch-stick{width:100px;height:100px;}
 .cm-touch-left,.cm-touch-right{bottom:max(10px,env(safe-area-inset-bottom));gap:7px;}
 .cm-touch-modifiers button,.cm-touch-actions button{min-height:36px;padding:6px 9px;font-size:10px;}
 .cm-touch-nav button{min-height:36px;padding:7px 12px;}
 .cm-touch-build{bottom:16px;}
 .cm-touch-build button{max-width:none!important;min-height:34px;}
 body.cm-touch-device .status{top:45px;}
 body.cm-touch-device .weaponPanel{top:55px;}
 body.cm-touch-device .world-clock{top:12px;bottom:auto;left:50%;transform:translateX(-50%);}
 body.cm-touch-device .territoryHud{top:24px;left:145px;}
 body.cm-touch-device .survival-state{top:105px;left:12px;}
 body.cm-touch-device .prompt{bottom:30px;max-width:42%;}
 body.cm-touch-device .toast{top:105px;max-width:55vw;}
 body.cm-touch-device .construction-bar{top:55px;left:170px;right:170px;max-height:calc(100dvh - 120px);padding:8px;}
 body.cm-touch-device .construction-bar .kit-header small{display:none;}
 body.cm-touch-device .kit-recipes{grid-template-columns:repeat(4,minmax(0,1fr));}
 body.cm-touch-device .kit-target{font-size:9px;}
 .cm-touch-menu-card{padding:14px;}
 .cm-touch-menu-grid{grid-template-columns:repeat(4,minmax(0,1fr));margin-top:10px;gap:6px;}
 .cm-touch-menu-card h2{font-size:18px;}
 .cm-touch-menu-card p{margin:5px 0;}
 .cm-touch-menu-grid button{font-size:10px;min-height:38px;padding:7px;}
}

body.cm-touch-device .construction-bar{top:148px;max-height:145px;}
body.cm-touch-device .construction-bar .kit-header{display:none;}
body.cm-touch-device .construction-bar .kit-tools{display:flex;overflow-x:auto;flex-wrap:nowrap;gap:5px;}
body.cm-touch-device .construction-bar .kit-tools button{flex-shrink:0;}
body.cm-touch-device .construction-bar .kit-recipes{display:flex;overflow-x:auto;gap:6px;padding:3px 0 5px;}
body.cm-touch-device .construction-bar .kit-recipes button{flex:0 0 78px;min-height:43px;}
body.cm-touch-device .construction-bar .kit-target{display:none;}
body.cm-touch-device .construction-bar .kit-message{margin:3px 0;font-size:9px;}
@media(orientation:landscape) and (max-height:550px){body.cm-touch-device .construction-bar{top:50px;max-height:125px;}}

body.cm-touch-device .save-warning{z-index:2147483200;}

/* Final ergonomic sizes override the older compact landscape rules. */
@media(orientation:landscape) and (max-height:550px){.cm-touch-stick{width:108px;height:108px;}.cm-touch-modifiers button,.cm-touch-actions button,.cm-touch-nav button{min-height:44px;}.cm-touch-quick button{min-height:46px;}}

/* Keep context text clear of the central weapon control. */
.cm-touch-stick>span{font-size:8px;letter-spacing:.3px;white-space:nowrap;}
@media(orientation:portrait){body.cm-touch-device .world-clock{top:145px;bottom:auto;}body.cm-touch-device .survival-state{top:173px;}body.cm-touch-device .toast{top:203px;}}
@media(orientation:landscape) and (max-height:550px){body.cm-touch-device .prompt{bottom:max(83px,calc(env(safe-area-inset-bottom) + 78px));}}

.cm-touch-fire{min-width:70px;min-height:48px!important;align-self:flex-start;border-color:#d8a68a99!important;background:linear-gradient(145deg,#6d3a28ed,#382019ed)!important;font-size:12px!important;letter-spacing:.6px}.cm-touch-fire[aria-pressed=true]{background:#bd7652!important;color:#fff}.cm-touch[data-mode=build] .cm-touch-fire,.cm-touch[data-mode=vehicle] .cm-touch-fire{display:none!important}.cm-touch-right{display:grid;grid-template-columns:auto auto;align-items:center;gap:8px}.cm-touch-right>.cm-touch-actions{grid-column:1/-1;justify-content:flex-end}.cm-touch-right>.cm-touch-fire{grid-column:1;grid-row:2}.cm-touch-right>.cm-touch-stick{grid-column:2;grid-row:2}
@media(max-width:550px) and (orientation:portrait){.cm-touch-right{display:flex;flex-direction:column;align-items:flex-end;gap:7px}.cm-touch-fire{align-self:flex-end;min-height:44px!important;min-width:72px}.cm-touch-right>.cm-touch-actions{order:0}.cm-touch-fire{order:1}.cm-touch-aim{order:2}.cm-touch-left{bottom:max(16px,env(safe-area-inset-bottom))}}
@media(orientation:landscape) and (max-height:500px){.cm-touch-right{gap:6px}.cm-touch-fire{min-width:62px;min-height:44px!important}.cm-touch-actions button{min-height:40px!important}}
