/* The battle viewport has its own orthographic, full-bleed 2D surface. */
#siege-scene{display:none;position:absolute;inset:48px 0 62px;width:100%;height:calc(100% - 110px);touch-action:none;z-index:1}
#siege-status{display:none;position:absolute;top:49px;left:8px;right:8px;z-index:3;pointer-events:none;justify-content:space-between;gap:8px;color:#eee3be;text-shadow:0 1px 3px #000;font-size:11px}
body[data-siege="true"] #siege-scene{display:block}body[data-siege="true"] #scene{visibility:hidden}body[data-siege="true"] #order-hud,body[data-siege="true"] #selection-hud,body[data-siege="true"] #mission-hud{display:none}body[data-siege="true"] #siege-status{display:flex}body[data-siege="true"] #hint{bottom:66px;top:auto;max-width:85%;font-size:11px;pointer-events:none}body[data-siege="true"] #controls{height:60px;min-height:60px;left:0;right:0;bottom:0;padding:4px 8px;display:flex;justify-content:space-between;gap:6px;background:linear-gradient(#202b2b,#131d20);border-top:1px solid #968255;box-shadow:0 -3px 10px #0006;z-index:5}body[data-siege="true"] #hud{z-index:5}body[data-siege="true"] #app:after{pointer-events:none}
.siege-crew,.siege-buttons{display:flex;gap:5px;align-items:center;min-width:0}.siege-buttons button{width:44px;height:44px;min-width:44px;padding:7px}.siege-buttons .heroic-icon{width:26px;height:26px}.siege-hero{position:relative;width:55px;min-width:44px;height:50px;padding:0!important;background:#192827!important;overflow:hidden;border:1px solid #536556!important}.siege-hero.selected{border-color:#f1d392!important;background:#4b4a34!important}.siege-hero img{width:38px;height:37px;object-fit:contain;display:block;margin:auto}.siege-hero span{position:absolute;left:1px;right:1px;bottom:3px;font-size:9px;line-height:11px;text-align:center;text-shadow:0 1px 2px #000;overflow:hidden;white-space:nowrap}.siege-hero i{position:absolute;bottom:0;left:0;right:0;height:3px;background:linear-gradient(to right,#79d5ae var(--hp),#352b27 var(--hp))}.siege-hero:disabled{filter:grayscale(1);opacity:.45}.siege-phase{font-weight:bold;color:#ffdc92}
#siege-dialog{width:min(760px,calc(100vw - 12px));max-width:none;max-height:calc(100dvh - 16px);padding:12px;overflow:hidden;color:#eee3c2;background:linear-gradient(135deg,#283432,#172424);border:1px solid #aa8e59;border-radius:7px}#siege-dialog[open]{display:flex;flex-direction:column;gap:9px}#siege-dialog .panel-top{min-height:44px;margin:0;flex-shrink:0;gap:10px}#siege-dialog h2{font-size:18px;margin:0}#siege-dialog .panel-top button{width:44px;height:44px;padding:9px;min-width:44px}#siege-dialog .heroic-icon{width:23px;height:23px;vertical-align:middle}#siege-dialog .siege-note{margin:0;font-size:12px;line-height:1.35}#siege-dialog .siege-note .heroic-icon{width:17px;height:17px}.siege-command-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;overflow:auto;min-height:0}.siege-command-grid button{display:flex;align-items:center;gap:8px;min-height:56px;text-align:left;padding:7px;background:#35463d;border:1px solid #6e795d}.siege-command-grid button span{display:flex;flex-direction:column;min-width:0;gap:3px}.siege-command-grid b{font-size:13px}.siege-command-grid small{font-size:11px;line-height:1.25}.siege-scroll{overflow-y:auto;overscroll-behavior:contain;min-height:48px;max-height:calc(100dvh - 130px);scrollbar-width:thin;display:flex;flex-direction:column;gap:4px}.siege-list-row{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:46px;height:auto;flex-shrink:0;text-align:left;background:#273b34;border:1px solid #52694e;padding:5px 9px}.siege-list-row span{display:flex;flex:1;flex-direction:column;gap:3px}.siege-list-row b{font-size:12px}.siege-list-row small{font-size:11px}.siege-list-row img{width:38px;height:38px;object-fit:contain}.siege-list-row.broken{background:#452e2b;border-color:#8c5144}.siege-part-detail{display:grid;grid-template-columns:140px 1fr;gap:6px 14px;overflow:auto;min-height:0}.siege-part-detail p{margin:0;font-size:12px;line-height:1.45}.siege-part-detail p:last-child{grid-column:2}.siege-part-health{display:flex;flex-direction:column;gap:6px;grid-row:span 2}.siege-part-health b{font-size:20px}.siege-part-health progress{width:100%;accent-color:#9fc17f}.siege-part-health span{font-size:12px}.siege-detail-actions{display:flex;gap:6px;flex-wrap:wrap;flex-shrink:0}.siege-detail-actions button{min-height:44px;display:flex;gap:4px;align-items:center;padding:6px 9px;font-size:12px}.siege-detail-actions small{font-size:10px;max-width:100px;line-height:1.2}.siege-detail-actions button:disabled{opacity:.5}.wheel-repair-panel .repair-guard-layout{display:grid;grid-template-columns:1fr 1fr;gap:12px;font-size:12px}.repair-guard-layout p{margin:6px 0}.repair-guard-layout ul{padding-left:18px;margin:4px 0}.repair-guard-layout progress{width:100%;accent-color:#c2ab6f}.siege-log{font-size:11px}.wood-load{display:flex;align-items:center;gap:5px;flex-wrap:wrap;font-size:12px}.wood-load button{min-height:36px;padding:4px 7px}.wood-load .heroic-icon{width:19px;height:19px}
@media(max-height:360px){#siege-dialog{padding:8px;gap:6px}#siege-dialog h2{font-size:16px}.siege-command-grid{gap:4px}.siege-command-grid button{min-height:48px;padding:5px}.siege-command-grid small{font-size:10px}.siege-hero{width:46px}.siege-crew,.siege-buttons{gap:3px}body[data-siege="true"] #controls{padding:4px 6px}.siege-part-detail{grid-template-columns:120px 1fr;gap:5px 10px}}
@media(max-width:650px){.siege-hero{width:44px}.siege-crew,.siege-buttons{gap:3px}.siege-command-grid{grid-template-columns:repeat(3,minmax(0,1fr))}#siege-status{font-size:10px}.siege-buttons button{width:44px}.siege-command-grid button{gap:4px}}
.fresh-preparation .wood-load{margin-top:6px}.wood-load button{min-height:44px;padding:5px 9px;font-size:12px}.wood-load button small{font-size:10px}#siege-supplies{width:min(640px,calc(100vw - 16px));max-width:none;max-height:calc(100dvh - 16px);padding:12px;background:#233831;color:#f3e3bd;border:1px solid #b29660;border-radius:6px}#siege-supplies .panel-top{min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:10px}#siege-supplies h2{font-size:18px;margin:0}#siege-supplies p{font-size:12px;margin:8px 0}.supply-options{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.supply-options>div{display:flex;gap:6px;align-items:center;margin-right:auto}.supply-options>div small{font-size:11px;max-width:100px}.supply-options button{height:44px;min-width:44px}.supply-options .icon{width:21px;height:21px}
#panel .wheel-repair-panel{height:100%;max-height:100%;width:min(860px,99%);display:flex;flex-direction:column;gap:6px;padding:10px;overflow:hidden;text-align:left}#panel .wheel-repair-panel h2{font-size:19px;line-height:1.2;margin:0;flex:none;text-align:center}.wheel-repair-panel .repair-guard-layout{flex:1;min-height:0;overflow-y:auto;gap:14px;align-content:start}.wheel-repair-panel .repair-guard-layout p{font-size:11px;line-height:1.35;margin:3px 0}.wheel-repair-panel .repair-guard-layout ul{font-size:11px;line-height:1.3;margin:4px 0;padding-left:14px}.wheel-repair-panel .repair-guard-layout progress{display:block;height:8px;margin:3px 0}.wheel-repair-panel .icon{width:17px;height:17px}.wheel-repair-panel .encounter-actions{display:grid;grid-template-columns:1fr 1.25fr 1fr;gap:5px;flex:none;margin:0}.wheel-repair-panel .encounter-actions button{height:46px;min-width:44px;font-size:11px;padding:4px;gap:3px}.wheel-repair-panel .encounter-actions button small{display:block;font-size:9px;line-height:1.1}.wheel-repair-panel .encounter-actions button span{min-width:0}
.wheel-repair-panel .encounter-actions{grid-template-columns:1fr 1.25fr 1fr .9fr}.wheel-repair-panel [data-action=abandon-caravan]{border-color:#a97867;color:#f1b9a4}
body[data-siege="true"] #controls{height:calc(60px + env(safe-area-inset-bottom));padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right));padding-bottom:max(4px,env(safe-area-inset-bottom))}#siege-scene{bottom:calc(62px + env(safe-area-inset-bottom));height:calc(100% - 110px - env(safe-area-inset-bottom))}body[data-siege="true"] #hint{bottom:calc(66px + env(safe-area-inset-bottom))}
#siege-status>span:nth-child(2){min-width:0;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:center}#siege-status>span:first-child,#siege-status>span:last-child{flex-shrink:0}.siege-list-row.focused{border-color:#efd38c;background:#4a4933}
.siege-buttons button.siege-labelled{padding:2px;flex-direction:column;gap:0;line-height:1}.siege-labelled .icon{width:25px;height:25px}.siege-labelled small{font-size:9px;line-height:12px;max-width:100%;overflow:hidden;text-overflow:ellipsis}.siege-gate img{width:27px;height:27px;object-fit:contain}.siege-spell.waiting{opacity:.65}.siege-spell.ready{border-color:#a7c895}
.siege-spell.blocked{opacity:.65;border-color:#9d7765}
#siege-caravan{display:none;position:absolute;left:max(8px,env(safe-area-inset-left));top:76px;z-index:4;width:96px;padding:3px;background:#192722e8;border:1px solid #a58d56;border-radius:4px;box-shadow:0 2px 6px #0006}
body[data-siege="true"] #siege-caravan{display:block}
.siege-caravan-label{display:block;font-size:10px;text-align:center;color:#e5d3a2;line-height:13px}
#siege-caravan>div{display:flex;flex-direction:column;gap:2px}
#siege-caravan button{width:44px;min-width:44px;height:44px;padding:2px;display:flex;flex-direction:column;gap:0}
#siege-caravan .heroic-icon{width:25px;height:25px}
#siege-caravan small{font-size:8px;line-height:12px;white-space:nowrap}
#siege-caravan button:disabled{opacity:.65}
.siege-caravan-actions{display:flex;gap:6px;flex-shrink:0}
.siege-caravan-actions button{min-height:44px;padding:5px 10px;display:flex;gap:6px;align-items:center;font-size:12px}
body[data-siege="true"] #hint{left:auto;right:10px;max-width:calc(100% - 270px);text-align:right;white-space:normal;line-height:1.25;text-shadow:0 1px 2px #000,0 0 5px #000}
/* Full scenery under individually floating controls, never opaque menu rails. */
body[data-siege="true"] #siege-scene{inset:0;width:100%;height:100%}
body[data-siege="true"] #controls,body[data-siege="true"] #hud{background:none;border:0;box-shadow:none;pointer-events:none}
body[data-siege="true"] #controls button,body[data-siege="true"] #hud button{pointer-events:auto}
body[data-siege="true"] #controls{padding-top:0;height:calc(54px + env(safe-area-inset-bottom));min-height:54px;align-items:flex-end;padding-bottom:max(4px,env(safe-area-inset-bottom))}
body[data-siege="true"] #siege-caravan{background:none;border:0;box-shadow:none;padding:0;width:44px}
body[data-siege="true"] .siege-caravan-label{text-shadow:0 1px 2px #000,0 0 4px #000}
body[data-siege="true"] #game-frame::before,body[data-siege="true"] #game-frame::after{display:none}

/* Smaller painted fittings on phones; transparent 44px targets remain intact. */
@media (max-width:1000px) and (orientation:landscape){
 body[data-siege="true"] :is(#controls,#siege-caravan) button{
  position:relative;isolation:isolate;width:44px;min-width:44px;height:44px;
  border:0!important;background:none!important;box-shadow:none!important;
 }
 body[data-siege="true"] :is(#controls,#siege-caravan) button::before{
  content:'';position:absolute;inset:4px;z-index:-1;pointer-events:none;
  border:1px solid #b29461;border-radius:5px;
  background:linear-gradient(#5b361b1a,#190c1480),var(--hero-wood) center/240px;
  box-shadow:inset 0 1px #ffe8aa55,0 1px 2px #0007;
 }
 body[data-siege="true"] :is(#controls,#siege-caravan) button:hover:not(:disabled)::before{border-color:#ffe1a0;filter:brightness(1.18)}
 body[data-siege="true"] #controls button.gold::before{background:linear-gradient(#9e303a33,#370d2e55),var(--hero-red) center/240px;border-color:#ffdb8f}
 body[data-siege="true"] #controls .siege-hero::before{inset:2px 4px;background:#192827;border-color:#536556}
 body[data-siege="true"] #controls .siege-hero.selected::before{background:#4b4a34;border-color:#f1d392;box-shadow:inset 0 0 0 1px #eed59c55}
 body[data-siege="true"] #controls .siege-spell.ready::before{border-color:#a7c895}
 body[data-siege="true"] #controls .siege-spell.blocked::before{border-color:#9d7765}
 body[data-siege="true"] #controls .siege-hero img{width:29px;height:29px;margin:2px auto 0}
 body[data-siege="true"] #controls .siege-hero span{left:5px;right:5px;bottom:6px;font-size:8px;line-height:10px}
 body[data-siege="true"] #controls .siege-hero i{left:5px;right:5px;bottom:3px;height:3px}
 body[data-siege="true"] :is(.siege-buttons,#siege-caravan) button{padding:4px;gap:0}
 body[data-siege="true"] :is(.siege-buttons,#siege-caravan) .icon{width:21px;height:21px}
 body[data-siege="true"] :is(.siege-buttons,#siege-caravan) small{font-size:8px;line-height:11px}
 body[data-siege="true"] .siege-gate img{width:22px;height:22px}
 body[data-siege="true"] .siege-caravan-label{display:none}
 body[data-siege="true"] .hud-right>button>.icon{width:23px;height:23px}
 body[data-siege="true"] .hud-right>button::before{inset:0 5px 8px;border-top:1px solid #c3a46a;border-radius:5px}
}
/* Immediate spells/orders stay on the battlefield, not inside a modal chooser. */
.siege-buttons{position:relative}
.siege-cooldown{position:absolute;top:3px;right:4px;font:bold 10px/12px sans-serif;background:#1e2223dd;color:#ffe4b4;padding:0 2px;border-radius:3px}
.siege-orders-inline{position:absolute;bottom:50px;right:0;display:flex;gap:3px;padding:3px;background:#172922dc;border:1px solid #ac915c;border-radius:5px;pointer-events:auto}
.siege-orders-inline button{display:flex;flex-direction:column;flex:none}
#siege-dialog{position:fixed;margin:0;inset:67px auto 62px max(58px,env(safe-area-inset-left));width:min(260px,calc(100vw - 116px));height:auto;max-height:none;padding:7px;z-index:12;box-shadow:0 2px 8px #0007}
#siege-dialog[open]{gap:5px}
#siege-dialog h2{font-size:13px}
#siege-dialog .panel-top{gap:3px}
#siege-dialog .siege-caravan-actions{gap:3px}
#siege-dialog .siege-caravan-actions button{padding:3px;font-size:11px;min-width:44px;flex:1}
#siege-dialog .siege-note{font-size:10px;line-height:1.2}
#siege-dialog .siege-part-health{position:relative;display:grid;grid-template-columns:auto 1fr;gap:3px 7px;align-items:center;flex:none}
#siege-dialog .siege-part-health b{font-size:14px}
#siege-dialog .siege-part-health span{font-size:10px}
#siege-dialog .siege-part-health progress{height:7px;grid-column:2;grid-row:1}
#siege-dialog .siege-detail-actions{display:grid;grid-template-columns:1fr 1fr;gap:3px;margin-top:auto}
#siege-dialog .siege-detail-actions button{min-width:44px;min-height:44px;padding:3px;font-size:11px}
#siege-dialog .siege-detail-actions .icon{width:20px;height:20px}
#siege-dialog .siege-scroll{flex:1;max-height:none;min-height:0}
#siege-dialog .siege-list-row{min-height:44px;padding:3px 5px}
@media(max-height:300px){#siege-dialog{top:60px;bottom:54px}#siege-dialog .siege-part-health span{display:none}}
.map-camp{width:44px;height:44px;padding:2px!important;display:flex;flex-direction:column;gap:0;font-size:9px}
.road-controls > .map-camp .icon{width:23px;height:23px}
.field-camp-panel{width:min(900px,100%);max-height:100%;display:flex;flex-direction:column;gap:7px;padding:12px;overflow:hidden}
.field-camp-panel .panel-top{min-height:28px;flex:none;margin:0}
.field-camp-panel h2{font-size:21px;margin:0;display:flex;align-items:center;gap:7px}
.field-camp-panel .panel-top button{font-size:12px}
.field-camp-panel .camp-event{font-size:12px;line-height:1.25;margin:0;flex:none}
.camp-work{display:grid;grid-template-columns:1fr 1fr;gap:14px;min-height:0;overflow:auto}
.camp-work>section{min-width:0}
.camp-care{width:100%;min-height:44px;text-align:left;justify-content:flex-start;gap:7px;padding:5px}
.camp-care b{font-size:12px}
.camp-care small{display:block;font-size:10px;line-height:1.2}
.camp-patients{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px;margin-top:5px}
.camp-patients>div{display:flex;align-items:center;gap:5px;font-size:11px;min-width:0}
.camp-patients img{width:26px;height:30px;object-fit:contain}
.camp-patients small{display:block;font-size:10px}
.camp-work label{display:block;font-size:12px;margin-bottom:4px}
.camp-work select{width:100%;height:44px;color:#ffe6b3;background:#243c38;border:1px solid #c3a368;font-size:12px;min-width:0}
.camp-work-quote{font-size:12px;line-height:1.35;margin:7px 0 0}
.field-camp-panel .icon{width:21px;height:21px;vertical-align:middle}
.camp-footer{display:flex;align-items:center;gap:6px;flex:none;justify-content:space-between}
.camp-footer>span{font-size:12px;line-height:1.2}
.camp-footer small{display:block;font-size:10px;max-width:200px}
.camp-footer button{font-size:11px;min-height:44px;padding:4px 6px}
@media(max-height:360px){.field-camp-panel{padding:7px;gap:4px}.field-camp-panel h2{font-size:17px}.camp-patients img{width:22px;height:25px}.camp-work{gap:8px}.camp-work-quote{font-size:11px;margin-top:4px}.field-camp-panel .camp-event{font-size:11px}.camp-footer>span{font-size:11px}}

@media(max-height:380px) and (orientation:landscape){body[data-screen=encounter] #hud{top:4px}}
@media(max-height:300px) and (orientation:landscape){.camp-patients,.camp-work-detail{display:none}.camp-work-quote{margin:4px 0 0}.camp-work-quote br{display:none}.camp-work label{font-size:11px}.field-camp-panel .camp-event{font-size:10px}}
.field-camp-panel .camp-care{height:44px;padding:3px;line-height:1.1}
.field-camp-panel .camp-care b{display:block;line-height:13px}
.field-camp-panel .camp-care small{font-size:10px;line-height:12px}
.field-camp-panel .camp-patients>div{height:24px;font-size:11px;line-height:11px}
.field-camp-panel .camp-patients small{font-size:10px;line-height:11px}
.field-camp-panel .camp-patients img{height:24px;width:22px}
.field-camp-panel .camp-work-quote{font-size:11px;line-height:1.25;margin:4px 0 0}

.siege-buttons [data-siege=spell-ice] .icon img{filter:hue-rotate(245deg) saturate(1.2) brightness(1.15)}
.siege-buttons button[aria-pressed=true]{outline:1px solid #ffe49f;outline-offset:-4px}
.siege-buttons button[aria-pressed=true]::before{border-color:#ffe49f!important;box-shadow:inset 0 0 0 1px #ffe49f,0 0 5px #ffe49f88!important}
/* Optional battle-view controls are distinct from caravan operations. */
.siege-spell-pool{display:flex;gap:3px;position:relative;padding-bottom:3px}.shared-spell-charge{position:absolute;bottom:1px;left:9px;right:9px;height:3px;background:linear-gradient(to right,#ddae6e var(--cool),#8ad9d8 var(--cool));border-radius:2px;box-shadow:0 0 0 1px #1d211c}.siege-spell-pool:after{content:'↔';position:absolute;bottom:-4px;left:50%;transform:translateX(-50%);font-size:10px;line-height:10px;color:#ffe3a7;pointer-events:none}.siege-forecast-detail{display:flex;flex-direction:column;gap:7px;overflow:auto;min-height:0;font-size:11px;line-height:1.3}.siege-forecast-detail b{font-size:13px}.siege-forecast-detail small{font-size:10px;color:#ded0ae}
/* Dossiers no longer obscure/freeze the entire battle. Pause remains explicit. */
body[data-siege=true] :is(#soldier-detail,#company-detail,#help,#retreat-plan,#cargo-manifest){position:fixed;inset:65px 58px 59px auto;margin:0;width:min(530px,calc(100vw - 122px));height:auto;max-height:none;max-width:none;padding:7px;box-sizing:border-box;overflow:hidden;z-index:13;background:linear-gradient(#26352cef,#192c25f2);border:1px solid #b69b65;box-shadow:0 3px 10px #0007}
body[data-siege=true] :is(#soldier-detail,#company-detail,#help,#retreat-plan,#cargo-manifest)[open]{display:flex;flex-direction:column;gap:4px}
body[data-siege=true] #help-content,body[data-siege=true] #soldier-detail .stat-grid,body[data-siege=true] #retreat-plan .retreat-layout{min-height:0;overflow-y:auto;flex:1;overscroll-behavior:contain}
body[data-siege=true] #retreat-plan h2{font-size:15px}body[data-siege=true] #retreat-plan p{font-size:11px;line-height:1.25;margin:4px 0}body[data-siege=true] #retreat-plan h3{font-size:12px;margin:3px 0}body[data-siege=true] #retreat-plan .retreat-layout{display:block}body[data-siege=true] #retreat-plan .retreat-actions{flex:none;display:flex;gap:3px}body[data-siege=true] #retreat-plan .retreat-actions button{min-height:44px;min-width:44px;font-size:11px;padding:3px;flex:1}body[data-siege=true] #retreat-plan .panel-top{flex:none;min-height:44px}body[data-siege=true] #soldier-detail .soldier-heading{flex:none;min-height:44px}body[data-siege=true] #soldier-detail .soldier-footer{flex:none}body[data-siege=true] #soldier-detail .soldier-amulet{display:none}body[data-siege=true] #soldier-detail .equipped-weapon small{font-size:10px;line-height:1.1}body[data-siege=true] #soldier-detail .stat-grid{grid-template-columns:repeat(3,1fr)}body[data-siege=true] #soldier-detail .stat-grid>div{padding:2px;min-height:44px}body[data-siege=true] #soldier-detail .stat-grid strong{font-size:14px}
@media(max-height:300px){body[data-siege=true] :is(#soldier-detail,#company-detail,#help,#retreat-plan,#cargo-manifest){top:60px;bottom:55px}.siege-forecast-detail{gap:4px}}
.tool-load{display:flex;gap:5px;align-items:center;flex-wrap:wrap;width:100%;font-size:12px}.tool-load .icon{width:21px;height:21px}
body[data-siege=true] #company-detail .panel-top{flex:none;min-height:44px;margin:0}body[data-siege=true] #company-detail .panel-top select{height:44px;min-height:44px;font-size:12px;flex:1;min-width:0;color:#f8e6bd;background:#233d32}body[data-siege=true] #company-detail .panel-top button{width:44px;height:44px;padding:6px;min-width:44px}.battle-equipment-list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:3px}.battle-equipment-list article{display:flex;gap:7px;align-items:center;min-height:44px;padding:3px 5px;background:#162b22aa;flex:none}.battle-equipment-list b{display:block;font-size:12px}.battle-equipment-list small{display:block;font-size:10px}.battle-equipment-list .icon{width:24px;height:24px}body[data-siege=true] #help>button{margin:0;min-height:44px;flex:none}body[data-siege=true] #help-content>h2{font-size:16px;margin:0 0 5px}
.siege-hero.unarmed:after{content:'⚔';position:absolute;top:3px;right:3px;line-height:12px;font-size:10px;color:#ffd6ad;text-shadow:0 1px 2px #000;background:#6f3926;border-radius:3px;padding:0 1px;pointer-events:none}
/* A component's relevant actions fit one44px row even at600×273. */
#siege-dialog .siege-detail-actions{grid-template-columns:repeat(auto-fit,minmax(55px,1fr));gap:3px}
#siege-dialog .siege-detail-actions button{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:1px;line-height:11px;min-height:44px;height:44px;padding:2px;font-size:10px;white-space:normal;overflow-wrap:normal}
#siege-dialog .siege-detail-actions .icon{width:18px;height:18px}
@media(max-height:300px){#siege-dialog{padding:5px}#siege-dialog[open]{gap:3px}}

/* Shared caravan integrity: information-only, never intercepts field orders. */
#caravan-vitality{position:absolute;z-index:4;left:max(8px,env(safe-area-inset-left));top:78px;width:44px;height:clamp(108px,calc(100dvh - 152px - env(safe-area-inset-bottom)),280px);pointer-events:none}
#caravan-vitality:empty{display:none}
.caravan-health{--health-color:#55d184;display:flex;flex-direction:column;align-items:center;gap:3px;height:100%;padding:5px 2px;box-sizing:border-box;color:#fff2cc;background:linear-gradient(#1c3029eb,#101b1be8);border:1px solid #b79a60;border-radius:5px;box-shadow:0 2px 5px #0009;text-shadow:0 1px 2px #000}
.caravan-health.damaged{--health-color:#f2ce4b}.caravan-health.critical{--health-color:#ee5d54}
.caravan-health-title{font:9px/11px Georgia,serif}.caravan-health strong{font:700 14px/17px sans-serif}.caravan-health-value{font:700 10px/12px sans-serif;white-space:nowrap}
.caravan-health-track{position:relative;flex:1;min-height:40px;width:20px;background:#090f10;border:1px solid #87734a;box-shadow:inset 0 1px 5px #000;border-radius:3px;overflow:hidden}
.caravan-health-track i{position:absolute;inset:auto 0 0;display:block;background:linear-gradient(90deg,#ffffff35,var(--health-color) 28%,var(--health-color) 72%,#0004);border-top:1px solid #ffffff8c;box-sizing:border-box}
body[data-siege="true"] #siege-caravan{left:max(60px,calc(env(safe-area-inset-left) + 52px))}

.formation-field{position:absolute;left:52px;top:0;width:44px;height:44px;min-width:44px;pointer-events:auto;padding:2px;display:flex;flex-direction:column;gap:0;border:1px solid #b1945e;background:var(--hero-wood) center/220px;color:#ffebbe;border-radius:4px}.formation-field>span{font-size:23px;line-height:25px}.formation-field small{font-size:9px;line-height:12px}.formation-field:disabled{opacity:.5}

/* Component drawer clears the meter and the caravan controls. */
body[data-siege="true"] #siege-dialog{left:max(110px,calc(env(safe-area-inset-left) + 102px));width:min(260px,calc(100vw - 168px))}
/* Live reference drawers also leave the two left-side fittings unobstructed. */
body[data-siege=true] :is(#soldier-detail,#company-detail,#help,#retreat-plan,#cargo-manifest){width:min(530px,calc(100vw - 180px))}

/* On the world map only the formation shortcut remains; integrity is battle-only. */
body[data-screen=map] #caravan-vitality{height:44px}
body[data-screen=map] #caravan-vitality .formation-field{left:0}

/* World travel actions share one truly centered bottom group. */
body[data-screen=map] .road-controls{position:absolute;left:50%;transform:translateX(-50%);gap:3px;}
body[data-screen=map] .road-controls .map-camp{height:48px;min-width:44px;flex:none;background:linear-gradient(#183b51e8,#162b43f2);border:2px ridge #e1bc76;border-radius:0;padding:2px!important;}
@media(max-width:700px){body[data-screen=map] .map-position{max-width:112px;padding:5px;}}

/* Network loading is not simulation time. Keep global menu/save controls usable. */
#battle-loading{position:absolute;inset:62px 8px 82px;z-index:9;display:grid;place-content:center;justify-items:center;background:#172c29f2;text-align:center;pointer-events:none;gap:6px}
#battle-loading[hidden]{display:none}#battle-loading strong{font-size:15px}#battle-loading p{font-size:12px;margin:0}#battle-loading button{pointer-events:auto;min-height:44px;margin-top:3px}

#siege-dialog .siege-detail-actions button[data-siege=select-occupant]{flex-direction:row;gap:3px;padding:3px;font-size:11px;line-height:12px}.tower-occupant{width:18px;height:24px;object-fit:contain}.siege-detail-actions [data-siege=select-occupant]>span{min-width:0}.siege-detail-actions [data-siege=select-occupant] b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

#siege-dialog .siege-part-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:4px}#siege-dialog .tower-protection{color:#cde8bc}#siege-dialog .ballista-status{line-height:1.35}
