/* Small-screen play only. Desktop has no smallMode attribute and keeps its existing layout. */
#small-panel{display:none}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-panel[hidden],body:has(#game-screen[data-small-mode]):not(.home-mode) #mobile-info[hidden]{display:none!important}
body:not(.home-mode) #app-shell #game-screen[data-small-mode]{--small-paper:#fdf6e4;--small-ink:#22385a}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] .game-layout{gap:12px;align-items:start}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #field-hud{margin-bottom:12px}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-panel{display:flex;flex-direction:column;gap:10px;min-width:0;color:var(--small-ink)}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info{min-height:0;display:flex;flex-direction:column;gap:10px}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info>.sidebar{position:static;display:flex;flex:none;flex-direction:column;gap:8px;width:100%;height:auto;max-height:none;min-height:0;margin:0;padding:10px;overflow:visible;border:2px solid var(--small-ink);border-radius:12px;background:var(--small-paper);box-shadow:0 3px 0 var(--small-ink);box-sizing:border-box}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info>.sidebar[hidden]{display:none}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info>.sidebar>:not(#intel-fold,#sidebar-orders){display:none}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info #intel-fold{display:block;margin:0;padding:0;border:0;background:none;box-shadow:none;overflow:visible;flex:none}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info #intel-fold>summary{display:none}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info .intel-panel{display:block;padding:0;line-height:1.4}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info .selected-heading{display:flex;align-items:center;gap:8px;padding-bottom:8px}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info .selected-heading canvas{width:48px;height:48px;flex:none}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info #selected-name{font:800 22px/1.1 var(--font-heading)}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info #selected-sub{font-size:12px;line-height:1.3;white-space:normal}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info :is(.intel-close,.intel-details){width:44px;height:44px;min-height:44px;flex:none;border:2px solid var(--small-ink);border-radius:9px;background:var(--small-paper);color:var(--small-ink)}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info #unit-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:8px 0;padding:0;border:0}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info #unit-stats:empty{display:none}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info #unit-stats>.metric-card{display:flex;flex-direction:column!important;align-items:center;justify-content:center;gap:4px;min-width:0;padding:6px 4px;border:1px solid #d8c7a2;border-radius:8px;background:#fff9ec}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info #unit-stats strong{font-size:17px}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info .metric-name{position:static;width:auto;height:auto;clip-path:none;overflow:visible;font-size:10px;line-height:1.2}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info :is(#terrain-info,#forecast,#intel-alert,#engineer-capabilities){display:block;grid-column:auto;grid-row:auto;margin:6px 0 0;padding:7px;font-size:13px;line-height:1.4;white-space:normal;background:#efe3c4;border-radius:8px}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info [hidden]{display:none!important}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-panel #map-dock{position:static;display:flex;flex:none;flex-direction:column;gap:8px;width:auto;max-width:none;min-width:0;margin:0;transform:none;pointer-events:auto}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-panel #map-dock>details{position:static;display:block;flex:none;width:auto;overflow:visible}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-panel #map-dock>details>summary{color:var(--small-ink);min-height:44px;display:flex;align-items:center;gap:8px;padding:0 10px;border:2px solid var(--small-ink);border-radius:12px;background:var(--small-paper);font-size:14px;cursor:pointer}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-panel #map-dock .fold-label{position:static;width:auto;height:auto;clip:auto;clip-path:none;overflow:visible;white-space:normal}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-panel #map-dock .sheet-body{position:static;width:auto;max-height:none;transform:none;overflow:visible;margin-top:5px;padding:10px;background:var(--small-paper);border:1px solid #d8c7a2;border-radius:8px;font-size:13px;line-height:1.4}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-panel #map-dock>details:not([open])>.sheet-body{display:none}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-panel #map-dock>#commander-fold>summary{display:none}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-controls{flex:none;display:flex;flex-direction:column;gap:8px;padding:0 0 4px}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-controls .zoom{position:static;inset:auto;display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:8px;width:100%;height:auto;margin:0;padding:0;background:none;pointer-events:auto}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-controls .zoom button{width:auto;height:44px;min-height:44px;min-width:44px;margin:0;padding:0 8px;border:2px solid var(--small-ink);border-radius:12px;background:var(--small-paper);color:var(--small-ink);font:800 16px/1.1 var(--font-heading)}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-controls #mobile-orders{position:static;inset:auto;display:grid;grid-template-columns:1fr 1fr;gap:8px;width:100%;margin:0;padding:0;border:0;background:none}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-controls #mobile-orders button{min-height:56px;min-width:44px;margin:0;padding:8px;border:2px solid var(--small-ink);border-radius:12px;font:800 19px/1.15 var(--font-heading);white-space:normal}
/* Les deux mots de « Tour adverse » tiennent aussi dans la colonne étroite du paysage. */
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #mobile-orders button#mobile-end{display:grid;place-items:center;padding-inline:2px;text-align:center;text-wrap:balance}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-controls #mobile-info{display:none}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-panel #quick-actions{position:static!important;inset:auto!important;width:100%;height:auto;max-height:none;display:grid;grid-auto-flow:row;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:8px;margin:0;padding:0;border:0;background:none;box-shadow:none;overflow:visible}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-panel #quick-actions:empty{display:none}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-panel #quick-actions button{width:auto;min-width:0;min-height:44px;padding:8px;white-space:normal;text-align:center;font-size:14px;overflow:visible}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-panel #sidebar-orders{order:0;margin:0;padding:0}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=portrait] .game-layout{display:flex;flex-direction:column;gap:14px}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=portrait] .board-section{width:100%;margin:0}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=portrait] #small-panel{width:100%}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=portrait] #viewport{height:var(--board-h);min-height:0;max-height:none;aspect-ratio:auto}
body:has(#game-screen[data-small-mode=portrait]):not(.home-mode){padding-bottom:max(12px,env(safe-area-inset-bottom,0px))}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=landscape] .game-layout{display:grid;grid-template-columns:minmax(0,1fr) clamp(200px,28vw,272px);gap:12px;align-items:stretch}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=landscape] #small-panel{height:100%;min-height:0;overflow:hidden}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=landscape] #small-info{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 3px 4px 0}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=landscape] #small-info .selected-heading{display:grid;grid-template-columns:48px minmax(0,1fr) 44px 44px;gap:8px}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=landscape] #small-info .selected-heading canvas{grid-column:1;grid-row:1}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=landscape] #small-info .selected-heading>div{grid-column:2/-1;grid-row:1}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=landscape] #small-info .intel-details{grid-column:3;grid-row:2}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=landscape] #small-info .intel-close{grid-column:4;grid-row:2}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=landscape] .map-shell{height:100%}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=landscape] #viewport{height:100%;min-height:0;max-height:none}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded][data-inline-info=false] #small-panel{display:none}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] #viewport{height:var(--board-h);min-height:0;max-height:none;aspect-ratio:auto}
body:has(#game-screen[data-small-mode=expanded]):not(.home-mode) #mobile-info{display:inline-flex!important;align-items:center;justify-content:center}
body:has(#game-screen[data-small-mode=expanded]):not(.home-mode)>#mobile-orders{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:8px 10px calc(8px + env(safe-area-inset-bottom,0px))}
body:has(#game-screen[data-small-mode=expanded]):not(.home-mode)>#mobile-orders button{min-width:44px;min-height:56px;white-space:normal;font:800 18px/1.1 var(--font-heading)}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] .map-shell>#quick-actions.docked{grid-auto-flow:row;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:45dvh;overflow:auto}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] .map-shell>#quick-actions.docked button{min-width:44px;min-height:44px;white-space:normal}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] .map-shell>#quick-actions.docked .build-order{display:none}
#small-info-dialog{width:min(440px,calc(100vw - 16px));max-height:calc(100dvh - 16px)}
#small-info-dialog>.sidebar{display:flex;flex-direction:column;width:auto;height:auto;max-height:none;overflow:visible;padding:12px}
#small-info-dialog>.sidebar>:not(#intel-fold,#sidebar-orders){display:none}
#small-info-dialog #intel-fold{display:block;margin:0;border:0;background:none;box-shadow:none}
#small-info-dialog #intel-fold>summary{display:none}
#small-info-dialog .intel-panel{padding:0}
#small-info-dialog #quick-actions{position:static!important;inset:auto!important;display:flex;flex-wrap:wrap;width:auto;max-width:none;gap:8px;margin-top:10px;padding:0;background:none;border:0;box-shadow:none}
#small-info-dialog #quick-actions button{min-width:44px;min-height:44px;white-space:normal}
#small-info-dialog #quick-actions .build-order{display:none}

body:not(.home-mode) #app-shell #game-screen[data-small-mode=portrait] #small-controls{position:static;padding:8px 0 max(8px,env(safe-area-inset-bottom,0px));border-top:1px solid #d8c7a2}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=portrait] #field-hud{width:100%;margin:0 0 12px}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-panel #objectives-fold>summary{justify-content:flex-start}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-panel #objectives-fold>summary .fold-label{margin-left:0}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info .selected-heading>div{min-width:0;flex:1}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info #selected-name{white-space:normal;overflow-wrap:anywhere}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-controls:empty{display:none}

/* Commander details are transient; economy, day and gauges remain in the HUD during zoom. */
#small-commander-dialog{width:min(420px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:12px;border:2px solid #22385a;border-radius:14px;background:#fdf6e4;color:#22385a;box-shadow:0 5px 0 #22385a,0 12px 32px #10243844}
#small-commander-dialog::backdrop{background:#10243855}
#small-commander-dialog .modal-head{position:static;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 0 10px}
#small-commander-dialog .modal-head h2{font:800 24px/1.1 var(--font-heading);margin:0}
#small-commander-dialog .close-modal{position:static;width:44px;min-width:44px;height:44px;padding:0;border:2px solid #22385a;border-radius:9px;background:#fdf6e4;color:#22385a}
#small-commander-dialog #commander-fold{display:block;width:100%;margin:0;border:0;padding:0;background:none;box-shadow:none}
#small-commander-dialog #commander-fold>summary{display:none}
#small-commander-dialog .sheet-body{position:static;display:flex;flex-direction:column;gap:10px;width:auto;max-height:none;margin:0;padding:0;transform:none;overflow:visible;font-size:14px;line-height:1.45}
#small-commander-dialog .commander{display:grid;grid-template-columns:80px minmax(0,1fr);gap:8px;height:auto;min-height:0;padding:8px;box-shadow:none}
#small-commander-dialog .commander-art{position:static;width:80px;height:80px}
#small-commander-dialog .commander-label{position:static;align-self:center;min-width:0}
#small-commander-dialog .commander-label small{display:block;font-size:10px;letter-spacing:0}
#small-commander-dialog .commander-label h2{font:800 30px/1.1 var(--font-heading);margin:2px 0}
#small-commander-dialog .commander-label>span{font-size:11px;letter-spacing:0}
#small-commander-dialog .commander-quote{position:static;grid-column:1/-1;padding:8px;border-radius:5px;font-size:13px;line-height:1.4}
#small-commander-dialog .commander-power{color:#22385a}
#small-commander-dialog .commander-power p{margin:5px 0 0}
#small-commander-dialog .commander-talents{margin:0;color:#22385a}
#small-commander-dialog #talent-open{min-height:44px}

/* Landscape uses the full map width after zoom; the physical right rail is hidden. */
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] .game-layout{display:block;min-height:0}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] :is(.board-section,.map-shell,#viewport){height:100%;min-height:0;max-height:none}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] #map-orders{position:absolute;right:10px;bottom:10px;width:min(340px,52vw);max-width:calc(100% - 20px);display:block;padding:0;background:none;border:0;box-shadow:none;pointer-events:none}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] #map-orders #mobile-orders{position:static;inset:auto;display:grid;grid-template-columns:1fr 1fr;gap:8px;width:100%;margin:0;padding:0;border:0;background:none;pointer-events:auto}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] #mobile-orders button{min-width:44px;min-height:56px;padding:8px;font:800 18px/1.1 var(--font-heading);white-space:normal}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] #mobile-info{font-size:0}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] #mobile-info .stat-icon{width:22px;height:22px;flex:none}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] #mobile-info>span[data-i18n]{display:none}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] #map-hud>.zoom{position:absolute;right:10px;top:48px;bottom:auto;left:auto;display:flex;flex-direction:column;align-items:stretch;gap:8px;width:44px;pointer-events:none}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] #map-hud>.zoom button{width:44px;min-width:44px;height:44px;min-height:44px;pointer-events:auto}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] #map-hud>.zoom #zoomfit{width:44px;min-width:44px;font-size:12px;line-height:1.1;white-space:normal;padding:4px}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] #map-dock{left:10px;bottom:10px;max-width:calc(48% - 30px)}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] #objectives-fold .fold-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}

/* A readable card fills the remaining cream area at intermediate portrait zooms. */
body:not(.mobile-landscape):not(.home-mode) #app-shell #game-screen[data-small-mode] #small-panel{display:flex;width:100%;min-height:var(--portrait-info-h,0px)}
body:not(.mobile-landscape):not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info{flex:1}
body:not(.mobile-landscape):not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info>.sidebar{flex:none}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] .intel-details,#small-info-dialog .intel-details{display:none!important}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] .intel-close,#small-info-dialog .intel-close{display:none!important}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info #selected-description,#small-info-dialog #selected-description{display:block;margin:10px 0 0;padding:9px 0 0;border-top:1px solid #d8c7a2;font-size:13px;line-height:1.45;white-space:pre-line;color:#22385a}
/* Keep the fitted portrait card at its content height; spare height belongs to the readable journal. */
body:not(.mobile-landscape):not(.home-mode) #app-shell #game-screen[data-small-mode=portrait] #small-panel{min-height:0}
body:not(.mobile-landscape):not(.home-mode) #app-shell #game-screen[data-small-mode=portrait] #small-info{flex:none}
body:not(.mobile-landscape):not(.home-mode) #app-shell #game-screen[data-small-mode=portrait] #small-info>.sidebar{flex:none}
:is(body:not(.mobile-landscape):not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info,#small-info-dialog) .intel-panel[data-kind=terrain]{display:grid;grid-template-columns:minmax(0,1fr) minmax(116px,.72fr);gap:8px 12px;align-items:center}
:is(body:not(.mobile-landscape):not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info,#small-info-dialog) .intel-panel[data-kind=terrain] #intel-kicker{grid-column:1/-1;margin:0;padding:5px 8px;font-size:11px;letter-spacing:1.2px}
:is(body:not(.mobile-landscape):not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info,#small-info-dialog) .intel-panel[data-kind=terrain] .selected-heading{grid-column:1;grid-row:2;min-width:0;margin:0;padding:0}
:is(body:not(.mobile-landscape):not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info,#small-info-dialog) .intel-panel[data-kind=terrain] .selected-heading>div{min-width:0}
:is(body:not(.mobile-landscape):not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info,#small-info-dialog) .intel-panel[data-kind=terrain] #terrain-info{grid-column:2;grid-row:2;align-self:stretch;margin:0;min-width:0;padding:8px;font-size:12px}
:is(body:not(.mobile-landscape):not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info,#small-info-dialog) .intel-panel[data-kind=terrain] #terrain-info b{float:right;display:inline;line-height:1.1}
:is(body:not(.mobile-landscape):not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info,#small-info-dialog) .intel-panel[data-kind=terrain]>:is(#selected-description,#intel-alert,#forecast){grid-column:1/-1}
:is(body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info,#small-info-dialog) #selected-description:empty{display:none}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #log-fold[open] #log-summary{display:none}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info #log-fold>.sheet-body{box-sizing:border-box;max-height:max(96px,var(--journal-h,200px));overflow:auto;overscroll-behavior:contain}
body:not(.home-mode) #app-shell #game-screen[data-small-mode][data-roomy-journal=true] #small-info #log-fold>.sheet-body{box-sizing:border-box;max-height:var(--journal-h);overflow:auto;overscroll-behavior:contain}
body:not(.home-mode) #app-shell #game-screen[data-small-mode][data-roomy-journal=true] #small-info #log-fold .battle-log{max-height:none;overflow:visible}
@media(max-width:360px){
 :is(body:not(.mobile-landscape):not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info,#small-info-dialog) .intel-panel[data-kind=terrain]{grid-template-columns:minmax(0,1fr)}
 :is(body:not(.mobile-landscape):not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info,#small-info-dialog) .intel-panel[data-kind=terrain] #terrain-info{grid-column:1;grid-row:3}
 :is(body:not(.mobile-landscape):not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info,#small-info-dialog) .intel-panel[data-kind=terrain] #terrain-info b{float:right;display:inline}
}
body:not(.mobile-landscape):not(.home-mode) #app-shell #game-screen[data-small-mode=expanded][data-inline-info=true] #small-panel{height:var(--portrait-info-h);min-height:160px;overflow:hidden}
body:not(.mobile-landscape):not(.home-mode) #app-shell #game-screen[data-small-mode=expanded][data-inline-info=true] #small-info{overflow:auto;overscroll-behavior:contain}

/* Mobile map tools: one flag and one information icon, each retaining a 44 px touch target. */
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #objectives-fold>summary{width:44px;height:44px;min-width:44px;min-height:44px;padding:0;justify-content:center;box-sizing:border-box}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #objectives-fold>summary .fold-label,
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #objectives-fold>summary::after{display:none}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] :is(#mobile-info,#objectives-fold>summary){display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;flex:0 0 44px;align-self:flex-start;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:2px solid #22385a;border-radius:12px;background:#fdf6e4e6;color:#22385a;box-shadow:0 3px 0 #22385acc;font-size:0;pointer-events:auto}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #mobile-info>span[data-i18n]{display:none}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] :is(#mobile-info .map-tool-icon,#objectives-fold .objectives-icon){width:20px;height:20px;flex:none;color:inherit}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] #map-dock>#objectives-fold{flex:0 0 44px;width:44px}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] #map-dock>#log-fold{flex:1;min-width:0}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] #map-hud :is(.zoom button,#objectives-fold>summary,#log-fold>summary){background:#fdf6e4e6;box-shadow:0 3px 0 #22385acc}
/* Info sits beside the flag in the expanded view: same floating shadow (graphics-controls smoke). */
body:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] #map-hud #mobile-info{box-shadow:0 3px 0 #22385acc}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] #mobile-next{background:#f7d77be6}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] #mobile-end{background:#ed792fe6}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] .map-shell>#quick-actions:not(.docked){box-sizing:border-box;background:#142e42e6}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] .map-shell>#quick-actions:not(.docked) button{background:#f7edcce6}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] .map-shell>#quick-actions:not(.docked) .attack{background:#f6b193e6}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] .map-shell>#quick-actions:not(.docked) .capture{background:#c7e5b1e6}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] .map-shell>#quick-actions:not(.docked) .undo{background:#d8e3e5e6}

/* Portrait starts with an unobtrusive objective flag on the board; the information card stays below it. */
#portrait-map-tools{display:none}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=portrait] #portrait-map-tools{display:flex;position:absolute;left:10px;bottom:10px;z-index:6;pointer-events:none}
#portrait-map-tools:empty{display:none!important}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=portrait] #portrait-map-tools>.fold{position:static;width:44px;min-width:44px;margin:0;padding:0;border:0;background:none;box-shadow:none;overflow:visible}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=portrait] #portrait-map-tools summary{display:flex;align-items:center;border:2px solid #22385a;border-radius:12px;background:#fdf6e4e6;color:#22385a;box-shadow:0 3px 0 #22385acc;pointer-events:auto}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=portrait] #portrait-map-tools .sheet-body{position:absolute;bottom:calc(100% + 10px);left:0;width:min(340px,calc(100vw - 48px));max-height:min(300px,60dvh);overflow:auto;box-sizing:border-box;margin:0;padding:12px;border:2px solid #22385a;border-radius:12px;background:#fdf6e4;color:#22385a;box-shadow:0 3px 0 #22385a;font:500 14px/1.45 var(--font-ui);pointer-events:auto}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=portrait] #portrait-map-tools details:not([open])>.sheet-body{display:none}
/* An intermediate zoom can keep both the natural-height information card and its journal below the board. */
body:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded][data-inline-info=true] #portrait-map-tools{position:absolute;left:10px;bottom:10px;z-index:6;display:flex;gap:8px;align-items:flex-end;pointer-events:none}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded][data-inline-info=true] #portrait-map-tools #objectives-fold{width:44px;flex:none;margin:0;padding:0;background:none;border:0;box-shadow:none;overflow:visible}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded][data-inline-info=true] #portrait-map-tools #objectives-fold>summary{border:2px solid #22385a;border-radius:12px;background:#fdf6e4e6;box-shadow:0 3px 0 #22385acc;pointer-events:auto}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded][data-inline-info=true] #portrait-map-tools .sheet-body{position:absolute;bottom:54px;left:0;width:min(340px,calc(100vw - 48px));max-height:min(300px,60dvh);overflow:auto;padding:12px;border:2px solid #22385a;border-radius:12px;background:#fdf6e4;pointer-events:auto}
/* Téléphone portrait : zoom, unités à jouer et fin du tour restent visibles en bas de l'écran quand la fiche
   d'unité allonge la page (avant : Fin du tour passait sous le pli dès qu'une unité était choisie, et toujours
   à 360 × 740). */
body:not(.home-mode) #app-shell #game-screen[data-small-mode=portrait] #small-controls{position:sticky;bottom:0;z-index:4;padding:8px 0 calc(8px + env(safe-area-inset-bottom,0px));border-radius:12px 12px 0 0;background:#e9d7b0;box-shadow:0 -6px 12px -6px #22385a40}
/* Nom d'unité ou de bâtiment : coupure entre syllabes, avec trait d'union, plutôt qu'au milieu d'un mot
   (« Headquarter / s » dans le panneau étroit du paysage bas). */
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info #selected-name{overflow-wrap:break-word;hyphens:auto}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=landscape] #small-info #selected-name{font-size:19px}
/* Ordres sur petit écran : un peu d'air entre les boutons et avec les bords du panneau (les ombres portées se
   touchaient). */
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-controls .zoom,body:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-controls #mobile-orders{column-gap:12px}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=portrait] #small-controls{padding-left:12px;padding-right:12px}
/* Plus d'air vertical seulement quand la hauteur le permet (320 × 568 n'a pas un pixel de trop). */
@media(min-height:640px){body:not(.home-mode) #app-shell #game-screen[data-small-mode=portrait] #small-controls{gap:12px;padding-top:12px;padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))}}
/* Petit écran, unité sélectionnée (hud-layout.js) : les boutons posés sur la carte s'effacent ; le menu d'ordres, la
   pastille des coordonnées et la barre du bas restent. */
body.hud-aiming:not(.home-mode) #app-shell #game-screen[data-small-mode] :is(#tactical-tools,#portrait-map-tools),body.hud-aiming:not(.home-mode) #app-shell #game-screen[data-small-mode=portrait] #small-controls .zoom{opacity:0!important;pointer-events:none!important}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] :is(#tactical-tools,#portrait-map-tools),body:not(.home-mode) #app-shell #game-screen[data-small-mode=portrait] #small-controls .zoom{transition:opacity .16s ease}
@media(prefers-reduced-motion:reduce){body:not(.home-mode) #app-shell #game-screen[data-small-mode] :is(#tactical-tools,#portrait-map-tools),body:not(.home-mode) #app-shell #game-screen[data-small-mode=portrait] #small-controls .zoom{transition:none}}
/* Audit des écrans de jeu (13 novembre 2026), téléphone en paysage : Objectifs et Journal passent côte à côte sous la
   fiche pour rester visibles sans défilement ; la fiche se resserre de quelques pixels ; les libellés des mesures
   ne sont plus coupés par un trait d'union. */
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info{gap:8px}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info>.sidebar{padding:4px 8px;gap:4px}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info .selected-heading{padding-bottom:2px}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-panel #map-dock{flex-direction:row;flex-wrap:wrap;gap:6px}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-panel #map-dock>details{flex:1 1 0;min-width:0}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-panel #map-dock>#objectives-fold:not([open]){flex:0 0 auto}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-panel #map-dock .fold-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-panel #map-dock>details[open]{flex:1 1 100%}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-panel #map-dock>details>summary{overflow:hidden;white-space:nowrap}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode] #small-info #unit-stats>.metric-card :is(span,small,b){hyphens:manual;overflow-wrap:normal;word-break:normal;font-size:9px;letter-spacing:0}
/* Fit the unit's three named metrics above the landscape controls. */
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode=landscape] #small-info #unit-stats{grid-template-columns:auto 1fr auto;gap:4px;margin:4px 0}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode=landscape] #small-info #unit-stats>.metric-card{padding:4px;gap:2px}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode=landscape] #small-info #unit-stats .stat-icon{display:none}
body.mobile-landscape:not(.home-mode) #app-shell #game-screen[data-small-mode=landscape] #small-info #unit-stats strong{font-size:15px;line-height:1.2}
/* 21 novembre 2026 : avec un objectif chiffré (Conquête, Course aux villes, Trésor…), le drapeau des objectifs s'élargit
   pour porter le score condensé (▲ 2 · ◆ 1 / 3). Le bandeau détaillé reste dans le pli, au-dessus des objectifs. */
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #objectives-fold:has(.objectives-score:not([hidden])){width:auto;min-width:44px;flex:0 0 auto}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #objectives-fold:has(.objectives-score:not([hidden]))>summary{width:auto;flex:0 0 auto;gap:6px;padding:0 10px}
body:not(.home-mode) #app-shell #game-screen[data-small-mode] #objectives-fold>summary .objectives-score{margin:0;padding:0;border:0;background:none;font:800 13px/1 var(--font-ui);color:inherit}
/* 22 novembre 2026 : même chose en vue agrandie (bouton seul en bas du plateau, avec ou sans fiche en ligne), où une
   largeur fixe de 44 px coupait le score (« drapeau illisible » sur Samsung). */
body:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] #map-dock>#objectives-fold:has(.objectives-score:not([hidden])),
body:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded][data-inline-info=true] #portrait-map-tools #objectives-fold:has(.objectives-score:not([hidden])){flex:0 0 auto;width:auto}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=expanded] #objectives-fold:has(.objectives-score:not([hidden]))>summary{flex:0 0 auto;width:auto;gap:6px;padding:0 10px}
/* Paysage (21 novembre 2026) : la fiche de case défile seule ; la rangée Objectifs/Journal reste entière sous elle, au
   lieu d'être coupée par le bas de la zone défilante quand la fiche est grande. */
body:not(.home-mode) #app-shell #game-screen[data-small-mode=landscape] #small-info{overflow:hidden}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=landscape] #small-info>.sidebar{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain}
body:not(.home-mode) #app-shell #game-screen[data-small-mode=landscape] #small-info>#map-dock{flex:none}
