/* Warzone workspace. The game map keeps its native dimensions and controls. */
.map-panel {--zone-ink:#e4eff0;--zone-muted:#b4c6cb;--zone-edge:#3a505b;--zone-active:#9edfd3;min-inline-size:0}
.map-panel .map-controls {container:zone-map-tools / inline-size;background:#11252e}
.map-panel .map-toolbar {position:relative;min-width:0}
.map-panel .map-controls .map-toolbar :is(.tools>button,.tools>details>summary,.map-utility>button,.map-utility>select),
.map-panel .map-controls #drawing-tools :is(button,summary,select),
.map-panel .secondary-map-tools>button,.map-panel #map-info-button {
  box-sizing:border-box;min-height:44px;min-width:44px;line-height:1.3;font-size:.8125rem;
}
.map-panel .map-controls .map-toolbar .ui-icon {width:16px;height:16px;flex:none}
.map-panel .map-controls .map-toolbar #layers-button {min-width:44px;width:auto;min-height:44px;padding-inline:10px}
.map-panel .map-controls .map-toolbar #map-view {font-size:.875rem;min-height:44px}
.map-panel .map-controls .tools>button,.map-panel #more-tools-label,.map-panel #layers-button {
  font-weight:550;color:var(--zone-ink);border-radius:6px;box-shadow:none;
}
.map-panel .map-controls .tools>button[aria-pressed=true],.map-panel #more-tools-label.active {
  color:#102a2a;background:#a2dfd2;border-color:#a2dfd2
}
.map-panel #more-tools-label {list-style:none}
.map-panel #more-tools-label::-webkit-details-marker {display:none}
.map-panel #more-map-tools,.map-panel .map-controls .tools {position:static}
.map-panel #more-map-tools[open] .secondary-map-tools {
  position:absolute;inset:auto auto auto 0;top:calc(100% + 4px);z-index:18;display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,8rem),1fr));width:min(100%,22rem);
  padding:5px;gap:4px;max-width:100%;box-sizing:border-box;max-height:min(56dvh,24rem);
  overflow:auto;overscroll-behavior:contain;scrollbar-gutter:auto;border:1px solid var(--zone-edge);
  border-radius:10px;background:#142832;box-shadow:0 7px 22px #00101865;
}
.map-panel .map-controls .secondary-map-tools button {
  min-width:0;width:100%;height:auto;min-height:44px;text-align:start;justify-content:flex-start;
  color:var(--zone-ink);font-size:.8125rem;line-height:1.35;padding:6px 9px;white-space:normal;
  border:0;background:#1b323c;gap:6px;overflow-wrap:anywhere
}
.map-panel .map-stage #map-pan-pad {background:transparent;border:0;padding:0;border-radius:8px;box-shadow:none}
.map-panel .zone-pan-menu {display:block;margin:0;padding:0;border:0;box-shadow:none;background:transparent}
.map-panel .zone-pan-menu>summary {
  display:grid;place-items:center;box-sizing:border-box;width:44px;min-height:44px;margin-inline-start:auto;list-style:none;
  border:1px solid #556c71;border-radius:8px;color:var(--zone-ink);background:#12252ef5;cursor:pointer;
}
.map-panel .zone-pan-menu>summary::-webkit-details-marker {display:none}
.map-panel .zone-pan-menu>summary svg {width:19px;height:19px;pointer-events:none}
.map-panel .zone-pan-menu>summary:focus-visible,.map-panel .map-stage button:focus-visible,.map-panel .map-controls :focus-visible {outline:2px solid var(--zone-active);outline-offset:-3px}
.map-panel .zone-pan-menu[open]>summary {color:var(--zone-active);border-color:var(--zone-active)}
.map-panel .zone-pan-menu .zone-pan-directions {
  display:flex;gap:1px;padding:2px;margin-top:3px;box-sizing:border-box;border:1px solid #556c71;
  border-radius:8px;background:#12252efa;box-shadow:0 4px 10px #00101850
}
.map-panel .zone-pan-menu:not([open]) .zone-pan-directions {display:none}
.map-panel .zone-pan-directions [data-pan] {width:44px;min-width:44px;height:44px}
.map-panel .map-stage :is(.zoom button,.history-controls button) {min-width:44px;min-height:44px;}
.map-panel .map-stage .zoom #zoom-in,.map-panel .map-stage .zoom #zoom-out {font-size:1.25rem}
.map-panel .zone-view-name,.map-panel .zone-preset-choice {display:none}
.map-panel .map-controls #drawing-tools .drawing-style-options {max-width:100%;box-sizing:border-box;flex-wrap:wrap;gap:5px}
.map-panel .map-controls #drawing-tools .drawing-style-options #draw-colours {flex-wrap:wrap;gap:2px;min-width:0}
.map-panel .map-controls #drawing-tools .drawing-style-options .drawing-swatch {width:44px;min-width:44px;min-height:44px}
.map-panel .map-controls #drawing-tools .drawing-style-options #draw-width {font-size:1rem;min-height:44px;max-width:100%}
.map-panel .map-stage :is(.placement-mode,.map-context) :is(button,summary,input,select) {min-height:44px;min-width:44px}
.map-panel .map-stage #line-tools :is(button,input,summary,select) {min-height:44px;box-sizing:border-box}
.map-panel .map-stage #line-tools :is(button,summary) {font-size:.8125rem;line-height:1.35;white-space:normal;overflow-wrap:anywhere}
.map-panel .map-stage #line-tools :is(input:not([type=range]),select) {font-size:1rem;min-width:0;max-width:100%}
.map-panel .map-stage #line-unit-range {min-height:44px}
.map-panel .map-stage #line-tools :is(.small,#line-estimate,#line-feedback) {font-size:.8125rem;line-height:1.42;overflow-wrap:anywhere}
#map-settings-dialog .zone-map-choice {display:grid;gap:.3rem;margin:0 0 .65rem;max-width:100%;color:inherit;text-align:start}
#map-settings-dialog .zone-map-choice label {font-weight:600;font-size:.8125rem}
#map-settings-dialog .zone-map-choice select {width:100%;min-width:0;min-height:44px;font-size:1rem;box-sizing:border-box}
@media(max-width:720px), (max-width:1100px) and (max-height:540px) {
  .map-panel .zone-view-name {display:block;white-space:normal;line-height:1.25;overflow-wrap:anywhere}
  .map-panel .map-controls:not(:has(#drawing-tools:not([hidden]))) .map-toolbar {
    display:grid;grid-template-columns:repeat(3,minmax(44px,1fr)) minmax(54px,1.25fr);
    align-items:stretch;gap:3px;padding:3px;min-width:0;box-sizing:border-box
  }
  .map-panel .map-toolbar>.tools,.map-panel .map-toolbar>.map-utility {display:contents}
  .map-panel .map-toolbar .tools>button,.map-panel #more-tools-label,.map-panel .map-controls .map-toolbar #layers-button {
    display:flex;align-items:center;justify-content:center;gap:4px;width:100%;max-width:100%;
    height:auto;padding:4px 3px;white-space:normal;overflow-wrap:anywhere;line-height:1.25
  }
  .map-panel .map-toolbar .tools>button[hidden] {display:none}
  .map-panel #more-tools-label {height:100%}
  .map-panel .map-controls #drawing-tools .drawing-top-row {width:100%;min-width:0}
  .map-panel .map-controls #drawing-presets {display:none}
  .map-panel .map-controls .zone-preset-choice {
    display:grid;grid-template-columns:1fr auto;align-items:center;gap:7px;min-width:0;width:100%;position:relative;
    min-height:44px;box-sizing:border-box;padding:5px 12px;background:#19323c;border:1px solid #49636c;border-radius:6px;
    color:var(--zone-ink);font-size:.875rem;line-height:1.3
  }
  .map-panel .zone-preset-choice::after {content:'';width:7px;height:7px;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:rotate(45deg);margin:0 2px 4px 0}
  .map-panel .zone-preset-choice>span {white-space:normal;overflow-wrap:anywhere}
  .map-panel .map-controls #drawing-tools .zone-preset-choice>select {position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;font-size:1rem}
  .map-panel .zone-preset-choice:has(:focus-visible) {outline:2px solid var(--zone-active);outline-offset:-3px}
  .map-panel .map-controls #drawing-tools #draw-modes {display:block;max-width:100%;width:100%;min-width:0}
  .map-panel .map-controls #drawing-tools .drawing-bottom-row {flex-wrap:wrap;align-items:stretch;gap:3px;max-width:100%;min-width:0}
  .map-panel .map-controls #drawing-tools .drawing-bottom-row>:is(button,details)>summary,
  .map-panel .map-controls #drawing-tools .drawing-bottom-row>button {
    font-size:.8125rem;line-height:1.3;white-space:normal;overflow-wrap:anywhere;min-width:44px;min-height:44px;padding:4px 7px;
  }
  .map-panel .map-controls #drawing-tools .drawing-extra>div {max-width:calc(100vw - 24px);max-height:48dvh;overflow:auto;box-sizing:border-box}
  .map-panel .map-stage :is(.placement-mode,.map-context) {max-width:calc(100% - 14px);box-sizing:border-box;overflow-wrap:anywhere}
}
@container zone-map-tools (max-width:17rem) {
 .map-panel .map-controls:not(:has(#drawing-tools:not([hidden]))) .map-toolbar {grid-template-columns:repeat(2,minmax(0,1fr))}
 .map-panel .map-controls .map-toolbar :is(button,.tools>details>summary) {font-size:.8125rem;hyphens:auto;overflow-wrap:anywhere}
}
.map-panel .zone-nav-menu {display:none}
.map-panel[data-zone-floating] {position:relative}
.map-panel[data-zone-floating]:not([data-zone-tools-open]) > .map-controls {display:none!important}
.map-panel[data-zone-floating][data-zone-tools-open] > .map-controls {
  position:absolute;z-index:12;display:flex;flex-direction:column;align-items:stretch;gap:3px;
  inset:58px 7px auto;width:auto;max-width:40rem;height:auto;max-height:calc(100% - 66px);box-sizing:border-box;
  padding:3px;background:#122832fa;border:1px solid #48626c;border-radius:8px;box-shadow:0 4px 15px #00121c55;
}
.map-panel[data-zone-floating] .map-stage {height:100%;min-height:0}
.map-panel[data-zone-floating] #map-pan-pad {display:none!important}
.map-panel[data-zone-floating] .zone-nav-menu {
  display:block;position:absolute;z-index:4;inset:auto 8px 8px auto;max-width:calc(100% - 16px);
  border:0;border-radius:8px;background:transparent;padding:0;margin:0;box-shadow:none;
}
.map-panel[data-zone-floating] .zone-nav-menu>summary {
  display:grid;place-items:center;width:44px;height:44px;box-sizing:border-box;border:1px solid #627980;border-radius:8px;
  background:#112630f5;color:#edf6f5;font-size:1.25rem;line-height:1;font-weight:600;cursor:pointer;list-style:none;margin-inline-start:auto
}
.map-panel .zone-nav-menu>summary::-webkit-details-marker{display:none}
.map-panel .zone-nav-menu[open]>summary {border-color:var(--zone-active);color:var(--zone-active)}
.map-panel .zone-nav-menu .zone-nav-body {
  position:absolute;z-index:5;bottom:calc(100% + 5px);right:0;display:grid;gap:4px;padding:4px;
  box-sizing:border-box;border:1px solid #49636c;border-radius:8px;background:#132832fa;box-shadow:0 3px 12px #00121d55
}
.map-panel .zone-nav-menu:not([open]) .zone-nav-body {display:none}
.map-panel .zone-nav-body .zoom,.map-panel .zone-nav-body .zone-pan-directions {
  position:static;display:grid;grid-template-columns:repeat(4,44px);padding:0;margin:0;gap:2px;
  max-width:100%;background:none;border:0;box-shadow:none;transform:none
}
.map-panel .zone-nav-body .zoom>button,.map-panel .zone-nav-body [data-pan] {
  display:grid;place-items:center;width:44px;min-width:44px;height:44px;min-height:44px;margin:0;
  color:var(--zone-ink);border:1px solid #3e555e;border-radius:5px;background:#1b333e;padding:6px;box-sizing:border-box
}
.map-panel .zone-nav-body [data-pan] svg {width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.map-panel .zone-nav-body [data-pan=up] svg {transform:rotate(90deg)}
.map-panel .zone-nav-body [data-pan=down] svg {transform:rotate(-90deg)}
.map-panel .zone-nav-body [data-pan=right] svg {transform:rotate(180deg)}
.map-panel[data-zone-floating] .history-controls:has(#undo:disabled):has(#redo:disabled) {display:none}
.map-panel[data-zone-floating] .map-stage:has(.line-tools:not([hidden]) #line-settings[open]) .zone-nav-menu,
.map-panel[data-zone-floating] .map-stage:has(#map[data-panning=true]) .zone-nav-menu {visibility:hidden;pointer-events:none}
@supports selector(.map-panel:has(#map-context:not([hidden]))) {
 .map-panel[data-zone-floating][data-zone-tools-open]:has(#line-tools:not([hidden])) > .map-controls {inset:auto 7px 57px}
}
.map-panel[data-zone-floating] .zone-nav-body #map-pan-pad {
 display:block!important;position:static;inset:auto;width:auto;height:auto;max-width:100%;margin:0;padding:0;visibility:visible;
}
.map-panel .zone-nav-body #map-pan-pad>.zone-pan-menu {display:none}
.map-panel .map-controls .map-toolbar #layers-button .zone-view-name {font-size:.8125rem;font-weight:550}
.map-panel .zone-nav-menu>summary svg {width:20px;height:20px;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;fill:none}

/* Keep the placement instruction and its cancel action clear of both floating toolbars. */
.map-panel[data-zone-floating] .map-stage #placement-mode:not([hidden]) {top:60px!important}
.map-panel[data-zone-floating] .map-stage #placement-mode {font-size:.8125rem;line-height:1.35}
.map-panel[data-zone-floating] .map-stage #placement-mode :is(strong,span,button) {font-size:inherit;line-height:inherit}
.map-panel[data-zone-floating] .map-stage #placement-mode :is(div,strong,span) {min-width:0;overflow-wrap:anywhere}
@media(max-width:360px) {
}
.map-panel #wz-line-options {display:none}
.map-panel[data-zone-floating][data-zone-tools-open]:has(#line-tools:not([hidden])) > .map-controls {inset:58px 7px auto}
.map-panel[data-zone-floating][data-zone-tools-open] .map-stage #line-tools:not([hidden]) {visibility:hidden}
.map-panel[data-zone-floating] .map-stage #line-tools:not([hidden]) {
 position:absolute!important;top:59px!important;left:7px!important;right:auto!important;bottom:auto!important;transform:none!important;
 min-width:0;max-width:calc(100% - 14px)!important;max-height:calc(100% - 119px)!important;
 overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;box-sizing:border-box;z-index:3;
}
.map-panel[data-zone-floating] #line-tools #wz-line-options {
 display:inline-flex;justify-content:space-between;align-items:center;gap:7px;width:auto;max-width:100%;min-width:44px;min-height:44px;
 font-size:.8125rem;line-height:1.35;white-space:normal;overflow-wrap:anywhere;text-align:start;
}
.map-panel[data-zone-floating] #wz-line-options::after {content:'';width:7px;height:7px;flex:none;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:rotate(45deg);margin:0 1px 3px 0}
.map-panel[data-zone-floating] #wz-line-options[aria-expanded=true]::after {transform:rotate(225deg);margin:4px 1px 0 0}
.map-panel[data-zone-floating] .map-stage #line-tools:not([data-zone-line-open]):not([hidden]) {
 display:flex!important;flex-wrap:wrap;align-items:center;gap:4px;width:max-content;padding:3px!important;
 color:var(--zone-ink);background:#132a34f7;border:1px solid #506872;border-radius:8px;box-shadow:0 2px 8px #00101844;
}
.map-panel[data-zone-floating] .map-stage #line-tools:not([data-zone-line-open])>:not(#wz-line-options):not(#line-summary),
.map-panel[data-zone-floating] #line-tools:not([data-zone-line-open]) #line-summary>:not(#line-place),
.map-panel[data-zone-floating] #line-tools:not([data-zone-line-open]) #line-summary:not(:has(#line-place:not(:disabled):not([hidden]))) {display:none!important}
.map-panel[data-zone-floating] #line-tools:not([data-zone-line-open]) #line-summary:has(#line-place:not(:disabled):not([hidden])) {display:contents!important}
.map-panel[data-zone-floating] #line-tools:not([data-zone-line-open]) #line-place:not(:disabled):not([hidden]) {display:inline-flex;align-items:center;min-height:44px;margin:0}
.map-panel[data-zone-floating] #line-tools[data-zone-line-open] #wz-line-options {grid-column:1/-1;width:100%;margin:0 0 4px}
body[data-map-focus] .map-panel>.map-caption {display:none!important}
.map-panel[data-zone-floating] .zone-nav-body #map-info-button {
 display:flex;align-items:center;justify-content:center;min-height:44px;padding:5px 8px;margin:0;
 font-size:.8125rem;line-height:1.35;background:#1b333e;color:var(--zone-ink);border:1px solid #3e555e;border-radius:5px;
}
/* The native expanded panel can grow vertically for a large system font. */
.map-panel[data-zone-floating] .map-stage #line-tools[data-zone-line-open]:not([hidden]) {
 display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;flex-wrap:nowrap!important;gap:5px;
}
.map-panel[data-zone-floating] .map-stage #line-tools[data-zone-line-open] > * {flex-shrink:0!important;min-width:0;max-width:100%;box-sizing:border-box}
.map-panel[data-zone-floating] #line-tools[data-zone-line-open] .line-toolbar {display:flex;flex-wrap:wrap;align-items:stretch;justify-content:flex-start;gap:4px;height:auto;min-height:0}
.map-panel[data-zone-floating] #line-tools[data-zone-line-open] .line-toolbar .line-segment {flex:1 1 100%;min-width:0;max-width:100%;flex-wrap:wrap;align-items:stretch}
.map-panel[data-zone-floating] #line-tools[data-zone-line-open] .line-toolbar button {flex:1 1 auto;max-width:100%;min-width:44px;height:auto;align-self:stretch;hyphens:auto}
.map-panel[data-zone-floating] #line-tools[data-zone-line-open] #line-settings {height:auto;min-height:min-content;max-height:none;overflow:visible}
.map-panel[data-zone-floating] #line-tools[data-zone-line-open] #line-settings-summary {height:auto;white-space:normal;overflow-wrap:anywhere}

/* Keep the active route and squad readable while editing timing on a phone. */
@media (max-width:700px){
 body.hq-battle dialog#commander-settings-panel[open] .commander-settings-heading{
  position:static;grid-template-columns:repeat(auto-fit,minmax(min(100%,7rem),1fr))!important;
 }
 body.hq-battle dialog#commander-settings-panel[open] .commander-settings-heading #commander-settings-title{
  grid-area:1 / 1 / 2 / -1!important;display:block;-webkit-line-clamp:unset;
  max-height:none;white-space:normal;overflow:visible;overflow-wrap:anywhere;
 }
 body.hq-battle dialog#commander-settings-panel[open] .commander-settings-heading .tw-lang-toggle{
  grid-area:auto!important;justify-self:start;
 }
 body.hq-battle dialog#commander-settings-panel[open] .commander-settings-heading #commander-close-settings{
  grid-area:auto!important;justify-self:end;
 }
 body.hq-battle #commander-settings-panel .commander-unit-heading{
  display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.25rem .5rem;
 }
 body.hq-battle #commander-settings-panel .commander-unit-heading>label{flex:1 1 7rem}
 body.hq-battle #commander-settings-panel .commander-apply-actions button small{
  white-space:normal;overflow-wrap:anywhere;
 }
}

/* Shared planner sheets */
body.hq-battle :is(dialog:not(#zone-browser-dialog),.orders-panel) {
 --zp-panel:#152630;--zp-border:#39505b;--zp-accent:#a0e2d2;--zp-muted:#b8cbd1;
 box-sizing:border-box; color:#edf3f4; font-size:.875rem;line-height:1.45;
}
body.hq-battle dialog:not(#zone-browser-dialog){
 max-width:calc(100vw - 16px)!important;max-height:calc(100dvh - 16px)!important;
 padding:clamp(10px,2.4vw,18px);border:1px solid var(--zp-border);border-radius:.85rem;background:var(--zp-panel);
 overflow-y:auto;overscroll-behavior:contain;
}
body.hq-battle dialog:not(#zone-browser-dialog) :is(.dialog-header,.commander-settings-heading) {
 display:grid!important;grid-template-columns:minmax(0,1fr) auto auto!important;align-items:center;gap:6px!important;
 margin:0 0 .7rem!important;padding:0 0 .5rem!important;border-bottom:1px solid var(--zp-border);background:var(--zp-panel);
}
body.hq-battle dialog:not(#zone-browser-dialog) :is(h2,.commander-settings-heading h2){grid-column:auto!important;font-size:1.0625rem!important;line-height:1.28;letter-spacing:-.012em;margin:0;min-width:0;overflow-wrap:anywhere}
body.hq-battle :is(dialog:not(#zone-browser-dialog),.orders-panel) h3 {font-size:.9375rem!important;line-height:1.4;overflow-wrap:anywhere}
body.hq-battle :is(dialog:not(#zone-browser-dialog),.orders-panel) :is(p,label,td,th,dt,dd,output,li,summary,.saved-plan-copy,.share-settings) {min-width:0;max-width:100%;box-sizing:border-box;overflow-wrap:anywhere}
body.hq-battle :is(dialog:not(#zone-browser-dialog),.orders-panel) :is(p,label,summary,td,th,dt,dd){font-size:.8125rem;line-height:1.48}
body.hq-battle :is(dialog:not(#zone-browser-dialog),.orders-panel) :is(small,.small,.dialog-note,.muted,.help-tip,.saved-plan-copy small,.saved-plan-state,.plan-library-status){font-size:.8125rem!important;line-height:1.43;color:var(--zp-muted)}
body.hq-battle :is(dialog:not(#zone-browser-dialog),.orders-panel) :is(button,summary,select,input:not([type=checkbox]):not([type=radio]),textarea){
 box-sizing:border-box;min-height:44px!important;max-width:100%;min-width:0;line-height:1.35;
}
body.hq-battle :is(dialog:not(#zone-browser-dialog),.orders-panel) :is(button,summary){font-size:.8125rem!important;white-space:normal!important;overflow-wrap:anywhere}
body.hq-battle :is(dialog:not(#zone-browser-dialog),.orders-panel) button {min-width:44px!important;height:auto!important}
body.hq-battle :is(dialog:not(#zone-browser-dialog),.orders-panel) :is(select,input:not([type=checkbox]):not([type=radio]),textarea){font-size:1rem!important}
body.hq-battle :is(dialog:not(#zone-browser-dialog),.orders-panel) :is(select,input[type=text],input[type=number],textarea){background-color:#10212a;color:#edf3f4;border-color:var(--zp-border)}
body.hq-battle :is(dialog:not(#zone-browser-dialog),.orders-panel) label:has(> input:is([type=checkbox],[type=radio])) {min-height:44px;display:flex;align-items:center;gap:.5rem}
body.hq-battle :is(dialog:not(#zone-browser-dialog),.orders-panel) input:is([type=checkbox],[type=radio]) {flex:none}
body.hq-battle :is(dialog:not(#zone-browser-dialog),.orders-panel) summary {align-content:center;cursor:pointer}
body.hq-battle dialog:not(#zone-browser-dialog) .tw-lang-toggle{margin:0;max-width:100%;height:auto!important;padding:.3rem .5rem;justify-self:end;font-size:.8125rem!important}
body.hq-battle dialog:not(#zone-browser-dialog) :is(.dialog-header,.commander-settings-heading) > button[data-close],body.hq-battle dialog:not(#zone-browser-dialog) .help-close {width:44px;height:44px!important;padding:0;display:grid;place-items:center;justify-self:end;font-size:1.3rem!important}
body.hq-battle :is(dialog:not(#zone-browser-dialog),.orders-panel) :is(input,select,button,summary,textarea):focus-visible{outline:2px solid var(--zp-accent);outline-offset:2px}
body.hq-battle .zone-action-group {margin:.55rem 0;padding:0;border-block-start:1px solid var(--zp-border)}
body.hq-battle .zone-action-group > summary {padding:.35rem 0;text-align:start;color:var(--zp-accent);font-weight:600}
body.hq-battle .zone-group-body {display:grid;gap:.4rem}
body.hq-battle #plan-dialog .plan-actions,body.hq-battle #zone-plan-more .zone-group-body {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,7rem),1fr));gap:.4rem}
body.hq-battle #plan-dialog .plan-actions {border-top:1px solid var(--zp-border);padding-top:.65rem}
body.hq-battle #plan-dialog #new-plan {border-color:#55897c;background:#22423e;color:#d1f6ea}
body.hq-battle #plan-dialog .plan-library-tabs {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.3rem}
body.hq-battle #plan-dialog .plan-library-list {max-height:none;overflow:visible;scrollbar-gutter:auto}
body.hq-battle #plan-dialog .saved-plan-row {gap:.5rem;padding:.45rem .55rem}
body.hq-battle #plan-dialog .saved-plan-copy strong {font-size:.9375rem}
body.hq-battle #plan-dialog .saved-plan-state,body.hq-battle #plan-dialog .saved-plan-zone {font-size:.8125rem}
body.hq-battle #plan-dialog .saved-plan-state {overflow-wrap:anywhere;flex:0 1 auto}
body.hq-battle .orders-panel #order-count {font-size:.875rem}
body.hq-battle .orders-panel .summary-strip {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,6.5rem),1fr));gap:.4rem}
body.hq-battle .orders-panel .summary-strip :is(span,strong) {font-size:.8125rem;line-height:1.45;overflow-wrap:anywhere}
body.hq-battle .orders-panel .summary-strip strong {font-size:.975rem}
body.hq-battle .orders-panel .empty {padding:.75rem .6rem}
body.hq-battle .orders-panel .empty-mark {display:none}
body.hq-battle .orders-panel .empty h3 {margin:.15rem 0 .3rem}
body.hq-battle .orders-panel .empty p {margin:0}
body.hq-battle .orders-panel .order-list {min-width:0}
body.hq-battle .orders-panel .orders-heading-actions {align-self:center}
body.hq-battle #zone-order-timing .zone-group-body :is(button,p){margin:0}
body.hq-battle .zone-help-topic {display:none}
body.hq-battle #map-settings-dialog :is(.map-toggles,.terrain-legend,.border-legend) {display:flex;align-items:start;flex-wrap:wrap;gap:.35rem .75rem}
body.hq-battle #map-settings-dialog :is(.map-options,.map-about,.map-advanced) {min-width:0;max-width:100%}
body.hq-battle #map-settings-dialog :is(.border-help,.map-limits,.art-help,.map-about) {font-size:.8125rem;line-height:1.45}
body.hq-battle #locations-dialog #gate-list {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,6rem),1fr));gap:.4rem}
body.hq-battle #files-dialog .file-label {display:block}
body.hq-battle #files-dialog .file-label input[type=file] {width:100%}
body.hq-battle #files-dialog .file-label input::file-selector-button {min-height:44px;max-width:100%;border-radius:.4rem;white-space:normal}
body.hq-battle #commander-settings-panel .commander-unit-heading {display:flex;flex-wrap:wrap;gap:.5rem;justify-content:space-between;align-items:center}
body.hq-battle #commander-settings-panel .minute-stepper {grid-template-columns:44px minmax(4ch,1fr) 44px;max-width:100%}
body.hq-battle #commander-settings-panel .minute-stepper :is(button,input) {min-width:0;width:100%}
body.hq-battle dialog:not(#zone-browser-dialog) :is(.default-presets,.commander-presets,.crew-options,.commander-apply-actions,.dialog-actions,.route-primary-actions,.route-danger-actions,.default-fields,.two-fields) {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,6rem),1fr));gap:.4rem}
body.hq-battle #times-dialog :is(.unit-slider-heading,.unit-ready,.unit-march,.default-ready) {flex-wrap:wrap;min-width:0;max-width:100%}
body.hq-battle #times-dialog #plan-unit-range {width:100%;min-width:0}
body.hq-battle #times-dialog .time-matrix :is(caption,th,td) {font-size:.8125rem}
body.hq-battle #times-dialog .time-matrix input {width:100%;min-width:0;max-width:100%;padding:.35rem}
body.hq-battle #times-dialog section {min-width:0}
body.hq-battle #coordinates-dialog form {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.45rem}
body.hq-battle #coordinates-dialog form label:has(select) {grid-column:1/-1}
body.hq-battle #coordinates-dialog form button {grid-column:1/-1}
body.hq-battle #coordinates-dialog form :is(select,input) {width:100%}
@media(max-width:700px){
 body.hq-battle dialog:not(#zone-browser-dialog) {width:min(100% - 16px,35rem)!important;max-height:calc(100dvh - 16px)!important}
 body.hq-battle #planner-help-dialog[open] {display:block;overflow:auto}
 body.hq-battle #planner-help-dialog .help-topics {display:none}
 body.hq-battle #planner-help-dialog .zone-help-topic {display:block;width:100%;margin:.5rem 0}
 body.hq-battle #planner-help-dialog :is(.help-body,.help-footer){max-height:none;overflow:visible;padding:.45rem 0}
 body.hq-battle #planner-help-dialog .help-footer{display:flex;align-items:center;flex-wrap:wrap;gap:.4rem}
 body.hq-battle #planner-help-dialog .help-footer button {flex:1 1 5rem}
 body.hq-battle #planner-help-dialog .help-steps {gap:.7rem}
 body.hq-battle #orders-dialog #mobile-orders-slot .panel-heading {display:none}
 body.hq-battle #orders-dialog .orders-panel {width:auto;min-width:0;display:block;padding:0;border:0;background:transparent;overflow:visible;max-height:none}
 body.hq-battle #orders-dialog .order-list {overflow:visible;max-height:none;margin:.45rem 0}
 body.hq-battle #orders-dialog .orders-panel>#briefing-button {margin-top:.4rem}
 body.hq-battle #times-dialog .time-matrix {display:block;width:100%;table-layout:auto}
 body.hq-battle #times-dialog .time-matrix caption {display:block;text-align:start;line-height:1.45;margin:.4rem 0}
 body.hq-battle #times-dialog .time-matrix thead {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 body.hq-battle #times-dialog .time-matrix tbody {display:grid;gap:.75rem}
 body.hq-battle #times-dialog .time-matrix tr {display:block;text-align:start}
 body.hq-battle #times-dialog .time-matrix th {display:block;text-align:start;width:auto;padding:.5rem 0}
 body.hq-battle #times-dialog .time-matrix td {display:grid;grid-template-columns:minmax(0,1fr) minmax(5.3rem,1fr);align-items:center;gap:.12rem .5rem;text-align:start;border:0;border-block-start:1px solid var(--zp-border);padding:.45rem 0}
 body.hq-battle #times-dialog .time-matrix td::before {content:attr(data-crew-label);overflow-wrap:anywhere}
 body.hq-battle #times-dialog .time-matrix td small{grid-column:1/-1;font-size:.8125rem}
 body.hq-battle #briefing-dialog[open]{display:block;overflow:auto}
 body.hq-battle #briefing-dialog :is(.share-layout,.share-footer,.share-settings,.share-preview-actions,.share-frame-controls,.share-actions){max-width:100%;min-width:0;height:auto;max-height:none;overflow:visible}
 body.hq-battle #briefing-dialog .share-layout {display:flex;flex-direction:column;gap:.6rem;container-type:normal}
 body.hq-battle #briefing-dialog .share-frame-controls {display:flex;flex-wrap:wrap;align-items:center}
 body.hq-battle #briefing-dialog #share-zoom {flex:1 1 6rem;width:auto;min-width:4rem}
 body.hq-battle #briefing-dialog :is(.share-preview-actions,.share-actions){display:flex;flex-wrap:wrap;gap:.4rem}
 body.hq-battle #briefing-dialog :is(.share-preview-actions,.share-actions)>button:not([hidden]){flex:1 1 6rem}
 body.hq-battle #briefing-dialog .share-footer {position:static;display:block;margin-top:.75rem}
 body.hq-battle #routes-dialog .route-settings>label,body.hq-battle #map-settings-dialog .marker-display {display:grid;grid-template-columns:minmax(0,1fr);gap:.25rem}
 body.hq-battle #routes-dialog .route-settings>label :is(input,select),body.hq-battle #map-settings-dialog .marker-display select {width:100%}
 body.hq-battle #default-timing-dialog .remember-timing {white-space:normal}
 body.hq-battle #default-timing-dialog .remember-timing span {min-width:0}
 body.hq-battle #default-timing-dialog .default-fields,body.hq-battle #commander-settings-panel .commander-arrival {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,9rem),1fr));gap:.4rem}
 body.hq-battle #plan-clock-dialog input[type=datetime-local]{width:100%}
}
@media(max-width:360px){
 body.hq-battle dialog:not(#zone-browser-dialog) :is(.dialog-header,.commander-settings-heading) {grid-template-columns:minmax(0,1fr) auto!important;gap:3px 6px!important}
 body.hq-battle dialog:not(#zone-browser-dialog) :is(.dialog-header,.commander-settings-heading)>h2 {grid-column:1!important;grid-row:1}
 body.hq-battle dialog:not(#zone-browser-dialog) :is(.dialog-header,.commander-settings-heading)>.tw-lang-toggle {grid-column:1/-1;grid-row:2;justify-self:start}
 body.hq-battle dialog:not(#zone-browser-dialog) :is(.dialog-header,.commander-settings-heading)>:is([data-close],.help-close,#commander-close-settings) {grid-column:2;grid-row:1}
 body.hq-battle #plan-dialog .saved-plan-row {flex-wrap:wrap}
 body.hq-battle #plan-dialog .saved-plan-state {margin-inline-start:auto}
 body.hq-battle #times-dialog .time-matrix td {grid-template-columns:minmax(0,1fr) minmax(4.25rem,1fr)}
}
body.hq-battle #plan-dialog :is(.plan-actions[hidden],.plan-actions[hidden]+#zone-plan-more){display:none!important}
body.hq-battle #commander-settings-panel .commander-apply-actions {grid-template-columns:repeat(auto-fit,minmax(min(100%,7.25rem),1fr));position:static}
body.hq-battle #commander-settings-panel .commander-apply-actions>button {grid-column:auto!important;grid-row:auto!important}
body.hq-battle #commander-settings-panel #commander-units-number,body.hq-battle #times-dialog .unit-slider-heading input[type=number] {width:6.5ch!important;min-width:5.5ch!important;padding-inline:.3rem;box-sizing:content-box}
body.hq-battle #map-settings-dialog label.toggle,body.hq-battle #map-settings-dialog label.toggle span {min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}
body.hq-battle dialog:not(#zone-browser-dialog) {--tw-language-control-height:44px}
body.hq-battle:has(dialog:not(#zone-browser-dialog)[open]) .tw-lang-option {min-height:44px}
body.hq-battle :is(#route-switcher,#route-lines-popover) {
 max-width:calc(100vw - 16px);box-sizing:border-box;font-size:.875rem;
}
body.hq-battle :is(#route-switcher,#route-lines-popover) :is(h2,h3,strong,small,span,p,summary,label) {min-width:0;overflow-wrap:anywhere}
body.hq-battle :is(#route-switcher,#route-lines-popover) :is(button,summary) {
 min-width:44px;min-height:44px!important;height:auto;max-width:100%;padding-block:.35rem;
 font-size:.8125rem!important;line-height:1.4;white-space:normal;box-sizing:border-box;
}
body.hq-battle #route-switcher :is(.quick-routes-header,.quick-editor-heading) {flex-wrap:wrap;gap:.3rem .5rem}
body.hq-battle :is(#route-switcher,#route-lines-popover) h2 {font-size:1.0625rem;line-height:1.28}
body.hq-battle #route-switcher :is(h3,.quick-route-copy strong) {font-size:.9rem;line-height:1.4}
body.hq-battle #route-switcher :is(small,.small,.quick-routes-context,.quick-routes-note,.quick-route-copy small) {font-size:.8125rem!important;line-height:1.4;white-space:normal;overflow:visible;text-overflow:clip}
body.hq-battle #route-switcher :is(.quick-route-copy,.quick-route-copy strong) {white-space:normal;overflow:visible;max-width:100%}
body.hq-battle #route-switcher .quick-route-row {display:grid;grid-template-columns:minmax(0,1fr) minmax(6rem,auto) 44px;gap:4px;align-items:stretch}
body.hq-battle #route-switcher .quick-route-row .quick-route-edit {width:44px;min-width:44px;align-self:center}
body.hq-battle #route-switcher .quick-route-row .quick-route-timing {width:auto;max-width:none;align-self:center}
body.hq-battle #route-switcher .quick-route-row .quick-route {min-width:0;min-height:44px}
body.hq-battle #route-switcher .quick-route-fields {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,9rem),1fr));gap:.4rem}
body.hq-battle #route-switcher .quick-route-fields input {min-height:44px;width:100%;max-width:100%;font-size:1rem}
body.hq-battle #route-switcher :is(.quick-add-choices,.quick-primary-actions,.quick-routes-footer,.quick-route-removal) {display:flex;flex-wrap:wrap;gap:.4rem}
body.hq-battle #route-switcher :is(.quick-add-choices,.quick-primary-actions,.quick-routes-footer,.quick-route-removal)>button:not([hidden]) {flex:1 1 7rem}
body.hq-battle #route-switcher #quick-route-list {width:100%;min-width:0}
@media(max-width:360px) {
 body.hq-battle #route-switcher .quick-route-row {grid-template-columns:minmax(0,1fr) 44px}
 body.hq-battle #route-switcher .quick-route-row .quick-route-timing{grid-row:2;grid-column:1;width:100%}
 body.hq-battle #route-switcher .quick-route-row .quick-route-edit{grid-column:2;grid-row:1}
}
body.hq-battle #default-timing-dialog .default-fields label {display:grid;grid-template-columns:minmax(0,1fr);min-width:0;max-width:100%}
body.hq-battle #default-timing-dialog .default-fields :is(select,input) {width:100%!important;min-width:0!important;max-width:100%!important;box-sizing:border-box}
body.hq-battle #default-timing-dialog .default-fields label>span {min-width:0;overflow-wrap:anywhere}
@media(max-width:700px){
 body.hq-battle #map-settings-dialog .map-options {display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:.5rem;align-items:start}
 body.hq-battle #map-settings-dialog .map-options>* {grid-column:1!important;grid-row:auto!important;min-width:0;max-width:100%;width:auto}
 body.hq-battle #map-settings-dialog .map-options>.zone-map-choice {width:100%}
 body.hq-battle #map-settings-dialog .map-options>.small {margin:0;max-width:100%}
 body.hq-battle #map-settings-dialog .map-options>#whole-map {justify-self:start}
}
@media(max-width:700px){
 body.hq-battle #route-switcher .quick-routes-header {position:static}
}
body.hq-battle dialog:not(#zone-browser-dialog) .zone-native-choice {
 position:relative;display:flex;align-items:center;min-width:0;max-width:100%;min-height:44px;overflow:hidden;
 box-sizing:border-box;padding:.45rem 1.7rem .45rem .5rem;background:#10212a;color:#edf3f4;border:1px solid var(--zp-border);border-radius:.4rem;
}
body.hq-battle dialog:not(#zone-browser-dialog) .zone-native-choice::after {
 content:'';position:absolute;inset-inline-end:.6rem;top:50%;width:.4rem;height:.4rem;border:solid currentColor;
 border-width:0 2px 2px 0;transform:translateY(-70%) rotate(45deg);pointer-events:none;
}
body.hq-battle dialog:not(#zone-browser-dialog) .zone-native-choice>.zone-selected-value {
 display:block;position:static;min-width:0;max-width:100%;font-size:1rem;line-height:1.35;white-space:normal;overflow-wrap:anywhere;pointer-events:none;
}
body.hq-battle dialog:not(#zone-browser-dialog) .zone-native-choice>select {
 position:absolute;inset:0;opacity:0;min-width:0!important;max-width:100%!important;width:100%!important;height:100%!important;cursor:pointer;
}
body.hq-battle dialog:not(#zone-browser-dialog) .zone-native-choice:focus-within {outline:2px solid var(--zp-accent);outline-offset:2px}
body.hq-battle #briefing-dialog .share-settings>label:has(#share-area) {display:grid;grid-template-columns:minmax(0,1fr);width:100%;gap:.25rem}
body.hq-battle #briefing-dialog .share-settings>label .zone-native-choice {width:100%}

body[data-zone-preview] {
 --wz-surface:#14252f;--wz-edge:#39515b;--wz-muted:#b6cad0;--wz-accent:#96e1d3;
}
body[data-zone-preview] main {position:relative;padding:0!important;gap:0!important;isolation:isolate}
body[data-zone-preview] .wz-bar {
 display:flex!important;flex:0 0 auto;justify-content:space-between;align-items:center;gap:8px;
 min-width:0;min-height:44px;height:auto!important;padding:2px clamp(8px,2vw,22px);margin:0;border:0;border-bottom:1px solid var(--wz-edge);background:#11232d;color:#e8eff2;z-index:4
}
body[data-zone-preview] .wz-title,body[data-zone-preview] .wz-bar-actions {display:flex;align-items:center;gap:8px;min-width:0}
body[data-zone-preview] .wz-title {flex-wrap:wrap;gap:2px 10px}
body[data-zone-preview] .wz-bar h1 {position:static;margin:0;font-size:clamp(1rem,.95rem + .35vw,1.25rem)!important;line-height:1.2;letter-spacing:-.015em;overflow-wrap:anywhere}
body[data-zone-preview] #wz-location {font-size:.8125rem;color:var(--wz-muted);line-height:1.3;overflow-wrap:anywhere}
body[data-zone-preview] .wz-bar-actions {flex:none;gap:4px}
body[data-zone-preview] .wz-bar-actions button,body[data-zone-preview] #wz-close {
 display:inline-flex;align-items:center;justify-content:center;gap:.38rem;min-height:44px;min-width:44px;max-width:100%;
 padding:5px 9px;font:600 .8125rem/1.25 inherit;font-family:inherit;font-size:.8125rem;font-weight:600;line-height:1.25;
 color:#dce9ec;background:#182e37;border:1px solid #38525b;border-radius:.48rem;cursor:pointer
}
body[data-zone-preview] .wz-bar-actions button:is([aria-expanded=true],[aria-pressed=true]) {background:#1f4549;color:#b9f7ea;border-color:#578e88}
body[data-zone-preview] .wz-icon {width:18px;height:18px;display:block;flex:none}
body[data-zone-preview] :is(.wz-leave,.wz-enter) {display:inline-flex;align-items:center}
body[data-zone-preview]:not([data-map-focus]) .wz-leave,body[data-zone-preview][data-map-focus] .wz-enter {display:none}
body[data-zone-preview] #wz-setup-panel[hidden],body[data-zone-preview] #wz-failure[hidden] {display:none!important}
body[data-zone-preview] #wz-setup-panel {
 display:grid!important;position:fixed!important;inset:auto 8px auto auto;z-index:12;
 width:min(26rem,calc(100% - 16px));max-width:none;max-height:var(--wz-max-height,75dvh);
 grid-template-columns:minmax(0,1fr)!important;grid-auto-rows:max-content;gap:.65rem;height:auto;min-height:0;
 box-sizing:border-box;align-content:start;overflow:auto;overscroll-behavior:contain;padding:10px 12px;
 border:1px solid var(--wz-edge);border-radius:.75rem;background:#11232d;color:#e3eff0;box-shadow:0 10px 40px #020b11a6
}
body[data-zone-preview] #wz-setup-panel :is(button,select,a) {font-family:inherit;font-size:.875rem;line-height:1.35;min-height:44px;min-width:0;box-sizing:border-box;white-space:normal;overflow-wrap:anywhere}
body[data-zone-preview] #wz-setup-panel button:not(#wz-close) {background:#192e38;color:#deebee;border:1px solid var(--wz-edge);border-radius:.45rem;cursor:pointer}
body[data-zone-preview] .wz-panel-head,body[data-zone-preview] .wz-panel-footer {display:flex;align-items:center;justify-content:space-between;gap:8px}
body[data-zone-preview] .wz-panel-head h2 {font-size:1rem;line-height:1.25;margin:0}
body[data-zone-preview] #wz-close {width:44px;padding:0}
body[data-zone-preview] .wz-pickers,body[data-zone-preview] .wz-timing {display:grid;align-items:end;grid-template-columns:repeat(auto-fit,minmax(min(100%,8rem),1fr));gap:8px}
body[data-zone-preview] #wz-setup-panel :is(.wz-pickers>div,.active-route-copy,.zone-plan-copy) {display:grid;align-items:center;gap:.15rem;min-width:0;width:auto;margin:0}
body[data-zone-preview] .wz-pickers [data-wz],body[data-zone-preview] #tech-bonus-button>span {color:var(--wz-muted);font-size:.8125rem;line-height:1.35}
body[data-zone-preview] #wz-setup-panel :is(#zone-browser-button,#route-settings-button) {position:static;display:flex;width:100%;height:auto;max-width:100%;padding:.35rem .45rem;gap:6px;min-width:0;align-items:center;justify-content:space-between}
body[data-zone-preview] #wz-setup-panel #zone-browser-current {display:flex;flex-wrap:wrap;align-items:center;gap:2px .3rem;min-width:0}
body[data-zone-preview] #wz-setup-panel :is(#zone-browser-edition,#zone-browser-zone,#active-route-name,#open-plan-name,#active-route-time) {display:block;position:static;min-width:0;height:auto;max-width:none;overflow:visible;white-space:normal;font-size:.8125rem;line-height:1.3;overflow-wrap:anywhere}
body[data-zone-preview] #wz-setup-panel :is(#open-plan-name,#active-route-time) {color:var(--wz-muted);font-size:.75rem}
body[data-zone-preview] #wz-setup-panel .map-plan-actions,body[data-zone-preview] #wz-setup-panel .workspace-actions {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,6.6rem),1fr));gap:6px;margin:0;width:100%;max-width:none;min-width:0}
body[data-zone-preview] #wz-setup-panel .commander-route-actions {grid-column:1/-1;min-width:0;flex-wrap:wrap}
body[data-zone-preview] #wz-setup-panel .commander-route-actions[hidden] {display:none!important}
body[data-zone-preview] #wz-setup-panel :is(#map-start-button,#map-destination-button,#route-timing-button,#plan-menu-button,#orders-toggle,#planner-help,#share-plan-button) {display:flex;flex-direction:row;align-items:center;justify-content:center;gap:.3rem;min-width:44px;width:100%;height:auto;padding:.3rem .45rem;font-size:.875rem}
body[data-zone-preview] #wz-setup-panel :is(#map-start-button,#map-destination-button,#route-timing-button,#plan-menu-button,#orders-toggle)::before,
body[data-zone-preview] #wz-setup-panel :is(#map-start-button,#map-destination-button,#route-timing-button,#plan-menu-button,#orders-toggle)::after {content:none!important;display:none!important}
body[data-zone-preview] #wz-setup-panel :is(#map-start-button,#route-timing-button)>span {display:inline!important}
body[data-zone-preview] #wz-setup-panel :is(button).active,body[data-zone-preview] #wz-setup-panel button[aria-pressed=true] {border-color:#589d92;background:#204047}
body[data-zone-preview] #wz-setup-panel #tech-bonus-button {display:grid;gap:.15rem;min-width:0;width:100%;height:auto;padding:0;border:0;background:none;position:static}
body[data-zone-preview] #wz-setup-panel #tech-bonus-value {display:none}
body[data-zone-preview] #wz-setup-panel #tech-bonus-level {display:block;position:static;opacity:1;inset:auto;width:100%;max-width:100%;padding:.3rem;font-size:1rem;background:#142933;color:#e3eff0;border:1px solid var(--wz-edge);border-radius:.45rem}
body[data-zone-preview] .wz-panel-footer {flex-wrap:wrap;border-top:1px solid var(--wz-edge);padding-top:.15rem}
body[data-zone-preview] #wz-setup-panel #save-state {position:static;display:block;font-size:.8125rem;line-height:1.35;margin:0;color:var(--wz-muted)}
body[data-zone-preview] #wz-setup-panel #wz-guide {display:flex;align-items:center;color:var(--wz-accent);text-underline-offset:.2em}
body[data-zone-preview] main>.workspace {min-height:0;flex:1 1 0%;margin:0;padding:0;max-width:none}
body[data-zone-preview][data-map-focus] > header,body[data-zone-preview][data-map-focus] > .hq-breadcrumbs,body[data-zone-preview][data-map-focus] .wz-title {display:none!important}
body[data-zone-preview][data-map-focus] main {position:fixed!important;inset:0;z-index:1000;display:flex;height:100dvh!important;width:100%;padding:0;margin:0;max-width:none}
body[data-zone-preview][data-map-focus] .wz-bar {position:absolute;inset:max(6px,env(safe-area-inset-top)) max(6px,env(safe-area-inset-right)) auto auto;min-height:0;margin:0;padding:0;background:transparent;border:0;pointer-events:none}
body[data-zone-preview][data-map-focus] .wz-bar-actions {pointer-events:auto;background:#10232bf2;border-radius:8px;box-shadow:0 2px 7px #07131866}
body[data-zone-preview][data-map-focus] .wz-bar-actions button {color:#f2faf9;background:#142932f5;border-color:#496169}
body[data-zone-preview][data-map-focus] #wz-map-focus .wz-full-label {display:none}
body[data-zone-preview] :is(.wz-static,#wz-failure) {padding:.6rem 1rem;overflow:auto;font-size:.9rem;line-height:1.55}
body[data-zone-preview] :is(.wz-static,#wz-failure) nav {display:flex;align-items:center;flex-wrap:wrap;gap:.3rem 1rem}
body[data-zone-preview] :is(.wz-static,#wz-failure) nav a,body[data-zone-preview] #wz-retry {display:inline-flex;align-items:center;min-height:44px}
body[data-zone-preview][data-wz-failed] :is(.workspace,.wz-bar-actions,#commander-route,#route-search-status){display:none!important}
body[data-zone-preview] :is(.wz-bar,#wz-setup-panel) :focus-visible {outline:2px solid var(--wz-accent);outline-offset:-3px}
@media(max-width:560px),(max-height:500px) {
 body[data-zone-preview] .wz-full-label {display:none}
 body[data-zone-preview] .wz-bar {padding-inline:6px}
}
@media(max-width:360px) {
 body[data-zone-preview] .wz-title {display:block}
 body[data-zone-preview] #wz-location {display:none}
}
/* A zone picker can scroll at larger text settings without burying its map or action. */
body[data-zone-preview] #zone-browser-dialog {width:min(49rem,calc(100vw - 12px));height:min(52rem,calc(100dvh - 12px));max-height:calc(100dvh - 12px);margin:auto;border-radius:.75rem;overflow:auto;overscroll-behavior:contain;background:#132630}
body[data-zone-preview] #zone-browser-dialog[open] {display:flex;flex-flow:column;align-items:stretch}
body[data-zone-preview] #zone-browser-dialog :is(.zb-header,.zb-campaign,.zb-selection,footer) {flex:none;min-width:0;position:static;gap:6px;padding:6px 10px;flex-wrap:wrap}
body[data-zone-preview] #zone-browser-dialog .zb-header {display:flex;align-items:center;justify-content:space-between}
body[data-zone-preview] #zone-browser-dialog .zb-header h2 {display:flex;flex-wrap:wrap;flex:1 1 5rem;gap:4px;margin:0;white-space:normal;overflow:visible;font-size:.9rem;line-height:1.35}
body[data-zone-preview] #zone-browser-dialog .zb-zone-code {height:auto;min-height:1.5rem;max-width:100%;white-space:normal;line-height:1.3;font-size:.875rem}
body[data-zone-preview] #zone-browser-dialog :is(button,select) {min-height:44px;min-width:44px;height:auto;max-width:100%;font-size:.875rem;line-height:1.3;white-space:normal;overflow-wrap:anywhere}
body[data-zone-preview] #zone-browser-dialog select {font-size:1rem}
body[data-zone-preview] #zone-browser-dialog :is(.zb-selection,.zb-map-options,.zb-current,.zb-create) {min-width:0}
body[data-zone-preview] #zone-browser-dialog .zb-map-wrap {position:relative;flex:1 0 10rem;min-height:135px;width:auto;margin:0 8px}
body[data-zone-preview] #zone-browser-dialog .zb-legend,body[data-zone-preview] #zone-browser-dialog .zb-same,body[data-zone-preview] #zone-browser-dialog .zb-help {line-height:1.4;font-size:.75rem;white-space:normal;overflow-wrap:anywhere}
body[data-zone-preview] #zone-browser-dialog .zb-selection {display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:end}
body[data-zone-preview] #zone-browser-dialog .zb-selection label {min-width:0;max-width:100%}
body[data-zone-preview] #zone-browser-dialog .zb-selection label span {font-size:.8125rem}
body[data-zone-preview] #zone-browser-dialog .zb-selection select {min-width:0;width:100%}
body[data-zone-preview] #zone-browser-dialog footer {display:flex}
body[data-zone-preview] #zone-browser-dialog footer button {flex:1 1 9rem;max-width:100%}
body[data-zone-preview] #zone-browser-dialog .zb-map-tools {gap:2px;max-width:100%}
body[data-zone-preview] #zone-browser-dialog .zb-map-tools button {font-size:.875rem}
@media(max-width:560px) {
 body[data-zone-preview] #zone-browser-dialog .zb-help {position:static;max-width:100%;padding:4px 8px;margin:0;order:2}
 body[data-zone-preview] #zone-browser-dialog .zb-map-wrap {min-height:160px}
}
body[data-zone-preview] #wz-setup-panel:not([hidden]) {display:flex!important;flex-direction:column;align-items:stretch}
body[data-zone-preview] #wz-setup-panel > * {flex:0 0 auto;grid-area:auto!important;order:0;position:static;min-width:0;max-width:100%;width:auto;margin:0}
body[data-zone-preview] #wz-setup-panel .wz-pickers > div {grid-template-columns:minmax(0,1fr);grid-auto-flow:row}
body[data-zone-preview] #wz-setup-panel .workspace-actions {grid-template-columns:repeat(2,minmax(0,1fr))}
body[data-zone-preview] #wz-setup-panel #planner-help span {display:inline;width:auto;height:auto;max-width:100%;border:0;padding:0;background:none;line-height:inherit;font-size:inherit}
body[data-zone-preview] #wz-setup-panel #wz-close {flex:0 0 44px}
@media(max-width:360px) {
 body[data-zone-preview] #wz-setup-panel .wz-timing {align-items:start}
}
body[data-zone-preview] #zone-browser-dialog button.tw-lang-toggle {--tw-control-height:44px;min-height:44px!important;height:auto!important}
body[data-zone-preview][data-map-focus] .workspace>.orders-panel:not([hidden]) {
 position:absolute;inset:55px 6px 6px auto;z-index:5;width:min(24rem,calc(100% - 12px));max-height:calc(100% - 65px);
 overflow:auto;background:var(--wz-surface);border:1px solid var(--wz-edge);border-radius:.6rem;box-shadow:0 5px 24px #06131bb0
}
body[data-zone-preview][data-map-focus] .workspace {grid-template-columns:minmax(0,1fr)!important}
@media(max-height:500px),(max-width:380px) and (max-height:610px) {
 body[data-zone-preview] header[data-hq-masthead].homepage-shared-header .header-inner .desktop-shortcuts {display:none!important}
}
body[data-zone-preview] #wz-setup-panel .wz-panel-head h2 {min-width:0;overflow-wrap:anywhere}
body[data-zone-preview] #wz-setup-panel #save-state {min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}
body[data-zone-preview] #wz-setup-panel .wz-pickers .wz-route {display:flex;align-items:stretch;flex-direction:column}
body[data-zone-preview] #wz-setup-panel .wz-star-input {position:relative;display:block;min-width:0}
body[data-zone-preview] #wz-setup-panel .wz-star-face {display:flex;align-items:center;justify-content:space-between;gap:.35rem;min-height:44px;min-width:0;box-sizing:border-box;padding:.32rem .45rem;border:1px solid var(--wz-edge);border-radius:.45rem;background:#152c35;color:#e4eff0;font-size:.875rem;line-height:1.3;overflow-wrap:anywhere}
body[data-zone-preview] #wz-setup-panel .wz-star-face::after {content:'';flex:none;width:.4rem;height:.4rem;border:solid #b2cacf;border-width:0 1.5px 1.5px 0;transform:rotate(45deg)}
body[data-zone-preview] #wz-setup-panel .wz-star-input #tech-bonus-level {position:absolute;inset:0;opacity:0;cursor:pointer;width:100%;height:100%}
body[data-zone-preview] #wz-setup-panel .wz-star-input:focus-within .wz-star-face {outline:2px solid var(--wz-accent);outline-offset:-3px}
body[data-zone-preview] #zone-browser-dialog .zb-header .tw-lang-toggle {--tw-lang-height:44px!important;min-height:44px!important;min-width:44px!important}
@media(max-height:500px),(max-width:380px) and (max-height:610px) {
 body.hq-battle[data-zone-preview][data-atlas] header[data-hq-masthead][data-shared-ssr].homepage-shared-header .header-inner .desktop-shortcuts{display:none!important}
 body.hq-battle[data-zone-preview][data-atlas] header[data-hq-masthead][data-shared-ssr].homepage-shared-header .header-inner {grid-template-rows:auto!important;min-height:44px!important;padding-block:0}
 body.hq-battle[data-zone-preview] main#hq-main-content {margin:0!important}
}
@media(max-width:700px),(max-height:500px) {
 body[data-zone-preview] #route-switcher:popover-open {
   position:fixed!important;inset:8px 6px auto!important;width:min(calc(100vw - 12px),28rem)!important;min-width:0;
   height:auto!important;max-height:calc(100dvh - 16px)!important;margin:0 auto!important;box-sizing:border-box;overflow:auto;overscroll-behavior:contain
 }
 body[data-zone-preview] #route-switcher::backdrop {background:#06111977}
}
body[data-zone-preview] #wz-setup-panel #tech-bonus-button .wz-star-face,
body[data-zone-preview] #wz-setup-panel #tech-bonus-button .wz-star-face>span {white-space:normal!important;min-width:0;max-width:100%;overflow-wrap:anywhere;line-height:1.35;height:auto}
body[data-zone-preview] #wz-setup-panel #tech-bonus-button .wz-star-face>span {display:block;flex:1 1 auto;color:#e3eef0;font-size:inherit}
body[data-zone-preview] dialog#zone-browser-dialog .zb-header button.tw-lang-toggle {--tw-language-control-height:44px!important}

/* Keep touch areas separate from the type scale of the Plan panel. */
@media (max-width: 48rem), (max-height: 32rem) and (pointer: coarse) {
  body[data-zone-preview] #wz-setup-panel #wz-panel-title {
    font-size:.9375rem;
    font-weight:630;
    line-height:1.3;
  }
  body[data-zone-preview] #wz-setup-panel :is(.wz-pickers,.workspace-actions) button:not(#wz-close),
  body[data-zone-preview] #wz-setup-panel :is(#map-start-button,#map-destination-button,#route-timing-button) {
    min-height:44px;
    font-size:.8125rem;
    line-height:1.35;
    font-weight:550;
  }
  body[data-zone-preview] #wz-setup-panel :is(#zone-browser-current,#active-route-name) {
    font-size:.8125rem;
    font-weight:620;
  }
  body[data-zone-preview] #wz-setup-panel #tech-bonus-button .wz-star-face {
    font-size:.8125rem;
    line-height:1.35;
    font-weight:520;
  }
  body[data-zone-preview] #wz-setup-panel #tech-bonus-button > span:first-child,
  body[data-zone-preview] #zone-browser-dialog .zb-selection label > span {
    font-size:.8125rem;
    line-height:1.4;
    font-weight:550;
  }
  body[data-zone-preview] #wz-setup-panel .wz-panel-footer {
    font-size:.8125rem;
    line-height:1.35;
  }
}
@media (max-width:48rem), (max-height:32rem) and (pointer:coarse) {
 body[data-zone-preview] #nav[data-field-menu] .hq-menu-toolbar .directory-filters:not([hidden]) + select.hq-menu-category {
   font-size:.765625rem!important;font-weight:500!important;line-height:1.35!important;min-height:44px!important;
 }
 body[data-zone-preview] #nav[data-field-menu] #site-nav-links .site-nav-group a:not([hidden]) {font-size:.75rem!important;line-height:1.35!important;min-height:44px!important}
 body[data-zone-preview] #wz-setup-panel :is(.wz-pickers,.workspace-actions) button:not(#wz-close) {font-size:.78125rem}
}

/* Keep the map quick actions aligned even when native controls add their own icons. */
body[data-zone-preview] .map-panel #more-map-tools .secondary-map-tools > button {
  display:flex; align-items:center; justify-content:flex-start; text-align:start;
  gap:.45rem; padding:.35rem .55rem; min-inline-size:0; min-block-size:44px; height:auto;
  font-size:.8125rem; line-height:1.32; font-weight:500; border:0;
  border-radius:5px; background:transparent; color:#e0ebee; box-shadow:none;
}
body[data-zone-preview] .map-panel #more-map-tools .secondary-map-tools > button:is(#locations-button,#coordinate-button) {
  border-top:1px solid #3c515a; border-radius:0; color:#bce4db;
}
body[data-zone-preview] .map-panel #more-map-tools .secondary-map-tools > button:is(:hover,:focus-visible) {
  background:#243b43; color:#f4faf9;
}
body[data-zone-preview] .map-panel #more-map-tools .secondary-map-tools > button.active {
  background:#24453f; color:#ccf4e8;
}
body[data-zone-preview] .map-panel #more-map-tools .secondary-map-tools > button :is(.tool-art,.ui-icon),
body[data-zone-preview] .map-panel #more-map-tools .secondary-map-tools > button[data-tool]::before {
  flex:none; width:16px; height:16px; margin:0; object-fit:contain;
}
body[data-zone-preview] .map-panel .map-toolbar #more-map-tools[open]>summary {
  background:#233d43; color:#d8f4ed; border-radius:5px;
}
body[data-zone-preview] .map-panel #layers-button {gap:.25rem}
body[data-zone-preview] .map-panel #layers-button .zone-view-name {display:block;min-width:0;padding:0;white-space:normal;font-size:.8125rem;line-height:1.25;font-weight:500}
body.hq-battle #map-settings-dialog .dialog-header {
  position:sticky; inset-block-start:-1px; z-index:4; background:#172a34; border-bottom:1px solid #3b505a;
}
body.hq-battle #map-settings-dialog .map-options:not(:has(.zone-map-choice)) {display:none!important}
body.hq-battle #map-settings-dialog .zone-map-choice {margin:0;gap:.3rem}
body.hq-battle #map-settings-dialog .map-toggles {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,9.5rem),1fr)); align-items:stretch;
  margin:.35rem 0; padding:.2rem 0; gap:0 .65rem;
}
body.hq-battle #map-settings-dialog .map-toggles label.toggle,
body.hq-battle #map-settings-dialog .map-advanced label.toggle {
  display:flex; align-items:center; justify-content:flex-start; gap:.55rem; margin:0;
  min-height:44px; padding:.2rem 0; box-sizing:border-box; font-size:.8125rem; font-weight:500; line-height:1.35;
}
body.hq-battle #map-settings-dialog label.toggle input {
  width:1rem; height:1rem; min-width:1rem; min-height:1rem; margin:0; flex:0 0 1rem; accent-color:#a5d9c9;
}
body.hq-battle #map-settings-dialog .wz-map-actions {margin:.2rem 0 .55rem}
body.hq-battle #map-settings-dialog :is(.map-advanced,#wz-map-notes) {
  border:0; border-top:1px solid #394e58; border-radius:0; padding:0; margin:.15rem 0 0; background:transparent;
}
body.hq-battle #map-settings-dialog :is(.map-advanced,#wz-map-notes)>summary {
  display:flex; align-items:center; gap:.55rem; min-block-size:44px; padding:.25rem .1rem;
  box-sizing:border-box; font-size:.8125rem; font-weight:550; line-height:1.4; color:#c6e8df;
  background:transparent; border:0; border-radius:3px; list-style:none; cursor:pointer;
}
body.hq-battle #map-settings-dialog :is(.map-advanced,#wz-map-notes)>summary::-webkit-details-marker {display:none}
body.hq-battle #map-settings-dialog :is(.map-advanced,#wz-map-notes)>summary::before {
  content:''; flex:0 0 .4rem; height:.4rem; border:solid currentColor; border-width:0 1.5px 1.5px 0;
  margin-inline:.15rem; transform:rotate(-45deg);
}
body.hq-battle #map-settings-dialog :is(.map-advanced,#wz-map-notes)[open]>summary::before {transform:rotate(45deg)}
body.hq-battle #map-settings-dialog :is(.map-advanced,#wz-map-notes)>summary:focus-visible {outline:2px solid #a4dfcd;outline-offset:-2px}
body.hq-battle #map-settings-dialog .marker-display {display:grid;gap:.3rem;min-width:0}
body.hq-battle #map-settings-dialog .marker-display .zone-native-choice {width:100%;margin:0}
body.hq-battle #map-settings-dialog .marker-display .zone-selected-value {font-size:.875rem;font-weight:500;line-height:1.4;color:#e7f0f1}
body.hq-battle #map-settings-dialog #wz-map-notes p {margin:.45rem 0;font-size:.8125rem;line-height:1.45;overflow-wrap:break-word}
body.hq-battle #map-settings-dialog #wz-map-notes .map-about {padding:0;border:0;background:none}
@media(max-width:720px),(max-width:1100px) and (max-height:540px){
  body.hq-battle #map-settings-dialog .map-options {display:block!important;margin:.35rem 0}
  body.hq-battle #map-settings-dialog .map-options:not(:has(.zone-map-choice)) {display:none!important}
  body.hq-battle #map-settings-dialog .map-toggles {grid-template-columns:repeat(auto-fit,minmax(min(100%,9.75rem),1fr))}
  body[data-zone-preview] .map-panel .map-controls .map-toolbar #layers-button {padding-inline:2px}
}
@media(forced-colors:active){
  body.hq-battle #map-settings-dialog .marker-display .zone-native-choice {border-color:ButtonText;color:ButtonText}
}
/* Native value controls keep their input size when the visible map type is compact. */
body.hq-battle #map-settings-dialog .zone-map-choice {display:grid;grid-template-columns:minmax(0,1fr)}
body.hq-battle #map-settings-dialog .zone-map-choice>label {grid-row:1}
body.hq-battle #map-settings-dialog .zone-map-choice > :is(select,.wz-map-view-value) {
  grid-area:2/1;align-self:stretch;margin:0;min-block-size:44px;box-sizing:border-box;
}
body.hq-battle #map-settings-dialog .zone-map-choice > select {
  opacity:0;position:relative;z-index:1;width:100%;cursor:pointer;font-size:max(16px,1rem);
}
body.hq-battle #map-settings-dialog .wz-map-view-value,body.hq-battle .wz-draw-select {
  position:relative;display:flex;align-items:center;min-width:0;
  background:#10212a;color:#e7f0f1;border:1px solid #415962;border-radius:6px;
  padding:.35rem 1.6rem .35rem .55rem;box-sizing:border-box;font-size:.8125rem;font-weight:500;line-height:1.36;
}
body.hq-battle #map-settings-dialog .wz-map-view-value::after,body.hq-battle .wz-draw-select::after {
  content:'';position:absolute;right:.55rem;top:50%;width:.38rem;height:.38rem;border:solid currentColor;
  border-width:0 1.5px 1.5px 0;transform:translateY(-70%) rotate(45deg);pointer-events:none;
}
body.hq-battle #map-settings-dialog .zone-map-choice select:focus-visible+.wz-map-view-value,
body.hq-battle .wz-draw-select:has(select:focus-visible) {outline:2px solid #a4dfcd;outline-offset:1px}
body.hq-battle .wz-draw-select {align-self:stretch;min-height:44px}
body.hq-battle .wz-draw-select:has(select[hidden]) {display:none!important}
body.hq-battle #wz-map-toolbar .wz-draw-select>select {
  position:absolute;inset:0;opacity:0;width:100%!important;height:100%!important;min-width:0!important;
  font-size:max(16px,1rem)!important;box-sizing:border-box;cursor:pointer;
}
body.hq-battle .wz-draw-select .wz-draw-value {pointer-events:none;overflow-wrap:anywhere}
@media(max-width:720px),(max-width:1100px) and (max-height:540px) {
  body.hq-battle #map-settings-dialog .dialog-header #map-settings-dialog-title {
    font-size:.9375rem!important;line-height:1.24;font-weight:600;
  }
  body.hq-battle #map-settings-dialog :is(.zone-map-choice label,.map-toggles label.toggle,.map-toggles label.toggle span,.map-advanced label.toggle,.map-advanced label.toggle span,.marker-display>span:first-child,.map-advanced>summary,#wz-map-notes>summary,#whole-map,#coordinate-settings-button,.border-legend,.terrain-legend) {
    font-size:.765625rem;line-height:1.38;font-weight:500;
  }
  body.hq-battle #map-settings-dialog :is(.wz-map-view-value,.marker-display .zone-selected-value) {
    font-size:.8125rem;font-weight:500;line-height:1.38;
  }
  body.hq-battle #map-settings-dialog #wz-map-notes p {font-size:.765625rem;line-height:1.48}
  body[data-zone-preview] .map-panel #wz-map-toolbar .map-toolbar :is(button,summary),
  body[data-zone-preview] .map-panel #wz-map-toolbar #layers-button .zone-view-name,
  body[data-zone-preview] .map-panel #wz-map-toolbar #more-map-tools .secondary-map-tools>button,
  body[data-zone-preview] .map-panel #wz-map-toolbar #drawing-tools :is(button,summary,.zone-preset-choice,.wz-draw-select) {
    font-size:.765625rem!important;font-weight:500;line-height:1.3;
  }
  body[data-zone-preview] .map-panel #wz-map-toolbar #drawing-tools :is(button,summary,.zone-preset-choice,.wz-draw-select) {min-height:44px}
  body[data-zone-preview] .map-panel #wz-map-toolbar #drawing-tools .zone-preset-choice>span,
  body[data-zone-preview] .map-panel #wz-map-toolbar .map-toolbar button>span {font-size:inherit;font-weight:inherit}
}
/* More and Style belong to the scrolling tray, including when the map itself is full-screen. */
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar:has(#drawing-tools:not([hidden])) {
  max-block-size:min(63dvh,calc(100% - 68px));overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;
}
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar #drawing-tools:not([hidden]) {display:grid!important;grid-template-columns:minmax(0,1fr);align-items:start;align-content:start;align-self:flex-start;flex:none;width:100%;min-width:0;max-width:100%;height:auto}
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar #drawing-tools .drawing-bottom-row {
  display:flex!important;flex-flow:row wrap!important;align-items:center;flex:1 1 100%;width:100%;min-width:0;gap:3px;
}
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar #drawing-tools .drawing-bottom-row>button {
  flex:0 1 auto;width:auto;max-width:100%;min-width:44px;height:auto;flex-direction:row;
}
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar #drawing-tools .drawing-style-options {
  position:static;inset:auto;order:11;flex:1 0 100%;width:100%;max-width:100%;max-height:none;overflow:visible;box-sizing:border-box;
}
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar #drawing-tools #draw-colours {
  display:flex;flex-wrap:wrap;min-width:0;max-width:100%;
}
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar #drawing-tools .drawing-style-options .wz-draw-select {flex:1 1 6rem}
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar #drawing-tools:has(#drawing-extra[open]) .drawing-top-row,
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar #drawing-tools:has(#drawing-extra[open]) .drawing-edit-hint,
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar #drawing-tools:has(#drawing-extra[open]) .drawing-bottom-row>:not(#drawing-extra) {display:none!important}
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar #drawing-tools:has(#drawing-extra[open]) .drawing-bottom-row {display:block!important}
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar #drawing-tools #drawing-extra[open] {
  position:static;display:block;flex:1 0 100%;width:100%;min-width:0;max-width:100%;margin:0;
}
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar #drawing-tools #drawing-extra[open]>summary {
  justify-content:flex-start;padding-inline:.55rem;gap:.45rem;background:#223d43;color:#c8eee1;border-radius:5px;
}
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar #drawing-tools #drawing-extra[open]>summary::after {
  content:'';width:.4rem;height:.4rem;border:solid currentColor;border-width:1.5px 1.5px 0 0;transform:rotate(-45deg);
}
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar #drawing-tools #drawing-extra[open]>div,
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar #drawing-tools #drawing-context:not([hidden]) {
  position:static;inset:auto;transform:none;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,7rem),1fr));gap:.25rem;
  align-items:start;align-content:start;grid-auto-rows:max-content;width:100%;min-width:0;max-width:100%;height:auto;max-height:none;overflow:visible;
  padding:.25rem 0 0;margin:0;background:transparent;border:0;box-shadow:none;box-sizing:border-box;
}
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar #drawing-tools #drawing-context:not([hidden]) {grid-column:1/-1;padding-bottom:.25rem;border-block-end:1px solid #40545b}
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar #drawing-tools #drawing-extra[open]>div button:not([hidden]) {
  justify-self:stretch;justify-content:flex-start;align-items:center;width:100%;min-width:0;min-height:44px;
  padding:.3rem .45rem;box-sizing:border-box;text-align:start;white-space:normal;overflow-wrap:anywhere;
}
/* Keep Build and its disclosure mark on one line at narrow phone widths. */
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar .map-toolbar #more-tools-label {
  flex-flow:row nowrap;gap:.14rem;padding-inline:2px;
  white-space:nowrap;overflow-wrap:normal;word-break:normal;
}
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar .map-toolbar #more-tools-label::before {
  flex:0 0 14px;width:14px;height:14px;
}
body[data-zone-preview] #wz-map-toolbar #more-tools-label>span,
body[data-zone-preview] #wz-quick-tools #wz-quick-build>span {white-space:nowrap;overflow-wrap:normal;word-break:normal}
@container zone-map-tools (min-width:17.01rem) and (max-width:26rem){
  .map-panel[data-zone-floating] #wz-map-toolbar .map-toolbar {
    grid-template-columns:minmax(44px,1fr) minmax(44px,.9fr) minmax(max-content,1fr) minmax(44px,1.12fr);
  }
}
/* Align all four toolbar buttons in the same direction as the Build disclosure. */
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar .map-toolbar .tools > button:not([hidden]),
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar .map-toolbar #layers-button {
  flex-flow:row nowrap;align-items:center;justify-content:center;gap:.14rem;padding-inline:2px;
}
body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar .map-toolbar :is(.tools>button,#layers-button)>.ui-icon {
  width:14px;height:14px;flex:0 0 14px;
}
@container zone-map-tools (max-width:27rem) {
  html:lang(de) .map-panel[data-zone-floating] #wz-map-toolbar:not(:has(#drawing-tools:not([hidden]))) .map-toolbar {
    grid-template-columns:minmax(max-content,1fr) minmax(0,1fr)!important;
  }
  html:lang(de) .map-panel[data-zone-floating] #wz-map-toolbar .map-toolbar .tools>button:not([hidden]) {
    width:100%;max-width:100%;white-space:nowrap;
  }
}
@container zone-map-tools (max-width:17rem) {
  body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar .map-toolbar :is(.tools>button:not([hidden]),#layers-button) {gap:2px;padding-inline:1px}
  body[data-zone-preview] .map-panel[data-zone-floating] #wz-map-toolbar .map-toolbar :is(.tools>button,#layers-button)>.ui-icon {width:12px;height:12px;flex-basis:12px}
}
@container zone-map-tools (max-width:20rem) {
  html:lang(ja) .map-panel[data-zone-floating] #wz-map-toolbar:not(:has(#drawing-tools:not([hidden]))) .map-toolbar {
    grid-template-columns:minmax(0,1fr) minmax(max-content,1fr)!important;
  }
  html:lang(ja) .map-panel[data-zone-floating] #wz-map-toolbar .map-toolbar #layers-button .zone-view-name {white-space:nowrap}
}

body[data-zone-preview] .wz-bar {flex-wrap:wrap;column-gap:6px;row-gap:2px;}
body[data-zone-preview] .wz-title {flex:1 1 7rem;}
body[data-zone-preview] #wz-campaign {
 margin:0; padding:0; border:0; min-width:0; max-width:100%; flex:0 1 auto;
 line-height:1.2; font-family:inherit; pointer-events:auto; color:#e9f3f4; background:none;
}
body[data-zone-preview] #wz-campaign-toggle {
 display:grid; grid-template-columns:minmax(0,1fr) auto; gap:0 .35rem; align-content:center;
 min-height:44px; align-self:center; padding:3px .55rem; box-sizing:border-box; border:1px solid #42636a;
 border-radius:.48rem; background:#182f38; color:#eff7f7; cursor:pointer; list-style:none;
}
body[data-zone-preview] #wz-campaign-toggle::-webkit-details-marker {display:none;}
body[data-zone-preview] .wz-campaign-caption {font-weight:600;font-size:.75rem;line-height:1.2;color:#bad4d6;overflow-wrap:anywhere;}
body[data-zone-preview] :is(#wz-campaign-current,#wz-campaign-name) {grid-column:1; font-weight:680;font-size:.875rem;line-height:1.15;color:#ebf6f5;}
body[data-zone-preview] .wz-campaign-chevron {width:.44rem;height:.44rem;grid-column:2;grid-row:1/3;align-self:center;justify-self:end;border:solid #a9d8d1;border-width:0 1.5px 1.5px 0;transform:rotate(45deg);margin-top:-.2rem;}
body[data-zone-preview] #wz-campaign[open] .wz-campaign-chevron {transform:rotate(225deg);margin-top:.2rem;}
body[data-zone-preview] #wz-campaign[open]>summary {background:#20414a;border-color:#77b4aa;}
body[data-zone-preview] #wz-campaign-options {
 position:fixed;z-index:12;display:grid;gap:0;padding:4px;margin:0;width:max-content;min-width:0;
 max-width:calc(100vw - 12px);box-sizing:border-box;overflow:auto;overscroll-behavior:contain;
 background:#142630;border:1px solid #526d73;border-radius:.6rem;box-shadow:0 6px 20px #07131866;
}
body[data-zone-preview] #wz-campaign:not([open]) #wz-campaign-options {display:none;}
body[data-zone-preview] #wz-campaign-options a {
 display:flex; justify-content:space-between; align-items:center; gap:.5rem; min-height:44px;
 padding:.35rem .55rem; margin:0; text-decoration:none; font:600 .875rem/1.3 system-ui,sans-serif;
 overflow-wrap:anywhere; color:#e4edef; border-radius:.35rem; box-sizing:border-box;
}
body[data-zone-preview] #wz-campaign-options a[aria-current=page] {background:#20413f; color:#a8e6d8;}
body[data-zone-preview] #wz-campaign-options a:not([aria-current]) .wz-campaign-mark {visibility:hidden;}
body[data-zone-preview][data-map-focus] .wz-bar {max-width:calc(100% - 12px);width:max-content;justify-content:flex-end;}
@media(max-width:36rem) {
 body[data-zone-preview]:not([data-map-focus]) .wz-bar {display:grid!important;grid-template-columns:minmax(0,1fr) auto auto;}
 body[data-zone-preview]:not([data-map-focus]) .wz-title {min-width:0;}
}
@media(max-width:22rem) {
 body[data-zone-preview]:not([data-map-focus]) .wz-bar {grid-template-columns:minmax(0,1fr) auto;}
 body[data-zone-preview]:not([data-map-focus]) .wz-title {grid-column:1/-1;}
 body[data-zone-preview]:not([data-map-focus]) #wz-campaign {justify-self:start;}
}

body[data-zone-preview] #wz-campaign-name {display:none;}
@media(min-width:48rem) {
 body[data-zone-preview] #wz-campaign-name {display:block;}
 body[data-zone-preview] #wz-campaign-current {display:none;}
}
body[data-zone-preview] .wz-bar:has(#wz-campaign[open]) {z-index:50;}
body[data-zone-preview] #wz-campaign-toggle {gap:0 4px;padding-inline:7px;}
body[data-zone-preview] .wz-campaign-caption {grid-column:1/-1;white-space:nowrap;font-family:system-ui,sans-serif;}
body[data-zone-preview] .wz-campaign-chevron {grid-row:2;width:6px;height:6px;}
@media(max-width:22rem) {
 body[data-zone-preview]:not([data-map-focus]) .wz-bar {display:flex!important;}
 body[data-zone-preview]:not([data-map-focus]) .wz-title {flex:1 0 100%;}
 body[data-zone-preview]:not([data-map-focus]) #wz-campaign {flex:0 0 auto;}
 body[data-zone-preview]:not([data-map-focus]) .wz-bar-actions {margin-inline-start:auto;}
}

body[data-zone-preview] .map-panel #wz-quick-tools {display:none}
body[data-zone-preview] .map-panel[data-zone-floating] #wz-quick-tools {
 display:inline-grid;grid-template-columns:repeat(4,minmax(44px,auto));align-items:stretch;
 position:absolute;bottom:max(7px,env(safe-area-inset-bottom));left:max(7px,env(safe-area-inset-left));z-index:8;
 box-sizing:border-box;margin:0;padding:2px;gap:1px;max-width:calc(100% - 64px);
 background:#10252ef5;color:#e6f2f0;border:1px solid #496269;border-radius:8px;box-shadow:0 2px 6px #00121c48;
}
body[data-zone-preview] #wz-quick-tools button {
 box-sizing:border-box;display:flex;align-items:center;justify-content:center;flex-flow:column;gap:1px;min-width:44px;min-height:44px;
 padding:2px 6px;position:relative;border:1px solid transparent;border-radius:5px;
 color:#d4e2e2;background:transparent;font:550 .75rem/1.2 system-ui,sans-serif;cursor:pointer;white-space:normal;
}
body[data-zone-preview] #wz-quick-tools svg {width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
body[data-zone-preview] #wz-quick-tools button:is([aria-pressed=true],[aria-expanded=true],.wz-current-section) {background:#244541;border-color:#4e8279;color:#b6f2df}
body[data-zone-preview] #wz-quick-tools button:focus-visible {outline:2px solid #b1e6da;outline-offset:-2px}
body[data-zone-preview] .map-panel[data-zone-floating] .zone-nav-menu {z-index:10}
body[data-zone-preview] .map-panel[data-zone-floating][data-wz-build-quick] #wz-map-toolbar #drawing-tools {display:none!important}
body[data-zone-preview] .map-panel[data-zone-floating] .map-stage .history-controls {margin-bottom:calc(var(--wz-quick-h,50px) + 5px)}
body[data-zone-preview] .map-panel[data-zone-floating]:has(#line-tools:not([hidden])) #wz-quick-tools {left:auto;right:61px}
@media(max-width:360px) {
 body[data-zone-preview] #wz-quick-tools button span {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 body[data-zone-preview] #wz-quick-tools button {padding:4px}
 body[data-zone-preview] #wz-quick-tools svg {width:19px;height:19px}
}
/* Build opens against its own button so the next choice is within thumb reach. */
body[data-zone-preview] .map-panel[data-zone-floating][data-wz-build-quick][data-zone-tools-open] > #wz-map-toolbar {
 inset:auto auto calc(12px + var(--wz-quick-h,50px)) max(7px,env(safe-area-inset-left))!important;
 box-sizing:border-box; width:min(22rem,calc(100% - 14px)); max-height:calc(100% - var(--wz-quick-h,50px) - 68px)!important;
 padding:5px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain
}
body[data-zone-preview] .map-panel[data-wz-build-quick] #wz-map-toolbar :is(.tools>.active[data-tool],.tools>button,.map-utility,#line-switch) {display:none!important}
body[data-zone-preview] .map-panel[data-wz-build-quick] #wz-map-toolbar .map-toolbar,
body[data-zone-preview] .map-panel[data-wz-build-quick] #wz-map-toolbar .tools,
body[data-zone-preview] .map-panel[data-wz-build-quick] #more-map-tools {display:block!important;width:100%;max-width:100%;position:static;margin:0}
body[data-zone-preview] .map-panel[data-wz-build-quick] #more-map-tools>summary {width:100%;height:auto;min-height:44px;justify-content:flex-start}
body[data-zone-preview] .map-panel[data-wz-build-quick] #more-map-tools[open]>.secondary-map-tools {
 display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(8.5rem,100%),1fr));position:static!important;inset:auto;transform:none!important;
 width:auto!important;max-width:100%!important;max-height:none;padding:2px;overflow:visible;border:0;box-shadow:none
}
body[data-zone-preview] .map-panel[data-zone-floating][data-zone-tools-open]:not([data-wz-build-quick]) > #wz-map-toolbar {
 max-block-size:max(44px,min(63dvh,calc(100% - var(--wz-quick-h,50px) - 74px)))!important;
 max-height:max(44px,min(63dvh,calc(100% - var(--wz-quick-h,50px) - 74px)))!important;
 box-sizing:border-box;overflow-y:auto;overscroll-behavior:contain
}

body[data-zone-preview] #wz-draw-palette {
 position:absolute;z-index:7;inset-inline-start:8px;bottom:calc(8px + var(--wz-quick-h, 44px) + 6px);
 pointer-events:none;
 display:flex;flex-wrap:wrap;align-items:center;gap:2px;max-width:calc(100% - 16px);box-sizing:border-box;
 margin:0;padding:3px;border:1px solid #46616b;border-radius:9px;
 background:#11262ff5;box-shadow:0 2px 9px #04131960;
}
body[data-zone-preview] #wz-draw-palette[hidden],
body[data-zone-preview] .map-panel[data-zone-tools-open] #wz-draw-palette {display:none;}
body[data-zone-preview] #wz-draw-palette button {
 display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;
 width:44px;height:44px;min-width:44px;min-height:44px;margin:0;padding:0;
 color:#b8cfd1;border:1px solid transparent;background:transparent;border-radius:6px;
 pointer-events:auto;outline-offset:-3px;cursor:pointer;touch-action:manipulation;
}
body[data-zone-preview] #wz-draw-palette button:is(:hover,:focus-visible) {background:#24404a;color:#f3f9f7;}
body[data-zone-preview] #wz-draw-palette button[aria-pressed=true] {background:#1c4747;border-color:#77bfae;color:#baf6e2;}
body[data-zone-preview] #wz-draw-palette button:focus-visible {outline:2px solid #cdf4e8;}
body[data-zone-preview] #wz-draw-palette svg {
 box-sizing:border-box;display:block;width:21px;height:21px;flex:none;fill:none;stroke:currentColor;
 stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;
}
@media(forced-colors:active){
 body[data-zone-preview] #wz-draw-palette button[aria-pressed=true] {outline:2px solid Highlight;}
}

body[data-zone-preview] #wz-draw-more {border-inline-start:1px solid #526d74;border-start-start-radius:0;border-end-start-radius:0;}
body[data-zone-preview] #wz-draw-more svg {fill:currentColor;stroke:none;}
body[data-zone-preview] .map-panel[data-zone-floating]:not([data-zone-tools-open]):has(#wz-draw-palette:not([hidden])) .map-stage .history-controls {
 margin-bottom:calc(var(--wz-quick-h,44px) + var(--wz-mark-height,52px) + 11px);
}
@media(max-width:360px){
 body[data-zone-preview] #wz-draw-palette {inset-inline-start:2px;gap:0;max-width:calc(100% - 4px);padding:0;}
}

body[data-zone-preview] .map-panel:not([data-zone-floating]) #wz-draw-palette {
 top:8px;bottom:auto;left:8px;right:auto;
}
body[data-zone-preview] .map-panel:not([data-zone-floating]):has(#wz-draw-palette) #drawing-tools .drawing-top-row {display:none;}

body[data-zone-preview] #wz-draw-palette .wz-mark-caption {display:none;}
body[data-zone-preview] #wz-draw-palette[data-wz-mark-labels] button {
 display:grid;justify-items:center;align-content:center;gap:0;width:auto;padding:1px 3px;
}
body[data-zone-preview] #wz-draw-palette[data-wz-mark-labels] .wz-mark-caption {
 display:block;white-space:nowrap;color:inherit;font:600 .75rem/1.15 system-ui,sans-serif;
}
@media(min-width:320px) and (max-width:360px) {
 body[data-zone-preview] #wz-draw-palette {flex-wrap:nowrap;}
}

/* A separate flex row reserves this space for readouts in both map layouts. */
body.hq-battle[data-zone-preview] main#hq-main-content > #wz-map-readout {
 display:flex;align-items:center;justify-content:space-between;gap:4px 14px;
 position:relative;box-sizing:border-box;flex:0 0 auto;width:100%;min-width:0;
 padding:2px max(8px,env(safe-area-inset-right)) max(2px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
 background:#10232c;color:#d4e7e8;border-top:1px solid #3a535d;
}
body.hq-battle[data-zone-preview] #wz-map-readout #map-coordinate {
 display:block!important;position:static!important;inset:auto!important;transform:none!important;
 box-sizing:border-box;flex:1 1 auto;min-width:0;max-width:none;width:auto;height:auto;
 padding:0;margin:0;border:0;border-radius:0;background:none;box-shadow:none;
 color:#dcebec;font:520 .75rem/1.3 system-ui,sans-serif;font-variant-numeric:tabular-nums;
 pointer-events:none;white-space:normal;overflow-wrap:anywhere;
}
body.hq-battle[data-zone-preview] #wz-map-readout #map-coordinate:empty::before {content:'X — · Y —';color:#a5bbc0}
body.hq-battle[data-zone-preview] #wz-map-readout .map-scale {
 display:flex!important;flex:0 1 auto;align-items:center;gap:6px;position:static!important;inset:auto!important;
 max-width:50%;padding:0;margin:0;border:0;background:none;box-shadow:none;transform:none;
 color:#b9cccf;font:450 .75rem/1.3 system-ui,sans-serif;white-space:normal
}
body.hq-battle[data-zone-preview] #wz-map-readout #map-scale {color:inherit;font:inherit}
body.hq-battle[data-zone-preview] #wz-map-readout #scale-line {display:block;flex:none;max-width:none;height:5px;border:solid #b5cdd0;border-width:0 1px 1px;background:none}
@media(max-width:600px){body.hq-battle[data-zone-preview] #wz-map-readout .map-scale{display:none!important}}

/* In short landscape maps the history group can share the tool launcher's height. */
@media (orientation: landscape) and (max-height: 30rem) {
  body[data-zone-preview] .map-panel[data-zone-floating]:not([data-zone-tools-open]):has(#wz-draw-palette:not([hidden])) .map-stage .history-controls {
    left: auto;
    right: max(8px, env(safe-area-inset-right));
  }
}

/* Keep placement guidance clear of fullscreen navigation. */
body[data-zone-preview]:not([data-map-focus]) .map-panel[data-zone-floating] .map-stage #placement-mode:not([hidden]) {top:8px!important}

/* Mark tools and navigation are separate rows when space is limited. */
body[data-zone-preview] #wz-draw-palette:not([hidden]) {
 display:grid;grid-template-columns:minmax(0,1fr);align-items:stretch;
 inline-size:max-content;max-inline-size:calc(100% - 16px);padding:3px;gap:3px;
 pointer-events:auto;touch-action:none;
}
body[data-zone-preview] .map-panel[data-zone-tools-open] #wz-draw-palette:not([hidden]) {display:none}
body[data-zone-preview] #wz-draw-palette .wz-draw-marks {
 display:grid;grid-template-columns:repeat(6,minmax(44px,1fr));align-items:stretch;column-gap:3px;
}
body[data-zone-preview] #wz-draw-palette .wz-draw-actions {
 display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch;gap:3px;
 border-block-start:1px solid #415b62;padding-block-start:3px;
}
body[data-zone-preview] #wz-draw-palette button {width:100%;min-height:44px;height:auto}
body[data-zone-preview] #wz-draw-palette .wz-draw-actions button {
 display:flex;align-items:center;justify-content:center;gap:4px;width:100%;min-width:44px;padding:2px 4px;
 border:1px solid transparent;border-radius:5px;
}
body[data-zone-preview] #wz-draw-palette .wz-draw-actions button[aria-pressed=true] {border-color:#77bfae}
body[data-zone-preview] #wz-draw-palette .wz-draw-actions button svg {display:none}
body[data-zone-preview] #wz-draw-palette .wz-draw-actions button .wz-mark-caption {
 display:block;white-space:normal;overflow-wrap:anywhere;font:600 .8125rem/1.18 system-ui,sans-serif;
}
body[data-zone-preview] #wz-draw-style::before {
 content:'';display:block;width:9px;height:9px;flex:none;border-radius:50%;
 border:1px solid #dbe8e9;background:var(--draw-colour,#e5484d);
}
body[data-zone-preview] #wz-draw-palette[data-wz-draw-wide] {
 grid-template-columns:max-content max-content;align-items:stretch;
}
body[data-zone-preview] #wz-draw-palette[data-wz-draw-wide] .wz-draw-actions {
 border:0;border-inline-start:1px solid #415b62;padding:0;padding-inline-start:3px;
 grid-template-columns:repeat(3,minmax(48px,max-content));
}
@media(max-width:360px) {
 body[data-zone-preview] #wz-draw-palette:not([hidden]) {inset-inline-start:4px;max-inline-size:calc(100% - 8px)}
}
body[data-zone-preview] .map-panel:not([data-zone-floating]):has(#wz-draw-palette):not([data-wz-draw-view]) #drawing-tools {display:none!important}
body[data-zone-preview] .map-panel[data-wz-drawer=draw] #wz-map-toolbar .map-toolbar {display:none!important}
body[data-zone-preview] .map-panel[data-wz-draw-view] #wz-map-toolbar #drawing-tools :is(.drawing-top-row,.drawing-edit-hint) {display:none!important}
body[data-zone-preview] .map-panel[data-wz-draw-view=more] #wz-map-toolbar #drawing-tools .drawing-bottom-row>:not(#drawing-extra),
body[data-zone-preview] .map-panel[data-wz-draw-view=style] #wz-map-toolbar #drawing-tools .drawing-bottom-row>:not(#draw-style-toggle):not(#drawing-style-options) {display:none!important}
body[data-zone-preview] .map-panel[data-wz-draw-view] #wz-map-toolbar #drawing-tools .drawing-bottom-row {
 display:block!important;max-width:100%;width:100%;min-width:0;
}
body[data-zone-preview] .map-panel[data-wz-draw-view] #wz-map-toolbar #drawing-tools #drawing-extra[open] {
 display:block;position:static;max-width:100%;width:100%;margin:0;
}
body[data-zone-preview] .map-panel[data-wz-draw-view] #wz-map-toolbar #drawing-tools :is(#draw-style-toggle,#drawing-extra[open]>summary) {
 box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;
 gap:.5rem;width:100%;min-height:44px;line-height:1.3;padding:.3rem .55rem;
 border:0;border-radius:5px;color:#c8eee1;background:#223d43;text-align:start;
}
body[data-zone-preview] .map-panel[data-wz-draw-view] #wz-map-toolbar #drawing-tools :is(#draw-style-toggle,#drawing-extra[open]>summary)::after {
 content:'';display:block;position:static;flex:none;width:.5rem;height:.5rem;border:solid currentColor;border-width:1.5px 1.5px 0 0;
 margin:0 .2rem 0 auto;transform:rotate(-45deg);border-radius:0;background:none;
}
body[data-zone-preview] .map-panel[data-wz-draw-view=style] #wz-map-toolbar #drawing-tools #drawing-style-options {
 position:static;inset:auto;transform:none;box-sizing:border-box;display:flex!important;flex-wrap:wrap;align-items:center;gap:6px;
 width:100%;max-width:100%;padding:6px 0 0;border:0;background:none;box-shadow:none;
}
body[data-zone-preview] .map-panel[data-wz-draw-view=style] #wz-map-toolbar #drawing-tools #draw-colours {
 display:flex;flex-flow:row wrap;gap:3px;max-width:100%;
}
body[data-zone-preview] .map-panel[data-wz-draw-view=style] #wz-map-toolbar #drawing-tools #draw-colours button {
 box-sizing:border-box;min-height:44px;min-width:44px;width:44px;height:44px;
}
body[data-zone-preview] .map-panel[data-wz-draw-view=more] #wz-map-toolbar #drawing-tools :is(#drawing-extra[open]>div,#drawing-context:not([hidden]),#drawing-bends:not([hidden])) {
 position:static;inset:auto;transform:none;box-sizing:border-box;display:grid;
 grid-template-columns:repeat(auto-fit,minmax(min(7.5rem,100%),1fr));gap:6px;
 align-items:stretch;align-content:start;width:100%;min-width:0;max-width:100%;height:auto;
 max-height:none;overflow:visible;padding:6px 0 0;margin:0;border:0;background:none;box-shadow:none;
}
body[data-zone-preview] .map-panel[data-wz-draw-view=more] #wz-map-toolbar #drawing-tools :is(#drawing-context,#drawing-bends):not([hidden]) {
 grid-column:1/-1;padding:0;
}
body[data-zone-preview] .map-panel[data-wz-draw-view=more] #wz-map-toolbar #drawing-tools #drawing-extra[open]>div button:not([hidden]) {
 display:flex;align-items:center;justify-content:flex-start;box-sizing:border-box;text-align:start;gap:.25rem;
 min-width:44px;min-height:44px;width:100%;height:auto;max-width:100%;padding:.3rem .45rem;
 white-space:normal;overflow-wrap:anywhere;
}
body[data-zone-preview] .map-panel[data-wz-draw-view] #wz-map-toolbar #drawing-tools .wz-draw-select {
 min-height:44px;height:auto;min-width:44px;max-width:100%;
}
body[data-zone-preview] .map-panel[data-wz-draw-view] #wz-map-toolbar #drawing-tools .wz-draw-select>select {display:block}
body[data-zone-preview] .map-panel[data-zone-floating][data-wz-drawer=draw] > #wz-map-toolbar {
 inset:auto auto calc(12px + var(--wz-quick-h,50px)) max(7px,env(safe-area-inset-left))!important;
 box-sizing:border-box;width:min(23rem,calc(100% - 14px));max-width:calc(100% - 14px);
 padding:6px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;
}
body[data-zone-preview] .map-panel:not([data-zone-floating])[data-wz-draw-view] #drawing-tools:not([hidden]) {
 position:relative;display:block!important;width:min(100%,40rem);max-width:100%;
}

/* Give the German hand tool enough room for its full visible name at 200%. */
html:lang(de) #wz-draw-palette:not([data-wz-mark-labels]):not([data-wz-draw-wide]) .wz-draw-actions {
 grid-template-columns:max-content minmax(44px,1fr) max-content;gap:2px;
}
html:lang(de) #wz-draw-palette:not([data-wz-mark-labels]):not([data-wz-draw-wide]) .wz-draw-actions button {
 padding-inline:1px;
}
html:lang(de) #wz-draw-palette:not([data-wz-mark-labels]):not([data-wz-draw-wide]) .wz-draw-actions .wz-mark-caption {
 font-size:.75rem;
}
html:lang(de) #wz-draw-palette:not([data-wz-mark-labels]):not([data-wz-draw-wide]) #wz-draw-style::before {display:none}

body[data-zone-preview] #line-tools > #wz-line-header {
  display:flex;align-items:stretch;flex-wrap:wrap;gap:4px;max-width:100%;
  grid-column:1/-1;
}
body[data-zone-preview] .map-panel:not([data-zone-floating]) #line-tools > #wz-line-header:has(#line-switch[hidden]) {
  display:none;
}
body[data-zone-preview] main#hq-main-content .map-panel[data-zone-floating] .map-stage #line-tools:not([hidden]) > #wz-line-header {
  display:flex!important;flex-wrap:nowrap;
}
body[data-zone-preview] .map-panel[data-zone-floating] #line-tools #wz-line-header > #wz-line-options {
  width:auto;min-width:44px;max-width:100%;margin:0;
}
body[data-zone-preview] #line-tools #wz-line-header > #line-switch:not([hidden]) {
  display:inline-flex;align-items:center;justify-content:center;min-height:44px;min-width:44px;
  max-width:100%;margin:0;padding:5px 8px;
  background:#244540;color:#d5f6eb;border:1px solid #648f86;border-radius:5px;
  cursor:pointer;font:600 .8125rem/1.25 system-ui,sans-serif;overflow-wrap:anywhere;
}
body[data-zone-preview] #line-tools #wz-line-header > #line-switch[hidden] {display:none!important;}
body[data-zone-preview] #line-tools #line-switch:focus-visible {outline:2px solid #c3f2df;outline-offset:-3px;}

body[data-zone-preview][data-map-focus] .map-panel[data-zone-floating] .map-stage #line-tools:not([hidden]) {
  --wz-line-top:max(59px,calc(max(6px,env(safe-area-inset-top)) + var(--wz-map-bar-height,46px) + 5px));
  top:var(--wz-line-top)!important;
  max-height:calc(100% - var(--wz-line-top) - var(--wz-quick-h,50px) - 10px)!important;
}

body[data-zone-preview] #wz-setup-panel #wz-share-plan {
  display: grid;
  gap: .3rem;
}

body[data-zone-preview] #wz-share-title {
  font-size: .9375rem;
  font-weight: 650;
  line-height: 1.25;
}

body[data-zone-preview] .wz-share-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr));
  gap: .375rem;
}

body[data-zone-preview] #wz-setup-panel .wz-share-actions button {
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: max(44px, 2.75rem);
  height: auto;
  padding: .375rem .5rem;
  font-size: .9375rem;
  line-height: 1.25;
  text-align: center;
}

body[data-zone-preview] #wz-setup-panel .wz-share-actions button:enabled {
  background: #204047;
  border-color: #528079;
}

body[data-zone-preview] #wz-setup-panel .workspace-actions {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 5rem), 1fr));
}

/* Plan uses the same compact reading scale as the map, with full-height touch targets. */
body.hq-battle[data-zone-preview] #wz-setup-panel {
 --plan-type:.75rem; --plan-heading:.875rem;
 font:400 var(--plan-type)/1.4 system-ui,sans-serif;
 gap:.45rem;padding:6px 12px 8px;
}
body.hq-battle[data-zone-preview] #wz-setup-panel #wz-panel-title {
 font:600 var(--plan-heading)/1.3 system-ui,sans-serif;
}
body.hq-battle[data-zone-preview] #wz-setup-panel :is(button:not(#wz-close),a),
body.hq-battle[data-zone-preview] #wz-setup-panel :is(#wz-share-title,#wz-guide,#save-state,.wz-pickers [data-wz],#tech-bonus-button>span:first-child,#tech-bonus-button .wz-star-face) {
 font:450 var(--plan-type)/1.35 system-ui,sans-serif;
}
body.hq-battle[data-zone-preview] #wz-setup-panel :is(.workspace-actions button, .map-plan-actions button, .wz-timing button, #wz-share-plan button) {
 font-weight:500; min-height:44px;
}
body.hq-battle[data-zone-preview] #wz-setup-panel :is(#zone-browser-edition,#zone-browser-zone,#active-route-name) {font-size:var(--plan-type);font-weight:580}
body.hq-battle[data-zone-preview] #wz-setup-panel :is(#open-plan-name,#active-route-time,#tech-bonus-button .wz-star-face>span) {font-size:var(--plan-type);font-weight:400}
body.hq-battle[data-zone-preview] #wz-setup-panel .workspace-actions {
 grid-template-columns:repeat(auto-fit,minmax(min(100%,5.25rem),1fr));
}
body.hq-battle[data-zone-preview] #wz-setup-panel .wz-panel-footer {padding-block-start:0}
body.hq-battle[data-zone-preview] #wz-setup-panel #wz-close {
 display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;background:transparent;
}
body.hq-battle[data-zone-preview] #wz-setup-panel #wz-close:is(:hover,:focus-visible) {background:#203945}
body.hq-battle[data-zone-preview] #plan-dialog {
 font-family:system-ui,sans-serif;
}
body.hq-battle[data-zone-preview] #plan-dialog #plan-dialog-title {
 font-size:.875rem!important;font-weight:600!important;
}
body.hq-battle[data-zone-preview] #plan-dialog :is(#plan-library,.plan-actions,.dialog-note,#plan-library-status,button:not([data-close]),summary,small,.saved-plan-state,.saved-plan-zone) {
 font-family:inherit;font-size:.75rem!important;line-height:1.4;
}
body.hq-battle[data-zone-preview] #plan-dialog :is(button:not([data-close]),summary) {
 font-weight:500!important;min-height:44px;
}
body.hq-battle[data-zone-preview] #plan-dialog button strong {font-size:.8125rem;font-weight:600}
body.hq-battle[data-zone-preview] #plan-dialog :is(small,.saved-plan-state,.saved-plan-zone) {font-weight:450!important}
body.hq-battle[data-zone-preview] #wz-setup-panel #planner-help>span {font-weight:inherit}

.share-timings{display:grid;gap:.35rem;margin-block:.25rem}.share-settings .share-timings>label{display:flex;align-items:center;gap:.6rem;min-height:44px;margin:0;cursor:pointer}.share-settings .share-timings input{width:1.1rem;height:1.1rem;flex:none;margin:0}.share-timings button:not([hidden]){justify-self:start}.plan-note{margin-block:.55rem}.plan-note summary{cursor:pointer;padding-block:.55rem}.plan-note textarea{width:100%;box-sizing:border-box}.share-timings [hidden]{display:none!important}

body.hq-battle[data-zone-preview] #wz-setup-panel #wz-share-link {
  background:#204440;border-color:#5d9587;color:#d9f6ea;font-weight:600;
}
body.hq-battle[data-zone-preview] #wz-setup-panel #wz-share-link::before {
  content:'';width:15px;height:15px;flex:none;background:currentColor;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m10 13 4-4m-5 1-3 3a3.5 3.5 0 0 0 5 5l3-3m-1-5 2-2m-5 0 3-3a3.5 3.5 0 0 1 5 5l-3 3'/%3E%3C/svg%3E") center/contain no-repeat;
}
body.hq-battle[data-zone-preview] #wz-link-dialog {
  width:min(24rem,calc(100% - 16px));max-width:calc(100% - 16px);max-height:calc(100dvh - 16px);
  padding:12px;box-sizing:border-box;overflow:auto;overscroll-behavior:contain;
  background:#142934;color:#e0eded;border:1px solid #455e68;border-radius:10px;
  font:400 .8125rem/1.45 system-ui,sans-serif;
}
body.hq-battle[data-zone-preview] #wz-link-dialog[open]{display:grid;gap:8px}
body.hq-battle[data-zone-preview] #wz-link-dialog .dialog-header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0;padding:0 0 4px;border-block-end:1px solid #344c56}
body.hq-battle[data-zone-preview] #wz-link-dialog #wz-link-heading{font:600 .9375rem/1.3 system-ui,sans-serif!important;margin:0}
body.hq-battle[data-zone-preview] #wz-link-dialog :is(p,label){margin:0;font:400 .8125rem/1.45 system-ui,sans-serif;color:#cedfe1}
body.hq-battle[data-zone-preview] #wz-link-dialog #wz-link-field{min-width:0;display:grid;gap:4px}
body.hq-battle[data-zone-preview] #wz-link-dialog #wz-link-field label{font-size:.75rem}
body.hq-battle[data-zone-preview] #wz-link-dialog #wz-link-url{box-sizing:border-box;width:100%;min-width:0;min-height:44px;font-size:1rem;padding:4px 8px;background:#10212b;border:1px solid #57717b;color:#e7f3f2;border-radius:6px}
body.hq-battle[data-zone-preview] #wz-link-actions{display:flex;flex-wrap:wrap;gap:6px}
body.hq-battle[data-zone-preview] #wz-link-dialog button,body.hq-battle[data-zone-preview] #wz-link-feedback button{
 min-width:44px;min-height:44px;max-width:100%;height:auto;padding:5px 10px;white-space:normal;overflow-wrap:anywhere;
 font:530 .8125rem/1.35 system-ui,sans-serif;color:#dcf1ec;background:#213a43;border:1px solid #48616a;border-radius:6px;cursor:pointer;
}
body.hq-battle[data-zone-preview] #wz-link-actions button{flex:1 1 7rem}
body.hq-battle[data-zone-preview] #wz-link-dialog #wz-link-copy{background:#21463f;border-color:#638f82}
body.hq-battle[data-zone-preview] #wz-link-dialog #wz-plan-file{justify-self:start;padding-inline:3px;border-color:transparent;background:transparent;color:#b8dbd8;text-decoration:underline;text-underline-offset:3px}
body.hq-battle[data-zone-preview] #wz-link-dialog #wz-link-state:empty,
body.hq-battle[data-zone-preview] #wz-link-dialog #wz-link-actions:not(:has(button:not([hidden]))),
body.hq-battle[data-zone-preview] #wz-link-dialog [hidden],body.hq-battle[data-zone-preview] #wz-link-feedback[hidden],body.hq-battle[data-zone-preview] #wz-link-feedback [hidden]{display:none!important}
body.hq-battle[data-zone-preview] #wz-link-feedback{z-index:6;display:flex;flex-wrap:wrap;align-items:center;gap:3px 7px;padding:3px 10px;background:#1a3939;color:#e4f5f0;font:450 .78125rem/1.4 system-ui,sans-serif;}
body.hq-battle[data-zone-preview] #wz-link-feedback span{flex:1 1 8rem}
body.hq-battle[data-zone-preview] #wz-link-feedback button{padding:3px 6px;font-size:.75rem;background:transparent}
body.hq-battle[data-zone-preview][data-map-focus] #wz-link-feedback{margin-block-start:calc(var(--wz-map-bar-height,48px) + 10px)}
body.hq-battle[data-zone-preview] #wz-link-dialog #wz-link-private{
 font-size:.75rem;line-height:1.4;color:#b5c8cc;
}

/* Keep the map visible around the Plan popover. Each row still provides a full touch target. */
body.hq-battle[data-zone-preview] #wz-setup-panel {
  --plan-type:.703125rem;
  --plan-heading:.8125rem;
  --plan-meta:.6875rem;
  --plan-rule:#36505a;
  width:min(20rem,calc(100% - 16px));
  padding:3px 9px 4px;
  gap:3px;
}
body.hq-battle[data-zone-preview] #wz-setup-panel .wz-panel-head {
  gap:4px;align-items:center;min-width:0;border-bottom:1px solid var(--plan-rule);
}
body.hq-battle[data-zone-preview] #wz-setup-panel .wz-heading-copy {
  min-width:0;display:flex;align-items:baseline;flex-wrap:wrap;gap:0 .55rem;
}
body.hq-battle[data-zone-preview] #wz-setup-panel #save-state {
  font:400 var(--plan-meta)/1.35 system-ui,sans-serif;color:#b5cacf;
}
body.hq-battle[data-zone-preview] #wz-setup-panel #wz-close {flex:none}
body.hq-battle[data-zone-preview] #wz-setup-panel #wz-share-plan {
  display:flex;align-items:center;flex-wrap:wrap;gap:2px 6px;
}
body.hq-battle[data-zone-preview] #wz-setup-panel #wz-share-title {
  flex:0 1 auto;font-size:var(--plan-meta);color:#c1d1d4;
}
body.hq-battle[data-zone-preview] #wz-setup-panel .wz-share-actions {
  flex:1 1 11.5rem;gap:3px;min-width:0;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,5.55rem),1fr));
}
body.hq-battle[data-zone-preview] #wz-setup-panel .wz-share-actions button {
  font-size:var(--plan-type);min-height:44px;padding:3px;line-height:1.25;gap:.25rem;
}
body.hq-battle[data-zone-preview] #wz-setup-panel #wz-share-link::before {width:13px;height:13px}
body.hq-battle[data-zone-preview] #wz-setup-panel .wz-pickers,
body.hq-battle[data-zone-preview] #wz-setup-panel .wz-timing {
  gap:4px;grid-template-columns:repeat(auto-fit,minmax(min(100%,7rem),1fr));align-items:stretch;
}
body.hq-battle[data-zone-preview] #wz-setup-panel :is(#zone-browser-button,#route-settings-button) {
  min-height:44px;align-self:stretch;align-items:center;padding:3px 7px;gap:4px;
}
body.hq-battle[data-zone-preview] #wz-setup-panel :is(.zone-plan-copy,.active-route-copy) {
  flex:1 1 auto;gap:2px;min-width:0;text-align:start;
}
body.hq-battle[data-zone-preview] #wz-setup-panel .wz-picker-line {
  display:flex;flex-wrap:wrap;align-items:baseline;gap:0 .3rem;min-width:0;
}
body.hq-battle[data-zone-preview] #wz-setup-panel :is(.wz-picker-line>[data-wz],#open-plan-name,#active-route-time,#tech-bonus-button>span:first-child) {
  font:400 var(--plan-meta)/1.3 system-ui,sans-serif;color:#bdd0d4;
}
body.hq-battle[data-zone-preview] #wz-setup-panel #tech-bonus-button {
  display:grid;position:relative;align-content:center;gap:1px;min-height:44px;
  padding:3px 7px;background:#192e38;border:1px solid var(--wz-edge);border-radius:.45rem;
}
body.hq-battle[data-zone-preview] #wz-setup-panel #tech-bonus-button :is(.wz-star-input,.wz-star-face) {
  position:static;min-height:0;height:auto;width:100%;margin:0;padding:0;border:0;background:none;
}
body.hq-battle[data-zone-preview] #wz-setup-panel #tech-bonus-button .wz-star-face>span {
  font:450 var(--plan-type)/1.3 system-ui,sans-serif;
}
body.hq-battle[data-zone-preview] #wz-setup-panel #tech-bonus-button:focus-within {outline:2px solid var(--wz-accent);outline-offset:-2px}
body.hq-battle[data-zone-preview] #wz-setup-panel #tech-bonus-button .wz-star-face {outline:none}
body.hq-battle[data-zone-preview] #wz-setup-panel .map-plan-actions {
  display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,6.25rem),1fr));gap:4px;
}
body.hq-battle[data-zone-preview] #wz-setup-panel .workspace-actions {
  border-top:1px solid var(--plan-rule);padding-top:1px;
  display:flex;align-items:stretch;flex-wrap:wrap;gap:1px;
}
body.hq-battle[data-zone-preview] #wz-setup-panel .workspace-actions :is(button:not(#wz-close),#wz-guide) {
  display:flex;align-items:center;justify-content:center;text-align:center;
  flex:1 1 auto;min-height:44px;min-width:44px;width:auto;max-width:100%;padding:3px 4px;border:0;border-radius:4px;
  background:transparent;color:#cbe3e4;font:500 var(--plan-type)/1.3 system-ui,sans-serif;text-decoration:none;
}
body.hq-battle[data-zone-preview] #wz-setup-panel .workspace-actions :is(button,a):is(:hover,:focus-visible) {background:#213943;color:#e6f3f2}
/* A nested plan sheet keeps the map as its backdrop. Closing it reveals the same Plan menu. */
body.hq-battle[data-zone-preview]:has(:is(#orders-dialog,#plan-dialog):modal) #wz-setup-panel {
  visibility:hidden;
}

/* The steps sheet and the desktop panel share the same route content. */
body.hq-battle[data-zone-preview] :is(#orders-dialog, .workspace > .orders-panel) {
  font-family: system-ui, sans-serif;
  font-size: .75rem;
  line-height: 1.35;
}
body.hq-battle[data-zone-preview] #orders-dialog .dialog-header {
  padding-bottom: 3px;
  margin-bottom: 5px;
}
body.hq-battle[data-zone-preview] :is(#orders-dialog #orders-dialog-title, .orders-panel .panel-heading h2) {
  font-size: .8125rem !important;
  font-weight: 600 !important;
  line-height: 1.3;
}
body.hq-battle[data-zone-preview] :is(#orders-dialog, .workspace > .orders-panel) :is(button:not([data-close]):not(#hide-orders), summary) {
  min-height: 44px;
  font-size: .734375rem !important;
  font-weight: 500 !important;
  line-height: 1.35;
}
body.hq-battle[data-zone-preview] .orders-panel .summary-strip {
  gap: 4px;
  margin: 0 0 4px;
}
body.hq-battle[data-zone-preview] .orders-panel .summary-strip > div {
  display: grid;
  align-content: start;
  gap: 1px;
  min-height: 0;
  padding: 4px 7px;
}
body.hq-battle[data-zone-preview] .orders-panel .summary-strip span {
  margin: 0;
  font-size: .703125rem;
  line-height: 1.32;
}
body.hq-battle[data-zone-preview] .orders-panel .summary-strip strong {
  font-size: .796875rem;
  font-weight: 600;
  line-height: 1.32;
}
body.hq-battle[data-zone-preview] .orders-panel .empty {
  margin: 4px 0;
  padding: 5px 7px;
}
body.hq-battle[data-zone-preview] :is(#orders-dialog, .workspace > .orders-panel) .empty h3 {
  margin: 0 0 2px;
  font-size: .78125rem !important;
  font-weight: 600;
  line-height: 1.32;
}
body.hq-battle[data-zone-preview] :is(#orders-dialog, .workspace > .orders-panel) :is(.empty p, .warning, #time-note, .panel-heading .small, .route-order-heading small, .order-content small, .builder-summary small) {
  font-size: .71875rem !important;
  line-height: 1.36;
}
body.hq-battle[data-zone-preview] .orders-panel :is(.warnings, .order-list, .plan-note, #zone-order-timing) {
  margin: 3px 0;
}
/* Read the shared orders before the individual steps. */
body.hq-battle .orders-panel #wz-plan-guidance:not([hidden]){
 margin:0 0 .55rem;padding:.5rem .65rem;border-inline-start:3px solid var(--zp-accent);background:#172e35;color:#edf6f5;
}
body.hq-battle .orders-panel #wz-plan-guidance h3{
 margin:0 0 .15rem;font-size:.78rem!important;color:#a6dacf;
}
body.hq-battle .orders-panel #wz-plan-guidance p{
 margin:0;line-height:1.44;overflow-wrap:anywhere;
}
body.hq-battle .orders-panel #wz-plan-guidance [data-briefing-note]{white-space:pre-wrap}
body.hq-battle .orders-panel #wz-plan-guidance [data-clock-section]{color:#c4dadb;font-size:.78rem}
body.hq-battle .orders-panel #wz-plan-guidance section:not([hidden])+[data-clock-section]{margin-top:.35rem}
body.hq-battle .orders-panel #wz-plan-guidance time{font-variant-numeric:tabular-nums;font-weight:600}
body.hq-battle .orders-panel .wz-route-ends{display:grid;gap:.08rem;flex:0 0 100%;margin:0}
body.hq-battle .orders-panel .wz-route-ends div{display:flex;flex-wrap:wrap;column-gap:.35rem;align-items:baseline}
body.hq-battle .orders-panel .wz-route-ends :is(dt,dd){font-size:.74rem;line-height:1.4;margin:0;overflow-wrap:anywhere}
body.hq-battle .orders-panel .wz-route-ends dt{color:#b5cbce;font-weight:500}
body.hq-battle .orders-panel .wz-route-ends dd{color:#ebf3f2;font-weight:400}

@media(max-width:380px) and (max-height:740px) {
body.hq-battle[data-zone-preview][data-atlas]:has(#wz-link-feedback:not([hidden]) #wz-read-steps:not([hidden])) header[data-hq-masthead][data-shared-ssr].homepage-shared-header .header-inner .desktop-shortcuts{display:none!important}
body.hq-battle[data-zone-preview][data-atlas]:has(#wz-link-feedback:not([hidden]) #wz-read-steps:not([hidden])) header[data-hq-masthead][data-shared-ssr].homepage-shared-header .header-inner {grid-template-rows:auto!important;min-height:44px!important;padding-block:0}
body.hq-battle[data-zone-preview] #wz-link-feedback:has(#wz-read-steps:not([hidden])){display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 6px;padding:4px 8px}
body.hq-battle[data-zone-preview] #wz-link-feedback:has(#wz-read-steps:not([hidden])) #wz-link-notice{grid-column:1/-1;max-height:min(3lh,22dvh);overflow:auto;overflow-wrap:anywhere}
body.hq-battle[data-zone-preview] #wz-link-feedback:has(#wz-read-steps:not([hidden])) #wz-link-dismiss{font-size:0;min-width:44px}
body.hq-battle[data-zone-preview] #wz-link-feedback:has(#wz-read-steps:not([hidden])) #wz-link-dismiss::after{content:'×' / '';font-size:1.1rem;line-height:1}
}

body.hq-battle[data-zone-preview] .orders-panel .order-list:empty {
  margin: 0;
}
body.hq-battle[data-zone-preview] .orders-panel .warning {
  padding: 4px 7px;
}
body.hq-battle[data-zone-preview] .orders-panel .route-order-heading {
  min-width: 0;
  margin: 1px 0 0;
  padding: 2px 6px;
  flex-wrap: wrap;
  gap: 2px 6px;
}
@media (max-width: 700px) {
  body.hq-battle[data-zone-preview] .route-order-heading > .wz-order-clock {
    flex: 0 0 100%;
    min-width: 0;
    margin-inline: 0;
    text-align: start;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
body.hq-battle[data-zone-preview] .orders-panel .order-button {
  padding: 4px 6px;
  gap: 6px;
}
body.hq-battle[data-zone-preview] .orders-panel .order-content {
  min-width: 0;
  overflow-wrap: anywhere;
}
body.hq-battle[data-zone-preview] .orders-panel .order-content :is(strong, small) {
  white-space: normal;
  overflow-wrap: anywhere;
}
body.hq-battle[data-zone-preview] .orders-panel .order-content strong {
  font-size: .75rem;
  font-weight: 600;
}
body.hq-battle[data-zone-preview] .orders-panel .order-end {
  font-size: .703125rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}
body.hq-battle[data-zone-preview] .orders-panel :is(#add-objective, #briefing-button) {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: top;
  width: calc(50% - 5px);
  margin: 3px 0 0;
  padding: 4px 6px;
}
body.hq-battle[data-zone-preview] #orders-dialog .orders-panel > #briefing-button {
  margin-top: 3px;
}
body.hq-battle[data-zone-preview][data-map-focus] .workspace > .orders-panel:not([hidden]) {
  bottom: auto;
}

/* Saved plans. Keep the list prominent and let the surrounding actions share a line. */
body.hq-battle[data-zone-preview] #plan-dialog[open] {
  display:grid;
  grid-template-columns:repeat(12,minmax(0,1fr));
  align-content:start;
  align-items:center;
  gap:2px 0;
  width:min(22rem,calc(100vw - 16px))!important;
  padding:5px 9px 9px;
  box-sizing:border-box;
  container:plan-library / inline-size;
}
body.hq-battle[data-zone-preview] #plan-dialog > *,
body.hq-battle[data-zone-preview] #plan-dialog #plan-library > * {grid-column:1/-1}
body.hq-battle[data-zone-preview] #plan-dialog .dialog-header {
  grid-template-columns:minmax(0,1fr) auto auto!important;
  gap:3px!important;
  margin:0!important;
  padding:0!important;
}
body.hq-battle[data-zone-preview] #plan-dialog #plan-dialog-title {
  font-size:.8125rem!important;
  font-weight:600!important;
}
body.hq-battle[data-zone-preview] #plan-dialog .dialog-header > :is(h2,.tw-lang-toggle,button[data-close]){
  grid-area:auto!important;
}
body.hq-battle[data-zone-preview] #plan-dialog .dialog-header button {
  background:transparent;
  border-color:transparent;
  box-shadow:none;
}
body.hq-battle[data-zone-preview] #plan-dialog .dialog-header button[data-close] {
  font-size:1.0625rem!important;
  line-height:1;
}
body.hq-battle[data-zone-preview] #plan-dialog #plan-library {display:contents}
body.hq-battle[data-zone-preview] #plan-dialog #plan-library .plan-library-tabs {
  grid-column:1/6;
  grid-template-columns:repeat(3,minmax(44px,1fr));
  gap:0;
}
body.hq-battle[data-zone-preview] #plan-dialog .plan-library-tabs button {
  padding:3px;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
body.hq-battle[data-zone-preview] #plan-dialog .plan-library-tabs [aria-pressed=true] {
  box-shadow:inset 0 -2px var(--zp-accent);
  color:var(--zp-accent);
}
body.hq-battle[data-zone-preview] #plan-dialog #plan-library .plan-library-status {
  grid-column:6/-1;
  padding-inline-start:10px;
  font-size:.71875rem!important;
  line-height:1.35;
}
body.hq-battle[data-zone-preview] #plan-dialog .plan-library-list {gap:2px}
body.hq-battle[data-zone-preview] #plan-dialog .plan-library-list:empty {display:none}
body.hq-battle[data-zone-preview] #plan-dialog .saved-plan-row {
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:6px;
  padding:4px 6px;
  text-align:start;
}
body.hq-battle[data-zone-preview] #plan-dialog .saved-plan-zone {
  align-content:center;
  width:auto;
  min-width:1.5rem;
  height:auto;
  min-height:1.5rem;
  padding:1px 3px;
  box-sizing:border-box;
}
body.hq-battle[data-zone-preview] #plan-dialog .saved-plan-copy {gap:1px}
body.hq-battle[data-zone-preview] #plan-dialog .saved-plan-copy strong,
body.hq-battle[data-zone-preview] #plan-dialog .saved-plan-copy small {
  overflow:visible;
  overflow-wrap:anywhere;
  white-space:normal;
  text-overflow:clip;
}
body.hq-battle[data-zone-preview] #plan-dialog .saved-plan-copy strong {font-size:.78125rem}
body.hq-battle[data-zone-preview] #plan-dialog :is(.saved-plan-copy small,.saved-plan-state,.saved-plan-zone,.dialog-note) {
  font-size:.71875rem!important;
  line-height:1.35;
}
body.hq-battle[data-zone-preview] #plan-dialog #plan-library .plan-library-browse {
  grid-column:1/4;
  align-self:stretch;
}
body.hq-battle[data-zone-preview] #plan-dialog .plan-actions {
  grid-column:4/-1;
  align-self:stretch;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:0;
  border:0;
  padding:0;
  margin:0;
}
body.hq-battle[data-zone-preview] #plan-dialog :is(.plan-actions,.zone-group-body) button,
body.hq-battle[data-zone-preview] #plan-dialog #plan-library .plan-library-browse {
  padding:4px;
  border:0;
  background:transparent;
  box-shadow:none;
  line-height:1.25;
}
body.hq-battle[data-zone-preview] #plan-dialog .plan-actions #new-plan {color:var(--zp-accent)}
body.hq-battle[data-zone-preview] #plan-dialog #zone-plan-more {
  border-top:1px solid var(--zp-border);
  margin:0;
}
body.hq-battle[data-zone-preview] #plan-dialog #zone-plan-more .zone-group-body {
  grid-template-columns:repeat(auto-fit,minmax(min(100%,6rem),1fr));
  gap:2px;
}
body.hq-battle[data-zone-preview] #plan-dialog :is(button,summary):not(:disabled):is(:hover,:focus-visible){
  background:#203945;
}
body.hq-battle[data-zone-preview] #plan-dialog .dialog-note {margin:0}
body.hq-battle[data-zone-preview] #plan-dialog:has(.plan-actions[hidden]) #plan-library .plan-library-browse {
  grid-column:1/-1;
  justify-self:start;
  width:auto;
}
@container plan-library (max-width:20rem) {
  body.hq-battle[data-zone-preview] #plan-dialog #plan-library :is(.plan-library-tabs,.plan-library-status) {
    grid-column:1/-1;
    padding-inline-start:0;
  }
  body.hq-battle[data-zone-preview] #plan-dialog #plan-library .plan-library-tabs {
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}
@container plan-library (max-width:17rem) {
  body.hq-battle[data-zone-preview] #plan-dialog #plan-library .plan-library-browse,
  body.hq-battle[data-zone-preview] #plan-dialog .plan-actions {grid-column:1/-1}
  body.hq-battle[data-zone-preview] #plan-dialog .plan-actions {
    grid-template-columns:repeat(auto-fit,minmax(min(100%,5.5rem),1fr));
  }
  body.hq-battle[data-zone-preview] #plan-dialog .saved-plan-row {
    grid-template-columns:auto minmax(0,1fr);
  }
  body.hq-battle[data-zone-preview] #plan-dialog .saved-plan-copy {grid-area:1/2/3/3}
  body.hq-battle[data-zone-preview] #plan-dialog .saved-plan-state {grid-area:2/1;margin:0}
}
@container plan-library (max-width:13rem) {
  body.hq-battle[data-zone-preview] #plan-dialog .dialog-header {
    grid-template-columns:minmax(0,1fr) auto!important;
  }
  body.hq-battle[data-zone-preview] #plan-dialog .dialog-header .tw-lang-toggle {
    grid-area:2/1/3/-1!important;
    justify-self:start;
  }
  body.hq-battle[data-zone-preview] #plan-dialog .dialog-header button[data-close] {grid-area:1/2!important}
}

/* Keep the four map shortcuts identifiable at phone widths. */
body[data-zone-preview] .map-panel[data-zone-floating] #wz-quick-tools {
  --wz-tools-reserve: 64px; /* Leave room for map zoom. */
  max-width: calc(100% - var(--wz-tools-reserve));
  display: inline-flex;
  align-items: stretch;
}

body[data-zone-preview] #wz-quick-tools button {
  flex: 1 1 auto;
  gap: 1px;
  padding: 2px 1px;
  font-size: .703125rem;
  font-weight: 500;
  line-height: 1.15;
}

body[data-zone-preview] #wz-quick-tools #wz-quick-build {
  flex-shrink: 0;
}

body[data-zone-preview] #wz-quick-tools button span {
  position: static;
  width: auto;
  height: auto;
  max-width: 100%;
  overflow: visible;
  clip-path: none;
  white-space: nowrap;
}

body[data-zone-preview] #wz-quick-tools svg {
  width: 17px;
  height: 17px;
}

/* When the full translated names cannot fit, keep one row of named buttons. */
body[data-zone-preview] #wz-quick-tools[data-icons-only] button span {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* Fit drawing controls to their contents in the map and floating tray. */
body[data-zone-preview] .map-panel[data-zone-floating] #wz-draw-palette:not([hidden]) {
  padding: 1px;
  gap: 1px;
}
body[data-zone-preview] .map-panel[data-zone-floating] #wz-draw-palette .wz-draw-marks {
  grid-template-columns: repeat(6, minmax(44px, max-content));
  gap: 1px;
}
body[data-zone-preview] .map-panel[data-zone-floating] #wz-draw-palette[data-wz-mark-labels] .wz-draw-marks button {
  padding-inline: 1px;
}
body[data-zone-preview] .map-panel[data-zone-floating] #wz-draw-palette .wz-draw-actions {
  gap: 1px;
  padding-block-start: 1px;
}
body[data-zone-preview] .map-panel[data-zone-floating] #wz-draw-palette[data-wz-draw-wide] .wz-draw-actions {
  padding-block-start: 0;
  padding-inline-start: 2px;
}
body[data-zone-preview] .map-panel #wz-draw-palette :is(.wz-draw-marks, .wz-draw-actions) button .wz-mark-caption {
  font-size: .71875rem;
  font-weight: 500;
}

body[data-zone-preview] .map-panel[data-zone-floating][data-wz-drawer=draw] > #wz-map-toolbar {
  padding: 2px;
}
body[data-zone-preview] .map-panel[data-zone-floating][data-wz-draw-view=style] > #wz-map-toolbar {
  width: min(calc(15rem + 124px), calc(100% - 14px));
}
body.hq-battle[data-zone-preview] .map-panel[data-wz-draw-view=style] #wz-map-toolbar #drawing-tools .drawing-bottom-row {
  display: grid !important;
  grid-template-columns: fit-content(34%) minmax(0, 1fr);
  align-items: start;
  gap: 1px;
}
body.hq-battle[data-zone-preview] .map-panel[data-wz-draw-view=style] #wz-map-toolbar #drawing-tools #drawing-style-options {
  display: flex !important;
  flex-flow: row wrap;
  gap: 1px;
  padding: 0;
}
body.hq-battle[data-zone-preview] .map-panel[data-wz-draw-view=style] #wz-map-toolbar #drawing-tools #draw-colours {
  display: contents !important;
}
body.hq-battle[data-zone-preview] .map-panel[data-wz-draw-view=style] #wz-map-toolbar #drawing-tools .drawing-bottom-row > #draw-style-toggle {
  flex: 0 1 auto;
  align-self: start;
  justify-content: flex-start;
  width: auto;
  gap: .25em;
  padding: 2px .3em;
}
body.hq-battle[data-zone-preview] .map-panel[data-wz-draw-view=style] #wz-map-toolbar #drawing-tools .drawing-bottom-row > #draw-style-toggle::before {
  display: none;
}
body.hq-battle[data-zone-preview] .map-panel[data-wz-draw-view=style] #wz-map-toolbar #drawing-tools .wz-draw-select {
  flex: 0 1 auto;
  min-width: 4.5em;
  padding: 2px 1.25em 2px .4em;
}
body.hq-battle[data-zone-preview] .map-panel[data-wz-draw-view=style] #wz-map-toolbar #drawing-tools #draw-colours button {
  flex: 0 0 44px;
}
body[data-zone-preview] .map-panel[data-zone-floating][data-wz-drawer=draw][data-wz-draw-view=more] > #wz-map-toolbar {
  width: min(18.5rem, calc(100% - 14px));
  max-height: max(44px, min(45%, calc(100% - var(--wz-quick-h, 50px) - 74px))) !important;
  max-block-size: max(44px, min(45%, calc(100% - var(--wz-quick-h, 50px) - 74px))) !important;
}
body.hq-battle[data-zone-preview] .map-panel[data-wz-draw-view=more] #wz-map-toolbar #drawing-tools #drawing-extra[open] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(5.6rem, 100%), 1fr));
  gap: 2px;
}
body.hq-battle[data-zone-preview] .map-panel[data-wz-draw-view=more] #wz-map-toolbar #drawing-tools #drawing-extra[open] :is(#drawing-context:not([hidden]),#drawing-bends:not([hidden])) {
  display: contents;
}
body.hq-battle[data-zone-preview] .map-panel[data-wz-draw-view=more] #wz-map-toolbar #drawing-tools #drawing-extra[open]::details-content,
body.hq-battle[data-zone-preview] .map-panel[data-wz-draw-view=more] #wz-map-toolbar #drawing-tools #drawing-extra[open] > div {
  display: contents;
}
body.hq-battle[data-zone-preview] .map-panel[data-wz-draw-view=more] #wz-map-toolbar #drawing-tools #drawing-extra[open] :is(summary,button:not([hidden]),.wz-draw-select) {
  align-items: center;
  margin: 0;
  min-width: 44px;
  min-height: 44px;
  padding: 2px .35em;
  font-size: .765625rem !important;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
body.hq-battle[data-zone-preview] .map-panel[data-wz-draw-view=more] #wz-map-toolbar #drawing-tools #drawing-extra[open] .wz-draw-select {
  padding-inline-end: 1.3em;
}
/* Native disabled hover painting can mask labels on the dark editor. */
body.hq-battle[data-zone-preview] .map-panel[data-wz-draw-view=more] #drawing-extra[open] :is(#share-drawings,#clear-drawings) {
  appearance: none;
}
body.hq-battle[data-zone-preview] .map-panel[data-wz-draw-view=more] #drawing-extra[open] :is(#share-drawings,#clear-drawings):disabled {
  background: #182b35;
  color: #acbec6;
  -webkit-text-fill-color: currentColor;
  border-color: #354b57;
  opacity: 1;
}
body.hq-battle[data-zone-preview] .map-panel[data-wz-draw-view=more] #drawing-extra[open] #clear-drawings:disabled {
  background: #30252d;
  border-color: #59404b;
  color: #c7abb4;
}

/* The floating Build button opens and closes this palette. */
body[data-zone-preview] .map-panel[data-zone-floating][data-wz-build-quick][data-zone-tools-open] > #wz-map-toolbar {
  width:min(14.75rem,calc(100% - 14px));
  padding:2px;
}
body[data-zone-preview] .map-panel[data-wz-build-quick] #wz-map-toolbar :is(.map-toolbar,.tools) {
  padding:0;
  border:0;
  box-shadow:none;
}
body[data-zone-preview] .map-panel[data-wz-build-quick] #wz-map-toolbar #more-map-tools > summary {
  display:none!important;
}
body[data-zone-preview] .map-panel[data-wz-build-quick] #more-map-tools[open] > .secondary-map-tools {
  grid-template-columns:minmax(0,.92fr) minmax(0,1fr) minmax(0,1.08fr);
  align-items:stretch;
  padding:0;
  gap:0;
}
body[data-zone-preview] .map-panel[data-wz-build-quick] #wz-map-toolbar #more-map-tools .secondary-map-tools > button {
  box-sizing:border-box;
  min-width:44px;
  min-height:44px;
  margin:0;
  padding:2px 4px!important;
  gap:3px;
  font-size:.75rem!important;
  line-height:1.22;
  white-space:normal;
  overflow-wrap:anywhere;
}
body[data-zone-preview] .map-panel[data-wz-build-quick] #more-map-tools .secondary-map-tools > button > span {
  min-width:0;
  white-space:normal;
  overflow-wrap:anywhere;
}
body[data-zone-preview] .map-panel[data-wz-build-quick] #more-map-tools #coordinate-button {
  grid-column:span 2;
}

body[data-zone-preview] .map-panel[data-wz-build-quick] #more-map-tools {
  container:build-palette / inline-size;
}
@container build-palette (max-width:12rem) {
  body[data-zone-preview] .map-panel[data-wz-build-quick] #more-map-tools[open] > .secondary-map-tools {
    display:flex!important;
    flex-flow:row wrap;
  }
  body[data-zone-preview] .map-panel[data-wz-build-quick] #more-map-tools .secondary-map-tools > button {
    flex:1 1 auto;
    width:max-content;
    max-width:100%;
  }
}
@media (orientation:landscape) and (max-height:32rem) {
  body[data-zone-preview] .map-panel[data-zone-floating][data-wz-build-quick][data-zone-tools-open] > #wz-map-toolbar {
    width:min(21rem,calc(100% - 14px));
  }
  body[data-zone-preview] .map-panel[data-wz-build-quick] #more-map-tools[open] > .secondary-map-tools {
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
  body[data-zone-preview] .map-panel[data-wz-build-quick] #more-map-tools #coordinate-button {
    grid-column:auto;
  }
}

/* Anchor the native desktop popup to its Build summary. */
body[data-zone-preview] .map-panel:not([data-zone-floating]) #more-map-tools {
  position:relative;
}
body[data-zone-preview] .map-panel:not([data-zone-floating]) #more-map-tools[open] > .secondary-map-tools {
  inset:auto auto auto 50%;
  top:calc(100% + 4px);
  transform:translateX(-50%);
  width:max-content;
  max-width:42vw;
  grid-template-columns:repeat(3,auto);
  align-items:stretch;
  padding:2px;
  gap:0;
}
body[data-zone-preview] .map-panel:not([data-zone-floating]) #wz-map-toolbar #more-map-tools .secondary-map-tools > button {
  min-width:44px;
  min-height:44px;
  width:100%;
  margin:0;
  padding:2px 4px!important;
  gap:3px;
  font-size:.75rem!important;
  line-height:1.22;
  white-space:normal;
  overflow-wrap:anywhere;
}
body[data-zone-preview] .map-panel:not([data-zone-floating]) #more-map-tools .secondary-map-tools > button > span {
  min-width:0;
  white-space:normal;
  overflow-wrap:anywhere;
}
body[data-zone-preview] .map-panel:not([data-zone-floating]) #more-map-tools #coordinate-button {
  grid-column:span 2;
}
@container zone-map-tools (max-width:34rem) {
  body[data-zone-preview] .map-panel:not([data-zone-floating]) #more-map-tools[open] > .secondary-map-tools {
    display:flex;
    flex-flow:row wrap;
    width:min(18rem,42vw);
  }
  body[data-zone-preview] .map-panel:not([data-zone-floating]) #wz-map-toolbar #more-map-tools .secondary-map-tools > button {
    flex:1 1 auto;
    width:max-content;
    max-width:100%;
  }
}

/* Keep the map visible while changing a layer. The native dialog owns focus and dismissal. */
body.hq-battle dialog#map-settings-dialog {
  width: min(322px, calc(100% - 16px)) !important;
  max-height: min(72dvh, 620px) !important;
  padding: 4px 8px 6px;
  border-radius: 10px;
  font-size: .78125rem;
  scroll-padding-block: 3.25rem .5rem;
}
body.hq-battle dialog#map-settings-dialog[open] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.6rem), 1fr));
  grid-auto-rows: max-content;
  gap: 0 6px;
  align-content: start;
}
body.hq-battle dialog#map-settings-dialog::backdrop {
  background: rgb(8 18 26 / 18%);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
body.hq-battle dialog#map-settings-dialog > :is(.dialog-header, .map-options),
body.hq-battle dialog#map-settings-dialog:has(> details[open]) > details {
  grid-column: 1 / -1;
}
body.hq-battle dialog#map-settings-dialog .dialog-header {
  inset-block-start: -4px;
  padding: 0 !important;
  margin: 0 0 3px !important;
  column-gap: 4px !important;
  background: var(--zp-panel);
}
body.hq-battle dialog#map-settings-dialog .dialog-header #map-settings-dialog-title {
  font-size: .8125rem !important;
  font-weight: 600;
  line-height: 1.25;
}
body.hq-battle dialog#map-settings-dialog .dialog-header button[data-close] {
  font-size: 1.125rem !important;
}
body.hq-battle dialog#map-settings-dialog .map-options {
  padding: 0;
  margin: 0 !important;
  border: 0;
}
body.hq-battle dialog#map-settings-dialog .zone-map-choice {
  grid-template-columns: fit-content(45%) minmax(0, 1fr);
  align-items: center;
  gap: 4px 8px;
}
body.hq-battle dialog#map-settings-dialog .zone-map-choice > label {grid-area: 1 / 1}
body.hq-battle dialog#map-settings-dialog .zone-map-choice > :is(select, .wz-map-view-value) {grid-area: 1 / 2}
body.hq-battle dialog#map-settings-dialog .map-toggles {display: contents}
body.hq-battle dialog#map-settings-dialog label.toggle {
  min-width: 0;
  min-height: 44px;
  gap: 6px;
}
body.hq-battle dialog#map-settings-dialog .wz-map-actions {
  margin: 0;
  display: flex;
  align-items: center;
}
body.hq-battle dialog#map-settings-dialog #whole-map {
  width: 100%;
  padding: 3px 6px;
}
body.hq-battle dialog#map-settings-dialog :is(.map-advanced, #wz-map-notes) {
  margin: 2px 0 0;
  min-width: 0;
}
body.hq-battle dialog#map-settings-dialog :is(.map-advanced, #wz-map-notes) > summary {
  gap: 5px;
  padding: 2px;
}
body.hq-battle dialog#map-settings-dialog .marker-display {
  gap: 2px;
  margin: 0;
}
body.hq-battle dialog#map-settings-dialog :is(.border-legend, .terrain-legend) {
  margin: 3px 0;
  padding: 3px 0;
  gap: 3px 8px;
}
body.hq-battle dialog#map-settings-dialog .border-legend > span {
  white-space: normal;
  min-width: 0;
}
body.hq-battle dialog#map-settings-dialog :is(.zone-map-choice > label, label.toggle, label.toggle > span, .marker-display > span:first-child, .border-legend, .terrain-legend) {
  font-size: .75rem !important;
  line-height: 1.32;
}
body.hq-battle dialog#map-settings-dialog :is(#whole-map, #coordinate-settings-button, .map-advanced > summary, #wz-map-notes > summary) {
  font-size: .75rem !important;
  line-height: 1.32;
}
body.hq-battle dialog#map-settings-dialog :is(.wz-map-view-value, .marker-display .zone-selected-value) {
  font-size: .75rem !important;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
body.hq-battle dialog#map-settings-dialog #wz-map-notes p {
  font-size: .78125rem !important;
  line-height: 1.45;
  margin: .375em 0;
}
@media (max-width: 720px), (max-width: 1100px) and (max-height: 540px) {
  body.hq-battle dialog#map-settings-dialog {
    /* Leave the coordinate strip below the sheet at default and enlarged text. */
    inset: auto max(8px, env(safe-area-inset-right)) calc(max(34px, 1.15rem + 6px) + env(safe-area-inset-bottom)) auto;
    margin: 0;
    max-height: 66dvh !important;
  }
}

/* Short portrait phones have less map below the site and campaign headers. */
@media (max-width: 720px) and (max-height: 640px) and (orientation: portrait) {
  body.hq-battle dialog#map-settings-dialog {
    inset-block: max(8px, env(safe-area-inset-top)) auto;
    max-height: 46dvh !important;
  }
}
body.hq-battle dialog#map-settings-dialog .map-options {container: wz-filter-view / inline-size}
@container wz-filter-view (max-width: 14rem) {
  body.hq-battle dialog#map-settings-dialog .zone-map-choice {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 2px;
  }
  body.hq-battle dialog#map-settings-dialog .zone-map-choice > :is(select, .wz-map-view-value) {grid-area: 2 / 1}
}

/* Keep the line editor in the map. Its contents scroll independently when labels wrap. */
body[data-zone-preview] main .map-panel .map-stage #line-tools:not([hidden]) {
  --line-caption: .765625rem;
  box-sizing: border-box;
  max-width: calc(100% - 14px) !important;
  border: 1px solid #506872;
  border-radius: 7px;
  background: #15252ff7;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding: 3px;
  font: 400 var(--line-caption)/1.3 system-ui,sans-serif;
}
body[data-zone-preview] main .map-panel .map-stage #line-tools:not([hidden]):not([data-zone-line-open]) {
  display: flex !important;
  flex-flow: row wrap !important;
  align-items: center !important;
  gap: 2px;
  width: max-content;
  height: auto;
  padding: 1px !important;
}
body[data-zone-preview] main .map-panel .map-stage #line-tools:not([data-zone-line-open]) > :not(#wz-line-header, #line-summary),
body[data-zone-preview] main .map-panel #line-tools:not([data-zone-line-open]) #line-summary > :not(#line-place),
body[data-zone-preview] main .map-panel #line-tools:not([data-zone-line-open]) #line-summary:not(:has(#line-place:not(:disabled):not([hidden]))) {
  display: none !important;
}
body[data-zone-preview] main .map-panel #line-tools:not([data-zone-line-open]) #line-summary:has(#line-place:not(:disabled):not([hidden])) {
  display: contents !important;
}
/* A saved line can be closed directly from the folded map toolbar. */
body[data-zone-preview] main#hq-main-content .map-panel .map-stage #line-tools[data-save-state="saved"]:not([data-zone-line-open]) > :is(#line-summary, #line-toolbar-controls) {
  display: contents !important;
}
body[data-zone-preview] main#hq-main-content .map-panel .map-stage #line-tools[data-save-state="saved"]:not([data-zone-line-open]) > #line-toolbar-controls > :not(#line-done) {
  display: none !important;
}
body[data-zone-preview] main#hq-main-content .map-panel #line-tools[data-save-state="saved"]:not([data-zone-line-open]) #line-place:disabled {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 0;
  padding: 2px 5px;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: inherit;
  font-weight: 400;
  opacity: 1;
}
body[data-zone-preview] main#hq-main-content .map-panel #line-tools[data-save-state="saved"]:not([data-zone-line-open]) #line-done {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  order: 1;
}
body[data-zone-preview] main#hq-main-content .map-panel .map-stage #line-tools:not([hidden]) > #wz-line-header {
  display: flex !important;
  flex-flow: row nowrap;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
  width: fit-content;
}
body[data-zone-preview] main .map-panel #line-tools #wz-line-header > :is(#wz-line-options, #line-switch:not([hidden])) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  box-sizing: border-box;
  width: auto;
  min-width: 44px;
  min-height: 44px;
  padding: 2px 5px;
  margin: 0;
  font: 550 var(--line-caption)/1.2 system-ui,sans-serif;
  white-space: normal;
  overflow-wrap: anywhere;
}
/* Preserve a single long menu name when the line count can wrap on spaces. */
body[data-zone-preview] main .map-panel #line-tools #wz-line-header > #wz-line-options {
  flex-shrink: 0;
  max-width: calc(100% - 46px);
}
body[data-zone-preview] main .map-panel #line-tools #wz-line-header:has(#line-switch[hidden]) > #wz-line-options {
  max-width: 100%;
}
body[data-zone-preview] main .map-panel #line-tools #wz-line-header > #line-switch {
  text-wrap: balance;
}
body[data-zone-preview] main .map-panel #line-tools #wz-line-options::after {
  content: '';
  width: 6px;
  height: 6px;
  flex: none;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  margin: 0 1px 3px 0;
}
body[data-zone-preview] main .map-panel #line-tools #wz-line-options[aria-expanded=true]::after {
  transform: rotate(225deg);
  margin: 3px 1px 0 0;
}
body[data-zone-preview] main .map-panel .map-stage #line-tools[data-zone-line-open]:not([hidden]) {
  display: flex !important;
  flex-flow: column nowrap !important;
  align-items: stretch !important;
  gap: 2px;
  width: min(18rem, 300px);
  height: auto;
  max-height: min(43%, calc(100% - 119px)) !important;
  padding: 3px !important;
}
body[data-zone-preview][data-map-focus] main .map-panel .map-stage #line-tools[data-zone-line-open]:not([hidden]) {
  max-height: min(43%, calc(100% - var(--wz-line-top) - var(--wz-quick-h,50px) - 10px)) !important;
}
body[data-zone-preview] main .map-panel:not([data-zone-floating]) .map-stage #line-tools:not([hidden]) {
  position: absolute !important;
  inset: 7px auto auto 7px !important;
  transform: none !important;
}
body[data-zone-preview] main .map-panel #line-tools[data-zone-line-open] > * {
  flex: none !important;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
body[data-zone-preview] main .map-panel #line-tools #line-toolbar-controls {
  position: static;
  display: flex;
  flex-flow: row wrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 2px;
  height: auto;
  min-height: 0;
  padding: 0;
  margin: 0;
}
body[data-zone-preview] main .map-panel #line-tools #line-toolbar-controls .line-segment {
  flex: 0 1 auto;
  flex-wrap: wrap;
  max-width: 100%;
}
body[data-zone-preview] main .map-panel #line-tools :is(#line-toolbar-controls button, #line-place, #line-start, #line-time-warning, #line-shape-actions button, #line-settings summary) {
  min-width: 44px;
  min-height: 44px;
  width: auto;
  height: auto;
  max-width: 100%;
  margin: 0;
  padding: 3px 5px;
  font: 500 var(--line-caption)/1.2 system-ui,sans-serif;
  white-space: normal;
  overflow-wrap: anywhere;
}
body[data-zone-preview] main .map-panel #line-tools #line-toolbar-controls button {
  flex: 0 1 auto;
  align-self: stretch;
}
body[data-zone-preview] main .map-panel #line-tools #line-toolbar-controls :is(#line-clear, #line-delete) {
  gap: 1px;
}
body[data-zone-preview] main .map-panel #line-tools #line-done::after,
body[data-zone-preview] main .map-panel #line-tools #line-place::after,
body[data-zone-preview] main .map-panel #line-tools #line-more::before {
  content: none;
}
body[data-zone-preview] main .map-panel #line-tools #line-more:not([hidden]) {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}
body[data-zone-preview] main .map-panel #line-tools[data-zone-line-open] #line-summary:not([hidden]) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0;
}
body[data-zone-preview] main .map-panel #line-tools #line-estimate-button {
  flex: 1 1 8rem;
  min-width: 44px;
  min-height: 44px;
  width: auto;
  height: auto;
  margin: 0;
  padding: 3px 1.35rem 3px 6px;
  text-align: start;
}
body[data-zone-preview] main .map-panel #line-tools #line-estimate-button > :is(span, strong, small) {
  width: auto;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  font: 450 var(--line-caption)/1.22 system-ui,sans-serif;
}
body[data-zone-preview] main .map-panel #line-tools #line-estimate-button > span::after {content: none}
body[data-zone-preview] main .map-panel #line-tools #line-estimate-button > strong {font-weight: 650}
body[data-zone-preview] main .map-panel #line-tools #line-estimate-button > small {font-size: .71875rem}
body[data-zone-preview] main .map-panel #line-tools :is(#line-feedback, #line-estimate, #line-time-label, .line-time-settings p, #line-assumption-note) {
  margin: 0;
  font: 400 var(--line-caption)/1.3 system-ui,sans-serif;
  overflow-wrap: anywhere;
}
body[data-zone-preview] main .map-panel #line-tools :is(#line-time-warning, #line-start) {text-align: start}
body[data-zone-preview] main .map-panel #line-tools :is(#line-settings, #line-timing, .line-capacity, .line-unit-control, .line-time-settings) {
  box-sizing: border-box;
  height: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
}
body[data-zone-preview] main .map-panel #line-tools #line-settings[open] {
  overflow: visible;
  border: 0;
  max-height: none;
}
body[data-zone-preview] main .map-panel #line-tools:has(#line-more:not([hidden])) #line-settings-summary {display: none}
body[data-zone-preview] main .map-panel #line-tools:has(#line-more[hidden]) #line-settings-summary {display: list-item}
body[data-zone-preview] main .map-panel #line-tools #line-settings .line-capacity {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}
body[data-zone-preview] main .map-panel #line-tools #line-settings :is(label, .line-unit-control label span, .line-march-label span, #line-crew button) {
  font: 500 var(--line-caption)/1.25 system-ui,sans-serif;
  overflow-wrap: anywhere;
}
body[data-zone-preview] main .map-panel #line-tools #line-settings label small {font-size: .71875rem}
body[data-zone-preview] main .map-panel #line-tools #line-unit-number {width: 4.5em; max-width: 50%}
body[data-zone-preview] main .map-panel #line-tools #line-unit-range {
  display: block;
  box-sizing: border-box;
  height: 44px;
  min-height: 44px;
  width: 100%;
  margin: 0;
}
body[data-zone-preview] main .map-panel #line-tools #line-crew {gap: 2px; padding: 0}
body[data-zone-preview] main .map-panel #line-tools #line-crew button {padding: 2px 3px; min-width: 44px; min-height: 44px}
body[data-zone-preview] main .map-panel #line-tools #line-settings .line-march-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  margin: 0;
}
body[data-zone-preview] main .map-panel #line-tools #line-settings .minute-stepper {gap: 2px; max-width: 100%}
body[data-zone-preview] main .map-panel #line-tools #line-settings .minute-stepper :is(input,button) {
  flex: 0 1 auto;
  min-width: 44px;
  min-height: 44px;
}
body[data-zone-preview] main .map-panel #line-tools #line-settings :is(#line-march, #line-minutes, #line-unit-number) {
  min-height: 44px;
  padding: 2px 4px;
  font: 450 1rem/1.2 system-ui,sans-serif;
}
body[data-zone-preview] main .map-panel #line-tools :focus-visible {
  outline: 2px solid #b1e6da;
  outline-offset: -3px;
}
/* Timing keeps the named line controls together and returns space to the fields. */
body[data-zone-preview] main .map-panel .map-stage #line-tools[data-zone-line-open]:has(#line-settings[open]):not([hidden]) {
  flex-flow: row wrap !important;
  align-content: flex-start;
}
body[data-zone-preview] main .map-panel #line-tools:has(#line-settings[open]) > :not(#line-toolbar-controls, #wz-line-header) {
  width: 100%;
}
body[data-zone-preview] main .map-panel #line-tools:has(#line-settings[open]) #line-toolbar-controls {
  width: fit-content;
}
body[data-zone-preview] main .map-panel #line-tools:has(#line-settings[open]) #line-toolbar-controls > :not(#line-more) {
  display: none !important;
}

/* Map selections share the same title, action row and optional details hierarchy. */
.map-stage #map-context {
  --wz-card-width: 15.5rem;
  --card-gap: 4px;
  container: wz-map-card / inline-size;
  width: min(var(--wz-card-width), calc(100% - 16px));
  padding: 4px 7px 7px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 3px 14px #0004;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  text-align: start;
}
.map-stage #map-context[data-kind="ground"] { --wz-card-width: 13.75rem; }
.map-stage #map-context[data-kind="choices"] { --wz-card-width: 15rem; }
.map-stage #map-context[data-kind="order"]:has(.plant-completion,.selected-availability) { --wz-card-width: 16rem; }
.map-stage #map-context :is(button,summary,input) {
  box-sizing: border-box;
  touch-action: manipulation;
  min-width: 44px;
  min-height: 44px;
  max-width: 100%;
}
.map-stage #map-context :is(.context-heading,.placement-heading,.ground-heading) {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: 0;
}
.map-stage #map-context .context-heading strong {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  color: var(--ink);
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.22;
}
.map-stage #map-context .context-title,
.map-stage #map-context .landmark-heading strong > span { display: grid; min-width: 0; gap: 1px; }
.map-stage #map-context .placement-name,
.map-stage #map-context .context-route > span,
.map-stage #map-context .ground-area,
.map-stage #map-context .map-choice-list strong {
  display: block;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  -webkit-line-clamp: unset;
}
.map-stage #map-context .context-number {
  flex: none;
  align-self: flex-start;
  min-width: 19px;
  height: auto;
  padding: 2px 4px;
  border-radius: 5px;
  box-sizing: border-box;
  font: 650 .6875rem/1.45 system-ui,sans-serif;
  text-align: center;
}
.map-stage #map-context .context-heading > button {
  flex: 0 0 44px;
  align-self: flex-start;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 400 1.125rem/1 system-ui,sans-serif;
}
.map-stage #map-context .ground-heading .ground-coordinates,
.map-stage #map-context .placement-coordinates {
  color: var(--muted);
  font: 500 .75rem/1.32 ui-monospace,monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  margin: 0;
  white-space: normal;
}
.map-stage #map-context .ground-heading .ground-coordinates {
  flex: initial;
  color: var(--ink);
  font-size: .8125rem;
  font-weight: 600;
}
.map-stage #map-context .ground-heading .ground-area { flex: 1; font-size: .75rem; }
.map-stage #map-context :is(.context-actions,.context-secondary,.context-route-tools,.unit-presets) {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,5.5rem),1fr));
  gap: var(--card-gap);
  align-items: stretch;
  margin: 0;
}
.map-stage #map-context :is(.placement-actions,.card-actions,.ground-actions,.landmark-actions) {
  display: flex;
  flex-wrap: wrap;
  gap: var(--card-gap);
  margin: 2px 0 0;
}
.map-stage #map-context :is(.placement-actions,.card-actions,.ground-actions,.landmark-actions) > button {
  flex: 1 1 min-content;
}
.map-stage #map-context :is(.context-actions,.context-secondary,.context-route-tools,.unit-presets,.selected-availability) button,
.map-stage #map-context .control-toggle,
.map-stage #map-context .placement-warning {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 4px 6px;
  font: 550 .8125rem/1.25 system-ui,sans-serif;
  white-space: normal;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.map-stage #map-context .context-actions button::before,
.map-stage #map-context .context-secondary button::before { display: none; }
.map-stage #map-context .context-actions .context-more {
  flex: 0 1 auto;
  background: transparent;
  color: var(--muted);
}
.map-stage #map-context .context-more[aria-expanded="true"] { color: var(--ink); background: var(--ui-control); }
.map-stage #map-context .placement-repeat span { font-size: 1em; }
.map-stage #map-context .control-toggle { width: 100%; margin-top: var(--card-gap); justify-content: flex-start; }
.map-stage #map-context .placement-warning {
  width: 100%;
  justify-content: flex-start;
  gap: 5px;
  margin-top: var(--card-gap);
  font-size: .75rem;
  text-align: start;
}
.map-stage #map-context p.placement-warning { min-height: 0; box-sizing: border-box; }
.map-stage #map-context .context-route {
  display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 5px; row-gap: 2px;
  margin: 5px 0 0; font-size: .75rem; line-height: 1.3;
}
.map-stage #map-context .context-route::before { align-self: center; }
.map-stage #map-context .context-route > span { flex: 1 1 auto; }
.map-stage #map-context .context-route small { font: inherit; white-space: normal; overflow-wrap: anywhere; }
.map-stage #map-context .plant-completion { margin: 2px 0 4px; padding: 5px 7px; gap: 2px; border-radius: 5px; }
.map-stage #map-context .plant-completion strong { font-size: .8125rem; font-weight: 600; line-height: 1.32; }
.map-stage #map-context :is(.context-help,.placement-extra p,.plant-completion small,.connection-note,.selection-summary,.plant-navigation > span) {
  display: block;
  font-size: .75rem;
  line-height: 1.38;
}
.map-stage #map-context :is(.placement-extra,.context-extra) {
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 6px;
}
.map-stage #map-context :is(.placement-extra,.context-extra)[hidden] { display: none; }
.map-stage #map-context .context-extra .selection-summary { margin: 3px 0; font-size: .75rem; }
.map-stage #map-context .context-extra .context-route { margin-top: 0; }
.map-stage #map-context .connection-note { padding: 5px 7px; margin: 4px 0; }
.map-stage #map-context .connection-note span { display: block; font-size: inherit; line-height: inherit; }
.map-stage #map-context .context-secondary { margin-top: 5px; }
.map-stage #map-context .selection-delete-actions { display: contents; }
.map-stage #map-context .context-secondary button { border: 1px solid var(--line); background: var(--ui-control); }
.map-stage #map-context .context-secondary button.danger { color: var(--ui-danger); background: var(--ui-danger-bg); border-color: var(--ui-danger-line); }
.map-stage #map-context .plant-navigation { margin: 0 0 2px; padding-bottom: 3px; }
.map-stage #map-context .plant-navigation button { width: 44px; height: 44px; }
.map-stage #map-context .selected-build-settings summary {
  display: flex; flex-flow: row wrap; align-items: center; justify-content: space-between;
  gap: 4px; padding: 4px 0; font-size: .8125rem; line-height: 1.3;
}
.map-stage #map-context .selected-build-settings summary::after { content: '⌄'; }
.map-stage #map-context .selected-build-settings[open] summary::after { content: '⌃'; }
.map-stage #map-context .selected-build-settings .unit-slider-heading,
.map-stage #map-context .selected-build-settings .unit-slider-heading > div,
.map-stage #map-context .selected-build-settings .unit-march label {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
}
.map-stage #map-context .selected-build-settings :is(label,output,.unit-march span,.unit-slider-heading span) { font-size: .75rem; }
.map-stage #map-context .selected-build-settings input[type="number"] { width: 6em; font-size: .875rem; }
.map-stage #map-context .map-choice-list { display: grid; grid-template-columns: minmax(0,1fr); gap: 3px; }
.map-stage #map-context .map-choice-list button {
  min-height: 44px; padding: 4px 6px; gap: 6px; text-align: start;
}
.map-stage #map-context .map-choice-list strong { font-size: .8125rem; font-weight: 600; line-height: 1.3; }
.map-stage #map-context .map-choice-list small { font-size: .75rem; line-height: 1.3; }


.map-stage #map-context .card-connection {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 44px;
  margin: 2px 0 4px;
  padding: 5px 7px;
  text-align: start;
  border: 1px solid var(--ui-warning-line);
  border-radius: 5px;
  background: var(--ui-warning-bg);
  color: var(--warn);
}
.map-stage #map-context .card-connection strong { font-size: .8125rem; line-height: 1.25; }
.map-stage #map-context .card-connection span { font-size: .75rem; line-height: 1.3; }
.map-stage #map-context .ground-actions { display: grid; grid-template-columns: minmax(44px,.75fr) minmax(0,1.2fr) minmax(0,1.05fr); }
.map-stage #map-context .ground-actions:not(:has([data-context="destination-cell"])) { grid-template-columns: repeat(2,minmax(0,1fr)); }
.map-stage #map-context .ground-actions button > span { white-space: normal; }

.map-stage #map-context :is(.card-type,.card-full-name) { display: none; }
@container wz-map-card (max-width: 12rem) {
  .map-stage #map-context :is(.card-actions,.landmark-actions,.placement-actions) > button {
    flex: 1 0 auto;
    max-width: 100%;
  }
  .map-stage #map-context :is(.card-actions,.landmark-actions,.placement-actions) > .context-more { flex: 0 0 auto; }
  .map-stage #map-context .ground-actions { grid-template-columns: minmax(0,.75fr) minmax(0,1.25fr); }
  .map-stage #map-context .ground-actions [data-context="destination-cell"] { grid-column: 1 / -1; }
  .map-stage #map-context .card-type { display: block; }
  .map-stage #map-context .card-type + .placement-name { display: none; }
  .map-stage #map-context .card-full-name {
    display: block;
    margin: 4px 0 0;
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }
}

/* Marker and building details share this editor. Allow native controls to fit
   their column even when a dependency name is much wider than the panel. */
body[data-zone-preview] #editor-dialog {
  container-type: inline-size;
  overflow: auto;
  overscroll-behavior: contain;
}
body[data-zone-preview] #editor-dialog .editor-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
}
body[data-zone-preview] #editor-dialog .editor-head h2 {
  flex: 1 1 9rem;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.28;
  overflow-wrap: anywhere;
}
body[data-zone-preview] #editor-dialog .editor-head > div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 100%;
}
body[data-zone-preview] #editor-dialog .editor-head button {
  min-height: 44px;
  max-width: 100%;
  padding: 4px 8px;
  font-size: 0.8125rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
body[data-zone-preview] #editor-dialog .editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
  align-items: start;
  gap: 8px;
  margin-top: 8px;
}
body[data-zone-preview] #editor-dialog .editor-grid > .wide {
  grid-column: 1 / -1;
}
body[data-zone-preview] #editor-dialog .editor-grid > *,
body[data-zone-preview] #editor-dialog .editor-note {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
body[data-zone-preview] #editor-dialog label,
body[data-zone-preview] #editor-dialog .editor-hint {
  font-size: 0.8125rem;
  line-height: 1.35;
}
body[data-zone-preview] #editor-dialog .editor-grid :is(input:not([type=checkbox]),select,textarea),
body[data-zone-preview] #editor-dialog .editor-note textarea {
  box-sizing: border-box;
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
  min-height: 44px;
  font-size: 1rem;
}
body[data-zone-preview] #editor-dialog select { overflow: hidden; text-overflow: ellipsis; }
@container (max-width: 20rem) {
  body[data-zone-preview] #editor-dialog .editor-head { align-items: flex-start; }
  body[data-zone-preview] #editor-dialog .editor-head > h2 { flex-basis: 100%; }
}

/* WebKit includes an option's intrinsic width in its label's scroll area. */
body[data-zone-preview] #editor-dialog .editor-grid label:has(> select) {
  overflow: clip;
  overflow-clip-margin: 3px;
}

/* Use the coordinate strip for the next route action, clear of the canvas. */
body.hq-battle[data-zone-preview] main#hq-main-content > #wz-map-readout {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:2px 8px;
}
body[data-zone-preview] #wz-route-actions:not([hidden]) {
  grid-column:2;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  max-width:min(52vw,16rem);
}
body[data-zone-preview] #wz-route-actions #commander-draw {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  min-height:44px;
  min-width:44px;
  padding:3px 10px;
  margin:0;
  border:1px solid #528779;
  border-radius:5px;
  background:#244a43;
  color:#d8faef;
  font:600 .75rem/1.22 system-ui,sans-serif;
  text-align:center;
  white-space:normal;
  overflow-wrap:anywhere;
}
body[data-zone-preview] #wz-route-actions #commander-draw::before,
body[data-zone-preview] #wz-route-actions #commander-draw::after {content:none}
body[data-zone-preview] #wz-route-actions #wz-route-reached {
  font:500 .71875rem/1.3 system-ui,sans-serif;
  color:#b2d3c7;
  overflow-wrap:anywhere;
}
@media (max-width:360px) {
  body[data-zone-preview] #wz-route-actions:has(+ #wz-route-coverage:not([hidden])) {
    max-width:68vw;
  }
}
body[data-zone-preview] #wz-route-coverage:not([hidden]) {
  grid-column:1/-1;
  color:#e4cda0;
  font:500 .75rem/1.35 system-ui,sans-serif;
  overflow-wrap:anywhere;
}
body[data-zone-preview] #wz-map-readout #route-search-status:not(:empty) {
  display:block;
  position:static;
  grid-column:1/-1;
  box-sizing:border-box;
  width:100%;
  max-height:max(50px,12dvh);
  overflow:auto;
  margin:0;
  padding:2px 0;
  color:#c3d5d9;
  background:none;
  border:0;
  font:500 .71875rem/1.35 system-ui,sans-serif;
  overflow-wrap:anywhere;
}
body[data-zone-preview] #wz-map-readout #route-search-status:empty {display:none}
body[data-zone-preview] #wz-map-readout #route-search-status button {
  min-height:44px;
  min-width:44px;
  padding:2px 6px;
  font:inherit;
}

/* Filters stays above the coordinate strip when a route command or message is present. */
@media (max-width:720px), (max-width:1100px) and (max-height:540px) {
  body.hq-battle dialog#map-settings-dialog {
    --wz-filter-bottom:max(calc(34px + env(safe-area-inset-bottom)), calc(1.15rem + 6px + env(safe-area-inset-bottom)), calc(var(--wz-readout-height, 21px) + 4px));
    inset-block-end:var(--wz-filter-bottom);
  }
}
@media (max-width:720px) and (max-height:640px) and (orientation:portrait) {
  body.hq-battle dialog#map-settings-dialog {inset-block-end:auto}
}

body[data-zone-preview] .map-stage #map-context {
  box-sizing:border-box;
  overflow-y:auto;
  overscroll-behavior:contain;
}
body[data-zone-preview] .map-stage:has(#map-context[data-kind="placement"]:not([hidden])) #placement-mode {
  display:none;
}

/* Keep loading and recovery independent of the interactive map. */
body[data-zone-preview] #wz-loading {display:none;font-size:.875rem;line-height:1.4;margin:1rem;}
body[data-zone-preview][data-wz-loading] #wz-loading {display:block;}
body[data-zone-preview][data-wz-loading] :is(.workspace,.wz-bar-actions,#wz-campaign,#wz-location,#route-search-status,#commander-route) {visibility:hidden!important;}
body[data-zone-preview][data-wz-failed] :is(#wz-campaign,#wz-location,#map-entry-screen,#wz-loading) {display:none!important;}
body[data-zone-preview] #wz-zone-trigger {display:flex;align-items:center;flex-wrap:wrap;gap:1px .55rem;box-sizing:border-box;min-height:44px;min-width:44px;max-width:100%;padding:1px 0;border:0;border-radius:4px;background:transparent;color:inherit;font:inherit;line-height:inherit;text-align:start;cursor:pointer;}
body[data-zone-preview] #wz-zone-trigger:disabled {opacity:1;cursor:default;}
body[data-zone-preview] #wz-zone-trigger:focus-visible {outline:2px solid var(--wz-accent);outline-offset:1px;}
body[data-zone-preview] #wz-location:not([hidden]) {display:inline-flex;align-items:center;gap:.35em;font-size:.8125rem;line-height:1.2;font-weight:550;}
body[data-zone-preview] #wz-location:not([hidden])::after {content:'';flex:none;width:.36em;height:.36em;transform:rotate(45deg);border:solid currentColor;border-width:0 1.5px 1.5px 0;}
body[data-zone-preview] #wz-location[hidden] {display:none!important;}
@media(min-width:353px) and (max-width:720px) {
 body[data-zone-preview]:not([data-map-focus]) #wz-zone-trigger {display:grid;align-content:center;gap:1px;justify-items:start;}
}
@media(max-width:352px) {
 body[data-zone-preview]:not([data-map-focus]) .wz-bar {display:grid!important;grid-template-columns:minmax(0,1fr) auto;column-gap:3px;}
 body[data-zone-preview]:not([data-map-focus]) #wz-campaign {min-width:0;max-width:100%;}
 body[data-zone-preview]:not([data-map-focus]) .wz-campaign-caption {overflow-wrap:anywhere;white-space:normal;}
}
@media(min-width:420px) and (max-width:720px) and (max-height:420px) {
 body[data-zone-preview]:not([data-map-focus]):not([data-wz-failed]):not([data-wz-loading]) #wz-zone-trigger:not(:disabled) #wz-title {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);}
}
@media(min-width:721px) and (min-height:541px), (min-width:1101px){
 body[data-zone-preview][data-map-focus] .wz-bar {position:relative;inset:auto;box-sizing:border-box;width:100%;max-width:none;min-height:46px;padding:2px 10px;justify-content:space-between;background:var(--wz-panel,#10232b);pointer-events:auto;}
 body[data-zone-preview][data-map-focus] .wz-title {display:flex!important;}
 body[data-zone-preview][data-map-focus] .map-panel>.map-caption {display:flex!important;}
 body[data-zone-preview][data-map-focus] #wz-map-focus .wz-full-label {display:inline;}
}
@media(min-width:353px) and (max-width:420px) {
 body.hq-battle[data-zone-preview]:not([data-map-focus]) .wz-bar-actions #wz-setup-toggle {max-width:min(26vw,6rem);}
}

/* Compact mode controls share a touch-sized row. Full instructions open on request. */
#placement-help-button {display:none}
body[data-zone-preview] .map-panel[data-zone-floating] .map-stage #placement-mode:not([hidden]) {
  width:max-content;max-width:calc(100% - 16px);min-height:44px;
  padding:0;gap:0;align-items:stretch;border-radius:8px;
}
body[data-zone-preview] .map-panel[data-zone-floating] .map-stage #placement-mode > div:first-child {display:none}
body[data-zone-preview] .map-panel[data-zone-floating] .map-stage #placement-help-button {
  display:flex;align-items:center;gap:6px;margin:0;padding:3px 8px;min-width:44px;max-width:min(180px,55vw);
  border:0;background:transparent;color:inherit;
}
body[data-zone-preview] .map-panel[data-zone-floating] .map-stage #placement-help-button span {
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
#placement-help-button svg {width:16px;height:16px;flex:none}
body[data-zone-preview] .map-panel[data-zone-floating] .map-stage #cancel-placement-mode {
  font-size:0!important;flex:0 0 44px;width:44px;min-height:44px;margin:0;padding:0;border-width:0 0 0 1px;border-radius:0 7px 7px 0;
}
body[data-zone-preview] .map-panel[data-zone-floating] .map-stage #cancel-placement-mode::before {content:'×' / '';font:24px/1 sans-serif}
@media(max-height:420px) {
  body[data-zone-preview]:not([data-map-focus]) .map-panel[data-zone-floating] .map-stage:has(#placement-mode:not([hidden])) .history-controls {left:auto;right:8px;top:4px;bottom:auto;margin:0}
}
#wz-placement-help {box-sizing:border-box;max-width:min(30rem,calc(100vw - 20px));max-height:calc(100dvh - 20px);overflow:auto}
#wz-placement-help h2,#wz-placement-help p {overflow-wrap:anywhere}
#wz-placement-help .dialog-header button {min-width:44px;min-height:44px}
.wz-coordinate-help,.wz-coordinate-feedback {
  grid-column:1/-1;margin:0;min-width:0;font-size:.875rem;line-height:1.4;overflow-wrap:anywhere;
}
.wz-coordinate-feedback [role=alert]:empty {display:none}
.wz-coordinate-feedback p {margin:0}
.wz-coordinate-feedback [role=alert]:not(:empty) {padding:6px 0;color:#ffd1c8;font-weight:600}
.wz-coordinate-feedback button {min-height:44px;max-width:100%;white-space:normal}
:is(#coordinate-form,#editor) input[aria-invalid=true] {outline:2px solid #ec9588;outline-offset:-2px}

/* In short landscape, keep the middle of the map reachable while placing. */
@media (max-width:700px) and (max-height:365px) {
  body[data-zone-preview] .map-panel[data-zone-floating]:has(#placement-mode:not([hidden])) #wz-quick-tools button span {
    position:absolute;inline-size:1px;block-size:1px;overflow:hidden;clip-path:inset(50%);
  }
  body[data-zone-preview] .map-panel[data-zone-floating]:has(#placement-mode:not([hidden])) #wz-quick-tools button {
    flex:0 0 44px;inline-size:44px;min-width:44px;padding:2px;
  }
}

/* Route actions inside Plan share the available width and show their full labels. */
body.hq-battle[data-zone-preview] #wz-setup-panel .commander-route-actions:not([hidden]) {
  display: grid !important;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.25rem), 1fr));
  gap: 4px;
  width: 100%;
}
body.hq-battle[data-zone-preview] #wz-setup-panel .commander-route-actions button:not([hidden]) {
  display: flex !important;
  flex-flow: row wrap;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  width: 100% !important;
  max-width: none;
  height: auto !important;
  min-height: 44px;
  padding: .3rem .45rem;
  font-size: var(--plan-type) !important;
  line-height: 1.3;
  white-space: normal;
}
body.hq-battle[data-zone-preview] #wz-setup-panel .commander-route-actions button::before,
body.hq-battle[data-zone-preview] #wz-setup-panel .commander-route-actions button::after {
  content: none !important;
  display: none !important;
}
body.hq-battle[data-zone-preview] #wz-setup-panel #commander-adjust-line > span {
  display: inline !important;
  position: static;
  font: inherit !important;
  width: auto;
  height: auto;
  clip-path: none;
  overflow: visible;
}
body.hq-battle[data-zone-preview] #wz-setup-panel #commander-adjust-line > span::after {
  content: none !important;
}
body.hq-battle[data-zone-preview] #wz-setup-panel:has(.commander-route-actions:not([hidden])) #route-timing-button {
  display: none !important;
}

/* Local plan identity, recovery and image export. */
body.hq-battle #wz-panel-title{min-width:0}
body.hq-battle #wz-panel-title:has(#wz-current-plan:not(:empty))>span{display:none}
body.hq-battle #wz-current-plan,body.hq-battle #wz-link-plan-name{display:block;overflow-wrap:anywhere}
body.hq-battle #wz-current-plan{max-width:100%;line-height:1.2}
body.hq-battle[data-zone-preview] #wz-setup-panel #wz-rename-current {
  flex:0 0 auto;min-width:44px;min-height:44px;max-width:45%;margin-inline-start:auto;
  padding:.2rem .45rem;overflow-wrap:anywhere;
}
body.hq-battle[data-zone-preview] #wz-setup-panel .wz-panel-head {
  container:plan-heading / inline-size;flex-wrap:wrap;
}
body.hq-battle[data-zone-preview] #wz-setup-panel .wz-heading-copy {flex:1 1 0}
@container plan-heading (max-width:14rem) {
  body.hq-battle[data-zone-preview] #wz-setup-panel .wz-heading-copy {flex:1 1 calc(100% - 48px)}
  body.hq-battle[data-zone-preview] #wz-setup-panel #wz-close {order:1;align-self:flex-start}
  body.hq-battle[data-zone-preview] #wz-setup-panel #wz-rename-current {order:2;margin-inline-start:0;max-width:100%}
}
body.hq-battle #wz-link-plan-name{margin:.45rem 0 0;font-size:1rem}
body.hq-battle #wz-empty-map-reason{grid-column:1/-1;display:block;color:#c2d5d8;line-height:1.35;margin:.2rem 0}
body.hq-battle #wz-empty-map-reason[hidden],body.hq-battle #wz-manage-dialog [hidden],body.hq-battle #wz-manage-incoming-button[hidden]{display:none!important}
body.hq-battle #wz-manage-dialog{box-sizing:border-box;width:min(30rem,calc(100vw - 1rem));max-height:calc(100dvh - 1rem);overflow:auto;padding:.8rem}
body.hq-battle #wz-manage-dialog :is(label,select){display:block}
body.hq-battle #wz-manage-dialog :is(select,button){min-height:44px;max-width:100%;white-space:normal;overflow-wrap:anywhere}
body.hq-battle #wz-manage-dialog select{width:100%;margin:.25rem 0 .5rem}
body.hq-battle #wz-manage-dialog .dialog-header h2,body.hq-battle #wz-manage-dialog p{overflow-wrap:anywhere}
body.hq-battle #wz-manage-dialog .wz-manage-actions{display:flex;gap:.45rem;flex-wrap:wrap}
body.hq-battle #wz-manage-remove{border-color:#e0a483}
body.hq-battle #wz-link-feedback:has(#wz-manage-incoming-button:not([hidden])){flex-wrap:wrap}
body.hq-battle #wz-manage-incoming-button{max-width:100%;min-height:44px;white-space:normal}
@media(max-width:700px){
 body.hq-battle[data-zone-preview] #briefing-dialog .share-footer{position:static}
 body.hq-battle[data-zone-preview] #briefing-dialog>.wz-export-top{margin:.3rem 0 .4rem;display:flex;align-items:center;gap:.4rem}
 body.hq-battle[data-zone-preview] #briefing-dialog>.wz-export-top button{min-height:44px;max-width:100%;white-space:normal}
}

body.hq-battle[data-zone-preview] #wz-setup-toggle{box-sizing:border-box;max-width:7.5rem;min-width:44px}
body.hq-battle[data-zone-preview] .wz-plan-toggle-copy{display:flex;flex-flow:column nowrap;align-items:flex-start;min-width:0;max-width:100%;line-height:1.12;overflow:hidden;text-align:start}
body.hq-battle[data-zone-preview] #wz-map-plan-name{max-width:100%;font-size:.75rem;line-height:1.15;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}
@media(max-width:700px){
 body.hq-battle[data-zone-preview] #wz-setup-toggle{max-width:min(24vw,6.6rem);flex-shrink:1}
}
@media(max-width:420px){
 body.hq-battle[data-zone-preview] #wz-setup-toggle>.wz-icon{display:none}
 body.hq-battle[data-zone-preview] #wz-setup-toggle{max-width:min(30vw,7rem)}
}


/* Anchor the filter sheet clear of the launcher so a second tap dismisses it. */
body.hq-battle dialog#map-settings-dialog[data-wz-tool-filter] {
 position:fixed;inset:auto;margin:0;box-sizing:border-box;
 max-height:min(var(--wz-filter-room,66dvh),36rem)!important;min-height:0;
 overflow:auto;overscroll-behavior:contain;z-index:12000;
}

/* Give touch and keyboard the same focus target on the native disclosure in WebKit. */
.map-panel[data-zone-floating] .zone-nav-menu > summary svg,
.map-panel[data-zone-floating] .zone-nav-menu > summary svg * {
  pointer-events: none;
}

/* Bound the navigation flyout to the map when a short viewport leaves little room above its trigger. */
.map-panel[data-zone-floating] .zone-nav-menu[open] {
  top: 8px;
  width: 44px;
  pointer-events: none;
}
.map-panel[data-zone-floating] .zone-nav-menu[open] > summary {
  position: absolute;
  right: 0;
  bottom: 0;
  pointer-events: auto;
}
.map-panel[data-zone-floating] .zone-nav-menu[open] .zone-nav-body {
  bottom: 49px;
  width: max-content;
  max-width: calc(100vw - 24px);
  max-height: calc(100% - 49px);
  overflow: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
}
.map-panel[data-zone-floating] .zone-nav-body #map-info-button {
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (orientation: landscape) and (max-height: 540px) {
  .map-panel[data-zone-floating] .zone-nav-menu[open] .zone-nav-body {
    grid-template-columns: repeat(2, minmax(0, max-content));
    align-items: start;
  }
  .map-panel[data-zone-floating] .zone-nav-body #map-info-button {
    grid-column: 1 / -1;
  }
  body[data-zone-preview] .map-panel[data-zone-floating][data-wz-build-quick][data-zone-tools-open] > #wz-map-toolbar {
    max-height: calc(100% - var(--wz-quick-h, 50px) - 20px) !important;
  }
}

/* On wider maps the coordinates, scale and route action share one footer row. */
@media (min-width:601px) {
 body.hq-battle[data-zone-preview] main#hq-main-content > #wz-map-readout:has(#wz-route-actions:not([hidden])) {
  grid-template-columns:minmax(0,1fr) auto auto;
 }
 body.hq-battle[data-zone-preview] #wz-map-readout:has(#wz-route-actions:not([hidden])) .map-scale {
  max-width:min(28vw,18rem);
 }
 body[data-zone-preview] #wz-route-actions:not([hidden]) {grid-column:3;}
}

/* In short landscape the controls sit on the right of the map. Let the open
   line editor use the left side without reserving two full toolbar rows. */
@media (orientation:landscape) and (max-height:540px) {
 body[data-zone-preview]:not([data-map-focus]) main .map-panel[data-zone-floating] .map-stage #line-tools[data-zone-line-open]:not([hidden]) {
  top:7px!important;
  max-height:calc(100% - 14px)!important;
  max-width:48%!important;
 }
 body[data-zone-preview]:not([data-map-focus]) .map-panel[data-zone-floating] .map-stage:has(#line-tools[data-zone-line-open]:not([hidden])) .history-controls {
  left:auto;right:8px;top:4px;bottom:auto;margin:0;
 }
}

/* Build and Filters temporarily cover the map editor. Keep the draft in place
   and expose its actions again when the user dismisses the tool panel. */
body[data-zone-preview] .map-panel:has(#more-map-tools[open]) .map-stage :is(#line-tools, #placement-mode, #map-context),
body[data-zone-preview]:has(#map-settings-dialog[data-wz-tool-filter][open]) .map-panel .map-stage :is(#line-tools, #placement-mode, #map-context) {
  visibility: hidden !important;
}

/* Let enlarged type use the available width on short landscape phones. */
@media (orientation:landscape) and (max-height:540px) and (max-width:1000px) {
 body.hq-battle dialog#map-settings-dialog[data-wz-tool-filter] {
  width:min(max(322px,20rem),calc(100vw - 16px))!important;
 }
}
/* Keep the narrow filter header in one row only when its text fits. */
@media (max-width:360px) {
 body.hq-battle dialog#map-settings-dialog {container:wz-filter-panel / inline-size}
 @container wz-filter-panel (min-width:16rem) {
  body.hq-battle dialog#map-settings-dialog .dialog-header {grid-template-columns:minmax(0,1fr) auto auto!important}
  body.hq-battle dialog#map-settings-dialog .dialog-header>.tw-lang-toggle {grid-area:1 / 2;justify-self:end}
  body.hq-battle dialog#map-settings-dialog .dialog-header>button[data-close] {grid-area:1 / 3!important}
 }
}

/* Use viewport coordinates so the same feedback clears the page and full-screen tools. */
body.hq-battle #toast[data-wz-map-feedback]:not([hidden]) {
 position:fixed;z-index:12010;inset:auto;left:var(--wz-feedback-x,6px);top:var(--wz-feedback-y,6px);
 transform:none;box-sizing:border-box;width:max-content;max-width:var(--wz-feedback-width,calc(100vw - 12px));
 display:flex;align-items:center;gap:6px;padding:5px 9px;border-radius:8px;
 font-size:.75rem;line-height:1.3;overflow-wrap:anywhere;pointer-events:none;
}
body.hq-battle #toast[data-wz-map-feedback]:has(button) {padding:0 2px 0 8px!important}
body.hq-battle #toast[data-wz-map-feedback] button {min-width:44px;min-height:44px;pointer-events:auto}

/* Keep drawing history clear of the open Style and More panels. */
body[data-zone-preview] .map-panel[data-zone-floating][data-wz-draw-view] .map-stage .history-controls {
 top:6px;right:8px;bottom:auto;left:auto;margin:0;
}
body[data-zone-preview] .map-panel[data-zone-floating]:has(#drawing-tools:not([hidden])) .history-controls :is(#undo,#redo) {
 min-width:44px;
}
@media (orientation:landscape) and (max-height:420px) {
 body[data-zone-preview] .map-panel[data-zone-floating]:has(#drawing-tools:not([hidden])) {
  --wz-history-space:102px;
 }
 body[data-zone-preview] .map-panel[data-zone-floating]:has(#drawing-tools:not([hidden])):is([data-wz-draw-view],:not([data-zone-tools-open])) .map-stage .history-controls {
  left:auto;top:auto;right:calc(58px + env(safe-area-inset-right));bottom:8px;margin:0;padding:2px;
 }
 body[data-zone-preview] .map-panel[data-zone-floating]:has(#drawing-tools:not([hidden])) .history-controls :is(#undo,#redo) {
  width:44px;height:44px;min-width:44px;padding:0;justify-content:center;
 }
 body[data-zone-preview] .map-panel[data-zone-floating]:has(#drawing-tools:not([hidden])) .history-controls #undo span {display:none}
 body[data-zone-preview] .map-panel[data-zone-floating]:has(#drawing-tools:not([hidden])) #wz-quick-tools {
  max-width:calc(100% - 66px - var(--wz-history-space));
 }
 body[data-zone-preview] .map-panel[data-zone-floating]:not([data-zone-tools-open]) #wz-draw-palette:not([hidden]) {
  grid-template-columns:max-content max-content;align-items:stretch;overflow-x:auto;
  touch-action:pan-x;overscroll-behavior-x:contain;
 }
 body[data-zone-preview] .map-panel[data-zone-floating] #wz-draw-palette .wz-draw-actions {
  grid-template-columns:repeat(3,max-content);border-block-start:0;border-inline-start:1px solid #415b62;
  padding-block-start:0;padding-inline-start:2px;
 }
}

/* Keep the marker's two everyday fields in view. */
body[data-zone-preview] #editor-dialog:has(.wz-marker-form) { height: fit-content !important; min-height: 0; max-inline-size: min(30rem, calc(100vw - 16px)); }
body[data-zone-preview] #editor-dialog .wz-marker-form { display: grid; gap: 10px; }
body[data-zone-preview] #editor-dialog .wz-marker-form .editor-grid { margin: 0; gap: 6px 10px; }
body[data-zone-preview] #editor-dialog .wz-marker-main { grid-template-columns: minmax(0, 1fr); }
body[data-zone-preview] #editor-dialog .wz-marker-main label { margin: 0; }
body[data-zone-preview] #editor-dialog .wz-marker-main textarea { min-block-size: 3.5rem; block-size: 3.5rem; resize: vertical; }
body[data-zone-preview] #editor-dialog .wz-marker-xy { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body[data-zone-preview] #editor-dialog .wz-marker-xy :is(.wz-coordinate-help, .wz-coordinate-feedback) { grid-column: 1 / -1; margin: 0; }
body[data-zone-preview] #editor-dialog .wz-marker-xy .wz-coordinate-feedback:has(button[hidden]):has(p:empty) { display: none; }
body[data-zone-preview] #editor-dialog .wz-marker-options { border-block: 1px solid #ffffff24; }
body[data-zone-preview] #editor-dialog .wz-marker-options summary { align-content: center; min-block-size: 44px; padding: 4px 2px; font-size: .8125rem; line-height: 1.35; font-weight: 600; cursor: pointer; overflow-wrap: anywhere; }
body[data-zone-preview] #editor-dialog .wz-marker-options[open] .editor-grid { margin-block-end: 10px; }
body[data-zone-preview] #editor-dialog .wz-marker-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; }
body[data-zone-preview] #editor-dialog .wz-marker-actions button { min-block-size: 44px; max-inline-size: 100%; padding: 5px 10px; font-size: .8125rem; line-height: 1.25; overflow-wrap: anywhere; }

/* Keep names readable in the library, including the end of similarly named plans. */
body.hq-battle[data-zone-preview] #plan-dialog .plan-library-search {
 display:flex; align-items:center; gap:3px; min-width:0;
}
body.hq-battle[data-zone-preview] #plan-dialog .plan-library-search[hidden],
body.hq-battle[data-zone-preview] #plan-dialog .plan-library-search button[hidden] {display:none!important}
body.hq-battle[data-zone-preview] #plan-dialog .plan-library-search input {
 flex:1; min-width:0; width:100%; min-height:44px; box-sizing:border-box;
 border:1px solid var(--zp-border); border-radius:6px; padding:3px 7px; font:inherit; font-size:.8125rem;
}
body.hq-battle[data-zone-preview] #plan-dialog .plan-library-search button {
 flex:none; min-width:44px; min-height:44px; line-height:1;
}
body.hq-battle[data-zone-preview] #plan-dialog #plan-library .plan-library-count {
 position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%);
 white-space:nowrap; padding:0; margin:0; border:0;
}
body.hq-battle[data-zone-preview] #plan-dialog #plan-library .plan-library-search {grid-column:1/-1}
body.hq-battle[data-zone-preview] #plan-dialog #plan-library .plan-library-tabs {
 grid-column:1/-1; grid-template-columns:repeat(3,minmax(0,1fr));
}
body.hq-battle[data-zone-preview] #plan-dialog #plan-library .plan-library-status:not(.plan-library-count) {
 grid-column:1/-1; padding-inline-start:0;
}
@media (max-width:700px) {
 body.hq-battle[data-zone-preview] #plan-dialog .dialog-header {
  position:sticky; top:-5px; z-index:2; background:var(--zp-panel,#172934);
 }
}
@container plan-library (max-width:17rem) {
 body.hq-battle[data-zone-preview] #plan-dialog .saved-plan-row {
  grid-template-columns:minmax(0,1fr) auto; column-gap:6px; row-gap:2px;
 }
 body.hq-battle[data-zone-preview] #plan-dialog .saved-plan-copy {display:contents}
 body.hq-battle[data-zone-preview] #plan-dialog .saved-plan-zone {grid-area:1/1; justify-self:start}
 body.hq-battle[data-zone-preview] #plan-dialog .saved-plan-state {grid-area:1/2; justify-self:end}
 body.hq-battle[data-zone-preview] #plan-dialog .saved-plan-copy strong {grid-area:2/1/3/-1}
 body.hq-battle[data-zone-preview] #plan-dialog .saved-plan-copy small {grid-area:3/1/4/-1}
}

@media (max-width:700px) and (min-height:480px) {
 body.hq-battle[data-zone-preview] #plan-dialog[open] {max-height:88dvh!important}
}

body.hq-battle[data-zone-preview] #share-download-warning{flex:1 1 10rem;min-width:0;margin:0;line-height:1.35;font-size:.83rem;color:var(--text,#273944);overflow-wrap:anywhere}
body.hq-battle[data-zone-preview] #briefing-dialog>.wz-export-top{flex-wrap:wrap}
body.hq-battle[data-zone-preview] #briefing-dialog .share-plan-key{margin-top:.3rem}

body.hq-battle #route-switcher .quick-route-fields select {width:100%;min-width:0;min-height:44px;font:inherit}
body.hq-battle #route-checks-button,body.hq-battle .commander-empty-slots {white-space:normal;overflow-wrap:anywhere}
body.hq-battle .audit-source summary,body.hq-battle .commander-slot-details summary {min-height:44px;align-content:center;cursor:pointer}
body.hq-battle .audit-source .audit-step {overflow-wrap:anywhere}
body.hq-battle #objective-confirm {margin-top:.5rem}

/* Keep both map axes side by side; long region names and instructions wrap. */
body.hq-battle #coordinates-dialog :is(.coord-text,#coord-zone){grid-column:1/-1}
body.hq-battle #coordinates-dialog :is(.coord-text,.coord-end)[hidden]{display:none}
body.hq-battle #coordinates-dialog #coord-zone{white-space:pre-line;overflow-wrap:anywhere;font-size:.85rem;margin:0}
body.hq-battle #coordinates-dialog #coord-zone:empty{display:none}
body.hq-battle #coordinates-dialog #coordinate-form :is(select,input){min-width:0;max-width:100%;box-sizing:border-box}
body.hq-battle #coordinates-dialog #coordinate-form button{min-height:44px;white-space:normal}

.map-stage #map-context .wz-assignment { display: grid; gap: 3px; min-width: 0; padding-block: 2px 4px; }
.map-stage #map-context:has(.wz-assignment) :is(.card-type,.card-full-name) { display: none; }
.map-stage #map-context:has(.wz-assignment) .card-type + .placement-name { display: block; overflow-wrap: anywhere; }
.map-stage #map-context .wz-assignment p { margin: 0; overflow-wrap: anywhere; font-size: .8125rem; line-height: 1.35; }
.map-stage #map-context .wz-assignment-team span { opacity: .82; font-weight: 500; }
.map-stage #map-context .wz-assignment-team { font-weight: 650; }
.map-stage #map-context .wz-assignment-note { white-space: pre-wrap; }
#plan-clock-form:not([data-draft]) :is([data-clock-use],[data-clock-help]),
#plan-clock-form[data-draft] :is([data-clock-save],[data-clock-original-help]) { display: none !important; }
body.hq-battle[data-zone-preview] #wz-read-steps { text-decoration: underline; text-underline-offset: .2em; }
