/* Original bronze-and-stone command frame. The arena and controls occupy separate rows. */
.command-layout{--command-stone:#24271f;--command-dark:#12170f;--command-bronze:#88754c;--command-gold:#dac28d;--command-ink:#ede6cf;--command-muted:#b3b49c;--command-edge:#5b604a;color:var(--command-ink)}
.raid-portal #game-screen.command-layout{display:grid;grid-template-rows:48px auto minmax(0,1fr) auto;min-height:0;background:#10160e}
.command-layout [hidden]{display:none!important}
.command-layout .game-top{height:48px;padding:0 14px;background:#29271f;border-color:var(--command-bronze);gap:10px}
.command-layout .game-top .icon-btn{width:44px;height:44px;min-width:44px;border-radius:3px;background:#2e3325;border-color:#6f704b;color:var(--command-ink)}
.command-layout .game-top .eyebrow{font-size:9px;color:var(--command-gold);letter-spacing:.08em}
.command-layout .game-top .command-mode-label select{min-height:44px;max-width:86px;padding:3px 5px}
.command-layout .game-top .command-mode-label>span{display:none}
.command-layout .command-inventory-toggle{display:none;min-width:44px;min-height:44px;border:1px solid #827349;border-radius:2px;background:#303827;color:var(--command-gold);font-size:10px}
.command-layout .game-top strong{font-size:12px}.command-layout .game-top .chip{border-color:#74734d;color:#ceccb2;background:#151c15;font-size:9px}
.command-layout .encounter-header{position:relative;z-index:14;min-width:0;background:#221f19;border-bottom:1px solid var(--command-bronze)}
.command-layout .boss-hud{position:static;transform:none;left:auto;top:auto;max-width:none;width:100%;padding:8px 16px;margin:0;display:grid;grid-template-columns:minmax(220px,.9fr) minmax(0,1.5fr);gap:20px;align-items:center;pointer-events:auto}
.command-layout .boss-core{min-width:0}.command-layout .boss-name,.command-layout .boss-hp,.command-layout .boss-sub{max-width:none;margin-left:0;margin-right:0}
.command-layout .boss-name{gap:10px;margin-bottom:5px;line-height:1.25}.command-layout .boss-name strong{font-size:14px;color:#eee4c8}.command-layout .boss-name>span:first-child{display:none}.command-layout #boss-phase{font-size:9px;white-space:nowrap;color:var(--command-gold)}
.command-layout .boss-name{flex-wrap:wrap}.command-layout #command-focus-note{font-size:9px;padding:2px 5px;border:1px solid #a99561;color:#ebd696;background:#57482b;white-space:nowrap;border-radius:2px}
.command-layout .boss-hp{height:7px;border-radius:1px;background:#352e22;border:1px solid #817053}.command-layout #boss-hp-fill{background:#b07d49}
.command-layout .boss-sub{margin-top:4px;font-size:9px}.command-layout .energy-track{height:3px;border-radius:0;background:#29332b}.command-layout #energy-fill{background:#a0b777}.command-layout #boss-hp-text{font-size:9px;color:var(--command-muted)}
.command-layout .guide-weakness{display:flex;align-items:center;gap:8px;grid-column:1/-1;margin-top:3px;min-width:0;color:#c0f9df;line-height:1.2}
.command-layout #guide-window-time{font-size:10px;font-variant-numeric:tabular-nums;white-space:nowrap}
.command-layout .guide-weakness #guide-window-track{flex:1;min-width:24px;height:4px;margin:0;background:#98ebc626}
.command-layout .combat-guide{margin:0;padding:0;background:none;border:0;box-shadow:none;border-radius:0;color:var(--command-ink);display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px}
.command-layout .guide-cells{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:12px;align-items:center}
.command-layout .guide-cell{padding:0;border:0;background:none;min-width:0}.command-layout .guide-cell+.guide-cell{border-left:1px solid #7f79594d;padding-left:12px}
.command-layout .guide-label{font-size:9px;letter-spacing:.03em;color:var(--command-muted);margin-bottom:2px}.command-layout .guide-cell strong{font-size:13px;line-height:1.35}.command-layout #guide-danger-note,.command-layout #guide-action-note{display:none}
.command-layout .guide-footer{padding:0;border:0;background:none}.command-layout #guide-details-toggle{min-width:44px;min-height:44px;font-size:10px;white-space:normal;width:48px;line-height:1.3;border-color:#756849;color:var(--command-gold);border-radius:3px;padding:4px}
.command-layout .combat-detail-content{position:absolute;top:100%;right:12px;width:min(440px,calc(100vw - 24px));max-height:min(350px,58vh);margin:0;background:#1b231afc;border:1px solid #a78d54;border-radius:3px;box-shadow:0 12px 24px #0009;padding:12px;z-index:30}
.command-layout .combat-detail-content #guide-reward{display:block;padding:8px 0;border:0}.command-layout .combat-detail-content .guide-cell p{display:block;font-size:12px}.command-layout .combat-detail-content .guide-keys{padding:8px 0;gap:6px}.command-layout .raid-rhythm{padding:4px 0;flex-wrap:wrap;font-size:10px;background:none}
/* All renderers share exactly this uncluttered canvas rectangle. */
.command-layout .battle-wrap{position:relative;min-height:0;min-width:0;width:100%;height:100%;overflow:hidden;--guide-safe-top:0px!important;background:#152015}
.command-layout #battle-canvas,.command-layout .battle-wrap>.battle-3d-canvas,.command-layout .battle-wrap>.floating-3d-canvas{position:absolute;inset:0;top:0;height:100%;width:100%}
.command-layout .renderer-note{bottom:6px;top:auto;left:8px;font-size:9px;max-width:60%;opacity:.65}.command-layout #input-feedback{bottom:10px;top:auto;max-width:90%;font-size:12px}.command-layout #performance-hud{top:6px;right:8px}
.command-layout #combat-banner,.command-layout #gate-card,.command-layout .portrait-hint{display:none!important}
.command-layout .command-dock.bottom-hud{position:relative;inset:auto;z-index:15;display:grid;grid-template-columns:168px minmax(245px,1fr) 178px minmax(285px,1.1fr);gap:12px;padding:10px 14px max(10px,env(safe-area-inset-bottom));align-items:stretch;pointer-events:auto;min-width:0;background:linear-gradient(#353129,#231f19);border-top:3px solid #97804e;box-shadow:inset 0 1px #ded0a151,0 -4px 16px #0006}
.command-dock>div{min-width:0}.command-panel-heading{height:26px;display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:5px}.command-panel-heading>strong{font-size:11px;letter-spacing:.035em;color:var(--command-gold);white-space:nowrap}.command-panel-heading>span{font-size:9px;color:var(--command-muted)}
.command-map-panel,.command-unit-panel,.command-build-panel{border-right:1px solid #7470556e;padding-right:12px}
.command-map-panel .command-panel-heading>span{display:none}
.command-layout #command-minimap{display:block;position:static;width:100%;height:auto;aspect-ratio:26/17;border:2px solid #8c7b52;background:#11180f;cursor:crosshair;touch-action:none;box-shadow:0 0 0 2px #141a11}
.map-legend{display:flex;flex-wrap:wrap;gap:8px;font-size:9px;margin-top:7px;color:var(--command-muted)}.map-legend>span:before{content:'●';font-size:8px;margin-right:3px}.map-legend .map-self:before{color:#d6e5a0}.map-legend .map-ally:before{color:#8fc4c5}.map-legend .map-boss:before{color:#bc7256}.map-legend #command-map-order:before{content:''}.map-legend #command-map-order{flex:1;text-align:right}
.command-layout #command-select-self{font-size:10px;min-height:44px;min-width:44px;padding:3px 6px;color:var(--command-muted);border-bottom:1px solid #777453}
.command-unit-panel>.command-panel-heading{height:44px}
.command-selected{display:grid;grid-template-columns:74px minmax(0,1fr);gap:10px;align-items:center}
#command-portrait-wrap{height:78px;background:linear-gradient(145deg,#525641,#20291b);border:2px solid #99865a;box-shadow:inset 0 0 18px #0008;position:relative;overflow:hidden}
.command-layout #command-portrait{position:static;display:block;width:100%;height:100%;object-fit:contain}.command-layout #command-portrait-fallback{display:grid;place-items:center;height:100%;width:100%}#command-portrait-fallback .class-icon{width:48px;height:48px}.boss-portrait-mark{font-size:11px;letter-spacing:.04em;color:var(--command-gold)}
.command-unit-copy>strong{display:block;font-size:13px;line-height:1.35;color:var(--command-ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.command-unit-copy>span{display:block;font-size:9px;color:var(--command-muted);line-height:1.35;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.selection-health{height:5px;background:#142115;border:1px solid #667748;margin:5px 0 3px}.selection-health>span{height:100%;display:block;background:#9aaa5f}.command-unit-copy #command-selection-hp{font-size:9px;font-variant-numeric:tabular-nums}
#command-unit-stats{display:grid;grid-template-columns:1fr 1fr;gap:1px 8px;margin:5px 0 0;font-size:9px;line-height:1.4}#command-unit-stats>div{display:flex;justify-content:space-between;gap:5px}#command-unit-stats dt{color:#9fa88c}#command-unit-stats dd{color:#e3dfc9;margin:0;font-variant-numeric:tabular-nums;white-space:nowrap}
.command-layout .player-vitals{width:auto;background:none;border:0;border-radius:0;padding:0;margin-top:6px}.command-layout .player-vitals>div:first-child{font-size:9px;display:flex;justify-content:space-between}.command-layout .player-vitals #player-class{font-size:9px}.command-layout .player-vitals #player-hp-text{font-size:10px}.command-layout .player-vitals .player-hp{height:4px;margin:3px 0}.command-layout .player-vitals small{display:none}
.command-party{display:flex;gap:5px;margin-top:6px;max-width:100%;overflow-x:auto}.command-party button{flex:1;min-width:44px;min-height:44px;display:grid;align-content:center;gap:3px;padding:4px;background:#192318;border:1px solid #555f41;border-radius:2px}.command-party button[aria-pressed="true"]{border-color:#d7c78b;background:#37402a}.command-party button>span:first-child{font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.party-health{height:3px;background:#10180e;display:block}.party-health i{display:block;height:100%;background:#a0b568}.command-party small{font-size:8px;color:#c2c8aa;font-variant-numeric:tabular-nums}
.command-layout[data-party-size="1"] .command-party{display:none}
.command-item-slots{display:grid;grid-template-columns:repeat(3,minmax(44px,1fr));gap:5px}.command-layout .command-item{min-width:44px;min-height:72px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:5px 3px;border:1px solid #80754c;border-radius:2px;background:#303725;color:#d5c69a;line-height:1.15}.command-item>span{font-size:23px}.command-item>b{font-size:8px;font-weight:500;text-align:center;word-break:keep-all}.command-item>small{font-size:8px;color:#ddd2b2}.command-item.empty{border-style:dashed;background:#182016;color:#798268}.command-item.empty>span{font-size:15px}.command-item.empty>small{color:#8b957d}.command-build-note{font-size:9px;margin:7px 0;color:var(--command-muted)}
.command-mode-label{display:flex;gap:5px;align-items:center;font-size:9px;color:var(--command-muted)}.command-layout .command-mode-label select{min-height:28px;padding:2px 4px;width:auto;font-size:10px;color:var(--command-ink);background:#172014;border:1px solid #706447;border-radius:2px}
.command-order-grid{display:grid;grid-template-columns:repeat(4,minmax(44px,1fr));gap:5px;margin-bottom:7px}.command-layout .command-order-grid button{position:relative;min-width:44px;min-height:44px;padding:6px 4px;background:#343d29;border:1px solid #85825a;border-radius:2px;color:#e3dcc1;font-size:11px;line-height:1.2}.command-order-grid kbd{display:block;font-size:9px;color:#c8b781;margin-bottom:4px}.command-layout .command-order-grid button[aria-pressed="true"]{background:#65603b;border-color:#ead08b;box-shadow:inset 0 0 0 1px #eddb9d44}.command-layout[data-control-mode="direct"] .command-order-grid kbd{display:none}
.command-layout .skillbar{display:grid;grid-template-columns:repeat(3,minmax(44px,1fr));gap:5px;pointer-events:auto;justify-content:initial;flex:none}
.command-layout .skill{width:auto;min-width:44px;height:49px;min-height:44px;border:1px solid #827349;border-radius:2px;background:linear-gradient(#43533b,#253224);gap:2px;position:relative;color:#ede5c9}.command-layout .skill kbd{position:absolute;top:3px;left:4px;font-size:9px;color:#e4d29d}.command-layout .skill .skill-icon{font-size:17px;margin-top:0}.command-layout .skill small{display:block;font-size:9px;line-height:1.2;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.command-layout .skill .cd{font-size:14px;background:#0d180ddb}.command-layout .skill.ready{box-shadow:inset 0 0 10px #d6d0866b;border-color:#dace7f}
.command-status{font-size:10px;line-height:1.4;min-height:14px;color:#c3c8a6;margin:6px 0 0;overflow-wrap:anywhere}
.command-layout .touch-controls{display:none;position:static;inset:auto;width:auto;height:auto;min-height:0;gap:10px;align-items:center;justify-content:space-between;pointer-events:auto}
.command-layout #joystick{position:relative;flex:0 0 68px;width:68px;height:68px;border-color:#a49b6b;background:#46503977}.command-layout #joystick-thumb{width:32px;height:32px;left:17px;top:17px;background:#b5b88480;border-color:#c4c693}
.command-layout .touch-skills{width:208px;flex:0 1 208px;grid-template-columns:repeat(4,minmax(44px,1fr));gap:5px}.command-layout .touch-skills button[data-action]{border-radius:2px;background:#303e2b;border-color:#8a8052;color:#e3ddbe}.command-layout .touch-skills button.touch-attack[data-action]{background:#576342;height:93px}
.command-layout button:focus-visible,.command-layout select:focus-visible,.command-layout canvas:focus-visible{outline:2px solid #eed68f;outline-offset:2px}
.command-layout[data-item-detail="true"] .command-build-note{display:block;font-size:11px;line-height:1.5;color:#e1d6b4}
@media(max-width:1080px){
 .command-layout .command-dock.bottom-hud{grid-template-columns:136px minmax(210px,1fr) 148px minmax(258px,1fr);padding-left:9px;padding-right:9px;gap:8px}.command-map-panel,.command-unit-panel,.command-build-panel{padding-right:8px}.command-layout .boss-hud{gap:14px;padding:6px 12px}.command-selected{grid-template-columns:60px minmax(0,1fr);gap:7px}#command-portrait-wrap{height:70px}.command-unit-copy>strong{font-size:12px}
}
.command-layout .command-status[data-help="true"]{display:block;font-size:11px;line-height:1.4;color:var(--command-ink)}
@media(max-width:800px){
 .command-layout .command-dock.bottom-hud{grid-template-columns:112px minmax(160px,1fr) minmax(270px,1.3fr)}.command-build-panel{display:none}.command-layout .boss-hud{grid-template-columns:minmax(175px,.7fr) minmax(0,1.4fr);gap:12px}.command-layout .guide-cells{gap:8px}.command-layout .guide-cell+.guide-cell{padding-left:8px}.command-layout .guide-cell strong{font-size:11px}.command-layout .guide-label{font-size:8px}.command-party button>span:first-child{font-size:7px}
 .command-layout .command-inventory-toggle{display:block}.command-layout[data-inventory-open="true"] .command-build-panel{display:block;position:absolute;right:10px;bottom:calc(100% + 8px);width:220px;background:#252e20;padding:12px;border:1px solid var(--command-gold);box-shadow:0 8px 20px #0008;z-index:35}
}
/* Compact phone frame: 46px bar, fixed 54px encounter strip, battlefield, ~156px dock (65%+ of the viewport stays battlefield). */
@media(max-width:650px) and (orientation:portrait){
 .raid-portal #game-screen.command-layout{grid-template-rows:46px 54px minmax(0,1fr) auto}
 .command-layout .game-top{height:46px;padding:0 6px;gap:5px}.command-layout .game-top>div{gap:5px}.command-layout .game-top .chip,.command-layout .game-top .eyebrow,.command-layout #gate-dots,.command-layout #game-sound{display:none}.command-layout .game-top strong{display:block;font-size:10px;max-width:92px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.command-layout #battle-time{font-size:9px}.command-layout .command-inventory-toggle{display:block}
 .command-layout .encounter-header{height:54px}
 .command-layout .boss-hud{display:flex;flex-direction:column;justify-content:center;align-items:stretch;gap:4px;height:100%;padding:3px 58px 3px 9px}
 .command-layout .boss-core{display:flex;align-items:center;gap:8px;min-width:0}.command-layout .boss-name{flex:0 1 auto;min-width:0;margin:0;gap:6px;flex-wrap:nowrap;overflow:hidden;white-space:nowrap}.command-layout .boss-name strong{font-size:12px;overflow:hidden;text-overflow:ellipsis}.command-layout #boss-phase{font-size:8px}.command-layout .boss-hp{flex:1 1 56px;min-width:40px;height:6px}.command-layout .boss-sub{display:none}
 .command-layout .guide-weakness{flex:0 0 auto;margin:0;gap:5px}.command-layout .guide-weakness #guide-window-track{flex:0 0 32px}
 .command-layout .combat-guide{display:block;margin:0;overflow:visible}.command-layout .guide-cells{display:flex;align-items:center;gap:7px;max-height:28px;overflow:hidden}.command-layout .guide-cell{flex:0 1 auto;min-width:0}.command-layout #guide-danger{max-width:48%}.command-layout #guide-action{flex:1 1 0}.command-layout .guide-cell+.guide-cell{padding-left:7px}.command-layout .guide-label{display:none}.command-layout .guide-cell strong{font-size:11px;line-height:14px}
 .command-layout .guide-footer{position:absolute;right:8px;top:50%;transform:translateY(-50%)}.command-layout #guide-details-toggle{width:44px;min-height:44px;font-size:9px}
 .command-layout .command-dock.bottom-hud{grid-template-columns:68px minmax(0,1fr);grid-template-rows:46px auto;gap:5px 8px;padding:6px 8px max(6px,env(safe-area-inset-bottom));border-top-width:2px}
 .command-map-panel{grid-column:1;grid-row:1;border:0;padding:0;align-self:center}.command-map-panel .command-panel-heading,.map-legend{display:none}
 .command-unit-panel{grid-column:2;grid-row:1;display:flex;align-items:center;gap:8px;min-width:0;border:0;padding:0;overflow:hidden}.command-unit-panel>.command-panel-heading{display:none}
 .command-selected{flex:1 1 0;min-width:0;grid-template-columns:40px minmax(0,1fr);gap:7px}#command-portrait-wrap{height:40px;border-width:1px}#command-portrait-fallback .class-icon{width:28px;height:28px}
 .command-unit-copy{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:baseline;column-gap:6px}.command-unit-copy>strong{font-size:11px}.command-unit-copy>#command-selection-sub,#command-unit-stats{display:none}.selection-health{grid-column:1/-1;margin:4px 0 0;height:5px}.command-unit-copy #command-selection-hp{grid-column:2;grid-row:1;font-size:9px;white-space:nowrap}
 .command-layout .player-vitals{display:none;flex:0 0 92px;margin:0}.command-layout .player-vitals>div:first-child{font-size:8px}.command-layout .player-vitals #player-hp-text{font-size:9px}
 .command-layout[data-party-size="1"]:has(#command-portrait[data-unit^="boss:"]) .player-vitals{display:block}.command-layout:has(#command-portrait[data-unit^="boss:"]) #class-combat-status{display:none}
 #class-combat-status{flex:0 1 40%;min-width:0}.command-layout #class-combat-status .reference-identity{padding:0;gap:0}.command-layout #class-combat-status .reference-identity strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal;font-size:10px;line-height:1.3}
 .command-layout[data-party-size]:not([data-party-size="1"]) .command-selected,.command-layout[data-party-size]:not([data-party-size="1"]) #class-combat-status{display:none}.command-party{flex:1 1 0;margin:0;gap:4px}.command-party button{min-height:44px;padding:3px;gap:2px}.command-party button>span:first-child,.command-party small{font-size:8px}
 .command-actions-panel{grid-column:1/-1;grid-row:2}.command-actions-panel>.command-panel-heading{display:none}.command-order-grid{gap:5px;margin-bottom:5px}.command-layout .command-order-grid button{height:44px;min-height:44px;display:flex;align-items:center;justify-content:center;gap:5px;padding:2px 4px;font-size:11px}.command-order-grid kbd{margin:0;font-size:9px}
 .command-layout .skillbar{grid-template-columns:repeat(6,minmax(44px,1fr));gap:4px}.command-layout .skill{height:44px}.command-layout .skill small{font-size:8px}.command-layout .skill .skill-icon{font-size:16px}.command-layout .skill kbd{font-size:8px;top:2px;left:3px}
 .command-layout .command-status{display:none;position:absolute;left:8px;right:8px;bottom:calc(100% + 6px);z-index:20;margin:0;padding:6px 9px;min-height:0;font-size:11px;line-height:1.4;color:var(--command-ink);background:#1b231af2;border:1px solid #a78d54;border-radius:3px;box-shadow:0 6px 16px #0008;pointer-events:none}.command-layout[data-command-intent]:not([data-command-intent=""]) .command-status{display:block}.command-layout #input-feedback{bottom:48px}
 .command-layout[data-control-mode="direct"] .skillbar,.command-layout[data-control-mode="direct"] .command-order-grid{display:none}.command-layout[data-control-mode="direct"] .touch-controls{display:flex}.command-layout .touch-skills .action-label{font-size:9px}.command-layout .touch-skills .action-status{font-size:8px}
 .command-layout .renderer-note{display:none}
}
/* Short landscape phones: bar and encounter strip share one 44px row; the dock is one row of 44px controls. */
@media(max-height:550px) and (orientation:landscape){
 .raid-portal #game-screen.command-layout{grid-template-columns:auto minmax(0,1fr);grid-template-rows:44px minmax(0,1fr) auto}
 .command-layout .game-top{grid-column:1;grid-row:1;height:44px;min-height:44px;padding:0 6px;gap:6px;border-bottom:1px solid var(--command-bronze)}.command-layout .game-top>div{gap:6px}.command-layout .game-top .icon-btn{height:44px;width:44px}.command-layout .game-top>div:first-child>div,.command-layout .game-top .chip,.command-layout #gate-dots{display:none}.command-layout #battle-time{font-size:10px}
 .command-layout .encounter-header{grid-column:2;grid-row:1;height:44px;border-left:1px solid #7470556e}.command-layout .battle-wrap{grid-column:1/-1;grid-row:2}.command-layout .command-dock.bottom-hud{grid-column:1/-1;grid-row:3}
 .command-layout .boss-hud{height:100%;min-height:0;padding:0 6px 0 10px;grid-template-columns:minmax(118px,.7fr) minmax(0,1.6fr);gap:10px}.command-layout .boss-name{margin-bottom:3px;flex-wrap:nowrap;white-space:nowrap;overflow:hidden}.command-layout .boss-name strong{font-size:11px;overflow:hidden;text-overflow:ellipsis}.command-layout .boss-sub,.command-layout .guide-label{display:none}.command-layout .guide-weakness{margin-top:2px}
 .command-layout .combat-guide{gap:6px}.command-layout .guide-cells{gap:8px}.command-layout .guide-cell+.guide-cell{padding-left:8px}.command-layout .guide-cell strong{font-size:10px;line-height:1.3}.command-layout #guide-details-toggle{min-height:44px;width:44px;font-size:9px}
 .command-layout .command-dock.bottom-hud{grid-template-columns:68px auto minmax(0,1fr);gap:8px;padding:5px 8px max(5px,env(safe-area-inset-bottom));border-top-width:2px;align-items:center}
 .command-map-panel,.command-unit-panel{padding:0;border:0}.command-map-panel .command-panel-heading,.map-legend{display:none}.command-layout #command-minimap{max-height:none}
 .command-build-panel{display:none}.command-layout .command-inventory-toggle{display:block}.command-layout[data-inventory-open="true"] .command-build-panel{display:block;position:absolute;right:10px;bottom:calc(100% + 8px);width:220px;background:#252e20;padding:12px;border:1px solid var(--command-gold);box-shadow:0 8px 20px #0008;z-index:35}
 .command-unit-panel>.command-panel-heading,.command-layout .player-vitals,#class-combat-status,#command-selection-sub,#command-unit-stats{display:none}.command-selected{width:136px;grid-template-columns:36px minmax(0,1fr);gap:6px}#command-portrait-wrap{height:36px;border-width:1px}#command-portrait-fallback .class-icon{width:26px;height:26px}.command-unit-copy>strong{font-size:10px}.selection-health{height:4px;margin:3px 0}.command-unit-copy #command-selection-hp{font-size:8px}
 .command-layout[data-party-size]:not([data-party-size="1"]) .command-selected{display:none}.command-party{margin:0;gap:4px}.command-party button{min-height:44px;padding:3px}.command-party button>span:first-child,.command-party small{font-size:7px}
 .command-actions-panel{display:flex;align-items:center;gap:8px;min-width:0}.command-actions-panel>.command-panel-heading{display:none}.command-order-grid{flex:0 0 auto;width:min(40%,252px);margin:0;gap:5px}.command-layout .command-order-grid button{height:44px;min-height:44px;display:flex;align-items:center;justify-content:center;gap:4px;padding:2px;font-size:10px;white-space:nowrap}.command-order-grid kbd{margin:0;font-size:9px}
 .command-layout .skillbar{flex:1 1 0;min-width:0;grid-template-columns:repeat(6,minmax(44px,1fr));gap:5px}.command-layout .skill{height:44px}.command-layout .skill kbd{font-size:8px}.command-layout .skill small{font-size:7px}.command-layout .skill .skill-icon{font-size:14px}
 .command-layout .command-status{display:none;position:absolute;right:8px;bottom:calc(100% + 6px);z-index:20;max-width:min(420px,70vw);margin:0;padding:5px 9px;min-height:0;font-size:11px;line-height:1.4;color:var(--command-ink);background:#1b231af2;border:1px solid #a78d54;border-radius:3px;pointer-events:none}.command-layout[data-command-intent]:not([data-command-intent=""]) .command-status{display:block}
 .command-layout[data-control-mode="direct"] .skillbar,.command-layout[data-control-mode="direct"] .command-order-grid{display:none}.command-layout[data-control-mode="direct"] .touch-controls{display:flex;flex:1 1 auto;min-height:0;height:auto}.command-layout #joystick{flex:0 0 58px;width:58px;height:58px}.command-layout #joystick-thumb{width:28px;height:28px;left:14px;top:14px}
 .raid-portal .command-layout .touch-skills{flex:1 1 auto;width:auto;max-width:520px;grid-template-columns:1.3fr repeat(6,minmax(44px,1fr));gap:5px}.raid-portal .command-layout .touch-skills button.touch-attack[data-action]{grid-area:auto;height:44px;border-radius:10px}
 .command-layout .renderer-note{display:none}
}
@media(max-width:740px) and (max-height:550px) and (orientation:landscape){
 .command-layout #game-sound,.command-map-panel,.command-order-grid kbd{display:none}.command-layout .command-dock.bottom-hud{grid-template-columns:auto minmax(0,1fr)}.command-selected{width:118px}
}
/* Coarse-pointer tablets need the same direct controls as narrow phones. */
@media(pointer:coarse){
 .command-layout[data-control-mode="direct"] .skillbar{display:none}
 .command-layout[data-control-mode="direct"] .touch-controls{display:flex}
}
