.hq-page {
  --amber:#facc15;
  background:var(--canvas);color:var(--text);
  font-family:Consolas,"SFMono-Regular","Liberation Mono",monospace;font-size:12px;
}
.hq-page * {scrollbar-color:#303542 #08080b;scrollbar-width:thin}
.hq-page .green {color:var(--accent)}
.hq-page .red {color:var(--error)}
.hq-page .cyan {color:var(--cyan)}
.hq-page .amber {color:var(--amber)}
.hq-page .muted {font-size:10px;line-height:1.5}
.hq-page button,.hq-page input,.hq-page select {border-radius:0;min-height:28px;padding:4px 7px;font-size:11px}
.hq-page input[type=checkbox] {width:15px;height:15px;min-height:15px;margin:0;accent-color:var(--cyan)}
.hq-page button:hover {background:#11151c;color:#fff;border-color:#68768b}
.hq-page button:disabled {opacity:.4}
.hq-page .app-header {gap:16px;position:sticky;top:0;z-index:10}
.hq-page .brand {font-size:13px;letter-spacing:-.03em;display:flex;align-items:center;gap:7px}
.hq-page .brand span {font:9px Consolas,monospace;letter-spacing:0;margin:0}
.hq-page .app-header nav {gap:8px}
.hq-page .app-header nav a {font:11px Consolas,monospace;padding:5px 8px;border:1px solid transparent}
.hq-page .app-header nav a.active {border-color:#178841;background:#09180e;color:#fff;display:flex;align-items:center;gap:6px}
.hq-page .app-header nav small {color:var(--accent);border:1px solid #145a2d;font-size:8px;padding:1px 3px}
.signal-dot {height:5px;width:5px;display:inline-block;background:var(--accent)}
.header-metric {font-size:10px;border-left:1px solid var(--line);padding-left:13px;color:var(--muted)}
.header-metric strong {color:#fff;margin-left:5px}
.hq-page .account-controls {gap:6px}
.hq-page .account-controls button,.hq-page .account-controls select {font-size:10px}
.hq-page .account-controls select {color:var(--amber);max-width:170px}
.hq-page .matrix-shell {max-width:none;margin:0;padding:0;display:grid;grid-template-columns:310px minmax(0,1fr);align-items:start}
.planning-sidebar {padding:12px;border-right:1px solid var(--line);background:#050507;position:sticky;top:46px;max-height:calc(100dvh - 46px);overflow-y:auto;display:flex;flex-direction:column;gap:12px;min-width:0}
.side-panel {border:1px solid var(--line);padding:10px;background:var(--surface);min-width:0}
.panel-heading {display:flex;align-items:center;justify-content:space-between;gap:6px;border-bottom:1px solid #181b23;padding-bottom:5px;margin-bottom:7px}
.hq-page .panel-heading h2 {font:700 11px "Segoe UI",sans-serif;text-transform:uppercase;letter-spacing:-.02em;line-height:1.35}
.panel-heading>span {font-size:9px;white-space:nowrap}
.panel-tag {color:var(--muted)}
.plan-metrics {display:grid;grid-template-columns:1fr 1fr;gap:7px}
.plan-metrics>div {border:1px solid #181b23;padding:7px;background:#000;display:flex;flex-direction:column;gap:4px;min-width:0}
.hq-page .metric-label {font:9px Consolas,monospace;line-height:1.4;color:var(--muted);letter-spacing:0}
.plan-metrics strong {font-size:15px;letter-spacing:-.05em;overflow-wrap:anywhere}
.plan-metrics s {font-size:9px}
.hq-page .plan-metrics .muted {font-size:9px;line-height:1.3}
#planSpeed {font-size:9px}
.hq-page .speed-control {margin:7px 0;gap:6px;justify-content:space-between}
.hq-page .speed-control label {flex:1}
.hq-page .speed-control input {width:60px;font:700 13px Consolas,monospace;min-height:26px}
.research-page .speed-control input {width:90px}
.discount-list {display:grid;gap:4px}
.discount-strip {display:flex;justify-content:space-between;gap:8px;padding:6px;border:1px solid #181b23;background:#000;font-size:9px;line-height:1.5}
.discount-strip>span:last-child {font-size:8px;white-space:nowrap}
.discount-total {margin:0;font-size:9px}
.gap-resource {padding:5px 0 6px;border-bottom:1px solid #161922}
.gap-resource:last-child {border:0;padding-bottom:3px}
.gap-label {display:flex;justify-content:space-between;flex-wrap:wrap;gap:5px;align-items:center;font-size:10px;text-transform:uppercase}
.gap-label small {font-size:9px;color:var(--muted)}
.gap-label strong {font-size:9px;white-space:nowrap;font-weight:500}
.gap-resource.deficit strong {color:var(--error)}
.gap-resource.covered strong {color:var(--accent)}
.gap-resource.boxes strong {color:var(--amber)}
.gap-resource.idle strong {color:var(--muted)}
.gap-track {height:5px;display:flex;margin:6px 0 4px;background:#161a22;overflow:hidden}
.raw-coverage {background:var(--accent);height:100%}
.deficit .raw-coverage {background:var(--error)}
.box-coverage {background:var(--amber);height:100%}
.gap-caption {display:flex;justify-content:space-between;gap:8px;color:var(--muted);font-size:9px}
.deficit .gap-caption>span:last-child {color:var(--error)}
.box-allocation {font-size:9px;color:var(--amber);margin-top:6px;line-height:1.5}
.panel-note {font-size:9px;color:var(--muted);line-height:1.5;border-top:1px solid var(--line);padding-top:7px;margin:8px 0 0}
.discount-list+.panel-note,.gains-panel>.panel-note {border-top:0;padding-top:0}
.empty-plan {font-size:11px;line-height:1.6;color:var(--muted);margin:6px 0 10px}
.selected-upgrade {border:1px solid #20232b;background:#000;display:grid;grid-template-columns:17px minmax(0,1fr) auto 18px;gap:6px;align-items:center;padding:5px;margin:5px 0}
.plan-index {font-size:9px;color:var(--muted)}
.hq-page .plan-building {font-size:10px;font-weight:bold;border:0;background:none;text-align:left;padding:0;line-height:1.5;min-width:0;overflow-wrap:anywhere}
.plan-building small {display:block;font-size:9px;color:var(--muted);font-weight:normal}
.selected-upgrade>strong {font-size:9px;max-width:85px;text-align:right;line-height:1.5}
.hq-plan-row {padding:9px 0;border-bottom:1px solid var(--line);font-size:11px}
.hq-page .hq-plan-row>.building-link {font-size:11px;font-weight:bold;min-height:0;padding:0}
.plan-status {display:grid;gap:6px;font-size:10px;line-height:1.5;margin:12px 0}
.plan-status>div {display:flex;justify-content:space-between;gap:10px}
.plan-status dt {color:var(--muted)}
.plan-status dd {margin:0;text-align:right}
.hq-plan-warning,.plan-warning {font-size:10px;line-height:1.6;margin:10px 0}
.hq-plan-row .plan-actions {display:flex;flex-wrap:wrap;gap:5px;margin-top:12px}
.hq-page .remove-plan {font-size:14px;padding:0;border:0;min-height:24px;width:18px;color:var(--muted)}
.hq-page .text-button {font-size:10px;min-height:22px;padding:0}
.hq-page .warehouse {border-radius:0;margin:0;padding:0}
.hq-page .warehouse>summary {padding:10px;gap:6px}
.hq-page .warehouse>summary:before {display:none}
.hq-page .warehouse>summary>span:first-child {font:700 11px "Segoe UI",sans-serif;text-transform:uppercase}
.hq-page .warehouse>summary>.muted {margin-left:auto;font-size:9px}
.hq-page .warehouse-content {padding:10px}
.hq-page .warehouse-summary {font-size:9px;line-height:1.7;margin:0 0 12px;white-space:normal}
.hq-page .warehouse-fields {grid-template-columns:1fr 1fr;gap:10px 8px;margin-bottom:13px}
.hq-page .warehouse-fields label {font:10px Consolas,monospace;margin-bottom:5px}
.warehouse .warehouse-resource-label {display:flex;align-items:center;gap:5px}
.warehouse-resource-label img {flex:none;object-fit:contain}
.hq-page .warehouse-content label:not(.consume-option) {font:10px Consolas,monospace;color:var(--muted)}
.hq-page .quantity-control {gap:3px}
.hq-page .quantity-control input {padding:4px;font:11px Consolas,monospace}
.hq-page .quantity-control select {width:42px;padding:3px}
.hq-page .consume-option {align-items:flex-start;font-size:10px;line-height:1.5;gap:6px}
.hq-page #consumeHint {font-size:9px;line-height:1.6;margin-top:8px}
.sidebar-footer {display:flex;justify-content:space-between;align-items:center;gap:5px;font-size:9px;color:var(--muted);padding:0 2px 6px}
.sidebar-footer strong {color:var(--cyan)}
.matrix-workspace {min-width:0;padding:10px}
.hq-page .page-heading {gap:8px;margin:0 0 8px;min-height:32px;flex-wrap:wrap}
.matrix-title {display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.hq-page h1 {font:700 14px "Segoe UI",sans-serif;text-transform:uppercase;letter-spacing:-.035em;margin:0}

#selectionSummary {font-size:10px}
.hq-page .save-area {font-size:9px;gap:6px;margin-left:auto;white-space:nowrap;min-width:0;flex-direction:row;align-items:center}
.hq-page .save-area [data-state=saved] {color:var(--accent)}
.hq-page .save-area [data-state=pending] {color:var(--amber)}
.hq-page .save-area [data-state=saving] {color:var(--cyan)}
.matrix-toolbar {display:flex;gap:6px;align-items:center;border-top:1px solid var(--line);padding:7px 0;flex-wrap:wrap}
.search-control {display:flex;align-items:center;gap:5px;border:1px solid #2a2f3c;padding-left:7px;color:var(--cyan);min-width:145px;flex:1;max-width:260px}
.hq-page .search-control input {border:0;min-width:0;width:100%;font-size:11px;outline-offset:0}
.target-actions {display:flex;gap:12px;margin-left:auto}
.level-actions {display:grid;grid-template-columns:1fr 1fr;gap:0}
.level-actions>span {grid-column:1/-1;font-size:9px;letter-spacing:.08em;color:var(--muted);margin-bottom:4px}
.level-actions:last-child>span {color:var(--cyan)}
.hq-page .target-actions button {font-size:9px;white-space:nowrap;border-color:#323641}
.hq-page .target-actions button+button {border-left:0}
.matrix-filter-row {display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 0 5px}
.filter-chips {display:flex;flex-wrap:wrap;gap:4px}
.hq-page .filter-chips button {display:flex;align-items:center;gap:5px;font-size:9px;min-height:23px;padding:3px 6px;background:#0c0e12;border-color:#303641}
.hq-page .filter-chips [aria-pressed=true] {background:#f8fafc;color:#000;border-color:#f8fafc;font-weight:bold}
.filter-chips i {width:5px;height:5px;background:currentColor}
.filter-chips button>span {color:inherit}
.matrix-hint {font-size:9px;white-space:nowrap;color:var(--muted)}
.matrix-explainer {font-size:9px;color:var(--muted);margin:4px 0 9px;line-height:1.5}
.hq-page .table-scroll {border-radius:0;background:#000;max-height:calc(100dvh - 201px);overflow:auto}
.hq-page .buildings {min-width:1055px;table-layout:fixed}
.hq-page .buildings thead {position:sticky;top:0;z-index:2}
.hq-page .buildings th {font:9px Consolas,monospace;letter-spacing:.025em;padding:9px 7px;background:#09090c;border-right:1px solid #1c1f27;white-space:nowrap}
.hq-page .buildings td {padding:5px 7px;border-right:1px solid #15181f;border-top:1px solid #171a22;font-size:11px;background:transparent;height:48px}
.hq-page .buildings th:nth-child(1) {width:30px;padding:7px}
.hq-page .buildings th:nth-child(2) {width:215px}
.hq-page .buildings th:nth-child(3),.hq-page .buildings th:nth-child(4) {width:88px;text-align:center}
.hq-page .buildings th:nth-child(5) {width:108px}
.hq-page .buildings th:nth-child(6) {width:175px}
.hq-page .buildings th:nth-child(7) {width:123px}
.hq-page .buildings th:nth-child(8) {width:185px}
.hq-page .buildings tr.hq-row {background:#040c07}
.hq-page .buildings tr.selected-row {background:#071119}
.hq-page .buildings tr.selected-row>td:first-child {box-shadow:inset 2px 0 var(--cyan)}
.hq-page .buildings tbody tr:hover {background:#0e121a}
.hq-page .plan-cell {text-align:center}
.plan-check {display:inline-flex;align-items:center;justify-content:center;min-width:20px;min-height:26px;cursor:pointer}
.hq-page .building-link {font:600 12px "Segoe UI",sans-serif;padding:0;border:0;min-height:20px;line-height:1.4}
.hq-page .building-link:hover {background:none;color:var(--cyan)}
.hq-page .building-link.building-identity {display:flex;flex-direction:row;align-items:center;gap:8px;max-width:100%;min-height:28px}
.hq-page .building-icon {display:block;flex:0 0 40px;width:40px;height:28px;object-fit:contain}
.hq-page .building-identity>span {white-space:normal;overflow-wrap:anywhere}
.hq-page .building-meta {font:9px Consolas,monospace;color:var(--muted);line-height:1.5;margin-top:3px;text-transform:uppercase}
.hq-page .stepper button {width:19px;min-height:25px;font-size:12px;padding:0;border-radius:0;background:#080a0e}
.hq-page .stepper input {width:35px;min-height:25px;padding:2px 0;font:bold 11px Consolas,monospace;border-radius:0}
.hq-page .buildings td:nth-child(3),.hq-page .buildings td:nth-child(4) {text-align:center}
.hq-page .cost-grid {font:10px Consolas,monospace;grid-template-columns:1fr 1fr;min-width:0;gap:5px 8px}
.hq-page .cost-grid span {gap:3px;white-space:nowrap;justify-content:space-between}
.hq-page .cost-grid small {font:9px Consolas,monospace;opacity:.9}
.cost-grid .zero {color:#68768a}
.hq-page .number {font:bold 11px Consolas,monospace;white-space:nowrap}
.hq-page .status {font:9px Consolas,monospace;border:1px solid #333945;padding:3px 5px;gap:4px;text-transform:uppercase;max-width:100%}
.hq-page .status.ready {color:var(--accent);border-color:#145a2d;background:#031509}
.hq-page .status.blocked {color:var(--error);border-color:#652033;background:#17040a}
.hq-page .status:before {width:4px;height:4px;flex-shrink:0}
.row-insight>span {display:block;font:10px Consolas,monospace;line-height:1.45}
.row-insight>small {display:block;font:9px Consolas,monospace;line-height:1.5;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.req-more {font-size:9px;font-style:normal;margin-left:7px;font-weight:bold}

.hq-page .error-banner {border-radius:0;font-size:11px;line-height:1.6;margin:8px 0;padding:10px;border-color:#743045;background:#16070b}
.hq-page dialog {border-radius:0;background:#08080b;border-color:#455065}
.hq-page .dialog-heading h2 {font:600 18px "Segoe UI",sans-serif}
.hq-page .detail-controls .stepper input {min-width:55px;min-height:34px;font-size:13px}
.hq-page .detail-controls .stepper button {min-width:30px;min-height:34px}
.hq-page .rss-block,.hq-page .requirement-block,.hq-page .roi-card {border-radius:0}
.hq-page .efficiency-chart-bar {fill:#16a34a}
.hq-page .efficiency-chart-bar.past-guide {fill:#b47f18}
.hq-page .bonus-category {color:var(--cyan)}
@media(min-width:1001px){body.hq-page:not(.heroes-page){height:100dvh;overflow:hidden;display:grid;grid-template-rows:auto minmax(0,1fr)}.hq-page .app-header{height:46px;flex-wrap:nowrap}.hq-page .matrix-shell{height:100%;min-height:0;overflow:hidden}.planning-sidebar{height:100%;max-height:none;min-height:0;position:relative;top:0}.matrix-workspace{height:100%;min-height:0;display:flex;flex-direction:column}.hq-page .page-heading{flex-shrink:0}.hq-page .building-section{display:flex;flex-direction:column;flex:1;min-height:0}.hq-page .table-scroll{flex:1;min-height:0;max-height:none}.hq-page .matrix-toolbar,.hq-page .matrix-filter-row,.hq-page .matrix-explainer{flex-shrink:0}}
@media(min-width:1600px){.hq-page .matrix-shell{grid-template-columns:365px minmax(0,1fr)}.gap-label{font-size:11px}.gap-label strong{font-size:10px}.hq-page .buildings td{height:47px;padding:5px 10px}.hq-page .building-link{font-size:13px}.hq-page .cost-grid{font-size:11px}.plan-metrics strong{font-size:18px}}
@media(max-width:1200px) and (min-width:1001px){.hq-page .matrix-shell{grid-template-columns:280px minmax(0,1fr)}.planning-sidebar{padding:9px;gap:9px}.matrix-title{gap:7px}}
@media(max-width:1000px){.hq-page .app-header{flex-wrap:wrap;gap:8px;padding:7px 10px}.hq-page .app-header nav{margin-right:0}.hq-page .account-controls{margin-left:auto}.hq-page .matrix-shell{display:block}.planning-sidebar{position:static;max-height:none;overflow:visible;border-right:0;border-bottom:1px solid var(--line);display:grid;grid-template-columns:1fr 1fr;padding:10px;gap:10px}.resource-panel{grid-column:2;grid-row:1/span 2}.selected-panel{grid-column:1;grid-row:2}.planning-sidebar>.warehouse,.efficiency-panel,.sidebar-footer{grid-column:1/-1}.hq-page .warehouse-fields{grid-template-columns:repeat(4,minmax(0,1fr))}.hq-page .table-scroll{max-height:70dvh}.matrix-workspace{padding:10px}.hq-page .building-meta{text-transform:none}}
@media(max-width:767px){.header-metric{display:none}.hq-page .app-header nav{gap:2px}.hq-page .app-header nav a{font-size:10px;padding:4px}.hq-page .account-controls{width:100%;margin:0}.hq-page .account-controls select{max-width:none}.planning-sidebar{padding:9px;gap:9px}.telemetry,.resource-panel,.selected-panel{grid-column:1/-1;grid-row:auto}.plan-metrics{grid-template-columns:1fr 1fr}.gap-label{font-size:11px}.gap-label strong{font-size:10px}.resource-panel #resourceGap{display:grid;grid-template-columns:1fr 1fr;gap:8px 15px}.gap-label{display:block}.gap-label strong{display:block;margin-top:5px}.gap-caption{flex-direction:column;gap:3px}.hq-page .warehouse-fields{grid-template-columns:1fr 1fr}.hq-page .page-heading{display:block}.matrix-title{gap:7px;margin:3px 0 8px}.hq-page h1{font-size:15px}.hq-page .save-area{justify-content:flex-start;margin:0 0 7px;white-space:normal}.matrix-toolbar{gap:6px}.search-control{max-width:none;min-width:0;flex:1 1 100%}.hq-page .matrix-toolbar>select{flex:1;min-width:0}.target-actions{width:100%;margin:0}.target-actions button{flex:1;padding:6px 3px;font-size:9px}.matrix-filter-row{align-items:flex-start;gap:5px}.matrix-hint{font-size:8px;margin-top:6px}.hq-page .filter-chips button{font-size:8px;min-height:28px}.matrix-explainer{font-size:10px;margin-bottom:10px}.hq-page .table-scroll{max-height:none;overflow:visible}.hq-page .buildings{min-width:0;table-layout:auto}.hq-page .buildings thead{display:none}.hq-page .buildings tbody{display:block}.hq-page .buildings tr{display:grid;grid-template-columns:1fr 1fr;position:relative;gap:11px;padding:12px;border-top:1px solid var(--line)}.hq-page .buildings td{height:auto;border:0;text-align:left!important;padding:0;min-width:0}.hq-page .buildings td:first-child{grid-column:1;grid-row:1;display:flex;align-items:center;gap:7px}.hq-page .buildings td:first-child:before{display:block;content:'Plan';margin:0;font-size:11px}.hq-page .buildings td:nth-child(2){grid-column:1/-1;grid-row:2}.hq-page .buildings td:nth-child(2):before{display:none}.hq-page .buildings td:nth-child(5){grid-column:1;grid-row:5}.hq-page .buildings td:nth-child(6){grid-column:1/-1;grid-row:4}.hq-page .buildings td:nth-child(7){grid-column:2;grid-row:5}.hq-page .buildings td:nth-child(8){grid-column:1/-1;grid-row:6}.hq-page .buildings td[data-label]:before{font-size:10px;color:var(--muted);margin-bottom:5px}.hq-page .buildings tr.selected-row>td:first-child{box-shadow:none;color:var(--cyan)}.hq-page .buildings .building-link{font-size:15px}.hq-page .stepper input{width:55px;min-height:34px;font-size:13px}.hq-page .stepper button{width:34px;min-height:34px;font-size:15px}.hq-page .cost-grid{max-width:none;font-size:12px;gap:7px 20px}.hq-page .cost-grid small{font-size:10px}.hq-page .building-meta{font-size:9px}.hq-page .row-insight>span{font-size:11px}.hq-page .row-insight>small{font-size:10px}.hq-page .number{font-size:12px}.hq-page .status{font-size:10px}.hq-page input[data-plan]{width:18px;height:18px;min-height:18px}}
@media(pointer:coarse){.hq-page button,.hq-page input:not([type=checkbox]),.hq-page select{min-height:44px}.hq-page .stepper button{min-width:32px}.hq-page .filter-chips button{min-height:36px}.hq-page .building-link{min-height:40px}.hq-page .remove-plan{min-width:28px;min-height:36px}.hq-page .selected-upgrade{grid-template-columns:17px minmax(0,1fr) auto 28px}.hq-page .plan-cell{min-width:30px}.hq-page .plan-check{min-width:44px;min-height:44px}.hq-page .text-button{min-height:36px}}

.short-coverage {height:100%;background:var(--error)}
.sidebar-footer {justify-content:flex-end}
@media(max-width:767px){.hq-page .buildings td[data-label="Current"]{grid-column:1;grid-row:3}.hq-page .buildings td[data-label="Target"]{grid-column:2;grid-row:3}}

.hq-page .brand {width:32px;height:32px;flex-shrink:0;justify-content:center}
.hq-page .brand img {display:block;width:32px;height:32px;object-fit:contain}
.research-page .row-insight>span {overflow-wrap:anywhere}
.research-page .detail-table-scroll {overflow-x:auto}
.research-page #bonusRows>details {margin:12px 0;border-top:1px solid var(--line);padding-top:10px}
.research-page .selected-panel>.row-insight {margin:4px 0 10px}
.hq-page .buildings th[data-sort-heading] {padding:0}
.hq-page .column-sort {display:flex;align-items:center;justify-content:space-between;gap:5px;width:100%;min-height:32px;padding:8px 7px;border:0;background:transparent;color:var(--muted);font:inherit;text-transform:uppercase;white-space:nowrap}
.hq-page .column-sort:hover {background:#151a22;color:var(--text)}
.hq-page .buildings th[aria-sort] .column-sort {color:var(--cyan)}
[data-sort-arrow] {font-size:11px}
.mobile-sort {display:none}
@media(max-width:767px){.mobile-sort{display:flex;flex-wrap:wrap;align-items:center;gap:5px;margin:0 0 8px}.hq-page .mobile-sort button{font-size:10px;min-height:32px;padding:4px 6px}.mobile-sort [aria-pressed=true]{border-color:var(--cyan);color:var(--cyan)}}
@media(max-width:767px){.target-actions .level-actions{flex:1;min-width:0}.target-actions{gap:10px}}

/* Shared progress and bonuses popup layout for all three modules. */
.hq-page .progress-dialog h3{font:600 13px "Segoe UI",sans-serif;color:var(--cyan);margin:24px 0 10px}
.hq-page .progress-dialog .detail-table-scroll{max-width:100%;overflow-x:auto;margin:12px 0 18px}
.hq-page .progress-dialog .bonus-table{width:100%;table-layout:fixed}
.hq-page .progress-dialog .bonus-table th,.hq-page .progress-dialog .bonus-table td{padding:10px 12px;text-align:left;overflow-wrap:anywhere}
.hq-page .progress-dialog .bonus-table th:first-child{width:48%}
.hq-page .progress-dialog .progress-resources th:first-child{width:24%}
.hq-page .progress-dialog .bonus-table td{font:12px Consolas,monospace}
.hq-page .progress-dialog details{margin-top:16px;border-top:1px solid var(--line);padding-top:12px}
@media(max-width:767px){.hq-page .progress-dialog .bonus-table th,.hq-page .progress-dialog .bonus-table td{padding:9px 6px;font-size:10px}.hq-page .progress-dialog .progress-resources{min-width:420px}}

/* Bonus comparisons share the same colors and completion fill across the suite. */
.bonus-table td.number.green{background-image:linear-gradient(to right,rgba(0,230,118,.1) var(--bonus-completion,0%),transparent var(--bonus-completion,0%))}
.hq-page .progress-dialog .resource-coverage th:first-child{width:36%}
.hq-page .progress-dialog .resource-coverage.has-total th:first-child{width:28%}
.hq-page .progress-dialog .resource-coverage caption{text-align:left;padding:12px 0;color:var(--muted);font-size:11px;line-height:1.6}

/* Keep the shared sidebar sequence consistent at every viewport size. */
.planning-sidebar.ordered-planning-sidebar{display:flex;flex-direction:column}

/* Shared workspace tabs: Tank systems and Hot Events. */
.workspace-tabs{display:flex;gap:6px;border-bottom:1px solid var(--line);padding-bottom:8px;margin-bottom:12px;flex-wrap:wrap;flex-shrink:0}
.workspace-tabs [aria-selected=true]{border-color:var(--cyan);color:var(--cyan);background:#07131b}

.planning-sidebar .plan-metrics{grid-template-columns:1fr}
.plan-shortage{border-top:1px solid var(--line);padding-top:12px;margin-top:12px}
.plan-shortage>.metric-label{display:block;margin-bottom:7px}
.shortage-item{display:block;font-size:12px;font-weight:700;text-transform:uppercase;line-height:1.6;margin:3px 0}
.plan-coverage-hint{font-size:10px;line-height:1.7;margin-top:12px}
.plan-coverage-hint[hidden]{display:none!important}
.planning-sidebar #resourceGap{display:block}
.coverage-detail{font-size:9px;line-height:1.6;color:var(--muted);margin:5px 0 0}
.planned-gain{display:flex;justify-content:space-between;align-items:start;gap:12px;font-size:10px;line-height:1.6;padding:7px 0;border-bottom:1px solid var(--line)}
.planned-gain strong{white-space:nowrap}
.planned-gain-description{font-size:10px;line-height:1.7;margin-top:10px}
.planned-gain-description summary{cursor:pointer;color:var(--cyan)}
.planned-gain-description p{white-space:pre-line}

.telemetry>.panel-heading+.plan-shortage{margin-top:0;padding-top:0;border-top:0}

.planning-sidebar .plan-status dd{max-width:68%;overflow-wrap:anywhere}
.planning-sidebar .plan-actions{display:flex;flex-wrap:wrap;gap:5px}
.planning-sidebar :is(.research-plan-row,.plan-item,.refugee-plan-heading)>.building-link{font-size:11px;font-weight:bold;min-height:0;padding:0}
/* The sixth module wraps within the available header space on small screens. */
@media(max-width:767px){.hq-page .app-header nav{flex-wrap:wrap;min-width:0;flex:1}}

.hq-page .account-controls .control-button {
  min-height: 28px;
  padding: 4px 7px;
  border-radius: 0;
  font-size: 10px;
}
.hq-page .control-button:hover { background: #11151c; color: #fff; border-color: #68768b; }

.warehouse-section-title { margin: 0 0 10px; font-size: 11px; text-transform: uppercase; }
.warehouse-speedups { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.speedup-source { border: 0; padding: 0; margin: 0 0 10px; min-width: 0; }
.speedup-source:last-child { margin-bottom: 0; }
.speedup-source legend { padding: 0; margin-bottom: 5px; font-size: 11px; }
.speedup-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.speedup-inputs input { display: block; margin-top: 4px; width: 100%; min-width: 0; }
.speedup-error { margin: 5px 0 0; font-size: 10px; }
.speedup-error:empty { margin: 0; }
.overview-subtitle { margin: 0 0 7px; font-size: 11px; text-transform: uppercase; }
.speed-control + .overview-subtitle { margin-top: 10px; }
.speedup-shortage { margin-top: 8px; }
.speedup-shortage > .metric-label { display: block; margin-bottom: 4px; }
.plan-coverage-hint.speedup-time-hint { margin-top: 4px; }
#speedupCoverage .gap-resource.boxes .box-coverage { min-width: 5px; }
