/* Command styling comes after mobile.css. Shared controls stay legible in every tab. */
#command-console{--cr-ink:#f0eee6;--cr-muted:#adb3b8;--cr-line:#424447;--cr-amber:#f2b478;--cr-blue:#9fc9db;--cr-panel:#202226;color:var(--cr-ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
#command-console .command-dialog{width:min(1180px,96vw);padding:26px;background:#191b1f;border:1px solid #55524b;box-shadow:0 24px 90px #0009;gap:0}
#command-console .command-header{align-items:flex-start;gap:20px;flex-shrink:0}
#command-console .command-header>div{min-width:0}
#command-console .command-header .eyebrow{font-family:inherit;font-size:11px;font-weight:600;line-height:1.4;letter-spacing:.1em;color:var(--cr-amber);text-transform:uppercase}
#command-console .command-header h2{margin:6px 0 7px;font-family:inherit;font-size:30px;font-weight:650;line-height:1.15;letter-spacing:-.035em;color:var(--cr-ink)}
#command-console .command-header p{margin:0;font-family:inherit;font-size:12px;font-weight:400;line-height:1.55;letter-spacing:0;color:var(--cr-muted)}
#command-console #close-command{display:grid;place-items:center;flex:0 0 40px;width:40px;height:40px;min-height:40px;padding:0;border:1px solid #52545a;background:#24262b;color:var(--cr-ink);font-family:inherit;font-size:26px;font-weight:400;line-height:1}
#command-console #command-resources{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) minmax(110px,.9fr);gap:0;margin:19px 0 16px;border:1px solid var(--cr-line);background:#222429;flex-shrink:0}
#command-console #command-resources>div{display:flex;align-items:center;min-width:0;padding:12px 16px;gap:10px;border:0;border-right:1px solid var(--cr-line)}
#command-console #command-resources>div:last-child{border:0}
#command-console #command-resources>div>div{display:flex;flex-direction:column;gap:3px}
#command-console #command-resources small{display:block;font-family:inherit;font-size:11px;font-weight:500;line-height:1.3;letter-spacing:.01em;color:var(--cr-muted)}
#command-console #command-resources b{font-family:inherit;font-size:22px;font-weight:600;line-height:1;letter-spacing:-.02em;font-variant-numeric:tabular-nums;color:var(--cr-ink)}
#command-console #command-resources em{margin-left:auto;font-family:inherit;font-size:11px;font-style:normal;font-weight:400;line-height:1.4;letter-spacing:0;color:var(--cr-muted)}
#command-console #command-resources em[hidden]{display:none}
#command-console .resource-glyph{display:grid;place-items:center;width:28px;height:28px;flex:0 0 28px;border:1px solid #777064;color:var(--cr-amber);font-family:inherit;font-size:13px;line-height:1;border-radius:50%}
#command-console #command-resources .command-tier{align-items:flex-start;justify-content:center;flex-direction:column;gap:5px}
#command-console #command-resources .command-tier strong{font-family:inherit;font-size:20px;font-weight:600;line-height:1;letter-spacing:-.02em;color:var(--cr-blue)}
#command-console .command-tabs{gap:22px;border-bottom:1px solid var(--cr-line);margin:0 0 16px;flex-shrink:0}
#command-console .command-tabs button{border:0;border-bottom:2px solid transparent;background:transparent;color:var(--cr-muted);font-family:inherit;font-size:13px;font-weight:550;line-height:1.3;letter-spacing:0;padding:4px 2px 12px;min-height:35px;text-transform:none}
#command-console .command-tabs button.active{color:var(--cr-ink);border-bottom-color:var(--cr-amber)}
#command-console .command-tabs button:hover{color:var(--cr-ink);background:#ffffff05}
#command-console :is(button,[tabindex]):focus-visible{outline:2px solid var(--cr-blue);outline-offset:3px}
#command-console #command-content{scrollbar-color:#62605a #191b1f;scrollbar-width:thin;padding:0 7px 2px 0;overscroll-behavior:contain;flex:1 1 auto}
#command-console #command-notice{order:0;position:static;z-index:auto;min-height:0;flex:0 0 auto;margin:12px 0 0;padding:10px 12px;border:1px solid #555047;border-left:3px solid var(--cr-amber);background:#252528;color:var(--cr-ink);font-family:inherit;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:0;box-shadow:none}
#command-console #command-notice[hidden]{display:none!important}
#command-console #command-notice[data-state="pending"],#command-console #command-notice[data-state="accepted"]{border-left-color:var(--cr-blue)}
#command-console .command-footer{margin-top:14px;padding-top:12px;border-top:1px solid var(--cr-line);gap:18px;color:var(--cr-muted);font-family:inherit;font-size:11px;font-weight:400;line-height:1.4;letter-spacing:0}
.command-research{display:flex;flex-direction:column;gap:18px;padding:1px 0 4px;color:var(--cr-ink);font-size:13px;line-height:1.5}
.command-research [hidden]{display:none!important}
.cr-route{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));padding:0;margin:0;list-style:none;border:1px solid var(--cr-line);background:#1e2024}
.cr-route li{display:flex;align-items:center;position:relative;gap:12px;padding:12px 16px;min-width:0;color:var(--cr-muted)}
.cr-route li+li{border-left:1px solid var(--cr-line)}
.cr-route .cr-tier-number{display:grid;place-items:center;width:34px;height:34px;flex:0 0 34px;border:1px solid #55585d;font-size:16px;font-weight:550;line-height:1;color:#b0b4b8}
.cr-route strong{display:block;font-size:13px;font-weight:550;line-height:1.35;letter-spacing:0;color:inherit}
.cr-route span{display:block;font-size:11px;line-height:1.4;margin-top:2px;color:var(--cr-muted)}
.cr-route [data-state="current"]{color:var(--cr-ink);background:#34302a;box-shadow:inset 0 -2px var(--cr-amber)}
.cr-route [data-state="current"] .cr-tier-number{color:var(--cr-amber);border-color:#b98459}
.cr-route [data-state="complete"] .cr-tier-number{color:var(--cr-blue);border-color:#7094a3}
.cr-project{display:grid;grid-template-columns:36px minmax(0,1fr) auto;align-items:center;gap:10px 12px;border:1px solid var(--cr-line);background:#22252a;padding:14px 16px}
.cr-project-symbol{display:grid;place-items:center;width:34px;height:34px;font-size:27px;line-height:1;color:var(--cr-blue)}
.cr-project h3{margin:0;font-family:inherit;font-size:14px;font-weight:600;line-height:1.4;color:var(--cr-ink)}
.cr-project p{margin:3px 0 0;font-family:inherit;font-size:12px;font-weight:400;line-height:1.5;color:var(--cr-muted)}
.cr-remaining{font-size:13px;line-height:1.4;font-weight:500;white-space:nowrap;font-variant-numeric:tabular-nums;color:var(--cr-blue)}
.cr-progress{grid-column:2/-1;height:4px;background:#42464b;overflow:hidden}
.cr-progress i{display:block;height:100%;background:var(--cr-blue);transition:width .2s linear}
.cr-project[data-state="paused"] .cr-project-symbol,.cr-project[data-state="paused"] .cr-remaining{color:var(--cr-amber)}
.cr-project[data-state="paused"] .cr-progress i{background:var(--cr-amber)}
.cr-project[data-state="idle"]{background:transparent;border-style:dashed}
.cr-section-heading{display:flex;align-items:baseline;justify-content:space-between;gap:8px 16px;margin-bottom:-8px}
.cr-section-heading h3{margin:0;font-family:inherit;font-size:16px;font-weight:600;line-height:1.4;letter-spacing:-.01em;color:var(--cr-ink)}
.cr-section-heading p{margin:0;font-family:inherit;font-size:12px;line-height:1.5;color:var(--cr-muted)}
.cr-doctrines{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.cr-upgrades{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.cr-card{display:flex;flex-direction:column;min-width:0;position:relative;padding:17px;background:#23252a;border:1px solid #4b4c50;border-top:2px solid #696660;color:var(--cr-ink)}
.cr-card-top{display:flex;align-items:center;gap:9px;margin-bottom:12px;min-height:32px}
.cr-icon{display:block;width:32px;height:32px;flex:0 0 32px;color:#d1ccc2}
.cr-icon svg{display:block;width:100%;height:100%}
.cr-kind{font-size:11px;font-weight:550;line-height:1.4;color:var(--cr-muted)}
.cr-state{margin-left:auto;padding:3px 7px;background:#313339;border:1px solid #55575b;border-radius:2px;font-size:11px;font-weight:550;line-height:1.3;white-space:nowrap;color:#c6c8cb}
.cr-card h3{margin:0 0 7px;font-family:inherit;font-size:16px;font-weight:600;line-height:1.3;letter-spacing:-.02em;color:var(--cr-ink)}
.cr-card .cr-description{margin:0 0 12px;font-family:inherit;font-size:12px;font-weight:400;line-height:1.6;letter-spacing:0;color:#c3c5c7}
.cr-requirements{display:flex;flex-direction:column;gap:4px;list-style:none;padding:0;margin:0 0 14px;font-size:11px;line-height:1.5;color:var(--cr-muted)}
.cr-requirements [data-met="false"]{color:#e4bb92}
.cr-requirements [data-met="true"]{color:#abc6cf}
.cr-card-foot{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:7px;margin-top:auto;padding-top:12px;border-top:1px solid #ffffff17}
.cr-costs{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
.cr-cost{display:inline-flex;align-items:center;gap:6px;font-size:16px;font-variant-numeric:tabular-nums;color:var(--cr-ink)}
.cr-cost i{display:grid;place-items:center;width:20px;height:20px;border:1px solid #9e896e;border-radius:50%;color:#ead4ae;font-size:10px;font-style:normal;line-height:1}
.cr-cost b{font-weight:550}
.cr-cost[data-affordable="false"]{color:var(--cr-amber)}
.cr-duration{font-size:11px;line-height:1.4;color:var(--cr-muted)}
.cr-card .cr-reason{margin:8px 0 10px;min-height:18px;font-family:inherit;font-size:11px;line-height:1.5;letter-spacing:0;color:#d4c2ac}
#command-console .cr-action{display:block;width:100%;min-height:39px;padding:10px 12px;margin:0;border:1px solid #dcac80;background:#e5b183;color:#24221f;font-family:inherit;font-size:12px;font-weight:650;line-height:1.3;letter-spacing:0;text-align:center;text-transform:none;cursor:pointer}
#command-console .cr-action:hover{background:#f4c59b}
#command-console .cr-action[aria-disabled="true"]{background:#2b2d32;border-color:#56585d;color:#c4c7cc;cursor:default;opacity:1}
.cr-card[data-state="available"]{border-color:#8d745e;border-top-color:var(--cr-amber)}
.cr-card[data-state="available"] .cr-state{background:#3b3026;border-color:#997451;color:#f2c495}
.cr-card[data-state="active"],.cr-card[data-state="complete"]{border-top-color:var(--cr-blue)}
.cr-card[data-state="active"] .cr-state,.cr-card[data-state="complete"] .cr-state{background:#283941;border-color:#60808e;color:#b5d6e4}
.cr-card[data-state="complete"] .cr-reason{color:#b5d6e4}
.cr-card[data-state="paused"]{border-top-color:var(--cr-amber)}
.cr-card[data-state="paused"] .cr-state{color:var(--cr-amber)}
.cr-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:900px),(pointer:coarse){
 #command-console .command-dialog{padding:18px!important;overflow:hidden;max-height:calc(100dvh - 22px)!important}
 #command-console .command-header h2{font-size:26px!important}
 #command-console #command-content{overflow:auto;padding-right:3px}
 #command-console #command-resources{grid-template-columns:repeat(4,minmax(0,1fr));margin:14px 0 12px;gap:0!important}
 #command-console #command-resources>div{min-width:0;gap:7px;padding:10px!important;flex-wrap:wrap}
 #command-console #command-resources .resource-glyph{display:none}
 #command-console #command-resources em{display:none}
 #command-console #command-resources b{font-size:20px}
 #command-console #command-resources .command-tier strong{font-size:18px}
 #command-console .command-tabs{gap:8px!important;flex-wrap:nowrap;margin-bottom:12px}
 #command-console .command-tabs button{font-size:12px!important;padding:8px 2px!important;min-height:42px}
 .cr-upgrades{grid-template-columns:repeat(2,minmax(0,1fr))}
 .cr-route li{padding:10px;gap:8px}
 .cr-route .cr-tier-number{width:28px;height:32px;flex-basis:28px;font-size:14px}
 .cr-route strong{font-size:12px}
 .cr-route span{font-size:10px}
 .cr-section-heading{align-items:flex-start;flex-direction:column;gap:3px}
 #command-console .cr-action{min-height:44px}
}
@media(max-width:560px){
 #command-console .command-dialog{padding:14px!important;width:100%}
 #command-console .command-header{gap:10px}
 #command-console .command-header h2{font-size:24px!important}
 #command-console .command-header .eyebrow{font-size:10px}
 #command-console .command-header p{font-size:11px}
 #command-console #command-resources{grid-template-columns:repeat(2,minmax(0,1fr));margin:12px 0 9px}
 #command-console #command-resources>div{padding:8px 10px!important;flex-wrap:nowrap}
 #command-console #command-resources>div:nth-child(2){border-right:0}
 #command-console #command-resources>div:nth-child(-n+2){border-bottom:1px solid var(--cr-line)}
 #command-console #command-resources>div>div{width:100%;flex-direction:row;align-items:center;justify-content:space-between;gap:8px}
 #command-console #command-resources small{font-size:10px}
 #command-console #command-resources b{font-size:18px}
 #command-console #command-resources .command-tier{flex-direction:row;align-items:center;justify-content:space-between;gap:8px}
 #command-console #command-resources .command-tier strong{font-size:16px;white-space:nowrap}
 #command-console .command-tabs{gap:4px!important}
 #command-console .command-tabs button{font-size:11px!important}
 .command-research{gap:15px}
 .cr-route li{padding:9px 6px;gap:6px;align-items:flex-start;flex-direction:column}
 .cr-route .cr-tier-number{width:auto;height:auto;min-height:18px;flex-basis:auto;border:0;font-size:14px}
 .cr-route strong{font-size:11px}
 .cr-route span{font-size:10px}
 .cr-project{grid-template-columns:25px minmax(0,1fr);gap:7px 10px;padding:12px}
 .cr-project-symbol{width:25px;font-size:23px}
 .cr-project h3{font-size:13px}
 .cr-project p{font-size:11px}
 .cr-remaining{grid-column:2;font-size:12px}
 .cr-progress{grid-column:2}
 .cr-doctrines,.cr-upgrades{grid-template-columns:minmax(0,1fr);gap:10px}
 .cr-card{padding:15px}
 .cr-card-top{margin-bottom:10px}
 .cr-card .cr-description{font-size:13px}
 .cr-requirements,.cr-card .cr-reason,.cr-duration{font-size:12px}
 #command-console .cr-action{font-size:13px}
 #command-console #command-notice{font-size:11px;max-height:100px;overflow:auto;padding:9px 10px}
}
/* Short landscape screens scroll the whole workspace, keeping only Close/header
   anchored. Resource and tab chrome must not consume most of the reading area. */
@media(max-height:500px) and (min-width:561px){
 #command-console .command-dialog{padding:10px 14px!important;overflow:auto!important;scroll-padding-top:52px}
 #command-console .command-header{position:sticky;top:-10px;z-index:3;align-items:center;min-height:44px;margin-top:-1px;padding:0 0 4px;background:#191b1f}
 #command-console .command-header .eyebrow,#command-console .command-header p{display:none}
 #command-console .command-header h2{font-size:22px!important;margin:0;line-height:1.2}
 #command-console #close-command{width:44px;height:44px;min-height:44px;flex-basis:44px}
 #command-console #command-resources{margin:6px 0 5px}
 #command-console #command-resources>div{padding:7px 10px!important;flex-wrap:nowrap}
 #command-console #command-resources>div>div{width:100%;flex-direction:row;align-items:center;justify-content:space-between;gap:8px}
 #command-console #command-resources small{font-size:11px}
 #command-console #command-resources b{font-size:18px}
 #command-console #command-resources .command-tier{flex-direction:row;align-items:center;justify-content:space-between}
 #command-console #command-resources .command-tier strong{font-size:17px;white-space:nowrap}
 #command-console .command-tabs{margin-bottom:8px}
 #command-console .command-tabs button{min-height:44px}
 #command-console #command-content{flex:0 0 auto;overflow:visible;padding-right:0}
 #command-console #command-notice:not([hidden]){position:sticky;bottom:-10px;z-index:4;max-height:72px;overflow:auto}
 .command-research{gap:9px}
 .cr-route li{padding:6px 10px;gap:8px}
 .cr-route .cr-tier-number{width:23px;height:25px;flex-basis:23px;font-size:13px}
 .cr-route li>div{display:flex;align-items:baseline;flex-wrap:wrap;gap:3px 8px}
 .cr-route strong{font-size:12px}
 .cr-route span{font-size:10px;margin:0}
 .cr-project{padding:9px 12px}
 .cr-project[data-state="idle"]{display:block;padding:0 1px;border:0}
 .cr-project[data-state="idle"] .cr-project-symbol,.cr-project[data-state="idle"] h3{display:none}
 .cr-project[data-state="idle"] p{margin:0;font-size:11px}
 .cr-section-heading{flex-direction:row;align-items:baseline;gap:12px;margin:0}
 .cr-section-heading h3{font-size:14px}
 .cr-section-heading p{font-size:11px}
 .cr-card{padding:13px}
 .cr-card-top{min-height:26px;margin-bottom:8px}
 .cr-icon{width:26px;height:26px;flex-basis:26px}
 #command-console .cr-action{min-height:44px}
}
@media(prefers-reduced-motion:reduce){.cr-progress i{transition:none}}
