/* Consistent spacing for the agricultural marketplace and its account tools. */
.trade-shell { padding-block:24px 40px; }
.trade-shell h1 { margin:8px 0 12px; line-height:1.2; }
.trade-shell > p, .form-heading > p { margin:0 0 20px; line-height:1.6; }
.trade-tabs { margin:0 0 24px; padding:0 0 16px; gap:12px 22px; }
.trade-page-heading, .trade-section-heading { margin-bottom:16px; }
.trade-page-heading p, .trade-section-heading p { margin:8px 0 0; }
.trade-section { margin-top:32px; }
.trade-shell .trade-panel { padding:22px; margin-bottom:16px; }
.trade-panel > :first-child, .trade-empty > :first-child { margin-top:0; }
.trade-panel > :last-child, .trade-empty > :last-child { margin-bottom:0; }
.trade-empty { padding:24px; }
.trade-empty p { margin:10px 0 16px; }
.trade-note { margin:16px 0; }
.trade-pagination:empty { display:none; }
.trade-detail-grid { align-items:start; gap:24px; }
.trade-detail-grid > *, .trade-account-grid > * { min-width:0; }
.trade-dashboard-row h3 { margin:0 0 6px; }
.trade-shell .primary-button, .trade-shell .secondary-button,
.trade-shell .outline-button { width:auto; margin:0; }
.trade-actions { gap:10px; margin-top:16px; }
.trade-filters { gap:14px; margin:0 0 24px; padding:18px; }
.trade-filters > .primary-button { width:auto; flex:0 0 auto; margin:0; }
.trade-filter-options { gap:16px; padding-top:12px; }
.trade-filter-options label:not(.trade-check) { flex:none; }
.trade-hero { min-height:340px; padding-block:40px; }
.trade-hero h1 { margin:14px 0; }
.trade-hero-foot { margin-top:20px; }
.trade-how { margin:32px 0; padding:28px; }

/* Use one row gap instead of stacking field margins on the form grid gap. */
.trade-shell .trade-form { display:grid; gap:16px; margin-top:20px; }
.trade-shell .trade-form section { display:flex; flex-direction:column; gap:16px; padding:22px; margin:0; }
.trade-shell .trade-form section > h2 { margin:0 0 2px; }
.trade-shell .trade-form section > p { margin:0; }
.trade-shell .trade-form label { display:block; margin:0; line-height:1.5; }
.trade-shell .trade-form label .optional { display:inline; margin-left:4px; line-height:1.5; }
.trade-shell .trade-form label > input:not([type=checkbox]),
.trade-shell .trade-form label > select,
.trade-shell .trade-form label > textarea { display:block; margin:6px 0 0; }
.trade-shell .trade-form .form-pair,
.trade-shell .trade-form .trade-form-three { display:grid; align-items:end; gap:16px; margin:0; }
.trade-shell .trade-form .form-pair { grid-template-columns:repeat(2,minmax(0,1fr)); }
.trade-shell .trade-form .trade-check { display:flex; align-items:center; gap:8px; }
.trade-shell .trade-form .trade-check input { margin:0; }
.trade-shell .trade-form > .primary-button { justify-self:start; }
.trade-offer-aside .primary-button { width:100%; margin:12px 0; }
.trade-offer-aside .secondary-button { width:100%; margin:0 0 10px; }

/* Keep admin content aligned, including pages that use the trade components. */
.admin-workspace { min-height:calc(100dvh - 96px); }
.admin-sidebar { top:56px; height:calc(100dvh - 56px); overflow-y:auto; }
.admin-page, .admin-main > .trade-shell { width:100%; max-width:none; margin:0; padding:24px 28px 40px; }
.admin-main { min-width:0; }
.category-list-table-wrap { position:relative; }
.admin-page .portal-heading, .admin-page-heading { margin-bottom:20px; }
.admin-page .stat-grid { margin:0 0 24px; gap:16px; }
.admin-actions { grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin-top:0; }
.admin-actions > a, .admin-actions > article { padding:22px; }
.admin-actions h2 { margin:12px 0 8px; }
.admin-actions p { margin:0; }
.site-header .header-register { display:inline-flex; align-items:center; color:#165f43; }

@media(max-width:1100px) {
  .admin-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:700px) {
  .trade-shell { padding:20px 16px 28px; }
  .trade-shell h1 { font-size:28px; }
  .trade-tabs { gap:10px 16px; margin-bottom:20px; padding-bottom:14px; }
  .trade-section { margin-top:26px; }
  .trade-shell .trade-panel, .trade-empty { padding:18px; }
  .trade-shell .trade-form { gap:14px; margin-top:18px; }
  .trade-shell .trade-form section { padding:18px; gap:14px; }
  .trade-shell .trade-form .form-pair,
  .trade-shell .trade-form .trade-form-three { grid-template-columns:1fr; gap:14px; }
  .trade-shell .trade-form > .primary-button { justify-self:stretch; }
  .trade-filters { padding:16px; gap:12px; }
  .trade-filters > .primary-button { width:100%; }
  .trade-page-heading, .trade-section-heading { gap:12px; }
  .trade-hero { min-height:0; padding-block:28px; }
  .trade-how { padding:22px; }
  .trade-stats { margin-bottom:20px; }
  .admin-page, .admin-main > .trade-shell { padding:20px 16px 28px; }
  .admin-page .stat-grid { gap:12px; margin-bottom:20px; }
  .category-overview-cards { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-bottom:20px; }
  .category-overview-cards > article { padding:12px 10px; }
  .category-overview-cards span, .category-overview-cards small { font-size:10px; line-height:1.4; }
  .category-overview-cards strong { font-size:24px; }
  .category-detail-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .admin-actions { gap:12px; }
  .admin-actions > a, .admin-actions > article { padding:18px; }
  .site-header .header-actions { gap:6px; }
  .site-header .sell-button { width:auto; flex:0 0 auto; }
}
@media(max-width:420px) {
  .admin-actions { grid-template-columns:1fr; }
  .site-header .brand img { max-width:100px; }
  .site-header .header-actions > a[href$='/blog'] { display:none; }
}
