/* ===== Marketplace ===== */
.marketplace .toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin: 16px 0;
}

.marketplace .toolbar-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  flex: 1 1 650px;
}

.marketplace .toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

/* ===== Marketplace list map ===== */
.marketplace-map-card {
  margin: 16px 0;
  padding: 14px 16px;
}

.marketplace-map-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.marketplace-map-title {
  margin: 0;
  font-size: 1.08rem;
}

.marketplace-map-subtitle {
  margin: 4px 0 0 0;
}

.marketplace-map-count {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 700;
}

.marketplace-map {
  height: 380px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  position: relative;
  z-index: 1;
}

.marketplace .map-empty {
  margin-top: 10px;
  padding: 14px;
  border: 1px dashed #d1d5db;
  border-radius: 10px;
  color: #6b7280;
  background: #f8fafc;
}

.marketplace-map-popup {
  min-width: 190px;
  max-width: 260px;
}

.marketplace-map-popup strong {
  display: block;
  margin-bottom: 6px;
  color: #111827;
}

.marketplace-map-popup-meta {
  margin-bottom: 6px;
  color: #475569;
  font-size: 0.88rem;
}

.marketplace-map-popup-location {
  margin-bottom: 8px;
  color: #6b7280;
  font-size: 0.84rem;
}

.marketplace-map-popup-link {
  display: inline-flex;
  margin-top: 2px;
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.marketplace-map-popup-link:hover {
  text-decoration: underline;
}

@media (max-width: 700px) {
  .marketplace-map-head {
    flex-direction: column;
  }

  .marketplace-map {
    height: 300px;
  }
}

.marketplace .toolbar-filters input[type="text"] {
  min-width: 220px;
  flex: 1 1 220px;
}

.marketplace .toolbar-filters select {
  min-width: 150px;
}

.marketplace .subcat-filter {
  display: inline-flex;
}

.marketplace input[type="text"],
.marketplace input[type="url"],
.marketplace select,
.marketplace textarea {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  font-size: 0.95rem;
}

.marketplace input[type="text"]:focus,
.marketplace input[type="url"]:focus,
.marketplace select:focus,
.marketplace textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.marketplace .list {
  list-style: none;
  padding: 0;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.marketplace .card {
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
}

.marketplace .card-title {
  margin: 0;
  font-size: 1.05rem;
}

.marketplace .card-title a {
  color: inherit;
  text-decoration: none;
}

.marketplace .card-title a:hover {
  text-decoration: underline;
}

.marketplace .meta {
  margin-top: 8px;
  color: #555;
  font-size: 0.92rem;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.marketplace .muted {
  margin-top: 6px;
  color: #6b7280;
  font-size: 0.9rem;
}

/* ===== Marketplace pagination ===== */
.marketplace-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 22px 0 8px 0;
}

.pagination-pages {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  line-height: 1;
}

.pagination-btn:hover {
  background: #f8fafc;
  border-color: var(--primary);
  color: var(--primary);
}

.pagination-current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.pagination-current:hover {
  background: var(--primary);
  color: #fff;
}

.pagination-disabled {
  color: #9ca3af;
  background: #f8fafc;
  cursor: not-allowed;
}

.pagination-disabled:hover {
  border-color: #d1d5db;
  color: #9ca3af;
  background: #f8fafc;
}

.pagination-ellipsis {
  padding: 0 4px;
  color: #6b7280;
  font-weight: 700;
}

.marketplace-pagination-summary {
  margin: 0 0 16px 0;
  text-align: center;
  color: #6b7280;
  font-size: 0.88rem;
}

@media (max-width: 700px) {
  .marketplace-pagination {
    justify-content: flex-start;
  }

  .pagination-btn {
    min-width: 34px;
    min-height: 34px;
    padding: 6px 9px;
  }

  .marketplace-pagination-summary {
    text-align: left;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #ddd;
  font-size: 0.85rem;
  background: #f8fafc;
}

.badge-offer {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.badge-request {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.10);
}

/* Form rows */
.marketplace form p.form-row {
  margin: 10px 0;
  display: grid;
  grid-template-columns: 215px 1fr;
  column-gap: 12px;
  row-gap: 4px;
  align-items: start;
}

.marketplace form p.form-row > label {
  padding-top: 8px;
}

.marketplace form p.form-row > input,
.marketplace form p.form-row > select,
.marketplace form p.form-row > textarea {
  width: 100%;
  box-sizing: border-box;
}

.marketplace form p.form-row > input[type="file"] {
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #475569;
  background: #ffffff;
}

.marketplace-image-control {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.marketplace-current-image {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
}

.marketplace-current-image-preview-frame {
  position: relative;
  width: 112px;
  height: 84px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #e2e8f0;
}

.marketplace-current-image-preview-backdrop {
  position: absolute;
  inset: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  object-fit: cover;
  filter: blur(10px) saturate(0.8);
  opacity: 0.62;
  transform: scale(1.05);
}

.marketplace-current-image-preview {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.marketplace-current-image-preview,
.marketplace-current-image-preview-backdrop {
  pointer-events: none;
}

.marketplace-current-image-info {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.marketplace-image-control-label {
  color: #475569;
  font-size: 0.85rem;
  font-weight: 700;
}

.marketplace-current-image-link {
  color: #2563eb;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.marketplace-current-image-link:hover {
  text-decoration: underline;
}

.marketplace-image-remove-checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.marketplace-image-remove {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  background: #ffffff;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.marketplace-image-remove:hover {
  border-color: #fca5a5;
  background: #fef2f2;
}

.marketplace-image-remove svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.marketplace-image-remove-checkbox:checked + .marketplace-image-remove {
  border-color: #dc2626;
  color: #ffffff;
  background: #dc2626;
}

.marketplace-image-remove-checkbox:focus-visible + .marketplace-image-remove {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  outline-offset: 2px;
}

.marketplace-image-remove-pending {
  display: none;
  color: #b91c1c;
  font-size: 0.8rem;
  font-weight: 600;
}

.marketplace-image-remove-checkbox:checked
  ~ .marketplace-image-remove-pending {
  display: block;
}

.marketplace-image-control input[type="file"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #475569;
  background: #ffffff;
}

.marketplace-image-control input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 7px 11px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: #2563eb;
  cursor: pointer;
  font-weight: 700;
}

.marketplace-image-control input[type="file"]::file-selector-button:hover {
  background: #1d4ed8;
}

.marketplace form p.form-row > .field-help {
  grid-column: 2;
  color: #6b7280;
  font-size: 0.85rem;
}

.marketplace form p.form-row > .field-error {
  grid-column: 2;
  color: #b91c1c;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 2px;
}

@media (max-width: 700px) {
  .marketplace form p.form-row {
    grid-template-columns: 1fr;
  }

  .marketplace form p.form-row > .field-error {
    grid-column: 1;
  }

  .marketplace form p.form-row > .field-help {
    grid-column: 1;
  }
}


/* ===== Marketplace detail ===== */
.marketplace-detail .detail-head{
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 32px;
  align-items: start;
  margin-bottom: 24px;
}
.marketplace-detail .detail-head h1 {
  font-size: clamp(1.6rem, 2.6vw, 2.15rem);
  line-height: 1.25;
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}
.marketplace-detail .detail-head > div:first-child { min-width: 0; }

.marketplace-detail .detail-head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  padding-top: 3px;
}
.marketplace-detail .detail-head-actions .btn { white-space: nowrap; }

.marketplace-detail .detail-grid{
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  align-items: start;
}

.marketplace-detail .detail-main,
.marketplace-detail .detail-side{
  padding: 16px 18px;
}

.marketplace-detail .detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.marketplace-detail .listing-image-card {
  padding: 16px 18px;
}

.marketplace-detail .listing-image-frame,
.marketplace-detail .listing-image-empty {
  display: block;
  width: 100%;
  height: 240px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.marketplace-detail .listing-image-frame {
  position: relative;
  overflow: hidden;
  background: #e2e8f0;
}

.marketplace-detail .listing-image-backdrop {
  position: absolute;
  inset: -18px;
  width: calc(100% + 36px);
  height: calc(100% + 36px);
  object-fit: cover;
  filter: blur(18px) saturate(0.8);
  opacity: 0.62;
  transform: scale(1.05);
}

.marketplace-detail .listing-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.marketplace-detail .listing-image-view {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.82);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  backdrop-filter: blur(6px);
  transition: background 0.15s ease, transform 0.15s ease;
}

.marketplace-detail .listing-image-view:hover {
  color: #ffffff;
  background: #2563eb;
  transform: translateY(-1px);
}

.marketplace-detail .listing-image-view svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.marketplace-detail .listing-image-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  color: #64748b;
  background: #f8fafc;
}

.marketplace-detail .listing-image-empty-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 4px;
  fill: none;
  stroke: #94a3b8;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.marketplace-detail .listing-image-empty strong {
  color: #475569;
}

.marketplace-detail .listing-image-empty span {
  font-size: 0.9rem;
}

.marketplace-detail .section-title{
  margin: 0 0 14px 0;
  font-size: 1.05rem;
}

.marketplace-detail .section-subtitle{
  margin: 0 0 8px 0;
  font-size: 0.98rem;
}

.marketplace-detail .detail-info{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.marketplace-detail .detail-row{
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.marketplace-detail .detail-label{
  color: #6b7280;
  font-weight: 600;
  min-width: 110px;
}

.marketplace-detail .detail-description{
  margin-top: 16px;
}

.marketplace-detail .detail-description p{
  margin: 0;
  white-space: pre-wrap;
}

.marketplace-detail .listing-map{
  height: 300px;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid #e5e7eb;
  position: relative;
  z-index: 1;
}

.marketplace-detail .map-empty{
  margin-top: 10px;
  padding: 14px;
  border: 1px dashed #d1d5db;
  border-radius: 10px;
  color: #6b7280;
  background: #f8fafc;
}

.marketplace-detail .detail-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.marketplace-detail .detail-location-text{
  margin-bottom: 8px;
}

.marketplace-detail .detail-row a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.marketplace-detail .detail-row a:hover {
  text-decoration: underline;
}

@media (max-width: 900px){
  .marketplace-detail .detail-head {
    grid-template-columns: 1fr;
  }

  .marketplace-detail .detail-head-actions {
    justify-content: flex-start;
  }

  .marketplace-detail .detail-grid{
    grid-template-columns: 1fr;
  }

  .marketplace-detail .listing-image-frame,
  .marketplace-detail .listing-image-empty {
    height: clamp(220px, 52vw, 360px);
  }

  .marketplace-detail .detail-row{
    flex-direction: column;
    gap: 4px;
  }
}

.detail-matches {
  margin-top: 24px;
  scroll-margin-top: 24px;
}

.match-controls {
  margin: 14px 0 18px;
  padding: 16px;
  border: 1px solid #dbe3ec;
  border-radius: 14px;
  background: #f4f8ff;
}

.match-controls-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.match-controls-head h3 {
  margin: 0 0 3px;
  color: #1e293b;
  font-size: 1rem;
}

.match-controls-head p {
  margin: 0;
  color: #64748b;
  font-size: 0.86rem;
}

.match-results-count {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
}

.match-filter-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
}

.match-filter-field {
  min-width: 0;
}

.match-filter-field label {
  display: block;
  margin-bottom: 5px;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.match-filter-field input,
.match-filter-field select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 0.86rem;
}

.match-filter-field input:focus,
.match-filter-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.match-filter-field select:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.match-filter-actions {
  display: flex;
  justify-content: flex-end;
  grid-column: 1 / -1;
  gap: 7px;
}

.match-filter-actions .btn {
  min-height: 40px;
  white-space: nowrap;
}

.match-hide-actions {
  margin-bottom: 16px;
}

@media (max-width: 1100px) {
  .match-filter-form {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .match-filter-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .match-controls {
    padding: 14px;
  }

  .match-controls-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .match-results-count {
    align-self: flex-start;
  }

  .match-filter-form {
    grid-template-columns: 1fr;
  }

  .match-filter-actions {
    grid-column: auto;
    flex-wrap: wrap;
  }
}

/* Match results emphasize evidence rather than a percentage score. */
.match-card {
  margin-top: 18px;
  padding: 24px;
  border: 1px solid #cbd5e1;
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  background: #fff;
}
.match-card-head { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; }
.match-card .match-title { margin: 0 0 12px; }
.match-card .match-title a { color: var(--primary); text-decoration: none; }
.match-card .match-title a:hover { text-decoration: underline; }
.match-proposal { margin: 12px 0; line-height: 1.5; color: #475569; font-size: .9rem; }
.match-quantity-coverage { padding: 14px 0; margin: 14px 0 0; border-top: 1px solid #e2e8f0; }
.match-quantity-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.match-quantity-heading h4 { margin: 0; color: #0f172a; font-size: .95rem; }
.match-quantity-status { padding: 4px 10px; border-radius: 6px; background: #eff6ff; color: #1e40af; font-size: .82rem; font-weight: 600; }
.match-quantity-coverage p { margin: 8px 0 0; color: #475569; line-height: 1.5; font-size: .85rem; }
.match-quantity-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 20px; margin: 14px 0 10px; }
.match-quantity-metrics-no-coverage { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.match-quantity-metrics > div { min-width: 0; padding-right: 16px; }
.match-quantity-metrics > div + div { padding-left: 20px; border-left: 1px solid #e2e8f0; }
.match-quantity-metrics dt { color: #475569; font-size: .82rem; }
.match-quantity-metrics dd { margin: 4px 0 0; color: #0f172a; font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.match-quantity-metrics dd span { font-size: .85rem; font-weight: 400; }
.match-quantity-supply dd { color: var(--primary); }
.match-quantity-coverage progress { display: block; width: 100%; height: 5px; margin-top: 5px; border: 0; border-radius: 4px; overflow: hidden; background: #e2e8f0; accent-color: var(--primary); }
.match-quantity-coverage progress::-webkit-progress-bar { background: #e2e8f0; }
.match-quantity-coverage progress::-webkit-progress-value { background: var(--primary); }
.match-quantity-coverage progress::-moz-progress-bar { background: var(--primary); }
.match-quantity-details { font-size: .85rem; color: #475569; }
.match-quantity-details summary { width: fit-content; padding: 4px 0; color: var(--primary); cursor: pointer; }
.match-quantity-details > div { padding: 0 0 6px 16px; }
.match-quantity-details summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
.match-quantity-coverage .match-quantity-note { font-size: .8rem; }
.match-quantity-coverage .match-quantity-minimum { color: #166534; font-size: .85rem; }
@media (max-width: 600px) {
  .match-quantity-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .match-quantity-metrics > div { padding: 0; }
  .match-quantity-metrics > div + div { padding-left: 0; border-left: 0; }
}
.match-evidence-summary { display: inline-flex; gap: 6px; flex-wrap: wrap; font-size: .8rem; }
.match-evidence-summary > span { padding: 3px 6px; border-radius: 5px; font-weight: 500; background: #f1f5f9; }
.match-evidence-summary > .evidence-compatible { background: #f0fdf4; }
.match-evidence-summary > .evidence-discussion { background: #fffbeb; }
.match-evidence-summary > .evidence-missing { color: #6d28d9; background: #f5f3ff; }
.evidence-compatible { color: #166534; }
.evidence-discussion { color: #92400e; }
.evidence-missing { color: #475569; }
.match-details { border-top: 1px solid #e2e8f0; padding-top: 10px; margin-top: 0; }
.match-details > summary { display: flex; align-items: flex-start; gap: 8px; list-style: none; cursor: pointer; color: var(--primary); font-weight: 600; padding: 6px 0; font-size: .9rem; }
.match-details > summary::-webkit-details-marker { display: none; }
.match-details > summary::before { content: ""; flex: 0 0 auto; margin-top: 6px; border-block: 4px solid transparent; border-left: 5px solid currentColor; }
.match-details[open] > summary::before { transform: rotate(90deg); }
.match-details summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
.match-comparison-heading { display: flex; flex: 1; min-width: 0; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.match-evidence-groups { display: grid; gap: 16px; margin-top: 14px; }
.match-evidence-groups section { min-width: 0; }
.match-evidence-groups h4 { margin: 0; padding: 6px 10px; border-left: 3px solid currentColor; border-radius: 4px; font-size: .85rem; font-weight: 700; }
.match-evidence-groups > .evidence-discussion > h4 { color: #9a3412; background: #fff7ed; }
.match-evidence-groups > .evidence-missing > h4 { color: #6d28d9; background: #f5f3ff; }
.match-evidence-groups > .evidence-compatible > h4 { color: #166534; background: #f0fdf4; }
.match-findings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 0; }
.match-finding { min-width: 0; padding: 10px 0; border-bottom: 1px solid #f1f5f9; overflow-wrap: anywhere; }
.match-finding dt { color: #0f172a; font-size: .85rem; font-weight: 600; }
.match-finding dd { color: #475569; font-size: .85rem; line-height: 1.5; margin: 3px 0 0; }
.match-evidence-empty { color: #64748b; font-size: .85rem; margin: 8px 0 0; }
.match-evidence-groups > .evidence-discussion .match-findings,
.match-evidence-groups > .evidence-missing .match-findings { grid-template-columns: 1fr; }
.match-evidence-groups > .evidence-discussion .match-finding,
.match-evidence-groups > .evidence-missing .match-finding { display: grid; grid-template-columns: minmax(100px, 150px) minmax(0, 1fr); gap: 8px 16px; }
.match-evidence-groups > .evidence-discussion dd,
.match-evidence-groups > .evidence-missing dd { margin: 0; }
.match-update-notice { border-left: 4px solid #92400e; padding: 4px 0 4px 18px; }
@media (max-width: 600px) {
  .match-findings { grid-template-columns: 1fr; }
  .match-evidence-groups > .evidence-discussion .match-finding,
  .match-evidence-groups > .evidence-missing .match-finding { grid-template-columns: 1fr; gap: 3px; }
}
@media (max-width: 560px) { .match-card { padding: 18px 14px; } }

.match-mini-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.match-mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  font-size: 0.8rem;
  color: #475569;
}

.match-inline-location {
  margin-top: 4px;
  font-size: 0.82rem;
  color: #6b7280;
}

.match-description {
  margin-top: 6px;
  font-size: 0.84rem;
  color: #475569;
  line-height: 1.3;
}

.marketplace-active-field {
  margin: 14px 0;
}

.marketplace-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
}

.marketplace-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #999;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  user-select: none;
}

.info-tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  left: 50%;
  bottom: 140%;
  transform: translateX(-50%);
  width: 260px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #222;
  color: #fff;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  z-index: 50;
  transition: opacity 0.15s ease;
}

.info-tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #222 transparent transparent transparent;
}

.info-tooltip:hover .info-tooltip-text,
.info-tooltip:focus .info-tooltip-text {
  visibility: visible;
  opacity: 1;
}

.form-errors {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.9rem;
}

.contact-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #eef2f7;
}

.contact-card {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
}

.contact-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
}

.contact-row:last-child {
  border-bottom: none;
}

.contact-label {
  color: #6b7280;
  font-weight: 600;
  min-width: 80px;
}

.contact-card a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.contact-card a:hover {
  text-decoration: underline;
}

@media (max-width: 700px) {
  .contact-row {
    flex-direction: column;
    gap: 4px;
  }
}

.contact-value {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}

.contact-value a {
  overflow-wrap: anywhere;
}

.copy-contact-btn {
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  padding: 3px 9px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.copy-contact-btn:hover {
  background: #f1f5f9;
}

@media (max-width: 700px) {
  .contact-value {
    justify-content: flex-start;
    text-align: left;
  }
}

.marketplace .my-post-toolbar {
  justify-content: flex-start;
}

/* ===== My posts archive tabs/actions ===== */
.marketplace-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 16px 0;
  border-bottom: 1px solid #e5e7eb;
}

.marketplace-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: #475569;
  font-weight: 700;
  text-decoration: none;
}

.marketplace-tab:hover {
  color: var(--primary);
  background: #f8fafc;
}

.marketplace-tab-active {
  color: var(--primary);
  background: #fff;
  border-color: #e5e7eb;
  position: relative;
  top: 1px;
}

.marketplace-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.78rem;
}

.marketplace-tab-active .marketplace-tab-count {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
}

.my-post-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.my-post-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.my-post-actions form,
.detail-head-actions form {
  margin: 0;
  display: inline-flex;
}

.detail-head-actions .btn {
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font: inherit;
  line-height: 1;
}

.my-post-actions .btn {
  min-height: 36px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1;
}

.archive-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f8fafc;
  color: #6b7280;
  font-size: 0.85rem;
  font-weight: 700;
}

.btn-danger-soft {
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  color: #991b1b;
}

.btn-danger-soft:hover {
  background: rgba(239, 68, 68, 0.13);
  color: #7f1d1d;
}

@media (max-width: 700px) {
  .my-post-card-head {
    flex-direction: column;
  }

  .my-post-actions {
    justify-content: flex-start;
  }
}

/* ===== Verification badge ===== */

.verification-badge {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  width: fit-content;
}

.verification-verified {
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #166534;
}

.verification-pending {
  background: rgba(59, 130, 246, 0.10);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #1d4ed8;
}

.verification-rejected {
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #991b1b;
}

/* ===== Listing visibility and unavailable state ===== */
.listing-visibility-notice {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 158, 11, 0.34);
  border-radius: 12px;
  color: #92400e;
  background: rgba(245, 158, 11, 0.11);
  font-weight: 650;
  line-height: 1.5;
}

.marketplace-unavailable {
  display: grid;
  min-height: min(620px, calc(100vh - 260px));
  place-items: center;
  padding: 48px 0;
}

.marketplace-unavailable-card {
  width: min(620px, 100%);
  padding: 44px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.10);
  text-align: center;
}

.marketplace-unavailable-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.10);
}

.marketplace-unavailable-icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.marketplace-unavailable-code {
  margin: 18px 0 4px;
  color: #2563eb;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.marketplace-unavailable-card h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.35rem);
}

.marketplace-unavailable-card > p:not(.marketplace-unavailable-code) {
  max-width: 500px;
  margin: 14px auto 0;
  color: #64748b;
  line-height: 1.65;
}

.marketplace-unavailable-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .marketplace-unavailable {
    min-height: auto;
    padding: 28px 0;
  }

  .marketplace-unavailable-card {
    padding: 30px 20px;
  }

  .marketplace-unavailable-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

.marketplace form #id_quantity {
  box-sizing: border-box;
  width: 100%;
}

.marketplace .required-star {
  color: #c62828;
  font-weight: 700;
}

.marketplace .marketplace-quantity-row {
  display: grid;
  grid-template-columns: 215px minmax(120px, 1fr) auto minmax(130px, 1fr);
  gap: 12px;
  align-items: center;
  margin: 10px 0;
}

.marketplace .marketplace-quantity-field,
.marketplace .marketplace-unit-field {
  display: contents;
}

.marketplace .marketplace-quantity-field label {
  grid-column: 1;
}

.marketplace .marketplace-quantity-field input {
  grid-column: 2;
}

.marketplace .marketplace-unit-field label {
  grid-column: 3;
}

.marketplace .marketplace-unit-field select {
  grid-column: 4;
}

.marketplace .marketplace-quantity-field input,
.marketplace .marketplace-unit-field select {
  width: 100%;
  box-sizing: border-box;
}

.marketplace .marketplace-quantity-field .field-error {
  grid-column: 2;
}

.marketplace .marketplace-unit-field .field-error {
  grid-column: 4;
}

@media (max-width: 700px) {
  .marketplace .marketplace-quantity-row {
    grid-template-columns: 100px minmax(0, 1fr);
  }

  .marketplace .marketplace-quantity-field label,
  .marketplace .marketplace-unit-field label {
    grid-column: 1;
  }

  .marketplace .marketplace-quantity-field input,
  .marketplace .marketplace-unit-field select,
  .marketplace .marketplace-quantity-field .field-error,
  .marketplace .marketplace-unit-field .field-error {
    grid-column: 2;
  }
}

/* Marketplace map ownership and legend */

.marketplace-own-marker {
  background: transparent;
  border: 0;
}

.marketplace-own-marker svg {
  display: block;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.25));
}

.marketplace-map-own-label {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f3e8ff;
  color: #6d28d9;
  font-size: 0.8rem;
  font-weight: 700;
}

.marketplace-map-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.marketplace-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 12px;
  color: #475569;
  font-size: 0.88rem;
}

.marketplace-map-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.marketplace-map-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.marketplace-map-legend-dot-blue {
  background: #3388bb;
}

.marketplace-map-legend-dot-purple {
  background: #7c3aed;
}

.marketplace-map-legend-panel {
  margin-top: 12px;
  text-align: center;
}

.marketplace .marketplace-map-legend-title {
  margin: 0 0 6px;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
}

.marketplace .marketplace-map-legend {
  justify-content: center;
  margin-top: 0;
}

.marketplace .marketplace-map-legend-help {
  margin: 6px 0 0;
  line-height: 1.5;
}

/* ===== Marketplace create/edit form ===== */

.marketplace-editor {
  max-width: 1000px;
  margin: 0 auto;
}

.marketplace-editor *,
.marketplace-editor *::before,
.marketplace-editor *::after {
  box-sizing: border-box;
}

/* Keep conditional fields and inactive steps hidden. */
.marketplace-editor [hidden] {
  display: none !important;
}

.marketplace-editor > .card {
  padding: 28px;
}

.marketplace-editor .marketplace-wizard-panel {
  min-width: 0;
}

.marketplace-editor .marketplace-wizard-panel > h2 {
  margin: 0 0 18px;
  color: #1e293b;
  font-size: 1.2rem;
  line-height: 1.4;
}

.marketplace-editor .section-subtitle {
  margin: 26px 0 12px;
  padding-top: 18px;
  border-top: 1px solid #e2e8f0;
  color: #1e293b;
  font-size: 1.05rem;
}

/* Progress indicator */
.marketplace-editor .marketplace-wizard-progress {
  margin-bottom: 28px;
}

.marketplace-editor .marketplace-wizard-progress ol {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: marketplace-step;
}

.marketplace-editor .marketplace-wizard-progress li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 6px;
  border-bottom: 3px solid #e2e8f0;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  counter-increment: marketplace-step;
}

.marketplace-editor .marketplace-wizard-progress li::before {
  content: counter(marketplace-step);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
}

.marketplace-editor .marketplace-wizard-progress li.is-current {
  border-bottom-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
}

.marketplace-editor .marketplace-wizard-progress li.is-current::before {
  border-color: var(--primary, #2563eb);
  background: var(--primary, #2563eb);
  color: #fff;
}

/* Labels on the left, inputs on the right */
.marketplace-editor .form-row {
  display: grid;
  grid-template-columns: 215px minmax(0, 1fr);
  align-items: start;
  gap: 6px 14px;
  margin: 16px 0;
  min-width: 0;
}

.marketplace-editor .form-row > label {
  grid-column: 1;
  padding-top: 9px;
  color: #334155;
  font-weight: 600;
  line-height: 1.4;
}

.marketplace-editor .form-row > :not(label) {
  grid-column: 2;
  min-width: 0;
}

.marketplace-editor input[type="text"],
.marketplace-editor input[type="url"],
.marketplace-editor input[type="number"],
.marketplace-editor input[type="date"],
.marketplace-editor select,
.marketplace-editor textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #1e293b;
  font: inherit;
  font-size: 0.95rem;
}

.marketplace-editor textarea {
  min-height: 90px;
  resize: vertical;
}

.marketplace-editor input:focus-visible,
.marketplace-editor select:focus-visible,
.marketplace-editor textarea:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.16);
  outline-offset: 1px;
  border-color: var(--primary, #2563eb);
}

.marketplace-editor input[type="checkbox"],
.marketplace-editor input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 10px 0 0;
  accent-color: var(--primary, #2563eb);
}

.marketplace-editor .form-row > div label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 5px 0;
  color: #334155;
  font-weight: 400;
  line-height: 1.5;
}

.marketplace-editor .form-row > div label input {
  flex-shrink: 0;
  margin-top: 3px;
}

.marketplace-editor .field-help {
  display: block;
  color: #64748b;
  font-size: 0.86rem;
  line-height: 1.5;
}

.marketplace-editor .field-error,
.marketplace-editor .errorlist {
  color: #b91c1c;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.5;
}

.marketplace-editor .errorlist {
  margin: 4px 0;
  padding-left: 18px;
}

/* Quantity and Unit share one line */
.marketplace-editor [data-wizard-step="2"] .marketplace-step-fields {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr);
  gap: 0 18px;
}

.marketplace-editor [data-wizard-step="2"] .form-row {
  grid-column: 1 / -1;
}

.marketplace-editor [data-wizard-step="2"] [data-field="quantity"] {
  grid-column: 1;
}

.marketplace-editor [data-wizard-step="2"] [data-field="unit"] {
  grid-column: 2;
  grid-template-columns: auto minmax(0, 1fr);
}

/* Technical parameters, environmental indicators and attachments */
.marketplace-editor .marketplace-parameter-group,
.marketplace-editor .marketplace-environmental-group,
.marketplace-editor .marketplace-attachment {
  min-width: 0;
  margin: 18px 0;
  padding: 14px 18px;
  border: 1px solid #dbe3ec;
  border-radius: 10px;
  background: #f8fafc;
}

.marketplace-editor fieldset legend {
  max-width: 100%;
  padding: 0 7px;
  color: #334155;
  font-size: 0.95rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.marketplace-editor .marketplace-extra-parameters {
  margin: 18px 0;
}

.marketplace-editor .marketplace-extra-parameters > summary {
  width: fit-content;
  padding: 8px 0;
  color: var(--primary, #2563eb);
  font-weight: 700;
  cursor: pointer;
}

.marketplace-editor .marketplace-extra-parameters > summary:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.2);
  outline-offset: 4px;
  border-radius: 4px;
}

.marketplace-editor input[type="file"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-size: 0.88rem;
}

.marketplace-editor input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 7px 11px;
  border: 0;
  border-radius: 6px;
  background: var(--primary, #2563eb);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.marketplace-editor .marketplace-attachment > a {
  display: inline-block;
  margin: 6px 0;
  color: var(--primary, #2563eb);
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* Preview */
.marketplace-editor #marketplacePostPreview > section {
  margin: 18px 0;
  padding: 16px 18px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.marketplace-editor #marketplacePostPreview h3 {
  margin: 0 0 14px;
  color: #1e293b;
  font-size: 1rem;
}

.marketplace-editor #marketplacePostPreview dl {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(0, 2fr);
  gap: 10px 18px;
  margin: 0;
}

.marketplace-editor #marketplacePostPreview dt {
  color: #475569;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.marketplace-editor #marketplacePostPreview dd {
  margin: 0;
  color: #1e293b;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.marketplace-editor #marketplacePostPreview ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* Navigation */
.marketplace-editor .marketplace-wizard-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.marketplace-editor .marketplace-wizard-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 18px;
  font: inherit;
}

.marketplace-editor .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Smaller screens */
@media (max-width: 760px) {
  .marketplace-editor > .card {
    padding: 20px 16px;
  }

  .marketplace-editor .marketplace-wizard-progress ol {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .marketplace-editor .marketplace-wizard-progress li {
    flex: 1 1 100px;
    padding: 8px 4px;
  }

  .marketplace-editor .form-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .marketplace-editor .form-row > label,
  .marketplace-editor .form-row > :not(label) {
    grid-column: 1;
  }

  .marketplace-editor .form-row > label {
    padding-top: 0;
  }

  .marketplace-editor [data-wizard-step="2"] .marketplace-step-fields {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 0 12px;
  }

  .marketplace-editor [data-wizard-step="2"] [data-field="unit"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .marketplace-editor .marketplace-parameter-group,
  .marketplace-editor .marketplace-environmental-group,
  .marketplace-editor .marketplace-attachment {
    padding: 12px;
  }

  .marketplace-editor #marketplacePostPreview dl {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .marketplace-editor #marketplacePostPreview dd {
    margin-bottom: 12px;
  }

  .marketplace-editor .marketplace-current-image {
    flex-wrap: wrap;
  }
}

/* ===== Extended marketplace listing information ===== */

.marketplace-detail .marketplace-profile-section {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #e2e8f0;
}

.marketplace-detail .marketplace-profile-values {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(0, 1.5fr);
  gap: 10px 18px;
  margin: 12px 0 0;
}

.marketplace-detail .marketplace-profile-values dt {
  color: #64748b;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.marketplace-detail .marketplace-profile-values dd {
  margin: 0;
  color: #334155;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.marketplace-detail .marketplace-profile-group {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.marketplace-detail .marketplace-profile-group h4 {
  margin: 0;
  color: #334155;
  font-size: 0.95rem;
}

.marketplace-detail .marketplace-document-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.marketplace-detail .marketplace-document-list li {
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  overflow-wrap: anywhere;
}

.marketplace-detail .marketplace-document-list a {
  display: block;
  color: var(--primary, #2563eb);
  font-weight: 700;
}

.marketplace-detail .marketplace-document-list p {
  margin: 6px 0 0;
  white-space: pre-wrap;
}

.marketplace-detail .marketplace-private-location {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  overflow-wrap: anywhere;
}

.marketplace-detail .marketplace-private-location p {
  margin: 6px 0 0;
}

@media (max-width: 600px) {
  .marketplace-detail .marketplace-profile-values {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .marketplace-detail .marketplace-profile-values dd {
    margin-bottom: 10px;
  }
}

.marketplace-editor .marketplace-location-picker {
  margin: 20px 0;
}

.marketplace-editor .marketplace-location-map {
  height: 320px;
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  z-index: 0;
}

.marketplace-editor .marketplace-location-map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.marketplace-editor .marketplace-location-map-actions .btn {
  width: auto;
}

/* Published listing: one main column and expandable information */
.marketplace-detail .detail-grid {
  grid-template-columns: minmax(0, 1fr);
}

.marketplace-detail .detail-main {
  min-width: 0;
  padding: 24px;
}

.marketplace-detail .detail-info {
  max-width: 100%;
}

.marketplace-detail .detail-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(0, 2fr);
  gap: 12px 24px;
}

.marketplace-detail .detail-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.marketplace-detail .detail-description p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.marketplace-detail .marketplace-detail-media {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 24px 0;
  align-items: start;
}

.marketplace-detail .marketplace-detail-media > .card {
  min-width: 0;
  margin: 0;
  box-shadow: none;
  border: 1px solid #e2e8f0;
}

.marketplace-detail .marketplace-detail-media .listing-image-frame,
.marketplace-detail .marketplace-detail-media .listing-image-empty,
.marketplace-detail .marketplace-detail-media .listing-map {
  height: 280px;
}

.marketplace-detail .marketplace-detail-disclosure {
  margin-top: 14px;
  border: 1px solid #dbe5ef;
  border-radius: 12px;
  background: #fff;
}

.marketplace-detail .marketplace-detail-disclosure > summary {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px 48px 16px 18px;
  border-radius: 12px;
  background: #f0f6fc;
  cursor: pointer;
  list-style: none;
}

.marketplace-detail .marketplace-detail-disclosure > summary::-webkit-details-marker {
  display: none;
}

.marketplace-detail .marketplace-detail-disclosure > summary::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 22px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #2563eb;
  border-bottom: 2px solid #2563eb;
  transform: rotate(45deg);
}

.marketplace-detail .marketplace-detail-disclosure[open] > summary::after {
  transform: rotate(225deg);
  top: 26px;
}

.marketplace-detail .marketplace-detail-disclosure > summary:hover {
  background: #e7f0fb;
}

.marketplace-detail .marketplace-detail-disclosure > summary:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
}

.marketplace-detail .marketplace-detail-disclosure[open] > summary {
  border-bottom: 1px solid #dbe5ef;
  border-radius: 12px 12px 0 0;
}

.marketplace-detail .marketplace-detail-disclosure-title {
  color: #1e3a5f;
  font-size: 1rem;
  font-weight: 700;
}

.marketplace-detail .marketplace-detail-disclosure-preview {
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.marketplace-detail .marketplace-detail-disclosure-body {
  padding: 4px 18px 18px;
}

.marketplace-detail .marketplace-detail-disclosure-body .marketplace-profile-group {
  background: #f8fafc;
}

.marketplace-detail .marketplace-detail-disclosure-body .marketplace-profile-group h4 {
  margin: 0;
}

.marketplace-detail .marketplace-document-list {
  padding-left: 20px;
}

.marketplace-detail .marketplace-document-list li {
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .marketplace-detail .detail-main {
    padding: 18px;
  }

  .marketplace-detail .marketplace-detail-media {
    grid-template-columns: minmax(0, 1fr);
  }

  .marketplace-detail .detail-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .marketplace-detail .marketplace-detail-disclosure > summary {
    padding-left: 14px;
  }

  .marketplace-detail .marketplace-detail-disclosure-body {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* More space between the description and image/map row */
.marketplace-detail .marketplace-detail-media {
  margin-top: 36px;
}

/* Separate the labels from their values */
.marketplace-detail .detail-row {
  column-gap: 0;
}

.marketplace-detail .detail-row > .detail-label {
  padding-right: 20px;
  border-right: 1px solid #e2e8f0;
}

.marketplace-detail .detail-row > span:last-child {
  padding-left: 20px;
}

/* Remove separators between labels and their values */
.marketplace-detail .detail-row > .detail-label {
  border-right: 0;
  padding-right: 0;
}

.marketplace-detail .detail-row > span:last-child {
  padding-left: 0;
}

.marketplace-detail .detail-row {
  column-gap: 24px;
}

/* Separate the two columns of complete entries */
.marketplace-detail .detail-info {
  position: relative;
}

.marketplace-detail .detail-info::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: #f1f5f9;
  pointer-events: none;
}

/* Hide the separator when entries use one column */
@media (max-width: 900px) {
  .marketplace-detail .detail-info::after {
    display: none;
  }
}

/* Clickable creation steps */
.marketplace-editor .marketplace-wizard-progress button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  cursor: pointer;
}

.marketplace-editor .marketplace-wizard-progress button:hover {
  background: #dbeafe;
  color: #1d4ed8;
}

.marketplace-editor .marketplace-wizard-progress button:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}

/* Expandable technical and environmental cards */
.marketplace-editor details.marketplace-editor-disclosure {
  margin: 14px 0;
  padding: 0;
  border: 1px solid #dbe5ef;
  border-radius: 10px;
  background: #fff;
}

.marketplace-editor .marketplace-editor-disclosure > summary {
  position: relative;
  padding: 15px 44px 15px 16px;
  border-radius: 10px;
  background: #f0f6fc;
  color: #1e3a5f;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.marketplace-editor .marketplace-editor-disclosure > summary::-webkit-details-marker {
  display: none;
}

.marketplace-editor .marketplace-editor-disclosure > summary::after {
  content: "";
  position: absolute;
  right: 19px;
  top: 19px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #2563eb;
  border-bottom: 2px solid #2563eb;
  transform: rotate(45deg);
}

.marketplace-editor .marketplace-editor-disclosure[open] > summary::after {
  transform: rotate(225deg);
  top: 23px;
}

.marketplace-editor .marketplace-editor-disclosure > summary:hover {
  background: #e7f0fb;
}

.marketplace-editor .marketplace-editor-disclosure > summary:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}

.marketplace-editor .marketplace-editor-disclosure[open] > summary {
  border-bottom: 1px solid #dbe5ef;
  border-radius: 10px 10px 0 0;
}

.marketplace-editor .marketplace-editor-disclosure-body {
  padding: 16px;
}

.marketplace-editor .marketplace-editor-disclosure[hidden] {
  display: none;
}

.marketplace-editor .marketplace-wizard-progress button {
  text-align: center;
}

.marketplace-editor .marketplace-file-picker {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.marketplace-editor .marketplace-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.marketplace-editor .marketplace-file-picker.has-file-focus {
  outline: 2px solid #2563eb;
  outline-offset: 4px;
  border-radius: 6px;
}

.marketplace-editor .marketplace-file-name {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #64748b;
}

.marketplace-editor .marketplace-remove-attachment {
  margin-top: 14px;
}

.marketplace-editor .marketplace-delete-control[hidden],
.marketplace-editor .marketplace-attachment[hidden] {
  display: none;
}

/* ===== Marketplace text readability ===== */

/* Map introduction and legend */
.marketplace .marketplace-map-subtitle,
.marketplace .marketplace-map-legend,
.marketplace .marketplace-map-legend-help {
  color: var(--text);
}

/* Type, category, subtype and quantity:
   Marketplace list, My Posts and published listing header */
.marketplace .meta {
  color: var(--text);
}

/* Published listing labels and values */
.marketplace-detail .detail-label,
.marketplace-detail .detail-row > span:last-child,
.marketplace-detail .detail-description p,
.marketplace-detail .marketplace-profile-values dt,
.marketplace-detail .marketplace-profile-values dd,
.marketplace-detail .marketplace-profile-group h4 {
  color: var(--text);
}

/* Location information */
.marketplace-detail .detail-location-text,
.marketplace-detail .map-empty {
  color: var(--text);
}

/* Contact labels, values and explanatory text */
.marketplace-detail .contact-label,
.marketplace-detail .contact-value,
.marketplace-detail .contact-card .muted {
  color: var(--text);
}
