/* Three jobs, three compositions: a mission desk, a living station and a flight chart. */
#command-view { --mission-brass: #c5ad72; }
#command-view .first-loop-panel {
  border: 1px solid #716748;
  border-left: 4px solid var(--mission-brass);
  background: #24251f;
}
#command-view .first-loop-heading { align-items: flex-start; }
#command-view .first-loop-heading > strong {
  padding: 6px 10px;
  border: 1px solid #756949;
  background: #171c18;
  font-variant-numeric: tabular-nums;
}
#command-view .first-loop-steps li { border: 0; border-left: 2px solid #62634d; }
#command-view .first-loop-steps li.done { border-left-color: #8a9c70; }
#command-view .first-loop-steps li.current { border-left-color: #d5b776; }
#command-view .first-loop-next { border: 0; border-top: 1px solid #776a45; background: #2e2b20; }
#command-view .command-header {
  background-color: #1b201b;
  background-image: radial-gradient(circle at 100% 0, transparent 56px, #8b7f4926 57px, transparent 58px, transparent 97px, #8b7f491a 98px, transparent 99px);
  border: 1px solid #626348;
  border-top: 3px solid var(--mission-brass);
}
#command-view .command-header .command-rank-card {
  border: 0;
  border-left: 3px solid #a59b69;
  border-radius: 0;
  background: #2a2d22;
}
#command-view .command-metrics {
  gap: 1px;
  padding: 1px;
  border: 1px solid #68654b;
  background: #575944;
}
#command-view .command-metrics > div { border: 0; padding: 18px 22px; background: #1a211a; }
#command-view .command-metrics > div:nth-child(even) { background: #252b20; }
#command-view .command-metrics strong { font-family: var(--mono); font-size: 33px; margin: 8px 0; }
#command-view > .expansion-links {
  padding: 18px 24px;
  border: 0;
  border-left: 1px solid #8e835c;
  background: #1d221d;
}
#command-view > .expansion-links h2 { font-size: 20px; }
#command-view .command-toolbar > .growth-tabs { border: 0; border-bottom: 1px solid #82734e; background: transparent; }
#command-view .command-toolbar > .growth-tabs button { border-right: 1px solid #414936; }
#command-view .command-toolbar > .growth-tabs button.active { background: #3e3928; border-bottom-color: #dbc58d; }
#command-view .command-logistics { border: 1px dashed #66694d; background: transparent; }
#command-view .command-empty-shipment { background: #1d251c; }
#command-view .command-advice-panel { background: #1c251b; border-top: 3px solid #84966b; }
#command-view .command-advice { border-top-color: #46573d; }

/* Live scenery and telemetry stay at the center of the colony view. */
#colony-view .world-panel { border-color: #76856a; box-shadow: inset 0 0 0 4px #141d17; }
#colony-view .world-panel .panel-toolbar { background: #202d23; border-bottom-color: #738565; }
#colony-view .world-panel .panel-toolbar h2 { letter-spacing: .08em; }
#colony-view .sector-switcher { gap: 1px; background: #5b6c50; }
#colony-view .sector-switcher [data-scene] {
  --sector-tint: #849e78;
  min-height: 48px;
  padding: 12px 10px;
  border: 0;
  border-bottom: 3px solid transparent;
  background-color: #1a251e;
  background-image: linear-gradient(#101a16e8, #132018ed), var(--sector-landscape);
  background-size: cover;
  background-position: center;
  color: #d4ded0;
  text-shadow: 0 1px 3px #000;
}
#colony-view .sector-switcher [data-scene="colony"] { --sector-landscape: url('./assets/environments/station-colony.webp'); --sector-tint: #a5bb82; }
#colony-view .sector-switcher [data-scene="alpha"] { --sector-landscape: url('./assets/environments/station-alpha.webp'); --sector-tint: #d0b78b; }
#colony-view .sector-switcher [data-scene="beta"] { --sector-landscape: url('./assets/environments/station-relay.webp'); --sector-tint: #9fbed1; }
#colony-view .sector-switcher [data-scene="gamma"] { --sector-landscape: url('./assets/environments/station-polar.webp'); --sector-tint: #bfc8df; }
#colony-view .sector-switcher [data-scene].active { color: var(--sector-tint); border-bottom-color: var(--sector-tint); background-image: linear-gradient(#14201cc9, #17261ddc), var(--sector-landscape); }
#colony-view .sector-switcher [data-scene]:hover { color: #f1efdd; }
#colony-view .world-status { background: #18251c; border-top-color: #667c59; }
#colony-view .field-summary { background: #1c2a20; border: 1px solid #526c50; border-left: 4px solid #8ba67c; }
#colony-view .field-summary > :is(span, button) { padding: 4px 0; }
#colony-view .battle-card:not(.rescued) { border-left: 3px solid #738c6b; }
#colony-view .building-card { --facility-signal: #92ad7b; border-top: 3px solid var(--facility-signal); background: #20271e; }
#colony-view .building-card:has([data-building="habitat"]) { --facility-signal: #9cb67b; background: #242d20; }
#colony-view .building-card:has([data-building="workshop"]) { --facility-signal: #c59c65; background: #2d2920; }
#colony-view .building-card:has([data-building="medbay"]) { --facility-signal: #87b8ba; background: #202e2d; }
#colony-view .building-card:has([data-building="fabricator"]) { --facility-signal: #b5a67b; background: #292b22; }
#colony-view .building-card:has([data-building="research"]) { --facility-signal: #9daecc; background: #242a31; }
#colony-view .building-card .building-art { background: transparent; }
#colony-view .building-card .building-card-top { align-items: flex-start; }
#colony-view .building-card h3 { color: #e8e5d8; font-size: 15px; }
#colony-view .building-card .level-label { color: var(--facility-signal); }
#colony-view .building-card .upgrade-button { border-color: var(--facility-signal); border-left-width: 3px; }
#colony-view .welcome-strip { background: #1d2b20; border-left: 3px solid #79956c; }

/* The expedition is a chart: destination strip, manifest and departure instrument. */
#expeditions-view { --flight-accent: #d2a46c; }
#expeditions-view > .expansion-links {
  background: #242721;
  border: 0;
  border-left: 4px solid #bf965b;
  padding: 22px 26px;
}
#expeditions-view > .expansion-links h2 { font-size: 25px; }
#expeditions-view .exp-toolbar { padding-top: 12px; border-bottom-style: dashed; border-bottom-color: #807055; }
#expeditions-view .exp-toolbar .growth-tabs { border: 0; border-bottom: 1px solid #9d8257; background: transparent; }
#expeditions-view .exp-toolbar .growth-tabs button.active { background: #4a3825; border-bottom-color: #e0b578; color: #f3d4a6; }
#expeditions-view .exp-idle { border: 1px dashed #827052; border-radius: 0; background: #1f2522; }
#expeditions-view .exp-idle > span:first-child { background: #393323; color: #e0bd83; border-color: #8f7850; }
#expeditions-view .exp-zone-selector { gap: 14px; }
#expeditions-view .exp-zone {
  --destination-image: url('./assets/environments/station-alpha.webp');
  --destination-color: #c3a574;
  position: relative;
  padding: 22px 18px;
  border: 1px solid #73664f;
  border-left: 3px solid var(--destination-color);
  background-color: #21251f;
  background-image: linear-gradient(90deg, #17201bf0, #17201bd9), var(--destination-image);
  background-size: cover;
  background-position: center;
}
#expeditions-view .exp-zone[data-expedition-zone="beta"] { --destination-image: url('./assets/environments/station-relay.webp'); --destination-color: #9bb9c9; }
#expeditions-view .exp-zone[data-expedition-zone="gamma"] { --destination-image: url('./assets/environments/station-polar.webp'); --destination-color: #b5b8d6; }
#expeditions-view .exp-zone.selected { border-color: var(--destination-color); box-shadow: inset 0 0 0 1px var(--destination-color); background-image: linear-gradient(90deg, #293126e8, #17201bc9), var(--destination-image); }
#expeditions-view .exp-zone-number { font-family: var(--mono); font-size: 30px; color: var(--destination-color); }
#expeditions-view .exp-zone.selected .exp-zone-number { color: var(--destination-color); }
#expeditions-view .exp-zone strong { color: #e8e7dc; }
#expeditions-view .exp-zone-icon { color: var(--destination-color); }
#expeditions-view .exp-preparation { border: 0; border-top: 2px solid #ad9263; background: #24271f; }
#expeditions-view .exp-section-title > .exp-team-count { padding: 7px 12px; background: #151e19; border: 1px solid #6e724f; }
#expeditions-view .exp-hero { border-left: 3px solid #5f715b; background: #19241e; }
#expeditions-view .exp-hero.selected { border-left-color: #b99c66; background: #303427; }
#expeditions-view .exp-hero-main strong { letter-spacing: .03em; }
#expeditions-view .exp-rally-actions .secondary-button { background: #2b3931; border-color: #7e9c83; }
#expeditions-view .exp-tactics button { border-top: 3px solid #657e66; background: #17211c; }
#expeditions-view .exp-tactics button[data-expedition-tactic="balanced"] { border-top-color: #a99a66; }
#expeditions-view .exp-tactics button[data-expedition-tactic="bold"] { border-top-color: #c18a68; }
#expeditions-view .exp-tactics button.selected { border-color: #bfa06a; background: #3b3527; }
#expeditions-view .exp-preview {
  border: 1px solid #7a7758;
  border-top: 4px solid #cbab72;
  background-color: #17221e;
  background-image: linear-gradient(#839b7d08 1px, transparent 1px), linear-gradient(90deg, #839b7d08 1px, transparent 1px);
  background-size: 24px 24px;
}
#expeditions-view .exp-power { border-block: 1px solid #5d7055; }
#expeditions-view .exp-power strong { font-family: var(--mono); color: #c3d4b1; }
#expeditions-view .exp-power > div:last-child strong { color: var(--amber); }
#expeditions-view .exp-readout-row { border-bottom: 1px dotted #3f5545; }
#expeditions-view .exp-start-cost { padding: 16px; border-left: 3px solid #c2a06b; background: #302b20; }
#expeditions-view .exp-start-cost span { white-space: normal; }
#expeditions-view .exp-estimated { border: 0; border-left: 2px solid #8a9b71; background: #243024; }
#expeditions-view .exp-active { border-top: 3px solid #a6b2bd; }
#expeditions-view .exp-active.ready { border-top-color: #93b47a; }
#expeditions-view .exp-history { border: 0; border-left: 2px solid #9d845c; background: #1d261f; }

@media (min-width: 1200px) {
  #command-view:has(> .first-loop-panel:not([hidden])) { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, .85fr); gap: 20px; align-items: stretch; }
  #command-view:has(> .first-loop-panel:not([hidden])) > * { grid-column: 1 / -1; }
  #command-view:has(> .first-loop-panel:not([hidden])) > .first-loop-panel { grid-column: 1; grid-row: 1 / span 2; margin-bottom: 0; }
  #command-view:has(> .first-loop-panel:not([hidden])) > .command-header { grid-column: 2; grid-row: 1; flex-direction: column; align-items: stretch; justify-content: space-between; gap: 24px; padding: 28px; }
  #command-view:has(> .first-loop-panel:not([hidden])) > .expansion-links { grid-column: 2; grid-row: 2; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 16px; min-width: 0; padding: 24px; }
  #command-view .first-loop-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #command-view .command-header .command-rank-card { flex: none; width: 100%; }
  #command-view:has(> .first-loop-panel:not([hidden])) .command-metrics { margin: 0; }
  #command-view:has(> .first-loop-panel:not([hidden])) .command-toolbar { margin-block: 0; }
  #command-view .command-overview { grid-template-columns: minmax(0, 2fr) minmax(250px, .8fr); }
  #command-view .command-chapters { display: grid; grid-template-columns: minmax(170px, .7fr) minmax(0, 2fr); }
  #command-view .chapter-selector { grid-template-columns: minmax(0, 1fr); align-content: start; border-right: 1px solid #696348; }
  #command-view .chapter-step { min-height: 100px; border-left-width: 3px; }
  #command-view .chapter-detail { min-width: 0; }
  #colony-view #building-list { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
  #colony-view .building-card { grid-column: span 2; }
  #colony-view .building-card:has([data-building="fabricator"]), #colony-view .building-card:has([data-building="research"]) { grid-column: span 3; }
  #colony-view .building-card:has([data-building="fabricator"]) .building-card-top, #colony-view .building-card:has([data-building="research"]) .building-card-top { display: grid; grid-template-columns: minmax(80px, .7fr) minmax(0, 1fr); align-items: center; gap: 20px; }
  #expeditions-view #expedition-preparation { display: grid; grid-template-columns: 230px minmax(0, 1fr); align-items: start; gap: 22px; }
  #expeditions-view #expedition-preparation > .exp-current-note { grid-column: 1 / -1; }
  #expeditions-view .exp-zone-selector { grid-template-columns: minmax(0, 1fr); margin-bottom: 0; }
  #expeditions-view .exp-zone { min-height: 168px; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: start; gap: 10px; }
  #expeditions-view .exp-zone-icon { grid-column: 2; }
  #expeditions-view .exp-planning-grid { grid-template-columns: minmax(0, 1.2fr) minmax(260px, .85fr); gap: 20px; }
  #expeditions-view :is(.exp-preparation, .exp-preview) { padding: 22px; }
  #expeditions-view .exp-tactics { grid-template-columns: minmax(0, 1fr); }
  #expeditions-view .exp-tactics button { min-height: 74px; display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 16px; align-items: start; }
  #expeditions-view .exp-tactics small { margin: 0; }
}
@media (max-width: 650px) {
  #command-view .command-metrics { gap: 1px; }
  #command-view .command-metrics > div { padding: 16px 12px; }
  #command-view .command-metrics strong { font-size: 28px; }
  #command-view > .expansion-links { padding: 18px; }
  #command-view .command-header { padding: 20px; }
  #colony-view .sector-switcher [data-scene] { padding: 10px 8px; font-size: 11px; }
  #colony-view #building-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  #colony-view .building-card { padding: 14px; }
  #colony-view .building-card:has([data-building="research"]) { grid-column: 1 / -1; }
  #colony-view .building-card h3 { font-size: 14px; }
  #colony-view .building-card .upgrade-button { gap: 8px; flex-wrap: wrap; }
  #expeditions-view > .expansion-links { padding: 20px; }
  #expeditions-view > .expansion-links h2 { font-size: 22px; }
  #expeditions-view .exp-zone { padding: 18px 14px; }
  #expeditions-view .exp-zone-selector { gap: 10px; }
  #expeditions-view .exp-preview { padding: 20px; }
  #expeditions-view .exp-preparation { padding: 18px; }
  #expeditions-view .exp-tactics { grid-template-columns: minmax(0, 1fr); }
  #expeditions-view .exp-tactics button { min-height: 72px; display: grid; grid-template-columns: 50px minmax(0, 1fr); align-items: start; gap: 12px; }
  #expeditions-view .exp-tactics small { margin-top: 0; }
}
@media (max-width: 380px) {
  #colony-view #building-list { grid-template-columns: minmax(0, 1fr); }
  #colony-view .building-card:has([data-building="research"]) { grid-column: auto; }
  #colony-view .building-card .building-card-top { display: grid; grid-template-columns: 86px minmax(0, 1fr); align-items: center; gap: 14px; }
  #colony-view .building-card .building-art, #colony-view .building-card .building-art .facility-figure { height: 86px; margin: 0; }
  #expeditions-view .exp-hero { grid-template-columns: 24px minmax(0, 1fr); }
  #expeditions-view .exp-hero > b { grid-column: 2; text-align: left; font-size: 20px; }
  #expeditions-view .exp-hero > b small { display: inline; margin-left: 6px; }
}
