/* Dialogs follow their contents within the visible safe area. */
#overlay {
 box-sizing:border-box;
 inset:0 0 auto;
 height:100dvh;
 /* Keep the modal above the mobile navigation and the activity panel. */
 z-index:50;
 --modal-space:clamp(7px,1.5vw,22px);
 --modal-top:max(var(--modal-space),env(safe-area-inset-top));
 --modal-right:max(var(--modal-space),env(safe-area-inset-right));
 --modal-bottom:max(var(--modal-space),env(safe-area-inset-bottom));
 --modal-left:max(var(--modal-space),env(safe-area-inset-left));
 padding:var(--modal-top) var(--modal-right) var(--modal-bottom) var(--modal-left);
}
#overlay:not(.hidden) + #toastContainer {z-index:60}
#overlay .dialog {
 box-sizing:border-box;
 display:flex;flex-direction:column;
 width:fit-content;
 min-width:min(100%,340px);
 max-width:100%;
 height:auto!important;
 min-height:0!important;
 max-height:100%!important;
}
#overlay .dialog:not(.nav-window) {
 width:fit-content;
 max-width:min(100%,46rem);
}
#overlay .dialog:has(.stellar-modal-art,.gallery-large-picture,.colony-popup,.system-popup,.building-list,.fleet-order-popup,.stellar-ship-showcase) {
 width:min(100%,56rem);
 max-width:100%;
}
#overlay .dialog:has(.stellar-ship-catalog) {width:min(100%,71rem)}
#overlay .dialog-header,#overlay .dialog-footer {
 flex:0 0 auto;min-width:0;
 padding:clamp(8px,1.3vw,15px) clamp(10px,2vw,23px);
}
#overlay .dialog-header h2 {overflow-wrap:anywhere}
#overlay #dialogClose {flex:0 0 auto}
#overlay .dialog-footer>button {max-width:100%;white-space:normal}
#overlay .dialog .dialog-body {
 box-sizing:border-box;
 flex:0 1 auto!important;
 inline-size:100%;
 min-height:0!important;min-width:0;
 max-height:none!important;
 overflow:hidden auto!important;
 align-items:stretch;
 overscroll-behavior:contain!important;
 overflow-wrap:anywhere;
 scrollbar-color:#66819b #121b31;
 padding:clamp(9px,1.4vw,18px) clamp(10px,2vw,23px);
 gap:clamp(8px,1vw,14px);
}
#overlay .dialog .dialog-body>* {flex-shrink:0;min-width:0;max-width:100%}
#overlay .dialog-body :is(img,video,svg,canvas,iframe) {max-inline-size:100%}
#overlay .dialog-body pre {white-space:pre-wrap;overflow-wrap:anywhere}
#overlay .dialog.nav-chat #chatModalMount {height:clamp(18rem,65dvh,46rem)}
#overlay .dialog.nav-rank .dialog-body>.panel {flex:0 0 auto}
#overlay .dialog.nav-rank .dialog-body>.panel>.panel-body {overflow:visible!important;flex:0 0 auto}
#overlay .dialog.nav-resources .resources-fit {flex:0 0 auto}
#overlay .dialog.nav-resources .resources-fit-grid {min-height:clamp(16rem,52dvh,35rem)}
#overlay .dialog.nav-galaxy {
 width:min(100%,90rem);
 height:min(calc(100dvh - var(--modal-top) - var(--modal-bottom)),64rem)!important;
}
#overlay .dialog.nav-galaxy .dialog-body {flex:1 1 auto!important}
#overlay .dialog.nav-galaxy .galaxy-wrap {
 flex:1 1 10rem!important;
 min-height:10rem!important;
 height:auto!important;
 background:#080f21;
}
#overlay .nav-galaxy .galaxy-inline-actions {flex-wrap:wrap}
.galaxy-wrap canvas {touch-action:none;cursor:grab}
.galaxy-wrap canvas.map-dragging {cursor:grabbing}
.galaxy-controls {
 position:absolute;top:8px;right:8px;z-index:1;
 display:flex;align-items:center;gap:4px;
 padding:4px;background:#0a1429ef;border:1px solid #526c96;border-radius:9px;
}
.galaxy-controls button {
 min-width:34px;min-height:34px;
 border:1px solid #536c95;border-radius:6px;
 color:#e7f3ff;background:#172b45;font-size:19px;
}
.galaxy-controls button:hover,.galaxy-controls button:focus-visible {background:#304f73}
.galaxy-controls output {min-width:4.3ch;text-align:center;color:#cce6f7;font-size:11px}
.galaxy-key {
 display:flex;flex-wrap:wrap;gap:5px 14px;
 margin:6px 0 8px;color:#c4d8ef;font-size:12px;
}
.galaxy-key span {display:inline-flex;align-items:center;gap:6px}
.galaxy-key i {display:inline-block;width:11px;height:11px;border-radius:50%}
.galaxy-key .key-known {background:#ffe092;box-shadow:0 0 7px #ffb965}
.galaxy-key .key-fog {border:1.5px dashed #d6bbff;background:#9372bf35}
.galaxy-key .key-shared {background:#b9eaff;border:2px solid #679cd9}
.galaxy-system-sun {
 flex:none; width:42px;height:42px;border-radius:50%;
 background:radial-gradient(circle at 40% 37%,#fffbea 5%,#ffe394 35%,#f78e49 80%);
 box-shadow:0 0 20px #ffbd6e83;
}
.galaxy-system-heading {display:flex;align-items:center;gap:14px}
.galaxy-system-heading strong {display:block}
.stellar-upload-picture img {object-fit:contain!important;object-position:center!important}
.stellar-upload-picture:hover img {transform:none}
#overlay .stellar-modal-art {min-width:0;overflow:hidden;border-radius:10px}
#overlay .stellar-modal-art>img {
 display:block;
 width:100%;
 height:clamp(104px,27dvh,270px);
 object-fit:contain;
 background:#09172b;
}
#overlay .stellar-modal-art>.stellar-picture {
 height:clamp(88px,26dvh,295px)!important;
 max-width:100%;
}
#overlay .gallery-large-picture>.stellar-upload-picture {height:clamp(115px,49dvh,500px)}
.fleet-ship-previews {display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.fleet-ship-previews figure {width:min(128px,100%);margin:0}
.fleet-ship-previews .stellar-picture {aspect-ratio:16/9}
.fleet-ship-previews figcaption {font-size:11px;color:#c4d8ef;padding-top:3px}
@media(max-width:760px) {
 #overlay .stellar-modal-art>img,
 #overlay .stellar-modal-art>.stellar-picture,
 #overlay .gallery-large-picture>.stellar-upload-picture {
  height:clamp(72px,19dvh,158px)!important;
 }
 #overlay .dialog-body :is(.upgrade-table,.finance-table,.build-readiness table) {table-layout:fixed;width:100%}
 #overlay .dialog-body :is(.upgrade-table,.finance-table,.build-readiness table) :is(th,td) {
  overflow-wrap:anywhere;
  white-space:normal;
 }
 #overlay .dialog-body :is(.upgrade-table,.finance-table,.build-readiness table) th:first-child {width:38%}
 #overlay .dialog-header h2 {font-size:clamp(17px,4.9vw,23px)}
 #overlay .dialog-footer {gap:6px}
 #overlay .dialog-footer>button,#overlay #dialogClose {min-height:42px}
 #overlay .dialog-footer .primary {flex:1 1 9rem}
 #overlay .nav-galaxy .galaxy-key {font-size:10px}
 .galaxy-controls button {min-width:39px;min-height:39px}
 #overlay .dialog:has(.stellar-ship-catalog) .grid3 {
  grid-template-columns:repeat(auto-fit,minmax(min(100%,205px),1fr));
 }
 .game .screen.empire-dashboard>#resourceStripInline .resource-tile :is(.res-name,.res-rate) {
  white-space:normal!important;overflow-wrap:anywhere;
 }
}
@media (min-width:761px) and (max-width:1050px) {
 .game .screen.empire-dashboard>#resourceStripInline .resource-tile :is(.res-name,.res-rate) {
  white-space:normal!important;overflow-wrap:anywhere;
 }
}
.construction-detail {display:grid;grid-template-columns:minmax(0,1fr);gap:clamp(10px,1.6vw,20px);min-width:0}
.construction-detail>.stack {min-width:0;gap:9px}
.construction-detail .grid2 {grid-template-columns:repeat(2,minmax(0,1fr))}
.construction-detail .stat {min-width:0}
.construction-detail .modal-cost {margin:0}
.system-popup>.soft-btn,.explore-popup>.soft-btn {margin-bottom:9px}
@media(min-width:700px) {
 .construction-detail {grid-template-columns:minmax(0,2fr) minmax(0,3fr);align-items:start}
 #overlay .construction-detail .stellar-modal-art>.stellar-picture {
  height:auto!important;aspect-ratio:16/9;
 }
}
#overlay .dialog.nav-finance {width:min(100%,46rem)}
.commander-stat[data-action="hud-credits"] {font:inherit;color:inherit;text-align:start;cursor:pointer}
.finance-view {display:grid;gap:12px}
.finance-totals .value {font-size:clamp(16px,3.5vw,25px)}
.finance-table {width:100%;border-collapse:collapse;font-size:clamp(11px,2.8vw,14px)}
.finance-table :is(th,td) {padding:9px 6px;border-bottom:1px solid #6e8fa84d;text-align:start}
.finance-table :is(th,td):nth-child(n+2) {text-align:end}
.finance-table td:last-child {font-weight:700}
.finance-view .popup-section-blurb p {margin:5px 0 8px}
#overlay .dialog:has(.tech-tree,.explore-popup .fleet-qty) {width:min(100%,62rem);max-width:100%}
.tech-tree,.tech-tree-group[open] {display:grid;gap:12px}
.tech-tree h4 {margin:7px 0 4px}
.tech-tree-branch,.tech-tree-group {border:1px solid #587da365;border-radius:10px;background:#0c1b2d;padding:clamp(9px,1.6vw,17px)}
.tech-tree-group summary {cursor:pointer;font-weight:700}
.tech-tree-branch header {display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.tech-tree-branch header p,.tech-tree .popup-section-blurb p {margin-top:5px;color:#b7cee5}
.tech-tree-branch header .pill {white-space:nowrap}
.tech-tree-tier {border-inline-start:2px solid #6593bf70;padding-inline-start:10px;margin:12px 0}
.tech-tree ul {list-style:none;margin:0;padding:0}
.tech-tree-entry {display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr) auto;align-items:start;gap:8px;padding:8px 0;border-top:1px solid #80a2c333}
.tech-tree-entry small {display:block;margin-top:4px;color:#bdd1e5}
.tech-tree-entry .pill {display:inline-flex}
.tech-tree-filters {flex-wrap:wrap}
.research-tools {margin:9px 0 14px}
.tech-gate-hint {display:flex;flex-wrap:wrap;gap:7px;align-items:center}
.upgrade-table {width:100%;border-collapse:collapse;font-size:clamp(10px,2vw,13px);font-variant-numeric:tabular-nums}
.upgrade-table th,.upgrade-table td {text-align:end;border-bottom:1px solid #87a6cb45;padding:6px 4px}
.upgrade-table th:first-child {text-align:start}
.upgrade-table th small {display:block;color:#aac3d9;font-weight:400;margin-top:3px}
.upgrade-table td:last-child {font-weight:800}
@media(max-width:430px) {
 .tech-tree-entry {grid-template-columns:minmax(0,1fr) auto}
 .tech-tree-state {grid-column:1;grid-row:2}
 .tech-tree-entry>button {grid-column:2;grid-row:1}
}

#overlay .dialog.nav-tech-tree {width:min(100%,62rem)}
.tech-tree {display:grid;gap:14px}
.tech-tree :is(.tech-tree-branch ul,.tech-tree-group ul) {
 list-style:none;padding:0;margin:10px 0;display:grid;gap:8px
}
.tech-tree-entry {
 display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;align-items:start;gap:8px;
 padding:10px;border:1px solid #6e8fa84d;border-radius:8px;background:#101c30
}
.tech-tree-entry small {display:block;color:#b5c9e3;overflow-wrap:anywhere}
.tech-tree-ship-cost {grid-column:1/-1}
.tech-tree-ship-cost .modal-cost {margin:0}
@media (max-width:480px) {
 .tech-tree-entry {grid-template-columns:minmax(0,1fr) auto}
 .tech-tree-state {grid-row:2;grid-column:1/-1}
}

.research-summary {display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:4px}
.research-summary p {margin:0}
.research-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(5px,1.3vw,14px)}
.research-tile {
 min-width:0;display:flex;flex-direction:column;align-items:stretch;gap:4px;text-align:left;
 padding:clamp(5px,1.1vw,11px);border:1px solid #476383;border-radius:10px;
 color:#eff7ff;background:#12243a;line-height:1.2;overflow-wrap:anywhere;hyphens:auto
}
.research-tile:hover,.research-tile:focus-visible {border-color:#82deec;background:#18314b}
.research-tile img {display:block;width:100%;height:clamp(44px,12vw,100px);object-fit:cover;border-radius:6px}
.research-tile strong {font-size:clamp(11px,2vw,17px)}
.research-tile span,.research-tile small {font-size:clamp(10px,1.65vw,13px);color:#b9cee8}
.research-tile small {margin-top:auto;color:#86d9e7}
.build-readiness {display:grid;gap:7px;min-width:0}
.build-readiness p,.build-readiness ul {margin:0}
.build-readiness ul {padding:0;display:grid;gap:5px;list-style:none}
.build-readiness li span {display:block;padding-inline-start:1.1em;font-size:.9em}
.build-readiness table {width:100%;border-collapse:collapse;font-size:clamp(10px,2.65vw,14px);font-variant-numeric:tabular-nums}
.build-readiness :is(th,td) {padding:5px 3px;border-bottom:1px solid #4e6b895c;text-align:right;overflow-wrap:anywhere}
.build-readiness th:first-child {text-align:left}

.resource-analysis {display:grid;gap:7px}
.resource-analysis-row {
 display:grid;grid-template-columns:minmax(0,1.35fr) repeat(3,minmax(0,1fr));
 gap:5px;padding:7px 5px;font-size:clamp(10px,2.75vw,14px);
 align-items:center;overflow-wrap:anywhere
}
.resource-analysis-row>:nth-child(n+2) {text-align:right}
.resource-analysis-head {color:#a8c6dd;border-bottom:1px solid #4e6b89}
.resource-analysis details {border:1px solid #4e6b89;border-radius:8px}
.resource-analysis summary {cursor:pointer}
.resource-analysis summary>:first-child::before {content:'▸ ';color:#89d8ec}
.resource-analysis details[open]>summary>:first-child::before {content:'▾ '}
.resource-analysis-sources {display:grid;gap:8px;padding:6px 10px 10px}
.resource-analysis-sources ul {list-style:none;padding:0;margin:0}
.resource-analysis-sources li {display:flex;justify-content:space-between;gap:8px;font-size:13px;padding:3px 0}
.resource-analysis-sources li strong {flex:none}

.commodity-label {display:inline-flex;align-items:center;gap:5px;max-width:100%;min-width:0;vertical-align:middle;color:var(--commodity-color);font-weight:700}
.commodity-label .commodity-icon {display:block;flex:none;width:22px;height:22px;object-fit:cover;border:1px solid #7599b380;border-radius:5px;background:#101d30}
.commodity-label .commodity-name {min-width:0;white-space:normal;overflow-wrap:anywhere}
.modal-cost .resource-cost-chip .commodity-label,.modal-cost .resource-cost-chip .commodity-name {background:none;border:0;padding:0;font:inherit;color:var(--commodity-color)}
.resource-analysis summary>:first-child {display:flex;align-items:center;min-width:0}
#overlay .resource-summary-headers,#overlay .resource-summary-row {
 grid-template-columns:minmax(0,1.4fr) repeat(4,minmax(0,1fr));min-width:0;gap:4px
}
#overlay .resource-summary-row :is(span,strong) {white-space:normal;overflow-wrap:anywhere}
@media(max-width:460px){
 .commodity-label .commodity-icon {width:17px;height:17px}
 .commodity-label {gap:4px}
 .finance-totals .value .commodity-label {align-items:flex-start}
}

.commodity-label .metric-icon {
 display:grid;place-items:center;padding:0;color:var(--commodity-color);
 font:700 14px/1 system-ui,sans-serif;text-align:center;
}
.upgrade-table th[scope="row"] .commodity-label {align-items:flex-start}
@media(max-width:460px){.commodity-label .metric-icon{font-size:11px}}

/* The chat transcript needs a definite flex height inside the dialog. */
#overlay .dialog.nav-chat {
 width:min(100%,68rem);
 height:min(calc(100dvh - var(--modal-top) - var(--modal-bottom)),48rem)!important;
}
#overlay .dialog.nav-chat .dialog-body {
 flex:1 1 0!important;
 overflow:hidden!important;
}
#overlay .dialog.nav-chat #chatModalMount {
 flex:1 1 0;
 height:auto;
}

/* Illustrated prerequisite branches */
.tech-object-title img {display:block;width:min(100%,15rem);aspect-ratio: 16 / 8;object-fit:cover;border-radius:7px;margin-bottom:7px}
.dependency-tree {grid-column:1 / -1;min-width:0;color:#d6efff}
.dependency-tree summary {cursor:pointer;padding:7px 0;color:#9befff}
.tech-tree .dependency-tree ul {display:block;list-style:none;margin:4px 0;padding:0 0 0 clamp(7px,2vw,20px);border-left:1px solid #5790b0}
.tech-tree .dependency-tree li {position:relative;padding:5px 0}
.tech-tree .dependency-tree li:before {content:'';position:absolute;top:25px;left:calc(-1 * clamp(7px,2vw,20px));width:clamp(7px,2vw,20px);border-top:1px solid #5790b0}
.dependency-node {display:flex;align-items:center;gap:8px;padding:5px 7px;border:1px solid #aa8757;border-radius:7px;background:#102138;overflow-wrap:anywhere}
.dependency-node.dependency-ready {border-color:#589e9f}
.dependency-node img {width:clamp(28px,8vw,68px);height:40px;object-fit:cover;border-radius:4px}

#chatModalMount > nav {flex:0 0 auto;display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px}
#chatModalMount .combat-chat-content {display:flex;min-height:0;flex:1}
#chatModalMount .combat-chat-view {display:flex;flex-direction:column;width:100%;min-height:0;overflow:auto}
#chatModalMount .combat-chat-view > .chat-heading {display:none}
.combat-card {padding:12px;margin:6px 0;border:1px solid #4a6788;border-radius:8px;background:#0f2038}
.combat-ship {display:flex;align-items:center;gap:8px;margin:5px 0}
.combat-ship img,.combat-ship svg {width:76px;flex:0 0 76px}
.combat-round {padding:6px 0;border-top:1px solid #304967}
.combat-round label {display:flex;align-items:center;justify-content:space-between;gap:6px}
.combat-round meter {width:35%}

.security-list {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,170px),1fr));gap:6px}
.security-list .security-card {display:flex;align-items:center;gap:7px;text-align:left;padding:6px;min-width:0;overflow-wrap:anywhere}
.security-art {flex:0 0 46px;width:46px}
.security-art img,.security-art svg {display:block;width:46px;height:32px;object-fit:cover;border-radius:4px}
.security-card small {display:block;margin-top:3px;font-size:.75rem}
#commandToggle {position:absolute;right:-27px;top:44dvh;z-index:34;width:28px;height:54px;padding:0;border-radius:0 10px 10px 0}
@media(min-width:761px){
 .game.command-collapsed .layout {grid-template-columns:0 minmax(0,1fr) minmax(255px,279px)!important}
 .game.command-collapsed.messages-collapsed .layout {grid-template-columns:0 minmax(0,1fr) 0!important}
 .game.command-collapsed .sidebar {width:0!important;padding:0!important;border:0!important;overflow:visible!important;background:none}
 .game.command-collapsed .sidebar > :not(#commandToggle) {display:none!important}
 .game.command-collapsed #commandToggle {position:fixed;left:0;right:auto}
}
@media(min-width:761px) and (max-width:1320px){
 .game.command-collapsed:not(.messages-collapsed) .layout {grid-template-columns:0 minmax(0,1fr) 245px!important}
}

.growth-card {display:flex;align-items:center;gap:12px}
.growth-card img,.growth-card svg {width:clamp(52px,16vw,100px);height:56px;object-fit:cover;border-radius:5px}
.growth-card p {margin:4px 0}

.stellar-upload-picture.ship-cutout {background:radial-gradient(ellipse at center,#284560,#091625 76%)}
.stellar-upload-picture.ship-cutout img {box-sizing:border-box;padding:8px}
#overlay .shipyard-card {display:flex;flex-direction:column;gap:10px;min-width:0}
#overlay .shipyard-card :is(h3,p,ul,dl,dd) {margin:0}
#overlay .shipyard-card ul {padding-inline-start:17px;font-size:.8rem}
.shipyard-stats {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
.shipyard-stats>div {display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:3px;padding:4px 6px;border:1px solid #385471;border-radius:6px}
.shipyard-stats dt {font-size:.75rem}
.shipyard-stats dd {font-weight:700}
.shipyard-costs,.shipyard-actions {display:flex;flex-wrap:wrap;gap:5px;margin-top:4px}
.shipyard-actions {margin-top:auto}

/* Compact research overview and order dialog. */
.research-grid {gap:8px}
.research-grid .research-tile {padding:7px;gap:7px;align-content:center}
.research-grid .research-tile img {
 width:100%;height:clamp(52px,13vw,96px);object-fit:contain;background:#0b192a;
}
.research-tile-copy {display:grid;gap:2px;min-width:0;overflow-wrap:anywhere}
.research-tile-copy strong {font-size:clamp(12px,1.4vw,16px)}
#overlay .dialog.research-order-dialog {width:min(100%,52rem);max-width:100%}
.research-order {display:grid;grid-template-columns:minmax(150px,1fr) minmax(0,2.5fr);gap:14px}
.research-order-intro {display:grid;gap:7px;align-content:start;min-width:0}
.research-order-intro img {
 display:block;width:100%;height:clamp(90px,18vh,150px);object-fit:contain;
 background:#0b192a;border-radius:8px;
}
.research-order :is(h3,p) {margin:0}
.research-order-intro :is(p,.help-context) {margin-top:5px}
.research-order .build-readiness {gap:5px}
.research-order .build-readiness ul {gap:3px}
.research-order .build-readiness li span {display:inline;padding-inline-start:.55em}
.research-order .build-readiness :is(th,td) {padding-block:4px}
@media (min-width:760px) {
 .research-grid .research-tile {display:grid;grid-template-columns:minmax(100px,53%) minmax(0,1fr);align-items:center}
 .research-grid .research-tile img {height:clamp(96px,8vw,118px)}
}
@media (max-width:759px) {
 .research-order {grid-template-columns:minmax(0,1fr);gap:8px}
 .research-order-intro {grid-template-columns:minmax(64px,23%) minmax(0,1fr);align-items:start}
 .research-order-intro img {height:65px}
 .research-order-intro .help-context {padding:5px 8px;min-height:0}
 .research-order .build-readiness li {line-height:1.25}
}

.game .screen.empire-dashboard .colony-scene .scene-overlay.planet-info-overlay {
 z-index:6;
 width:max-content;
 max-width:min(335px,calc(100% - 20px));
 max-height:calc(100% - 44px);
 box-sizing:border-box;
 overflow:auto;
 pointer-events:auto;
 padding:8px 14px 10px 10px;
 border:0;
 box-shadow:none;
 backdrop-filter:none;
 background:linear-gradient(100deg,#061322f2 0%,#061322d9 75%,#06132200 100%);
 color:#f4faff;
}
.planet-info-overlay summary {padding:2px 0;cursor:pointer}
.planet-info-overlay dl {margin:5px 0 0;font:500 12px/1.3 system-ui,sans-serif}
.planet-info-overlay dl div {display:grid;grid-template-columns:auto 1fr;gap:9px;padding:2px 0}
.planet-info-overlay dt {color:#d5e8f8}
.planet-info-overlay dd {margin:0;text-align:right;font-weight:700}

.scene-planet-rename {display:none}
@media (max-width:760px) {
 .game .screen.empire-dashboard>.home-planetline {
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:auto!important;
  grid-template-areas:"hud"!important;
 }
 .game .screen.empire-dashboard>.home-planetline>:is(.home-planet-title,.home-planet-controls) {
  display:none!important;
 }
 .game .screen.empire-dashboard>.home-planetline {
  padding-block:4px!important;
 }
 .game .screen.empire-dashboard>.home-planetline>.home-command-hud,
 .game .screen.empire-dashboard .home-command-hud>.hud-chip {
  height:clamp(43px,7.6dvh,52px)!important;
  min-height:clamp(43px,7.6dvh,52px)!important;
  max-height:clamp(43px,7.6dvh,52px)!important;
 }
 .game .screen.empire-dashboard .home-command-hud>.hud-chip .hud-chip-icon {
  width:20px!important;
  height:20px!important;
  flex-basis:20px!important;
 }
 .game .screen.empire-dashboard .home-command-hud>.hud-chip .hud-chip-data small {
  font-size:8px!important;
  line-height:9px!important;
 }
 .game .screen.empire-dashboard>.colony-scene {
  min-height:clamp(270px,36dvh,340px)!important;
 }
 .game .screen.empire-dashboard .colony-scene .scene-overlay.planet-info-overlay {
  display:block!important;
  top:6px;
  left:7px;
  max-width:calc(100% - 60px);
  padding:5px 14px 7px 8px;
  background:linear-gradient(100deg,#061322f5 0%,#061322e3 83%,#06132200 100%);
 }
 .planet-info-overlay summary strong {font-size:16px}
 .planet-info-overlay dl {font-size:11px}
 .planet-info-overlay dl div {padding-block:1px}
 .scene-planet-rename {
  display:grid;
  place-items:center;
  position:absolute;
  z-index:7;
  top:7px;
  right:7px;
  min-width:38px;
  min-height:38px;
  padding:0;
 }
 .game .screen.empire-dashboard>.home-action-grid {
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
 }
 .game .screen.empire-dashboard>.home-action-grid>.home-action:nth-child(n) {
  grid-column:auto!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:15px 2.24em!important;
  font-size:clamp(9px,2.5vw,12px)!important;
  align-content:center!important;
  justify-items:center!important;
  gap:2px!important;
  padding:2px 3px!important;
  text-align:center!important;
 }
 .game .screen.empire-dashboard>.home-action-grid>.home-action-art .home-action-icon {
  grid-column:1!important;
  grid-row:1!important;
  width:15px!important;
  height:15px!important;
  min-width:0!important;
  min-height:0!important;
 }
 .game .screen.empire-dashboard>.home-action-grid>.home-action-art strong {
  grid-column:1!important;
  grid-row:2!important;
  align-self:center!important;
  text-align:center!important;
  white-space:normal!important;
  font-size:inherit!important;
  line-height:1.12!important;
 }
 @media (max-height:720px) {
  .game .screen.empire-dashboard>.colony-scene {
   min-height:clamp(100px,calc(100dvh - 460px),270px)!important;
  }
  .game .screen.empire-dashboard>.home-action-grid {
   grid-auto-rows:44px!important;
  }
  .game .screen.empire-dashboard>.home-action-grid>.home-action:nth-child(n) {
   grid-template-rows:12px 2.24em!important;
   height:44px!important;
   min-height:44px!important;
  }
  .game .screen.empire-dashboard>.home-action-grid>.home-action-art .home-action-icon {
   width:12px!important;
   height:12px!important;
  }
 }
 .game .screen.empire-dashboard>.home-action-grid>.home-action-art strong {
  display:block!important;
  overflow-wrap:anywhere;
 }
}

@media (width > 760px) {
 .game .screen.empire-dashboard>.home-action-grid>.home-action-art:is([data-panel="trade"],[data-panel="codex"]) {
  display:none!important;
 }
}


.resource-tile {position:relative}
.resource-tile :is(.res-tile-staff,.res-tile-load) {
 position:absolute;
 z-index:4;
 top:2px;
 padding:1px 2px;
 border-radius:3px;
 background:#071323ed;
 color:#f4f9ff;
 font:700 clamp(8px,1.65vw,11px)/1.1 system-ui,sans-serif;
 font-variant-numeric:tabular-nums;
 pointer-events:none;
}
.resource-tile .res-tile-staff {left:2px;color:#ffd0a2}
.resource-tile .res-tile-load {right:2px}

#tradeForm #tradeQuantity[aria-invalid="true"] {
 color:#ff8a95;
 border-color:#ff7687;
}
#tradeForm button[type="submit"]:disabled {
 opacity:.52;
 cursor:not-allowed;
}

.map-planet-popup {
 position: absolute;
 inset: .5rem auto auto .5rem;
 z-index: 2;
 box-sizing: border-box;
 width: min(19rem, calc(100% - 1rem));
 max-height: calc(100% - 1rem);
 overflow: auto;
 overscroll-behavior: contain;
 padding: .65rem .8rem;
 border: 1px solid #526c96;
 border-radius: .65rem;
 background: #111d34f5;
 box-shadow: 0 .35rem 1rem #050917a6;
 font-size: .85rem;
}
.map-planet-popup header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.map-planet-popup h2 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.map-planet-popup header button { padding: .15rem .6rem; }
@media (max-width: 600px) {
 .map-planet-popup { inset: auto auto .5rem .5rem; max-height: min(75%, calc(100% - 1rem)); }
}
.map-planet-popup dl { display: grid; grid-template-columns: 1fr auto; gap: .45rem 1rem; margin: .75rem 0 1rem; }
.map-planet-popup dd { margin: 0; text-align: right; font-weight: 700; }
.map-planet-popup .actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.map-planet-popup button:disabled { opacity: .5; cursor: default; }

#overlay .dialog-footer:has(> #flightPreview) {
 display: flex;
 flex-wrap: wrap;
 align-items: center;
 gap: .45rem;
}
#dialogFooter > #flightPreview {
 box-sizing: border-box;
 flex: 0 0 100%;
 min-width: 0;
 justify-content: flex-start;
 gap: .25rem 1rem;
 padding: .4rem .65rem;
}
#dialogFooter > #flightPreview p { margin: 0; }
#dialogFooter > #flightPreview strong { font-size: .9rem; }
#dialogFooter .fleet-footer-actions {
 display: flex;
 flex-wrap: wrap;
 gap: .45rem;
 margin-right: auto;
}
@media (max-width: 520px) {
 #dialogFooter .fleet-footer-actions { flex: 1 0 100%; }
 #dialogFooter .fleet-footer-actions > button { flex: 1 1 auto; min-height: 42px; }
}

#messagesReadAll { margin: 0 .6rem .45rem; padding: .35rem .5rem; font-size: .72rem; }
#messagesReadError:not(:empty) { padding: 0 .6rem .4rem; font-size: .72rem; }
button[data-nav="chat"], button[data-panel="chat"] { position: relative; }
.chat-unread-badge {
 position: absolute; z-index: 2; top: .2rem; right: .3rem;
 display: grid; place-items: center; min-width: 1.15rem; height: 1.15rem;
 padding: 0 .2rem; border-radius: 1rem; background: #a4ecff;
 color: #081727; font: 700 .68rem/1 system-ui, sans-serif;
}
.chat-unread-badge[hidden] { display: none; }
@media (min-width: 761px) {
 .game .screen.empire-dashboard > .home-planetline {
  min-height: 51px !important;
  padding-block: 3px !important;
 }
 .game .screen.empire-dashboard > .home-planetline > .status-planet-btn,
 .game .screen.empire-dashboard .home-command-hud > .hud-chip {
  height: 44px !important;
  min-height: 44px !important;
  padding-block: 2px !important;
 }
}
.resource-tile .res-capacity {
 font-size: clamp(8px, .66vw, 11px);
 line-height: 1.05;
 color: #c1dfef;
 white-space: nowrap;
}
#overlay .dialog.warehouse-dialog {
 width: min(100%, 66rem);
 max-width: 100%;
 height: 100% !important;
}
#overlay .warehouse-dialog .dialog-body {
 display: flex;
 flex-direction: column;
 flex: 1 1 auto !important;
 overflow: hidden !important;
 padding-block: .45rem;
 gap: .4rem;
}
#overlay .warehouse-dialog .warehouse-grid {
 --warehouse-gap: .65rem;
 display: grid;
 flex: 1 1 0;
 min-height: 0;
 grid-template-columns: repeat(2, minmax(0, 1fr));
 grid-auto-rows: max(11rem, calc((100% - var(--warehouse-gap)) / 2));
 gap: var(--warehouse-gap);
 overflow: hidden auto;
 overscroll-behavior: contain;
 scroll-snap-type: y proximity;
 scrollbar-gutter: stable;
}
.warehouse-grid article {
 display: grid;
 grid-template-rows: minmax(0, 1fr) auto;
 border: 1px solid #3b5878;
 border-radius: .6rem;
 overflow: hidden;
 background: #102236;
 scroll-snap-align: start;
}
.warehouse-grid .warehouse-card-info { display: grid; gap: .2rem; padding: .35rem .55rem; }
.warehouse-card-stock, .warehouse-upgrade-row {
 display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .25rem .55rem;
}
.warehouse-grid .warehouse-card-stock h3 { font-size: 1rem; line-height: 1.15; }
.warehouse-grid .warehouse-upgrade-row > button { margin: 0; }
.warehouse-grid article :is(h3,p) { margin: 0; }
.warehouse-grid article p { font-size: .8rem; line-height: 1.25; }
.warehouse-grid .modal-cost { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; }
.warehouse-grid .resource-cost-chip { min-width: 0; padding: .2rem .35rem; font-size: .72rem; }
.warehouse-grid .commodity-icon { width: 1rem; height: 1rem; }
.warehouse-grid article button { min-height: 32px; padding: .25rem; }
.warehouse-picture { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; background: #0b1827; }
#overlay .warehouse-dialog .dialog-body > .actions { margin: 0; }
@media (max-width: 520px) {
 .warehouse-grid .warehouse-card-info { padding: .3rem; }
 .warehouse-grid article h3 { font-size: .9rem; }
 .warehouse-grid article :is(p,button) { font-size: .72rem; }
}
@media (max-width: 760px) {
 .game .screen.empire-dashboard > .home-planetline > .home-command-hud,
 .game .screen.empire-dashboard .home-command-hud > .hud-chip {
  height: 43px !important;
  min-height: 43px !important;
  max-height: 43px !important;
 }
}
@media (min-width: 761px) {
 .game .screen.empire-dashboard .home-planet-title .home-planet-copy h2 {
  font-size: 17px !important;
  line-height: 1.1;
 }
 .game .screen.empire-dashboard .home-planet-title .home-planet-copy small {
  font-size: 11px !important;
  line-height: 1.15;
  color: #e0edf7;
 }
 .game .screen.empire-dashboard .status-planet-btn .compact-planet-icon {
  width: 28px !important;
  height: 28px !important;
  flex-basis: 28px !important;
 }
}

#overlay .dialog.resource-detail-dialog { width: min(100%, 50rem); }
#overlay .resource-detail-dialog .dialog-body { gap: .45rem; padding-block: .55rem; }
.resource-detail-dialog .resource-detail-hero {
 grid-template-columns: clamp(76px, 18vw, 144px) minmax(0, 1fr) !important;
 gap: .65rem !important;
 padding: .45rem !important;
}
.resource-detail-dialog .resource-detail-art { height: clamp(72px, 12dvh, 112px); }
.resource-detail-dialog .resource-detail-image { object-fit: contain; }
.resource-detail-dialog .resource-detail-hero h2 { margin: 0; font-size: 1.4rem !important; }
.resource-detail-dialog .resource-detail-hero p { margin: 0; line-height: 1.25; }
.resource-detail-dialog .resource-detail-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
.resource-detail-dialog .resource-detail-stats > div { padding: .35rem; grid-column: auto; }
.resource-detail-dialog .resource-detail-stats small { margin-bottom: .15rem; }
.resource-detail-dialog :is(.storage-header,.storage-track,.resource-worlds) { margin: 0; }
.resource-world-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.resource-world-heading h3 { margin: 0; font-size: .95rem; }
.resource-world-heading select { width: auto; padding: .25rem; }
.resource-detail-dialog .resource-world-row { padding: .35rem; }
.resource-detail-dialog .resource-explain { margin: .3rem 0; padding: .35rem .5rem; }
.resource-production-compact { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; }
.resource-production-compact p { flex-basis: 100%; margin: 0; }
.resource-production-compact label { display: flex; flex: 1 1 13rem; align-items: center; gap: .35rem; }
.resource-production-compact input { flex: 1; min-width: 2rem; padding: 0; }
.resource-production-compact output { white-space: nowrap; }
.resource-storage-action { display: flex; justify-content: flex-end; margin-top: .3rem; }

/* Consistent labels for command buttons and equal-width colony tabs. */
#game button, #overlay button, #auth button { text-align: center; }
.nav-main .menu-art-btn,
#overlay .mobile-menu-grid .menu-art-btn {
 justify-content: center;
 text-align: center;
}
.planet-tabs .planet-pill {
 flex: 0 0 clamp(132px, 24vw, 180px);
 box-sizing: border-box;
 justify-content: center;
 text-align: center;
}
.planet-tabs .mini-planet { flex-shrink: 0; }
.planet-tabs .planet-tab-title {
 flex: 1;
 min-width: 0;
 overflow: hidden;
 text-overflow: ellipsis;
 text-align: center;
}
.game .screen.empire-dashboard > .home-action-grid > .home-action-art :is(strong,small) {
 text-align: center !important;
}
#game .hud-chip-data, #game .home-planet-copy {
 flex: 1;
 text-align: center;
}

#overlay .dialog:has(.dialog-body input[type="number"]) {
 width: min(100%, 54rem);
 max-width: 100%;
}
#overlay .dialog .dialog-body { scrollbar-gutter: stable; }
#overlay .dialog:has(#flightPreview) { height: min(100%, 55rem) !important; }
#overlay .dialog:has(#flightPreview) .dialog-body { flex: 1 1 auto !important; }
#dialogFooter > #flightPreview {
 block-size: 5.75rem;
 overflow: auto;
 align-content: center;
 scrollbar-gutter: stable;
}
@media (max-width: 520px) {
 #dialogFooter > #flightPreview { block-size: 7rem; align-content: flex-start; }
}
.fleet-cargo-group {
 min-inline-size: 0;
 margin: .65rem 0;
 padding: .55rem .75rem;
 border: 1px solid #587495;
 border-radius: .55rem;
}
.fleet-cargo-group legend { padding-inline: .3rem; font-weight: 700; }
.transport-ship-step .fleet-ship-grid {
 grid-template-columns: repeat(2,minmax(0,1fr));
 gap: .35rem;
}
.transport-ship-step .stellar-ship-choice {
 display: grid;
 grid-template-columns: minmax(0,1fr) 4.5rem;
 align-items: center;
 gap: .2rem .5rem;
 padding: .3rem .45rem;
}
.transport-ship-step .stellar-ship-choice > :not(strong,small,input) { display: none; }
.transport-ship-step .stellar-ship-choice input { grid-column: 2; grid-row: 1 / span 2; min-width: 0; }
.transport-ship-step .stellar-ship-choice small { grid-column: 1; }
.transport-limits dl { display: grid; gap: .35rem; margin: 0; }
.transport-limits dl > div { display: flex; justify-content: space-between; gap: .75rem; }
.transport-limits dd { margin: 0; font-weight: 700; }
.transport-limits dl > div:last-child { border-top: 1px solid #4e6b89; padding-top: .35rem; color: #a4ecff; }
@media (max-width: 520px) {
 .transport-ship-step .fleet-ship-grid { grid-template-columns: 1fr; }
}

#overlay .dialog.population-dialog { width: min(100%, 48rem); }
#overlay .population-dialog .dialog-body { gap: .6rem; padding-block: .65rem; }
.population-dialog h3 { margin: 0 0 .35rem; font-size: 1rem; }
.population-selector { display: flex; align-items: center; gap: .6rem; margin-bottom: .45rem; }
.population-selector select { flex: 1; min-width: 0; padding-block: .35rem; }
.population-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; margin: 0; }
.population-factors .population-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.population-metrics > div { padding: .45rem .6rem; border: 1px solid #445e80; border-radius: .5rem; background: #102236; }
.population-metrics dt { font-weight: 700; font-size: .8rem; line-height: 1.15; }
.population-metrics dd { margin: .15rem 0; color: #a4ecff; font-weight: 800; font-size: 1.18rem; line-height: 1.15; }
.population-metrics small { display: block; color: #d0dcef; font-size: .72rem; line-height: 1.2; }
.population-note { color: #d0dcef; margin: 0; font-size: .78rem; line-height: 1.35; }
#overlay .population-dialog .dialog-footer { flex-wrap: wrap; }
.population-dialog [data-action="open-empire-home"] { margin-inline-end: auto; }
@media (max-width: 520px) {
 .population-metrics > div { padding: .32rem .35rem; }
 .population-metrics dt { font-size: .72rem; }
 .population-metrics dd { font-size: 1rem; }
}

#overlay .dialog.population-dialog { width: min(100%, 51rem); }
.population-dialog h3 { font-size: 1.1rem; }
.population-selector { font-size: .95rem; }
.population-selector select { font-size: .95rem; }
.population-metrics dt { font-size: .94rem; }
.population-metrics dd { font-size: 1.42rem; }
.population-metrics small { font-size: .83rem; font-weight: 500; margin-top: .2rem; }
.population-note { font-size: .88rem; }
.population-metrics > .population-illustrated {
 position: relative;
 min-height: 6rem;
 padding-inline-start: calc(clamp(3rem, 12vw, 7rem) + .7rem);
 background: linear-gradient(120deg,#18324b,#101e34);
}
.population-art {
 position: absolute;
 inset: .35rem auto .35rem .35rem;
 width: clamp(3rem, 12vw, 7rem);
 border-radius: .35rem;
 overflow: hidden;
 pointer-events: none;
}
.population-art :is(img,svg) { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 520px) {
 .population-metrics dt { font-size: .85rem; overflow-wrap: anywhere; }
 .population-metrics dd { font-size: 1.15rem; }
 .population-metrics small { font-size: .77rem; }
 .population-metrics > .population-illustrated { padding: .3rem; }
 .population-art { position: static; display: block; width: 100%; height: clamp(26px, 7dvh, 50px); margin-bottom: .3rem; }
}

@media (max-width: 760px) {
 .game .screen.empire-dashboard > .home-planetline > .home-command-hud,
 .game .screen.empire-dashboard .home-command-hud > .hud-chip {
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
 }
 .game .screen.empire-dashboard .home-command-hud > .hud-chip .hud-chip-icon {
  width: 17px !important;
  height: 17px !important;
  flex: 0 0 17px !important;
 }
 .game .screen.empire-dashboard .home-command-hud > .hud-chip .hud-chip-data {
  flex: 0 0 auto !important;
  justify-content: center !important;
 }
 .game .screen.empire-dashboard .hud-chip-data strong {
  line-height: 1.15 !important;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
 }
 .game .screen.empire-dashboard > #resourceStripInline .resource-tile > .res-data {
  inset: 13px 0 0 !important;
  justify-content: center !important;
  padding: 0 1px 1px !important;
 }
 .game .screen.empire-dashboard > #resourceStripInline .resource-tile .res-capacity {
  line-height: 1;
  font-size: 8px;
 }
 .game .screen.empire-dashboard > #resourceStripInline .resource-tile :is(.res-tile-staff,.res-tile-load) {
  font-size: 8px;
  padding-block: 0;
 }
 .game .screen.empire-dashboard > #resourceStripInline .resource-tile .res-name {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
 }
}
@media (max-width: 760px) and (max-height: 640px) {
 .game .screen.empire-dashboard > #resourceStripInline {
  height: 153px !important;
  min-height: 153px !important;
  max-height: 153px !important;
  flex-basis: 153px !important;
 }
}

/* Let the panorama absorb the height of the visible order strip. */
@media (max-width: 760px) {
 .game:has(> #operationStrip:not([hidden])) .screen.empire-dashboard > .colony-scene {
  min-height: 0 !important;
 }
 .game:has(> #operationStrip:not([hidden])) .screen.empire-dashboard {
  overflow-y: auto !important;
 }
}

/* Independent planetary tax policy, responsive in the Credits popup. */
.finance-colony-list{display:grid;gap:12px}
.finance-colony-card{min-width:0;background:linear-gradient(140deg,#10283e,#081a2b);border:1px solid #5b8cb267;border-radius:13px;padding:clamp(12px,2.5vw,18px);display:grid;gap:10px}
.finance-colony-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px}
.finance-colony-heading>div:first-child{display:grid;gap:3px}
.finance-colony-heading strong{font-size:1.04em}
.finance-colony-heading small{color:#b5cddd}
.finance-colony-revenue{font-size:clamp(14px,3.5vw,19px);font-weight:750;color:#83e5b0}
.finance-tax-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:14px}
.finance-tax-heading strong{color:#9ce7ff;font-size:17px}
.finance-tax-slider{width:100%;min-height:28px;accent-color:#62c9eb;cursor:pointer;touch-action:pan-y}
.finance-tax-scale{display:flex;justify-content:space-between;gap:6px;color:#a9bfd3;font-size:clamp(9px,2.4vw,12px)}
.finance-tax-scale span:nth-child(2){text-align:center}
.finance-tax-scale span:last-child{text-align:right}
.finance-tax-effects{border-top:1px solid #5b8cb250;padding-top:9px;display:grid;gap:4px;font-size:13px;color:#c2d8eb}
.finance-tax-effects div{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap}
.finance-tax-effects strong{color:#e5f7ff}
.finance-tax-effects small{color:#a8c5d7}
@media(max-width:430px){.finance-colony-revenue{width:100%}.finance-tax-scale{font-size:10px}}

/* Admin: compose one-time announcements; players: readable announcement window. */
.admin-announcement-compose{display:grid;gap:14px;min-width:0}
.admin-announcement-compose label{display:grid;gap:6px;font-weight:650;color:#e1f0ff}
.admin-announcement-compose input,.admin-announcement-compose textarea{
 width:100%;min-width:0;box-sizing:border-box;border:1px solid #6f99b2;border-radius:9px;
 background:#0c1d30;color:#f0f9ff;font:inherit;font-size:15px;padding:11px 12px;
}
.admin-announcement-compose textarea{resize:vertical;min-height:145px;line-height:1.55}
.admin-announcement-compose :is(input,textarea):focus-visible{
 outline:2px solid #72d4ee;outline-offset:2px
}
.admin-announcement-controls{display:flex;gap:10px;flex-wrap:wrap}
.admin-announcement-history{display:grid;gap:7px;margin-top:4px}
.admin-announcement-history .row-item{display:flex;justify-content:space-between;gap:12px;align-items:center}
.admin-announcement-history .row-item>div{display:grid;gap:4px;min-width:0}
.admin-announcement-history small{color:#b8d1e4}
.admin-announcement-player{display:grid;gap:14px;min-width:0}
.admin-announcement-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65;
 padding:clamp(14px,3vw,24px);border-radius:14px;
 border:1px solid #6ab9db80;background:linear-gradient(135deg,#102c43,#091a30);
 color:#f3f8ff;font-size:clamp(15px,2.8vw,18px);max-height:55vh;overflow-y:auto
}
#overlay .dialog:has(.admin-announcement-compose,.admin-announcement-player){width:min(100%,48rem)}

.finance-guide-heading{display:flex;justify-content:space-between;align-items:center;gap:10px}
.finance-guide-heading h3{margin:0}

.finance-refresh-status{margin:-5px 0 4px;color:#a9ccdf;font-size:12px;min-height:16px}


/* 2026-11-16: compact, consistent planet building index */
#overlay .dialog:has(.compact-build-menu) {
 width:min(100%,68rem);
 max-width:100%;
}
.compact-build-menu{gap:9px}
.compact-build-menu .build-menu-toolbar{
 display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;
 color:#b8d7eb;font-size:12px;line-height:1.4;
}
.compact-build-menu .build-menu-toolbar>button{
 min-height:31px;padding:6px 12px;white-space:nowrap;flex:none;
}
#overlay .compact-build-menu .sector-grid{
 display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px;
}
#overlay .compact-build-menu .sector{
 display:flex;flex-direction:column;justify-content:center;align-items:center;
 gap:3px;min-height:68px;padding:7px 4px;overflow:hidden;
}
#overlay .compact-build-menu .sector .si{
 display:block;margin:0;font-size:19px;line-height:1.1;
}
#overlay .compact-build-menu .sector strong{
 font-size:clamp(10px,1.25vw,13px);line-height:1.2;
}
#overlay .compact-build-menu .sector small{
 font-size:clamp(9px,1vw,11px);line-height:1.2;
}
#overlay .compact-build-menu .building-list.fixed-building-order {
 display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;
}
#overlay .compact-build-menu .fixed-building-order .building-card{
 min-width:0;min-height:0;gap:4px;padding:8px!important;
}
#overlay .compact-build-menu .fixed-building-order .stellar-building-art{
 width:100%;height:clamp(75px,11vh,112px);
}
#overlay .compact-build-menu .fixed-building-order .bname{
 font-size:clamp(12px,1.15vw,15px)!important;line-height:1.18;
}
#overlay .compact-build-menu .fixed-building-order small{
 font-size:11px!important;line-height:1.3;max-height:2.6em;
}
#overlay .compact-build-menu .fixed-building-order .level{
 font-size:10px;margin-top:auto;
}
#overlay .compact-build-menu .planned-building{
 border-style:dashed;border-color:#52748c;
 background:linear-gradient(140deg,#122739,#101e35);
}
#overlay .compact-build-menu .planned-building .stellar-building-art{
 opacity:.65;filter:saturate(.7) brightness(.82);
}
#overlay .compact-build-menu .planned-building:not(:disabled):hover .stellar-building-art{
 opacity:1;filter:none;
}
#overlay .compact-build-menu .no-free-slot{
 opacity:.57;cursor:not-allowed;
}
@media(max-width:680px){
 #overlay .compact-build-menu .sector-grid{
  grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;
 }
 #overlay .compact-build-menu .sector{
  min-height:53px;padding:5px 3px;gap:2px;
 }
 #overlay .compact-build-menu .sector .si{font-size:16px}
 #overlay .compact-build-menu .sector strong{font-size:11px}
 #overlay .compact-build-menu .sector small{font-size:9px}
 #overlay .compact-build-menu .building-list.fixed-building-order{
  grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;
 }
 #overlay .compact-build-menu .fixed-building-order .stellar-building-art{
  height:clamp(73px,12vh,98px);
 }
 .compact-build-menu .build-menu-toolbar{font-size:11px;gap:5px}
 .compact-build-menu .build-menu-toolbar>button{padding:5px 9px}
}

/* Finance: compact planet selection buttons; one editor at a time. */
.finance-planet-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.finance-planet-button{
 display:grid;gap:7px;align-content:center;min-width:0;min-height:99px;
 padding:11px 12px;border-radius:11px;border:1px solid #537b9d;
 color:#e6f2ff;background:linear-gradient(145deg,#142b43,#0d2035);
 text-align:left;cursor:pointer;transition:border-color .16s,background .16s;
}
.finance-planet-button:hover,.finance-planet-button:focus-visible{
 border-color:#78d7f0;background:linear-gradient(145deg,#1b4059,#112840);
}
.finance-planet-button.selected{
 border-color:#79e3f1;box-shadow:inset 0 -2px #71dbf4;
}
.finance-planet-title{
 display:flex;justify-content:space-between;align-items:center;gap:8px;
 font-size:clamp(14px,1.5vw,17px);font-weight:800;line-height:1.18;
}
.finance-planet-title>span{color:#80d7f2}
.finance-planet-facts{
 display:flex;flex-wrap:wrap;justify-content:space-between;gap:5px 9px;
 color:#bcd3e6;font-size:12px;
}
.finance-planet-facts strong{color:#e2f6ff}
.finance-planet-money{
 display:flex;align-items:center;min-width:0;
 font-size:clamp(13px,1.4vw,17px);font-weight:800;color:#fae09c;
}
.finance-planet-money .commodity-name{overflow-wrap:anywhere}
.finance-tax-editor{
 display:grid;gap:12px;min-width:0;padding:17px;
 border:1px solid #6ed3f298;border-radius:12px;
 background:linear-gradient(140deg,#122d43,#0c1e33);
 box-shadow:0 0 17px #146f9150;
}
.finance-tax-editor-heading{
 display:flex;justify-content:space-between;align-items:flex-start;
 flex-wrap:wrap;gap:10px;
}
.finance-tax-editor-heading>div{display:grid;gap:4px}
.finance-tax-editor-heading small{font-size:10px;font-weight:800;letter-spacing:.11em;color:#87d7eb}
.finance-tax-editor-heading h3{font-size:19px;margin:0}
.finance-tax-editor-heading span{font-size:12px;color:#bdd0e3}
.finance-tax-editor-heading>button{min-height:31px;padding:5px 10px}
.finance-tax-editor .finance-tax-effects{display:grid;gap:7px}
.finance-tax-editor .finance-tax-effects [data-tax-income]{color:#fbe1a3}
.finance-tax-editor p.section-sub{font-size:12px;margin:0}
@media(max-width:520px){
 .finance-planet-grid{grid-template-columns:minmax(0,1fr);gap:7px}
 .finance-planet-button{min-height:80px;padding:9px 11px;gap:5px}
 .finance-tax-editor{padding:12px;gap:10px}
}

/* Research: exactly two large tiles across at any available width. */
#overlay .dialog.nav-research .research-grid{
 display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;
}
#overlay .dialog.nav-research .research-grid .research-tile{
 display:grid;grid-template-columns:minmax(0,43%) minmax(0,1fr);
 align-items:stretch;gap:15px;min-width:0;min-height:155px;
 padding:11px;text-align:left;
}
#overlay .dialog.nav-research .research-grid .research-tile img{
 display:block;width:100%;height:100%;min-height:130px;max-height:200px;
 object-fit:cover;border-radius:8px;background:#101c30;
}
#overlay .dialog.nav-research .research-tile-copy{
 display:flex;flex-direction:column;justify-content:center;
 align-items:flex-start;gap:7px;min-width:0;
}
#overlay .dialog.nav-research .research-tile-copy strong{
 font-size:clamp(14px,1.25vw,20px);line-height:1.2;
}
#overlay .dialog.nav-research .research-tile-copy span{
 font-size:clamp(12px,1vw,15px);
}
#overlay .dialog.nav-research .research-tile-copy small{
 font-size:clamp(11px,.9vw,14px);margin-top:0;line-height:1.35;
}
@media(max-width:680px){
 #overlay .dialog.nav-research .research-grid{gap:7px}
 #overlay .dialog.nav-research .research-grid .research-tile{
  display:flex;flex-direction:column;gap:7px;
  min-height:0;padding:7px;
 }
 #overlay .dialog.nav-research .research-grid .research-tile img{
  width:100%;height:clamp(72px,18vw,120px);min-height:0;max-height:none;
  object-fit:cover;
 }
 #overlay .dialog.nav-research .research-tile-copy{
  gap:3px;justify-content:flex-start;flex:1 1 auto;
 }
 #overlay .dialog.nav-research .research-tile-copy strong{
  font-size:clamp(12px,3.3vw,15px);
 }
 #overlay .dialog.nav-research .research-tile-copy span,
 #overlay .dialog.nav-research .research-tile-copy small{
  font-size:clamp(10px,2.8vw,12px);
 }
}

/* Notification deep links: identifiable chat destination and highlighted friend. */
.message-item.type-chat{border-left:3px solid #79cee5}
.friend-card.notification-highlight{
 border-color:#86def0!important;
 background:linear-gradient(135deg,#173c54,#132642);
 box-shadow:0 0 0 1px #6bcce555;
}
.notification-report-details{margin-left:4px}

/* Galactic events – top HUD, admin management and live player mission. */
.operation-tab.stellar-live-event-tab{flex:1 1 10%;min-width:110px;border-color:#eab86a;color:#ffebc1;background:linear-gradient(110deg,#48372e,#22294d);box-shadow:inset 0 -2px #e7a84d70}
.stellar-live-event-tab strong{font-size:clamp(11px,2vw,14px);color:#ffdaa0}
.stellar-live-event-tab small{display:block;font-size:11px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.stellar-live-event-tab [data-event-top-remaining]{font-size:11px;color:#fff3d3}
.game-event-body,.game-event-admin{display:grid;gap:13px;min-width:0}
.game-event-body p,.game-event-admin p{line-height:1.52;margin:0}
.game-event-hero{display:flex;align-items:center;gap:14px;padding:13px;border-radius:12px;border:1px solid #75a3c178;background:linear-gradient(130deg,#1b3451,#101e36)}
.game-event-hero strong{display:block;font-size:clamp(18px,3vw,24px)}
.game-event-hero small{display:block;margin-top:5px;color:#9fd5ee;font-size:11px}
.game-event-symbol{display:grid;place-items:center;flex:none;width:64px;height:64px;border-radius:13px;color:#ffe3a6;font-size:37px;background:radial-gradient(circle at 35% 25%,#5b4f75,#19344b 75%)}
.game-event-countdown,.game-event-active-info{padding:10px 12px;border:1px solid #bf9f6870;border-radius:9px;background:#1c2c3b;color:#ffe8bd;font-size:14px;font-weight:700}
.game-event-storm{border-radius:11px;padding:15px;border:1px solid #6b92b2;background:#1a3347;color:#c8e7f4;font-weight:700}
.game-event-storm.active{background:#49301d;border-color:#edb262;color:#ffdda7;box-shadow:0 0 18px #d9844d44}
.game-event-info-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.game-event-info-grid>div{display:grid;gap:4px;text-align:center;border-radius:10px;border:1px solid #4d83ae;padding:12px 5px;background:#142c43}
.game-event-info-grid strong{font-size:17px;color:#ddf5ff}
.game-event-info-grid small{color:#a9d7e7}
.game-event-needs{display:grid;gap:10px}
.game-event-resource{padding:12px;border:1px solid #5c819c;border-radius:11px;display:grid;gap:8px;background:#11283b}
.game-event-resource>div:first-child{display:flex;gap:10px;flex-wrap:wrap;justify-content:space-between}
.game-event-resource>div:first-child small{color:#b4cada}
.game-event-progress{height:8px;border-radius:20px;background:#213a52;overflow:hidden}
.game-event-progress span{height:100%;display:block;background:linear-gradient(90deg,#29aab6,#75dfcb)}
.game-event-donate-control{display:flex;align-items:center;gap:8px}
.game-event-donate-control input{flex:1;min-width:0;max-width:200px;min-height:36px}
.game-event-reward{border:1px solid #a88f69;border-radius:10px;padding:14px;background:linear-gradient(135deg,#342d37,#16253c)}
.game-event-reward h3,.game-event-mission-title h3{margin:0 0 8px}
.game-event-mission-title{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.game-event-done{color:#a4f0b9;font-weight:700}
.game-event-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.game-event-choice{border:1px solid #658bb1;border-radius:12px;padding:16px 11px;min-height:160px;background:linear-gradient(135deg,#1c3a56,#141e35);color:#ebf8ff;text-align:left;display:grid;gap:6px;align-content:start;cursor:pointer}
.game-event-choice>span{font-size:33px;color:#ffd59a}
.game-event-choice strong{font-size:16px}
.game-event-choice small{font-size:12px;color:#b6d1df;line-height:1.45}
.game-event-choice:disabled{opacity:.55;cursor:not-allowed}
.game-event-choice:not(:disabled):hover{border-color:#93daed}
.game-event-resource-inputs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}
.game-event-resource-inputs label,.game-event-prizes label{display:grid;gap:5px;color:#d1eaf4;font-weight:700;font-size:12px;min-width:0}
.game-event-resource-inputs input,.game-event-prizes input,.game-event-prizes select{box-sizing:border-box;width:100%;min-width:0;min-height:37px;border:1px solid #607f9c;background:#102235;color:#fff;border-radius:7px;padding:6px 9px;font:inherit}
.game-event-prizes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.game-event-automatic{padding:15px;border-radius:10px;background:#19334b;color:#bde5fb}
.game-event-history{display:grid;gap:6px}
.game-event-history-row{display:flex;justify-content:space-between;gap:8px;padding:10px;border:1px solid #566d83;border-radius:9px}
.game-event-history-row span{display:grid;gap:5px}
.game-event-history-row small{color:#a9c8d9}
@media(max-width:760px){
 .operation-tab.stellar-live-event-tab{min-width:0}
 .stellar-live-event-tab small{font-size:10px}
 .game-event-choices{grid-template-columns:1fr}
 .game-event-choice{min-height:80px;grid-template-columns:40px 1fr;align-items:center;gap:4px}
 .game-event-choice>span{grid-row:span 2}
 .game-event-choice small{grid-column:2}
 .game-event-resource-inputs{grid-template-columns:repeat(2,minmax(0,1fr))}
 .game-event-prizes{grid-template-columns:1fr}
 .game-event-info-grid{gap:4px}
 .game-event-info-grid strong{font-size:13px}
 .game-event-info-grid small{font-size:10px}
 .game-event-symbol{width:48px;height:48px;font-size:28px}
}


/* Admin-only read receipts for each broadcast announcement. */
.announcement-status-summary{flex-wrap:wrap;align-items:center;gap:10px}
.announcement-status-summary>div:first-child{flex:1 1 175px}
.announcement-status-summary .announcement-status-actions{
 display:flex;flex:0 1 auto;flex-direction:column;align-items:flex-end;gap:6px}
.announcement-status-actions .soft-btn{padding:7px 10px;font-size:11px;white-space:nowrap}
.announcement-status-detail{display:grid;gap:13px}
.announcement-status-detail .admin-announcement-text{max-height:28vh}
.announcement-status-total{display:flex;align-items:center;justify-content:space-between;gap:10px}
.announcement-status-total strong{color:#d8f7ff}
.announcement-status-total span{color:#88eab9;font-weight:800}
.announcement-status-progress{height:9px;border-radius:30px;overflow:hidden;background:#223a54}
.announcement-status-progress span{display:block;height:100%;
 background:linear-gradient(90deg,#27a887,#8cdeb9);transition:width .25s}
.announcement-status-groups{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.announcement-status-groups>section{border-radius:11px;padding:12px;
 background:linear-gradient(145deg,#152c43,#121e36);border:1px solid #48728b}
.announcement-status-groups h3{margin:0 0 10px;font-size:14px}
.announcement-status-person{display:grid;gap:5px;padding:9px 0;
 border-bottom:1px solid #6f93a62e;overflow-wrap:anywhere}
.announcement-status-person:last-child{border-bottom:0}
.announcement-status-person strong{font-size:14px}
.announcement-status-person span{font-size:12px;color:#b6ccda}
.announcement-read-icon{color:#74e0ab!important;font-weight:800}
.announcement-unread-icon{color:#e4c598!important;font-weight:800}
#overlay .dialog:has(.announcement-status-detail){width:min(100%,50rem)}
@media(max-width:640px){
 .announcement-status-groups{grid-template-columns:1fr}
 .announcement-status-summary .announcement-status-actions{align-items:flex-start}
}

/* Live home-world stock and delivery actions for the alien rescue event. */
.game-event-stock {
 display:grid;
 grid-template-columns:repeat(2,minmax(0,1fr));
 gap:5px 12px;
 padding:9px 11px;
 border-radius:8px;
 border:1px solid #5b7c96;
 background:#101f34;
 font-size:12px;
 color:#c8e2ee;
}
.game-event-stock span{min-width:0;overflow-wrap:anywhere}
.game-event-stock strong{font-size:13px;font-variant-numeric:tabular-nums;color:#d5f7ff}
.game-event-stock.is-sufficient{border-color:#4b997e}
.game-event-stock.is-sufficient span:first-child strong{color:#a9f2c3}
.game-event-stock.is-short{border-color:#9b7c50}
.game-event-stock.is-short span:first-child strong{color:#ffd39a}
.game-event-stock .game-event-stock-missing{
 grid-column:1/-1;color:#ffcf9a
}
.game-event-stock .game-event-stock-missing strong{color:inherit}
.game-event-stock-note{color:#dbbc98;font-size:12px;margin:0}
.game-event-donate-control{display:flex;gap:8px;flex-wrap:wrap}
.game-event-donate-control input{min-width:85px;max-width:195px;flex:1 1 100px}
.game-event-donate-control button{white-space:nowrap}
.game-event-donate-control button:disabled,.game-event-donate-control input:disabled{
 opacity:.47;cursor:not-allowed
}
@media(max-width:560px){
 .game-event-stock{grid-template-columns:1fr;font-size:11px}
 .game-event-stock .game-event-stock-missing{grid-column:1}
 .game-event-donate-control{gap:6px}
 .game-event-donate-control button{padding:8px 11px}
}


/* v094 · Optional PayPal support button in the original sidebar online strip. */
.game .sidebar-bottom .sidebar-status-text{
 display:grid;gap:2px;min-width:0;flex:1 1 auto;
}
.game .sidebar-bottom .sidebar-status-text strong{
 white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.game .sidebar-bottom .sidebar-status-text small{
 white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.game .sidebar-bottom .stellar-donate-trigger{
 flex:0 0 auto;margin-left:auto;min-width:64px;
 display:flex;flex-direction:column;justify-content:center;align-items:center;
 gap:1px;padding:5px 8px;min-height:37px;
 border-radius:9px;border:1px solid #d38bc0;
 background:linear-gradient(135deg,#55324b,#312b5b 75%,#243b59);
 box-shadow:inset 0 0 10px #e69dca22,0 0 13px #e498d122;
 color:#ffe2f5;cursor:pointer;line-height:1;
 transition:background .16s,border-color .16s,box-shadow .16s;
}
.game .sidebar-bottom .stellar-donate-trigger>span{
 font-size:15px;line-height:1;color:#ffb8de;
}
.game .sidebar-bottom .stellar-donate-trigger small{
 display:block;font-size:9px;font-weight:800;letter-spacing:.02em;
 color:#fff0fa;
}
.game .sidebar-bottom .stellar-donate-trigger:hover,
.game .sidebar-bottom .stellar-donate-trigger:focus-visible{
 background:linear-gradient(130deg,#78405f,#423672);
 border-color:#ffd5eb;box-shadow:0 0 16px #ed9acb55;
}
.stellar-support-modal{
 display:grid;gap:14px;max-width:600px;margin:0 auto;
 text-align:center;padding:4px 3px 10px;
}
.stellar-support-banner{
 height:116px;position:relative;overflow:hidden;
 display:flex;align-items:center;justify-content:center;
 border-radius:15px;border:1px solid #ab87ba77;
 background:radial-gradient(ellipse at 50% 40%,#753966b8,#232f58 65%,#102039);
 box-shadow:inset 0 0 22px #96afd51c;
}
.stellar-support-banner span:first-child{
 font-size:68px;color:#ffb8dd;text-shadow:0 0 25px #ea75be77;
}
.stellar-support-banner span:nth-child(2){position:absolute;left:19%;top:20%;font-size:23px;color:#bcb2ff}
.stellar-support-banner span:nth-child(3){position:absolute;right:18%;bottom:17%;font-size:25px;color:#9bdcf3}
.stellar-support-modal h3{font-size:clamp(18px,2.5vw,24px);line-height:1.2;margin:0}
.stellar-support-modal p{margin:0;line-height:1.6;color:#d4e8f4}
.stellar-support-modal .stellar-support-fairness{
 padding:12px 14px;
 border-radius:10px;border:1px solid #63a6b678;
 background:#18394c88;font-size:13px;
}
.stellar-support-paypal{
 display:flex;justify-content:center;align-items:center;gap:12px;
 padding:15px 18px;min-height:48px;box-sizing:border-box;
 border:1px solid #f1badd;border-radius:11px;
 background:linear-gradient(120deg,#7b4577,#603b80,#355380);
 color:#fff!important;font-weight:900;letter-spacing:.045em;
 text-decoration:none!important;
 box-shadow:0 0 19px #c17acb33;
}
.stellar-support-paypal:hover,.stellar-support-paypal:focus-visible{
 filter:brightness(1.15);box-shadow:0 0 25px #dba8fa66
}
.stellar-support-paypal>span:first-child{font-size:23px;color:#ffd0e5}
.stellar-support-note{display:block;font-size:11px;color:#a7c4d7;line-height:1.45}
@media(max-width:760px){
 .game .sidebar-bottom .stellar-donate-trigger{min-width:56px;padding:4px 6px}
 .stellar-support-banner{height:88px}
 .stellar-support-banner span:first-child{font-size:52px}
 .stellar-support-modal{gap:11px}
}
@media(prefers-reduced-motion:reduce){
 .game .sidebar-bottom .stellar-donate-trigger{transition:none}
}

/* v095 – application-only alliance membership, desktop and mobile. */
.alliance-apply-hub{
 display:grid;
 grid-template-columns:repeat(2,minmax(0,1fr));
 align-items:start;
 gap:12px;
}
.alliance-application-card,
.alliance-browse-card,
.alliance-own-application{
 padding:13px;
 border:1px solid #648cb2;
 border-radius:11px;
 background:linear-gradient(125deg,#152d45,#111b33);
}
.alliance-applications-list{display:grid;gap:10px;margin-top:16px}
.alliance-applications-list>h3{margin:0;color:#d7f6ff}
.alliance-application-card{display:grid;gap:9px}
.alliance-application-head{
 display:flex;align-items:center;flex-wrap:wrap;justify-content:space-between;gap:7px;
}
.alliance-application-head strong{color:#fff;font-size:16px}
.alliance-application-head small{color:#abcadd;font-size:11px}
.alliance-application-card p{
 margin:2px 0;padding:10px;border-radius:7px;
 background:#0c2034;color:#d0e8f3;white-space:pre-wrap;overflow-wrap:anywhere;
}
.alliance-application-card .actions{display:flex;gap:8px;flex-wrap:wrap}
.alliance-own-application{display:grid;gap:9px;border-color:#c0a76c}
.alliance-own-application h3{margin:0}
.alliance-browse-card{
 display:flex;gap:12px;align-items:center;justify-content:space-between;margin-bottom:9px;
}
.alliance-browse-card>div{display:grid;gap:5px;min-width:0}
.alliance-browse-card strong{color:#e4faff;font-size:16px;overflow-wrap:anywhere}
.alliance-browse-card small{color:#accede;font-size:11px}
.alliance-browse-card .primary{flex:0 0 auto}
.alliance-apply-form{display:grid;gap:13px}
.alliance-apply-form p{line-height:1.6}
.alliance-apply-form label{display:grid;gap:8px}
.alliance-apply-form textarea{
 width:100%;box-sizing:border-box;min-height:120px;
 background:#101f35;border:1px solid #6c96ac;
 border-radius:9px;color:#f3f9ff;
 padding:11px;font:inherit;resize:vertical;
}
@media(max-width:760px){
 .alliance-apply-hub{grid-template-columns:1fr}
 .alliance-browse-card{align-items:flex-start;flex-wrap:wrap}
 .alliance-browse-card .primary{width:100%}
}

/* v096: conspicuous alliance leave button; not linked to any immediate action
   until the player confirms the correct consequence in a second dialog. */
.alliance-quick-exit,
.alliance-management-exit{
 display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;
 padding:12px 14px;margin-top:14px;
 background:linear-gradient(120deg,#172a43,#2b233e);
 border:1px solid #8b6589;border-radius:12px;
}
.alliance-quick-exit>div,
.alliance-management-exit>div{display:grid;gap:4px;min-width:0;flex:1}
.alliance-quick-exit strong,
.alliance-management-exit strong{font-size:14px;color:#f2e7fc;overflow-wrap:anywhere}
.alliance-quick-exit small,
.alliance-management-exit small{font-size:11px;line-height:1.4;color:#c7c0d8}
.alliance-quick-exit .danger-btn,
.alliance-management-exit .danger-btn{
 flex:0 0 auto;min-height:42px;min-width:156px;
 font-weight:850;letter-spacing:.04em;border:1px solid #d59aaa;
 border-radius:9px;box-shadow:0 0 12px #9e536522
}
.alliance-management-exit{margin:9px 0 13px}
.alliance-leave-confirm{display:grid;gap:12px}
.alliance-leave-confirm>strong{font-size:18px;color:#e9dfff}
.alliance-leave-confirm p{line-height:1.65;margin:0}
.alliance-leave-confirm p strong{color:#ffcebc}
@media(max-width:760px){
 .alliance-quick-exit .danger-btn,
 .alliance-management-exit .danger-btn{width:100%}
}

/* v102 · Wide, readable construction dialogs, desktop and mobile. */
#overlay .dialog:has(.building-construction) {
 width:min(100%,72rem)!important;
 max-width:100%!important;
}
#overlay .building-construction {
 display:grid;
 grid-template-columns:minmax(0,1fr)!important;
 gap:clamp(10px,1.5vw,18px);
 width:100%;
 min-width:0;
}
#overlay .building-construction-intro {
 display:grid;
 grid-template-columns:minmax(110px,200px) minmax(0,1fr);
 align-items:center;
 gap:clamp(10px,1.6vw,20px);
 padding:10px;
 border:1px solid #40688488;
 border-radius:12px;
 background:linear-gradient(110deg,#102a42aa,#121d34aa);
 min-width:0;
}
#overlay .building-construction-summary {
 display:grid;align-content:center;gap:7px;min-width:0;
}
#overlay .building-construction-summary :is(h3,p) {margin:0}
#overlay .building-construction-summary h3 {
 font-size:clamp(16px,2vw,23px);overflow-wrap:break-word;
}
#overlay .building-construction-intro .stellar-modal-art {
 width:100%;max-width:200px;min-width:0;overflow:hidden;
}
#overlay .building-construction-intro .stellar-modal-art :is(.stellar-picture,img) {
 display:block;width:100%;height:clamp(90px,14vh,135px)!important;
 max-height:135px;object-fit:contain;aspect-ratio:16/9;
}
#overlay .building-construction-main {
 display:grid;gap:12px;min-width:0;width:100%;
}
#overlay .building-construction-main>h3 {margin:5px 0 0}
#overlay .building-construction .build-readiness,
#overlay .building-construction .build-readiness table {min-width:0;width:100%}
#overlay .building-construction :is(.upgrade-table,.build-readiness table) {
 table-layout:fixed;width:100%;
 font-size:clamp(12px,1vw,14px);
 font-variant-numeric:tabular-nums;
}
#overlay .building-construction :is(.upgrade-table,.build-readiness table) th:first-child {
 width:43%;text-align:left;
}
#overlay .building-construction :is(.upgrade-table,.build-readiness table) :is(th,td) {
 padding:10px 8px;vertical-align:middle;
 overflow-wrap:normal;
}
#overlay .building-construction :is(.upgrade-table,.build-readiness table) td {
 white-space:nowrap;text-align:right;
}
#overlay .building-construction .upgrade-table th[scope="row"] {
 font-weight:650;max-width:none;overflow-wrap:break-word;
}
#overlay .building-construction .upgrade-table th[scope="col"] {white-space:nowrap}
#overlay .building-construction .build-readiness li {
 line-height:1.5;
}
@media(max-width:670px) {
 #overlay .dialog:has(.building-construction) {width:100%!important}
 #overlay .building-construction-intro {
  grid-template-columns:minmax(72px,100px) minmax(0,1fr);
  padding:8px;gap:10px;
 }
 #overlay .building-construction-intro .stellar-modal-art :is(.stellar-picture,img) {
  height:82px!important;max-height:82px;
 }
 #overlay .building-construction-summary h3 {font-size:16px}
 #overlay .building-construction-summary .section-sub {font-size:11px;line-height:1.3}
 #overlay .building-construction :is(.upgrade-table,.build-readiness table) {
  width:100%;display:block;table-layout:auto;
 }
 #overlay .building-construction :is(.upgrade-table,.build-readiness table) thead {display:none}
 #overlay .building-construction :is(.upgrade-table,.build-readiness table) tbody {
  display:grid;gap:9px;width:100%;
 }
 #overlay .building-construction :is(.upgrade-table,.build-readiness table) tr {
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  gap:4px 6px;
  padding:10px 9px;
  border:1px solid #5c779566;
  border-radius:9px;
  background:#15263c;
 }
 #overlay .building-construction :is(.upgrade-table,.build-readiness table) th[scope="row"] {
  display:block;grid-column:1/-1;width:100%;max-width:none;
  padding:0 0 7px;border-bottom:1px solid #5c779566;
  white-space:normal;overflow-wrap:break-word;
 }
 #overlay .building-construction :is(.upgrade-table,.build-readiness table) td {
  display:block;min-width:0;padding:4px 2px 0;
  border:0;text-align:left;
  white-space:normal;overflow-wrap:anywhere;
  font-size:clamp(11px,2.8vw,13px);
 }
 #overlay .building-construction :is(.upgrade-table,.build-readiness table) td::before {
  display:block;content:attr(data-label);
  font-weight:700;font-size:11px;line-height:1.3;
  color:#acc8df;margin-bottom:4px;
 }
 #overlay .building-construction-main>.grid2 {grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:365px) {
 #overlay .building-construction-intro {grid-template-columns:1fr}
 #overlay .building-construction-intro .stellar-modal-art {display:none}
}

/* v103 - commander presence and responsive friend/spy records. */
.rank-player-identity{display:flex;align-items:center;gap:13px;min-width:0}
.rank-player-presence{display:flex;align-items:center;gap:7px}
.rank-status-dot{flex:none;display:inline-block;width:10px;height:10px;border-radius:50%;vertical-align:middle}
.rank-status-dot.is-online{background:#2aefa5;box-shadow:0 0 0 2px #2aefa52b,0 0 11px #36eeac88}
.rank-status-dot.is-offline{background:#fc5e69;box-shadow:0 0 0 2px #fc5e6928,0 0 9px #fc5e695c}
.rank-status-dot.is-ai{background:#8293a6;box-shadow:0 0 0 2px #8293a62e}
.rank-player-row{gap:12px}
.friend-colonies{margin:12px 0 0;padding:11px;border:1px solid #59769877;border-radius:10px;background:#111f35}
.friend-colonies>strong{display:block;color:#a4ebf7;margin-bottom:8px}
.friend-colony-row{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0;
 padding:9px 0;border-bottom:1px solid #5f819842}
.friend-colony-row>div{min-width:0}
.friend-colony-row :is(b,small){display:block;overflow-wrap:anywhere}
.friend-colony-row small{color:#b8d1e8;margin-top:2px}
.friend-colony-row button{flex:none}
.friend-colonies .actions{margin-top:10px}
.spy-archive{display:grid;gap:9px;min-width:0}
.spy-archive-card{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px;
 border-radius:10px;border:1px solid #56799582;background:linear-gradient(100deg,#172b44,#18213d)}
.spy-archive-card>div{min-width:0}
.spy-archive-card :is(strong,small){display:block;overflow-wrap:anywhere}
.spy-archive-card small{color:#a9c8dc;margin-top:4px}
.spy-archive-card button{flex:none}
@media(max-width:550px){
 .friend-colony-row,.spy-archive-card{align-items:flex-start}
 .friend-colony-row button,.spy-archive-card button{white-space:normal;max-width:42%}
 .rank-player-row{align-items:flex-start}
}

/* v104 · Compact diplomacy directory and full-size player detail popup. */
#overlay .friend-player-directory{display:grid;gap:15px;min-width:0}
#overlay .friend-player-group{display:grid;gap:9px;min-width:0}
#overlay .friend-player-group h3{margin:0;padding:0 2px;color:#b9d9ec;font-size:clamp(13px,1.5vw,16px)}
#overlay .friend-player-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,265px),1fr));gap:10px}
#overlay .friend-player-entry{
 display:flex;align-items:center;text-align:left;gap:12px;min-width:0;width:100%;
 padding:14px 15px;border:1px solid #547b9e;border-radius:12px;
 color:#e9f7ff;background:linear-gradient(115deg,#1b3655,#15243e);
 cursor:pointer;transition:border-color .16s,background-color .16s,transform .16s;
}
#overlay .friend-player-entry:hover,#overlay .friend-player-entry:focus-visible{
 border-color:#a0e6fa;background:linear-gradient(115deg,#244f6d,#1c3451);
 transform:translateY(-1px);outline:2px solid #8bdbfa44;outline-offset:1px;
}
#overlay .friend-player-entry.notification-highlight{box-shadow:0 0 0 2px #7ed9e855}
#overlay .friend-player-entry-icon{
 display:grid;place-items:center;flex:none;width:34px;height:34px;
 border:1px solid #6ab8d0;border-radius:11px;
 color:#92e9fd;background:#0e2d45;font-size:20px;
}
#overlay .friend-player-entry-copy{display:grid;gap:4px;flex:1;min-width:0}
#overlay .friend-player-entry-copy strong{font-size:clamp(14px,1.6vw,17px);overflow-wrap:anywhere;line-height:1.3}
#overlay .friend-player-entry-copy small{color:#b0c9e2;font-size:12px;line-height:1.4}
#overlay .friend-player-entry-arrow{font-size:27px;color:#92cfe4;flex:none;line-height:1}
#overlay .friend-player-profile{display:grid;gap:15px;min-width:0;max-width:100%}
#overlay .friend-profile-header{
 display:flex;align-items:center;gap:14px;padding:15px;border:1px solid #6f95b3;
 border-radius:12px;background:linear-gradient(110deg,#213e5b,#171f3d);
}
#overlay .friend-profile-avatar{
 display:grid;place-items:center;width:54px;height:54px;flex:none;
 border-radius:14px;background:#12374e;border:1px solid #68b6d3;
 color:#95ebff;font-size:29px;
}
#overlay .friend-profile-header>div{display:grid;justify-items:start;gap:6px;min-width:0}
#overlay .friend-profile-header strong{font-size:clamp(18px,2.5vw,25px);overflow-wrap:anywhere}
#overlay .friend-profile-header small{color:#bad2e4;font-size:12px}
#overlay .friend-profile-header .pill{margin-top:2px}
#overlay .friend-profile-stats{
 display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;
}
#overlay .friend-profile-stat{display:grid;gap:7px;min-width:0;border-radius:10px;
 border:1px solid #536f8b;background:#15263d;padding:12px 14px}
#overlay .friend-profile-stat small{color:#b6d2e4;font-size:12px}
#overlay .friend-profile-stat strong{font-size:clamp(14px,1.8vw,18px);overflow-wrap:anywhere}
#overlay .friend-profile-section{min-width:0;display:grid;gap:12px;padding:15px;
 border-radius:12px;border:1px solid #4d708f;background:#101f35}
#overlay .friend-profile-section h3{margin:0;font-size:19px}
#overlay .friend-profile-section p{margin:0;line-height:1.55}
#overlay .friend-profile-section>.actions{display:flex;gap:10px;flex-wrap:wrap}
#overlay .friend-profile-planets{display:grid;gap:8px;min-width:0}
#overlay .friend-profile-planets .friend-colony-row{
 display:flex;align-items:center;justify-content:space-between;gap:12px;
 border:1px solid #406381;border-radius:10px;padding:13px;
 background:#172e46;
}
#overlay .friend-profile-planets .friend-colony-row b{font-size:15px}
#overlay .friend-profile-planets .friend-colony-row small{font-size:12px}
#overlay .friend-profile-planets .friend-colony-row button{white-space:nowrap}
#overlay .friend-player-profile .actions{margin-top:4px}
@media (max-width:550px){
 #overlay .friend-player-list{grid-template-columns:minmax(0,1fr)}
 #overlay .friend-player-entry{padding:12px}
 #overlay .friend-profile-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
 #overlay .friend-profile-stat{padding:10px}
 #overlay .friend-profile-section{padding:12px}
 #overlay .friend-profile-planets .friend-colony-row{align-items:flex-start;flex-direction:column}
 #overlay .friend-profile-planets .friend-colony-row button{max-width:100%;white-space:normal}
}
@media (max-width:340px){
 #overlay .friend-profile-stats{grid-template-columns:minmax(0,1fr)}
}

/* v105: When a commander was last seen. Compact on desktop and mobile. */
#overlay .rank-player-last-online,
#overlay .friend-player-last-online{
 display:block;margin-top:3px;color:#adcae0;font-size:clamp(10px,1.1vw,12px);
 font-weight:400;line-height:1.4;overflow-wrap:anywhere
}
#overlay .friend-player-last-online{margin-top:0}
#overlay .rank-player-identity>div{min-width:0}
#overlay .friend-profile-stat{min-width:0}
@media(max-width:550px){
 #overlay .rank-player-last-online,
 #overlay .friend-player-last-online{font-size:11px}
}

/* v106 - Multiple resource loads on one transport fleet. */
#overlay .dialog:has(.transport-manifest){width:min(100%,58rem)!important;max-width:100%!important}
#overlay .transport-manifest{display:grid;gap:14px;min-width:0}
#overlay .transport-manifest>.section-sub{margin:0;line-height:1.5}
#overlay .transport-cargo-list{display:grid;gap:10px;min-width:0}
#overlay .transport-cargo-row{
 display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,.8fr) auto;
 align-items:end;gap:9px 12px;min-width:0;
 padding:13px;border:1px solid #477597;border-radius:11px;
 background:linear-gradient(112deg,#193651,#1b2443);
}
#overlay .transport-cargo-row label{min-width:0;margin:0;font-size:13px;display:grid;gap:6px}
#overlay .transport-cargo-row :is(select,input){
 min-width:0;width:100%;height:43px;box-sizing:border-box
}
#overlay .transport-cargo-row .transport-cargo-remove{
 min-width:94px;min-height:43px;white-space:normal
}
#overlay .transport-cargo-row-note{
 grid-column:1/-1;font-size:12px;color:#b4d3e6;
 overflow-wrap:anywhere;line-height:1.35
}
#overlay .transport-cargo-toolbar{
 display:flex;align-items:center;gap:12px;flex-wrap:wrap;min-width:0
}
#overlay .transport-cargo-toolbar .section-sub{margin:0}
#overlay .transport-multi-limits{
 padding:14px;border:1px solid #537898;border-radius:10px;
 background:#112b3e;min-width:0
}
#overlay .transport-multi-limits dl{gap:9px}
#overlay .transport-multi-limits dl>div{
 display:flex;gap:14px;align-items:baseline;justify-content:space-between;
 min-width:0;line-height:1.3
}
#overlay .transport-multi-limits dt{overflow-wrap:anywhere}
#overlay .transport-multi-limits dd{white-space:nowrap}
#overlay .transport-multi-limits dl>div:last-child{
 color:#a6ebf5;border-top:1px solid #527b91;padding-top:9px
}
#overlay .transport-cargo-fill-track{
 height:13px;width:100%;overflow:hidden;border:1px solid #568ab1;
 border-radius:100px;background:#071929;margin-top:14px
}
#overlay .transport-cargo-fill-track span{
 display:block;height:100%;border-radius:100px;
 background:linear-gradient(90deg,#18b5dd,#9ee8ef,#b8a0fa);
 transition:width .18s
}
#overlay .transport-multi-limits .section-sub{margin:9px 0 0;font-size:12px;line-height:1.4}
#overlay .transport-cargo-errors{display:grid;gap:5px;color:#ffb4bc;font-size:13px;line-height:1.4}
#overlay .transport-cargo-errors:empty{display:none}
#overlay .transport-cargo-errors p{margin:0}
#overlay .transport-cargo-row .is-invalid{
 border:2px solid #ff667c!important;box-shadow:0 0 0 2px #ff506c2b
}
#overlay .fleet-cargo-capacity{
 margin-top:12px;padding:12px 14px;border:1px solid #5495b2;
 border-radius:11px;background:linear-gradient(110deg,#11334c,#1b2544)
}
#overlay .fleet-cargo-capacity[hidden]{display:none!important}
#overlay .fleet-cargo-capacity>strong{
 display:block;color:#b3f0ff;font-size:clamp(14px,1.5vw,18px);margin-bottom:10px
}
#overlay .fleet-cargo-capacity-grid{
 display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 12px
}
#overlay .fleet-cargo-capacity-grid>span{
 display:flex;justify-content:space-between;align-items:center;gap:6px;
 border:1px solid #527c9865;background:#10283d;padding:8px 10px;
 border-radius:8px;font-size:13px
}
#overlay .fleet-cargo-capacity-grid b{white-space:nowrap;color:#d4f7ff;font-variant-numeric:tabular-nums}
#overlay .fleet-cargo-capacity>small{display:block;color:#b9d3e8;margin-top:9px;font-size:12px}
#overlay .transport-confirm-cargo,
#overlay .transport-confirm-capacity{display:grid;gap:8px;min-width:0}
#overlay .transport-confirm-cargo>div,
#overlay .transport-confirm-capacity>div{
 display:flex;justify-content:space-between;align-items:baseline;
 gap:12px;border-bottom:1px solid #6686a557;padding:7px 5px
}
#overlay .transport-confirm-cargo strong,
#overlay .transport-confirm-capacity dd{
 margin:0;white-space:nowrap;font-weight:750;color:#bcefff
}
#overlay .transport-confirm-capacity dt{font-size:13px}
@media(max-width:580px){
 #overlay .transport-cargo-row{
  grid-template-columns:minmax(0,1.25fr) minmax(0,.75fr);
  padding:10px;gap:8px
 }
 #overlay .transport-cargo-row .transport-cargo-remove{
  grid-column:1/-1;min-height:34px;width:100%;font-size:12px
 }
 #overlay .transport-cargo-row-note{grid-column:1/-1;font-size:11px}
 #overlay .fleet-cargo-capacity-grid{grid-template-columns:minmax(0,1fr)}
 #overlay .transport-cargo-toolbar{justify-content:center}
}
@media(max-width:360px){
 #overlay .transport-cargo-row{grid-template-columns:minmax(0,1fr)}
 #overlay .transport-cargo-row label{grid-column:1}
}
