/* The original production, research and hero systems share the outpost materials. */
:is(#production-view, #research-view, #development-view) { min-width: 0; }
:is(#production-view, #research-view, #development-view) .panel {
  background: #222520;
  border-color: #5c604f;
  border-radius: 2px;
}
:is(#production-view, #research-view, #development-view) :is(button, summary) {
  min-height: 44px;
  max-width: 100%;
  white-space: normal;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
:is(#production-view, #research-view, #development-view) :is(.primary-button, .secondary-button, .text-button) { font-size: 12px; }
:is(#production-view, #research-view, #development-view) :is(p, code) { overflow-wrap: anywhere; }
:is(#production-view, #research-view, #development-view) :is(input[type="number"], select) {
  min-height: 44px;
  height: auto;
  max-width: 100%;
  min-width: 0;
  padding: 11px 12px;
  background: #151916;
  border-color: #70694f;
  border-radius: 2px;
  color: var(--text);
  font-size: 12px;
}
:is(#production-view, #research-view, #development-view) .growth-tabs {
  gap: 0;
  padding: 0;
  background: #171b17;
  border-color: #6b654e;
  border-radius: 2px;
}
:is(#production-view, #research-view, #development-view) .growth-tabs button {
  padding: 11px 16px;
  font-size: 12px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
}
:is(#production-view, #research-view, #development-view) .growth-tabs button.active {
  background: #3d3829;
  color: #efdbac;
  border-color: transparent;
  border-bottom-color: #c6ad76;
}
:is(#production-view, #research-view, #development-view) .simulation-controls button { min-width: 44px; }

/* Facilities, staffing, production queues, supplies and permanent support. */
#production-view .facility-links { margin-bottom: 16px; }
#production-view :is(.prod-panel, .prod-service, .prod-history, .prod-staff-card, .prod-depot-card,
  .prod-support-intro, .prod-support-card, .prod-support-training, .prod-support-revival, .prod-support-history) { padding: 26px; }
#production-view :is(.prod-heading h2, .prod-support-intro h2) { font-size: 25px; font-weight: 600; line-height: 1.6; }
#production-view .prod-heading h3 { font-size: 17px; line-height: 1.7; }
#production-view :is(.prod-intro, .prod-footnote, .prod-policy, .prod-staff-reason, .prod-depot-cost,
  .prod-transfer-reason, .prod-service-vitals, .prod-medical-summary p, .prod-support-intro p,
  .prod-support-reason, .prod-support-revival-rules small) { font-size: 12px; line-height: 1.9; }
#production-view .prod-kpis > div { padding: 22px; background: #242821; border-color: #5d654f; border-radius: 2px; }
#production-view .prod-kpis :is(span, small) { font-size: 11px; line-height: 1.8; }
#production-view .prod-kpis strong { font-size: 30px; color: #e5d6b1; overflow-wrap: anywhere; }
#production-view .prod-facilities { gap: 14px; }
#production-view .prod-facility { padding: 20px 16px; background: #1c211c; border-color: #59624e; border-radius: 2px; }
#production-view .prod-facility.selected { background: #373627; border-color: #ad9a66; box-shadow: inset 0 2px 0 #c3ab73; }
#production-view .prod-facility:hover { background: #30352b; border-color: #9a906c; }
#production-view .prod-facility strong { font-size: 14px; line-height: 1.7; }
#production-view .prod-facility :is(small, em) { font-size: 11px; line-height: 1.8; }
#production-view .prod-benefit { padding: 18px; font-size: 12px; line-height: 1.9; border-radius: 2px; }
#production-view .prod-recipe { padding: 22px 0; border-color: #515b47; }
#production-view .prod-recipe h3 { font-size: 17px; line-height: 1.7; }
#production-view .prod-recipe-top > span { font-size: 11px; line-height: 1.8; }
#production-view :is(.prod-cost, .prod-output) { font-size: 12px; line-height: 1.8; }
#production-view .prod-recipe-actions { flex-wrap: wrap; align-items: flex-start; }
#production-view .prod-recipe-actions p { font-size: 11px; line-height: 1.9; max-width: 100%; flex: 1 1 180px; }
#production-view .prod-recipe-actions button { flex-shrink: 1; }
#production-view .prod-rate { flex-wrap: wrap; }
#production-view .prod-rate :is(span, small) { font-size: 11px; line-height: 1.8; }
#production-view :is(.prod-state, .prod-job-copy small, .prod-job-bottom, .prod-field-label) { font-size: 11px; line-height: 1.8; }
#production-view .prod-job-copy strong { font-size: 13px; line-height: 1.7; }
#production-view .prod-job-progress { background: #434a38; }
#production-view .prod-job-progress > span { background: #b9b080; }
#production-view :is(.prod-staff-card h3, .prod-depot-card h3) { font-size: 20px; line-height: 1.6; }
#production-view .prod-worker > div { min-width: 0; }
#production-view .prod-worker strong { font-size: 14px; line-height: 1.7; }
#production-view .prod-worker :is(small, p) { font-size: 11px; line-height: 1.9; }
#production-view .prod-staff-actions { flex-wrap: wrap; }
#production-view .prod-policy { padding: 20px; }
#production-view .prod-service-item { padding: 18px; background: #1c211b; border-color: #5b644e; border-radius: 2px; }
#production-view .prod-service-item strong { font-size: 13px; line-height: 1.7; }
#production-view .prod-service-item small { font-size: 11px; line-height: 1.9; }
#production-view .prod-log { grid-template-columns: 50px minmax(0, 1fr) auto; padding: 20px 0; }
#production-view .prod-log p { font-size: 12px; line-height: 1.9; }
#production-view .prod-log > span { border-color: #6e7657; border-radius: 2px; font-size: 10px; }
#production-view .prod-support-title > div { min-width: 0; }
#production-view :is(.prod-support-effects, .prod-support-stats, .prod-support-revival-rules > div) { border-color: #60674e; border-radius: 2px; }
#production-view .prod-support-effects > section { background: #1b211b; }
#production-view .prod-support-effects > section + section { background: #343526; border-color: #6a704f; }
#production-view .prod-support-effects :is(h3, h4, p, span), #production-view .prod-support-stats :is(span, small) { font-size: 11px; line-height: 1.9; }
#production-view .prod-support-effects strong { font-size: 22px; line-height: 1.6; }
#production-view .prod-support-upgrade { flex-wrap: wrap; }
#production-view .prod-support-upgrade small { font-size: 11px; line-height: 1.9; }
#production-view .prod-support-crew { border-color: #62684e; border-radius: 2px; scrollbar-color: #9a8a61 #1a2019; }
#production-view .prod-support-crew :is(th, td) { padding: 16px; border-color: #4f5945; font-size: 12px; }
#production-view .prod-support-crew thead th { color: #d2c5a8; background: #1b201b; }
#production-view .prod-support-crew :is(small, .prod-support-eligibility) { font-size: 11px; line-height: 1.8; }

/* Refinery quotes retain their own price ledger, scrolling table and warnings. */
#production-view :is(.exchange-intro, .exchange-panel) { padding: 26px; }
#production-view .exchange-intro { border-top: 3px solid #b19a66; }
#production-view .exchange-intro > div { min-width: 0; }
#production-view .exchange-intro h2 { font-size: 26px; font-weight: 600; }
#production-view .exchange-panel h2 { font-size: 21px; font-weight: 600; }
#production-view .exchange-symbol { border-color: #817247; background: #363224; border-radius: 2px; }
#production-view .exchange-balances > div { background: #252a22; border-color: #5d654e; border-radius: 2px; padding: 22px; }
#production-view .exchange-balances strong { font-size: 29px; }
#production-view .exchange-balances :is(span, small) { font-size: 11px; line-height: 1.8; }
#production-view :is(.exchange-clock, .exchange-batch-price, .exchange-flow > div, .exchange-lines) { border-color: #60664f; border-radius: 2px; }
#production-view :is(.exchange-clock, .exchange-batch-price) { background: #1b211b; }
#production-view :is(.exchange-intro p, .exchange-clock strong, .exchange-batch-price p, .exchange-reason,
  .exchange-note, .exchange-rules li, .exchange-history details > p) { font-size: 12px; line-height: 1.9; }
#production-view .exchange-clock :is(span, small), #production-view .exchange-flow :is(span, small) { font-size: 11px; line-height: 1.8; }
#production-view .exchange-quantities button { background: #1b211b; border-color: #60664f; border-radius: 2px; font-size: 13px; }
#production-view .exchange-quantities button.selected { background: #3a3627; border-color: #b5a06b; color: #eddaa8; }
#production-view .exchange-lines { scrollbar-color: #9a8a61 #1a2019; }
#production-view .exchange-lines :is(th, td) { font-size: 12px; padding: 13px; border-color: #505842; }
#production-view .exchange-lines thead th { background: #1a201a; color: #cfc3a8; font-size: 11px; }
#production-view .exchange-lines tfoot tr > * { background: #343425; }
#production-view .exchange-ledger, #production-view .exchange-history summary small { font-size: 11px; line-height: 1.9; }
#production-view .exchange-history summary strong { font-size: 14px; line-height: 1.8; }

/* Research keeps each branch's identity while the station follows the same frame. */
#research-view .research-facility { padding: 30px; border-top: 3px solid #b19a66; }
#research-view .research-facility > div:first-child { min-width: 0; }
#research-view .research-facility h2 { font-size: 28px; line-height: 1.5; font-weight: 600; }
#research-view :is(.research-facility p, .research-section-heading p, .research-routes-heading p,
  .research-project-heading p, .research-project-reason, .research-footnote, .research-history-empty p) { font-size: 12px; line-height: 1.9; }
#research-view :is(.research-projects, .research-active, .research-applied, .research-history) { padding: 26px; }
#research-view :is(.research-section-heading h2, .research-routes-heading h2, .research-history h2) { font-size: 22px; font-weight: 600; line-height: 1.6; }
#research-view .research-project { padding-block: 24px; border-color: #525b48; }
#research-view .research-project-icon { border-color: #7e754f; background: #383526; border-radius: 2px; }
#research-view .research-project-heading h3 { font-size: 19px; line-height: 1.7; }
#research-view .research-project-bottom small { font-size: 11px; line-height: 1.8; }
#research-view :is(.research-ranks, .research-requirements, .research-work) { font-size: 11px; line-height: 1.9; }
#research-view :is(.research-effect, .research-cost, .research-live, .research-active-actions button) { font-size: 12px; line-height: 1.8; }
#research-view .research-effect.next strong { color: #dfd4b3; }
#research-view .research-active h2 { font-size: 23px; line-height: 1.6; }
#research-view .research-station-symbol { border-color: #78704d; border-radius: 2px; }
#research-view .research-countdown strong { color: #dfc98e; }
#research-view .research-applied h3 { font-size: 18px; line-height: 1.7; }
#research-view .research-effects-list > div { font-size: 12px; line-height: 1.8; }
#research-view .research-effects-list strong { color: #dfd4b3; font-size: 12px; }
#research-view .research-log strong { font-size: 14px; line-height: 1.8; }
#research-view .research-log p { font-size: 12px; line-height: 1.9; }
#research-view .research-log small { font-size: 11px; line-height: 1.8; }
#research-view .research-log > span { border-color: #697455; border-radius: 2px; }
#research-view .research-branch-heading { padding: 22px 20px; border-color: #5c624c; background: #292d23; }
#research-view .research-branch-heading p { font-size: 12px; line-height: 1.9; }
#research-view .research-branch-stage { padding: 20px; }
#research-view .research-branch-stage.advanced { background: #1b211c; }
#research-view .research-branch .research-project { padding: 0; }
#research-view .research-branch .research-project-heading h3 { font-size: 18px; }
#research-view .research-branch .research-project-heading p { font-size: 12px; line-height: 1.9; }
#research-view .research-branch :is(.research-effect, .research-cost) { font-size: 12px; }
#research-view .research-branch :is(.research-requirements, .research-project-reason, .research-project-bottom small) { font-size: 11px; line-height: 1.9; }
#research-view .research-route-connector { background: #252a21; }
#research-view .research-stage-label { font-size: 11px; flex-wrap: wrap; }

/* The original hero, traits, protocol library, donor review and blessing loop. */
#development-view :is(.development-overview, .development-traits, .development-protocols, .development-library,
  .development-donors, .development-blessings, .development-history, .development-ascension-card) { padding: 26px; }
#development-view .development-overview { border-top: 3px solid #b19a66; }
#development-view .development-overview h2 { font-size: 29px; line-height: 1.5; font-weight: 600; }
#development-view .development-overview > header p { font-size: 12px; line-height: 1.9; }
#development-view .development-overview-links { flex-shrink: 1; }
#development-view .development-stats { gap: 18px; padding: 22px 0; border-color: #555f49; }
#development-view .development-stats span { font-size: 11px; line-height: 1.8; }
#development-view .development-stats strong { color: #e0d4b2; font-size: 23px; }
#development-view .development-slots > div { background: #1b211b; border-color: #5a634d; border-radius: 2px; }
#development-view .development-slots > div.empty { background: #191e1a; }
#development-view .development-slots strong { font-size: 13px; line-height: 1.8; }
#development-view .development-slots :is(small, div > span) { font-size: 11px; line-height: 1.8; }
#development-view .development-hero-reason { font-size: 12px; line-height: 1.9; }
#development-view .development-section-heading h3 { font-size: 22px; font-weight: 600; line-height: 1.6; }
#development-view .development-section-heading p { font-size: 12px; line-height: 1.9; }
#development-view :is(.development-trait-list > article, .development-spell-slots > article, .development-tomes > article) { background: #242b22; border-color: #5d6a51; border-radius: 2px; }
#development-view .development-spell-slots > article.empty { background: #1b211b; border-color: #55604b; }
#development-view .development-trait-list h4 { color: #d4d8bb; font-size: 15px; line-height: 1.7; }
#development-view :is(.development-trait-list p, .development-spell-slots p, .development-tomes > article > p,
  .development-trait-catalog p, .development-note, .development-empty) { font-size: 12px; line-height: 1.9; }
#development-view .development-trait-catalog strong { font-size: 13px; line-height: 1.8; }
#development-view .development-spell-slots h4, #development-view .development-tome-title h4 { font-size: 17px; line-height: 1.7; }
#development-view :is(.development-slot-number, .development-spell-slots > article > small, .development-tome-title small,
  .development-tome-roles, .development-tome-craft > small, .development-tome-learn > small, .development-cost) { font-size: 11px; line-height: 1.9; }
#development-view .development-tome-title > span { background: #393a2a; border-color: #7d7851; border-radius: 2px; }
#development-view .development-spell-cooldown { font-size: 12px; line-height: 1.9; color: #c3caa9; border-color: #5e6c4d; }
#development-view .development-donor-warning { border-radius: 2px; }
#development-view .development-donor-warning p { font-size: 12px; line-height: 1.9; }
#development-view .development-donor-list > label { min-height: 64px; border-radius: 2px; }
#development-view .development-donor-list strong { font-size: 15px; line-height: 1.8; }
#development-view .development-donor-list :is(p, small) { font-size: 11px; line-height: 1.9; }
#development-view .development-ascension-card h3 { font-size: 23px; line-height: 1.6; }
#development-view .development-ascension-card > p { font-size: 12px; line-height: 1.9; }
#development-view .development-comparison > div { font-size: 12px; gap: 12px; }
#development-view .development-action-reason { font-size: 12px !important; line-height: 1.9; }
#development-view :is(.development-blessing-rule, .development-blessing-loop) { border-radius: 2px; }
#development-view .development-blessing-rule h4 { color: #e0d4b3; font-size: 16px; line-height: 1.7; }
#development-view :is(.development-blessing-rule p, .development-blessing-loop > p, .development-blessing-craft p) { font-size: 12px; line-height: 1.9; }
#development-view .development-history-list { scrollbar-color: #9a8a61 #1a2019; }
#development-view .development-history-list h4 { font-size: 14px; line-height: 1.8; }
#development-view .development-history-list p { font-size: 12px; line-height: 1.9; }
#development-view .development-history-list :is(code, time, article > div > small) { font-size: 11px; line-height: 1.9; }

@media (max-width: 1100px) {
  #production-view .prod-facilities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #research-view .research-layout { grid-template-columns: minmax(0, 1fr); }
  #research-view .research-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #development-view .development-overview > header { flex-wrap: wrap; }
}
@media (max-width: 800px) {
  #production-view :is(.prod-main, .prod-staff-grid, .prod-depot-grid) { grid-template-columns: minmax(0, 1fr); }
  #research-view .research-branches { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 650px) {
  :is(#production-view, #research-view, #development-view) :is(input[type="number"], select) { font-size: 16px; }
  :is(#production-view, #research-view, #development-view) .growth-tabs { flex-wrap: wrap; }
  :is(#production-view, #research-view, #development-view) .growth-tabs button { padding: 10px 9px; }
  #production-view :is(.prod-panel, .prod-service, .prod-history, .prod-staff-card, .prod-depot-card,
    .prod-support-intro, .prod-support-card, .prod-support-training, .prod-support-revival, .prod-support-history,
    .exchange-intro, .exchange-panel) { padding: 18px; }
  #production-view :is(.prod-heading h2, .prod-support-intro h2, .exchange-intro h2) { font-size: 22px; }
  #production-view .prod-kpis > div, #production-view .exchange-balances > div { padding: 16px; }
  #production-view .prod-kpis strong { font-size: 25px; }
  #production-view .prod-facilities { grid-template-columns: minmax(0, 1fr); }
  #production-view .prod-facility { padding: 16px; }
  #production-view .prod-staff-card, #production-view .prod-depot-card { display: block; }
  #production-view .prod-staff-card .prod-worker { margin-bottom: 18px; }
  #production-view .prod-depot-cost { margin-bottom: 18px; }
  #production-view .prod-service-buttons { grid-template-columns: minmax(0, 1fr); }
  #production-view .prod-recipe-top { flex-wrap: wrap; gap: 10px; }
  #production-view .prod-log { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  #production-view .prod-log p { grid-column: 1 / -1; grid-row: 2; }
  #production-view .prod-support-price { flex-wrap: wrap; }
  #production-view .exchange-intro { align-items: flex-start; }
  #production-view .exchange-balances strong { font-size: 24px; }
  #production-view .exchange-flow { grid-template-columns: minmax(0, 1fr); }
  #production-view .exchange-quantities { gap: 8px; }
  #research-view .research-facility { padding: 20px; }
  #research-view .research-facility h2 { font-size: 24px; }
  #research-view :is(.research-projects, .research-active, .research-applied, .research-history) { padding: 18px; }
  #research-view .research-sidebar { grid-template-columns: minmax(0, 1fr); }
  #research-view .research-project-heading { flex-wrap: wrap; gap: 8px; }
  #research-view .research-project-heading > span { font-size: 15px; }
  #research-view .research-project-heading h3 { font-size: 18px; }
  #research-view .research-project-bottom { align-items: stretch; }
  #research-view .research-project-bottom button { align-self: stretch; }
  #research-view .research-active-actions { flex-wrap: wrap; }
  #research-view .research-branch-heading, #research-view .research-branch-stage { padding: 18px; }
  #research-view .research-branch .research-project-heading h3 { font-size: 17px; }
  #research-view .branch-mode .research-effects-list { grid-template-columns: minmax(0, 1fr); }
  #development-view .development-toolbar { flex-wrap: wrap; }
  #development-view #development-hero-picker { flex-basis: 100%; }
  #development-view .development-toolbar .simulation-controls { margin-left: auto; }
  #development-view :is(.development-overview, .development-traits, .development-protocols, .development-library,
    .development-donors, .development-blessings, .development-history, .development-ascension-card) { padding: 18px; }
  #development-view .development-overview h2 { font-size: 25px; }
  #development-view .development-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
  #development-view .development-stats strong { font-size: 21px; }
  #development-view .development-tabs { width: 100%; }
  #development-view .development-tabs button { flex: 1 1 100%; }
  #development-view .development-slots { grid-template-columns: minmax(0, 1fr); }
  #development-view .development-section-heading h3 { font-size: 20px; }
  #development-view .development-comparison > div { grid-template-columns: minmax(0, 1fr) 42px 12px 42px; gap: 8px; font-size: 11px; }
  #development-view .development-history-list > article { grid-template-columns: 28px minmax(0, 1fr); }
  #development-view .development-history-list time { grid-column: 2; text-align: left; }
}
@media (max-width: 380px) {
  #production-view .prod-toolbar .growth-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #production-view .prod-support-title { flex-wrap: wrap; }
  #research-view .research-project { flex-wrap: wrap; }
  #research-view .research-project-body { flex-basis: 100%; }
  #research-view .research-branch-heading { grid-template-columns: 25px minmax(0, 1fr); }
  #research-view .research-branch-heading > b { grid-column: 2; }
}
