.market {
  display: block;
  min-height: 65vh;
}
.market-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1.5rem;
}
.market h1 {
  margin: 0;
  font:
    normal clamp(2.4rem, 5vw, 4.6rem)/1.16 Georgia,
    "Segoe UI",
    serif;
}
.market-heading p {
  color: var(--muted);
  margin: 0.6rem 0 0;
  overflow-wrap: anywhere;
}
.archive-photo {
  position: relative;
  width: min(41%, 360px);
  height: 126px;
  overflow: hidden;
  border-radius: 65px 8px 8px 8px;
}
.archive-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}
.archive-photo a {
  position: absolute;
  inset-inline-end: 0;
  bottom: 0;
  background: var(--navy-dark);
  color: white;
  font-size: 0.72rem;
  padding: 2px 8px;
}
.market-body {
  margin-block: 1.5rem;
}
[data-page="products"] .market-body {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.3fr);
  gap: clamp(18px, 4vw, 48px);
  align-items: start;
}
.editor {
  border: 1px solid var(--rule);
  background: var(--tint);
  padding: clamp(16px, 2vw, 26px);
  border-radius: 12px;
}
.market h2 {
  font-size: 1.3rem;
  margin: 0 0 0.85rem;
}
#fields {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}
.editor label,
.filter {
  display: grid;
  gap: 4px;
}
.market select,
.market textarea {
  min-width: 0;
  max-width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.market textarea {
  resize: vertical;
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.pair > * {
  min-width: 0;
}
.form-actions,
.list-tools,
.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.list-tools {
  justify-content: space-between;
  margin-block-end: 1rem;
}
.list-tools h2 {
  margin: 0;
}
.filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.product-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 225px), 1fr));
  gap: 0.9rem;
}
.product-list li {
  display: flex;
  flex-direction: column;
  align-items: start;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--cyan);
  border-radius: 9px;
  background: var(--surface);
  overflow-wrap: anywhere;
}
.product-list h3 {
  font:
    600 1.35rem/1.35 Georgia,
    "Segoe UI",
    serif;
  margin: 0.35rem 0;
}
.product-list .card-meta {
  align-self: stretch;
  justify-content: space-between;
  border-top: 1px solid var(--rule);
  margin-top: auto;
  padding-top: 0.65rem;
}
.product-list p:last-of-type {
  margin-bottom: 0.85rem;
}
.product-list small {
  margin: 0;
  color: var(--muted);
}
.product-list button {
  margin-top: 0.75rem;
}
.price {
  color: var(--brand);
}
.empty {
  border: 1px dashed var(--border);
  background: var(--tint);
  padding: 22px;
  border-radius: 8px;
}
#more {
  margin-top: 1rem;
}
@media (max-width: 720px) {
  [data-page="products"] .market-body {
    display: flex;
    flex-direction: column;
  }
  .market-body > section {
    width: 100%;
  }
  .archive-photo {
    display: none;
  }
  .market-heading {
    gap: 0.65rem;
  }
  .product-list {
    grid-template-columns: 1fr;
  }
}

.option-editor, .option-row, .option-picker { min-width: 0; }
.option-editor > legend { font-weight: 700; }
.option-hint { margin: 0 0 .55rem; font-size: .88rem; color: var(--muted); }
.option-row { display: grid; gap: .6rem; padding: .8rem; margin-block-end: .65rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--canvas); }
.remove-option { justify-self: start; }
.option-picker { display: grid; gap: .3rem; align-self: stretch; margin-block: 0 .9rem; }

.product-photo { display:block; width:100%; aspect-ratio:1/1; object-fit:contain; background:var(--canvas); border-radius:6px; margin-block-end:.8rem; }
.photo-preview { max-width:100%; width:auto; height:115px; object-fit:contain; justify-self:start; }
