/* Compact command deck. Load after style.css. */
#app {
  height: 100dvh;
  min-height: 0;
}

.topbar {
  height: 34px;
  flex: 0 0 34px;
  gap: 14px;
  padding: 0 10px;
}
.brand {
  width: auto;
  gap: 6px;
  font-size: 13px;
  letter-spacing: 2px;
}
.brand-symbol { width: 18px; font-size: 24px; line-height: 25px; }
.brand-symbol span { width: 7px; height: 5px; }
.brand-sub, .live-tag { display: none; }
.resource-cluster { min-width: 0; gap: 20px; }
.resource { min-width: 0; gap: 5px; }
.resource > span:last-child { display: flex; align-items: center; gap: 6px; min-width: 0; }
.resource small { margin: 0; font-size: 9px; letter-spacing: 0; white-space: nowrap; }
.resource strong { font-size: 12px; letter-spacing: 0; white-space: nowrap; }
.resource-icon { font-size: 17px; }
.top-actions { flex: none; gap: 3px; margin-left: auto; }
.top-actions .timer { display: block; margin: 0 5px 0 0; font-size: 11px; }
.top-actions .icon-btn { width: 25px; height: 26px; font-size: 14px; }
.top-actions #sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; }

.battle-layout { flex: 1 1 auto; min-width: 0; min-height: 0; }
.battlefield { flex: 1 1 auto; min-width: 0; min-height: 0; }
#battle { width: 100%; height: 100%; }
.command-sidebar {
  width: 208px;
  flex: 0 0 208px;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}
.hud-collapsed .command-sidebar { display: none; }
.sidebar-heading {
  height: 24px;
  min-height: 24px;
  flex: none;
  padding: 4px 9px;
  gap: 5px;
}
.sidebar-heading > div { min-width: 0; }
.sidebar-heading h2 {
  margin: 0;
  font-size: 11px;
  line-height: 14px;
  letter-spacing: 1px;
  white-space: nowrap;
}
.sidebar-heading .art-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.faction-badge {
  display: block;
  padding: 1px 4px;
  font-size: 9px;
  line-height: 12px;
}
.radar-container { height: 110px; min-height: 110px; flex: none; margin: 0 9px; }
.radar-label { left: 5px; bottom: 4px; font-size: 7px; letter-spacing: 1px; }
.radar-label span { padding-left: 0; margin-left: 55px; font-size: 7px; }
.intel-row {
  display: flex;
  flex: none;
  min-height: 20px;
  padding: 4px 9px;
  gap: 8px;
  font-size: 8px;
}
.intel-row button { display: none; }
.intel-row .gem { margin-left: -2px; background: #d5a0fa; transform: rotate(45deg) scale(.8); }
.intel-row #tech-sites {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  align-self: stretch;
  color: #f0cc83;
  font-size: inherit;
  white-space: nowrap;
}
.intel-row #tech-sites:hover { color: #ffe8b5; }
.control-groups { flex: none; padding: 0 7px 3px; }
.control-group-heading { display: none; }
.control-group-buttons { grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 2px; }
.control-group-buttons button {
  height: 24px;
  min-height: 24px;
  padding: 1px 0;
  gap: 1px;
  flex-direction: column;
}
.control-group-buttons button kbd { font-size: 9px; line-height: 10px; }
.control-group-buttons .group-count { font-size: 7px; line-height: 8px; }
.sidebar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.35fr;
  flex: none;
  gap: 3px;
  padding: 3px 7px 5px;
}
.sidebar-actions button,
.command-sidebar #mouse-mode {
  min-width: 0;
  min-height: 24px;
  padding: 3px;
  border: 1px solid #40574b;
  background: #1b3027;
  color: #c5d4bb;
  font-size: 10px;
  line-height: 16px;
  white-space: nowrap;
}
.sidebar-actions button:hover,
.command-sidebar #mouse-mode:hover { background: #314734; border-color: #95ac82; }
.sidebar-actions button.active,
.sidebar-actions button[aria-pressed="true"] { background: #a7b98f; color: #16251c; border-color: #c7d4ad; }
.production-heading { display: none; }
.production-tabs {
  flex: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 7px;
  gap: 2px;
  margin: 0 0 5px;
}
.production-tabs button { padding: 5px 0; font-size: 10px; line-height: 14px; }
.production-selector { display: grid; grid-template-columns: 9px minmax(0, 1fr); gap: 4px; flex: none; padding: 0 7px; }
.production-selector .production-tabs { padding: 0; }
.sidebar-power { position: relative; align-self: stretch; margin-bottom: 5px; border: 1px solid #687584; background: #181c21; }
.sidebar-power i { position: absolute; inset: auto 1px 1px; height: calc(var(--supply, 0%) * .94); background: repeating-linear-gradient(to top, #67ab9b 0 3px, #293b3b 3px 5px); }
.sidebar-power b { position: absolute; left: -2px; right: -2px; height: 2px; bottom: calc(var(--demand, 0%) * .94); background: #f1d49d; }
.sidebar-power[data-low="true"] i { background: repeating-linear-gradient(to top, #cf724f 0 3px, #5f352e 3px 5px); }
.production-support {
  display: flex;
  align-items: center;
  flex: none;
  gap: 6px;
  min-height: 26px;
  margin: 0 7px 4px;
  padding: 2px 6px;
  border: 1px solid #57616e;
  background: #262d36;
  color: #dce5ed;
  font-size: 10px;
}
.production-support[hidden] { display: none; }
.production-support .support-icon { display: flex; }
.production-support svg { width: 17px; height: 17px; }
.production-support small { margin-left: auto; color: #b6c0c9; font-variant-numeric: tabular-nums; }
.production-support.ready { border-color: #b3a36a; color: #f5dea5; }
.production-support.ready small { color: inherit; }
.production-support:not(:disabled):hover, .production-support[aria-pressed="true"] { background: #444035; border-color: #e6c87a; }
.production-support:disabled { opacity: .76; }
#paradrop-hint { border-color: #d5bc80; }
@media (pointer: coarse) { .production-support { min-height: 36px; } }
.catalog-scroll { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 0 7px 4px; }
.catalog-scroll button { min-height: 17px; padding: 0; line-height: 14px; background: #333842; border: 1px solid #69737e; color: #e8dbc1; }
.catalog-scroll button:not(:disabled):hover { background: #4b535f; }
.catalog-scroll button:disabled { opacity: .48; }
@media (pointer: coarse) { .catalog-scroll button { min-height: 30px; } }
.catalog {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  padding: 0 7px 5px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(77px, max-content);
  gap: 5px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  align-content: start;
}
.catalog-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 77px;
  padding: 0;
  grid-template-columns: none;
  grid-template-rows: none;
  align-content: normal;
}
.catalog-card .card-art {
  height: 45px !important;
  min-height: 45px;
  width: 100%;
  flex: 0 0 45px;
  padding: 1px 4px;
  align-self: auto;
  border-bottom: 1px solid #71816b18;
}
.catalog-card .card-art svg { width: 58px; height: 39px; }
.catalog-card .card-name {
  flex: none;
  width: calc(100% - 8px);
  min-width: 0;
  margin: 2px 4px 1px;
  font-size: 9px;
  line-height: 12px;
  align-self: auto;
}
.card-bottom {
  flex: none;
  width: 100%;
  padding: 0 4px 2px;
  font-size: 9px;
  line-height: 11px;
}
.card-bottom small { font-size: 8px; }
.card-count {
  top: 3px; left: 3px; min-width: 13px; padding: 1px 3px; z-index: 2;
  font-size: 9px; line-height: 12px; text-align: center; font-variant-numeric: tabular-nums;
}
.card-lock {
  top: 7px; right: 5px; width: 9px; height: 7px; z-index: 2;
  border: 1px solid currentColor; border-radius: 1px; font-size: 0;
}
.card-lock:before {
  content: ""; position: absolute; top: -5px; left: 1px; width: 5px; height: 5px;
  border: 1px solid currentColor; border-bottom: 0; border-radius: 4px 4px 0 0;
}
.catalog-empty { grid-column: 1 / -1; padding: 12px 0; font-size: 10px; }

#queue-drawer, #camera-drawer {
  min-width: 0;
  flex: 0 0 auto;
  margin: 0;
  border-top: 1px solid #34483c;
  background: #11221c;
}
#queue-drawer > summary, #camera-drawer > summary {
  min-height: 24px;
  padding: 5px 8px;
  font-size: 10px;
  line-height: 14px;
  color: #bdcdb6;
  cursor: pointer;
}
#queue-drawer > summary::marker, #camera-drawer > summary::marker { color: #9aaf8e; font-size: 9px; }
#queue-count { font-size: 9px; font-variant-numeric: tabular-nums; }
#queue {
  flex: none;
  min-height: 0;
  max-height: 160px;
  margin: 0;
  padding: 4px 7px 7px;
  border: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.production-row + .production-row { margin-top: 8px; }
.queue-label { gap: 3px; margin-bottom: 3px; flex-wrap: wrap; font-size: 9px; }
.queue-label > span:first-child { flex: 1 1 auto; min-width: 0; max-width: 100%; }
.queue-job-status { min-width: 0; max-width: 100%; font-size: 8px; }
.queue-label button { margin-left: 0; min-width: 22px; min-height: 22px; }
.queue-job-actions { gap: 3px; min-width: 0; max-width: 100%; margin-left: auto; }
.queue-job-actions button { flex: none; }
.queue-placeholder { padding: 3px 0; font-size: 9px; }
.camera-tools {
  position: static;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 3px 7px 7px;
  gap: 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.camera-tools button { height: 24px; font-size: 10px; }
.camera-tools .view-tools button { height: 24px; font-size: 9px; }
.camera-tools .zoom-tools > output { font-size: 10px; }
.camera-tools .zoom-tools > button { font-size: 14px; }
.camera-tools .zoom-tools > #zoom-reset { font-size: 9px; }
.camera-tools .view-bookmarks { display: flex; }
.camera-tools .view-bookmarks button { height: 22px; }
.camera-tools .view-tools #camera-focus,
.camera-tools .zoom-tools #zoom-reset { display: block; }

#selection-panel {
  display: none;
  position: static;
  inset: auto;
  width: auto;
  height: auto;
  min-height: 0;
  flex: none;
  padding: 6px 7px;
  gap: 4px;
  border-top: 1px solid #4a5b46;
  background: #13251e;
  backdrop-filter: none;
  grid-template-columns: minmax(0, 1fr);
}
#selection-panel.has-selection { display: grid; }
#selection-panel .selected-portrait,
#selection-panel .selected-icons,
#selection-panel .selection-info p,
#selection-panel .selection-empty { display: none; }
#selection-panel .selection-info { min-width: 0; width: 100%; }
#selection-panel .selection-info h3 { margin: 0 0 4px; font-size: 10px; line-height: 14px; letter-spacing: 0; }
#selection-panel .health-track { width: 100%; height: 3px; }
#selection-panel .selection-meta {
  display: block;
  max-width: none;
  margin-top: 4px;
  font-size: 9px;
  line-height: 14px;
  overflow-wrap: anywhere;
}
#selection-panel .unit-commands {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  margin: 2px 0 0;
  gap: 3px;
}
#selection-panel .unit-commands button {
  min-width: 0;
  height: 24px;
  padding: 2px 1px;
  gap: 1px;
  flex-direction: row;
  font-size: 9px;
  line-height: 14px;
  white-space: nowrap;
}
#selection-panel .unit-commands button b { font-size: 8px; }
.sidebar-footer { flex: 0 0 22px; height: 22px; padding: 0 7px; font-size: 8px; }
.sidebar-footer > span { gap: 4px; }
.sidebar-footer button { font-size: 9px; }

.statusbar {
  height: 16px;
  min-height: 16px;
  flex: 0 0 16px;
  padding: 0 8px;
  gap: 10px;
  font-size: 8px;
  line-height: 14px;
}
.statusbar .version { flex: none; font-size: 7px; white-space: nowrap; }
.statusbar #status-message {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 8px;
}
.statusbar .shortcuts { display: none; }
.coordinate-bar {
  position: static;
  inset: auto;
  min-width: 0;
  height: auto;
  flex: 0 0 auto;
  padding: 0;
  gap: 8px;
  border: 0;
  background: none;
  font-size: 8px;
  line-height: 14px;
  letter-spacing: 0;
}
.coordinate-bar > span:nth-child(2), .coordinate-bar button { display: none; }
.objective, .compass { display: none; }
.map-heading {
  top: 8px;
  left: 8px;
  max-width: calc(100% - 32px);
  padding: 4px 6px;
  border: 1px solid #8aa27a33;
  background: #10221bba;
}
.map-heading .sector-label, .map-heading p, .map-heading .map-size-label { display: none; }
.map-heading h1 { margin: 0; font-size: 11px; line-height: 14px; letter-spacing: 1px; }
.map-heading h1 span { margin-left: 4px; font-size: 8px; letter-spacing: 1px; }
.in-overview .map-heading { display: none; }
.overview-caption { top: 8px; padding: 6px 9px; font-size: 11px; letter-spacing: 1px; }
.overview-caption span { margin-top: 4px; font-size: 9px; }
.tutorial {
  bottom: 26px;
  left: 26px;
  width: 280px;
  max-width: calc(100% - 52px);
  max-height: 76px;
  padding: 7px 25px 7px 8px;
  gap: 7px;
  overflow-y: auto;
}
.tutorial-num { font-size: 17px; line-height: 20px; }
.tutorial strong { font-size: 10px; line-height: 14px; letter-spacing: 0; }
.tutorial p { margin-top: 3px; font-size: 9px; line-height: 14px; }
.tutorial button { position: absolute; top: 4px; right: 4px; min-width: 20px; min-height: 20px; }
.toast {
  bottom: 12px;
  max-width: min(480px, calc(100% - 24px));
  padding: 7px 10px;
  font-size: 11px;
  line-height: 17px;
  white-space: normal;
  text-align: center;
  pointer-events: none;
}
.placement-hint { top: 36px; max-width: calc(100% - 32px); padding: 6px 9px; font-size: 10px; line-height: 16px; white-space: normal; }

.command-sidebar button:focus-visible,
.command-sidebar summary:focus-visible,
#sidebar-toggle:focus-visible { outline: 2px solid #e3c98b; outline-offset: -2px; }

@media (min-width: 1600px) {
  .command-sidebar { width: 220px; flex-basis: 220px; }
  .radar-container { height: 118px; min-height: 118px; }
}
@media (max-width: 820px) {
  .command-sidebar { width: 188px; flex-basis: 188px; }
  .topbar { gap: 8px; padding: 0 6px; }
  .resource-cluster { gap: 12px; }
  .resource small, .resource.population { display: none; }
  .top-actions .timer { display: none; }
  .radar-container { height: 100px; min-height: 100px; margin: 0 7px; }
  .radar-label span { margin-left: 40px; }
  .catalog { gap: 4px; padding-right: 6px; padding-left: 6px; }
  .catalog-card .card-name { font-size: 9px; }
  .overview-caption { left: 8px; transform: none; max-width: calc(100% - 16px); white-space: normal; }
  .overview-caption span { max-width: none; line-height: 14px; }
}
@media (max-width: 580px) {
  .command-sidebar { width: 160px; flex-basis: 160px; }
  .brand { gap: 3px; font-size: 11px; letter-spacing: 0; }
  .brand-symbol { width: 15px; font-size: 20px; line-height: 23px; }
  .topbar { gap: 6px; padding: 0 4px; }
  .resource-cluster { gap: 7px; }
  .resource { gap: 2px; }
  .resource strong { font-size: 10px; }
  .resource-icon { font-size: 14px; }
  .top-actions { gap: 1px; }
  .top-actions .icon-btn { width: 23px; height: 26px; }
  .top-actions #sound, .top-actions #help, .top-actions #settings, .top-actions #event-log { display: none; }
  .top-actions #sidebar-toggle { display: inline-flex; }
  .sidebar-heading { padding-left: 7px; padding-right: 7px; }
  .radar-container { height: 88px; min-height: 88px; margin: 0 6px; }
  .radar-label { font-size: 6px; letter-spacing: 0; }
  .radar-label span { margin-left: 30px; font-size: 6px; }
  .intel-row { padding: 3px 7px; min-height: 18px; gap: 7px; font-size: 7px; }
  .control-groups { padding-right: 5px; padding-left: 5px; }
  .sidebar-actions { padding-right: 5px; padding-left: 5px; gap: 2px; }
  .sidebar-actions button, .command-sidebar #mouse-mode { font-size: 9px; }
  .production-tabs { padding: 0 5px; }
  .production-tabs button { font-size: 9px; }
  .catalog { padding-right: 5px; padding-left: 5px; gap: 4px; }
  .catalog-card .card-name { width: calc(100% - 6px); margin-left: 3px; margin-right: 3px; font-size: 8px; }
  .card-bottom { padding-right: 3px; padding-left: 3px; font-size: 8px; }
  .card-bottom small { font-size: 7px; }
  #selection-panel { padding: 5px; }
  #selection-panel .unit-commands { gap: 2px; }
  #selection-panel .unit-commands button { font-size: 8px; letter-spacing: -0.4px; }
  #selection-panel .unit-commands button b { display: none; }
  #selection-panel .selection-meta { font-size: 8px; line-height: 12px; }
  .statusbar { gap: 6px; padding: 0 5px; }
  .statusbar .version { display: none; }
  .coordinate-bar { font-size: 7px; }
  .map-heading h1 span { display: none; }
  .tutorial { max-height: 76px; padding-left: 6px; gap: 4px; }
  .tutorial-num { display: none; }
}
@media (max-height: 600px) {
  .sidebar-heading { height: 22px; min-height: 22px; padding-top: 3px; padding-bottom: 3px; }
  .radar-container { height: 82px; min-height: 82px; }
  .intel-row { min-height: 16px; padding-top: 2px; padding-bottom: 2px; }
  .sidebar-actions { padding-top: 2px; padding-bottom: 3px; }
  .production-tabs { margin-bottom: 3px; }
  .production-tabs button { padding-top: 3px; padding-bottom: 3px; }
  #selection-panel { padding-top: 4px; padding-bottom: 4px; }
  #selection-panel .selection-meta { font-size: 8px; line-height: 12px; }
  #queue { max-height: 120px; }
}
@media (max-height: 440px) {
  .catalog { flex: 1 0 100px; }
  .command-sidebar { overflow-y: auto; }
  .radar-container { height: 64px; min-height: 64px; }
}

.catalog-card.job-paused{border-color:#c5a36d}.catalog-card.job-paused .card-bottom>span{color:#d6b67e}.queue-pause[hidden]{display:none}.statusbar #control-hint{display:block;font-size:8px;white-space:nowrap}@media(max-width:820px){.statusbar #control-hint{display:none}}
