.wagon-stores {
  box-sizing: border-box;
  container-type: inline-size;
  container-name: wagon-stores;
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  padding: 11px;
  overflow: hidden;
  color: #eadfbe;
  font: 14px/1.35 Georgia, serif;
  background: radial-gradient(ellipse at 35% 0%, #314a33, #182b22 85%);
  border: 2px solid #80633f;
  border-radius: 5px;
  box-shadow: inset 0 0 0 2px #132018, 0 3px 0 #0d120e80;
}

.wagon-stores *,
.wagon-stores *::before,
.wagon-stores *::after {
  box-sizing: border-box;
}

.wagon-stores__shelf {
  min-width: 0;
  padding: 8px 10px 10px;
  border: 0;
  border-bottom: 3px solid #665132;
  border-radius: 2px;
  background: linear-gradient(180deg, #352a1e99, #211a1188);
  box-shadow: 0 2px 0 #100c07a0;
}

.wagon-stores__shelf-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  min-width: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid #d5b66d6e;
}

.wagon-stores__title,
.wagon-stores__detail,
.wagon-stores__message,
.wagon-stores__state p {
  margin: 0;
}

.wagon-stores__title {
  color: #fff0bd;
  font: 700 16px/1.2 Georgia, serif;
  letter-spacing: .01em;
}

.wagon-stores__detail {
  color: #dcc58c;
  font: 12px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.wagon-stores__items {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}

.wagon-stores__item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  flex: 1 1 178px;
  min-width: 0;
  max-width: 100%;
  padding: 5px 6px;
  color: #f3e7c7;
  background: #17251bbb;
  border: 1px solid #a98c5040;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px #07100ab3;
}

.wagon-stores__icon {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
}

.wagon-stores__item-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.wagon-stores__count {
  min-width: 1.65em;
  padding: 1px 4px;
  color: #f8e3a5;
  text-align: center;
  font: 700 13px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #0b130eb8;
  border: 1px solid #907143;
  border-radius: 2px;
}

.wagon-stores__message,
.wagon-stores__state {
  color: #eadfc7;
  font: 14px/1.35 Georgia, serif;
}

.wagon-stores__message {
  padding: 10px 1px 1px;
}

.wagon-stores__state {
  padding: 10px 12px;
  border: 1px solid #947547;
  background: #17251bd9;
}

.wagon-stores__state--error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 12px;
  border-color: #bf8456;
}

.wagon-stores__retry {
  padding: 5px 9px;
  color: #fff0bd;
  font: 700 13px/1.2 Georgia, serif;
  cursor: pointer;
  background: #3e5a37;
  border: 1px solid #d2ac62;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px #182316;
}

.wagon-stores__retry:hover {
  background: #4d7044;
}

.wagon-stores__retry:focus-visible {
  outline: 2px solid #fff0bd;
  outline-offset: 2px;
}

/* The stores shelf lives in both the full-width wagon book and a narrow
   Field Guide column.  The layout follows its own usable width rather than
   the browser viewport, so a wide desktop cannot force a tiny shelf into a
   two-column header. */
@container wagon-stores (min-width: 760px) {
  .wagon-stores__shelf {
    display: grid;
    grid-template-columns: minmax(148px, 23%) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
  }

  .wagon-stores__shelf-header {
    display: block;
    padding: 0 12px 0 0;
    border-right: 1px solid #d5b66d6e;
    border-bottom: 0;
  }

  .wagon-stores__detail {
    margin-top: 4px;
  }

  .wagon-stores__items,
  .wagon-stores__message {
    margin-top: 0;
  }
}

@media (max-width: 430px) {
  .wagon-stores {
    padding: 8px;
  }

  .wagon-stores__shelf {
    padding: 7px;
  }

  .wagon-stores__item {
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wagon-stores *,
  .wagon-stores *::before,
  .wagon-stores *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

.wagon-stores__footnote{margin:0;color:#bcb293;font-size:12px}
