/* W3 local surface only: preserve the marketplace shell and shared tokens.
 * 44px controls = space-10 + space-1; no per-page token overrides. */
.buyer-surface {
  display: grid;
  gap: var(--m9-space-4);
  min-width: 0;
  color: var(--m9-text);
  font: var(--m9-type-body);
  overflow-wrap: anywhere;
}
.buyer-surface *,
.buyer-surface *::before,
.buyer-surface *::after {
  min-width: 0;
  box-sizing: border-box;
}
.buyer-surface h2,
.buyer-surface h3 {
  margin: 0;
  line-height: 1.5;
  letter-spacing: normal;
}
.buyer-surface h2 {
  font: var(--m9-type-section-title);
}
.buyer-surface h3 {
  font: var(--m9-type-card-title);
  line-height: 1.5;
}
.buyer-surface p {
  margin: 0;
  line-height: 1.65;
}
.buyer-surface small,
.buyer-surface .m9-helper {
  font: var(--m9-type-caption);
  line-height: 1.65;
}
.buyer-surface .m9-surface {
  padding: var(--m9-space-4);
  display: grid;
  gap: var(--m9-space-3);
}
.buyer-nav,
.buyer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--m9-space-2);
}
.buyer-surface .m9-button,
.buyer-surface input,
.buyer-surface select,
.buyer-surface textarea {
  min-height: calc(var(--m9-space-10) + var(--m9-space-1));
  max-width: 100%;
  font: var(--m9-type-ui);
  line-height: 1.65;
}
.buyer-surface .m9-button {
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
}
.buyer-surface input,
.buyer-surface select,
.buyer-surface textarea {
  width: 100%;
  padding: var(--m9-space-2) var(--m9-space-3);
  border: var(--m9-border-default);
  border-radius: var(--m9-radius-md);
  color: var(--m9-text);
  background: var(--m9-surface);
}
#buyerRoot input,
#buyerRoot select,
#buyerRoot textarea {
  min-height: calc(var(--m9-space-10) + var(--m9-space-1));
}
.buyer-surface textarea {
  min-height: var(--m9-space-16);
  resize: vertical;
}
.buyer-surface [aria-invalid="true"] {
  border-color: var(--m9-danger);
}
.buyer-surface label {
  display: grid;
  gap: var(--m9-space-2);
  font: var(--m9-type-ui);
}
.buyer-surface dl {
  margin: 0;
  display: grid;
  gap: var(--m9-space-2);
}
.buyer-surface dt {
  color: var(--m9-text-secondary);
  font: var(--m9-type-caption);
}
.buyer-surface dd {
  margin: 0;
}
.buyer-surface .buyer-note {
  padding: var(--m9-space-3);
  border-radius: var(--m9-radius-md);
  background: var(--m9-info-bg);
  color: var(--m9-info);
}
.buyer-surface .buyer-plain {
  white-space: pre-wrap;
}
.buyer-surface .buyer-status {
  justify-self: start;
  background: var(--m9-neutral-bg);
  color: var(--m9-neutral);
}
.buyer-surface .buyer-status[data-state="approved"],
.buyer-surface .buyer-status[data-state="resolved"] {
  background: var(--m9-success-bg);
  color: var(--m9-success);
}
.buyer-surface .buyer-status[data-state="rejected"] {
  background: var(--m9-danger-bg);
  color: var(--m9-danger);
}
.side-layer:has(.buyer-surface) [data-close-side] {
  min-width: calc(var(--m9-space-10) + var(--m9-space-1));
  min-height: calc(var(--m9-space-10) + var(--m9-space-1));
}
@media (max-width: 560px) {
  .buyer-surface .buyer-actions > *,
  .buyer-surface .buyer-nav > * {
    flex: 1 1 auto;
  }
  .buyer-surface input,
  .buyer-surface select,
  .buyer-surface textarea {
    font-size: var(--m9-body-size);
  }
}
