/* Shared tactics geometry; common controls retain the foundation tokens. */
.battle-screen{min-width:0;overflow:hidden}
.battle-heading{flex:none;height:56px;min-height:56px;gap:8px}
.battle-heading .battle-title{min-width:0;flex:1}
.battle-heading .inline-actions{flex:none;gap:6px}
.battle-heading button,.battle-commandbar button,.battle-objective button{min-height:44px}
.battle-heading [data-action=threat]{display:inline-flex}
.battle-heading button[aria-pressed=true]{border-color:var(--accent);background:#28413f}
.battle-objective{display:flex;flex:none;align-items:center;justify-content:space-between;gap:8px;min-height:44px;padding:0 12px;border-bottom:1px solid var(--border);font-size:12px;background:#142128}
.battle-objective button{flex:none;padding:5px 8px;font-size:12px;border-color:transparent}
.battle-layout{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 300px}
.battle-layout .board-wrap{min-height:0}
.battle-panel{min-height:0;padding:10px 12px;overscroll-behavior:contain;scrollbar-gutter:stable}
.battle-panel>*+*{margin-top:10px}
.battle-panel .unit-heading{gap:8px;min-height:58px}
.battle-panel .unit-heading>.paper-doll{width:44px;height:56px}
.battle-panel .unit-heading>div:not(.paper-doll):not(.turn-tokens){flex:1;min-width:0}
.battle-panel .unit-heading h2{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}
.battle-panel .unit-heading small{display:block;font-size:11px}
.turn-tokens{display:grid;gap:3px;flex:none;font-size:10px;color:var(--accent)}
.turn-tokens .used{color:var(--muted)}
.battle-panel .vitals{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.battle-panel .vitals meter{height:9px}
.battle-panel .actions-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.battle-panel .ability-button{min-height:50px;padding:6px 8px}
.ability-button kbd{font:inherit;color:var(--muted)}
.battle-conditions{margin-bottom:0;font-size:11px;color:#ead6a5}
.incoming-plan{margin-bottom:0;font-size:11px;color:#edc1b5}
.incoming-plan button{min-height:44px;padding:4px 8px;font-size:11px}
.enemy-intent-card{padding:10px;border:1px solid #a57963;border-radius:6px;background:#362d28;font-size:12px}
.enemy-intent-card p{margin:5px 0;overflow-wrap:anywhere}
.enemy-intent-card small{font-size:11px;color:#d7c3b3}
.enemy-stat-line{font-size:11px;color:var(--muted)}
.battle-roster{gap:5px}
.battle-roster button{min-height:44px;text-align:left}
.battle-record{font-size:12px}
.battle-record summary{min-height:44px;display:flex;align-items:center;cursor:pointer}
.combat-log{margin:0;padding:8px 8px 8px 26px;max-height:200px;overflow-wrap:anywhere}
.combat-log li+li{margin-top:6px}
.battle-commandbar{position:relative;z-index:3;display:flex;flex:none;align-items:center;justify-content:space-between;gap:10px;min-height:76px;padding:8px 12px;border-top:1px solid #465e62;background:#17272e;box-shadow:0 -3px 12px #07121955}
.command-copy{display:grid;gap:3px;min-width:0}
.command-copy strong,.command-copy small,.command-copy .forecast{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.command-copy strong{font-size:13px}
.command-copy small,.command-copy .forecast{font-size:11px}
.battle-commandbar .target-card{padding:0;border:0;background:none;overflow:hidden}
.command-actions{display:flex;flex:none;gap:6px;align-items:center}
.command-actions button{white-space:nowrap;padding:7px 12px;font-size:12px}
.command-actions svg{width:16px;height:16px;vertical-align:middle}
.battle-result-live{flex:none;min-height:24px;margin:0;padding:4px 12px;background:#14221f;color:#c4ecdc;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.intent-list,.forecast-list{display:grid;gap:8px}
.intent-row{display:grid;gap:5px;width:100%;padding:12px;text-align:left}
.intent-row span{font-size:12px;color:#d3c3b9}
.forecast-list>div{padding:10px;border:1px solid var(--border);border-radius:6px}
.forecast-list p{margin:5px 0 0;font-size:13px}
#battle-presentation{display:contents}
@media(max-width:700px){
 .battle-heading{height:52px;min-height:52px;padding:4px 8px;gap:5px}
 .battle-heading .inline-actions{gap:4px}
 .battle-heading button{padding:6px 9px;font-size:12px}
 .battle-heading .icon-button{width:40px;padding:6px}
 .battle-heading strong{font-size:12px}
 .battle-heading #round-label{font-size:10px}
 .battle-objective{min-height:44px;padding:0 8px;gap:6px;font-size:11px;line-height:1.2}
 .battle-objective button{font-size:11px;padding:5px}
 .battle-story{max-height:36px;padding:4px 8px;font-size:11px;line-height:1.25}
 .battle-layout{display:flex;flex-direction:column}
 .battle-layout .board-wrap{flex:1;min-height:150px}
 .battle-panel{flex:none;max-height:174px;padding:5px 8px;border-left:0;border-top:1px solid var(--border);scrollbar-gutter:auto}
 .battle-panel>*+*{margin-top:5px}
 .battle-panel .unit-heading{min-height:32px;height:32px;gap:5px}
 .battle-panel .unit-heading>.paper-doll{width:28px;height:32px}
 .battle-panel .unit-heading h2{font-size:12px}
 .battle-panel .unit-heading small{font-size:10px}
 .turn-tokens{display:flex;gap:6px;font-size:9px}
 .battle-panel .vitals{gap:12px;font-size:10px}
 .battle-panel .vitals label{display:flex;gap:5px;align-items:center}
 .battle-panel .vitals meter{flex:1;min-width:15px;width:auto}
 .battle-panel .vitals b{white-space:nowrap;font-size:10px}
 .battle-panel .actions-grid{display:flex;gap:5px;overflow-x:auto;padding:1px 0 3px;scroll-snap-type:x proximity;overscroll-behavior-inline:contain}
 .battle-panel .ability-button{flex:none;min-width:92px;min-height:46px;padding:5px 8px;scroll-snap-align:start}
 .battle-panel .ability-button strong{font-size:11px}
 .ability-button kbd{display:none}
 .battle-roster{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-inline:contain;padding-bottom:2px}
 .battle-roster button{flex:none;min-width:82px;padding:4px 7px;font-size:11px}
 .battle-roster small{font-size:9px}
 .incoming-plan{display:flex;align-items:center;justify-content:space-between;gap:5px;font-size:10px}
 .enemy-intent-card{padding:7px;font-size:11px}
 .enemy-intent-card small{font-size:10px}
 .battle-commandbar{min-height:74px;padding:6px 8px;gap:7px;align-items:center;flex-wrap:wrap}
 .command-copy{flex:1 1 120px;gap:2px}
 .command-copy strong{font-size:12px}
 .command-copy small{font-size:10px}
 .command-actions{gap:4px;margin-left:auto}
 .command-actions button{padding:6px 10px;font-size:11px}
 .battle-commandbar:has(.target-card) .command-copy{flex-basis:100%}
 .battle-commandbar:has(.target-card){gap:3px}
 .battle-commandbar:has(.target-card) .command-copy small{display:none}
 .battle-result-live{padding:3px 8px;min-height:21px;font-size:10px}
 .battle-screen .board-tools{gap:4px;top:6px;right:6px}
 .battle-screen .board-tools button{min-height:44px}
 .battle-screen .board-note{max-width:calc(100% - 12px);padding:4px 6px;font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}
@media(max-width:700px) and (max-height:700px){
 .battle-panel{max-height:148px}
 .battle-story{max-height:28px}
 .battle-commandbar{min-height:66px}
}
@media(max-height:500px) and (min-width:540px){
 .battle-heading{height:48px;min-height:48px}
 .battle-objective{min-height:32px}
 .battle-objective button{min-height:32px}
 .battle-story{max-height:25px}
 .battle-layout{display:grid;grid-template-columns:minmax(0,1fr) 238px}
 .battle-layout .board-wrap{min-height:100px}
 .battle-panel{max-height:none;border-left:1px solid var(--border);border-top:0;padding:5px 8px}
 .battle-panel .unit-heading{min-height:32px}
 .battle-panel .unit-heading>.paper-doll{width:28px;height:32px}
 .battle-panel .unit-heading h2{font-size:12px}
 .battle-panel .unit-heading small{font-size:10px}
 .battle-panel .actions-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 .battle-panel .ability-button{min-width:0;min-height:44px;padding:4px 6px}
 .battle-commandbar{min-height:58px;padding:5px 8px;flex-wrap:nowrap}
 .battle-commandbar:has(.target-card) .command-copy{flex-basis:auto}
 .battle-result-live{min-height:20px;padding:2px 8px}
}

.toast.error{border-color:#bd8176;background:#392324;color:#ffe0da}
@media(max-width:539px) and (max-height:600px){
 .battle-panel{max-height:100px}
 .battle-story{max-height:20px}
}
