/* Shared presentation only. Routes, form contracts and admin styles are unchanged. */
body:is(.marketplace-screen, .account-screen) {
  --type-page: clamp(1.625rem, 2.4vw, 2.125rem);
  --type-section: clamp(1.25rem, 1.7vw, 1.5rem);
  --type-body: .9375rem;
  --type-small: .8125rem;
  --control-height: 46px;
  --panel-padding: clamp(20px, 2vw, 28px);
  font-size: 1rem;
  line-height: 1.5;
}

/* Content hierarchy. The existing campaign banner keeps its own typography. */
body.marketplace-screen :is(#product-view, #cart-view, #checkout-view, #seller-view) h1,
body.account-screen .account-dashboard-header h1 {
  margin: 0 0 12px;
  font-size: var(--type-page);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}
body.marketplace-screen :is(#product-view, #cart-view, #checkout-view, #seller-view) h2,
body.marketplace-screen .catalog-section .section-heading h2,
body.account-screen #account-view h2 {
  font-size: var(--type-section);
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -.02em;
}
body.marketplace-screen :is(.product-lead, .product-description p, .cart-page-heading p, .checkout-page-heading p, .seller-dashboard-header p, .seller-onboarding-copy > p, .seller-entry-copy > p, .seller-status-layout > div > p),
body.account-screen .account-dashboard-header p {
  font-size: var(--type-body);
  line-height: 1.6;
}
body.marketplace-screen :is(.seller-dashboard-header, .cart-page-heading, .checkout-page-heading),
body.account-screen .account-dashboard-header {
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
body.marketplace-screen .seller-dashboard-header > div,
body.account-screen .account-dashboard-header > div { min-width: 0; }
body.marketplace-screen .seller-dashboard-header > .button { flex-shrink: 0; }
body.marketplace-screen .back-link {
  align-items: center;
  min-height: 40px;
  margin-bottom: 20px;
  font-size: .875rem;
  line-height: 1.4;
}

/* Stable card rows: image, two-line name, two-line description, price and action. */
body.marketplace-screen .catalog-card-body { gap: 0; padding: 8px 18px 16px; }
body.marketplace-screen .catalog-card-body h3 {
  display: -webkit-box;
  min-height: 3em;
  margin: 0 0 8px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0;
}
body.marketplace-screen .catalog-card-body p {
  min-height: 3em;
  margin: 0 0 16px;
  font-size: .875rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
body.marketplace-screen .catalog-card-body > strong {
  font-size: clamp(1.375rem, 1.8vw, 1.625rem);
  font-weight: 700;
  line-height: 1.3;
}
body.marketplace-screen :is(.catalog-card-body > strong, .product-price, .cart-item-price, .summary-line > strong, .seller-product-row > strong, .seller-inventory-summary strong) {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
body.marketplace-screen .catalog-card-body .availability { align-items: center; font-size: var(--type-small); }
body.marketplace-screen .catalog-card-body .availability-ready::before { flex-shrink: 0; margin-top: 0; }
body.marketplace-screen .catalog-card-action { align-items: center; min-height: 42px; margin-top: 14px; font-size: .875rem; }
body.marketplace-screen .catalog-card-link:focus-visible { outline-offset: -4px; }
body.marketplace-screen .product-price { font-size: clamp(1.875rem, 2.6vw, 2.25rem); line-height: 1.25; }
body.marketplace-screen .product-description p { white-space: pre-line; }
body.marketplace-screen .product-security { font-size: var(--type-small) !important; line-height: 1.5; }

/* Shared control rhythm, without changing header or banner controls. */
body:is(.marketplace-screen, .account-screen) :is(.view, .catalog-filters, .account-callout) .button {
  min-height: var(--control-height);
  padding: 11px 18px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.4;
  text-align: center;
}
body.marketplace-screen :is(.product-purchase-panel, .cart-summary, .checkout-summary, .checkout-address-panel, .seller-store-card, .seller-products-panel, .seller-form-panel, .seller-status-card) {
  padding: var(--panel-padding);
}
body.marketplace-screen .summary-line { gap: 16px; font-size: .875rem; line-height: 1.5; }
body.marketplace-screen .summary-line > span { min-width: 0; overflow-wrap: anywhere; }
body.marketplace-screen :is(.summary-delivery, .summary-pending) p { font-size: .875rem; line-height: 1.5; }
body.marketplace-screen :is(.cart-item-info > a, .seller-product-row h3) { font-size: .9375rem; font-weight: 650; line-height: 1.45; }
body.marketplace-screen :is(.cart-item-info p, .seller-product-row p, .seller-product-meta) { font-size: var(--type-small); line-height: 1.5; }
body.marketplace-screen .seller-product-row { gap: 16px; padding: 16px; }
body.marketplace-screen .seller-inventory-summary span { min-height: 3em; font-size: .875rem; line-height: 1.5; }
body.marketplace-screen .seller-inventory-summary strong { margin-top: 8px; line-height: 1.2; }
body.marketplace-screen .seller-detail-list :is(dt, dd) { font-size: .875rem; line-height: 1.5; }

/* Optional hints follow the control visually, keeping fields on the same baseline. */
body:is(.marketplace-screen, .account-screen) :is(.address-form, .seller-product-form, .seller-form-panel, .auth-form) label:not(.check-row) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.45;
}
body:is(.marketplace-screen, .account-screen) :is(.address-form, .seller-product-form, .seller-form-panel, .auth-form) label:not(.check-row) > :is(input, select, textarea) {
  order: 1;
  min-width: 0;
  min-height: var(--control-height);
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
}
body:is(.marketplace-screen, .account-screen) :is(.address-form, .seller-product-form, .seller-form-panel, .auth-form) label:not(.check-row) > span {
  order: 2;
  color: var(--muted);
  font-size: var(--type-small);
  font-weight: 400;
  line-height: 1.45;
}
body.marketplace-screen :is(.address-fields, .seller-product-fields) { align-items: start; gap: 20px 24px; }
body.marketplace-screen :is(.address-form, .seller-product-form) h2 { margin-bottom: 4px; }
body.marketplace-screen :is(.seller-form-heading, .seller-products-heading) { align-items: flex-start; gap: 16px; margin-bottom: 24px; }
body.marketplace-screen .seller-form-heading p { margin: 8px 0 0; font-size: .875rem; line-height: 1.5; }
body:is(.marketplace-screen, .account-screen) .form-helper { font-size: var(--type-small); line-height: 1.5; }

/* Account uses the storefront palette; authentication behavior and structure stay intact. */
body.account-screen {
  color-scheme: light;
  --ink: #f2f4f3;
  --surface: #fff;
  --surface-soft: #edf4f0;
  --line: #d8e2dd;
  --line-soft: #e5eae7;
  --text: #172c25;
  --muted: #62716a;
  --green: #007a50;
  --green-deep: #006b47;
  --green-wash: #eaf7f0;
  --danger: #a62d3e;
  --danger-bg: #fff1f3;
  --info: #214e77;
  --info-bg: #edf5ff;
  background: var(--ink);
  color: var(--text);
}
body.account-screen :is(.auth-card, .orders-panel) {
  padding: var(--panel-padding);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 28px #173b2810;
}
body.account-screen .account-brand { margin-bottom: 24px; padding: 16px; border-radius: 8px; background: #063d2e; color: #cfdfd6; }
body.account-screen .auth-tabs { background: #f5f8f6; border-color: var(--line); border-radius: 9px; }
body.account-screen .auth-tab { font-weight: 600; }
body.account-screen .auth-tab.is-active { border-color: #9bd0b7; background: #eaf7f0; color: #006b47; box-shadow: none; }
body.account-screen :is(input, select, textarea) { border-color: #c6d4cc; background: #fff; color: var(--text); }
body.account-screen .primary { background: #00df88; color: #022417; }
body.account-screen .primary:hover { background: #00cc7c; }
body.account-screen .inline-link:hover { color: #004c34; }
body.account-screen .auth-switch { font-size: .875rem; line-height: 1.5; }
body.account-screen .orders-empty { padding: 28px 20px; border-color: var(--line); background: #f8faf9; }
body.account-screen .orders-empty h3 { font-size: 1rem; line-height: 1.4; letter-spacing: 0; }
body.account-screen .orders-panel .section-heading { align-items: flex-start; flex-wrap: wrap; }
body.account-screen .account-links { gap: 12px 20px; }
body.account-screen .text-button { font-size: .875rem; color: #006b47; }
body.account-screen .status-success { background: #e9f8ef; color: #006b47; }
body.account-screen :is(button, a, input, select, textarea):focus-visible { outline: 3px solid #009b64; outline-offset: 3px; }

@media (max-width: 780px) {
  body.marketplace-screen .section-heading { flex-wrap: wrap; align-items: flex-start; gap: 12px; }
  body.marketplace-screen .section-heading > div:first-child { min-width: 0; flex: 1 1 190px; }
  body.marketplace-screen .catalog-refresh-feedback { min-width: 90px; }
  body.marketplace-screen :is(.seller-dashboard-header, .account-dashboard-header) { align-items: flex-start; }
  body.account-screen .account-dashboard-header { align-items: flex-start; }
  body.account-screen .account-links { justify-content: flex-start; }
  body.marketplace-screen .catalog-card-body { padding: 8px 12px 14px; }
  body.marketplace-screen .catalog-card-body h3 { font-size: .9375rem; }
  body.marketplace-screen .catalog-card-body p { font-size: var(--type-small); }
}
@media (max-width: 600px) {
  body.marketplace-screen .catalog-grid:has(> .catalog-card:only-child) { grid-template-columns: minmax(0, 1fr); }
  body.marketplace-screen .catalog-grid:has(> .catalog-card:only-child) .catalog-image { max-height: 300px; }
  body.marketplace-screen .seller-inventory-summary { gap: 12px; }
  body.marketplace-screen .seller-form-heading { flex-wrap: wrap; }
  body.marketplace-screen .seller-form-heading > div { flex: 1 1 220px; }
  body.account-screen #account-view { padding: 28px 16px; }
  body.account-screen .account-brand img { max-width: 100%; }
}
