#store-panel {
  --store-paper: var(--bg-panel);
  --store-ink: var(--text);
  --store-secondary: var(--text-dim);
  --store-rule: var(--border);
  --store-link: var(--info, var(--text));
  --store-art-width: 28px;
  --store-price-width: 91px;
  --store-selection: color-mix(in srgb, var(--store-ink) 10%, var(--store-paper));
  --store-read: 'Atkinson Hyperlegible', 'Segoe UI', sans-serif;
  --store-display: var(--store-read);
}
html body #store-panel.cool-modal:not(.hidden):not(.store-garage-active) {
  background: var(--store-paper);
  color: var(--store-ink);
  border: 1px solid var(--store-rule);
  border-radius: 3px;
}
html body #store-panel > .cool-modal-header {
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 10px;
  min-height: 48px;
  padding: 2px 56px 2px 16px;
  background: var(--store-paper);
  color: var(--store-ink);
  border: 0;
}
html body #store-panel > .cool-modal-header .cool-modal-title {
  flex: 0 0 auto;
  color: inherit;
  font: 700 21px/1.2 var(--store-display) !important;
  text-shadow: none;
}
html body #store-panel > .bottom-modal-close {
  color: var(--store-ink);
  background: transparent;
  text-shadow: none;
}
#store-panel.ch-window > .cool-modal-header { padding-inline-end: 104px; }
#store-panel.ch-win-min #store-aisle { display: none; }
#store-panel #store-wallet {
  margin-inline-start: auto;
  font: 600 14px/1.3 var(--store-read);
  color: var(--store-ink);
  white-space: nowrap;
}
#store-panel.ch-win-min #store-wallet { display: none; }
html body #store-panel #store-aisle {
  flex: 0 1 auto;
  width: auto;
  min-width: 44px;
  max-width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0 3px;
  border: 0;
  border-radius: 0;
  background: var(--store-paper);
  color: var(--store-ink);
  font: 15px/1.2 var(--store-read);
  color-scheme: dark;
}
html body #store-panel > .cool-modal-body { padding: 0 16px 2px; scrollbar-gutter: auto; }
@media (min-width: 769px) {
  html body #store-panel.ch-window:not(.hidden) { width: 556px; height: auto; max-height: min(480px, calc(100dvh - 96px)); }
}
@media (min-width: 641px) {
  body.layout-cinema:not(.twitch-safe-surface) > #store-panel.ch-window:not(.hidden) {
    max-height: calc(100dvh - 72px) !important;
  }
}

html body #store-panel #store-grid:not(.hidden) { display: block; margin: 0; padding: 0; }
#store-panel #store-catalog {
  display: grid;
  grid-template-columns: minmax(75px, 23%) minmax(0, 1fr);
  align-items: start;
  column-gap: 12px;
}
#store-panel #store-inspect-art {
  position: sticky;
  top: 8px;
  margin-block-start: 8px;
}
#store-panel #store-inspect-art .store-item-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: none;
  border: 0;
}
#store-panel.store-garage-active #store-catalog { display: none; }
#store-panel #store-catalog:has(#store-inspect-art:empty) { grid-template-columns: 1fr; }
#store-inspect-art:empty { display: none; }
#store-panel .store-category-name {
  margin: 0;
  padding: 13px 0 2px;

  color: var(--store-ink);
  font: 600 14px/1.3 var(--store-read);
}
html body #store-panel #store-grid .store-item {
  display: grid;
  grid-template-columns: var(--store-art-width) minmax(0, 1fr) var(--store-price-width);
  grid-template-areas: none;
  align-items: center;
  column-gap: 11px;
  row-gap: 0;
  min-width: 0;
  min-height: 58px;
  padding: 5px 8px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
  text-align: left;
}
#store-panel .store-item-art { display: grid; place-items: center; width: 100%; aspect-ratio: 1; }
html body #store-panel #store-grid .store-item.store-inspected {
  background: var(--store-selection);
}
html body #store-panel #store-grid .store-item-img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: contain;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
#store-panel .store-item-info { min-width: 0; }
#store-panel #store-grid :is(.store-item-info, .store-item-art) { cursor: pointer; }
html body #store-panel #store-grid .store-item-name {
  display: block;
  margin: 0;
  color: var(--store-ink);
  font: 650 17px/1.2 var(--store-display) !important;
  overflow-wrap: break-word;
  text-shadow: none;
  text-transform: none;
}
html body #store-panel #store-grid .store-item-desc {
  display: block;
  margin: 2px 0 0;
  color: var(--store-secondary);
  font: 14px/1.3 var(--store-read);
  overflow-wrap: anywhere;
}
#store-panel .store-effect-value { font-weight: inherit; white-space: nowrap; }
html body #store-panel #store-grid .store-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 9px;
  margin: 3px 0 0;
  color: var(--store-ink);
  font: 13px/1.25 var(--store-read);
}
#store-panel .store-item-meta:has(> [hidden]:only-child) { display: none !important; }
html body #store-panel #store-grid .store-item-stock { color: var(--store-secondary); font: inherit; }
html body #store-panel #store-grid .store-goods {
  min-width: 44px;
  min-height: 24px;
  max-width: 100%;
  margin: 0;
  padding: 0;
  color: inherit !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  text-align: start;
  text-shadow: none;
  white-space: normal;
  font: inherit !important;
  cursor: pointer;
}
#store-panel .store-goods:hover { text-decoration: underline; text-underline-offset: 3px; }
html body #store-panel #store-grid .store-item-price {
  grid-area: 1 / 3;
  align-self: center;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 4px 0;
  color: var(--store-ink);
  font: 400 14px/1.25 var(--store-read) !important;
}
html body #store-panel #store-grid button.store-item-price {
  align-items: center;
  min-height: 44px;
  color: var(--store-link) !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  text-shadow: none;
}
#store-panel .store-buy-verb { text-decoration: underline; text-underline-offset: 3px; }
#store-panel .store-buy-btn:disabled .store-buy-verb { display: none; }
html body #store-panel #store-grid button.store-item-price:hover:not(:disabled) {
  color: var(--store-ink) !important;
}
html body #store-panel #store-grid button.store-item-price:disabled {
  color: var(--store-secondary) !important;
  opacity: 1;
  cursor: default;
}
#store-panel .store-price-amount {
  white-space: nowrap;
  font: inherit;
  font-variant-numeric: tabular-nums;
}
#store-panel .store-price-unit { font: inherit; }
#store-panel #store-grid :is(.store-receipt,.store-detail,.store-work-progress) { grid-column: 2 / -1; }
#store-panel #store-grid .store-receipt:empty,
#store-panel #store-grid .store-detail[hidden] { display: none; }
#store-panel #store-grid :is(.store-receipt:not(:empty),.store-detail:not([hidden])) {
  padding-block: 4px;
  color: var(--store-ink);
  font: 14px/1.3 var(--store-read);
  overflow-wrap: anywhere;
}
#store-panel #store-grid .store-detail:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}
#store-panel #store-grid .store-item-note { margin: 0; color: inherit; }
#store-panel #store-grid .store-work-progress { margin-top: 5px; }
#store-panel #store-grid .store-make-btn { min-height: 44px; white-space: normal; }
#store-panel #store-grid .store-item--soon,
#store-panel #store-grid .cool-empty { margin: 0; padding: 12px 0; color: var(--store-ink); }
#store-panel #store-grid :is(.store-item,.store-goods,.store-buy-btn,.store-make-btn):focus-visible,
#store-panel #store-aisle:focus-visible {
  outline: 2px solid var(--store-ink);
  outline-offset: 2px;
}
#store-panel .store-extras {
  display: flex;
  flex-wrap: wrap;
  column-gap: 22px;
  border-top: 1px solid var(--store-rule);
  margin-top: 5px;
}
#store-panel .store-utility { margin: 0; }
#store-panel .store-utility summary {
  min-height: 44px;
  padding: 12px 0;
  color: var(--store-ink);
  font: 14px/1.4 var(--store-read);
  cursor: pointer;
}
#store-panel .store-utility[open] { flex: 0 0 100%; padding-bottom: 8px; }
#store-panel #inventory-grid-abbrev { display: block; }
#store-panel #inventory-grid-abbrev .store-item {
  display: grid;
  grid-template-columns: 32px minmax(0,1fr) auto;
  align-items: center;
  gap: 2px 8px;
  min-height: 48px;
  margin: 0;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--store-ink);
  text-align: start;
  box-shadow: none;
}
#inventory-grid-abbrev .store-item-img { grid-area: 1 / 1 / span 2; width: 32px; height: 32px; object-fit: contain; margin: 0; }
#store-panel #inventory-grid-abbrev .store-item-name { grid-area: 1 / 2; align-self: end; color: inherit; font: 600 15px/1.3 var(--store-read); }
#store-panel #inventory-grid-abbrev .inventory-count { color: var(--store-secondary); font-weight: 400; white-space: nowrap; }
#store-panel #inventory-grid-abbrev .store-item-meta { grid-area: 2 / 2; align-self: start; color: var(--store-secondary); font: 13px/1.3 var(--store-read); }
#store-panel #inventory-grid-abbrev .store-item-actions { grid-area: 1 / 3 / span 2; justify-content: end; align-items: center; margin: 0; max-width: min(44vw, 200px); }
#store-panel #inventory-grid-abbrev .store-item-actions button {
  min-height: 44px;
  padding: 3px 6px;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--store-link);
  text-decoration: underline;
  text-underline-offset: 2px;
  font: 14px/1.2 var(--store-read);
}
#store-panel #inventory-grid-abbrev .store-item-actions .store-drop-btn { color: var(--store-secondary); text-decoration: none; }
#store-panel #btn-inventory-full { min-height: 44px; color: var(--store-link); text-decoration: underline; font: 14px/1.3 var(--store-read); }
#store-inventory-result { padding-bottom: 6px; color: var(--store-ink); font: 14px/1.3 var(--store-read); }
#store-panel .store-utility :is(.cool-empty,.link-btn,.recipe-craft-list,.recipe-craft-title) { color: var(--store-ink); }
#store-panel.store-garage-active #store-garage { padding-block: 11px; }
#store-panel.store-garage-active .store-extras { display: none; }

@media (max-width: 768px) {
  html body #store-panel.cool-modal:not(.hidden):not(.store-garage-active) {
    top: auto;
    bottom: 0;
    height: auto;
    max-height: calc(100dvh - 36px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  html body #store-panel > .cool-modal-header { padding-inline-start: 12px; }
  html body #store-panel > .cool-modal-body { padding-inline: 12px; }
}
@media (max-width: 640px) {
  #store-panel { --store-art-width: 56px; --store-price-width: 86px; }
  #store-panel #store-catalog { display: block; }
  #store-panel #store-inspect-art { display: none; }
  html body #store-panel #store-grid .store-item { column-gap: 8px; padding-inline: 5px; min-height: 56px; }
  #store-panel #store-grid .store-item-art { width: 34px; justify-self: center; }
  #store-panel #store-grid .store-inspected .store-item-art { width: 100%; }
}
@media (max-width: 350px) {
  #store-panel { --store-art-width: 44px; --store-price-width: 82px; }
  #store-panel.ch-window > .cool-modal-header { padding-inline-end: 54px; }
}

html:is(:not([data-theme]), [data-theme="classic"]) #store-panel {
  --store-paper: #e9eee3;
  --store-ink: #233831;
  --store-secondary: #4a5a50;
  --store-rule: #bac6b7;
  --store-link: #215a42;
  --store-selection: #f5da8a;
}
html:is(:not([data-theme]), [data-theme="classic"]) body #store-panel #store-aisle { color-scheme: light; }

html[data-theme="battlenet"] #store-panel { --store-link: var(--text); }
html[data-theme="jrpg"] #store-panel { --store-read: PixelOperator, 'Segoe UI', sans-serif; }
html:is([data-theme="toybox"], [data-theme="channel"]) #store-panel {
  --store-paper: #faf1df;
  --store-ink: #302923;
  --store-secondary: #62584e;
  --store-rule: #c0b4a4;
  --store-link: #185a58;
}
html:is([data-theme="toybox"], [data-theme="channel"]) body #store-panel #store-aisle { color-scheme: light; }
