/* One optional team action within the existing inspection panel. */
@media(min-width:900px) and (min-height:601px){
 body[data-game=defense][data-inspection-open=true] .layout{grid-template-columns:minmax(0,1fr) 280px;grid-template-rows:minmax(0,1fr)}
 body[data-game=defense][data-inspection-open=true] .side{min-height:0;overflow:auto}
 body[data-game=defense][data-inspection-open=true] .tactical-content{grid-template-columns:minmax(0,1fr);max-height:none}
}

body[data-game=defense] .tactical-panel[data-unit-selected=true] .unit-info{grid-column:1/-1;grid-row:1}
body[data-game=defense] .tactical-content{max-height:min(22dvh,160px)}
body[data-game=defense] .tactical-upgrade #enhance{min-height:44px}
@media(max-width:340px){body[data-game=defense] .tactical-content{max-height:18dvh}}

body[data-game=defense] .top #sound{min-width:44px;min-height:44px}
#reserveUnit{width:100%;min-height:44px;margin-top:8px;white-space:normal;line-height:1.3}
#reserveUnit[hidden],#reserveNote[hidden]{display:none}
#reserveUnit[aria-pressed=true]{border-color:#8fddd2;background:#234b51;color:#c7f4ec}
#reserveNote{font-size:12px;line-height:1.5;color:#6f9998;margin:7px 0 0}
/* Keep the tactical field controls usable on phones without changing combat. */
body[data-game=defense] .field-tools .quiet{min-width:44px;min-height:44px;padding:6px 8px;line-height:1.2}
body[data-game=defense] .field-tools #zoom{min-width:72px}
body[data-game=defense] .field-tools #quality{min-width:78px}
@media(max-width:340px){body[data-game=defense] .field-tools{gap:4px}body[data-game=defense] .field-tools .quiet{font-size:10px}}

/* On a short landscape phone, reserve space for the board before captions. */
@media(max-height:600px) and (min-width:650px){
 body[data-game=defense] .top{min-height:48px;align-items:flex-start}
 body[data-game=defense] .top .brand{font-size:21px;line-height:1.1}
 body[data-game=defense] .top .edition{font-size:8px;line-height:1.2}
 body[data-game=defense] .top .game-purpose{font-size:9px;line-height:1.2;margin-top:3px}
 body[data-game=defense] .stats{top:5px}
 body[data-game=defense] .stat{padding:3px 10px}
 body[data-game=defense] .stat small{font-size:8px;line-height:1.2}
 body[data-game=defense] .stat b{font-size:17px;line-height:1.25}
 body[data-game=defense] .world-area .stage-note{grid-template-columns:auto minmax(0,1fr);padding:4px 8px;gap:5px;min-width:0}
 body[data-game=defense] .world-area .stage-note strong{white-space:nowrap}
 body[data-game=defense] .world-area .stage-note small{grid-column:2;grid-row:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}

/* A per-unit order lives inside the existing inspector, never over the board. */
.target-policy{clear:both;margin:10px 0;padding:10px;border:1px solid #456479;border-radius:8px;background:#132638}
.target-policy>strong{display:block;font-size:12px;color:#b7d8e6;margin-bottom:7px}
.target-policy>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
.target-policy button{min-width:0;min-height:44px;padding:6px 3px;border:1px solid #47657e;border-radius:6px;background:#1b3046;color:#b9cddd;font-family:inherit;font-weight:700;font-size:11px;line-height:1.3;cursor:pointer}
.target-policy button[aria-pressed=true]{background:#285650;border-color:#8edbc6;color:#e2fff5}
.target-policy button:disabled{opacity:.35;cursor:default}
.target-policy button:focus-visible{outline:2px solid #f2d39b;outline-offset:2px}
.target-policy #targetPolicyNote{font-size:11px;line-height:1.5;margin:8px 0 0;color:#a9c7d6;word-break:keep-all}
