/* Listings only: compact browsing, uncropped photography and a touch-friendly editor. */
#marketplaceMain .discovery-hero { min-height: 148px; padding: 24px; border-radius: 16px; }
#marketplaceMain .discovery-hero h1 { font-size: clamp(1.5rem, 2.3vw, 2rem); line-height: 1.2; }
#marketplaceMain .discovery-hero p { font-size: 1rem; margin: 8px 0 0; }
#marketplaceMain .discovery-hero-cta { min-height: 44px; padding: 10px 16px; font-size: .875rem; }
#siteResultsSection .listing-section-heading { margin: 20px 0 12px; gap: 12px; flex-wrap: wrap; }
#siteResultsSection .listing-section-heading h2 { font-size: 1.25rem; }
#siteResultsSection .section-eyebrow { display: none; }
#grid { gap: 14px; }
#grid .listing { min-width: 0; border-radius: 12px; box-shadow: none; }
#grid .photo { height: auto; aspect-ratio: 4 / 3; background: #f3f6f7; }
#grid .photo-open { position: absolute; inset: 0; display: block; border: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
#grid .photo img, #detail .detail-photo img, #detail .detail-thumb img,
#post .photo-tile img, #post .preview-card img { display: block; object-fit: contain; object-position: center; }
#grid .listing:hover .photo img { transform: none; }
.mobile-featured-track .mobile-featured-photo { object-fit: contain; }
#grid .pill { top: auto; bottom: 8px; left: 8px; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 7px; font-size: .75rem; }
#grid .fav { top: 8px; right: 8px; width: 44px; height: 44px; }
#grid .body { padding: 12px; }
#grid .body h2 { min-height: 42px; margin: 0 0 8px; font-size: .9375rem; }
#grid .title-open { font-size: inherit; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 44px; padding: 0; }
#grid .price { font-size: 1.125rem; overflow-wrap: anywhere; }
#grid .meta { margin-top: 10px; padding-top: 8px; font-size: .75rem; gap: 6px; flex-wrap: wrap; }
#detail .detail-gallery { align-content: start; align-self: start; min-width: 0; }
#detail .detail-photo { height: clamp(220px, 46vh, 460px); aspect-ratio: auto; background: #f3f6f7; position: relative; }
#detail .detail-photo img { width: 100%; height: 100%; }
#detail .detail-thumb { width: 72px; height: 64px; background: #f3f6f7; }
#detail .detail-thumbs { overscroll-behavior-inline: contain; }
#detail .detail-gallery-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .875rem; }
#detail .detail-gallery-controls button { min-width: 44px; min-height: 44px; font-size: .875rem; }
#detail .detail-gallery-controls button:disabled { opacity: .4; cursor: default; }
.listing-image-error { display: none; }
#grid .photo.has-image-error .listing-image-error,
#detail .detail-photo.has-image-error .listing-image-error { display: grid; place-items: center; position: absolute; inset: 0; padding: 16px; text-align: center; color: var(--sub); font-size: .875rem; pointer-events: none; }
#grid .photo.has-image-error img, #detail .detail-photo.has-image-error img { opacity: 0; }
#post .sheet { width: min(920px, 100%); }
#post .sheet-head { padding: 16px 24px; }
#post .content { padding: 20px 24px 24px; }
#post .wizard-progress { gap: 5px; margin-bottom: 24px; }
#post .wizard-progress button { font-size: .875rem; border-radius: 8px; }
#post .wizard-progress button.active { background: #e6f2f5; border-color: var(--ink); }
#post .wizard-pane h3 { font-size: 1.25rem; }
#post .wizard-copy { font-size: 1rem; line-height: 1.5; margin-bottom: 18px; }
#post .form { gap: 16px; }
#post .field > label, #post .field > legend { font-size: .875rem; }
#post input:not([type=checkbox]):not([type=radio]):not([type=hidden]), #post select, #post textarea { font-size: 1rem; min-height: 46px; border-radius: 8px; }
#post textarea { resize: vertical; line-height: 1.55; }
#post .field-hint { display: flex; justify-content: space-between; gap: 10px; color: var(--sub); font-size: .75rem; margin: 6px 0 0; }
#post .field-hint output { flex-shrink: 0; font-variant-numeric: tabular-nums; }
#post .upload { padding: 0; border: 0; background: transparent; }
#post .photo-picker { position: relative; display: grid; justify-items: center; gap: 8px; padding: 22px 16px; border: 2px dashed #9abac3; border-radius: 12px; background: #f4f9fa; cursor: pointer; text-align: center; }
#post .photo-picker strong { font-size: 1rem; color: var(--ink); }
#post .photo-picker small { color: var(--sub); font-size: .875rem; }
#post .photo-picker .photo-picker-action { padding: 10px 18px; background: var(--ink); border-radius: 8px; color: #fff; font-size: .875rem; font-weight: 700; }
#post .photo-picker input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
#post .photo-picker:focus-within { outline: 3px solid var(--red); outline-offset: 3px; }
#post .photo-drop-active .photo-picker { border-color: var(--ink); background: #dceef2; }
#post .photo-picker:has(input:disabled) { opacity: .6; cursor: wait; }
#post .photo-manager-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 16px; font-size: .875rem; }
#post .photo-manager-head small { color: var(--sub); font-size: .75rem; }
#post .photo-status { margin: 8px 0; font-size: .875rem; line-height: 1.5; color: var(--ink); white-space: pre-line; }
#post .photo-status:empty { display: none; }
#post .photo-status.has-error { color: #9b2929; }
#post .previews { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
#post .photo-tile { width: auto; max-width: none; min-width: 0; padding: 8px; border-radius: 10px; }
#post .photo-tile.is-cover { border: 2px solid var(--ink); padding: 7px; }
#post .photo-tile img { width: 100%; height: 132px; background: #f3f6f7; border-radius: 6px; }
#post .photo-tile-title { display: block; margin: 8px 0 3px; font-size: .875rem; }
#post .photo-tile-meta { color: var(--sub); font-size: .75rem; margin-bottom: 8px; }
#post .photo-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
#post .photo-tools button { margin: 0; padding: 6px 4px; min-height: 44px; font-size: .875rem; border-radius: 6px; }
#post .photo-tools button:disabled { opacity: .45; cursor: default; }
#post .photo-tools .photo-remove { color: #9b2929; }
#post .photo-preview-strip { display: flex; gap: 8px; overflow-x: auto; padding: 10px; border-top: 1px solid var(--line); }
#post .photo-preview-strip img { width: 72px; height: 64px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 6px; }
#post .preview-card > img { height: 260px; background: #f3f6f7; }
#post .preview-body h4 { font-size: 1.125rem; }
#post .preview-body p { white-space: pre-wrap; overflow-wrap: anywhere; }
#post .preview-edit-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
#post .preview-edit-actions button { min-height: 44px; font-size: .875rem; }
#post .wizard-actions { bottom: -24px; margin: 24px -24px -24px; padding: 12px 24px max(12px, env(safe-area-inset-bottom)); z-index: 2; }
#post .wizard-actions button { font-size: .875rem; }
#post :is(button, select, textarea, input):focus-visible, #grid button:focus-visible, #detail .detail-thumb:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
@media (min-width: 1280px) { #grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  body.post-modal-open .mobile-bottom-nav,
  body.post-modal-open .reference-post,
  body.post-modal-open .mobile-chat-button { display: none !important; }
  #post.modal { z-index: 120; }
  #marketplaceMain .discovery-hero { min-height: 124px; padding: 18px; }
  #marketplaceMain .discovery-hero h1 { font-size: 1.5rem; }
  #marketplaceMain .discovery-hero p { font-size: .875rem; }
  #grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #grid .listing { display: block; min-height: 0; }
  #grid .photo { height: auto; aspect-ratio: 1 / 1; }
  #grid .body { padding: 10px; }
  #grid .body h2 { font-size: .875rem; }
  #grid .price { font-size: 1rem; }
  #grid .meta { flex-direction: column; align-items: flex-start; }
  #detail .detail-photo { height: clamp(220px, 42dvh, 360px); max-height: none; }
  #post.modal { padding: 0; align-items: stretch; }
  #post .sheet { width: 100%; height: 100dvh; max-height: 100dvh; display: flex; flex-direction: column; overflow: hidden; border-radius: 0; }
  #post .sheet-head { flex: 0 0 auto; padding: 14px 16px; }
  #post #postForm.content { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior-y: contain; scroll-padding-bottom: calc(92px + env(safe-area-inset-bottom)); padding: 16px; }
  #post .wizard-progress { grid-template-columns: repeat(8, minmax(76px, 1fr)); margin-bottom: 18px; }
  #post .form { grid-template-columns: minmax(0, 1fr); }
  #post .previews { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #post .photo-tile img { height: 116px; }
  #post .photo-picker { padding: 18px 12px; }
  #post .photo-manager-head { flex-wrap: wrap; gap: 4px; }
  #post .wizard-actions { position: sticky; bottom: 0; margin: auto -16px 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr 1fr; flex: 0 0 auto; z-index: 5; background: #fff; box-shadow: 0 -8px 18px rgba(15, 63, 76, .08); }
  #post .wizard-actions .spacer { display: none; }
  #post .wizard-actions button { min-height: 46px; touch-action: manipulation; }
  #post #wizardNext, #post #submitBtn { grid-column: 1 / -1; }
  #post .location-row { flex-wrap: wrap; }
  #post .location-row input { width: 100%; }
}
@media (max-width: 350px) { #grid { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) {
  #grid .listing, #grid .photo img { transition: none; }
}
