/* Original deep-space systems and shared colony records, in the outpost frame. */
:is(#frontier-view, #network-view) { --outpost-edge: #5c5c4d; min-width: 0; }
:is(#frontier-view, #network-view) :is(button, summary) { min-height: 44px; line-height: 1.7; }
:is(#frontier-view, #network-view) button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
:is(#frontier-view, #network-view) :is(.primary-button, .secondary-button, .text-button) { font-size: 12px; }
:is(#frontier-view, #network-view) :is(input, select, textarea) { min-width: 0; max-width: 100%; }
:is(#frontier-view, #network-view) :is(code, p, dd, h2, h3, h4) { overflow-wrap: anywhere; }
:is(#frontier-view, #network-view) :is(button, a, input, select, textarea, summary):focus-visible { outline: 2px solid #ead399; outline-offset: 3px; }
:is(#frontier-view, #network-view) .simulation-controls button { min-width: 44px; }

/* Tabs keep every destination visible and retain the original selection state. */
:is(#frontier-view, #network-view) :is(.frontier-toolbar, .network-toolbar) { gap: 16px; align-items: flex-start; }
:is(#frontier-view, #network-view) :is(.frontier-tabs, .network-tabs) { padding: 0; gap: 0; border-color: #6a634d; border-radius: 2px; background: #171b18; }
:is(#frontier-view, #network-view) :is(.frontier-tabs, .network-tabs) > button { padding: 11px 16px; border-bottom: 2px solid transparent; border-radius: 0; font-size: 12px; }
:is(#frontier-view, #network-view) :is(.frontier-tabs, .network-tabs) > button.active { background: #3c3728; border-bottom-color: #c7ac72; color: #efdbac; }

/* Deep ruins: map tiers, exact party choices, settlement and income comparisons. */
#frontier-view .frontier-panel { padding: 28px; border-color: var(--outpost-edge); border-radius: 2px; background: #22251f; }
#frontier-view .frontier-panel:first-child { border-top: 2px solid #a58c58; }
#frontier-view .frontier-section-heading { gap: 20px; }
#frontier-view .frontier-section-heading > div { min-width: 0; }
#frontier-view .frontier-section-heading h2 { font-size: 26px; font-weight: 600; line-height: 1.5; }
#frontier-view .frontier-section-heading p { font-size: 13px; color: var(--muted); line-height: 1.9; }
#frontier-view .frontier-note { font-size: 12px; line-height: 1.9; }
#frontier-view .frontier-idle h2 { font-size: 20px; font-weight: 600; }
#frontier-view .frontier-idle p { font-size: 12px; line-height: 1.9; }
#frontier-view .frontier-empty { padding: 36px 16px; }
#frontier-view .frontier-empty h3 { font-size: 17px; }
#frontier-view .frontier-empty p { font-size: 12px; }
#frontier-view .frontier-tier-track > li { padding: 16px 10px; border-radius: 2px; }
#frontier-view .frontier-tier-track > li:not(.unlocked):not(.cleared):not(.boss-pending) { background: #1a1e1a; border-color: #555b4c; }
#frontier-view .frontier-tier-track > li.unlocked { background: #353326; border-color: #998452; }
#frontier-view .frontier-tier-track > li.cleared { background: #2c3828; border-color: #71805b; }
#frontier-view .frontier-tier-track strong { font-size: 24px; }
#frontier-view .frontier-tier-track span { font-size: 12px; }
#frontier-view .frontier-tier-track :is(small, em) { font-size: 10px; line-height: 1.8; }
#frontier-view .frontier-card { border-radius: 2px; padding: 20px; }
#frontier-view .frontier-card:not(.rare-card):not(.boss-card) { background: #1c221d; border-color: #59634f; }
#frontier-view .frontier-card.selected:not(.rare-card):not(.boss-card) { background: #393528; border-color: #a9905d; }
#frontier-view .frontier-card h3 { font-size: 19px; font-weight: 600; line-height: 1.6; }
#frontier-view .frontier-card :is(p, small) { font-size: 12px; line-height: 1.85; }
#frontier-view .frontier-map-support { padding: 20px; border-color: #717550; background: #2a3022; border-radius: 2px; }
#frontier-view .frontier-map-support :is(dt, p) { font-size: 12px; }
#frontier-view .frontier-map-support dd { font-size: 18px; }
#frontier-view .frontier-rank-policy { padding: 20px; background: #1c211b; border-color: #5c664f; border-radius: 2px; }
#frontier-view .frontier-departure-target { background: #2a3023; border-color: #787b52; border-radius: 2px; }
#frontier-view .frontier-crew-picker > button { padding: 16px; background: #1c211c; border-color: #5a624e; border-radius: 2px; }
#frontier-view .frontier-crew-picker > button.selected { background: #373626; border-color: #9f915c; }
#frontier-view .frontier-crew-picker :is(strong, small) { line-height: 1.85; }
#frontier-view .frontier-crew-picker strong { font-size: 14px; }
#frontier-view .frontier-crew-picker small { font-size: 11px; }
#frontier-view .frontier-field { font-size: 12px; }
#frontier-view .frontier-field select { min-height: 44px; padding: 11px 12px; background: #151a16; border-color: #6b6c51; border-radius: 2px; font-size: 13px; }
#frontier-view .frontier-policy-list > button { padding: 20px; background: #20251e; border-color: #5f654f; border-radius: 2px; }
#frontier-view .frontier-policy-list > button.selected { background: #383727; border-color: #a69360; }
#frontier-view .frontier-policy-list strong { font-size: 17px; }
#frontier-view .frontier-policy-list span { font-size: 12px; }
#frontier-view .frontier-member { border-radius: 2px; padding: 20px; }
#frontier-view .frontier-member:not(.out):not(.down) { background: #1c221d; border-color: #5a654f; }
#frontier-view .frontier-member h3 { font-size: 18px; }
#frontier-view .frontier-member h3 small { font-size: 11px; }
#frontier-view :is(.frontier-member-meta, .frontier-member-loadout, .frontier-vital > div:first-child) { font-size: 11px; line-height: 1.9; }
#frontier-view :is(.frontier-badge, .frontier-phases li > span, .frontier-boss-fight, .frontier-recovery-rules, .frontier-clear-reward, .frontier-run-history-meta) { border-radius: 2px; }
#frontier-view .frontier-phases li { font-size: 11px; line-height: 1.8; }
#frontier-view .frontier-reward b { font-size: 22px; }
#frontier-view .frontier-reward small { font-size: 11px; }
#frontier-view :is(.frontier-log p, .frontier-income-history p) { font-size: 12px; line-height: 1.9; }
#frontier-view :is(.frontier-log time, .frontier-income-history small, .frontier-history summary small) { font-size: 11px; }
#frontier-view .frontier-history summary strong { font-size: 17px; }
#frontier-view .frontier-renewal-table thead th { background: #292d23; }
#frontier-view :is(.frontier-renewal-table th, .frontier-renewal-table td) { border-color: #535b47; }
#frontier-view .frontier-renewal-guidance { background: #293123; border-color: #6a7952; border-radius: 2px; }
#frontier-view .frontier-table-scroll { border-radius: 2px; scrollbar-color: #897d57 #1c211b; }

/* Shared starport frame covers all eleven tabs and their original nested systems. */
#network-view :is(.network-heading, .network-panel) { padding: 28px; border-color: var(--outpost-edge); border-radius: 2px; }
#network-view .network-heading { background: #242721; border-top: 3px solid #ad935e; }
#network-view .network-heading h2 { font-size: 29px; font-weight: 600; line-height: 1.5; }
#network-view .network-heading p { font-size: 13px; line-height: 1.9; color: var(--muted); }
#network-view .network-profile-switch > label { font-size: 12px; }
#network-view .network-wallet { flex-wrap: wrap; gap: 20px 40px; border-color: #65654f; }
#network-view .network-wallet > div { min-width: 0; }
#network-view .network-wallet span { font-size: 12px; }
#network-view .network-wallet strong { font-size: 30px; overflow-wrap: anywhere; }
#network-view .network-status { font-size: 12px; line-height: 1.9; }
#network-view .network-status a { white-space: normal; }
#network-view .network-section-heading { flex-wrap: wrap; gap: 16px; }
#network-view .network-section-heading > div { min-width: 0; }
#network-view .network-section-heading h2 { font-size: 25px; font-weight: 600; line-height: 1.6; }
#network-view .network-section-heading p { font-size: 13px; line-height: 1.9; color: var(--muted); }
#network-view :is(.network-note, .network-empty p) { font-size: 12px; line-height: 1.9; }
#network-view .network-empty h3 { font-size: 17px; }
#network-view :is(.network-field, .network-form-row > .network-note) { font-size: 12px; }
#network-view :is(.network-field input, .network-field select, .network-field textarea, .network-profile-switch select, .network-cup-create-grid input, .network-cup-create-grid select) { min-height: 44px; font-size: 13px; padding: 11px 12px; background: #151a17; border-color: #6d6a53; border-radius: 2px; }
#network-view .network-field textarea { min-height: 100px; }
#network-view :is(.network-crew > article, .network-supply-catalog > article, .network-book-list article, .network-reward-list > article, .network-player-list > article, .network-guild-list > article, .network-listings > article, .network-visitor-crew > div, .network-migration-options > article, .network-directory-list article, .network-friends-list article, .network-tournament-entry) { background: #20261f; border-color: #5a634e; border-radius: 2px; }
#network-view :is(.network-crew > article, .network-supply-catalog > article, .network-listings > article) { padding: 20px; }
#network-view .network-crew h3 { font-size: 21px; }
#network-view .network-crew h3 small { font-size: 11px; }
#network-view .network-asset-id { font-size: 11px; line-height: 1.9; }
#network-view .network-statline dt { font-size: 11px; }
#network-view .network-statline dd { font-size: 17px; }
#network-view .network-loadout > div > span { font-size: 11px; }
#network-view .network-loadout strong { font-size: 12px; }
#network-view :is(.network-supply-catalog h3, .network-listings h3, .network-player-list h3, .network-guild-list h3) { font-size: 19px; line-height: 1.7; }
#network-view .network-supply-catalog > article > p:not(.network-cost) { font-size: 12px; }
#network-view .network-cost { font-size: 13px; }
#network-view .network-book-list strong { font-size: 13px; }
#network-view .network-book-list code { font-size: 11px; }
#network-view .network-book-list button { font-size: 12px !important; white-space: normal !important; }
#network-view .network-supply-catalog button { font-size: 12px !important; }
#network-view .network-badge { font-size: 11px; border-radius: 2px; }
#network-view .network-log p { font-size: 12px; }
#network-view .network-log time { font-size: 11px; }
#network-view :is(.network-boss, .network-arena-season, .network-arena-access, .network-arena-supply, .network-arena-replay) { border-color: #6d6b4e; background: #242a21; }
#network-view :is(.network-boss-readout > span, .network-arena-supply-readout > span) { border-radius: 2px; }
#network-view :is(.network-boss-readout small, .network-boss-readout p, .network-boss-quota p) { font-size: 12px; line-height: 1.9; }
#network-view :is(.network-boss-weights dt, .network-boss-components dt) { font-size: 12px; }
#network-view :is(.network-boss-reward-card, .network-arena-score-quote, .network-arena-rating-record, .network-arena-refresh-toolbar, .network-arena-access-options > article, .network-arena-access-ledger, .network-market-selected, .network-market-fee-preview, .network-hall-funding, .network-hall-grid > article, .network-merit-daily, .network-guild-quests > article) { background: #20281e; border-color: #59674d; border-radius: 2px; }
#network-view .network-boss-reward-card.estimated { background: #302e22; border-color: #9c8956; }
#network-view .network-arena-match-card:not(.training):not(.unavailable) { background: #242b20; border-color: #65714f; border-radius: 2px; }
#network-view .network-arena-match-card.training { border-radius: 2px; }
#network-view :is(.network-inbox-list > article, .network-arena-team-tactics article, .network-governance li, .network-succession li, .network-guild-identity-current, .network-guild-identity-preview, .network-visit-guild, .network-guild-notice, .network-directory-self) { border-radius: 2px; }
#network-view .network-inbox-list > article:not(.unread) { background: #20271f; border-color: #56634e; }
#network-view :is(.network-guild-comms, .network-tournament-reserve, .network-tournament-overview, .network-cup-create) { background: #252a22; }
#network-view :is(.network-tournament-reserve-summary > div, .network-tournament-summary > div, .network-cup-finance, .network-cup-card:not(.selected)) { background: #1e251e; border-color: #5a644f; border-radius: 2px; }
#network-view .network-cup-card.selected { background: #393627; border-color: #a48d59; border-radius: 2px; }
#network-view :is(.network-tournament-round, .network-guild-comms-log) { background: #171e1a; border-color: #58624e; border-radius: 2px; }
#network-view .network-tournament-round > header { background: #2c3226; }
#network-view :is(.network-boss-table-scroll, .network-guild-member-table, .network-market-sales-scroll, .network-arena-table-scroll, .network-arena-protocol-table) { max-width: 100%; min-width: 0; scrollbar-color: #897d57 #1c211b; }
#network-view :is(.network-boss-member-table, .network-guild-member-table table, .network-market-sales-table, .network-arena-table-scroll table, .network-arena-protocol-table table) :is(th, td) { border-color: #515b47; }
#network-view :is(.network-boss-member-table, .network-guild-member-table table, .network-market-sales-table, .network-arena-table-scroll table, .network-arena-protocol-table table) thead th { background: #2a3024; }

@media (max-width: 800px) {
  #frontier-view .frontier-toolbar, #network-view .network-toolbar { flex-wrap: wrap; }
  #frontier-view .frontier-tabs, #network-view .network-tabs { flex: 1 1 100%; }
  #frontier-view .frontier-tabs { display: flex; flex-wrap: wrap; }
  #frontier-view .frontier-tabs > button { flex: 1 1 auto; }
  #network-view .network-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  #network-view .network-tabs > button { min-width: 0; padding-inline: 10px; }
  #network-view .network-heading { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 650px) {
  #frontier-view .frontier-panel, #network-view :is(.network-heading, .network-panel) { padding: 20px 16px; }
  #frontier-view .frontier-section-heading h2, #network-view .network-section-heading h2 { font-size: 22px; }
  #network-view .network-heading h2 { font-size: 24px; }
  #network-view .network-heading p, #network-view .network-section-heading p, #frontier-view .frontier-section-heading p { font-size: 12px; }
  #frontier-view :is(.frontier-section-heading, .frontier-active > header, .frontier-active > footer, .frontier-idle) { flex-wrap: wrap; }
  #frontier-view :is(.frontier-active > header > div, .frontier-active > footer > div, .frontier-idle > div) { flex-basis: 100%; }
  #frontier-view .frontier-card { padding: 16px; gap: 12px; }
  #frontier-view .frontier-card h3 { font-size: 17px; }
  #frontier-view .frontier-tier-track { gap: 8px; }
  #frontier-view .frontier-tier-track > li { padding: 12px 8px; }
  #frontier-view .frontier-tier-track strong { font-size: 22px; }
  #frontier-view .frontier-tier-track span { font-size: 11px; }
  #frontier-view .frontier-phases { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  #frontier-view .frontier-economic-profile { grid-template-columns: minmax(0, 1fr); }
  #frontier-view .frontier-income-history article { flex-wrap: wrap; gap: 12px; }
  #frontier-view .frontier-income-history article > div { min-width: 0; }
  #frontier-view .frontier-history summary { flex-wrap: wrap; }
  #frontier-view .frontier-history summary em { white-space: normal; }
  #network-view .network-form-row > :is(.network-field, .network-note) { min-width: 0; max-width: 100%; flex-basis: 100%; }
  #network-view :is(.network-field input, .network-field select, .network-field textarea, .network-profile-switch select, .network-cup-create-grid input, .network-cup-create-grid select) { font-size: 16px; }
  #network-view .network-wallet { gap: 20px; }
  #network-view .network-wallet strong { font-size: 26px; }
  #network-view :is(.network-crew > article, .network-supply-catalog > article, .network-listings > article) { padding: 16px; }
  #network-view .network-book-list article { flex-wrap: wrap; }
  #network-view .network-book-list article > div { min-width: 0; flex: 1 1 100%; }
  #network-view .network-inbox-summary > div { min-width: 0; }
  #network-view .network-boss-quota p { min-width: 0; flex-basis: 100%; }
  #network-view :is(.network-mission, .network-rank-list > li, .network-directory-footer) { flex-wrap: wrap; }
  #network-view .network-mission > div:last-child { flex-basis: 100%; text-align: left; }
  #network-view .network-rank-list em { max-width: 100%; }
  #network-view .network-badge, #network-view .network-listings .network-badge { white-space: normal; }
  #network-view .network-tournament-bracket { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 380px) {
  #network-view .network-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #frontier-view .frontier-tabs > button { flex-basis: 100%; }
  #frontier-view .frontier-economic-metrics > div { grid-template-columns: minmax(0, 1fr) 42px 12px 42px; gap: 6px; }
  #frontier-view .frontier-card { align-items: flex-start; flex-wrap: wrap; }
  #frontier-view .frontier-card > span:nth-child(2) { flex-basis: calc(100% - 64px); }
  #network-view .network-asset-summary { grid-template-columns: minmax(0, 1fr); }
  #network-view .network-wallet > div { flex-basis: 100%; }
}
