.skin-shop {
  display: grid;
  min-width: 0;
  gap: var(--shop-gap, clamp(6px, .71cqw, 12px));
}

.skin-shop-tools {
  display: grid;
  grid-template-columns: var(--shop-tool-columns, minmax(0, 1fr) auto auto);
  align-items: stretch;
  gap: var(--shop-tool-gap, clamp(4px, .48cqw, 8px));
}

.skin-shop-tools:has(.skin-shop-balance[hidden]) {
  grid-template-columns: minmax(0, 1fr) auto;
}

.skin-shop-tools label { min-width: 0; }

.skin-shop .skin-shop-tools :is(input, select), .skin-shop-balance {
  width: 100%;
  min-width: 0;
  min-height: var(--shop-control-height, 34px);
  padding: .4em .52em;
  border: var(--shop-control-border, 1px solid #17110d);
  border-radius: var(--shop-control-radius, 6px);
  background: var(--shop-field-background, #fff2da);
  color: var(--shop-text, #17110d);
  font-size: var(--shop-tool-font-size, clamp(11px, .91cqw, 15px));
  font-weight: 800;
  line-height: 1.15;
}

.skin-shop-tools input::placeholder { color: var(--shop-muted, #694d3a); }

.skin-shop-balance {
  display: flex;
  grid-column: var(--shop-balance-column, auto);
  align-items: center;
  justify-content: space-between;
  gap: .65em;
  background: var(--shop-balance-background, #80f6b4);
  white-space: nowrap;
}

.skin-shop :is(.skin-shop-balance strong, .skin-shop-value, .skin-shop-pick span) {
  color: var(--shop-value-color, inherit);
  font-variant-numeric: tabular-nums;
}

.skin-shop .skin-shop-catalog {
  display: grid;
  grid-template-columns: var(--shop-columns, repeat(2, minmax(0, 1fr)));
  gap: var(--shop-grid-gap, .63cqw);
  max-height: var(--shop-grid-height, none);
  margin: 0;
  padding: var(--shop-grid-padding, 0);
  overflow: var(--shop-grid-overflow, visible);
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: var(--shop-scrollbar, auto);
}

.skin-shop-catalog > li { min-width: 0; }

.skin-shop .skin-shop-card {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: var(--shop-card-height, 56px);
  padding: var(--shop-card-padding, .33cqw .53cqw);
  grid-template-columns: var(--shop-card-columns, minmax(0, 1fr) minmax(0, 1.12fr));
  align-items: center;
  align-content: start;
  gap: var(--shop-card-gap, .35cqw);
  border: var(--shop-card-border, 1px solid #ff2873);
  border-block-end: var(--shop-card-bottom, var(--shop-card-border, 1px solid #ff2873));
  border-radius: var(--shop-card-radius, 6px);
  background: var(--shop-card-background, #ffdfcd);
  box-shadow: var(--shop-card-shadow, none);
  color: var(--shop-text, #17110d);
  font: inherit;
  line-height: 1.1;
  text-align: start;
}

.skin-shop-card:disabled { opacity: 1; cursor: default; }

.skin-shop .skin-shop-card:hover:not(:disabled) {
  border-color: var(--shop-card-hover-border, currentColor);
  background: var(--shop-card-hover, #ffd4c5);
}

.skin-shop .skin-shop-card[aria-pressed="true"] {
  border-color: var(--shop-card-hover-border, #ab1750);
  background: var(--shop-card-selected, #ffc8d7);
  box-shadow: var(--shop-selection-shadow, inset 0 0 0 1px #ab1750);
}

.skin-shop-card[aria-pressed="true"]::after {
  position: absolute;
  inset: 3px 3px auto auto;
  display: grid;
  width: 16px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 4px;
  background: var(--shop-check-background, #ba1558);
  color: var(--shop-check-color, #fff);
  font-size: 11px;
  font-weight: 900;
  content: "✓";
}

.skin-shop :is(button, input, select):focus-visible {
  outline: 2px solid var(--shop-focus, #851a46);
  outline-offset: 2px;
}

.skin-shop-art { width: 100%; height: var(--shop-art-height, clamp(36px, 4.34cqw, 70px)); }
.skin-shop-art > img { padding: 1px; object-view-box: var(--steam-image-view, none); }
.skin-shop-card-name { display: grid; min-width: 0; gap: .20em; }
.skin-shop-card-name > :is(span, small) { overflow-wrap: anywhere; }
.skin-shop-card-name span { font-size: var(--shop-name-size, clamp(10px, .97cqw, 16px)); font-weight: 750; }
.skin-shop-card-name small { color: var(--shop-muted, #634439); font-size: var(--shop-detail-size, clamp(9px, .77cqw, 12px)); }
.skin-shop-value { font-size: var(--shop-price-size, clamp(12px, 1.10cqw, 18px)); font-weight: 900; }
.skin-shop-stock { font-weight: 750; }
.skin-shop-card[data-sold-out] .skin-shop-stock { color: var(--shop-error, #8b1545); }
.skin-shop-card[data-sold-out] .skin-shop-art { opacity: .55; }

.skin-shop .skin-shop-card-placeholder {
  border-color: transparent;
  background: color-mix(in srgb, var(--shop-text, #17110d) 5%, var(--comic-paper-light, #fff2d6));
  box-shadow: none;
}
.skin-shop-card-placeholder .skin-shop-art,
.skin-shop-placeholder-lines > span {
  border-radius: 3px;
  background: color-mix(in srgb, var(--shop-text, #17110d) 13%, transparent);
}
.skin-shop-placeholder-lines { display: grid; gap: 4px; }
.skin-shop-placeholder-lines > span { width: 80%; block-size: .75em; }
.skin-shop-placeholder-lines > span:first-child { width: 38%; block-size: .9em; }
.skin-shop-placeholder-lines > span:last-child { width: 60%; }

.skin-shop-checkout { display: grid; align-content: center; gap: 4px; }
.skin-shop-checkout:not(:has(> :not([hidden]))) { display: none; }
.skin-shop-checkout:has(> :not([hidden])) {
  min-block-size: calc(var(--shop-control-height, 34px) + 2 * var(--shop-confirm-padding, 5px) + 2px);
}

.skin-shop-confirm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .42em;
  min-width: 0;
  padding: var(--shop-confirm-padding, 5px);
  border: var(--shop-control-border, 1px solid #17110d);
  border-radius: var(--shop-control-radius, 8px);
  background: var(--shop-balance-background, #80f6b4);
  color: var(--shop-text, #17110d);
}

.skin-shop-pick {
  display: grid;
  min-width: 0;
  padding-inline: 4px;
  font-size: var(--shop-tool-font-size, clamp(11px, .92cqw, 15px));
  line-height: 1.15;
}
.skin-shop-pick span { margin-top: .23em; font-weight: 800; }
.skin-shop-pick b { margin-left: .13em; font-size: 1.16em; font-weight: 900; }

.skin-shop :is(.skin-shop-buy, .skin-shop-secondary) {
  min-height: var(--shop-control-height, 34px);
  max-width: var(--shop-action-width, clamp(145px, 13cqw, 188px));
  padding: .36em .63em;
  border: var(--shop-control-border, 1px solid #17110d);
  border-radius: var(--shop-control-radius, 6px);
  background: var(--shop-action-background, #ffec15);
  box-shadow: var(--shop-action-shadow, 0 2px 0 #17110d);
  color: var(--shop-action-color, #17110d);
  font: var(--shop-action-font, italic 900 clamp(14px, 1.28cqw, 21px)/1.06 Impact, "Arial Narrow", sans-serif);
  text-align: center;
}

.skin-shop .skin-shop-secondary { justify-self: start; background: var(--shop-field-background, #fff2da); color: var(--shop-text, #17110d); }
.skin-shop :is(.skin-shop-buy, .skin-shop-secondary):hover:not(:disabled) { background: var(--shop-action-hover, #fff448); color: var(--shop-action-color, #17110d); }
.skin-shop .skin-shop-buy:disabled {
  opacity: 1;
  background: var(--shop-disabled-background, #dbd0b6);
  color: var(--shop-disabled-color, #594e42);
  box-shadow: none;
}

.skin-shop :is(.skin-shop-status, .skin-shop-message) { margin: 0; padding: .27em .14em; font-size: .83rem; }
.skin-shop-status { color: var(--shop-muted, #634439); }
.skin-shop-message { color: var(--shop-success, #225334); font-weight: 850; }
.skin-shop-message[data-error] { color: var(--shop-error, #8b1545); }

[data-skin-shop-panel] [data-skin-shop-host] {
  container-type: inline-size;
  --shop-text: var(--comic-ink, #20130f);
  --shop-muted: var(--comic-muted, #6e4936);
  --shop-field-background: var(--comic-paper-light, #fff2d6);
  --shop-balance-background: var(--comic-mint, #b9eca3);
  --shop-control-border: 1px solid var(--shop-text);
  --shop-control-height: 44px;
  --shop-control-radius: 4px;
  --shop-columns: repeat(3, minmax(0, 1fr));
  --shop-grid-gap: 8px;
  --shop-grid-padding: 3px;
  --shop-card-columns: minmax(0, 1fr);
  --shop-card-padding: 8px;
  --shop-card-gap: 4px;
  --shop-card-radius: 6px;
  --shop-card-border: 2px solid var(--shop-text);
  --shop-card-background: var(--shop-field-background);
  --shop-card-hover-border: var(--shop-text);
  --shop-card-hover: #ffe2a6;
  --shop-card-selected: #ffd986;
  --shop-selection-shadow: inset 0 0 0 1px var(--shop-text);
  --shop-check-background: var(--comic-yellow, #ffda24);
  --shop-check-color: var(--shop-text);
  --shop-focus: var(--comic-red, #b62147);
  --shop-tool-font-size: .875rem;
  --shop-name-size: .875rem;
  --shop-detail-size: .75rem;
  --shop-price-size: 1rem;
  --shop-art-height: clamp(60px, 14cqw, 100px);
  --shop-action-font: 800 .9rem/1.2 var(--font-interface, sans-serif);
  --shop-action-background: var(--comic-yellow, #ffda24);
  --shop-action-color: var(--shop-text);
  --shop-action-hover: var(--shop-balance-background);
  --shop-error: #9e1538;
  --shop-success: #25522a;
  --shop-disabled-color: #634439;
  --shop-disabled-background: #eadcc1;
}

@container (max-width: 420px) {
  [data-skin-shop-panel] .skin-shop-tools {
    --shop-tool-columns: minmax(0, 1fr) auto;
    --shop-balance-column: 1 / -1;
  }
  [data-skin-shop-panel] .skin-shop-catalog { --shop-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 360px) {
  .skin-shop-tools {
    --shop-tool-columns: minmax(0, 1fr) auto;
    --shop-balance-column: 1 / -1;
  }
}
