/* Inventory materials for public listings; transaction forms retain their
   established dimensions and behavior, with readable dark inner surfaces. */
html[data-ui-theme="teal-cloud-a"] #game-root [data-role="black-market-root"] {
  color: #eee3bd;
}

html[data-ui-theme="teal-cloud-a"] #game-root [data-role="black-market-root"] .black-market-list--market {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px 2px;
  min-width: 0;
  padding: 8px 3px;
  align-items: start;
  align-content: start;
  overflow-x: hidden;
  background: #0e383b26 !important;
  box-shadow: inset 0 0 0 2px #16484a, inset 0 0 0 3px #9d926644 !important;
}

html[data-ui-theme="teal-cloud-a"] #game-root .shop-panel[data-page="shop"] [data-role="black-market-root"] .black-market-list--market[data-role="black-market-list"] > :is(.black-market-product-tile, .black-market-empty-slot) {
  position: relative;
  box-sizing: border-box;
  display: grid;
  width: 100%;
  height: 75px;
  min-width: 0;
  min-height: 0;
  aspect-ratio: auto;
  padding: 4px;
  place-items: center;
  align-content: normal;
  grid-template-rows: none;
  gap: 0;
  overflow: hidden;
  border: 1px solid #b8a773 !important;
  border-radius: 4px;
  background: var(--tc-slot-filled-art, none) center / 100% 100% no-repeat,
    linear-gradient(120deg, #ece9d2, #cbd3b8) !important;
  box-shadow: inset 0 0 0 1px #3e756e88, inset 0 0 0 3px #f1e9c566 !important;
  color: #283420 !important;
  text-shadow: none !important;
  opacity: 1;
}

html[data-ui-theme="teal-cloud-a"] #game-root .shop-panel[data-page="shop"] [data-role="black-market-root"] .black-market-list--market[data-role="black-market-list"] > .black-market-empty-slot {
  background: var(--tc-slot-empty-art, none) center / 100% 100% no-repeat,
    linear-gradient(115deg, #42747255, #497b7055),
    var(--tc-cloth, none) center / 320px auto repeat, #2e6061 !important;
  border-color: #a79e6a !important;
  box-shadow: inset 0 0 0 1px #8aa49244 !important;
  pointer-events: none;
}

html[data-ui-theme="teal-cloud-a"] #game-root [data-role="black-market-root"] .black-market-product-tile > .shop-product-tile__art {
  position: relative;
  display: grid;
  width: 82%;
  max-width: 48px;
  aspect-ratio: 1;
  margin: 0;
  place-items: center;
  transform: translateY(-7px);
  border: 2px solid var(--black-market-quality-color, #797d6a) !important;
  border-radius: 6px;
  background-color: #d9dfc6 !important;
  color: #304738 !important;
  font-size: 12px;
}

html[data-ui-theme="teal-cloud-a"] #game-root [data-role="black-market-root"] .black-market-product-tile > .shop-product-tile__name {
  position: absolute;
  display: block;
  right: 3px;
  bottom: 1px;
  left: 3px;
  max-width: calc(100% - 6px);
  min-height: 0;
  margin: 0;
  padding: 1px 2px;
  overflow: hidden;
  background: transparent !important;
  color: #283420 !important;
  -webkit-text-fill-color: #283420 !important;
  text-shadow: none !important;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-line-clamp: unset;
}

html[data-ui-theme="teal-cloud-a"] #game-root [data-role="black-market-root"] :is(.shop-product-tile__art, .black-market-row__art) > span {
  color: #304738 !important;
  -webkit-text-fill-color: #304738 !important;
}

html[data-ui-theme="teal-cloud-a"] #game-root [data-role="black-market-root"] .black-market-product-tile > .black-market-quality-badge {
  top: 2px;
  right: 2px;
  margin: 0;
  padding: 1px 3px;
  font-size: 9px;
  line-height: 1.25;
}

/* The compact rarity badge always retains its exact item-quality color. */
html[data-ui-theme="teal-cloud-a"] #game-root :is([data-role="black-market-root"], dialog.black-market-dialog) .black-market-quality-badge {
  background: #253c35 !important;
  border-color: var(--quality-badge-color, #d8d8d8) !important;
  color: var(--quality-badge-color, #d8d8d8) !important;
  -webkit-text-fill-color: var(--quality-badge-color, #d8d8d8) !important;
  text-shadow: none !important;
}

html[data-ui-theme="teal-cloud-a"] #game-root [data-role="black-market-root"] :is(.black-market-product-tile, .black-market-view-button, .shop-category-button):focus-visible,
html[data-ui-theme="teal-cloud-a"] #game-root dialog.black-market-dialog :is(.black-market-choice, .black-market-item-choice, .black-market-filter-option):focus-visible {
  outline: 2px solid #f0d18a;
  outline-offset: -2px;
}

html[data-ui-theme="teal-cloud-a"] #game-root [data-role="black-market-root"] .black-market-reserved-tab:disabled {
  background: #46625d !important;
  border-color: #899989 !important;
  color: #d5dacb !important;
  -webkit-text-fill-color: #d5dacb !important;
  opacity: 1;
}

html[data-ui-theme="teal-cloud-a"] #game-root [data-role="black-market-root"] .shop-empty {
  grid-column: 1 / -1;
  width: 100%;
  padding: 20px 12px;
  border: 1px solid #a89c69 !important;
  border-radius: 7px;
  background: var(--tc-slot-empty-art, none) center / 100% 100% no-repeat,
    var(--tc-cloth, none) center / 480px auto repeat, #245859 !important;
  color: #eee3bd !important;
  text-shadow: 0 1px #163a3c;
}

html[data-ui-theme="teal-cloud-a"] #game-root [data-role="black-market-own-list"] > .shop-empty {
  display: grid;
  min-height: 132px;
  place-items: center;
}

html[data-ui-theme="teal-cloud-a"] #game-root [data-role="black-market-own-list"] .black-market-row {
  border-color: #ae9a64 !important;
  background: linear-gradient(125deg, #245a54, #133f42) !important;
  color: #eee3bd !important;
  box-shadow: inset 0 0 0 1px #e0bd6b22 !important;
}

html[data-ui-theme="teal-cloud-a"] #game-root [data-role="black-market-own-list"] .black-market-row__identity > .black-market-quality-name {
  color: #eee3bd !important;
  -webkit-text-fill-color: #eee3bd !important;
  text-shadow: none !important;
}

html[data-ui-theme="teal-cloud-a"] #game-root [data-role="black-market-own-list"] .black-market-row small {
  color: #bfcebd !important;
}

html[data-ui-theme="teal-cloud-a"] #game-root [data-role="black-market-own-list"] .black-market-row__price strong {
  color: #f1d58b !important;
}

html[data-ui-theme="teal-cloud-a"] #game-root [data-role="black-market-own-list"] .black-market-row__art {
  background-color: #d9dfc6 !important;
  border-color: var(--black-market-quality-color, #a89c69) !important;
}

/* Dark form panels replace the remaining legacy pale cards and dark ink. */
html[data-ui-theme="teal-cloud-a"] #game-root dialog.black-market-dialog[data-role] :is(
  .black-market-listing-panel, .black-market-listing-settings, .black-market-filter-section,
  .black-market-purchase-detail, .black-market-purchase-detail__attributes, .black-market-purchase-detail__price
) {
  background: #17484a !important;
  color: #eee3bd !important;
  border-color: #ac98647a !important;
  box-shadow: inset 0 1px #f0dfa518 !important;
}

html[data-ui-theme="teal-cloud-a"] #game-root dialog.black-market-dialog[data-role] :is(
  .black-market-listing-field h3, .black-market-filter-section h3,
  .black-market-purchase-detail__price strong
) {
  color: #f1d58b !important;
  -webkit-text-fill-color: #f1d58b !important;
  text-shadow: none !important;
}

html[data-ui-theme="teal-cloud-a"] #game-root dialog.black-market-dialog[data-role] .black-market-listing-preview {
  background: #0e393c !important;
  border-color: #b5a16699 !important;
  color: #eee3bd !important;
  box-shadow: none !important;
}

html[data-ui-theme="teal-cloud-a"] #game-root dialog.black-market-dialog[data-role] .black-market-listing-preview :is(span, strong),
html[data-ui-theme="teal-cloud-a"] #game-root dialog.black-market-dialog[data-role] :is(
  .black-market-purchase-detail p, .black-market-purchase-detail__attributes span, .black-market-purchase-detail__attributes strong,
  .black-market-cancel-message, .black-market-rules-content p, .black-market-rules-content ul
) {
  color: #eee3bd !important;
  -webkit-text-fill-color: #eee3bd !important;
  text-shadow: none !important;
}

html[data-ui-theme="teal-cloud-a"] #game-root dialog.black-market-dialog[data-role] .black-market-purchase-detail__meta > .black-market-quality-name {
  color: #eee3bd !important;
  -webkit-text-fill-color: #eee3bd !important;
}

html[data-ui-theme="teal-cloud-a"] #game-root dialog.attribute-modal.black-market-dialog.black-market-listing-dialog[data-role] .black-market-choice {
  background: var(--tc-action-art, none) center / 100% 100% no-repeat, #d3dcc1 !important;
  color: #173f3c !important;
  -webkit-text-fill-color: #173f3c !important;
  border-color: #ae9d67 !important;
  box-shadow: inset 0 1px #fff6d944 !important;
}

html[data-ui-theme="teal-cloud-a"] #game-root dialog.attribute-modal.black-market-dialog.black-market-listing-dialog[data-role] .black-market-choice.is-selected {
  background: #2b655c !important;
  color: #fff0c4 !important;
  -webkit-text-fill-color: #fff0c4 !important;
  border-color: #dfc17b !important;
  box-shadow: inset 0 0 0 1px #ead29133 !important;
}

html[data-ui-theme="teal-cloud-a"] #game-root dialog.attribute-modal.black-market-dialog.black-market-listing-dialog[data-role] .black-market-item-choice {
  background: #123e40 !important;
  border-color: var(--black-market-quality-color, #b09c67) !important;
  color: #eee3bd !important;
  box-shadow: none !important;
}

html[data-ui-theme="teal-cloud-a"] #game-root dialog.attribute-modal.black-market-dialog.black-market-listing-dialog[data-role] .black-market-item-choice.is-selected {
  background: #2a6258 !important;
  outline: 1px solid #e1c681;
  outline-offset: 1px;
  box-shadow: inset 0 0 0 1px #e1c68144 !important;
}

html[data-ui-theme="teal-cloud-a"] #game-root dialog.black-market-listing-dialog[data-role] .black-market-item-choice > strong {
  color: #eee3bd !important;
  -webkit-text-fill-color: #eee3bd !important;
  text-shadow: none !important;
}
