/* A quiet, optional field guide: the battlefield remains the main workspace. */
.operations-guide{position:absolute;z-index:5;top:var(--operations-guide-top,62px);left:14px;width:min(326px,calc(100% - 28px));border:1px solid #424a3d;border-left:2px solid var(--amber,#d5aa42);background:rgba(10,15,11,.94);color:#e3dfd0;box-shadow:0 8px 22px #0004;font:500 12px/1.45 "Avenir Next",system-ui,sans-serif;letter-spacing:0;pointer-events:auto}
.operations-guide[hidden]{display:none!important}
.operations-guide>summary{display:grid;grid-template-columns:auto minmax(0,1fr) 16px;align-items:center;gap:10px;min-height:44px;padding:8px 11px;cursor:pointer;list-style:none}
.operations-guide>summary::-webkit-details-marker{display:none}
.operations-kicker{color:#b3a37f;font:800 8px/1.2 ui-monospace,monospace;letter-spacing:.1em}
.operations-summary{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700;font-size:11px}
.operations-disclosure{font-size:18px;color:#d7b369;text-align:center;transition:transform .15s}
.operations-guide[open] .operations-disclosure{transform:rotate(45deg)}
.operations-guide>summary:hover{background:#20291b}
.operations-guide>summary:focus-visible,.operations-goal:focus-visible{outline:2px solid #e5c368;outline-offset:2px}
.operations-guide-body{max-height:min(380px,var(--operations-guide-space,50dvh));overflow-y:auto;overscroll-behavior:contain;padding:0 13px 13px;scrollbar-width:thin;scrollbar-color:#647157 #151b13}
.operations-guide-body p{margin:8px 0;color:#b8beae;font:500 11px/1.5 "Avenir Next",system-ui,sans-serif}
.operations-guide-body .operations-next-description{color:#eee8d5;margin-top:4px}
.operations-guide-body .operations-victory{padding:10px 0;border-top:1px solid #354030;border-bottom:1px solid #354030;color:#d2d7c7}
.operations-guide-body h3{margin:15px 0 5px;color:#cfbb8d;font:800 9px/1.3 ui-monospace,monospace;letter-spacing:.08em;text-transform:uppercase}
.operations-guide-body .operations-hint{margin-top:0;color:#9da793}
.operations-touch-controls{display:none}
.operations-goals{display:grid;gap:1px;margin-top:9px}
.operations-goal{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:44px;padding:9px 8px;border:0;border-bottom:1px solid #303b29;border-radius:0;background:transparent;color:#dce1d0;text-align:left;font:600 11px/1.35 "Avenir Next",system-ui,sans-serif;cursor:pointer}
.operations-goal small{flex:none;font:700 9px/1 ui-monospace,monospace;color:#a7b397}
.operations-goal:hover{background:#222d1d}
.operations-goal[aria-pressed="true"]{background:#30341f;box-shadow:inset 2px 0 #d7b369;color:#fff0c9}
.operations-guide-body .operations-reward{padding-top:10px;color:#c9c3a1}

/* Clamp the short summary itself. Clamping its mixed block parent made the
   hidden description and stats paint over neighbouring phone controls. */
.command-rail:not(.expanded) .build-command>em{display:block!important;-webkit-line-clamp:unset;-webkit-box-orient:initial;min-height:0;max-height:none;height:auto;overflow:visible}
.command-rail:not(.expanded) .build-command>em>.detail-copy,
.command-rail:not(.expanded) .build-command>em>b{display:none}
.command-rail:not(.expanded) .build-command>em>strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;max-height:none;margin-bottom:0}
.command-rail.expanded .build-command>em{display:block!important;-webkit-line-clamp:unset;-webkit-box-orient:initial;max-height:none;height:auto;overflow:visible}
.command-rail.expanded .build-command>em>strong,
.command-rail.expanded .build-command>em>.detail-copy,
.command-rail.expanded .build-command>em>b{display:block;-webkit-line-clamp:unset;max-height:none;overflow:visible}
.command-rail.expanded .rail-section{overflow-y:auto;overscroll-behavior:contain}
.technology-command>.technology-next-goal{grid-column:1/-1;grid-row:auto;display:block;margin:8px 0 0;color:#dbd3b8;font:600 10px/1.4 "Avenir Next",system-ui,sans-serif}
.command-rail:not(.expanded) .technology-next-goal{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.command-rail:not(.expanded) .technology-tradeoff{display:none}
.command-rail.expanded .technology-next-goal{-webkit-line-clamp:unset;overflow:visible}

@media(max-width:820px){
  .selection-readout{top:calc(56px + var(--app-safe-top,0px));bottom:auto}
  .operations-guide{top:var(--operations-guide-top,calc(90px + var(--app-safe-top,0px)));left:max(7px,env(safe-area-inset-left));width:min(310px,calc(100% - 14px));font-size:11px}
  .operations-guide>summary{min-height:42px;padding:8px 10px;gap:8px}
  .operations-kicker{font-size:7px}
  .operations-summary{font-size:10px}
  .operations-desktop-controls{display:none}
  .operations-guide-body .operations-touch-controls{display:block}
  .battlefield>.notice{top:auto;bottom:var(--operations-notice-bottom,calc(min(264px,40dvh) + 12px));left:50%;width:max-content;max-width:calc(100% - 28px);font-size:9px;line-height:1.45;letter-spacing:.04em;text-align:center;white-space:normal;translate:-50% 5px}
  .battlefield>.notice.visible{translate:-50% 0}
  .command-rail:not(.expanded) .build-command>em{align-self:start;margin-top:5px}
  .command-rail:not(.expanded) .build-command>em>strong{font-size:9px;line-height:1.35}
  .command-rail:not(.expanded) .technology-command>em{display:none!important}
  .command-rail.expanded .build-list{align-items:flex-start}
  .command-rail.expanded .build-command{height:auto;max-height:none;overflow:visible;flex-shrink:0}
  .command-rail.expanded .rail-section{overflow-x:auto;overflow-y:auto}
  .technology-command>.technology-next-goal{grid-column:1/-1;grid-row:6;margin-top:8px;font-size:10px;line-height:1.4}
  .command-rail.expanded .technology-tradeoff{display:grid!important}
}
@media(prefers-reduced-motion:reduce){.operations-disclosure{transition:none}}

/* Command terminal: one vertical catalogue on every screen. The same controls
   keep their place across categories; only the catalogue scrolls. */
.command-rail:not(.is-collapsed){display:flex;flex-direction:column;width:390px;max-width:calc(100vw - 28px);overflow:hidden;background:#111710f5;border:1px solid #53604a;box-shadow:0 14px 40px #0007}
.command-rail.expanded:not(.is-collapsed){width:480px}
.command-rail .rail-heading{flex:0 0 52px;min-height:52px;gap:6px;padding:4px 10px}
.command-rail .rail-heading>span{font-size:11px;letter-spacing:.14em}
.command-rail .rail-heading>small{display:none}
.command-rail .rail-collapse,.command-rail .rail-expand{min-height:44px;height:44px;min-width:64px;width:auto;padding:0 10px;font-size:10px}
.command-rail .rail-tabs{flex:0 0 52px;min-height:52px;height:52px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));padding:0;gap:0}
.command-rail .rail-tabs button{min-height:52px;height:auto;min-width:0;padding:6px 2px;border-radius:0}
.command-rail .rail-tabs button>b{font-size:12px;letter-spacing:.08em}
.command-rail .rail-tabs button>small{font-size:8px}
.command-rail .rail-tabs button[aria-pressed="true"]{background:#303724;color:#f4d37f;box-shadow:inset 0 -3px #d3b362}
.command-rail .production-overview{flex:0 0 auto;display:grid;gap:4px;padding:10px 12px;border-bottom:1px solid #35412e;background:#192016;font-size:10px;line-height:1.4}
.production-overview>strong{color:#aeb69d;font:700 9px/1.3 ui-monospace,monospace;letter-spacing:.06em}
.production-overview>strong>span{color:#f4d37f;padding-left:5px}
.production-overview>span{color:#d2d5c8;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.command-rail .rail-section{display:none;flex:1 1 auto;min-height:0;overflow:auto!important;padding:0 10px 12px;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#58654d #111710}
.command-rail[data-mobile-section="armoury"] .rail-section.armoury,.command-rail[data-mobile-section="structures"] .rail-section.structures,.command-rail[data-mobile-section="research"] .rail-section.research{display:block}
.command-rail .rail-section>h2{margin:12px 0 5px;padding:0;font:700 13px/1.4 "Avenir Next",system-ui,sans-serif;color:#e4e5d6}
.menu-filters{display:flex;flex-wrap:wrap;gap:4px;padding:0 0 7px}
.menu-filters button{min-height:44px;padding:7px 9px;border:1px solid #384331;background:#151d12;color:#b8c1a9;font:600 11px/1.2 "Avenir Next",system-ui,sans-serif;cursor:pointer}
.menu-filters button[aria-pressed="true"]{border-color:#8c9867;background:#2c3722;color:#f0edda}
.command-rail .build-list{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px;padding:0!important;overflow:visible!important;align-items:start}
.command-rail .command-guide{display:block;min-height:0;width:auto;max-width:none;padding:4px 1px 7px;border:0;background:none;font-size:11px;line-height:1.4}
.command-guide>strong{display:none}
.command-rail .command-guide>span{font-size:11px;line-height:1.45;color:#aeb7a0}
.command-entry{min-width:0;overflow:hidden;border:1px solid #3b4732;background:#1a2316}
.command-entry[hidden]{display:none!important}
.command-rail .command-entry>.build-command{display:grid!important;grid-template-columns:84px minmax(0,1fr);grid-template-rows:auto auto auto auto;column-gap:11px;row-gap:3px;width:100%;min-width:0;min-height:112px;height:auto!important;max-height:none;padding:10px;border:0;border-radius:0;background:transparent;overflow:visible;text-align:left;align-content:start}
.command-rail .command-entry>.build-command>img{grid-column:1;grid-row:1/5;width:84px;height:84px;min-height:0;max-height:none;margin:0;object-fit:cover;border:1px solid #44513b;border-radius:2px}
.command-rail .command-entry .command-purpose{grid-column:2;grid-row:1;font:700 13px/1.2 "Avenir Next",system-ui,sans-serif;letter-spacing:0;color:#f1f1df;white-space:normal;overflow:visible}
.command-rail .command-entry .command-callsign{grid-column:2;grid-row:2;font:600 10px/1.3 "Avenir Next",system-ui,sans-serif;color:#b4bea7;white-space:normal}
.command-rail .command-entry .build-command>small{grid-column:2;grid-row:3;font:600 10px/1.4 ui-monospace,monospace;color:#d3cda9;white-space:normal}
.command-rail .command-entry .command-status{grid-column:2;grid-row:4;padding:3px 0 0;margin:0;border:0;background:none;white-space:normal;font:700 10px/1.4 "Avenir Next",system-ui,sans-serif;color:#c9d5ab}
.command-rail .command-entry .is-locked{opacity:1;filter:none}
.command-rail .command-entry .is-locked>img{opacity:.7}
.command-rail .command-entry .is-locked .command-status{color:#d5ba82}
.command-rail .command-entry .build-command>em{grid-column:1/-1;grid-row:auto;margin:5px 0 0;padding:0;font:500 11px/1.45 "Avenir Next",system-ui,sans-serif;color:#afb8a0}
.command-rail .command-entry .build-command>em>strong{font:500 11px/1.45 "Avenir Next",system-ui,sans-serif}
.command-rail .command-entry .technology-stage{display:none}
.command-rail .command-entry .technology-next-goal{grid-row:auto;grid-column:1/-1;margin:4px 0 0;font-size:11px}
.command-rail:not(.expanded) .command-entry .technology-route{display:none!important}
.command-rail.expanded .command-entry .technology-route{display:grid;grid-column:1/-1;grid-row:auto;margin:6px 0 0;font-size:11px;line-height:1.4}
.command-requirement{display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%;min-height:44px;padding:9px 12px;border:0;border-top:1px solid #424b34;background:#242c1d;color:#e0c68d;text-align:left;font:700 10px/1.3 "Avenir Next",system-ui,sans-serif;letter-spacing:.06em;cursor:pointer}
.command-requirement:hover{background:#354028}
.research-guide{padding:0 2px 7px;color:#b7bfa8;font:500 11px/1.45 "Avenir Next",system-ui,sans-serif}
.research-guide>summary{min-height:44px;align-content:center;cursor:pointer;color:#d6c08e}
.research-guide>p{margin:6px 0}
.command-rail button:focus-visible,.command-rail summary:focus-visible{outline:2px solid #f3cd6e!important;outline-offset:-3px}
.command-rail>footer{flex:0 0 auto;padding:9px 12px;font-size:8px}
.command-rail.is-collapsed .production-overview{display:none}
@media(min-width:821px){.command-rail.is-collapsed{height:52px!important;min-height:52px}.command-rail.is-collapsed .rail-collapse{height:50px!important;min-height:50px}}
@media(max-width:820px){
 .operations-guide>summary{min-height:44px}
 .command-rail:not(.is-collapsed),.command-rail.expanded:not(.is-collapsed){left:0;right:0;bottom:0;width:100%;max-width:none;height:min(360px,42dvh);max-height:calc(100dvh - 140px);padding:0 0 env(safe-area-inset-bottom);border-left:0;border-right:0}
 .command-rail.expanded:not(.is-collapsed){height:min(520px,60dvh)}
 .command-rail .rail-heading{flex-basis:48px;min-height:48px;padding:2px 10px}
 .command-rail .rail-section{padding:0 10px 10px}
 .command-rail .production-overview{padding:7px 11px}
 .command-rail .production-overview>span{-webkit-line-clamp:1}
 .command-rail .menu-filters{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;gap:4px;padding-bottom:7px}
 .command-rail .menu-filters button{flex:none;font-size:10px;padding:7px 9px}
 .command-rail .command-entry>.build-command{grid-template-columns:80px minmax(0,1fr);min-height:108px;padding:9px}
 .command-rail .command-entry>.build-command>img{width:80px;height:80px}
 .command-rail .command-entry .command-purpose{font-size:13px}
 .command-rail:not(.expanded) .command-entry .build-command>em{display:none!important}
 .command-rail>footer{display:none}
 .command-rail.is-collapsed{height:52px!important;min-height:52px!important}
 .command-rail.is-collapsed .rail-tabs{height:52px!important;min-height:52px!important}
}
@media(max-height:540px) and (orientation:landscape){
 .command-rail:not(.is-collapsed),.command-rail.expanded:not(.is-collapsed){left:auto;right:0;top:54px;bottom:0;width:min(370px,48vw);height:auto;max-height:none;border-left:1px solid #53604a}
 .command-rail .rail-heading{flex-basis:44px;min-height:44px}
 .command-rail .production-overview{padding:5px 10px}
 .command-rail .production-overview>span{display:none}
 .command-rail .rail-section>h2{font-size:11px;margin:7px 0 3px}
 .command-rail .command-entry>.build-command{grid-template-columns:60px minmax(0,1fr);min-height:90px;gap:3px 8px}
 .command-rail .command-entry>.build-command>img{width:60px;height:60px}
 .command-rail.is-collapsed{left:auto;right:0;width:min(370px,48vw)}
 .command-rail .command-guide{display:none}
}
/* Retire the legacy horizontal tray sizing, including its attribute selector. */
.command-rail[data-mobile-section] .build-list{width:100%;min-width:0;max-width:100%;background:transparent}
.command-rail[data-mobile-section] .rail-section{padding:0 10px 12px!important;scroll-snap-type:none}
.command-rail[data-mobile-section] .rail-section>h2{display:block}
.command-rail[data-mobile-section] .command-entry>.build-command>img{height:84px;width:84px}
@media(max-width:820px){
 .command-rail[data-mobile-section]:not(.is-collapsed){height:min(360px,42dvh)}
 .command-rail.expanded[data-mobile-section]:not(.is-collapsed){height:min(520px,60dvh)}
 .command-rail[data-mobile-section] .command-entry>.build-command>img{width:80px;height:80px}
}
@media(max-height:540px) and (orientation:landscape){
 .command-rail[data-mobile-section]:not(.is-collapsed),.command-rail.expanded[data-mobile-section]:not(.is-collapsed){height:auto}
 .command-rail[data-mobile-section] .command-entry>.build-command>img{width:60px;height:60px}
}
.command-rail[data-mobile-section] .command-entry .technology-next-goal{text-transform:none;letter-spacing:0}
.command-rail[data-mobile-section] .command-entry .technology-route>span{font:500 11px/1.45 "Avenir Next",system-ui,sans-serif;text-transform:none;letter-spacing:0}
.command-rail[data-mobile-section] .command-entry .technology-route>b{font:700 9px/1.4 ui-monospace,monospace;letter-spacing:.03em}
@media(min-width:821px) and (min-height:541px){
 .operations-shell:has(.command-rail:not(.is-collapsed):not(.expanded)) .field-strip{padding-right:408px}
 .operations-shell:has(.command-rail.expanded:not(.is-collapsed)) .field-strip{padding-right:498px}
 .operations-shell:has(.command-rail:not(.is-collapsed):not(.expanded)) .tactical-minimap{right:406px}
 .operations-shell:has(.command-rail.expanded:not(.is-collapsed)) .tactical-minimap{right:496px}
}
.production-overview.is-empty{display:flex;align-items:center;justify-content:space-between;gap:10px}
.production-overview.is-empty>strong>span{display:none}
.command-rail .command-entry .detail-copy{text-transform:none;letter-spacing:0;font:500 11px/1.45 "Avenir Next",system-ui,sans-serif}
@media(min-width:821px) and (min-height:541px){
 .battlefield>.notice{top:auto;bottom:22px;max-width:420px;white-space:normal;line-height:1.4;text-align:center}
 .operations-shell:has(.command-rail:not(.is-collapsed)) .battlefield>.notice{left:calc((100% - 390px)/2);max-width:min(420px,calc(100% - 430px))}
 .operations-shell:has(.command-rail.expanded:not(.is-collapsed)) .battlefield>.notice{left:calc((100% - 480px)/2);max-width:min(420px,calc(100% - 520px))}
}
@media(pointer:coarse) and (min-width:821px){.selection-readout{left:82px;bottom:20px}}
@media(max-height:540px) and (orientation:landscape){
 .battlefield>.notice{top:auto;bottom:150px;left:calc((100% - min(370px,48vw))/2);width:max-content;max-width:calc(100% - min(370px,48vw) - 32px);white-space:normal;font-size:9px;line-height:1.4;text-align:center}
 .command-rail:not(.expanded) .command-entry .build-command>em{display:none!important}
}
.command-rail[data-mobile-section] .command-entry .technology-stage{display:none!important}

/* First-match catalogues keep the battlefield visible; details are deliberate. */
.command-return[hidden],.selection-actions[hidden]{display:none!important}
.command-return{flex:none;padding:0 10px;border-bottom:1px solid #494b3b}
.command-return button{width:100%;min-height:44px;border:0;background:transparent;color:var(--amber-hi);text-align:left;font:700 12px/1.3 system-ui}
.command-rail .command-entry .technology-consequence{display:block;grid-column:1/-1;grid-row:auto;color:#f5cc7c;font:700 11px/1.4 system-ui;margin:5px 0 0;text-transform:none;letter-spacing:0}
.command-rail:not(.expanded) .command-entry .build-command{grid-template-columns:64px minmax(0,1fr);min-height:92px;padding:8px;column-gap:9px}
.command-rail:not(.expanded)[data-mobile-section] .command-entry .build-command>img{width:64px;height:64px;max-height:64px}
.command-rail:not(.expanded) .command-entry .build-command>em{display:none!important}
.selection-actions{position:absolute;z-index:8;left:12px;bottom:72px;display:flex;gap:6px}
.selection-actions button{min-height:44px;padding:8px 12px;border:1px solid #77715b;background:rgba(11,14,11,.94);color:var(--amber-hi);font:700 12px/1.2 system-ui;touch-action:manipulation}
.selection-actions button:disabled{opacity:.5}
@media(max-width:820px){
 .command-rail .production-overview.is-empty{display:none}
 .command-rail .command-guide{display:none}
 .command-rail .rail-section h2{margin:7px 0;font-size:12px}
 .touch-select-control{width:84px;height:48px;letter-spacing:0;font-size:10px;bottom:calc(60px + env(safe-area-inset-bottom))}
 .touch-select-icon{width:19px;height:14px}
 .selection-actions{left:12px;bottom:calc(114px + env(safe-area-inset-bottom));gap:5px}
 .selection-actions button{padding:8px 10px}
 .operations-shell:has(.command-rail:not(.is-collapsed)) .selection-actions{bottom:calc(min(360px,42dvh) + 8px)}
 .operations-shell:has(.command-rail.expanded:not(.is-collapsed)) .selection-actions{bottom:calc(min(520px,60dvh) + 8px)}
}
