* { box-sizing: border-box; }
html, body {
	margin: 0;
	height: 100%;
	font-family: Segoe UI, Tahoma, sans-serif;
	background: #0b1020;
	color: #e8eef8;
}
h1, h2, h3 { margin: 0.4em 0; }
button, input, select {
	font: inherit;
	background: #1c2744;
	color: inherit;
	border: 1px solid #3a4d7a;
	padding: 0.25em 0.5em;
}
button:hover { background: #2a3b66; }
button:disabled { opacity: 0.45; }
.muted { color: #9aa7c2; font-size: 0.9em; }
.sub { color: #9aa7c2; }

#screen-generation {
	max-width: 48em;
	margin: 2em auto;
	padding: 1em;
}
#generation-form {
	display: flex;
	flex-direction: column;
	gap: 0.7em;
}
#generation-form label { display: flex; flex-direction: column; gap: 0.2em; }
#generation-form label.check { flex-direction: row; align-items: center; gap: 0.5em; }
#generation-form fieldset {
	border: 1px solid #3a4d7a;
	padding: 0.6em 0.75em 0.8em;
	margin: 0;
	min-width: 0;
}
#gen-saves {
	margin-top: 1.5em;
	padding-top: 1em;
	border-top: 1px solid #3a4d7a;
	display: flex;
	flex-direction: column;
	gap: 0.6em;
}
.save-continue {
	margin: 0;
}
.save-continue h3 {
	margin: 0 0 0.35em;
	font-size: 1em;
}
#gen-continue-list,
#menu-continue-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
#gen-save-list {
	list-style: none;
	padding: 0;
	margin: 0;
}
.gen-save-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em;
	align-items: center;
	margin: 0.35em 0;
}
.gen-save-row span { flex: 1; min-width: 12em; }
#chrome-save-status { font-size: 0.85em; margin: 0.5em 0 0; }
#menu-actions {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.45em;
}
#panel-load h2 { margin-top: 0.5em; }
#menu-load-list {
	list-style: none;
	padding: 0;
	margin: 0.5em 0 0;
}
#menu-continue { margin-bottom: 0.5em; }
#chrome-play-as-wrap {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.35em;
	font-size: 0.9em;
	color: #9aa7c2;
}
#chrome-play-as { max-width: none; width: 100%; }
#gen-opponents { list-style: none; padding: 0; margin: 0; }
.gen-opp {
	display: flex;
	flex-direction: column;
	gap: 0.5em;
	margin: 0.5em 0;
	padding: 0.55em 0.6em 0.7em;
	border: 1px solid #2a3b66;
	background: #10182e;
}
.gen-opp-head {
	display: flex;
	gap: 0.5em;
	align-items: center;
	flex-wrap: wrap;
}
.gen-opp-art, .gen-culture-grid img, .gen-blurb-art, .settle-culture-art, .garrison-art, .pop-token-art, .troop-badge-art, .combat-side-art {
	display: block;
	object-fit: contain;
	background: #050814;
}
.gen-opp-art { width: 36px; height: 36px; flex: 0 0 36px; }
.gen-culture-grid {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 0.35em;
}
.gen-culture-grid button {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.15em;
	padding: 0.25em;
	font-size: 0.72em;
	line-height: 1.15;
}
.gen-culture-grid img, .gen-random-mark {
	width: 48px;
	height: 48px;
}
.gen-random-mark {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.55em;
	font-weight: 700;
	background: #050814;
	color: #6ea8fe;
}
.gen-culture-grid button.is-selected { outline: 2px solid #6ea8fe; outline-offset: 1px; }
.gen-culture-blurb {
	display: flex;
	gap: 0.75em;
	align-items: flex-start;
	padding: 0.65em 0.75em;
	border: 1px solid #3a4d7a;
	background: #121a33;
}
.gen-blurb-art { width: 72px; height: 72px; flex: 0 0 72px; }
.gen-culture-blurb h3 { margin: 0 0 0.25em; }
.gen-culture-blurb p { margin: 0; }
.gen-blurb-bonuses {
	margin: 0.35em 0 0;
	padding-left: 1.15em;
}
.gen-blurb-bonuses li { margin: 0.15em 0; }
.settle-culture-art { width: 64px; height: 64px; border: 1px solid #3a4d7a; flex: 0 0 64px; }
.garrison-art, .troop-badge-art { width: 22px; height: 22px; }
.troop-badge-row, .troop-badge-row.garrison-btn-inner {
	display: flex;
	align-items: center;
	gap: 0.4em;
	min-width: 0;
}
.troop-badge-name { font-size: 0.9em; }
.troop-badge-count {
	font-variant-numeric: tabular-nums;
	color: #c5d4e0;
}
.troop-wildlife-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 1px solid rgba(196, 92, 42, 0.55);
	background: rgba(196, 92, 42, 0.12);
	overflow: hidden;
	flex: 0 0 22px;
}
.combat-location-line {
	margin: 0.15em 0 0.35em;
	display: flex;
	flex-wrap: wrap;
	gap: 0.65em 1em;
	align-items: center;
}
.combat-location-link {
	background: none;
	border: none;
	padding: 0;
	color: #9ec5ff;
	cursor: pointer;
	text-decoration: underline dotted;
	font: inherit;
}
.combat-location-link:hover { color: #fff; }

#screen-play { height: 100%; display: flex; flex-direction: column; }
#screen-play[hidden], [hidden] { display: none !important; }

#chrome {
	display: flex;
	justify-content: space-between;
	gap: 1em;
	padding: 0.4em 0.8em;
	background: #121a33;
	border-bottom: 1px solid #3a4d7a;
	flex-wrap: wrap;
}
#chrome-left, #chrome-right { display: flex; gap: 0.8em; align-items: center; flex-wrap: wrap; }

#play-layout { flex: 1; display: flex; min-height: 0; min-width: 0; }
#main-stage { flex: 1; min-width: 0; min-height: 0; position: relative; display: flex; }
#map-canvas {
	flex: 1;
	min-width: 0;
	width: 100%;
	background: #070b16;
	cursor: grab;
	touch-action: none;
}
.chrome-link { cursor: pointer; text-decoration: underline dotted; }
.chrome-link:hover { color: #fff; }
#stage-settlement, #stage-build, #stage-research, #stage-empire, #stage-spies, #stage-diplomacy, #stage-empire-report, #stage-combat, #stage-revolt, #stage-space-combat, #stage-design, #stage-report, #stage-guide {
	flex: 1;
	overflow: auto;
	padding: 0.8em 1em;
	background: #0b1020;
}
#settle-head, #build-head, #research-head, #empire-head, #spies-head, #diplo-head, #combat-head, #revolt-head, #report-head, #guide-head { display: flex; gap: 1em; align-items: flex-start; }
.guide-toc {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6em 1em;
	margin: 0.6em 0 1em;
}
.guide-toc a {
	color: #9ec1ff;
	text-decoration: none;
	font-size: 0.92em;
}
.guide-toc a:hover { text-decoration: underline; }
.guide-section { margin: 0 0 1.4em; }
.guide-section h3 { margin: 0 0 0.5em; }
.guide-upgrade-block { margin: 0.9em 0 1.2em; }
.guide-upgrade-title { margin: 0 0 0.4em; font-size: 1em; color: #c5d4f0; }
.guide-table-wrap {
	overflow-x: auto;
	border: 1px solid #2a3a5c;
	border-radius: 4px;
}
.guide-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9em;
}
.guide-table th,
.guide-table td {
	padding: 0.4em 0.55em;
	border-bottom: 1px solid #1c2740;
	text-align: left;
	vertical-align: middle;
}
.guide-table th {
	background: #121a2e;
	color: #9aa7c2;
	font-weight: 600;
	white-space: nowrap;
}
.guide-table tbody tr:nth-child(even) { background: #0e1526; }
.guide-table tbody tr:hover { background: #162038; }
.guide-species-art {
	width: 48px;
	height: 48px;
	object-fit: contain;
	display: block;
	border: 1px solid #3a4d7a;
	background: #070b16;
}
.guide-ship-icon {
	display: block;
	width: 36px;
	height: 28px;
}
.guide-troop-badge { gap: 0.2em; }
.guide-cell-blurb,
.guide-cell-bonuses,
.guide-cell-notes,
.guide-cell-summary,
.guide-cell-stats {
	max-width: 28em;
	line-height: 1.35;
	color: #b7c3da;
}
.guide-cell-name { font-weight: 600; white-space: nowrap; }
.guide-kind-badge {
	display: inline-block;
	padding: 0.1em 0.45em;
	border: 1px solid #3a4d7a;
	border-radius: 3px;
	font-size: 0.8em;
	color: #d7e2f7;
	background: #152038;
	white-space: nowrap;
}
.guide-kind-beam { border-color: #6ea8fe; color: #9ec1ff; }
.guide-kind-missileLauncher,
.guide-kind-missileAmmo,
.guide-kind-missile { border-color: #e09a5a; color: #f0c29a; }
.guide-kind-shield { border-color: #6ec8c0; color: #9ee6de; }
.guide-kind-fighter { border-color: #a78bfa; color: #c4b5fd; }
.guide-kind-device { border-color: #8fa3c8; color: #c5d4f0; }
#settle-head > div:nth-child(2) { flex: 1; min-width: 12em; }
#btn-settle-get-settlers { margin-top: 0.15em; }
#settle-planet-wrap {
	flex: 0 0 160px;
	width: 160px;
	height: 160px;
}
#settle-planet {
	display: block;
	width: 160px;
	height: 160px;
	background: #050814;
	border: 1px solid #3a4d7a;
}
#combat-head { align-items: stretch; }
.combat-hero {
	display: flex;
	gap: 1em;
	align-items: center;
	flex: 1;
	min-width: 0;
}
.combat-hero-copy { flex: 1; min-width: 0; }
.combat-result-icon {
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	border: 2px solid transparent;
}
.combat-result-icon.is-victory {
	color: #7fd97f;
	border-color: #3f8f4a;
	background: rgba(63, 143, 74, 0.18);
}
.combat-result-icon.is-defeat {
	color: #ff8a7a;
	border-color: #a94438;
	background: rgba(169, 68, 56, 0.18);
}
.combat-emblem {
	flex: 0 0 auto;
	color: #d4b45a;
	filter: drop-shadow(0 0 8px rgba(212, 180, 90, 0.35));
}
.combat-battlefield {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1em;
	margin: 1em 0;
	align-items: stretch;
}
.combat-col {
	display: grid;
	grid-template-rows: auto 1fr auto;
	min-height: 18em;
	border: 1px solid #2a3558;
	border-radius: 8px;
	overflow: hidden;
	background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.12));
}
.combat-banner {
	display: flex;
	gap: 0.75em;
	align-items: center;
	padding: 0.7em 0.85em;
	border-bottom: 1px solid rgba(255,255,255,0.08);
}
.combat-banner h3 { margin: 0; font-size: 1.05em; }
.combat-banner-attacker {
	background: linear-gradient(90deg, rgba(196, 92, 42, 0.28), rgba(196, 92, 42, 0.08));
	border-bottom-color: rgba(196, 92, 42, 0.45);
}
.combat-banner-defender {
	background: linear-gradient(90deg, rgba(91, 141, 239, 0.28), rgba(91, 141, 239, 0.08));
	border-bottom-color: rgba(91, 141, 239, 0.45);
}
.combat-side-icon {
	width: 42px;
	height: 42px;
	flex: 0 0 42px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	border: 2px solid rgba(255,255,255,0.18);
	background: #0b1020;
	overflow: hidden;
}
.combat-side-art {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.combat-side-glyph { width: 28px; height: 28px; }
.combat-side-mark {
	font-size: 1.2em;
	font-weight: 700;
	color: #d4b45a;
}
.combat-side-ts { margin: 0.15em 0 0; font-size: 0.9em; }
.combat-units {
	list-style: none;
	margin: 0;
	padding: 0.55em 0.65em;
	display: flex;
	flex-direction: column;
	gap: 0.45em;
}
.combat-unit-row {
	display: flex;
	flex-direction: column;
	gap: 0.15em;
	padding: 0.2em 0;
}
.combat-unit-row.is-lost .combat-troop-line {
	opacity: 0.82;
	border-color: rgba(255, 120, 100, 0.35);
	background: rgba(120, 30, 20, 0.16);
}
.combat-troop-line {
	width: 100%;
	box-sizing: border-box;
	cursor: default;
}
.combat-unit-meta {
	font-size: 0.78em;
	padding-left: 0.45em;
}
.combat-unit-fallback { font-size: 0.9em; padding: 0.35em 0.45em; }
.combat-empty-line {
	padding: 0.35em 0.45em;
	font-style: italic;
}
.combat-losses-panel {
	border-top: 1px solid rgba(255,255,255,0.08);
	background: rgba(0,0,0,0.14);
	min-height: 5.5em;
}
.combat-losses-panel h4 {
	margin: 0.55em 0.65em 0.2em;
	font-size: 0.82em;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #9aa7c2;
}
.combat-losses { padding-top: 0; }
.troop-badge-level {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.15em;
	height: 1.15em;
	padding: 0 0.2em;
	border: 1px solid #8a6a3a;
	border-radius: 3px;
	background: #2a2114;
	color: #e6c27a;
	font-size: 0.72em;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.02em;
}
.combat-rounds-wrap, .combat-effects-wrap { margin-top: 1.25em; }
.combat-rounds-table-wrap {
	overflow-x: auto;
	border: 1px solid #2a3a5c;
	border-radius: 6px;
	background: #0a1222;
}
.combat-rounds-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	font-size: 0.9em;
}
.combat-rounds-table th,
.combat-rounds-table td {
	padding: 0.65em 0.7em;
	border-bottom: 1px solid #1c2740;
	text-align: left;
	vertical-align: middle;
}
.combat-rounds-table th {
	background: #121a2e;
	color: #9aa7c2;
	font-weight: 600;
	white-space: nowrap;
	position: sticky;
	top: 0;
	z-index: 1;
}
.combat-rounds-table tbody tr:nth-child(even) { background: #0e1526; }
.combat-rounds-table tbody tr:hover { background: #162038; }
.combat-rounds-table tbody tr:last-child td { border-bottom: none; }
.combat-round-num {
	font-weight: 700;
	color: #d7e2f7;
	white-space: nowrap;
}
.combat-round-ts {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	white-space: nowrap;
}
.combat-round-total {
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	font-size: 1.05em;
	white-space: nowrap;
}
.combat-round-total.is-atk { color: #f0a878; }
.combat-round-total.is-def { color: #8eb6ff; }
.combat-dmg-cats {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45em 0.7em;
	align-items: center;
}
.combat-dmg-cat {
	display: inline-flex;
	align-items: center;
	gap: 0.28em;
	padding: 0.18em 0.4em;
	border: 1px solid #2f4068;
	border-radius: 4px;
	background: #121a30;
	font-variant-numeric: tabular-nums;
}
.combat-dmg-cat.is-general { border-color: #4a628e; }
.combat-dmg-cat.is-air { border-color: #5a8fc8; }
.combat-dmg-cat.is-armor { border-color: #8a7a4a; }
.combat-dmg-cat.is-infantry { border-color: #5a8a5a; }
.combat-dmg-cat-icon {
	width: 16px;
	height: 16px;
	display: block;
}
.combat-dmg-cat-value { font-weight: 600; }
.combat-dmg-cat-label {
	font-size: 0.75em;
	color: #9aa7c2;
}
.combat-round-note {
	color: #b7c3da;
	font-style: italic;
}
.combat-rounds-empty { margin: 0.5em 0 0; }
.combat-effects {
	list-style: none;
	margin: 0.35em 0 0;
	padding: 0;
}
.combat-effects li {
	padding: 0.45em 0.2em;
	border-bottom: 1px solid rgba(255,255,255,0.08);
	font-size: 0.92em;
}
.combat-debug-note { font-size: 0.78em; font-weight: normal; }
#revolt-head { align-items: stretch; }
.revolt-hero { flex: 1; min-width: 0; }
.revolt-actions { display: flex; flex-wrap: wrap; gap: 0.6em 1em; margin: 0.35em 0 0; }
.revolt-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1em;
	margin-top: 1em;
}
.revolt-panel {
	border: 1px solid #3a4d7a;
	background: #121a33;
	padding: 0.65em 0.75em;
}
.revolt-panel-wide { grid-column: 1 / -1; }
.revolt-panel h3 { margin: 0 0 0.45em; font-size: 0.95em; }
.revolt-lines { list-style: none; padding: 0; margin: 0; }
.revolt-lines li { margin: 0.2em 0; }
#combat-list button { width: 100%; text-align: left; }
#combat-list .is-selected button { outline: 1px solid #6ea8fe; }
#combat-list .is-victory button { border-left: 3px solid #7fd97f; }
#combat-list .is-defeat button { border-left: 3px solid #ff8a7a; }
#job-board { margin: 0.8em 0; }
.job-lane {
	border: 1px solid #3a4d7a;
	background: #121a33;
	padding: 0.35em 0.5em;
	margin: 0.35em 0;
	min-height: 2.4em;
}
.job-lane.drag-over { outline: 1px solid #6ea8fe; background: #1c2744; }
.job-lane-title { font-size: 0.9em; margin-bottom: 0.2em; cursor: pointer; }
.job-lane-pops {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0;
	min-height: 1.4em;
	max-width: 100%;
	overflow: hidden;
}
.job-lane-out {
	display: flex;
	flex-wrap: wrap;
	gap: 0.15em;
	min-height: 0.9em;
	margin-top: 0.2em;
	align-items: center;
}
.job-lane-pops .pop-token {
	flex: 0 0 auto;
	position: relative;
}
.job-lane-pops .pop-token:hover,
.job-lane-pops .pop-token.is-selected {
	z-index: 20;
}
.job-lane-money { border-style: dashed; }
.job-lane-money .job-lane-pops { display: none; }
.spy-lane-head {
	margin: 0.8em 0 0.35em;
	font-size: 0.95em;
	color: #9aa7c2;
	display: flex;
	align-items: center;
	gap: 0.4em;
}
.spy-lane-swatch {
	width: 0.75em;
	height: 0.75em;
	border-radius: 0.12em;
	flex: 0 0 auto;
	border: 1px solid rgba(255,255,255,0.28);
}
.spy-lane-head-label { min-width: 0; }
#spy-board {
	display: flex;
	flex-direction: column;
	gap: 0.15em;
	margin: 0.5em 0 1em;
}
.spy-track-row {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.45em;
	margin: 0.2em 0 0.45em;
	align-items: stretch;
}
.spy-track-row .spy-track {
	margin: 0;
	min-width: 0;
	min-height: 3.4em;
}
.spy-track-title {
	display: flex;
	align-items: center;
	gap: 0.4em;
	min-height: 1.4em;
}
.spy-track-title.is-group {
	cursor: default;
}
.spy-group-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.35em;
	height: 1.35em;
	border-radius: 50%;
	overflow: hidden;
	background: #0b1220;
	flex: 0 0 auto;
}
.spy-group-badge-art {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.spy-track-meta {
	font-size: 0.88em;
	color: #9aa7c2;
	white-space: nowrap;
}
.spy-track .job-lane-pops .pop-token:hover,
.spy-track .job-lane-pops .pop-token.is-selected {
	z-index: 20;
}
.pop-token {
	cursor: grab;
	display: inline-flex;
	line-height: 0;
	user-select: none;
	width: 22px;
	height: 22px;
	border: 2px solid #888;
	border-radius: 50%;
	overflow: hidden;
	background: #0b1020;
}
.pop-token-art { width: 100%; height: 100%; pointer-events: none; object-fit: cover; }
.pop-token:active { cursor: grabbing; }
.pop-token.is-selected { outline: 2px solid #fff; outline-offset: 1px; }
.prod-gap {
	display: inline-block;
	width: 0.7em;
	height: 12px;
	flex: 0 0 0.7em;
}
.pop-drag-ghost {
	position: fixed;
	z-index: 40;
	pointer-events: none;
	background: #1c2744;
	border: 1px solid #6ea8fe;
	padding: 0.2em 0.5em;
	font-size: 0.85em;
	white-space: nowrap;
}
#settle-build-stub {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45em 1em;
	align-items: center;
	border: 1px solid #3a4d7a;
	background: #121a33;
	padding: 0.45em 0.65em;
	margin: 0.5em 0;
}
#settle-build-stub h3 {
	margin: 0;
	font-size: 1em;
}
#settle-build-stub-line {
	margin: 0;
	flex: 1;
	min-width: 12em;
}
#settle-build-row {
	display: flex;
	gap: 1em;
	align-items: stretch;
	flex-wrap: wrap;
	min-height: 18em;
}
#settle-queue-col, #settle-catalog {
	flex: 1 1 14em;
	min-width: 12em;
	min-height: 0;
	max-height: min(40em, 70vh);
	display: flex;
	flex-direction: column;
}
#settle-inspect {
	flex: 1 1 22em;
	min-width: 18em;
	max-height: min(40em, 70vh);
	overflow: auto;
	display: flex;
	gap: 0.7em;
	align-items: stretch;
	border: 1px solid #3a4d7a;
	background: #121a33;
	padding: 0.55em 0.65em;
}
#settle-inspect-copy { flex: 1; min-width: 8em; }
#settle-inspect-copy h3 { font-size: 1em; margin: 0.1em 0 0.25em; }
#settle-inspect-stats-box {
	flex: 0 0 11em;
	width: 11em;
	border: 1px solid #3a4d7a;
	background: #0b1020;
	padding: 0.4em 0.5em;
}
#settle-inspect-stats-box h4 {
	margin: 0 0 0.3em;
	font-size: 0.8em;
	color: #9aa7c2;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
#settle-inspect-stats {
	list-style: disc;
	margin: 0 0 0 1.1em;
	padding: 0;
	font-size: 0.8em;
}
#settle-inspect-stats li { margin: 0.2em 0; }
#btn-settle-inspect-queue { margin-top: 0.5em; }
#settle-structures li button {
	display: block;
	width: 100%;
	text-align: left;
}
#settle-structures li.is-inspect button,
#settle-catalog-list li.is-inspect button,
#settle-queue li.is-inspect {
	outline: 1px solid #fff;
}
#settle-queue-col h3, #settle-catalog h3 { font-size: 1em; margin: 0.2em 0 0.25em; }
#settle-catalog-list, #settle-queue, #settle-fleets, #system-fleets, #research-cat-list, #research-detail-effects {
	list-style: none;
	padding: 0;
	margin: 0;
}
#settle-catalog-list, #settle-queue {
	overflow-y: auto;
	flex: 1;
	min-height: 0;
	overscroll-behavior: contain;
}
#settle-catalog-list li { margin: 0.25em 0; }
#settle-catalog-list li.catalog-group {
	margin: 0.55em 0 0.15em;
	color: #9aa7c2;
	font-size: 0.75em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
#settle-catalog-list li.catalog-group:first-child { margin-top: 0; }
#settle-catalog-list button {
	display: block;
	width: 100%;
	text-align: left;
}
#settle-queue li {
	display: flex;
	align-items: center;
	gap: 0.4em;
	font-size: 0.85em;
	margin: 0.15em 0;
	user-select: none;
}
#settle-queue .q-name { flex: 1; min-width: 0; cursor: pointer; }
#settle-queue .q-prog, #settle-queue .q-eta {
	color: #9aa7c2;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
#settle-queue li.is-blocked .q-name,
#settle-queue li.is-blocked .q-prog,
#settle-queue li.is-blocked .q-eta {
	opacity: 0.4;
}
.prod-total {
	margin-left: 0.35em;
	font-size: 0.85em;
	font-variant-numeric: tabular-nums;
	color: #c5d4e0;
}
.prod-total.is-neg { color: #e25a4a; }
.prod-glyph.is-spend { opacity: 0.4; }
#settle-catalog-list li.is-capped button { opacity: 0.55; }
#settle-queue li.is-mine { cursor: grab; }
#settle-queue li.is-dragging { opacity: 0.55; cursor: grabbing; }
#settle-queue .q-rm { padding: 0 0.35em; line-height: 1.2; }
.fleet-row { margin: 0.25em 0; }
.fleet-row button {
	width: 100%;
	text-align: left;
	display: flex;
	align-items: center;
	gap: 0.45em;
}
.fleet-row.is-selected button { outline: 1px solid #fff; }
.fleet-unit-icons-slot { flex: 0 0 auto; display: flex; align-items: center; }
.fleet-unit-icons {
	display: inline-flex;
	align-items: center;
	gap: 0.2em;
	min-width: 1.6em;
}
.fleet-unit-label { flex: 1 1 auto; min-width: 0; }
.fleet-unit-icons .troop-badge-row { gap: 0.15em; }
.fleet-unit-icons .troop-glyph,
.fleet-unit-icons .troop-badge-art,
.fleet-pop-art {
	width: 18px;
	height: 18px;
	object-fit: contain;
}
.fleet-unit-owner {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
}
.empire-culture-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.35em;
	height: 1.35em;
	border-radius: 50%;
	overflow: hidden;
	background: #0b1220;
	flex: 0 0 auto;
}
.empire-culture-badge-art {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.fleet-flag-icon,
.fleet-scout-icon,
.fleet-badge-art {
	width: 22px;
	height: 22px;
	display: block;
	flex: 0 0 auto;
}
#space-combat-head {
	display: flex;
	align-items: flex-start;
	gap: 0.6em;
}
#btn-space-ok {
	font-weight: 700;
}
#empire-report-head {
	display: flex;
	align-items: flex-start;
	gap: 0.75em;
	margin-bottom: 1em;
}
#empire-report-identity {
	display: flex;
	gap: 0.85em;
	align-items: flex-start;
}
.empire-report-block {
	margin: 0 0 1.25em;
}
.empire-report-block h3 {
	margin: 0 0 0.45em;
}
#empire-report-techs {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(14em, 1fr));
	gap: 0.25em 0.75em;
}
.empire-report-tech {
	display: flex;
	gap: 0.45em;
	font-size: 0.92em;
}
.empire-report-spies {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35em;
}
#empire-report-foreign {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75em;
}
.empire-report-foreign-head {
	display: flex;
	align-items: center;
	gap: 0.45em;
}
.empire-report-foreign-name { font-weight: 600; }
.empire-report-foreign-rel { margin-left: auto; }
.empire-report-foreign-bar { margin: 0.35em 0 0.2em; max-width: 16em; }
.empire-report-foreign-threat { margin: 0; font-size: 0.88em; }
.empire-report-foreign.is-war .empire-report-foreign-rel { color: #e25a4a; }
#diplo-actions { display: flex; gap: 0.5em; flex-wrap: wrap; }
.fleet-ship-art {
	width: 28px;
	height: 18px;
	object-fit: contain;
	image-rendering: auto;
	display: block;
}
.fleet-empty-mark { opacity: 0.55; font-size: 0.9em; }
#research-layout { display: flex; gap: 1.2em; align-items: flex-start; flex-wrap: wrap; margin-top: 0.8em; }
#research-cat-list { flex: 0 1 16em; min-width: 12em; }
.research-cat {
	border: 1px solid #3a4d7a;
	padding: 0.45em 0.55em;
	margin: 0.3em 0;
	cursor: pointer;
}
.research-cat.is-selected { outline: 1px solid #fff; }
.research-cat.is-current { background: #1c2744; }
.research-cat-name { font-weight: 600; }
#research-detail { flex: 1 1 20em; min-width: 16em; }
#research-detail-blurb {
	border: 1px solid #3a4d7a;
	background: #121a33;
	padding: 0.65em 0.75em;
	margin: 0.55em 0 0.8em;
}
#research-detail-summary {
	margin: 0;
	line-height: 1.45;
}
#research-detail-effects { margin: 0.5em 0 0 1.1em; list-style: disc; }
#research-detail-summary[hidden] + #research-detail-effects { margin-top: 0; }
#research-ladder {
	display: flex;
	flex-direction: column;
	gap: 0.45em;
	margin-bottom: 0.8em;
}
.research-tier { display: flex; gap: 0.45em; align-items: flex-start; }
.research-tier-label {
	flex: 0 0 1.8em;
	color: #9aa7c2;
	font-size: 0.85em;
	padding-top: 0.45em;
}
.research-tier-opts { display: flex; flex-wrap: wrap; gap: 0.35em; flex: 1; }
.research-node {
	flex: 1 1 7em;
	min-width: 6em;
	max-width: 12em;
	text-align: left;
	padding: 0.35em 0.45em;
	font-size: 0.8em;
}
.research-node-name { font-weight: 600; }
.research-node.is-done { opacity: 0.65; }
.research-node.is-skipped { opacity: 0.45; text-decoration: line-through; }
.research-node.is-current { outline: 1px solid #6ea8fe; background: #1c2744; }
.research-node.is-available { outline: 1px solid #3d9b5f; }
.research-node.is-locked { opacity: 0.5; }
.research-node.is-preview { outline: 1px solid #fff; }
#research-overview-wrap { margin-top: 1.2em; }
#research-overview-wrap h3 { font-size: 1em; }
.research-ov-row {
	display: flex;
	gap: 0.4em;
	align-items: stretch;
	margin: 0.25em 0;
}
.research-ov-label {
	flex: 0 0 9em;
	font-size: 0.8em;
	padding-top: 0.35em;
}
.research-ov-tiers { display: flex; flex: 1; gap: 0.25em; min-width: 0; }
.research-ov-tier {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.2em;
	min-width: 0;
}
.research-ov-cell {
	flex: 1;
	min-width: 0;
	font-size: 0.7em;
	padding: 0.3em 0.25em;
	text-align: left;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.research-ov-cell.is-done { opacity: 0.6; }
.research-ov-cell.is-skipped { opacity: 0.4; text-decoration: line-through; }
.research-ov-cell.is-current { outline: 1px solid #6ea8fe; }
.research-ov-cell.is-available { outline: 1px solid #3d9b5f; }
.research-ov-cell.is-locked { opacity: 0.45; }
.research-ov-cell.is-preview { outline: 1px solid #fff; }
#settle-structures-wrap, #settle-garrison-wrap { margin: 0.6em 0; }
#settle-structures { list-style: none; padding: 0; margin: 0.2em 0 0; }
#settle-structures li { margin: 0.15em 0; }
#settle-garrison {
	list-style: none;
	padding: 0;
	margin: 0.2em 0 0.4em;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em 0.7em;
}
#settle-garrison li { margin: 0; }
.garrison-btn {
	display: flex;
	align-items: center;
	gap: 0.4em;
	padding: 0.2em 0.45em;
	background: #121a33;
	border: 1px solid #3a4d7a;
}
.garrison-btn .troop-badge-row,
.garrison-btn .garrison-btn-inner {
	flex: 1;
}
#settle-garrison li.is-inspect .garrison-btn { outline: 1px solid #fff; }
.troop-glyph { flex: 0 0 18px; display: block; }
.troop-glyph-wrap { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex: 0 0 18px; }
.troop-glyph-img { object-fit: contain; display: block; }
#settle-garrison { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 0; border: 1px solid #3a4d7a; background: #0d1428; margin: 0.25em 0; }
.troop-lane-board { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 0; }
.troop-lane-board:empty { display: none; }
.troop-lane {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	border-right: 1px solid #3a4d7a;
	padding: 0.15em 0.25em;
	min-width: 2em;
}
.troop-lane:last-child { border-right: none; }
.troop-lane.is-inspect { outline: 1px solid #fff; }
.troop-lane-compact .troop-lane-head { font-size: 0.72em; }
.troop-lane-head {
	display: flex;
	align-items: center;
	gap: 0.2em;
	white-space: nowrap;
	margin-bottom: 0.1em;
}
.troop-lane-species { width: 14px; height: 14px; flex: 0 0 14px; object-fit: cover; }
.troop-lane-name { font-size: 0.75em; color: #c8d4ef; max-width: 5em; overflow: hidden; text-overflow: ellipsis; }
.troop-lane-units { display: flex; flex-wrap: nowrap; gap: 0.12em; align-items: center; min-height: 1.2em; }
.troop-glyph-token {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.15em;
	height: 1.15em;
	cursor: pointer;
}
.troop-glyph-token .troop-glyph { width: 14px; height: 14px; flex: 0 0 14px; }
.troop-glyph-token.is-selected { outline: 2px solid #fff; outline-offset: 1px; }
#settle-troop-fleet { margin: 0.35em 0 0.15em; }
#settle-troop-move {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em 0.7em;
	align-items: flex-end;
	margin: 0.35em 0;
}
#settle-troop-move label { display: flex; flex-direction: column; gap: 0.15em; font-size: 0.85em; }
#settle-troop-count { width: 4.5em; }
#settle-troop-moves { list-style: none; padding: 0; margin: 0.2em 0 0; }
#settle-troop-moves li { display: flex; gap: 0.5em; align-items: center; margin: 0.25em 0; font-size: 0.85em; }
#empire-settlement-rows { list-style: none; padding: 0; margin: 0.6em 0 1em; }
.empire-row {
	display: flex;
	flex-direction: column;
	gap: 0.25em;
	border: 1px solid #3a4d7a;
	background: #121a33;
	padding: 0.45em 0.55em;
	margin: 0.35em 0;
}
.empire-row-top {
	display: flex;
	gap: 0.6em;
	align-items: center;
}
.empire-row.is-selected { outline: 1px solid #fff; }
.empire-row.is-pop-source { outline: 1px solid #6ea8fe; }
.empire-row.is-troop-source { outline: 1px solid #e6c35c; }
.empire-row.is-pop-target { background: #1a2540; cursor: copy; }
.empire-row.is-troop-target { background: #1f2430; cursor: copy; }
.empire-lane-mini.is-job-target { background: #1c2744; cursor: pointer; }
.empire-row-body { flex: 1; min-width: 0; cursor: pointer; }
.empire-row-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.2em 0.55em;
	min-width: 0;
}
.empire-row-name { font-weight: 600; flex: 0 0 auto; }
.empire-row-meta {
	font-size: 0.78em;
	font-weight: 400;
	color: #8a96b0;
	flex: 1 1 auto;
	min-width: 0;
}
.empire-row-garrison {
	display: flex;
	flex-wrap: nowrap;
	overflow-x: auto;
	border: 1px solid #3a4d7a;
	background: #0d1428;
	min-height: 1.25em;
}
.empire-row-garrison:empty::before {
	content: "No garrison";
	color: #9aa7c2;
	font-size: 0.72em;
	padding: 0.1em 0.3em;
}
.empire-row-garrison .troop-lane-board,
.empire-row-garrison.troop-lane-board { border: none; background: transparent; min-height: 0; }
.empire-row-garrison:has(.troop-lane)::before { content: none; }
.troop-lane-inline {
	display: flex;
	align-items: center;
	border-right: 1px solid #3a4d7a;
	padding: 0;
}
.troop-lane-inline:last-child { border-right: none; }
.troop-lane-inline-row {
	display: flex;
	align-items: center;
	gap: 0.1em;
	padding: 0.06em 0.18em;
}
.troop-lane-inline .troop-lane-species {
	width: 12px;
	height: 12px;
	flex: 0 0 12px;
	object-fit: cover;
}
.troop-lane-inline .troop-wildlife-mark svg { width: 14px; height: 14px; }
.troop-lane-inline .troop-glyph-token {
	width: 0.95em;
	height: 0.95em;
}
.troop-lane-inline .troop-glyph-token .troop-glyph {
	width: 12px;
	height: 12px;
	flex: 0 0 12px;
}
.empire-row-lanes {
	display: flex;
	flex-wrap: nowrap;
	overflow: hidden;
	border: 1px solid #3a4d7a;
	background: #0d1428;
}
.empire-lane-mini {
	flex: 1 1 0;
	min-width: 2.5em;
	display: flex;
	align-items: center;
	border-right: 1px solid #3a4d7a;
	border-bottom: 2px solid transparent;
	padding: 0.15em 0.25em;
	min-height: 1.5em;
	overflow: hidden;
}
.empire-lane-mini:last-child { border-right: none; }
.empire-lane-pops {
	display: flex;
	flex-wrap: nowrap;
	gap: 0;
	align-items: center;
	overflow: hidden;
	max-width: 100%;
}
.empire-lane-pops .pop-token {
	flex: 0 0 auto;
	position: relative;
}
.empire-lane-pops .pop-token:hover,
.empire-lane-pops .pop-token.is-selected {
	z-index: 20;
}
.empire-lane-mini .pop-token {
	width: 1.15em;
	height: 1.15em;
	border-width: 2px;
	cursor: pointer;
}
#empire-move {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em 0.8em;
	align-items: center;
	border-top: 1px solid #3a4d7a;
	padding-top: 0.8em;
}
#empire-move h3, #empire-move > p { flex: 1 1 100%; }
#empire-move label { display: flex; flex-direction: column; gap: 0.15em; font-size: 0.85em; }
#empire-moves { list-style: none; padding: 0; margin: 0; flex: 1 1 100%; }
#empire-moves li { display: flex; gap: 0.5em; align-items: center; margin: 0.25em 0; }
.system-body {
	display: flex;
	align-items: center;
	gap: 0.5em;
	margin: 0.4em 0;
	list-style: none;
}
.system-planet {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	background: #050814;
	border: 1px solid #3a4d7a;
}
.system-body-text { flex: 1; white-space: pre-line; font-size: 0.9em; }
.system-body-actions { display: flex; flex-direction: column; gap: 0.2em; flex-shrink: 0; }
.system-body .btn-open, .system-body .btn-unload, .system-body .btn-invade, .system-body .btn-found { flex-shrink: 0; }
#system-bodies { padding-left: 0; }
#system-ship-orders {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35em;
	margin-top: 0.45em;
}
#system-ship-orders button { flex: 1 1 8em; }
#side {
	flex: 0 0 22em;
	width: 22em;
	min-width: 18em;
	overflow: auto;
	padding: 0.6em;
	background: #121a33;
	border-left: 1px solid #3a4d7a;
}
@media (max-width: 960px) {
	#play-layout { flex-direction: column; }
	#side {
		flex: 0 0 auto;
		width: 100%;
		min-width: 0;
		max-height: 42vh;
		border-left: none;
		border-top: 1px solid #3a4d7a;
	}
}
#side-nav { display: flex; flex-wrap: wrap; gap: 0.3em; margin-bottom: 0.6em; }
#side-nav button { font-size: 0.85em; }
.panel h2 { font-size: 1.1em; }
.panel ul { padding-left: 1.1em; }
#win-banner {
	position: fixed; inset: 0;
	background: rgba(0,0,0,0.7);
	display: flex; flex-direction: column;
	align-items: center; justify-content: center;
	gap: 1em;
}
.game-modal {
	position: fixed;
	inset: 0;
	z-index: 40;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5em;
	background: rgba(4, 8, 18, 0.72);
	cursor: pointer;
}
.game-modal-card {
	max-width: 22em;
	padding: 1em 1.15em;
	border: 1px solid #6ea8fe;
	background: #121a33;
	box-shadow: 0 0.35em 1.2em rgba(0, 0, 0, 0.45);
	cursor: default;
}
.game-modal-card p {
	margin: 0;
	line-height: 1.45;
}
.game-modal-form {
	margin-top: 0.75em;
	display: flex;
	flex-direction: column;
	gap: 0.5em;
}
.game-modal-form label {
	font-size: 0.9em;
	color: #b8c5e0;
}
.game-modal-form input[type="text"] {
	width: 100%;
	box-sizing: border-box;
	padding: 0.35em 0.5em;
	border: 1px solid #3a4d7a;
	background: #0c1224;
	color: #e8eef8;
}
.game-modal-actions {
	display: flex;
	gap: 0.5em;
	justify-content: flex-end;
	flex-wrap: wrap;
}
.refit-modal-card {
	max-width: 42em;
	width: min(42em, 100%);
}
.refit-modal-card h2 { margin: 0 0 0.35em; }
.refit-modal-card h3 { margin: 0 0 0.4em; font-size: 0.95em; }
.refit-layout {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.85em;
	margin-top: 0.75em;
	min-height: 14em;
}
.refit-col ul {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 16em;
	overflow: auto;
	border: 1px solid #3a4a6a;
}
.refit-col li button {
	width: 100%;
	text-align: left;
	background: transparent;
	border: 0;
	color: inherit;
	padding: 0.4em 0.55em;
	cursor: pointer;
}
.refit-col li.is-selected button,
.refit-col li button:hover {
	background: rgba(110, 168, 254, 0.18);
}
.refit-actions { justify-content: flex-end; }
.system-rename {
	display: flex;
	gap: 0.4em;
	margin: 0.35em 0 0.6em;
}
.system-rename input[type="text"] {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0.25em 0.45em;
	border: 1px solid #3a4d7a;
	background: #0c1224;
	color: #e8eef8;
}
.system-combat-line {
	margin: 0.35em 0 0.25em;
	color: #e8c070;
}
#btn-engage-space {
	margin: 0 0 0.6em;
}
.spy-incite {
	margin: 0.75em 0 1em;
	padding: 0.65em 0.75em;
	border: 1px solid #3a4d7a;
	background: rgba(12, 18, 36, 0.65);
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	align-items: center;
}
.spy-incite select {
	min-width: 10em;
}
#btn-rush-build {
	margin-top: 0.5em;
}
#todo-list li { margin: 0.35em 0; }
#todo-list button { margin-left: 0.3em; }

#diplo-layout { display: flex; flex-direction: column; gap: 1em; margin-top: 0.6em; }
#diplo-rivals-bar { width: 100%; }
#diplo-rivals {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.45em;
	width: 100%;
}
.diplo-rival { margin: 0; flex: 0 1 auto; }
.diplo-rival button {
	width: auto;
	min-width: 9em;
	max-width: 14em;
	display: flex;
	align-items: center;
	gap: 0.45em;
	text-align: left;
	padding: 0.35em 0.55em;
}
.diplo-rival img {
	width: 36px;
	height: 36px;
	object-fit: contain;
	background: #050814;
	flex: 0 0 36px;
}
.diplo-rival-name { flex: 1; min-width: 0; font-weight: 600; }
.diplo-rival-rel { flex: 0 0 auto; }
.diplo-rival.is-selected button { outline: 1px solid #fff; }
.diplo-rival.is-war .diplo-rival-rel { color: #e25a4a; }
.diplo-rival.is-attention button { outline: 1px solid #c9a227; }
.diplo-attitude {
	margin: 0.45em 0 0.35em;
	max-width: 18em;
}
.diplo-attitude-head {
	display: flex;
	justify-content: space-between;
	gap: 0.75em;
	font-size: 0.9em;
	margin-bottom: 0.25em;
}
.diplo-attitude-bar {
	position: relative;
	height: 0.55em;
	border: 1px solid #3a4a6a;
	background: #0c1224;
	overflow: hidden;
}
.diplo-attitude-fill {
	height: 100%;
	width: 50%;
	background: #7a8499;
	transition: width 0.15s ease;
}
.diplo-attitude-fill.is-hostile { background: #c45a4a; }
.diplo-attitude-fill.is-friendly { background: #4a9a6a; }
.diplo-attitude-mid {
	position: absolute;
	left: 50%;
	top: 0;
	bottom: 0;
	width: 1px;
	background: rgba(232, 238, 248, 0.45);
}
.diplo-threat {
	margin: 0.35em 0 0.5em;
	max-width: 42em;
	white-space: pre-line;
	font-size: 0.85em;
	line-height: 1.35;
}
#diplo-detail { flex: 1 1 auto; width: 100%; min-width: 0; }
#diplo-rival-head { display: flex; gap: 0.8em; align-items: flex-start; margin-bottom: 0.6em; }
.diplo-welcome { font-style: italic; margin: 0.35em 0 0.5em; max-width: 42em; }
#diplo-foreign { margin: 0.65em 0 0.85em; }
#diplo-foreign-list {
	list-style: none;
	margin: 0.35em 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.25em;
}
.diplo-foreign-row {
	display: flex;
	align-items: center;
	gap: 0.45em;
	font-size: 0.9em;
}
.diplo-foreign-swatch {
	width: 0.7em;
	height: 0.7em;
	border-radius: 0.1em;
	flex: 0 0 auto;
	border: 1px solid rgba(255,255,255,0.25);
}
.diplo-foreign-name { flex: 0 1 auto; font-weight: 600; }
.diplo-foreign-rel { flex: 1 1 auto; text-align: right; }
.diplo-foreign-row.is-war .diplo-foreign-rel { color: #e25a4a; }
#diplo-deal { display: grid; gap: 0.9em; }
#diplo-proposal h4 { margin: 0.75em 0 0.35em; font-size: 0.95em; }
#diplo-proposal > .muted { margin: 0.2em 0 0.6em; }
#diplo-active-treaties p { margin: 0.15em 0 0.5em; }
#diplo-pact-proposals { margin-bottom: 0.5em; }
.diplo-pact-opt {
	display: flex;
	gap: 0.45em;
	align-items: flex-start;
	margin: 0.35em 0;
	font-size: 0.92em;
}
.diplo-pact-opt input { margin-top: 0.15em; }
.diplo-duration-label {
	display: flex;
	align-items: center;
	gap: 0.45em;
	margin: 0.35em 0 0.55em;
	font-size: 0.92em;
}
#diplo-prefs, #diplo-threat, #diplo-stance { margin: 0.25em 0 0; }
#empire-report-stance { margin: 0.25em 0 0; }
#diplo-inbox {
	border: 1px solid #3a4d7a;
	background: #121a33;
	padding: 0.5em 0.65em;
	margin: 0.5em 0;
}
#diplo-actions { margin: 0.5em 0; }
.diplo-cols { display: flex; gap: 1em; flex-wrap: wrap; }
.diplo-col { flex: 1 1 12em; min-width: 10em; }
#diplo-give, #diplo-want {
	list-style: none;
	padding: 0;
	margin: 0.2em 0 0.5em;
	min-height: 1.2em;
}
#diplo-give:empty::before, #diplo-want:empty::before {
	content: "Nothing yet";
	color: #7a849c;
	font-size: 0.88em;
	font-style: italic;
}
#diplo-give li, #diplo-want li {
	display: flex;
	gap: 0.4em;
	align-items: center;
	margin: 0.2em 0;
	font-size: 0.9em;
}
#diplo-give li span, #diplo-want li span { flex: 1; min-width: 0; }
#diplo-add {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(16em, 1fr));
	gap: 0.55em;
	margin: 0.4em 0 0.6em;
}
.diplo-add-group {
	display: flex;
	flex-direction: column;
	gap: 0.45em;
	border: 1px solid #2a3555;
	background: #0d1224;
	padding: 0.55em 0.65em;
}
.diplo-add-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45em 0.65em;
	align-items: flex-end;
}
.diplo-add-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35em;
}
.diplo-add-group label { display: flex; flex-direction: column; gap: 0.15em; font-size: 0.85em; min-width: 8em; }
#diplo-money-n, #diplo-give-troop-n, #diplo-want-troop-n { width: 5em; }
#diplo-send-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45em;
	margin-top: 0.4em;
}
#diplo-outbox {
	border: 1px solid #2a3555;
	background: #0d1224;
	padding: 0.55em 0.65em;
	margin: 0.5em 0;
}
#diplo-outbox-list {
	list-style: none;
	padding: 0;
	margin: 0.2em 0 0;
}
#diplo-outbox-list li { margin: 0.3em 0; font-size: 0.9em; }
#diplo-pending-note { margin: 0.35em 0 0.5em; }

#report-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7em 1.2em;
	list-style: none;
	padding: 0;
	margin: 0.4em 0 0.8em;
}
#report-legend li { display: flex; align-items: center; gap: 0.4em; }
.report-swatch {
	display: inline-block;
	width: 0.85em;
	height: 0.85em;
	border-radius: 2px;
}
#report-charts {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.9em 1.1em;
}
#report-charts figure { margin: 0; }
#report-charts figcaption {
	font-size: 0.9em;
	margin-bottom: 0.25em;
	color: #9aa7c2;
}
#report-charts canvas {
	display: block;
	width: 100%;
	height: 140px;
	background: #070b16;
	border: 1px solid #3a4d7a;
}
#report-log { margin-top: 1.2em; }
#report-list { padding-left: 1.2em; }
#space-combat-head, #design-head { display: flex; gap: 1em; align-items: flex-start; flex: 0 0 auto; }
#stage-space-combat {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	min-height: 0;
}
#space-combat-layout {
	display: flex;
	gap: 0.8em;
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
	align-items: stretch;
}
#space-canvas {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 0;
	width: 100%;
	height: 100%;
	display: block;
	background: #050814;
	border: 1px solid #3a4d7a;
	cursor: grab;
	touch-action: none;
}
#space-combat-side {
	flex: 0 0 16em;
	min-height: 0;
	overflow: auto;
}
#space-combat-status {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75em;
	margin-top: 0.75em;
	flex: 0 0 auto;
}
.space-status-card {
	display: grid;
	grid-template-columns: auto 1fr 1fr;
	gap: 0.65em;
	align-items: start;
	padding: 0.55em 0.7em;
	border: 1px solid #2a3550;
	background: rgba(8, 12, 22, 0.92);
	min-height: 5.5em;
}
.space-status-card.is-enemy {
	grid-template-columns: 1fr 1fr auto;
	border-color: #4a3038;
}
.space-status-art {
	width: 96px;
	height: 72px;
	background: #050814;
	border: 1px solid #31405f;
}
.space-status-stats {
	font-size: 0.85em;
	line-height: 1.35;
	color: #c8d4ef;
}
.space-status-stats .space-stat-name {
	font-weight: 600;
	color: #e8eef8;
	margin-bottom: 0.2em;
}
.space-status-stats .is-hurt { color: #f0a090; }
.space-status-load {
	list-style: none;
	padding: 0;
	margin: 0;
	font-size: 0.8em;
	color: #9aa7c2;
}
.space-status-load li { margin: 0.15em 0; }
.space-status-load li.is-spent { color: #6a7388; }
.space-status-load li.is-selected button { outline: 1px solid #fff; }
.space-status-load button {
	font: inherit;
	color: inherit;
	background: #152038;
	border: 1px solid #31405f;
	padding: 0.2em 0.45em;
	cursor: pointer;
	width: 100%;
	text-align: left;
}
.space-status-load button:disabled {
	opacity: 0.55;
	cursor: default;
}
#space-ship-list, #space-weapon-list, #space-combat-log, #design-class-list, #design-load-list, #design-catalog {
	list-style: none;
	padding: 0;
	margin: 0.2em 0 0.6em;
}
#space-ship-list li, #space-weapon-list li, #design-class-list li, #design-catalog li { margin: 0.2em 0; }
#space-ship-list li.is-selected button, #space-weapon-list li.is-selected button, #design-class-list li.is-selected button {
	outline: 1px solid #fff;
}
#space-combat-log { font-size: 0.85em; color: #9aa7c2; max-height: 10em; overflow: auto; }
#design-layout {
	display: grid;
	grid-template-columns: 16em 1fr 16em;
	gap: 1em;
}
#design-hulls { display: flex; gap: 0.4em; margin-bottom: 0.6em; }
#design-hulls button.is-selected { outline: 1px solid #fff; }
#design-load-list li { display: flex; gap: 0.5em; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.design-load-label { flex: 1 1 10em; min-width: 8em; }
.design-load-controls { display: flex; flex-wrap: wrap; gap: 0.25em; }
.design-load-controls button { font-size: 0.8em; padding: 0.15em 0.4em; }
#design-class-actions { display: flex; flex-wrap: wrap; gap: 0.35em; margin: 0.4em 0; }
.design-ship-art {
	display: block; width: 100%; max-width: 26em; height: auto; aspect-ratio: 400 / 220;
	margin-top: 0.6em; background: #050814; border: 1px solid #243048;
}
.design-ship-art-controls { display: flex; align-items: center; gap: 0.5em; margin-top: 0.35em; }
.design-ship-art-controls button { min-width: 2.2em; padding: 0.2em 0.45em; }
#empire-colors {
	margin: 0.6em 0 1em;
	padding: 0.6em 0.75em;
	border: 1px solid #2a3550;
	background: rgba(8, 12, 22, 0.85);
}
#empire-colors h3 { margin: 0 0 0.35em; }
#empire-color-list {
	list-style: none;
	padding: 0;
	margin: 0.4em 0 0;
	display: flex;
	flex-direction: column;
	gap: 0.55em;
}
.empire-color-row {
	display: grid;
	grid-template-columns: minmax(8em, 14em) 1fr;
	gap: 0.5em;
	align-items: start;
}
.empire-color-name { font-size: 0.9em; color: #c8d4ef; padding-top: 0.15em; }
.empire-color-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25em;
}
.empire-color-swatch {
	width: 1.15em;
	height: 1.15em;
	padding: 0;
	border: 1px solid rgba(255,255,255,0.25);
	cursor: pointer;
	border-radius: 2px;
}
.empire-color-swatch.is-selected {
	outline: 2px solid #fff;
	outline-offset: 1px;
}
.empire-color-swatch.is-taken:not(.is-selected) {
	opacity: 0.35;
}
.gen-color-block {
	margin-top: 0.65em;
}
.gen-color-label {
	display: block;
	font-size: 0.9em;
	color: #c8d4ef;
	margin-bottom: 0.2em;
}
.gen-color-hint {
	margin: 0 0 0.35em;
	font-size: 0.85em;
}
.gen-color-dd {
	position: relative;
	display: inline-block;
	max-width: 100%;
}
.gen-color-dd-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	padding: 0.3em 0.55em;
	min-width: 8.5em;
}
.gen-color-dd-swatch {
	width: 1.1em;
	height: 1.1em;
	border: 1px solid rgba(255,255,255,0.3);
	border-radius: 2px;
	flex: 0 0 auto;
	background: transparent;
}
.gen-color-dd-swatch.is-random {
	background:
		linear-gradient(135deg, #3b82f6 25%, #ef4444 25% 50%, #22c55e 50% 75%, #eab308 75%) !important;
}
.gen-color-dd-label { flex: 1 1 auto; text-align: left; }
.gen-color-dd-caret { opacity: 0.7; font-size: 0.85em; }
.gen-color-dd-menu {
	display: none;
	position: absolute;
	left: 0;
	top: calc(100% + 0.25em);
	z-index: 40;
	min-width: 11em;
	padding: 0.45em;
	border: 1px solid #2a3b66;
	background: #0d1428;
	box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}
.gen-color-dd.is-open .gen-color-dd-menu { display: block; }
.gen-color-dd-random {
	display: block;
	width: 100%;
	margin-bottom: 0.4em;
	text-align: left;
}
.gen-color-dd-random.is-selected {
	outline: 1px solid #fff;
}
.gen-color-dd-grid {
	display: grid;
	grid-template-columns: repeat(4, 1.35em);
	gap: 0.3em;
}
#space-combat-actions { display: flex; flex-wrap: wrap; gap: 0.35em; margin: 0.4em 0; }
#btn-space-autocombat.is-active { outline: 1px solid #6ea8fe; }
@media (min-width: 520px) {
	.gen-color-dd-grid { grid-template-columns: repeat(5, 1.35em); }
}
@media (max-width: 960px) {
	#space-combat-layout, #design-layout { display: flex; flex-direction: column; }
	#space-combat-side { flex: 0 0 auto; max-height: 40%; }
	#space-combat-status { grid-template-columns: 1fr; }
}
