@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700&display=swap");
:root {
  color-scheme: dark;
  --bg: #080c15;
  --panel: #0e1420;
  --line: #222c3c;
  --text: #d7e2f1;
  --muted: #8493aa;
  --cyan: #68f2d0;
  --pink: #fa688d;
}
.ui-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  vertical-align: -4px;
  pointer-events: none;
}
[data-ui-icon] { display: inline; pointer-events: none; }
.facility .top .ui-icon,
.actions .ui-icon { color: var(--cyan); }
.danger .ui-icon,
.destroy-facility .ui-icon { color: var(--pink); }
.facility-status { color: #f5d16f; }
.facility-status .ui-icon { width: 15px; height: 15px; vertical-align: -3px; }
.resource-square {
  display: inline-flex;
  width: 12px;
  height: 12px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  vertical-align: -3px;
  border-radius: 0;
  color: #080c15;
  background: var(--resource);
  box-shadow: 0 0 7px color-mix(in srgb, var(--resource) 40%, transparent);
  font: 700 13px monospace;
  letter-spacing: 0;
}
.resource-symbols .resource-square::after {
  content: attr(data-glyph);
  display: block;
  color: #07111b;
  font: bold 10px/12px monospace;
  text-align: center;
  width: 12px;
}
.res .resource-name { display: block; font-size: 11px; color: #b7c9da; text-transform: capitalize; }
.map-display-controls {
  position: absolute; z-index: 2; top: 100px; right: 16px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  max-width: min(420px, calc(100% - 24px)); padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 5px; background: #0c1624ed;
  font-size: 12px;
}
.map-display-controls label { display: flex; align-items: center; gap: 6px; }
.map-display-controls select { width: auto; min-height: 28px; padding: 3px; margin: 0; font-size: 12px; }
.map-display-controls input { accent-color: var(--cyan); }
.map-display-controls small { width: 100%; color: #acbdcf; font-size: 11px; }
.theater .pause-indicator { top: 180px; }
.save-panel { padding: 16px; border: 1px solid #35565d; border-radius: 6px; margin: 16px 0; background: #10202a; }
.save-panel p { font-size: 13px; line-height: 1.5; }
.save-panel .warning:empty { display: none; }
.opponent-settings { padding: 14px 0; margin-bottom: 12px; }
.opponent-selectors { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.opponent-selectors label { font-size: 13px; color: var(--cyan); }
.opponent-selectors select { display: block; }
.opponent-settings p { font-size: 13px; line-height: 1.5; margin-bottom: 6px; }
.opponent-settings small { color: #a4b8ca; font-size: 12px; }
.audio-controls { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 18px 0; }
.audio-controls label { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.audio-palettes { display: grid; gap: 12px; }
.audio-palette { border: 1px solid var(--line); padding: 12px; border-radius: 5px; }
.audio-palette h3 { margin: 0; color: var(--cyan); font-size: 15px; }
.audio-palette p { margin: 5px 0 10px; }
.audio-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.audio-buttons button { margin: 0; }
#audioDialog { width: min(700px, 94vw); max-height: 90vh; overflow-y: auto; }
#replaceSave[hidden] { display: none; }
@media (max-height: 760px) and (min-width: 751px) {
  .map-display-controls { top: 60px; max-width: 360px; }
  .theater .pause-indicator { top: 140px; }
}
@media (max-width: 750px) {
  .map-display-controls { top: 108px; left: 12px; right: auto; padding: 6px; gap: 6px; }
  .map-display-controls small { display: none; }
  .time { gap: 4px; }
  .time button { padding: 7px 8px; }
}
.res > .resource-square { width: 12px; height: 12px; }
.repair-state { color: var(--cyan); font-size: 13px; }
.pause-indicator {
  position: absolute;
  top: 103px;
  right: 20px;
  padding: 7px 10px;
  border: 1px solid #697c94;
  border-radius: 4px;
  background: #0b1422ed;
  color: #d7e2f1;
  font: 12px monospace;
  letter-spacing: 1.5px;
  pointer-events: none;
}
.pause-indicator[hidden] { display: none; }
.bar.health { position: relative; }
.bar.health > .health-trail {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: #f5d16f99;
}
.bar.health > i { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    14px Inter,
    Segoe UI,
    sans-serif;
}
button,
select {
  font: inherit;
}
button {
  background: #192435;
  color: #cdd9e9;
  border: 1px solid #334258;
  border-radius: 4px;
  padding: 9px 12px;
  cursor: pointer;
}
button:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button.active,
.primary {
  background: #123a35;
  border-color: #377e6b;
  color: var(--cyan);
}
button.danger {
  color: var(--pink);
}
button:focus-visible,
select:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
header {
  height: 96px;
  display: flex;
  align-items: center;
  padding: 0 30px;
  gap: 40px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  gap: 13px;
  align-items: center;
  text-decoration: none;
  color: #eff5ff;
  font:
    600 27px "Barlow Condensed",
    sans-serif;
  letter-spacing: 1px;
  white-space: nowrap;
}
.brand b {
  font-weight: 500;
  color: var(--cyan);
}
.brand small {
  display: block;
  color: var(--muted);
  font:
    10px "IBM Plex Mono",
    monospace;
  letter-spacing: 2px;
  margin-top: 7px;
}
.brand-icon {
  font-size: 45px;
  color: var(--cyan);
}
.mission {
  margin-left: auto;
  font:
    12px "IBM Plex Mono",
    monospace;
  letter-spacing: 1px;
}
.mission small {
  display: block;
  color: var(--muted);
  font:
    12px Inter,
    sans-serif;
  margin-top: 8px;
  letter-spacing: 0;
}
.live {
  color: var(--cyan);
  margin-right: 8px;
}
.time {
  display: flex;
  align-items: center;
  gap: 8px;
}
.time > span {
  font:
    18px "IBM Plex Mono",
    monospace;
  margin-right: 12px;
}
.time button {
  min-width: 38px;
  padding: 8px;
}
main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  height: calc(100vh - 212px);
  min-height: 560px;
}
.theater {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: radial-gradient(ellipse at 50% 55%, #11202b70, transparent 65%);
}
.maphead {
  padding: 29px 30px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.eyebrow {
  font:
    10px "IBM Plex Mono",
    monospace;
  color: var(--cyan);
  letter-spacing: 2px;
}
h1 {
  font:
    500 26px "Barlow Condensed",
    sans-serif;
  margin: 8px 0;
  color: #f0f4fa;
  letter-spacing: 0.4px;
}
.factions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font:
    10px "IBM Plex Mono",
    monospace;
  letter-spacing: 0.6px;
}
.cyan {
  color: var(--cyan);
}
.pink {
  color: var(--pink);
}
canvas {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: block;
}
.mapfoot {
  padding: 0 25px 20px;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}
.mapfoot > span:last-child {
  font:
    9px "IBM Plex Mono",
    monospace;
  letter-spacing: 0.4px;
  text-align: right;
}
.mapfoot > span:first-child {
  max-width: 65%;
}
aside {
  border-left: 1px solid var(--line);
  background: linear-gradient(140deg, #111a28, #0c121c);
  overflow-y: auto;
}
.paneltitle {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  font:
    10px "IBM Plex Mono",
    monospace;
  letter-spacing: 1px;
  color: var(--muted);
}
select {
  background: #101b29;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 7px;
  border-radius: 4px;
  max-width: 100%;
  margin-top: 12px;
  width: 100%;
}
#inspector {
  padding: 24px 22px;
}
.systemName {
  font:
    600 34px "Barlow Condensed",
    sans-serif;
  letter-spacing: 1px;
  margin: 5px 0 8px;
}
.subtitle {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.tag {
  border: 1px solid #2c6557;
  color: var(--cyan);
  padding: 4px 7px;
  border-radius: 3px;
  font:
    10px "IBM Plex Mono",
    monospace;
  display: inline-block;
}
.sectionlabel {
  color: var(--muted);
  font:
    10px "IBM Plex Mono",
    monospace;
  letter-spacing: 1.2px;
  display: flex;
  justify-content: space-between;
  margin: 25px 0 13px;
}
.resources {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.res {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px;
  background: #ffffff03;
  border: 1px solid #ffffff08;
  border-radius: 4px;
}
.res b {
  font:
    13px "IBM Plex Mono",
    monospace;
}
.res small {
  font-size: 10px;
  color: var(--muted);
}
.resicon {
  font:
    600 12px "IBM Plex Mono",
    monospace;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 4px;
}
.res > div {
  flex: 1;
}
.bar {
  height: 3px;
  background: #283344;
  margin-top: 6px;
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  background: var(--cyan);
}
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.actions button {
  font-size: 12px;
  text-align: left;
  padding: 10px;
}
.actions small {
  display: block;
  font:
    10px "IBM Plex Mono",
    monospace;
  color: var(--muted);
  margin-top: 5px;
}
.facility,
.unit,
.route {
  padding: 10px 0;
  border-bottom: 1px solid #ffffff09;
  font-size: 12px;
}
.facility .top,
.unit .top,
.route .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.facility small,
.unit small,
.route small {
  color: var(--muted);
  font-size: 10px;
  display: block;
  margin-top: 6px;
  line-height: 1.5;
}
.facility button,
.unit button,
.route button {
  padding: 5px 7px;
  font-size: 11px;
}
.unit.selected {
  border-left: 2px solid var(--cyan);
  padding-left: 8px;
}
.routecolors {
  display: flex;
  gap: 5px;
}
.routecolors button {
  padding: 6px;
  width: 38px;
  font:
    12px "IBM Plex Mono",
    monospace;
}
.empty {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
#routebar {
  position: absolute;
  bottom: 70px;
  left: 25px;
  right: 25px;
  background: #101e2af5;
  border: 1px solid #458b77;
  border-radius: 5px;
  padding: 14px;
  box-shadow: 0 8px 30px #0008;
  z-index: 2;
  font-size: 12px;
}
#routebar button {
  padding: 7px 10px;
  margin-left: 8px;
}
footer {
  height: 82px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 30px;
  border-top: 1px solid var(--line);
  background: #0e1521;
}
.objective {
  display: flex;
  align-items: center;
  gap: 13px;
}
.target {
  font-size: 32px;
  color: var(--cyan);
}
.objective small {
  display: block;
  font:
    9px "IBM Plex Mono",
    monospace;
  color: var(--muted);
  letter-spacing: 1.4px;
  margin-bottom: 7px;
}
.objective strong {
  font-size: 13px;
  font-weight: 500;
}
#stats {
  margin: auto;
  display: flex;
  gap: 35px;
}
#stats strong {
  font:
    22px "IBM Plex Mono",
    monospace;
  color: #edf4ff;
}
#stats small {
  display: block;
  font:
    9px "IBM Plex Mono",
    monospace;
  color: var(--muted);
  letter-spacing: 1px;
  margin-top: 4px;
}
footer button {
  font-size: 12px;
}
.ticker {
  height: 34px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--line);
  font:
    10px "IBM Plex Mono",
    monospace;
  color: var(--muted);
}
.ticker > span {
  color: var(--cyan);
  font-size: 9px;
  letter-spacing: 1.5px;
  white-space: nowrap;
}
dialog {
  background: #101b29;
  color: var(--text);
  border: 1px solid #355166;
  border-radius: 8px;
  padding: 36px;
  max-width: 650px;
  max-height: 90vh;
  line-height: 1.8;
  box-shadow: 0 30px 120px #000b;
}
dialog::backdrop {
  background: #030812ce;
  backdrop-filter: blur(8px);
}
dialog h2 {
  font:
    500 37px "Barlow Condensed",
    sans-serif;
  line-height: 1.2;
  color: white;
}
dialog p,
dialog li {
  font-size: 14px;
}
dialog li {
  padding-bottom: 8px;
}
dialog button {
  margin-top: 12px;
}
.close {
  float: right;
  margin: 0;
}
.muted {
  color: var(--muted);
}
.warning {
  color: #f5cc70;
  font-size: 12px;
  line-height: 1.7;
}
.techrow {
  padding: 7px 0;
  border-bottom: 1px solid #ffffff08;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.techrow button {
  font-size: 11px;
  padding: 4px 6px;
}
@media (max-width: 1100px) {
  header {
    padding: 0 18px;
    gap: 15px;
  }
  .mission {
    display: none;
  }
  main {
    grid-template-columns: minmax(0, 1fr) 310px;
  }
  .time {
    margin-left: auto;
  }
  .factions {
    display: none;
  }
  #stats {
    gap: 15px;
  }
  .mapfoot > span:last-child {
    display: none;
  }
}
@media (max-width: 750px) {
  header {
    height: 80px;
  }
  .brand {
    font-size: 21px;
  }
  .brand-icon {
    font-size: 32px;
  }
  .brand small {
    font-size: 8px;
  }
  .time > span {
    display: none;
  }
  main {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
  }
  .theater {
    height: 60vh;
    min-height: 420px;
  }
  aside {
    border-top: 1px solid var(--line);
    overflow: visible;
  }
  #inspector {
    display: block;
  }
  .maphead {
    padding: 20px;
  }
  .resources {
    grid-template-columns: repeat(3, 1fr);
  }
  footer {
    height: auto;
    min-height: 90px;
    flex-wrap: wrap;
    padding: 15px;
  }
  .objective {
    display: none;
  }
  #stats {
    margin: 0 auto 0 0;
  }
  .ticker {
    padding: 0 15px;
  }
  .ticker > span {
    display: none;
  }
}

/* Command UI: persistent controls, separate views and screen-sized targets. */
html,
body {
  height: 100%;
  overflow: hidden;
}
body {
  font-size: 16px;
  display: grid;
  grid-template-rows: 76px minmax(0, 1fr) 68px 32px;
}
header {
  height: auto;
  padding: 0 24px;
}
.brand {
  font-size: 25px;
}
.brand small {
  font-size: 11px;
  letter-spacing: 1.2px;
}
.mission {
  font-size: 13px;
}
.mission small {
  font-size: 13px;
}
.time button {
  min-height: 40px;
  min-width: 42px;
}
main {
  height: auto;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 370px;
}
.theater {
  overflow: hidden;
  min-height: 0;
}
.maphead {
  padding: 18px 24px 0;
  pointer-events: none;
}
.maphead h1 {
  font-size: 24px;
}
.eyebrow,
.factions {
  font-size: 12px;
}
.mapfoot {
  min-height: 44px;
  padding: 8px 20px;
  font-size: 13px;
}
.mapfoot > span:first-child {
  max-width: 100%;
}
.mapfoot > span:last-child {
  display: none;
}
canvas {
  touch-action: none;
  cursor: grab;
}
.map-navigation {
  position: absolute;
  top: 96px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: #0c1622e8;
  border: 1px solid var(--line);
  padding: 5px;
  border-radius: 7px;
  box-shadow: 0 6px 20px #0003;
}
.map-navigation button {
  min-width: 38px;
  min-height: 36px;
  font-size: 16px;
  padding: 5px 10px;
}
.map-navigation #fitMap {
  font-size: 13px;
  margin-left: 4px;
}
.map-navigation span {
  font:
    12px "IBM Plex Mono",
    monospace;
  min-width: 44px;
  text-align: center;
}
.map-legend {
  position: absolute;
  bottom: 54px;
  left: 20px;
  display: flex;
  gap: 16px;
  font:
    12px "IBM Plex Mono",
    monospace;
  color: #96a9c1;
  pointer-events: none;
}
.map-legend > span:first-child {
  color: #f5d16f;
}
.map-legend > span:last-child {
  font:
    12px Inter,
    sans-serif;
  color: #9dc7ba;
}
aside {
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: #34465c transparent;
}
#commandAlerts {
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--line);
}
#commandHeader { position: sticky; top: 0; z-index: 4; background: #0f1826; }
#commandHeader .panel-tabs { position: static; }
#commandAlerts .sectionlabel { margin: 10px 0 6px; }
.alert-list { max-height: 96px; overflow-y: auto; display: grid; gap: 4px; }
.alert-list button { text-align: left; font-size: 12px; padding: 7px 9px; }
.alert-list small { color: var(--muted); }
.attention-shortcuts { display: flex; gap: 6px; padding: 6px 12px; }
.attention-shortcuts button { flex: 1; font-size: 11px; padding: 5px; }
.alert-priority-0 { border-left: 3px solid var(--pink); }
.alert-priority-1, .alert-priority-2 { border-left: 3px solid #ffbc72; }
#quickSupply {
  position: sticky;
  top: var(--command-header-height, 180px);
  z-index: 3;
  padding: 10px 16px;
  background: #101c2a;
  border-bottom: 1px solid #35505b;
}
#quickSupply[hidden] { display: none; }
#quickSupply b { font-size: 13px; }
#quickSupply small { color: var(--muted); font-size: 11px; }
#quickSupply .routecolors { margin: 7px 0 3px; }
#quickSupply button { min-height: 34px; }
aside[data-view="planets"] #inspector { padding: 14px 16px; }
aside[data-view="planets"] .systemName { font-size: 28px; }
aside[data-view="planets"] .subtitle { font-size: 12px; line-height: 1.5; }
aside[data-view="planets"] .resources { gap: 5px; }
aside[data-view="planets"] .res { padding: 6px; gap: 6px; }
aside[data-view="planets"] .sectionlabel { margin-top: 16px; margin-bottom: 8px; }
.incoming-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.incoming-row b { font-size: 12px; font-weight: 500; }
.incoming-row small, .project-forecast { display: block; font-size: 12px; line-height: 1.5; color: #a8c9d4; }
button.text-link { padding: 0; min-height: 0; background: none; border: 0; border-radius: 0; color: var(--cyan); text-decoration: underline; font: inherit; }
.catalog-toggle { width: 100%; text-align: left; margin-top: 12px; }
.demolition-choice { margin: 12px 0; padding: 12px; border: 1px solid #a95b70; border-radius: 5px; background: #291c2a; }
.demolition-choice b, .demolition-choice p { font-size: 13px; line-height: 1.5; }
.panel-tabs {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 10px;
  background: #0f1826;
  border-bottom: 1px solid var(--line);
  gap: 6px;
}
.panel-tabs button {
  flex: 1;
  min-height: 42px;
  font-size: 14px;
}
.panel-tabs [aria-selected="true"] {
  border-color: #478d79;
  background: #153b33;
  color: var(--cyan);
}
#battleCount:not(:empty) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 9px;
  background: #573b32;
  color: #ffc190;
  margin-left: 3px;
  font-size: 12px;
}
.paneltitle {
  padding: 14px 20px;
  font-size: 12px;
  letter-spacing: 0.7px;
}
select {
  font-size: 14px;
  min-height: 40px;
  margin-top: 8px;
}
#inspector {
  padding: 20px;
}
.subtitle,
.empty,
.warning {
  font-size: 14px;
}
.tag {
  font-size: 12px;
}
.sectionlabel {
  font-size: 12px;
  letter-spacing: 0.7px;
  margin: 22px 0 12px;
  gap: 8px;
}
.res {
  padding: 8px;
  gap: 7px;
}
.res b {
  font-size: 15px;
}
.res small {
  font-size: 12px;
}
.resicon {
  font-size: 13px;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}
.actions button,
.facility,
.route,
.unit,
.techrow {
  font-size: 14px;
}
.actions button {
  min-height: 45px;
}
.actions small,
.facility small,
.route small,
.unit small,
.techrow small {
  font-size: 12px;
}
.facility button,
.route button,
.unit button,
.techrow button {
  font-size: 13px;
  padding: 8px;
  min-height: 36px;
}
.facility .top,
.route .top {
  align-items: flex-start;
}
.facility .top > span,
.route .top > span {
  line-height: 1.5;
}
.routecolors {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}
.routecolors button {
  width: 100%;
  min-height: 40px;
  font-size: 14px;
  padding: 7px;
}
.bar {
  height: 4px;
}
.bar.health {
  height: 6px;
  margin: 10px 0;
}
.command-card {
  border: 1px solid #35574f;
  border-radius: 7px;
  padding: 16px;
  margin: 18px 0;
  background: linear-gradient(120deg, #15312988, #15233355);
}
.command-card h3 {
  font:
    600 29px "Barlow Condensed",
    sans-serif;
  margin: 12px 0;
}
.command-card p {
  font-size: 14px;
  line-height: 1.6;
}
.big-health {
  font:
    25px "IBM Plex Mono",
    monospace;
}
.big-health small {
  font-size: 14px;
  color: var(--muted);
}
.roster {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 13px 12px;
  margin-bottom: 8px;
  min-height: 68px;
}
.roster b,
.roster strong {
  font-size: 14px;
}
.roster small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}
.battle-tag {
  color: #ffc08c;
  border-color: #8c6344;
}
.battle-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0;
}
.battle-switches button {
  font-size: 13px;
}
.combat-clock {
  padding: 16px;
  border: 1px solid #725740;
  border-radius: 7px;
  background: #30221855;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}
.combat-clock > span {
  font:
    12px "IBM Plex Mono",
    monospace;
  color: #ffc08c;
}
.combat-clock > strong {
  font:
    25px "IBM Plex Mono",
    monospace;
  color: #ffcc9e;
}
.combat-clock > small,
.combat-clock > .bar {
  grid-column: 1/-1;
}
.combat-clock > small {
  font-size: 12px;
  color: var(--muted);
}
.battle-sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
  gap: 10px;
}
.battle-side {
  padding: 12px;
  background: #142b2a55;
  border: 1px solid #2c5950;
  border-radius: 6px;
}
.battle-side .sectionlabel {
  margin: 0 0 12px;
  color: var(--cyan);
}
.battle-side.hostile {
  background: #38212b55;
  border-color: #683749;
}
.battle-side.hostile .sectionlabel {
  color: var(--pink);
}
.battle-side > strong {
  font:
    25px "IBM Plex Mono",
    monospace;
}
.battle-side small,
.battle-side p {
  font-size: 12px;
}
.battle-side p {
  margin-bottom: 0;
  color: var(--muted);
}
.combat-unit {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.combat-unit .top {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
.combat-unit > small {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin: 8px 0;
  line-height: 1.7;
}
.volley-report p {
  font-size: 12px;
  line-height: 1.7;
  padding: 7px 0;
  margin: 0;
  border-bottom: 1px solid #ffffff08;
}
.volley-report span {
  color: var(--muted);
}
.volley-report b {
  display: block;
  color: #ffbc88;
}
.quiet-state {
  text-align: center;
  border: 1px dashed #34485f;
  border-radius: 7px;
  padding: 28px 18px;
  color: var(--muted);
  margin: 26px 0;
}
.quiet-state > h3 {
  color: var(--text);
  font-size: 18px;
}
.quiet-state > p {
  font-size: 14px;
  line-height: 1.8;
}
#routebar {
  bottom: 90px;
  left: 20px;
  right: 20px;
  font-size: 14px;
  line-height: 1.8;
}
#routebar button {
  font-size: 14px;
  min-height: 40px;
  margin: 8px 6px 0 0;
}
#routebar small {
  font-size: 13px;
}
footer {
  height: auto;
  padding: 0 24px;
}
#stats {
  gap: 24px;
}
#stats small,
.objective small {
  font-size: 11px;
  letter-spacing: 0.8px;
}
footer button {
  font-size: 13px;
  min-height: 38px;
}
.ticker {
  height: auto;
  font-size: 12px;
  overflow: hidden;
}
.ticker > span {
  font-size: 11px;
}
.ticker > div {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
dialog p,
dialog li {
  font-size: 16px;
}
dialog {
  max-width: 720px;
}
dialog .eyebrow {
  font-size: 12px;
}
button {
  transition:
    background 0.12s,
    border-color 0.12s;
}
button:active {
  background: #245044;
  transform: translateY(1px);
}
button:disabled {
  transform: none;
}
.paneltitle[hidden] {
  display: none;
}
#systemSearch { width: 100%; min-width: 0; margin: 6px 0; padding: 7px; background: #101b29; color: var(--text); border: 1px solid var(--line); border-radius: 4px; }
#systemNavigationMessage { display: block; color: #d8c68f; letter-spacing: normal; }
@media (max-width: 1150px) {
  main {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
  .mission {
    display: none;
  }
  .time {
    margin-left: auto;
  }
  .map-legend > span:last-child {
    display: none;
  }
  .objective {
    display: none;
  }
}
@media (max-height: 760px) and (min-width: 751px) {
  body {
    grid-template-rows: 64px minmax(0, 1fr) 54px 28px;
  }
  .maphead {
    padding: 12px 20px 0;
  }
  .maphead h1 {
    font-size: 20px;
  }
  .maphead .eyebrow {
    display: none;
  }
  .map-navigation {
    top: 61px;
  }
  .mapfoot {
    min-height: 35px;
    font-size: 12px;
  }
  .map-legend {
    bottom: 43px;
  }
  #inspector {
    padding: 16px;
  }
}
@media (max-width: 750px) {
  html,
  body {
    overflow: auto;
    height: auto;
    min-height: 100%;
  }
  body {
    display: block;
  }
  header {
    height: 72px;
    padding: 0 14px;
  }
  .brand {
    font-size: 21px;
  }
  .brand small {
    font-size: 9px;
  }
  .brand-icon {
    font-size: 30px;
  }
  .time {
    gap: 4px;
  }
  .time button {
    min-width: 34px;
    padding: 6px;
  }
  main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: auto;
  }
  .theater {
    height: 65svh;
    min-height: 410px;
    flex-shrink: 0;
  }
  aside {
    max-height: 65svh;
    overflow-y: auto;
  }
  .maphead {
    padding: 12px 16px 0;
  }
  .maphead .eyebrow {
    display: none;
  }
  .maphead h1 {
    font-size: 20px;
  }
  .map-navigation {
    top: 55px;
    left: 12px;
  }
  .map-legend {
    left: 12px;
    gap: 10px;
    font-size: 11px;
  }
  .mapfoot {
    padding: 8px 12px;
  }
  .resources {
    grid-template-columns: repeat(3, 1fr);
  }
  footer {
    min-height: 70px;
    padding: 12px;
    gap: 7px;
  }
  #stats {
    gap: 12px;
  }
  #stats strong {
    font-size: 18px;
  }
  #stats small {
    font-size: 10px;
  }
  footer button {
    font-size: 12px;
  }
  .ticker {
    min-height: 28px;
    padding: 0 12px;
  }
  .ticker > span {
    display: none;
  }
  .objective {
    display: none;
  }
  .factions {
    display: none;
  }
}

.summary-retreat {
  font-size: 12px;
  padding: 7px;
  margin-top: 12px;
  width: 100%;
  min-height: 34px;
  border-color: #46796a;
  color: var(--cyan);
}
@media (max-height: 850px) and (min-width: 751px) {
  aside[data-view="battles"] #inspector > .subtitle {
    display: none;
  }
  aside[data-view="battles"] .systemName {
    font-size: 28px;
    margin: 10px 0;
  }
  aside[data-view="battles"] .battle-switches {
    margin: 12px 0;
  }
  aside[data-view="battles"] .combat-clock {
    padding: 12px;
    gap: 5px;
  }
  aside[data-view="battles"] .battle-side {
    padding: 10px;
  }
  aside[data-view="battles"] .battle-side .sectionlabel {
    margin-bottom: 8px;
  }
}

@media (max-width: 750px) {
  .brand small {
    display: none;
  }
  .brand {
    font-size: 20px;
    gap: 8px;
  }
  .brand-icon {
    font-size: 26px;
  }
  .time button {
    min-width: 32px;
  }
  header {
    gap: 10px;
  }
  .time {
    flex-shrink: 0;
  }
}

/* Sector selection, live orders and story-driven training. */
.start-menu {
  width: min(1160px, 94vw);
  max-width: none;
  max-height: 94svh;
  padding: 34px 38px;
  background:
    radial-gradient(ellipse at 85% 5%, #1c4d4855, transparent 55%), #0c1522;
  border: 1px solid #3c6c65;
}
.start-menu::backdrop {
  background: #03070df5;
  backdrop-filter: blur(10px);
}
.menu-eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--cyan);
  font:
    12px "IBM Plex Mono",
    monospace;
  letter-spacing: 2px;
}
.menu-eyebrow button {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0;
}
.start-menu #menuTitle {
  font:
    600 76px/0.96 "Barlow Condensed",
    sans-serif;
  letter-spacing: 2px;
  margin: 28px 0 20px;
}
.start-menu #menuTitle span {
  color: var(--cyan);
}
.menu-intro {
  font-size: 18px !important;
  line-height: 1.6;
  margin-bottom: 28px;
}
.menu-intro span {
  font-size: 14px;
  color: var(--muted);
}
.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.mode-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 20px;
  min-height: 255px;
  background: linear-gradient(145deg, #1a293a, #101c2b);
  border-color: #35475b;
  margin: 0;
  border-radius: 7px;
}
.mode-card:hover {
  background: linear-gradient(145deg, #203c3b, #13282d);
}
.mode-card.tutorial-card {
  border-color: #4e9680;
  background: linear-gradient(140deg, #1a4137, #12242c);
}
.mode-icon {
  font:
    32px "IBM Plex Mono",
    monospace;
  color: var(--cyan);
  margin-bottom: 16px;
}
.mode-card strong {
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
}
.mode-card small {
  font-size: 12px;
  color: #9aafc7;
  margin: 6px 0;
}
.mode-card p {
  font-size: 13px !important;
  line-height: 1.7;
  color: var(--muted);
  margin: 6px 0 20px;
}
.mode-foot {
  font:
    11px "IBM Plex Mono",
    monospace;
  letter-spacing: 1px;
  color: var(--cyan);
  margin-top: auto;
}
.menu-note {
  font:
    11px "IBM Plex Mono",
    monospace !important;
  letter-spacing: 1.4px;
  color: var(--muted);
  margin-top: 26px;
  margin-bottom: 0;
}
.lesson-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.lesson-grid button {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 5px 10px;
  text-align: left;
  margin: 0;
  padding: 13px;
  min-height: 83px;
}
.lesson-grid button > span {
  grid-row: 1/3;
  color: var(--cyan);
  align-self: center;
}
.lesson-grid strong {
  font-size: 14px;
}
.lesson-grid small {
  font-size: 12px;
  color: var(--muted);
}
#trainingPicker .sectionlabel {
  margin-top: 30px;
}
.destroy-facility {
  font-size: 12px !important;
  padding: 5px 9px !important;
  min-height: 29px !important;
  margin-top: 8px;
  color: #e9a6b3;
  border-color: #684353;
  background: #351e2a55;
}
.destroy-facility:hover {
  border-color: var(--pink);
  color: var(--pink);
}
.fleet-order,
.fleet-eta,
.eta {
  font-family: "IBM Plex Mono", monospace;
}
.fleet-order {
  padding: 11px 0;
}
.fleet-order strong {
  font-size: 14px;
}
.fleet-order small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}
.fleet-order .eta {
  color: var(--cyan);
  font-size: 18px;
}
.roster {
  flex-wrap: wrap;
}
.roster-eta {
  flex-basis: 100%;
  font:
    12px "IBM Plex Mono",
    monospace;
  color: var(--cyan);
  margin-top: 4px;
}
.command-card .fleet-order {
  border-block: 1px solid #ffffff12;
  margin-bottom: 16px;
}
.fleet-order-label {
  font:
    11px "IBM Plex Mono",
    monospace;
  color: var(--muted);
}
.command-card .fleet-order small {
  font-size: 11px;
}
.tutorial-comms[hidden] {
  display: none;
}
body.is-tutorial {
  grid-template-rows: 76px auto minmax(0, 1fr) 68px 32px;
}
.tutorial-comms {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 235px;
  align-items: center;
  gap: 20px;
  padding: 18px 24px;
  background: linear-gradient(110deg, #153329, #102332 70%);
  border-bottom: 1px solid #477967;
}
.comms-avatar {
  width: 54px;
  height: 62px;
  border: 1px solid #69cbaa;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #346453, #112622);
  font:
    24px "IBM Plex Mono",
    monospace;
  color: #b9ffe5;
  box-shadow: 0 0 18px #62f2bd13;
}
.comms-message h2 {
  font:
    600 25px "Barlow Condensed",
    sans-serif;
  margin: 7px 0;
}
.comms-message p {
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
  color: #b4cbd3;
}
.comms-message .eyebrow {
  font-size: 11px;
  letter-spacing: 1px;
}
.comms-objective {
  border-left: 1px solid #497363;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.comms-objective .eyebrow {
  font-size: 11px;
}
.comms-objective strong {
  font-size: 14px;
  line-height: 1.4;
}
.comms-objective small {
  font:
    11px "IBM Plex Mono",
    monospace;
  color: var(--muted);
}
.comms-objective button {
  font-size: 13px;
  min-height: 36px;
}
.comms-objective .quiet-button {
  border: none;
  background: transparent;
  color: #a5b9c2;
  padding: 0;
  min-height: 25px;
  font-size: 12px;
}
.is-tutorial .objective strong {
  font-size: 12px;
}
.is-tutorial .map-legend > span:last-child {
  display: none;
}
.is-tutorial .maphead {
  padding-top: 12px;
}
.is-tutorial .maphead h1 {
  font-size: 20px;
}
.is-tutorial .maphead .eyebrow {
  display: none;
}
.is-tutorial .map-navigation {
  top: 59px;
}
#resume[hidden],
#trainingPicker[hidden] {
  display: none;
}
.fleet-order span[data-eta] {
  display: block;
}
@media (max-width: 1000px) {
  .mode-grid {
    grid-template-columns: 1fr 1fr;
  }
  .mode-card {
    min-height: 190px;
  }
  .mode-icon {
    font-size: 26px;
    margin-bottom: 10px;
  }
  .mode-card p {
    margin-bottom: 10px;
  }
  .start-menu #menuTitle {
    font-size: 60px;
  }
  .tutorial-comms {
    grid-template-columns: 40px minmax(0, 1fr) 200px;
    gap: 12px;
    padding: 14px;
  }
  .comms-avatar {
    width: 40px;
    height: 50px;
    font-size: 18px;
  }
  .comms-message p {
    font-size: 13px;
  }
}
@media (max-height: 850px) and (min-width: 751px) {
  body.is-tutorial {
    grid-template-rows: 64px auto minmax(0, 1fr) 54px 28px;
  }
  .tutorial-comms {
    padding: 12px 18px;
  }
  .comms-message h2 {
    font-size: 22px;
    margin: 5px 0;
  }
  .comms-message p {
    font-size: 13px;
  }
  .start-menu {
    padding: 25px 30px;
  }
  .start-menu #menuTitle {
    font-size: 60px;
    margin: 20px 0 14px;
  }
  .mode-card {
    min-height: 215px;
    padding: 16px;
  }
  .mode-card p {
    font-size: 12px !important;
  }
  .menu-intro {
    margin-bottom: 20px;
  }
  .menu-note {
    margin-top: 18px;
  }
  .is-tutorial .maphead {
    display: none;
  }
  .is-tutorial .map-navigation {
    top: 12px;
  }
}
@media (max-width: 750px) {
  .time button {
    min-width: 28px;
    padding: 5px;
    font-size: 13px;
  }
  #menu {
    font-size: 11px;
    min-width: 39px;
  }
  .brand {
    font-size: 18px;
  }
  .brand-icon {
    font-size: 21px;
  }
  .start-menu {
    width: 94vw;
    padding: 22px;
  }
  .start-menu #menuTitle {
    font-size: 48px;
    margin: 24px 0 14px;
  }
  .menu-eyebrow {
    font-size: 10px;
    letter-spacing: 1px;
  }
  .menu-eyebrow button {
    font-size: 12px;
    padding: 7px;
  }
  .menu-intro {
    font-size: 16px !important;
  }
  .mode-grid {
    grid-template-columns: 1fr;
  }
  .mode-card {
    min-height: 165px;
    padding: 16px;
  }
  .mode-icon {
    font-size: 23px;
    margin-bottom: 8px;
  }
  .mode-card p {
    margin-bottom: 12px;
  }
  .lesson-grid {
    grid-template-columns: 1fr;
  }
  .menu-note {
    font-size: 10px !important;
    letter-spacing: 0.7px;
  }
  .tutorial-comms {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
  }
  .comms-avatar {
    width: 32px;
    height: 42px;
    font-size: 14px;
    align-self: start;
  }
  .comms-message .eyebrow {
    font-size: 9px;
    letter-spacing: 0.5px;
  }
  .comms-message h2 {
    font-size: 22px;
  }
  .comms-message p {
    font-size: 13px;
    line-height: 1.7;
  }
  .comms-objective {
    grid-column: 2;
    border-left: 0;
    padding-left: 0;
    gap: 6px;
  }
  .comms-objective .eyebrow,
  .comms-objective small {
    display: none;
  }
  .comms-objective strong {
    font-size: 13px;
  }
  .is-tutorial .theater {
    height: 55svh;
    min-height: 360px;
  }
  .comms-objective button {
    font-size: 12px;
  }
  .is-tutorial .maphead {
    display: none;
  }
  .is-tutorial .map-navigation {
    top: 12px;
  }
}

.comms-choices {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.comms-choices button {
  font-size: 13px;
  padding: 8px 12px;
  text-align: left;
  min-height: 38px;
  border-color: #466e66;
}
.comms-choices button:hover {
  background: #245649;
}
.comms-message {
  min-width: 0;
}
.comms-message[aria-live] {
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
}
@media (max-width: 750px) {
  .comms-choices {
    display: grid;
    grid-template-columns: 1fr;
  }
  .comms-choices button {
    font-size: 12px;
  }
  .comms-message[aria-live] {
    max-height: none;
    overflow: visible;
  }
}
/* Phone command surface: the document never scrolls away from the map. */
#mobileCommands { display: none; }
#mobileSurrender { display: none; }
.step-complete { color: var(--cyan); font-size: 12px; margin: 0; }
@media (max-width: 750px) {
  html, body { height: 100%; overflow: hidden; }
  body, body.is-tutorial { height: 100dvh; min-height: 0; display: flex; flex-direction: column; }
  header { flex: 0 0 56px; height: 56px; padding: 0 10px; gap: 6px; }
  .brand { font-size: 14px; }
  .brand-icon, .brand small, header .mission, #help, #saveMatch { display: none; }
  .time { margin-left: auto; }
  .time button { min-width: 36px; min-height: 40px; }
  main { position: relative; flex: 1; height: 0; min-height: 0; display: block; }
  .theater, .is-tutorial .theater { width: 100%; height: 100%; min-height: 0; }
  .maphead, .map-legend, .mapfoot, footer, .ticker { display: none; }
  .map-navigation, .is-tutorial .map-navigation { top: 10px; left: 10px; }
  .map-display-controls { top: 58px; left: 10px; right: 10px; width: fit-content; max-width: calc(100% - 20px); }
  .map-display-controls label { font-size: 11px; }
  .theater .pause-indicator { top: 110px; }
  #map { touch-action: none; }
  #commands { position: absolute; z-index: 8; bottom: calc(60px + env(safe-area-inset-bottom)); left: 8px; right: 8px; height: 49%; max-height: none; overflow-y: auto; overscroll-behavior: contain; border: 1px solid #3f6677; border-radius: 16px 16px 8px 8px; box-shadow: 0 -8px 30px #0008; background: #0f1826; display: none; }
  .commands-open #commands { display: block; }
  #mobileCommands { display: block; position: fixed; z-index: 10; bottom: calc(8px + env(safe-area-inset-bottom)); left: 12px; right: 12px; min-height: 44px; background: #18343f; border-color: #477e8e; }
  #mobileSurrender { display: inline-block; margin: 6px 12px; }
  #commands button, #commands select { min-height: 40px; }
  #commandHeader { position: static; }
  #commandAlerts, .attention-shortcuts { display: none; }
  #quickSupply { position: static; padding: 8px 12px; }
  #commands #inspector { padding: 12px; }
  #routebar { z-index: 9; bottom: calc(64px + env(safe-area-inset-bottom)); max-width: calc(100% - 20px); }
  .tutorial-comms { flex: 0 0 auto; max-height: 31dvh; overflow-y: auto; display: flex; flex-direction: column; padding: 10px 12px; gap: 7px; }
  .comms-avatar, .comms-message .eyebrow, .comms-message h2 { display: none; }
  .comms-message p { font-size: 12px; line-height: 1.45; margin: 0; }
  .comms-objective { position: sticky; bottom: -10px; display: flex; flex-direction: row; align-items: center; justify-content: space-between; background: #101c2a; padding: 6px 0; gap: 8px; }
  .comms-objective strong { font-size: 12px; }
  .comms-objective button { min-height: 40px; flex-shrink: 0; }
  .comms-objective .step-complete { font-size: 10px; }
}
@media (max-width: 750px) {
  #commands .paneltitle { padding: 6px 10px; }
  #commands .paneltitle > span { display: none; }
  #commands .paneltitle select { width: 100%; max-width: none; }
  #quickSupply b, #quickSupply small { display: none; }
  #quickSupply .routecolors { margin: 0; }
  #commands .systemName { font-size: 23px; margin: 4px 0; }
  #commands .subtitle { font-size: 11px; }
  #commands .sectionlabel { margin: 8px 0; }
  #commands .res { padding: 5px; font-size: 11px; }
}
#expandCommands { display: none; }
@media (max-width: 750px) {
  #expandCommands { display: block; width: 100%; min-height: 28px; padding: 3px; font-size: 10px; border: 0; border-radius: 14px 14px 0 0; }
  .commands-tall #commands { height: calc(100% - 68px - env(safe-area-inset-bottom)); }
}
#routebar { max-width: min(600px, calc(100% - 32px)); padding: 0; }
.route-review { max-height: 31dvh; overflow-y: auto; overscroll-behavior: contain; padding: 12px 14px; }
.route-review p { font-size: 12px; line-height: 1.45; margin: 7px 0; }
.route-review small { display: block; font-size: 11px; line-height: 1.45; color: #c4d3df; }
#routebar .route-review-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 12px; border-top: 1px solid #3e5469; background: #101c2a; }
#routebar .route-review-actions button { float: none; margin: 0; min-height: 40px; }
@media (max-width: 750px) {
  #routebar { left: 10px; right: 10px; width: auto; max-width: none; }
  .route-review { max-height: 26dvh; padding: 10px; }
}
@media (min-width: 751px) {
  #routebar { left: auto; right: 20px; max-width: min(480px, calc(100% - 40px)); }
}
.system-status-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.system-status-chip { display: block; border: 1px solid currentColor; border-radius: 4px; background: #101d2c; padding: 5px 7px; font: 700 11px monospace; }
.system-status-chip small { display: block; max-width: 280px; font: 11px/1.4 Inter,sans-serif; margin-top: 3px; color: #dbe6ef; }
@media (max-width: 750px) {
  .system-status-list { margin: 7px 0; gap: 4px; }
  .system-status-chip { font-size: 10px; padding: 3px 5px; }
  .system-status-chip small { display: none; }
  .commands-tall .system-status-chip small { display: block; }
}
.compact-system-status { display: none; }
@media (max-width: 750px) {
  .compact-system-status { display: inline-block; margin-left: 8px; padding: 3px 5px; border: 1px solid currentColor; border-radius: 3px; background: #101d2c; font: 700 10px monospace; vertical-align: middle; }
  .system-status-list { display: none; }
  .commands-tall .system-status-list { display: flex; }
  .commands-tall .compact-system-status { display: none; }
}
.group-orders { padding: 10px; border: 1px solid #355365; border-radius: 6px; margin: 10px 0; background: #101d2c; }
.group-orders p, .group-orders small { font-size: 12px; line-height: 1.5; color: #c2d2df; }
.saved-groups { display: grid; gap: 5px; margin: 8px 0; }
.saved-groups > div { display: flex; gap: 5px; }
.saved-groups button { flex: 1; padding: 6px; font-size: 11px; }
.group-toggle { margin-top: 12px; font-size: 12px; width: 100%; }
.group-toggle[aria-pressed="true"], .retreat-options [aria-pressed="true"] { background: #214944; border-color: #85ecd1; }
.retreat-options { display: flex; flex-wrap: wrap; gap: 6px; }
.retreat-options button { font-size: 12px; }
.factory-rally { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 8px 0; }
.factory-rally small { width: 100%; }
.factory-rally button { font-size: 11px; padding: 5px; }
.order-warning { color: #ffb5c8; }
#orderFeedback { position: absolute; z-index: 10; top: 110px; left: 20px; max-width: min(500px, calc(100% - 40px)); padding: 10px; background: #101d2cf5; color: #e7f5f2; border: 1px solid #7bbaa9; border-radius: 5px; font: 12px/1.5 Inter,sans-serif; pointer-events: none; }
#orderFeedback[hidden] { display: none; }
@media (max-width: 750px) {
  #orderFeedback { top: 145px; left: 10px; max-width: calc(100% - 20px); }
  .route-review-actions { flex-wrap: wrap; }
}
#orderFeedback { pointer-events: auto; max-height: 27dvh; overflow-y: auto; padding-right: 36px; }
#dismissOrderFeedback { position: sticky; top: 0; float: right; margin-right: -28px; min-width: 24px; min-height: 24px; padding: 2px 5px; }
.group-tools { margin: 12px 0; }
.group-tools > summary { cursor: pointer; min-height: 40px; padding: 8px; border: 1px solid #355365; border-radius: 4px; color: #d7eee8; font-size: 12px; }
#dismissOrderFeedback { min-width: 32px; min-height: 32px; }
.quick-fleet-review p { margin: 4px 0; font-size: 11px; }
.quick-fleet-review small { font-size: 10px; }
[hidden] { display: none !important; }
.map-display-controls label { display: inline-flex; align-items: center; gap: 5px; margin-right: 8px; }
.explanation { margin: 4px 0; color: #b9d2dd; font-size: 11px; }
.explanation summary { cursor: pointer; color: #84e4d0; }
.explanation small { display: block; line-height: 1.45; }
.catalog-item { min-width: 0; }
.catalog-item > button { width: 100%; }
#eventNotices { position: absolute; z-index: 11; top: 155px; left: 20px; display: grid; gap: 5px; width: min(330px, calc(100% - 40px)); pointer-events: none; }
.event-notice { pointer-events: auto; text-align: left; background: #122532f5; border-left: 4px solid #69e5c4; color: #e6fff7; }
.event-notice.warning { border-left-color: #f5ce73; }
.event-notice.danger { border-left-color: #ff718e; }
.factions { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; gap: 5px 12px; max-width: 60%; }
.map-display-controls label small { width: auto; }
#sectorOverview { position: absolute; z-index: 3; right: 16px; bottom: 65px; width: 200px; height: 120px; border: 1px solid #7ca9ac; border-radius: 4px; cursor: crosshair; }
@media (max-width: 750px) { #sectorOverview { right: 10px; bottom: 72px; width: 150px; height: 90px; } }
.theater .pause-indicator { top: auto; bottom: 78px; left: 20px; right: auto; }
.shortcut-reference { font-size: 11px; color: #a7d8ca; }
.shortcut-reference summary { cursor: pointer; }
.shortcut-reference small { display: block; line-height: 1.5; }
.team-presets { display: flex; gap: 8px; margin: 10px 0; }
.destination-picker { display: block; margin: 8px 12px; font-size: 12px; }
.destination-picker select { display: block; max-width: 100%; margin-top: 4px; }
#onlineMap { display: block; width: 100%; max-width: 800px; height: auto; background: #091320; border: 1px solid #355365; border-radius: 4px; cursor: pointer; }
body.online-playing .start-menu { width: min(1100px, 96vw); max-width: 1100px; }
body.online-playing .start-menu > :not(.online-lobby) { display: none !important; }
body.online-playing .online-lobby > summary, body.online-playing .online-entry, body.online-playing .online-invite { display: none; }
body.online-playing #onlineGame label { display: inline-flex; flex-direction: column; gap: 4px; margin: 5px; }
body.online-playing #onlineGame .actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* Room and local setup share the same compact command styling. */
.online-lobby { margin: 20px 0; padding: 16px; border: 1px solid #31506a; border-radius: 10px; background: #101d2c; }
.online-lobby > summary { cursor: pointer; font-weight: 700; color: #a9f5e7; }
.online-entry, #onlineControls { display: grid; gap: 12px; margin-top: 16px; }
.online-entry[hidden], #onlineControls[hidden], .online-seat[hidden] { display: none; }
.online-entry label, .online-invite label, #onlineSetupFields > label { display: grid; gap: 5px; }
.online-invite { padding: 12px; border: 1px solid #29475d; border-radius: 8px; }
#onlineShare { font-weight: 700; color: #a9f5e7; overflow-wrap: anywhere; }
#onlineInviteLink { overflow-wrap: anywhere; }
#onlineRoster { display: grid; gap: 6px; padding-left: 20px; }
#onlineSetupFields { display: grid; gap: 10px; margin: 12px 0; }
.online-seat { padding: 10px; border: 1px solid #29475d; border-radius: 8px; }


/* Unified operation setup */
.start-menu { width: min(960px, 94vw); padding: 28px clamp(18px, 4vw, 40px); }
.start-menu #menuTitle { font-size: clamp(42px, 7vw, 64px); margin: 16px 0 10px; }
.menu-intro { margin-bottom: 18px; font-size: 15px !important; }
.save-panel { border: 1px solid #29475d; border-radius: 8px; padding: 10px 14px; margin: 0 0 18px; }
.save-panel summary, .online-invite summary { cursor: pointer; color: #b9d7dd; }
.opponent-settings { padding: 20px; border: 1px solid #31506a; border-radius: 10px; background: #101d2c; }
.setup-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.setup-heading h2 { margin: 4px 0 0; font-size: 24px; }
.setup-heading p { max-width: 300px; margin: 0; color: #a4b8ca; }
.setup-map { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.setup-map label, .opponent-selectors label { display: flex; flex-direction: column; gap: 5px; }
.setup-seat { padding: 12px; margin: 8px 0; border: 1px solid #29475d; border-radius: 8px; background: #0b1725; }
.seat-title { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.seat-title span { color: #8baab4; font: 10px monospace; letter-spacing: .08em; }
.setup-seat .opponent-selectors { display: flex; flex-wrap: wrap; gap: 10px; }
.setup-seat .opponent-selectors label { flex: 1 1 120px; }
.setup-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.setup-primary { background: #b1f4df; color: #102923; border-color: #b1f4df; font-weight: 700; }
.mode-grid[hidden] { display: none; }
@media (max-width: 600px) { .setup-heading { display: block; } .setup-heading p { margin-top: 8px; } .setup-actions > button { flex: 1 1 140px; } }

body.room-active .save-panel, body.room-active .setup-actions [data-mode="tutorial"] { display: none; }
/* Command workspace */
body > header { min-height: 58px; padding: 6px 16px; gap: 16px; }
.brand-icon { font-size: 29px; }
.brand small, .mission small, #playerRoster, .maphead, footer, .ticker { display: none; }
.mission { margin-left: auto; font-size: 11px; }
.time { gap: 5px; }
.time button { min-height: 34px; padding: 5px 8px; }
main { flex: 1; min-height: 0; grid-template-columns: minmax(0, 1fr) 270px; }
#commands { position: relative; overflow-y: auto; }
#commandHeader { position: static; }
#systemPicker { padding: 8px 12px; }
#rosterList { padding: 0 12px 15px; }
.roster-entry { width: 100%; display: flex; justify-content: space-between; text-align: left; margin: 3px 0; }
.roster-entry small { color: var(--muted); }
.attention-hub { position: fixed; top: 70px; left: 16px; z-index: 20; width: min(320px, calc(100vw - 32px)); }
.attention-hub details { background: #0e1928ef; border: 1px solid #34465b; border-radius: 5px; padding: 8px; }
.attention-hub summary { cursor: pointer; color: var(--cyan); }
#eventNotices { position: static; width: 100%; margin-top: 5px; }
.map-display-controls { top: auto; left: auto; right: 14px; bottom: 14px; width: 350px; max-width: calc(100% - 28px); }
.map-navigation { position: static; width: 100%; background: transparent; border: 0; padding: 0; box-shadow: none; }
.mapfoot, .map-legend { display: none; }
.pause-indicator { bottom: 18px; }
.game-window { position: fixed; z-index: 30; top: 110px; left: 12%; width: 400px; height: 560px; max-width: calc(100vw - 20px); max-height: calc(100vh - 90px); min-width: 260px; min-height: 160px; resize: both; overflow: hidden; background: #101a29f7; border: 1px solid #4c7886; border-radius: 7px; box-shadow: 0 12px 35px #000a; }
.game-window[hidden] { display: none !important; }
#facilityWindow { left: 25%; top: 135px; }
#techWindow { left: 37%; top: 155px; }
#fleetWindow { left: 20%; top: 125px; }
#battleWindow { left: 33%; top: 145px; }
.window-title { display: flex; align-items: center; justify-content: space-between; background: #182c3c; border-bottom: 1px solid #41606e; padding: 5px 8px 5px 12px; cursor: move; touch-action: none; color: var(--cyan); }
.window-title button { padding: 3px 9px; }
.window-content { height: calc(100% - 42px); overflow: auto; padding: 12px; overscroll-behavior: contain; }
.window-actions { display: flex; flex-wrap: wrap; gap: 5px; }
#inspector, aside[data-view="planets"] #inspector { padding: 8px 0; }
#quickSupply { position: static; }
@media (max-width: 700px) {
  body > header { gap: 5px; padding: 4px 8px; }
  .brand { font-size: 13px; } .brand-icon { font-size: 22px; }
  .mission { display: none; } .time { margin-left: auto; gap: 2px; } .time button { min-width: 30px; padding: 3px; font-size: 11px; }
  .attention-hub { top: 58px; left: 8px; width: min(260px, calc(100vw - 16px)); }
  .map-display-controls { top: auto; left: auto; right: 8px; bottom: 65px; max-width: 300px; }
  .game-window { top: 90px !important; left: 8px; width: min(400px, calc(100vw - 16px)); height: 55vh; max-height: calc(100vh - 120px); }
  .commands-open #commands { overflow: visible; }
  #commands .window-content { overflow: auto; }
}
.operation-info { position: relative; margin-left: auto; font-size: 12px; }
.operation-info summary { cursor: pointer; color: var(--cyan); white-space: nowrap; }
.operation-info[open] { background: #101a29; z-index: 50; }
.operation-info > :not(summary) { position: relative; margin: 8px; }
.operation-info[open] { padding: 8px; border: 1px solid #34465b; border-radius: 5px; }
.operation-info .mission, .operation-info .mission small, .operation-info .objective, .operation-info #stats { display: block; }
.operation-info .factions { display: flex; flex-direction: row; flex-wrap: wrap; }
@media (max-width: 700px) { .game-window { top: 90px; } .operation-info { font-size: 10px; } .operation-info .mission { display: block; } }
.operation-info[open] { padding: 0; border: 0; background: transparent; }
.operation-popover { position: absolute !important; right: 0; top: 100%; width: 300px; max-width: 80vw; padding: 12px; background: #101a29; border: 1px solid #34465b; border-radius: 5px; box-shadow: 0 8px 20px #0009; }
.operation-popover > * { margin: 8px 0; }
@media (max-width: 1000px) {
  body > header { gap: 5px; padding: 4px 8px; }
  .brand { font-size: 13px; } .brand-icon { font-size: 22px; }
  .time { gap: 2px; } .time > span { margin-right: 3px; font-size: 14px; }
  .time button { min-width: 30px; padding: 4px; font-size: 11px; }
  .operation-info { font-size: 10px; }
}
/* Compact planet intelligence and expandable attention */
.window-tools { display: inline-flex; gap: 5px; }
.planet-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 10px; margin: 10px 0 6px; }
.planet-heading .systemName { font-size: 23px; margin: 0; }
.planet-heading .tag { font-size: 10px; padding: 3px 5px; }
.planet-heading .subtitle { font-size: 11px; line-height: 1.35; }
.game-window .system-status-list { margin: 5px 0; gap: 4px; }
.game-window .system-status-chip { font-size: 10px; padding: 3px 5px; }
.game-window .sectionlabel { margin: 12px 0 6px; }
.game-window .resources { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.game-window .res { min-width: 0; padding: 5px; gap: 4px; }
.game-window .res > div { min-width: 0; }
.game-window .res b { font-size: 11px; }
.game-window .res small { font-size: 10px; }
.game-window .bar { margin-top: 3px; }
.supply-commands { margin: 12px 0 4px; padding: 7px; border: 1px solid #34465b; border-radius: 4px; }
.supply-commands summary { cursor: pointer; color: var(--cyan); }
.supply-commands .routecolors { margin: 7px 0; }
.supply-commands small { color: var(--muted); }
.planet-symbol { display: inline-block; min-width: 1em; }
.attention-hub details[open] { resize: vertical; overflow: auto; min-height: 120px; max-height: calc(100vh - 100px); height: 180px; }
.attention-hub .alert-list { max-height: none; }
@media (max-width: 700px) {
  #facilityWindow, #techWindow, #fleetWindow, #battleWindow { left: 8px; top: 90px; }
}
@media (max-width: 750px) {
  #facilityWindow, #techWindow, #fleetWindow, #battleWindow { left: 8px; top: 90px; }
  .attention-hub #commandAlerts { display: block; }
  .attention-hub .attention-shortcuts { display: flex; }
}

/* Keep refinery outputs together with their construction control. */
.refinery-choice { grid-column: 1 / -1; }
.refinery-picker { padding: 2px 0 4px; }
.refinery-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.refinery-options button { min-width: 0; }

/* Planet intelligence tabs keep the overview compact and the controls discoverable. */
.planet-tabs { display: flex; gap: 4px; border-bottom: 1px solid #34465b; margin-bottom: 10px; }
.planet-tabs button { flex: 1 1 0; min-width: 0; padding: 8px 4px; color: #a8bdc9; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; }
.planet-tabs button.active { color: var(--cyan); border-bottom-color: var(--cyan); background: #17313b; }
.planet-stock-summary { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 7px 9px; background: #0b1725; border-radius: 4px; }
.planet-stock-summary span { white-space: nowrap; font-size: 12px; }
.build-catalog { display: grid; grid-template-columns: 1fr; gap: 5px; margin-top: 8px; }
.build-catalog .catalog-item > button { width: 100%; display: flex; align-items: center; gap: 6px; text-align: left; }
.build-catalog .catalog-cost { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; white-space: nowrap; color: inherit; }
.facility-lab-link { padding: 2px 5px; color: var(--cyan); }

/* Planet facilities and the always-visible sector overview. */
.facility-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.facility-grid .facility { min-width: 0; margin: 0; }
.facility-grid .facility .top { align-items: flex-start; gap: 4px; }
.facility-grid .facility .top > span { min-width: 0; overflow-wrap: anywhere; }
.facility .facility-destroy-icon { flex: 0 0 auto; margin: 0; padding: 4px !important; min-width: 30px; min-height: 30px !important; color: #ff667c; }
.facility-destroy-icon .ui-icon { color: inherit; }
.build-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.build-catalog .catalog-item { min-width: 0; }
.build-catalog .catalog-item > button { min-height: 44px; }
#sectorOverview { position: static; display: block; flex: 0 0 150px; width: 150px; height: 90px; max-width: 100%; margin: 4px auto; }
@media (max-width: 700px) { #sectorOverview { position: static; width: 125px; height: 75px; flex-basis: 125px; } }
.build-catalog .refinery-choice { grid-column: auto; }
.build-catalog .refinery-choice:has(.refinery-picker) { grid-column: 1 / -1; }
.facility .top .facility-destroy-icon .ui-icon { color: #ff667c; }
/* Keep catalog rows aligned when the refinery picker is expanded. */
.build-catalog .catalog-item > button { height: 100%; min-height: 54px; }
.build-catalog .refinery-picker { grid-column: 1 / -1; padding: 2px 0 4px; }
.refinery-options button { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; text-transform: capitalize; }

/* Independent time controls, map options and draggable sector overview. */
header { flex-wrap: wrap; }
.time { display: flex; align-items: center; gap: 3px; padding: 4px; border: 1px solid #355365; border-radius: 5px; background: #0c1624; }
.time #clock { margin: 0 5px; font: 600 14px monospace; }
.time .speed-controls { display: flex; gap: 2px; margin: 0; }
.time button { min-width: 27px; min-height: 30px; padding: 4px; font-size: 10px; letter-spacing: -2px; }
.time button.active { background: #23584d; border-color: #70e9ca; color: #d9fff4; }
.time .speed-fastest { color: #ff7185; border-color: #973e51; }
.time .speed-fastest.active { color: #fff; background: #a52f46; border-color: #ff7185; }
.header-actions { display: flex; align-items: center; gap: 4px; }
.header-actions button { min-height: 34px; padding: 5px 8px; }
#gameAudio { font-size: 19px; line-height: 1; }
.map-display-controls { display: block; top: 12px; right: 12px; bottom: auto; left: auto; width: auto; max-width: min(300px, calc(100% - 24px)); padding: 0; }
.map-display-controls > summary { cursor: pointer; color: var(--cyan); padding: 7px 10px; }
.map-options-content { padding: 0 10px 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.map-options-content .map-navigation { display: flex; width: 100%; position: static; }
#sectorOverview { position: absolute; right: 14px; bottom: 14px; z-index: 3; width: min(300px, 32vw); height: auto; aspect-ratio: 5 / 3; margin: 0; touch-action: none; cursor: grab; }
#sectorOverview:active { cursor: grabbing; }
#audioDialog { width: min(420px, 94vw); }
@media (max-width: 700px) {
  body > header { gap: 3px 6px; }
  .brand { flex: 1 1 auto; }
  .operation-info { margin-left: 0; }
  .time { order: 3; flex: 0 0 auto; margin: 0; }
  .time button { min-width: 25px; min-height: 28px; padding: 3px; font-size: 9px; }
  .time #clock { font-size: 11px; margin: 0 3px; }
  .header-actions { order: 4; margin-left: auto; }
  .header-actions button { min-height: 29px; padding: 3px 5px; font-size: 11px; }
  .map-display-controls { top: 8px; right: 8px; bottom: auto; left: auto; max-width: min(280px, calc(100% - 16px)); }
  #sectorOverview { position: absolute; right: 8px; bottom: 58px; width: min(210px, 48vw); height: auto; }
}
body { display: flex; flex-direction: column; height: 100dvh; min-height: 0; }
body > header { flex: 0 0 auto; }
main { flex: 1 1 0; height: 0; min-height: 0; }
@media (max-width: 750px) { body > header { height: auto; flex-basis: auto; } }
@media (max-width: 700px) {
  .time #clock { display: inline; }
  .attention-hub { top: 90px; }
}
/* Starlane Fracture identity and menu navigation */
.start-menu { background: radial-gradient(ellipse at 80% 0%, #143c49 0%, transparent 48%), #0a1422; }
.menu-top { display: flex; justify-content: space-between; min-height: 38px; }
.menu-top #resume { margin-left: auto; }
.menu-identity { display: flex; align-items: center; gap: 28px; margin: 8px 0 30px; }
.fracture-mark { width: 150px; flex: 0 0 150px; filter: drop-shadow(0 0 12px #43e8d977); }
.identity-kicker { color: #83a9b5; font: 11px monospace !important; letter-spacing: .2em; }
.start-menu #menuTitle { margin: 10px 0; font-size: clamp(44px, 6vw, 76px); line-height: .9; }
.start-menu #menuTitle span { color: #72f9e5; text-shadow: 0 0 24px #35dccb66; }
.menu-intro { margin: 12px 0 0; color: #adbfcb; }
.menu-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.menu-choices button { display: flex; flex-direction: column; align-items: flex-start; text-align: left; min-height: 155px; padding: 20px; margin: 0; border: 1px solid #365969; background: linear-gradient(145deg, #172c3b, #101b2b); }
.menu-choices button:hover, .menu-choices button:focus-visible { border-color: #72f9e5; background: #1a3a43; box-shadow: 0 0 20px #45e8d32a; }
.menu-choices span { color: #70dfd1; font: 10px monospace; letter-spacing: .15em; }
.menu-choices strong { margin: auto 0 7px; font-size: 19px; }
.menu-choices small { color: #a6b9c8; }
.start-menu .menu-view { display: none; }
.start-menu[data-view="load"] .menu-view[data-view~="load"], .start-menu[data-view="single"] .menu-view[data-view~="single"], .start-menu[data-view="multi"] .menu-view[data-view~="multi"], .start-menu[data-view="tutorial"] .menu-view[data-view~="tutorial"]:not([hidden]) { display: block; }
#menuChoices[hidden] { display: none; }
@media (max-width: 700px) { .menu-identity { gap: 14px; } .fracture-mark { width: 90px; flex-basis: 90px; } .menu-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); } .menu-choices button { min-height: 120px; padding: 14px; } .menu-choices strong { font-size: 16px; } }
.save-entry { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; margin: 10px 0; border: 1px solid #31506a; border-radius: 7px; background: #101d2c; }
.save-entry strong, .save-entry small { display: block; overflow-wrap: anywhere; }
.save-entry small { margin-top: 7px; color: #a4b8ca; line-height: 1.5; }
.save-entry .actions { flex-shrink: 0; }
#saveForm { display: flex; gap: 10px; align-items: end; margin: 15px 0; }
#saveForm[hidden] { display: none; }
#saveForm label { display: grid; gap: 6px; flex: 1; }
#saveForm input { width: 100%; }
@media (max-width: 600px) { .save-entry { align-items: stretch; flex-direction: column; } #saveForm { align-items: stretch; flex-direction: column; } }
/* Keep training beside the map, below its controls and clear of order reports. */
.map-side-controls { position: absolute; z-index: 5; top: 12px; right: 12px; width: min(330px, calc(100% - 24px)); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; }
.map-side-controls .map-display-controls { position: static; max-width: 100%; pointer-events: auto; }
.map-side-controls .tutorial-comms { position: static; pointer-events: auto; display: flex; flex-direction: column; align-items: stretch; gap: 7px; width: 100%; max-height: min(45vh, 360px); overflow-y: auto; padding: 10px 12px; border: 1px solid #477967; border-radius: 6px; box-shadow: 0 5px 20px #0008; }
.map-side-controls .tutorial-comms[hidden] { display: none; }
.comms-avatar, .comms-message h2 { display: none; }
.comms-message p { font-size: 12px; line-height: 1.45; }
.comms-message .eyebrow { font-size: 10px; }
.comms-message[aria-live] { max-height: none; overflow: visible; }
.comms-objective { position: static; border: 0; padding: 0; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; background: transparent; }
.comms-objective .eyebrow, .comms-objective small { display: none; }
.comms-objective strong { flex: 1 1 150px; font-size: 12px; }
.comms-objective button { min-height: 32px; }
.tutorial-comms .resource-square::after { content: attr(data-glyph); color: #07111b; font: bold 10px/12px monospace; text-align: center; }
.tutorial-diamond { color: #ff6b81; }
@media (max-width: 750px) {
  .map-side-controls { top: 8px; right: 8px; width: min(280px, calc(100% - 16px)); }
  .map-side-controls .tutorial-comms { max-height: 32dvh; }
  .comms-message .eyebrow { display: block; }
  .comms-objective button { min-height: 40px; }
}
@media (max-width: 750px) {
  .is-tutorial .map-side-controls { width: min(280px, 56%); }
  .is-tutorial .attention-hub { width: calc(44% - 24px); }
}
/* Tutorial entry, progress, and mission reward. */
.tutorial-overview { max-width: 980px; padding: clamp(18px, 3vw, 32px); margin-bottom: 26px; border: 1px solid #477967; border-radius: 8px; background: linear-gradient(120deg, #173b37, #101e2d); }
.tutorial-overview h2 { color: #c8fff0; font-size: clamp(26px, 3vw, 38px); margin: 8px 0 14px; }
.tutorial-overview p { max-width: 78ch; line-height: 1.55; color: #c0d4db; }
.comms-progress { display: block; color: #7ef3d6; font: 700 11px/1.4 monospace; letter-spacing: .04em; margin-bottom: 6px; }
.tutorial-comms .briefing-title { display: block; font-size: 17px; margin: 0 0 6px; }
.tutorial-comms .learning-summary { color: #ddfff3; margin-bottom: 7px; }
.map-side-controls .tutorial-comms.mission-accomplished { position: fixed; z-index: 50; top: 50%; left: 50%; right: auto; transform: translate(-50%, -50%); width: min(570px, calc(100vw - 32px)); max-height: min(80dvh, 650px); padding: clamp(22px, 4vw, 42px); text-align: center; border: 2px solid #80f5c8; background: linear-gradient(135deg, #1a4b3d, #0f1e2c); box-shadow: 0 0 0 100vmax #050b13c7, 0 0 45px #62f2bd55; }
.mission-accomplished .accomplished-title { display: block; color: #b9ffe5; font-size: clamp(34px, 5vw, 54px); line-height: 1; margin: 12px 0; text-transform: uppercase; }
.mission-accomplished .accomplished-name { color: #fff; font-size: 18px; font-weight: 700; margin: 0 0 12px; }
.mission-accomplished .comms-message p { font-size: 14px; }
.mission-accomplished .comms-objective { justify-content: center; margin-top: 12px; }
.mission-accomplished .comms-objective button { min-height: 44px; padding: 8px 16px; }
.map-side-controls:has(.mission-accomplished) { z-index: 100; }
.tutorial-overview .resource-square::after { content: attr(data-glyph); color: #07111b; font: bold 10px/12px monospace; }

.music-panel { position: fixed; z-index: 100; top: 60px; right: 12px; width: min(310px, calc(100vw - 24px)); padding: 14px; border: 1px solid #4c7886; border-radius: 6px; background: #101a29f7; box-shadow: 0 12px 35px #000a; font-size: 13px; }
.music-panel[hidden] { display: none; }
.music-heading, .music-buttons { display: flex; align-items: center; gap: 6px; }
.music-heading { justify-content: space-between; color: var(--cyan); }
.music-heading button { padding: 3px 8px; }
.music-panel p { margin: 10px 0; }
.music-panel label { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.music-panel input { accent-color: var(--cyan); width: 140px; }
.music-panel small { color: var(--muted); line-height: 1.5; }
.music-panel a { color: var(--cyan); }

.map-picker-heading { display:flex; justify-content:space-between; gap:8px; margin:18px 0 8px; color:#cce9f8; }
.map-picker-heading small { color:#91a9ba; }
.map-picker { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:8px; max-height:350px; overflow:auto; padding:2px; }
.map-card { display:flex; flex-direction:column; gap:5px; text-align:left; padding:7px; min-width:0; background:#0a1929; border:1px solid #315168; border-radius:7px; color:#d5eaf7; }
.map-card.selected { border-color:#56e7ec; box-shadow:0 0 0 1px #56e7ec; }
.map-card svg { width:100%; aspect-ratio:1.8; background:radial-gradient(ellipse at center,#142e45,#07111d); border-radius:4px; }
.map-card line { stroke:#416579; stroke-width:.7; }
.map-card circle { fill:#80a9bc; }
.map-card circle.inhabited { fill:#e3c884; }
.map-card circle.home { fill:#5ce8e8; }
.map-card span { font-size:.85rem; }

#technologyWindow { left: 24%; top: 110px; width: 560px; }
.technology-card { display: block; margin: 8px 0; padding: 10px; border: 1px solid #35505c; border-radius: 5px; background: #142433; }
.technology-card > small { display: block; margin-top: 5px; }
.technology-card summary { cursor: pointer; }
.technology-assignments { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.technology-assignments button { font-size: 11px; padding: 4px 6px; }
.technology-levels { display: grid; gap: 5px; margin-top: 9px; font-size: 12px; }
.technology-levels .current { color: #6df1ce; }
@media (max-width: 700px) { #technologyWindow { left: 8px; width: calc(100vw - 16px); } }

.roster-toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 10px 0; }
.roster-toggle { min-width: 0; padding: 7px 4px; }
.roster-toggle.active, .roster-filter.active { border-color: #478d79; background: #153b33; color: var(--cyan); }
.roster-filters { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 8px; }
.roster-filter { padding: 4px 5px; font-size: 10px; min-height: 27px; }
.filter-dot { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: #65f4cf; }
.filter-red { background: #ff6b81; } .filter-blue { background: #68b7ff; } .filter-yellow { background: #f5d16f; }
.technology-lab-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 6px; margin: 10px 0; }
.technology-lab-controls label { display: grid; gap: 4px; flex: 1 1 180px; min-width: 0; font-size: 11px; color: var(--muted); }
.technology-lab-controls select { width: 100%; min-width: 0; }
.technology-lab-controls button { font-size: 12px; }
