@media (max-width: 980px) {
  .section-head .btn { padding: 10px 14px; font-size: 0.88rem; }
  .section { padding: 16px 16px 28px; }
  .plan-audience {
    display: flex;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    position: static;
  }
  .plan-audience button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
  }
  .section-head { margin-bottom: 12px; align-items: flex-start; }
  .hero { min-height: 72vh; }
  .hero-bg { background-position: center, 18% center; }
  .hero-inner { padding: 48px 16px 44px; }
  .gallery { height: 240px; min-height: 240px; }
  .form-page { padding: 18px 16px 96px; }
  .media-drop {
    min-height: 56px;
    padding: 16px 18px;
    overflow: hidden;
    -webkit-tap-highlight-color: rgba(27, 107, 69, 0.15);
  }
  .media-drop strong { font-size: 1.05rem; white-space: nowrap; }
  .media-drop.is-dragover {
    border-color: #0f3f28;
    background: #d5eadc;
    box-shadow: 0 0 0 3px rgba(27, 107, 69, 0.28);
  }
  .media-drop > span,
  .media-drop .media-drop-sub { display: none; }
  .media-drop input[type="file"] {
    position: absolute !important;
    inset: 0 !important;
    opacity: 0 !important;
    width: 100% !important;
    height: 100% !important;
    font-size: 16px !important;
    color: transparent !important;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
  }


  .nav-links { display: none !important; }
  .header-actions #acct-btn,
  .header-actions #sell-btn { display: none !important; }
  .header-actions { gap: 0; }
  .app-header { padding: 10px 16px; gap: 8px; }
  #site-notice { top: 54px; }
  .site-notice-inner { padding: 8px 40px 8px 14px; }
  .site-notice-msg { font-size: 0.88rem; }
  .slow-notice { padding: 6px 14px; font-size: 0.78rem; }
  .hy-bubble-orb, .hy-bubble-slot { width: 60px; height: 60px; }
  .hy-bubble-face { line-height: 60px; font-size: 1.45rem; }
  .hy-bubble-open video { height: 200px; }
  .hy-pop { padding: 24px 18px 18px; }
  .menu-toggle { display: inline-flex !important; }
  .dash-shell { grid-template-columns: 1fr !important; max-width: none; border-left: 0; border-right: 0; }
  .dash-aside { display: none !important; }
  .dash-mobile-top {
    display: block;
    padding: 16px 16px 10px;
    background: #fffcf7;
    border-bottom: 1px solid #d8e0d6;
  }
  .dash-mobile-hello {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 12px;
  }
  .dash-mobile-hello h2 {
    margin: 0;
    font-family: Poppins, system-ui, sans-serif;
    font-size: 1.55rem;
    letter-spacing: -.02em;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .dash-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 0 6px;
    scrollbar-width: none;
    max-width: 100%;
  }
  .dash-pills::-webkit-scrollbar { display: none; }
  .dash-pill {
    flex: none;
    padding: 8px 14px;
    border-radius: 999px;
    background: #eef4ef;
    color: #3a4a3e;
    font-weight: 560;
    font-size: .9rem;
  }
  .dash-pill.on { background: #1b6b45; color: #fff; }
  /* Nov 4 (t766u): Log out is the last pill (the phone's copy of the sidebar). */
  button.dash-pill { border: 0; font-family: inherit; line-height: inherit; cursor: pointer; }
  .dash-pill.acct-logout { background: #fff; box-shadow: inset 0 0 0 1px var(--line, #d9e0da); }
  /* Nov 6: Welcome is the home section under Industry News and the quote, on a phone and a wide screen. */
  .dash-mobile-hello { display: none !important; }
  .dash-mobile-hello .sub { margin: 4px 0 0; }
  #dash-main { padding: 16px !important; min-height: 0; max-width: 100%; width: 100%; overflow-x: hidden; }
  #dash-main.is-messages {
    padding: 0 !important;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .dash-col { flex: 1; min-height: 0; min-width: 0; width: 100%; overflow-x: hidden; }
  .dash-col:has(.is-messages) .dash-mobile-hello { display: none; }
  /* Oct 22 (David 4:45 PM): one page header everywhere. Off the Dashboard, the page's own large title leads. */
  html.hy-acct-sub .dash-mobile-hello { display: none; }
  html.hy-acct-sub .dash-mobile-top { padding-top: 10px; }
  .dash-subnav:not([hidden]) { padding-top: 16px; }
  .dash-col:has(.is-messages) .dash-mobile-top { padding: 8px 12px 8px; }
  .dash-col:has(.has-thread) .dash-pills { display: none; }
  html.hy-messages .inbox-shell,
  .inbox-shell {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100% !important;
    border-left: 0;
  }
  .inbox-shell.list-only .inbox-pane { display: none; }
  .inbox-shell.has-thread .inbox-list { display: none; }
  .inbox-list, .inbox-pane { flex: 1; min-height: 0; }
  .inbox-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    background: #e6f2ea;
    color: #0f3f28;
    font-weight: 650;
    line-height: 1;
    text-decoration: none;
  }
  .inbox-back::before { content: "‹"; font-size: 1.7rem; transform: translateY(-1px); }
  .inbox-list-head { padding: 12px 16px 6px; }
  .inbox-top { padding: 10px 12px; gap: 8px; flex-wrap: nowrap; }
  .inbox-thread { padding: 12px; }
  .inbox-foot {
    flex: none;
    padding: 8px 10px calc(12px + env(safe-area-inset-bottom));
  }
  .inbox-compose .btn { padding: 10px 14px; }

  .mail-tools {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin: 12px 0 16px;
  }
  .mail-tools .field { max-width: none; min-width: 0; }
  .mail-tools .btn { width: 100%; }
  .mail-log { padding: 12px 14px; }
  .mail-head { display: none; }
  .mail-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 10px;
    padding: 14px 0;
  }
  .mail-to { grid-column: 1 / -1; }
  .mail-subj { grid-column: 1 / -1; color: #3a4a3e; }
  .mail-status, .mail-when { width: auto; }
  .mail-when { text-align: right; }

  .dash-tiles { grid-template-columns: 1fr !important; width: 100%; }
  .dash-tile { min-width: 0; min-height: 0; overflow: hidden; }
  .dash-sec-tile .dash-tile { aspect-ratio: 1 / 1; max-height: min(72vw, 420px); }
  .dash-tile h3 { flex-wrap: wrap; gap: 4px 10px; flex: 0 0 auto; }
  .dash-tile-body { min-height: 0; overflow-x: hidden; overflow-y: auto; }
  .dash-mini { min-width: 0; }
  .dash-mini > b { flex: none; font-size: .9rem; }
  .podcast-grid { grid-template-columns: 1fr !important; }
  .news-ribbon { grid-template-columns: 1fr !important; width: 100%; max-width: 100%; }
  .start-banner { overflow: hidden; }

  .dash-kpis { grid-template-columns: 1fr 1fr !important; gap: 10px; max-width: none; width: 100%; }
  .dash-kpi { padding: 14px 12px; border-radius: 14px; aspect-ratio: auto; min-height: 78px; min-width: 0; }
  .dash-kpi b { font-size: 1.35rem; }
  .dash-kpi span { font-size: .78rem; white-space: normal; overflow-wrap: anywhere; }
  .view-toggle { display: none !important; }
  .browse-layout .filters {
    padding: 10px 12px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line, #d8e0d6);
  }
  .browse-layout .filters h3,
  .browse-layout .filters #apply-f,
  .browse-layout .filters .filter-count { display: none; }
  .filter-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .price-field { grid-column: 1 / -1; }
  .browse-layout .filters #near-me {
    display: block;
    margin-top: 8px;
    width: 100%;
  }
  .similar-block .cards-3 { grid-template-columns: 1fr; }
  .start-actions { flex-direction: column; align-items: stretch; }
  .share-row .btn { width: 100%; }
  .browse-layout .filters .field { margin: 0; }
  .browse-layout .filters .field label {
    font-size: 0.62rem;
    letter-spacing: .04em;
    margin-bottom: 3px;
  }
  .browse-layout .filters select {
    padding: 7px 6px;
    font-size: 16px;
    border-radius: 8px;
  }
  .browse-toolbar { display: none; }
  .browse-layout .filters .filter-search { display: none; }
  .map-frame {
    display: block;
    position: relative;
    height: 52vh;
    min-height: 420px;
    max-height: 560px;
    margin: 10px 12px 16px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--line, #d8e0d6);
    box-shadow: 0 10px 28px rgba(20, 32, 24, 0.1);
    background: #d5e4d4;
    z-index: 1;
  }
  .producers-frame { margin: 4px 0 8px; }
  .map-frame .map-search,
  .producers-frame .map-search {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    z-index: 5;
    top: 10px;
    left: 10px;
    right: 10px;
    max-width: none;
    margin: 0;
  }
  .map-search-field {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    margin: 0;
    padding: 0 14px;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 2px 12px rgba(20, 24, 20, 0.22);
    color: #5c6b62;
  }
  .map-search-field input {
    flex: 1;
    min-width: 0;
    height: 44px;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 16px;
    color: #1c241e;
    padding: 0;
  }
  .map-filter-btn {
    width: 48px;
    height: 48px;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #1c241e;
    box-shadow: 0 2px 12px rgba(20, 24, 20, 0.22);
    display: grid;
    place-items: center;
    padding: 0;
  }
  .browse-layout.filters-open .map-filter-btn { background: #16503c; color: #fff; }
  .browse-layout.filters-open .map-filter-btn circle { fill: #fff; stroke: #fff; }
  .map-frame .leaflet-top { top: 62px; }
  .browse-layout .map-wrap,
  .browse-layout.view-split .map-wrap,
  .browse-layout.view-list .map-wrap,
  .browse-layout.view-map .map-wrap,
  .producers-map {
    display: block !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #d5e4d4;
    overflow: hidden;
  }
  .browse-layout .map-wrap .leaflet-container,
  .producers-map .leaflet-container {
    border-radius: 17px;
  }
  .browse-layout .listings-col {
    padding-top: 2px;
  }
  .browse-layout .listings-col,
  .browse-layout.view-map .listings-col,
  .browse-layout.view-split .listings-col {
    display: flex !important;
    height: auto !important;
    overflow: visible !important;
  }
  .browse-layout .listings-grid,
  .browse-layout.view-map .listings-grid,
  .browse-layout.view-split .listings-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    height: auto !important;
    overflow: visible !important;
  }
  .browse-layout.view-split .browse-stage,
  .browse-layout.view-map .browse-stage {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .browse-layout.hy-zillow.mode-list .browse-stage {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important;
  }
  .browse-layout.hy-zillow.mode-list .listings-col {
    display: flex !important;
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
    overflow: hidden !important;
  }
  .browse-layout.hy-zillow.mode-list .listings-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}



.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
}
.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #142018;
  border-radius: 2px;
}
.mobile-menu {
  display: none;
  background: #fffcf7;
  border-bottom: 1px solid #d8e0d6;
  padding: 8px 16px 18px;
}
.mobile-menu.open {
  display: block;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 18px 40px rgba(20, 32, 24, 0.12);
}
.mobile-menu a,
.mobile-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #ebe6db;
  padding: 14px 6px;
  font: inherit;
  font-size: 1.05rem;
  color: #142018;
  cursor: pointer;
}
.mobile-menu a:last-child,
.mobile-menu .menu-cta {
  border-bottom: 0;
}
.mobile-menu .menu-cta {
  margin-top: 10px;
  text-align: center;
  background: #1b6b45;
  color: #fff;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 560;
}
/* Nov 5 (David): Log out at the bottom of the hamburger when signed in. */
.mobile-menu .menu-logout {
  margin-top: 6px;
  border-bottom: 0;
  color: #5a6a5e;
  font-weight: 560;
}
.mobile-menu .menu-logout[hidden] { display: none !important; }
@media (min-width: 981px) {
  .mobile-menu { display: none !important; }
  .menu-toggle { display: none !important; }
}

#pwa-install {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 90;
  background: #142018;
  color: #f4f1ea;
  border-radius: 16px;
  padding: 14px 44px 14px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  box-shadow: 0 16px 40px rgba(20, 32, 24, 0.28);
}
.pwa-x {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #f4f1ea;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 12px;
}
.pwa-install-copy { flex: 1; min-width: 0; }
.pwa-install-copy b { display: block; font-size: 0.95rem; }
.pwa-install-steps { display: block; font-size: 0.82rem; color: #c5d0c8; margin: 2px 0 0; line-height: 1.45; }
.pwa-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: 0 2px;
  vertical-align: -5px;
  background: #f4f1ea;
  color: #142018;
  border-radius: 6px;
}
.pwa-share svg { display: block; }
#pwa-install .btn { flex: none; padding: 8px 12px; font-size: 0.86rem; }
html.standalone .app-header { padding-top: calc(10px + env(safe-area-inset-top)); }
html.standalone:has(#slow-notice) .app-header { padding-top: 10px; }
html.standalone #site-notice { top: calc(54px + env(safe-area-inset-top)); }

#hy-offline-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 91;
  background: #142018;
  color: #f4f1ea;
  text-align: center;
  padding: 10px 14px;
  font-size: 0.92rem;
  font-weight: 560;
  letter-spacing: -0.01em;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(20, 32, 24, 0.28);
}
body:has(#pwa-install) #hy-offline-bar {
  bottom: calc(92px + env(safe-area-inset-bottom));
}

.media-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.media-actions .btn { cursor: pointer; }
.file-cam-btn {
  position: relative;
  overflow: hidden;
}
.file-cam-btn input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  font-size: 32px;
  cursor: pointer;
  border: 0;
  background: transparent;
}
@media (max-width: 980px) {
  /* Listing form: keep the page and wizard chrome inside the phone viewport.
     Long nowrap nav labels (Add Photo or Video) used to force the wiz-nav row
     past the right edge; Exit and Add Photo each get their own row. */
  .form-page {
    max-width: 100%;
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
  }
  .form-page .list-kind-toggle,
  .form-page .list-wizard,
  .form-page .panel {
    max-width: 100%;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .form-page .panel {
    padding-left: 16px;
    padding-right: 16px;
  }
  .list-kind-toggle button {
    min-width: 0;
  }
  .list-wizard:not(.list-flat) .wiz-top {
    display: block;
    margin: 0;
  }
  .list-wizard:not(.list-flat) .wiz-top span {
    font-size: 0.82rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5b6b60;
  }
  .wiz-progress {
    height: 6px;
    background: #e6eee8;
    border-radius: 99px;
    margin-top: 8px;
    overflow: hidden;
  }
  .wiz-progress i {
    display: block;
    height: 100%;
    width: 16%;
    background: #1b6b45;
    border-radius: 99px;
  }
  .list-wizard:not(.list-flat) .wiz-step { display: none; }
  .list-wizard:not(.list-flat) .wiz-step.on { display: block; }
  .list-wizard:not(.list-flat) .wiz-desktop-submit { display: none !important; }
  .list-wizard:not(.list-flat) .wiz-nav {
    display: flex;
    flex-wrap: wrap;
    position: fixed;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: auto;
    box-sizing: border-box;
    z-index: 200;
    gap: 8px;
    margin: 0;
    padding: 10px;
    background: #fffcf7;
    border: 1px solid #d8e0d6;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(20, 32, 24, 0.18);
    pointer-events: auto;
  }
  .list-wizard:not(.list-flat) .wiz-nav .wiz-step-error { order: 0; flex: 1 0 100%; }
  .list-wizard:not(.list-flat) .wiz-nav .btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    white-space: nowrap;
    position: relative;
    z-index: 1;
    pointer-events: auto;
  }
  /* Exit + Add Photo on their own rows; Back | Next share the last row
     (HTML order is Exit, Back, Add Photo, Next — reorder so the long
     photo label cannot sit between Back and Next). */
  .list-wizard:not(.list-flat) .wiz-nav #wiz-exit { order: 1; flex: 1 0 100%; min-height: 44px; }
  .list-wizard:not(.list-flat) .wiz-nav #wiz-add-photo { order: 2; flex: 1 0 100%; min-height: 44px; }
  .list-wizard:not(.list-flat) .wiz-nav #wiz-back { order: 3; }
  .list-wizard:not(.list-flat) .wiz-nav #wiz-next,
  .list-wizard:not(.list-flat) .wiz-nav #wiz-preview { order: 4; }
  .list-form-head { flex-wrap: wrap; gap: 10px; }
  .list-wizard:not(.list-flat) .wiz-mode-btn {
    min-height: 44px;
    margin-left: auto;
  }
  .list-wizard:not(.list-flat) .list-form-head {
    top: 52px;
  }
  .list-wizard:not(.list-flat) { padding-bottom: 8px; margin-bottom: 200px !important; }
  body:has(.list-wizard) #pwa-install { display: none !important; }
  #quality-meter {
    position: static;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    float: none;
    z-index: auto;
    transform: none;
  }
}

@media (max-width: 800px) {
  .app-footer {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 28px 16px calc(24px + env(safe-area-inset-bottom));
  }
  .foot-cols { grid-template-columns: 1fr 1fr; gap: 18px 16px; }
  .foot-meta { flex-direction: column; align-items: flex-start; }
}
@media (orientation: landscape) and (max-height: 560px) {
  body.hy-wiz .app-header {
    padding: 4px 12px 4px calc(12px + env(safe-area-inset-left));
    gap: 8px;
  }
  body.hy-wiz .brand span { display: none; }
  body.hy-wiz .brand img { width: auto; height: 26px; }
  body.hy-wiz .app-footer { display: none; }
  body.hy-shoot .form-page {
    padding: 6px calc(12px + env(safe-area-inset-right)) 58px calc(12px + env(safe-area-inset-left));
  }
  body.hy-shoot .form-page > .page-title,
  body.hy-shoot .form-page > .sub { display: none !important; }
  body.hy-shoot .list-wizard {
    margin-top: 0 !important;
    padding: 8px 10px;
  }
  body.hy-shoot .wiz-title,
  body.hy-shoot .wiz-step > .sub { display: none; }
  body.hy-shoot .wiz-top { margin: 0 0 6px; }
  body.hy-shoot .wiz-progress { height: 4px; margin-top: 4px; }
  body.hy-shoot .wiz-step.on .field.full {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
    margin: 0;
  }
  body.hy-shoot .media-drop {
    flex: 1 1 42%;
    min-height: 0;
    height: calc(100dvh - 132px);
    max-height: 220px;
    margin: 0;
  }
  body.hy-shoot #photo-preview.thumbs {
    flex: 1 1 58%;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0 !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    align-items: center;
  }
  body.hy-shoot #photo-preview .shot {
    width: 120px !important;
    height: 90px !important;
  }
  body.hy-shoot .wiz-extra { display: none; }
  body.hy-shoot .list-wizard:not(.list-flat) .wiz-nav {
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    bottom: calc(4px + env(safe-area-inset-bottom));
    padding: 6px;
    gap: 6px;
  }
  body.hy-shoot .list-wizard:not(.list-flat) .wiz-nav .btn {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 0.92rem;
  }
  body.hy-shoot .list-wizard:not(.list-flat) .wiz-nav #wiz-exit,
  body.hy-shoot .list-wizard:not(.list-flat) .wiz-nav #wiz-add-photo {
    flex: 1 0 100%;
    min-height: 40px;
    font-size: 0.88rem;
  }
  body.hy-shoot .list-wizard:not(.list-flat) .wiz-nav #wiz-back,
  body.hy-shoot .list-wizard:not(.list-flat) .wiz-nav #wiz-next,
  body.hy-shoot .list-wizard:not(.list-flat) .wiz-nav #wiz-preview {
    min-height: 40px;
  }
  body.hy-shoot .list-preview-hero { min-height: 0; max-height: 38vh; }
  body.hy-shoot .list-preview-hero img,
  body.hy-shoot .list-preview-hero video { max-height: 38vh; }
}

@media (orientation: landscape) and (max-height: 430px) {
  body.hy-shoot .media-drop { height: calc(100dvh - 118px); max-height: 160px; }
  body.hy-shoot #photo-preview .shot {
    width: 96px !important;
    height: 72px !important;
  }
}


/* HY-33: HerdMap inside browse map-frame */
.map-frame .hy-map-root,
.map-frame .hy-map-chrome,
.map-frame .hy-map-canvas { height: 100%; min-height: 0; border-radius: 0; }
.map-frame .hy-map-search-area { top: 66px; }
.map-frame .hy-map-locate { bottom: 18px; right: 12px; }
.map-frame .hy-map-preview { bottom: 14px; }
.map-frame .leaflet-top { top: 62px; }
.producers-map.hy-map-root,
.producers-map .hy-map-chrome,
.producers-map .hy-map-canvas { height: 100%; }

/* Genetics store: collapse search + filters on phones. One document scroll. */
@media (max-width: 980px) {
  .gx-panel-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 0 0 14px;
    padding: 12px 16px;
    border: 1px solid var(--line, #d8e0d6);
    border-radius: 999px;
    background: #fff;
    color: #142018;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(20, 32, 24, 0.06);
  }
  .gx-store.gx-panel-open .gx-panel-toggle {
    background: #16503c;
    color: #fff;
    border-color: #16503c;
  }
  .gx-panel-count {
    min-width: 1.4em;
    height: 1.4em;
    padding: 0 6px;
    border-radius: 999px;
    background: #16503c;
    color: #fff;
    font-size: 0.75rem;
    line-height: 1.4em;
    text-align: center;
  }
  .gx-store.gx-panel-open .gx-panel-count { background: #fff; color: #16503c; }
  .gx-store:not(.gx-panel-open) .gx-hero .hero-search,
  .gx-store:not(.gx-panel-open) .gx-filters {
    display: none !important;
  }
  .gx-store .hero.gx-hero {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible;
  }
  .gx-store .gx-hero .hero-inner { padding: 22px 16px 16px; }
  .gx-store .gx-hero h1 { font-size: 1.65rem; }
  .gx-store .gx-hero .lead { font-size: 0.95rem; margin-bottom: 0; }
  .gx-store.gx-panel-open .gx-hero .lead { margin-bottom: 14px; }
  .gx-store .hero-search input,
  .gx-filters input,
  .gx-filters select {
    font-size: 16px;
  }
  .gx-store,
  .gx-wrap,
  .gx-layout,
  .gx-main,
  .gx-grid,
  .gx-filters.filters {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    position: static !important;
    top: auto !important;
  }
  .gx-filters.filters {
    -webkit-overflow-scrolling: auto;
  }
  .gx-filters h3 { display: block; }
}


/* HY-50 listing detail mobile */
@media (max-width: 980px) {
  .ld-page {
    padding: 12px 16px 96px;
  }
  .ld-hero {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .ld-hero-media.gallery,
  .ld-page .gallery {
    min-height: 260px;
    height: 56vw;
    max-height: 360px;
    border-radius: 16px;
  }
  .ld-thumbs { margin-top: 10px; }
  .ld-thumb { width: 64px; height: 52px; }
  .ld-identity {
    padding: 14px 16px;
    border-radius: 16px;
    order: 0;
  }
  .ld-title { font-size: 1.45rem; }
  .ld-purchase {
    position: static;
    padding: 16px;
    border-radius: 16px;
    order: 1;
  }
  .ld-purchase .btn-lg,
  .ld-purchase #buy-now,
  .ld-purchase #contact-btn {
    min-height: 48px;
    width: 100%;
    font-size: 1.05rem;
  }
  .ld-qty-btn { min-width: 44px; min-height: 44px; }
  .ld-body { margin-top: 14px; gap: 12px; max-width: none; }
  .ld-card { padding: 14px 16px; border-radius: 16px; }
  .ld-grid { grid-template-columns: 1fr; }
  .ld-grid-row {
    grid-template-columns: 1fr 1fr;
    padding: 10px 0;
  }
  .ld-acc-btn {
    cursor: pointer;
    min-height: 44px;
    padding: 2px 0;
  }
  .ld-acc-chev { display: inline-block; }
  .ld-acc:not(.open) .ld-acc-body { display: none; }
  .ld-acc.open .ld-acc-body { display: block; }
  .ld-seller-actions { flex-direction: column; }
  .ld-seller-actions .btn { width: 100%; min-height: 48px; }
  .ld-owner {
    padding: 10px 12px;
    margin-bottom: 12px;
  }
  .ld-owner-actions { width: 100%; }
  .ld-owner-btn { flex: 1; justify-content: center; min-height: 44px; }

  .ld-sticky {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 252, 247, 0.96);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(20, 32, 24, 0.08);
    backdrop-filter: blur(8px);
  }
  .ld-sticky[hidden] { display: none !important; }
  .ld-sticky-price { font-weight: 750; font-size: 1.05rem; }
  .ld-sticky .btn { min-height: 44px; min-width: 120px; padding: 0 18px; }
  .ld-lightbox { padding: 56px 12px 24px; }
  .ld-lightbox .ld-nav.prev { left: 8px; }
  .ld-lightbox .ld-nav.next { right: 8px; }
}

/* Phone cattle and beef maps: keep search and the filter button off the tiles. */
@media (max-width: 540px) {
  html:has(.browse-layout.hy-phone-browse),
  html:has(.browse-layout.hy-phone-browse) body {
    height: 100%;
  }
  html:has(.browse-layout.hy-phone-browse) body {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
  }
  html:has(.browse-layout.hy-phone-browse) #app {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  html:has(.browse-layout.hy-phone-browse) .app-footer { display: none; }
  .browse-layout.hy-phone-browse {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow: hidden;
  }
  .browse-layout.hy-phone-browse .browse-main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow: hidden;
  }
  .browse-layout.hy-phone-browse .browse-toolbar { display: none !important; }
  .browse-layout.hy-phone-browse.mode-map .browse-mobile-toggle,
  .browse-layout.hy-phone-browse.mode-list .browse-mobile-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    flex: none;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px 10px;
  }
  .browse-layout.hy-phone-browse.mode-map .browse-mobile-toggle .btn,
  .browse-layout.hy-phone-browse.mode-list .browse-mobile-toggle .btn {
    width: 100%;
    height: 48px;
    min-height: 48px;
    margin: 0;
    padding: 12px 16px;
    box-sizing: border-box;
  }
  .browse-layout.hy-phone-browse .browse-stage {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important;
  }
  .browse-layout.hy-phone-browse.mode-map .map-frame,
  .browse-layout.hy-zillow.mode-list.hy-phone-browse .map-frame {
    display: flex !important;
    flex-direction: column;
    position: relative;
    flex: 1 1 auto;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden;
  }
  .browse-layout.hy-zillow.mode-list.hy-phone-browse .map-frame { flex: none; }
  .browse-layout.hy-phone-browse .map-frame .map-search {
    position: static !important;
    top: auto;
    left: auto;
    right: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex: none;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    margin: 0;
    padding: 16px;
    background: #d5e4d4;
    min-height: 80px;
    z-index: auto;
  }
  .browse-layout.hy-phone-browse .map-search-field {
    flex: 1 1 auto;
    align-self: center;
    min-width: 0;
    height: 48px;
    margin: 0;
    box-shadow: none;
    border: 1px solid var(--line, #d8e0d6);
  }
  .browse-layout.hy-phone-browse .map-filter-btn {
    flex: none;
    align-self: center;
    margin: 0;
  }
  .browse-layout.hy-phone-browse.filters-open .filters {
    display: block;
    flex: none;
    max-height: none;
    overflow: visible;
    padding: 8px 14px 12px;
    border-bottom: 1px solid var(--line, #d8e0d6);
  }
  html:has(.browse-layout.hy-phone-browse.filters-open),
  html:has(.browse-layout.hy-phone-browse.filters-open) body {
    height: auto;
    min-height: 100%;
  }
  html:has(.browse-layout.hy-phone-browse.filters-open) body {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
  }
  html:has(.browse-layout.hy-phone-browse.filters-open) #app,
  .browse-layout.hy-phone-browse.filters-open,
  .browse-layout.hy-phone-browse.filters-open .browse-main,
  .browse-layout.hy-phone-browse.filters-open .browse-stage,
  .browse-layout.hy-phone-browse.filters-open .map-frame {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    flex: none;
  }
  .browse-layout.hy-phone-browse.filters-open.mode-map .map-wrap {
    display: none !important;
    flex: none;
    min-height: 0 !important;
    height: 0 !important;
  }
  .browse-layout.hy-phone-browse.mode-map .map-wrap {
    display: block !important;
    flex: 1 1 0;
    min-height: 42vh !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }
  .browse-layout.hy-phone-browse.mode-map .listings-col { display: none !important; }
  .browse-layout.hy-phone-browse.mode-list .map-wrap { display: none !important; }
  .browse-layout.hy-phone-browse.mode-list .listings-col {
    display: flex !important;
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
    overflow: hidden !important;
  }
  .browse-layout.hy-phone-browse.mode-list .listings-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto !important;
  }
  .browse-layout.hy-phone-browse .map-frame .leaflet-top { top: 10px; }
  .browse-layout.hy-phone-browse .map-frame .hy-map-root,
  .browse-layout.hy-phone-browse .map-frame .hy-map-chrome,
  .browse-layout.hy-phone-browse .map-frame .hy-map-canvas {
    height: 100%;
    min-height: 0;
  }
}

/* HY-90: sideways swipe on an open listing, and the genetics card deck.
   The Listings view itself scrolls vertically (HY-97). */
@media (max-width: 980px) {
  .hy-listing-move { display: none !important; }
  .hy-listing-place { display: block; }
  .ld-page { touch-action: pan-y; }
  .ld-gallery, .ld-thumbs, .ld-lightbox, .ld-hero-media { touch-action: manipulation; }

  .hy-deck-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex: none;
    padding: 4px 12px 6px;
  }
  .hy-deck-arrow {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid var(--line, #d8e0d6);
    background: #fff;
    color: var(--green-d, #0f3f28);
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
  }
  .hy-deck-arrow:disabled { opacity: 0.35; }
  .hy-deck-count {
    color: var(--ink-soft, #3a4a3e);
    font-size: 0.82rem;
    font-weight: 650;
  }

  .gx-store .gx-layout,
  .gx-store .gx-main,
  .gx-store .hy-swipe-deck-inline {
    min-width: 0;
    max-width: 100%;
  }
  .gx-store .gx-main { overflow-x: hidden !important; }
  .gx-store .hy-swipe-deck-inline {
    width: 100%;
  }
  .gx-grid.hy-deck-track {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    display: flex !important;
    grid-template-columns: none !important;
    gap: 0;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding-bottom: 8px;
  }
  .gx-grid.hy-deck-track::-webkit-scrollbar { display: none; }
  .gx-grid.hy-deck-track .listing-card {
    flex: 0 0 var(--hy-deck-slide, 100%);
    width: var(--hy-deck-slide, 100%) !important;
    max-width: var(--hy-deck-slide, 100%);
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    box-sizing: border-box;
  }
  .gx-grid.hy-deck-track .listing-card:hover { transform: none; }
  .gx-store .hy-swipe-deck-inline { margin-top: 4px; }
}

/* HY-97: Listings view on a phone scrolls up and down only. */
@media (max-width: 980px) {
  .browse-layout.hy-zillow.mode-list,
  .browse-layout.hy-phone-browse.mode-list,
  .hy-map-page.is-mobile.mode-list {
    max-width: 100%;
    overflow-x: hidden;
  }
  .browse-layout.hy-zillow.mode-list .listings-scroll,
  .browse-layout.hy-phone-browse.mode-list .listings-scroll,
  .hy-map-page.is-mobile.mode-list .hy-map-results-scroll {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    touch-action: pan-y pinch-zoom;
    overscroll-behavior-x: none;
    overscroll-behavior-y: contain;
    scroll-snap-type: none;
    max-width: 100%;
  }
  .browse-layout.hy-zillow.mode-list .listings-grid,
  .browse-layout.hy-phone-browse.mode-list .listings-grid,
  .hy-map-page.is-mobile.mode-list .hy-map-results-scroll:not(.gx-phone-grid) #hy-map-results-list {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    height: auto !important;
  }
  .browse-layout.mode-list .listing-card,
  .hy-map-page.is-mobile.mode-list .hy-map-card {
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    flex: none;
    scroll-snap-align: none;
  }
}

/* HY-98: phone genetics listings scroll as a two-column portrait grid. */
@media (max-width: 540px) {
  /* Root overflow-x:clip keeps the document from scrolling this long page. */
  html:has(.gx-store) {
    height: 100%;
    overflow: hidden !important;
  }
  html:has(.gx-store) body {
    height: 100dvh;
    max-height: 100dvh;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .gx-store .gx-main {
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }
  .gx-store .gx-grid.gx-phone-grid,
  .gx-listings {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    align-items: stretch;
    scroll-snap-type: none;
  }
  .gx-store .gx-grid.gx-phone-grid .listing-card,
  .gx-listings .listing-card {
    display: flex;
    flex-direction: column;
    width: auto !important;
    max-width: none !important;
    min-width: 0;
    height: 100%;
    flex: none;
    scroll-snap-align: none;
  }
  .gx-store .gx-grid.gx-phone-grid .listing-card-link,
  .gx-listings .listing-card-link {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: auto;
  }
  .gx-store .gx-grid.gx-phone-grid .thumb,
  .gx-listings .listing-card .thumb {
    height: auto;
    aspect-ratio: 4 / 5;
    flex: none;
  }
  .gx-store .gx-grid.gx-phone-grid .badge,
  .gx-listings .listing-card .badge {
    top: 6px;
    left: 6px;
    max-width: calc(100% - 58px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.62rem;
    padding: 3px 7px;
  }
  .gx-store .gx-grid.gx-phone-grid .days,
  .gx-listings .listing-card .days {
    top: 6px;
    right: 6px;
    font-size: 0.6rem;
    padding: 3px 6px;
  }
  .gx-store .gx-grid.gx-phone-grid .listing-body,
  .gx-listings .listing-card .listing-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 8px 4px;
    gap: 2px;
  }
  .gx-store .gx-grid.gx-phone-grid .price,
  .gx-listings .listing-card .price {
    font-size: 0.92rem;
    margin: 0;
    line-height: 1.2;
  }
  .gx-store .gx-grid.gx-phone-grid .listing-title,
  .gx-listings .listing-card .listing-title {
    font-size: 0.82rem;
    line-height: 1.25;
    min-height: 0;
    margin-top: 2px;
    -webkit-line-clamp: 2;
  }
  .gx-store .gx-grid.gx-phone-grid .meta,
  .gx-listings .listing-card .meta {
    font-size: 0.72rem;
    line-height: 1.3;
    margin-top: 2px !important;
    -webkit-line-clamp: 2;
  }
  .gx-store .gx-grid.gx-phone-grid .card-actions,
  .gx-listings .listing-card .card-actions {
    position: static;
    flex-direction: row;
    justify-content: flex-end;
    gap: 4px;
    padding: 0 6px 8px;
  }
  .gx-store .gx-grid.gx-phone-grid .card-icon,
  .gx-listings .listing-card .card-icon {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
    box-shadow: none;
  }

  /* Genetics-only map listings. Preview popups stay on the shared card. */
  .hy-map-results-scroll.gx-phone-grid {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scroll-snap-type: none !important;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }
  .hy-map-results-scroll.gx-phone-grid #hy-map-results-list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    align-items: stretch;
    padding: 8px 8px calc(24px + env(safe-area-inset-bottom));
    box-sizing: border-box;
  }
  .hy-map-results-scroll.gx-phone-grid .hy-map-card {
    display: flex;
    flex-direction: column;
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    flex: none !important;
    scroll-snap-align: none !important;
    border-radius: 12px;
    border: 1px solid var(--line, #d8e0d6);
    border-bottom: 1px solid var(--line, #d8e0d6);
    overflow: hidden;
  }
  .hy-map-results-scroll.gx-phone-grid .hy-map-card-media {
    order: -1;
    margin: 0;
    border-radius: 0;
    aspect-ratio: 4 / 5;
  }
  .hy-map-results-scroll.gx-phone-grid .hy-map-card-head {
    padding: 8px 8px 0;
    gap: 4px;
  }
  .hy-map-results-scroll.gx-phone-grid .hy-map-card-lot {
    font-size: 0.82rem;
  }
  .hy-map-results-scroll.gx-phone-grid .hy-map-card-ranch {
    font-size: 0.72rem;
  }
  .hy-map-results-scroll.gx-phone-grid .hy-map-card-body {
    padding: 6px 8px 8px;
  }
  .hy-map-results-scroll.gx-phone-grid .hy-map-card-price {
    font-size: 0.92rem;
    margin-bottom: 2px;
  }
  .hy-map-results-scroll.gx-phone-grid .hy-map-card-line {
    font-size: 0.72rem;
  }
  .hy-map-results-scroll.gx-phone-grid .hy-map-card-cta {
    min-height: 32px;
    margin-top: 8px;
    font-size: 0.78rem;
    padding: 0 8px;
  }
  .hy-map-results-scroll.gx-phone-grid .hy-map-star {
    width: 28px;
    height: 28px;
    font-size: 0.95rem;
  }
}

/* HY-105: iOS Safari zooms the page when a focused input, select, or textarea
   computes under 16px, and that zoom pans the page. 16px stops the zoom and
   leaves pinch-zoom available. Desktop (wider than 980px) is unchanged. */
@media (max-width: 980px) {
  html:focus-within { scroll-behavior: auto; }
  input,
  select,
  textarea,
  .field input,
  .field select,
  .field textarea,
  .browse-layout .filters input,
  .browse-layout .filters select,
  .browse-layout .filters textarea,
  .hy-map-page-filters input,
  .hy-map-page-filters select,
  .hy-map-page.is-mobile .hy-map-phone-panel .hy-map-page-filters input,
  .hy-map-page.is-mobile .hy-map-phone-panel .hy-map-page-filters select,
  .gx-filters input,
  .gx-filters select,
  .gx-sort select,
  .gx-store .hero-search input,
  .hero-search input,
  .breed-pick input,
  .map-search-field input,
  .producers-frame .map-search-field input,
  .age-slider input,
  .price-range input,
  .field .price-range input,
  .form-page input,
  .form-page select,
  .form-page textarea,
  .ld-buy input,
  .ld-buy select,
  .ld-buy textarea {
    font-size: 16px;
  }
  button,
  .btn,
  input:not([type="range"]),
  select,
  textarea {
    touch-action: manipulation;
  }
}

/* HY-115: footer runs edge to edge on phones too. */
@media (max-width: 800px) {
  .app-footer {
    max-width: none;
    width: 100%;
    margin: auto 0 0;
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* HY-118 / HY-122 / HY-123 / HY-125 tablet and phone */
@media (max-width: 980px) {
  .home-hero .hero-inner { padding-top: 36px; padding-bottom: 30px; }
  .home-quick { gap: 8px; margin-top: 16px; }
  .home-quick a { padding: 9px 14px; font-size: 0.92rem; }
  .home-row-section { padding-top: 22px; padding-bottom: 4px; }
  .home-row-section + .home-row-section { padding-top: 14px; }
  .home-row {
    grid-auto-columns: minmax(240px, 46%);
    gap: 12px;
    scroll-snap-type: x mandatory;
    margin: 0 -16px;
    padding: 4px 16px 12px;
    scroll-padding: 0 16px;
  }
  .gx2-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .gx-store.gx2 { padding: 12px 16px calc(32px + env(safe-area-inset-bottom)); }
  .gx2-chips { margin: 12px -16px 14px; padding: 2px 16px 8px; }
  .cart-layout { grid-template-columns: 1fr; }
  .cart-ranch { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
  .cart-summary { position: static; }
  .ld-z .ldz-gallery.has-tiles { display: block; height: auto; }
  .ld-z .ldz-gallery.has-tiles .ld-hero-media.gallery { border-radius: 16px; height: 56vw; min-height: 260px; max-height: 360px; }
  .ldz-tiles { display: none; }
  .ldz-see-all { right: 10px; bottom: 10px; font-size: 0.84rem; padding: 7px 12px; }
  .ldz-main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-top: 14px;
  }
  .ldz-aside { position: static; }
  .ldz-aside .ld-purchase > .ld-label,
  .ldz-aside .ld-purchase > .ld-price { display: none; }
  .ldz-body { margin-top: 0; }
  .ldz-title-row { flex-direction: column; gap: 6px; }
  .ldz-head-actions { order: -1; }
  .ldz-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
  .ldz-fact { border: 0; background: var(--white); padding: 10px 14px; }
  .ldz-fact:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
  .home-row { grid-auto-columns: 78%; }
  .gx2-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gx2-card .listing-body { padding: 8px 10px 6px; }
  .gx2-card .listing-title { font-size: 0.92rem; }
  .gx2-card .price { font-size: 0.95rem; }
  .gx-cart-actions { grid-template-columns: 1fr; padding: 0 10px 10px; gap: 6px; }
  .gx-cart-btn.btn { min-height: 38px; }
  .cart-link { padding: 8px; }
  .cart-link-label { display: none; }
  .cart-count { left: 20px; }
  .cart-ranch { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
  .cart-page, .cart-ranch, .cart-ranch-main, .cart-line, .cart-tools, .cart-info { max-width: 100%; min-width: 0; }
  .cart-ranch-main { padding-left: 12px; padding-right: 12px; overflow: hidden; }
  .cart-ranch-head { grid-template-columns: auto minmax(0, 1fr); }
  .cart-av-link { grid-row: 1; grid-column: 1; }
  .cart-name-link { grid-row: 1; grid-column: 2; align-self: center; min-width: 0; }
  .cart-producer-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cart-ranch-sub {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    margin-top: 4px;
  }
  .cart-producer-count, .cart-fee-pill { grid-column: auto; grid-row: auto; }
  .cart-fee-pill { white-space: nowrap; flex: none; }
  .cart-ranch-main .cart-line {
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-areas: "thumb info" "tools tools";
    align-items: start;
  }
  .cart-ranch-main .cart-thumb { grid-area: thumb; width: 64px; height: 64px; flex: none; }
  .cart-ranch-main .cart-info { grid-area: info; }
  .cart-tools { grid-area: tools; justify-content: flex-end; flex-wrap: nowrap; gap: 8px; }
  .cart-trash { width: 44px; height: 44px; flex: none; }
  .cart-ranch-main .cart-qty-btn { width: 44px; height: 44px; }
  .cart-secure { white-space: normal; text-align: center; }
  .cart-head { flex-wrap: wrap; }
  .cart-error { flex-wrap: wrap; }
  .cart-summary .cart-checkout { min-height: 52px; width: 100%; }
}

/* HY-138: phone browse header. Map and Listings are round icon buttons on the search row. */
@media (max-width: 980px) {
  .map-view-btn {
    width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%;
    background: #fff; color: #1c241e; box-shadow: 0 2px 12px rgba(20, 24, 20, 0.22);
    display: grid; place-items: center; padding: 0; margin: 0; align-self: center; cursor: pointer;
  }
  .map-view-btn.is-active { background: #16503c; color: #fff; }
  .browse-layout.hy-phone-browse .map-frame .map-search { gap: 6px; }
}
@media (max-width: 360px) {
  .browse-layout.hy-phone-browse .map-filter-btn { width: 44px; height: 44px; }
  .browse-layout.hy-phone-browse .map-search-field { padding-left: 10px; padding-right: 8px; }
  .browse-layout.hy-phone-browse .map-frame .map-search { padding: 12px 10px; }
}

/* HY-142 follow-up: photo controls big enough to tap in the phone camera layout (portrait). */
@media (max-width: 980px) and (orientation: portrait) {
  body.hy-shoot #photo-preview .shot { height: 128px !important; width: 150px !important; }
  body.hy-shoot #photo-preview .shot-tools { top: 5px; left: 5px; gap: 5px; }
  body.hy-shoot #photo-preview .shot-tool { width: 34px; height: 34px; }
  body.hy-shoot #photo-preview .shot-tool svg { width: 16px; height: 16px; }
}

/* HY-150: one column on phones and small tablets, Zillow-style. */
@media (max-width: 980px) {
  .ld-z:not(.ld-sheet) .ldz-top { margin-bottom: 8px; }
  .ld-z:not(.ld-sheet) .ldz-top .ldz-head-actions { order: 0; }
  .ld-z:not(.ld-sheet) .ldz-gallery.has-tiles { display: block; height: auto; }
  .ldz-sum { flex-direction: column; gap: 12px; }
  .ldz-keys { gap: 22px; }
  .ldz-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ld-z:not(.ld-sheet) .ldz-facts { display: none; }
}
@media (max-width: 360px) {
  .ldz-chips { grid-template-columns: minmax(0, 1fr); }
  .ldz-keys { gap: 16px; }
}

/* Phones: drop the inline price/days/Message card (no Buy); message from the Sold by section at the bottom. */
@media (max-width: 760px) {
  .ldz-aside .ld-purchase.ld-purchase-contact { display: none !important; }
}

/* Oct 19: Cattle + Beef mobile web: ONE floating Map/List pill, bottom center (matches the iOS app).
   The search box takes the whole search row. Both panels stay mounted; 220ms crossfade between them. */
@media (max-width: 980px) {
  .hy-mt-pill {
    position: fixed;
    left: 50%;
    bottom: var(--hy-mt-lift, calc(16px + var(--hy-bottom-nav-h, 0px) + env(safe-area-inset-bottom, 0px)));
    transform: translateX(-50%);
    z-index: 1150;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 22px;
    background: #142018;
    color: #fff;
    font: 600 16px/1 Poppins, system-ui, sans-serif;
    letter-spacing: 0;
    box-shadow: 0 4px 12px rgba(20, 32, 24, .28);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: bottom 220ms ease-in-out, opacity 120ms ease-in-out;
  }
  .hy-mt-pill svg { width: 18px; height: 18px; flex: none; color: #fff; }
  .hy-mt-pill:active { opacity: .7; }
  .hy-mt-pill:focus-visible { outline: 3px solid #e7b85b; outline-offset: 2px; }
  /* The pill never sits on top of a full listing or an open filter sheet. */
  html.hy-listing-overlay-open .hy-mt-pill,
  .browse-layout.hy-mtoggle.filters-open .hy-mt-pill { display: none; }

  /* Search row: the field fills the row (only the filter button sits beside it). */
  .browse-layout.hy-mtoggle .map-search .map-search-field { flex: 1 1 auto; min-width: 0; }

  /* Both views keep the search row; only the panel under it changes. */
  .browse-layout.hy-mtoggle.mode-list .map-frame { display: flex !important; flex: none !important; height: auto !important; min-height: 0 !important; }
  .browse-layout.hy-mtoggle.mode-list .map-wrap { display: none !important; }
  .browse-layout.hy-mtoggle.mode-map .listings-col { display: none !important; }

  /* Map view: rounded top corners on the map panel; no Sort, no "Notify me" there. */
  .browse-layout.hy-mtoggle.mode-map .map-wrap { border-radius: 18px 18px 0 0 !important; overflow: hidden; }
  .browse-layout.hy-mtoggle.mt-on-map .field-sort,
  .browse-layout.hy-mtoggle.mt-on-map #save-search { display: none !important; }

  /* Room under the last card so the pill never covers it. */
  .browse-layout.hy-mtoggle .listings-scroll { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; }

  /* Crossfade (110ms out + 110ms in). */
  .browse-layout.hy-mtoggle .map-wrap,
  .browse-layout.hy-mtoggle .listings-col { transition: opacity 110ms ease-in-out; }
  .browse-layout.hy-mtoggle.mt-fading .map-wrap,
  .browse-layout.hy-mtoggle.mt-fading .listings-col { opacity: 0; }
}
@media (max-width: 980px) and (prefers-reduced-motion: reduce) {
  .hy-mt-pill, .browse-layout.hy-mtoggle .map-wrap, .browse-layout.hy-mtoggle .listings-col { transition: none; }
}
/* Oct 20 (David): on phones the Beef price panel stays visible (price shown exactly once, with the key facts);
   the price line under the title is not rendered for Beef.
   Nov 6: that panel is the price, so the extra buy-box copy stays hidden (cattle phones still use it,
   because the label price above the stepper is hidden). */
@media (max-width: 980px) {
  .ld-beef .ldz-aside .ld-purchase > .ld-label,
  .ld-beef .ldz-aside .ld-purchase > .ld-price { display: block; }
  .ld-beef .ldz-aside .ld-purchase .ld-buy > .ld-buy-price { display: none; }
}
@media (max-width: 760px) {
  .ld-beef .ldz-aside .ld-purchase.ld-purchase-contact { display: block !important; }
}

/* Nov 5 (David): hide header cart on phones until cart has an item. Desktop always shows #cart-link. */
@media (max-width: 980px) {
  .app-header #cart-link.is-empty { display: none !important; }
}


/* Nov 5 (David 9:29 PM PT): "What's special" (and other body headings) must sit below the
   buy/contact card — never overlap Visit Ranch Website / Connect. Force flow stacking. */
@media (max-width: 980px) {
  .ld-z .ldz-main {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .ld-z .ldz-head { order: 0; width: 100%; }
  .ld-z .ldz-aside {
    order: 1;
    position: static !important;
    top: auto !important;
    z-index: 2;
    max-height: none !important;
    overflow: visible !important;
    width: 100%;
    margin: 0 0 4px;
  }
  .ld-z .ldz-aside .ld-purchase {
    position: static !important;
    background: var(--white, #fff);
  }
  .ld-z .ldz-body {
    order: 2;
    position: relative;
    z-index: 0;
    margin-top: 4px;
    width: 100%;
    clear: both;
  }
  .ld-z .ldz-special,
  .ld-z .ldz-body > .ldz-special,
  .ld-z .ldz-body > .ld-card:first-child,
  .ld-z .ldz-body > .ld-sec:first-child,
  .ld-z .ldz-body > .bd-sec:first-child,
  .ld-z .ldz-body > .ld-h:first-child,
  .ld-z .ldz-body > .ldz-group-h:first-child {
    margin-top: 10px;
    padding-top: 2px;
  }
  .ld-z .ldz-special .ld-h,
  .ld-z .ldz-body > .ld-h:first-child,
  .ld-z .ldz-body > .ldz-group-h:first-child {
    position: relative;
    z-index: 0;
  }
  .ld-z .ld-connect,
  .ld-z .ld-connect-web {
    position: relative;
    z-index: 1;
  }
}
