#dialog:has(.trade-layout818) {
  width: 960px;
  height: 700px;
  box-sizing: border-box;
  max-height: 740px;
  display: flex;
  flex-direction: column;
  border: 3px double #dfb65d;
  background: linear-gradient(135deg, #352630, #201b26);
  color: #ffe7b4;
}

#dialog:has(.trade-layout818) #dialog-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.trade-layout818 {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  font: 16px Arial, sans-serif;
}

.trade-bag818, .trade-offers818 {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
  padding: 10px;
  border: 1px solid #ae864b;
  border-radius: 9px;
  background: #211922;
}

.trade-offers818 {
  overflow: auto;
  touch-action: pan-y;
}

.trade-side818 + .trade-side818 {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #ae864b;
}

.trade-layout818 p, .trade-layout818 label {
  margin: 3px 0;
}

.trade-grid818 {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 62px;
  gap: 4px;
  margin: 5px 0;
}

.trade-inventory818 {
  overflow: auto;
  touch-action: pan-y;
}

#dialog-content .trade-slot818 {
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  padding: 2px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  border: 1px solid #745337;
  border-radius: 6px;
  color: #ffe4a4;
  background: #302331 var(--inventory-skin-0) center / 100% 100% no-repeat;
}

#dialog-content .trade-slot818.filled {
  border-color: #be985c;
  background-image: var(--inventory-skin-1);
}

#dialog-content .trade-slot818.selected {
  border: 2px solid #ffe09a;
  box-shadow: inset 0 0 9px #ffd37380;
}

.trade-slot818 > :is(img, canvas, .char-item-glyph164) {
  width: 33px !important;
  height: 33px !important;
  object-fit: contain;
}

.trade-item818 {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.trade-gold818 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trade-gold818 input {
  width: 130px;
  padding: 5px;
  border: 1px solid #b28e59;
  border-radius: 5px;
  background: #1a1520;
  color: #ffe4a4;
  font: inherit;
}

.trade-actions818 {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.trade-actions818 output { margin-right: auto; }

#dialog-content .trade-actions818 button {
  padding: 8px 14px;
  border: 1px solid #d5a859;
  border-radius: 6px;
  background: linear-gradient(#72532f, #46301f);
  color: #ffe4a4;
  font: bold 16px Arial, sans-serif;
}

.trade-actions818 button[hidden] { display: none !important; }
.trade-actions818 button:disabled { opacity: .55; }

#ground-items425 .ground-item425[hidden] {
  display: none;
}

#ground-items425 .ground-selected427 {
  z-index: 2;
}

#ground-items425 :is(img, .char-item-glyph164, .ground-fallback818) {
  width: 36px !important;
  height: 36px !important;
  flex: none;
  object-fit: contain;
}

.ground-fallback818 {
  display: grid;
  place-items: center;
  color: #ffe4a4;
  font-size: 26px;
  text-shadow: 0 2px 4px #170e14;
}
