.management-shortcuts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.management-shortcuts button, #shop-page .page-heading button { min-block-size: 44px; }
#shop-page {
  --list-scene: url('assets/alliance-cover-nebula.webp');
  --list-scene-position: 61% center;
  --list-scene-shade: linear-gradient(100deg, #050c1ab5, #08122470 57%, #050b1766);
  --shop-product-top: #16263ad6;
}
#shop-page :is(.shop-account, .shop-packs, .shop-funding) {
  border-color: var(--list-panel-line, #98afd749);
  background: var(--list-panel-tint, #0b1426c7);
}
#shop-content { display: grid; min-inline-size: 0; gap: 10px; }
.shop-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.shop-pack-button { display: none; }
.shop-account { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 18px; padding: 9px clamp(10px, 2vw, 19px); }
.shop-account p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 9px; margin: 0; }
.shop-field-label, .shop-buy > div > span { color: var(--muted); font-size: .82rem; }
.shop-account strong { font: 650 1.02rem var(--heading); font-variant-numeric: tabular-nums; }
.shop-account [data-shop-balance] { color: var(--amber); font-size: 1.38rem; }
.shop-wallet { display: flex; flex-wrap: wrap; flex: 1 0 100%; gap: 4px 16px; margin: 0; padding-block-start: 6px; border-block-start: 1px solid var(--line); }
.shop-wallet div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.shop-wallet dt { color: var(--muted); font-size: .78rem; }
.shop-wallet dd { margin: 0; font-size: .84rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.shop-account .shop-account-scope { flex-basis: 100%; color: var(--muted); font-size: .78rem; line-height: 1.38; }
.shop-booster-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px 12px; }
.shop-sources { display: flex; flex-wrap: wrap; gap: 5px; }
.shop-sources button { min-block-size: 41px; padding: 5px 10px; font-size: .85rem; }
.shop-sources button[aria-pressed='true'] { border-color: #70a5a8; background: #19333e; color: #e8fafa; }
.shop-sources [data-shop-found] { margin-inline-start: 4px; color: #a9e3ca; }
.shop-mining-bonus {
  margin: 0; padding: 3px 6px; border-radius: 4px; background: var(--list-panel-tint, #0b1426c7);
  color: #a9e3ca; font-size: .82rem; line-height: 1.35; overflow-wrap: anywhere;
}
.shop-products { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 174px), 1fr)); align-items: stretch; gap: 8px; }
#shop-page .shop-product {
  display: flex; flex-direction: column; gap: 8px; padding: 11px; min-inline-size: 0;
  border-color: var(--list-panel-line, #98afd749);
  border-block-start: 2px solid var(--shop-accent);
  background: linear-gradient(165deg, var(--shop-product-top), var(--list-panel-tint, #0b1426c7) 47%);
}
.shop-product[data-shop-product="construction"] { --shop-accent: #f4c181; }
.shop-product[data-shop-product="research"] { --shop-accent: #c9b4fa; }
.shop-product[data-shop-product-type='mining'] { --shop-accent: #8ce7c9; }
.shop-product[data-shop-product-type='supply'] { --shop-accent: #9cdaff; }
.shop-product header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px; }
.shop-product h2 { margin: 0; color: #edf2fa; font: 650 clamp(.97rem, 2.2vw, 1.1rem) var(--heading); overflow-wrap: anywhere; }
.shop-effect { font: 700 .9rem var(--heading); color: var(--shop-accent); white-space: nowrap; }
.shop-description, .shop-preview, .shop-active { margin: 0; line-height: 1.38; font-size: .82rem; overflow-wrap: anywhere; }
.shop-description { color: #bac8dc; }
.shop-buy { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 8px; margin-block-start: auto; }
.shop-buy > div { display: flex; align-items: baseline; gap: 5px; }
.shop-buy strong { font: 650 .96rem var(--heading); color: var(--shop-accent); }
.shop-product-source { color: #b7c8db; font-size: .78rem; }
.shop-buy-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.shop-product button, .shop-job-field select { min-block-size: 44px; max-inline-size: 100%; font-size: .83rem; }
.shop-product button { white-space: normal; }
.shop-use { display: grid; align-items: start; gap: 6px; padding-block-start: 9px; border-block-start: 1px solid var(--line); }
.shop-use button { justify-self: start; }
.shop-job-field { display: grid; gap: 4px; color: #c9d5e5; font-size: .79rem; }
.shop-job-field select { min-inline-size: 0; padding-inline: 6px; color: #e8eff8; background: #172337; border: 1px solid #4c607d; border-radius: 5px; text-overflow: ellipsis; }
.shop-preview { color: var(--muted); }
.shop-active { color: var(--shop-accent); font-variant-numeric: tabular-nums; }

@media (orientation: landscape) and (max-height: 600px) {
  .shop-products { grid-template-columns: repeat(auto-fit, minmax(min(100%, 146px), 1fr)); }
  #shop-page .shop-product { gap: 6px; padding: 8px; }
  .shop-use { padding-block-start: 6px; }
  .shop-sources button, .shop-product button, .shop-job-field select { min-block-size: 38px; }
}
.shop-funding summary { align-content: center; min-block-size: 44px; padding-inline: 13px; cursor: pointer; color: var(--cyan); font-size: .87rem; font-weight: 600; }
.shop-funding summary:focus-visible, .shop-job-field select:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.shop-funding-note { margin: 0; padding: 0 13px 8px; color: var(--muted); font-size: .8rem; line-height: 1.38; }
.shop-funding dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 5px 12px; margin: 0; padding: 0 13px 10px; }
.shop-funding dl div { display: flex; justify-content: space-between; gap: 6px; padding: 6px 0; border-block-start: 1px solid var(--line); font-size: .81rem; }
.shop-funding :is(dt, dd) { min-inline-size: 0; overflow-wrap: anywhere; }
.shop-funding dd { margin: 0; color: var(--amber); text-align: end; }
.shop-status { position: sticky; inset-block-end: 6px; margin: 0; padding: 7px 10px; border: 1px solid #46617a; border-radius: 6px; background: #16263d; color: var(--cyan); font-size: .85rem; }
.shop-status:empty { position: absolute; margin: 0; padding: 0; border: 0; }
.shop-status[data-error="true"] { color: var(--danger); }

@media (orientation: landscape) and (max-height: 600px) {
  #shop-page .page-heading { align-items: center; margin-block-end: 8px; }
  #shop-page h1 { font-size: clamp(1.4rem, 3.2vw, 2rem); }
  #shop-page .shop-pack-button { display: inline-flex; align-items: center; }
}
.shop-packs { margin-block-start: 13px; padding: 11px 13px; }

.shop-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  border-radius: 6px 6px 0 0;
  border-block-end: 1px solid #3c5269;
  background: var(--list-panel-tint, #0b1426c7);
}
.shop-tabs button {
  min-block-size: 41px;
  padding: 5px 13px;
  border: 1px solid transparent;
  border-block-end-width: 2px;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: #b0c5d7;
  font: 650 .93rem/1.2 var(--heading);
}
.shop-tabs button:hover, .shop-tabs button[aria-selected='true'] { background: #192b3e; color: #eff8ff; }
.shop-tabs button[aria-selected='true'] { border-inline-color: #3c5269; border-block-end-color: #a4dbe3; }
.shop-panel { display: grid; min-inline-size: 0; gap: 9px; }
#shop-content[data-shop-view='heroes'] .shop-selected-planet { display: none; }
#shop-page:has(#shop-content[data-shop-view='heroes']) .shop-pack-button { display: inline-flex; align-items: center; }

.shop-hero-contract {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 1px 2px;
  gap: 4px 12px;
  border-radius: 6px;
  background: var(--list-panel-tint, #0b1426c7);
  color: #d3e6ee;
  font-size: .79rem;
  font-variant-numeric: tabular-nums;
}
.shop-hero-contract p { margin: 0; overflow-wrap: anywhere; }
.shop-hero-contract > div:first-child { flex: 1 1 215px; }
.shop-hero-contract [data-hero-hint] { color: #efc593; }
.shop-hero-terms {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 2px;
  border: 1px solid #405669;
  border-radius: 6px;
  background: var(--list-panel-tint, #0b1426c7);
}

@media (prefers-contrast: more) {
  #shop-page { --shop-product-top: #16263af2; }
}
.shop-hero-terms button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-block-size: 32px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #c1d5e6;
  font: 650 .77rem/1.2 var(--heading);
  white-space: nowrap;
}
.shop-hero-terms button:hover:not(:disabled), .shop-hero-terms button[aria-pressed='true'] {
  border-color: #63839a;
  background: #263d52;
  color: #eff8fc;
}
.shop-hero-terms button:disabled { opacity: .63; }
.shop-hero-terms .crystal-amount { color: #f0c897; }
.shop-hero-terms .crystal-amount-icon { inline-size: 18px; block-size: 18px; }
.shop-hero-roster { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
[data-hero-species='insectoid'] { --hero-portrait-ratio: 2 / 3; }
.shop-hero-card {
  --hero-accent: #ffd5a1;
  --hero-atlas-offset: 0%;
  display: grid;
  grid-template-rows: auto 1fr;
  min-inline-size: 0;
  border: 1px solid #405669;
  border-radius: 8px;
  overflow: hidden;
  background: #111f2e;
}
[data-shop-hero='mining'] { --hero-accent: #a8ece0; --hero-atlas-offset: 50%; }
[data-shop-hero='research'] { --hero-accent: #d9c5ff; --hero-atlas-offset: 100%; }
[data-shop-hero='fleet'] { --hero-accent: #a0dfff; }
.shop-hero-card[data-hero-active='true'] { border-color: var(--hero-accent); }
.shop-hero-visual {
  position: relative;
  overflow: hidden;
  block-size: clamp(5rem, 22vw, 18rem);
  border-block-end: 1px solid #41576a;
  background: radial-gradient(ellipse at 42% 28%, #32415a, #142235 80%);
}
.shop-hero-visual::after {
  position: absolute;
  inset: auto 0 0;
  block-size: 34%;
  background: linear-gradient(transparent, #111f2ee6);
  content: '';
}
.shop-hero-portrait {
  position: absolute;
  inset: 0 auto auto 0;
  inline-size: 100%;
  aspect-ratio: var(--hero-portrait-ratio, 1 / 2);
  background: var(--hero-atlas, none) no-repeat var(--hero-atlas-offset, 0%) 0 / 300% 100%;
}
[data-shop-hero='fleet'] .shop-hero-portrait { inset: 0; aspect-ratio: auto; background: var(--hero-fleet-art, none) no-repeat center 12% / cover; }
.shop-hero-body {
  display: grid;
  grid-template:
    'hero-name hero-name' auto
    'hero-effect hero-profile' minmax(min-content, 1fr)
    'hero-action hero-action' auto / minmax(0, 1fr) auto;
  gap: 7px 3px;
  align-items: start;
  padding: 10px 11px 11px;
}
.shop-hero-card:is([data-shop-hero='construction'], [data-shop-hero='research']) .shop-hero-body {
  grid-template:
    'hero-name hero-name' auto
    'hero-effect hero-profile' minmax(min-content, 1fr)
    'hero-extra hero-extra' auto
    'hero-action hero-action' auto / minmax(0, 1fr) auto;
}
.shop-hero-body header { grid-area: hero-name; }
.shop-hero-role { margin: 0 0 3px; color: var(--hero-accent); font: 600 .74rem/1.16 var(--heading); }
.shop-hero-body h3 { margin: 0; color: #f3f6fb; font: 650 clamp(.96rem, 2.2vw, 1.24rem)/1.12 var(--heading); overflow-wrap: anywhere; }
.shop-hero-effect { grid-area: hero-effect; margin: 0; color: #c9dbe6; font-size: .82rem; line-height: 1.25; overflow-wrap: anywhere; }
.shop-hero-effect strong { color: var(--hero-accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.shop-hero-extra { grid-area: hero-extra; margin: 0; color: var(--hero-accent); font-size: .77rem; line-height: 1.18; overflow-wrap: anywhere; }
.shop-hero-profile {
  grid-area: hero-profile;
  min-block-size: 23px;
  padding: 2px 4px;
  border: 0;
  border-radius: 4px;
  background: #1a2c3b;
  color: #c2dfe9;
  font-size: .76rem;
  white-space: nowrap;
}
.shop-hero-profile:hover { color: #fff; background: #29455a; }
.shop-hero-hire {
  grid-area: hero-action;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-block-size: 40px;
  min-inline-size: 0;
  padding: 4px 8px;
  border: 1px solid #698699;
  border-radius: 5px;
  background: #20394c;
  color: #f0f8fc;
  text-align: start;
  font: 650 .82rem/1.2 var(--heading);
}
.shop-hero-hire:hover:not(:disabled) { background: #2a4b60; border-color: var(--hero-accent); }
.shop-hero-hire:disabled { opacity: .63; }
.shop-hero-hire .crystal-amount { color: var(--hero-accent); }
.shop-hero-card[data-hero-active='true'] .shop-hero-hire { border-color: var(--hero-accent); color: var(--hero-accent); }

.shop-hero-dialog {
  position: fixed;
  inline-size: min(660px, calc(100vw - 28px));
  max-block-size: calc(100dvh - 24px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0;
  border: 1px solid #536781;
  border-radius: 10px;
  background: #142231;
  color: #eef5fb;
}
.shop-hero-dialog::backdrop { background: #020711df; }
.shop-hero-dialog > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 13px; border-block-end: 1px solid #405669; }
.shop-hero-dialog h2 { margin: 0; font: 650 1.24rem/1.2 var(--heading); overflow-wrap: anywhere; }
.shop-hero-dialog .shop-hero-role { color: var(--hero-accent, #ffd5a1); }
.shop-hero-dialog [data-hero-profile-close] {
  flex: none;
  min-inline-size: 42px;
  min-block-size: 42px;
  border: 1px solid #536781;
  border-radius: 5px;
  background: #20394c;
  font: 650 1.3rem/1 var(--heading);
}
.shop-hero-dialog-content { display: grid; grid-template-columns: minmax(70px, 26%) minmax(0, 1fr); align-items: stretch; }
.shop-hero-dialog .shop-hero-visual { block-size: auto; min-block-size: 160px; border: 0; border-inline-end: 1px solid #405669; }
.shop-hero-story { padding: 14px 15px; color: #d7e5ef; font-size: .93rem; line-height: 1.55; overflow-wrap: anywhere; }
.shop-hero-story p { margin: 0; }
.shop-hero-story p + p { margin-block-start: 10px; }
.shop-hero-story-effect { color: var(--hero-accent, #ffd5a1); }

@media (orientation: landscape) and (max-height: 460px) {
  #shop-content[data-shop-view='heroes'] { gap: 5px; }
  #shop-content[data-shop-view='heroes'] .shop-tabs button { min-block-size: 32px; }
  #shop-content[data-shop-view='heroes'] .shop-account { padding: 3px 8px; gap: 2px 9px; }
  #shop-content[data-shop-view='heroes'] .shop-account [data-shop-balance] { font-size: 1.04rem; }
  #shop-content[data-shop-view='heroes'] .shop-wallet { padding-block-start: 3px; gap: 2px 8px; }
  #shop-content[data-shop-view='heroes'] .shop-wallet :is(dt, dd) { font-size: .67rem; }
  #shop-content[data-shop-view='heroes'] .shop-account-scope { display: none; }
  #shop-panel-heroes { gap: 5px; }
  .shop-hero-terms button { min-block-size: 27px; padding-inline: 5px; }
  .shop-hero-roster { gap: 6px; }
  .shop-hero-card { grid-template: auto / minmax(44px, .31fr) minmax(0, .69fr); }
  .shop-hero-visual { block-size: auto; min-block-size: 120px; border-block-end: 0; border-inline-end: 1px solid #41576a; }
  .shop-hero-body { gap: 4px 3px; padding: 5px; }
  .shop-hero-role { font-size: .69rem; }
  .shop-hero-body h3 { font-size: .89rem; }
  .shop-hero-effect { font-size: .72rem; }
  .shop-hero-extra { font-size: .68rem; }
  .shop-hero-profile { min-block-size: 18px; padding-inline: 3px; font-size: .67rem; }
  .shop-hero-hire { min-block-size: 34px; padding: 2px 4px; font-size: .71rem; gap: 2px; }
  .shop-hero-hire .crystal-amount { gap: 2px; }
  .shop-hero-hire .crystal-amount-icon { inline-size: 16px; block-size: 16px; }
}

@media (orientation: landscape) and (max-height: 460px) and (min-width: 631px) {
  #shop-page:has(#shop-content[data-shop-view='heroes']) .page-heading { margin-block-end: 4px; }
  #shop-content[data-shop-view='heroes'] { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  #shop-content[data-shop-view='heroes'] .shop-tabs { border: 0; gap: 3px; }
  #shop-content[data-shop-view='heroes'] .shop-tabs button { padding-inline: 8px; }
  #shop-content[data-shop-view='heroes'] :is(.shop-panel, .shop-status) { grid-column: 1 / -1; }
  .shop-hero-card { position: relative; grid-template: auto / minmax(0, 1fr); }
  .shop-hero-card .shop-hero-visual {
    position: absolute;
    inset: 0 auto auto 0;
    inline-size: 51px;
    block-size: 42px;
    min-block-size: 0;
    border-block-end: 1px solid #41576a;
    border-end-end-radius: 6px;
  }
  .shop-hero-body header { min-block-size: 36px; padding-inline-start: 51px; }
}

@media (max-width: 630px) {
  .shop-hero-roster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-hero-card { grid-template: auto 1fr / minmax(0, 1fr); }
  .shop-hero-visual { block-size: clamp(5rem, 20vw, 11rem); min-block-size: 0; border-inline-end: 0; border-block-end: 1px solid #41576a; }
  .shop-hero-body { padding-inline: 5px; }
}
@media (orientation: portrait) {
  [data-mobile-device] .shop-hero-dialog[open] { display: none !important; }
  [data-mobile-device] .shop-hero-dialog::backdrop { display: none; }
}
