/* shop.css - customer-facing page layouts. Built on base.css + components.css.
 * Colors via var(--...) only. */

/* ---- Mobile nav drawer (toggled by .navbar__menu-toggle) ---- */

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-bg);
  /* Sticky under the header: static, a menu opened far down a page drew itself off-screen above it (#473). */
  position: sticky;
  top: var(--header-height);
  z-index: 29;
  max-height: calc(100vh - var(--header-height));
  max-height: calc(100dvh - var(--header-height));
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

.mobile-nav a {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  text-decoration: none;
}

.mobile-nav a:hover { background-color: var(--color-surface); }

/* Drawer for phone and tablet; from 960px the inline navbar nav. Shared breakpoint with .navbar__nav/.navbar__signin/.navbar__menu-toggle. */
@media (min-width: 960px) {
  .mobile-nav { display: none !important; }
}

/* ---- Page intro (heading + search) ---- */

/* Browse page only (#215): less top padding, or the promo strip and hero read as a hole under the header. */
body.page-home > main {
  padding-block-start: var(--space-3);
}

@media (min-width: 960px) {
  body.page-home > main {
    padding-block-start: var(--space-4);
  }
}

.shop-intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-block-end: var(--space-5);
}

.shop-intro__search {
  max-width: 36rem;
}

/* ---- Hero: landing view only. No setting - a shop ships page.hero.html on its layer; the base copy renders only a hidden h1.
   Copy is translations (hero.*), so fluid type, no fixed heights, prose capped at a readable measure ---- */

/* A band above the results, not a landing page: 48px padding and a 36px headline once pushed the first cards off screen. */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-4);
  margin-block-end: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-accent-soft);
}

@media (min-width: 800px) {
  .hero {
    grid-template-columns: 1.6fr 1fr;
    gap: var(--space-6);
    padding: var(--space-4) var(--space-6);
  }
}

/* Icon inline with the eyebrow: stacked above it, the 44px circle cost two lines of height. */
.hero__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg);
  color: var(--color-accent);
}

.hero__badge .icon {
  width: 0.875rem;
  height: 0.875rem;
}

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-1);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.hero__title {
  margin: 0;
  font-size: var(--font-size-lg);
  line-height: var(--line-height-tight);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  text-wrap: balance;
}

@media (min-width: 800px) {
  .hero__title { font-size: var(--font-size-xl); }
}

/* Body at page size: the headline carries the emphasis; a bigger paragraph turns a band into a billboard. */
.hero__body {
  margin: var(--space-1) 0 0;
  max-width: 60ch;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-base);
  color: var(--color-text-muted);
}

/* The optional button under the body (relooma, #467) had no rule and sat on the text (#473). */
.hero__cta { margin-block-start: var(--space-3); }

/* The points are a supporting column on desktop and a list under the prose on
   a phone. Never a grid of cards: three short lines do not need three boxes. */
.hero__points {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero__point {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-base);
  color: var(--color-text); /* muted was 4.2:1 at 12px on hockey's accent-soft */
}

.hero__tick {
  margin-block-start: 0.15em;
  color: var(--color-accent);
}

/* Compact variant (#215): eyebrow + one-line title left, three points right, no body or button; about half the height. Additive. */
.hero--compact {
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
}

.hero--compact .hero__eyebrow {
  margin-block-end: var(--space-1);
}

.hero--compact .hero__title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
}

.hero--compact .hero__points {
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
}

/* The one-sentence about line (#423) is its own row under title and points, full width (#431): inside the title column
   it stretched the compact band to five lines on the left against three points on the right. */
.hero--compact .hero__about {
  grid-column: 1 / -1;
  max-width: 80ch;
  margin-block-start: 0;
}

/* On a phone the strip is #215's title and three points: the about line (#423, still in the page for crawlers) was 126px
   of a band that held the first listing at 660px (#473). */
@media (max-width: 599px) {
  .hero--compact .hero__about { display: none; }
}

@media (min-width: 800px) {
  .hero--compact {
    grid-template-columns: auto 1fr;
    gap: var(--space-6);
  }

  .hero--compact .hero__points {
    justify-content: flex-end;
  }
}


/* ---- Browse filter bar: replaced the 260px sidebar, which cost a fourth card; each group is a popover (data-toggle +
   data-dropdown-menu, no new JS) so a long brand list is not a wall across the page ---- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* The form always renders (search and sort join it by id); spacing belongs to the groups, or an empty bar leaves a gap. */
.filter-bar--filled {
  margin-block-end: var(--space-5);
}

/* position: relative is what the absolutely positioned menu hangs off, and
   it is on .dropdown (shared with the navbar), not here. */
.filter-bar__item {
  position: relative;
}

.filter-bar__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch-target-min);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-full);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.filter-bar__btn:hover {
  border-color: var(--color-accent);
}

.filter-bar__btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* A group with a selection must read ON when closed - the one way a popover loses to an always-visible sidebar. */
.filter-bar__btn.is-active {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.filter-bar__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 var(--space-1);
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: var(--color-accent-fg);
  font-size: var(--font-size-xs);
  font-variant-numeric: tabular-nums;
}

.filter-bar__caret {
  color: var(--color-text-muted);
}

.filter-bar__menu {
  position: absolute;
  z-index: 20;
  inset-inline-start: 0;
  top: calc(100% + var(--space-2));
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: max-content;
  min-width: 13rem;
  /* Two caps: max-content sized the panel to the location hint's longest line (620px for a postal code) - the width cap lets it
     wrap; the viewport cap stops an absolutely positioned menu scrolling the page sideways on a phone. */
  max-width: min(19rem, calc(100vw - var(--space-8)));
  max-height: 60vh;
  overflow-y: auto;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  box-shadow: var(--shadow-lg);
}

/* Under 800px the panel docks to the bottom of the viewport (#106): anchored to the 3rd chip its right edge landed off screen,
   and to the 6th, at 700px, past a body that clips it (#473). */
@media (max-width: 799px) {
  .filter-bar__menu {
    position: fixed;
    inset-inline: var(--space-4);
    top: auto;
    bottom: var(--space-4);
    width: auto;
    max-width: none;
    max-height: 70vh;
  }
}

/* Popover controls run one step down from the page scale; the input keeps 36px - still a finger target. */
.filter-bar__menu .field__label {
  font-size: var(--font-size-xs);
}

/* 36px is a pointer size; on a phone back to the 44px minimum - two inputs side by side is where mis-taps happen. */
.filter-bar__menu .input,
.filter-bar__menu .select {
  min-height: var(--touch-target-min);
  padding-block: var(--space-1);
  font-size: var(--font-size-sm);
}

@media (min-width: 600px) {
  .filter-bar__menu .input,
  .filter-bar__menu .select {
    min-height: 36px;
  }
}

.filter-bar__menu .field__hint,
.filter-bar__menu .field__error {
  font-size: var(--font-size-xs);
  line-height: var(--line-height-tight);
}

.filter-bar__menu .btn {
  min-height: var(--touch-target-min);
  padding-block: var(--space-1);
  font-size: var(--font-size-sm);
}

@media (min-width: 600px) {
  .filter-bar__menu .btn {
    min-height: 36px;
  }
}

/* 44px is there for fingers. On a pointer it only spreads a short list out,
   so tighten the row - the same trade the sidebar made. */
@media (min-width: 960px) {
  .filter-bar__menu .choice {
    min-height: 30px;
  }
}

.filter-bar__clear {
  min-height: var(--touch-target-min);
  padding: var(--space-2);
  border: 0;
  background: none;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-family: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.filter-bar__clear:hover {
  color: var(--color-text);
}

/* Price range: two inputs side by side, inside the price popover. */
.price-range {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* .input is width:100%, so two price boxes grew to 250px each for "100" and "120": share the row instead. */
.price-range .input {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Spinners off: 20px per box and step 1 are useless on a price range; type=number keeps the numeric keypad and validation. */
.price-range .input::-webkit-outer-spin-button,
.price-range .input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.price-range__sep {
  color: var(--color-text-muted);
}

/* ---- Category bar: above the results, they are the first pick. Chips scroll sideways on a phone (four wrapped rows would push
   the first listing off screen) and WRAP from 700px; scrollbar hidden, a right-edge fade says "more" only while it can scroll;
   the radio is visually hidden but focusable, so the chips stay one keyboard-operable group ---- */

.cat-bar {
  position: relative;
  margin-block-end: var(--space-4);
  overflow-x: auto;
  /* Room for the focus ring, which a plain overflow container would clip. */
  padding-block: var(--space-1);
  /* Hidden, not thin. See the note above - the fade replaces it. */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.cat-bar::-webkit-scrollbar {
  display: none;
}

/* The fade. A mask rather than a gradient overlay, so it works on any page background without knowing the colour
   behind it; the #000 is mask alpha (opaque), not a colour - the one hex outside base.css, by design (#471). */
@media (max-width: 699px) {
  .cat-bar {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent);
  }
}

.cat-bar__list {
  display: flex;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 700px) {
  .cat-bar {
    overflow-x: visible;
    /* The mask would clip the focus ring on the last chip in each row, and
       there is nothing to fade once the chips wrap. */
    -webkit-mask-image: none;
    mask-image: none;
  }
  .cat-bar__list {
    flex-wrap: wrap;
    row-gap: var(--space-2);
  }
}

.cat-bar__item {
  flex: 0 0 auto;
}

.cat-bar__chip {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target-min); /* 39px sat over 44px filter buttons, two chip rows at two heights (#473) */
  cursor: pointer;
  text-decoration: none; /* a link since #456 */
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-full);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.cat-bar__chip:hover {
  border-color: var(--color-accent);
}

.cat-bar__chip.is-active {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-accent-fg);
}

.cat-bar__chip:hover, .cat-bar__chip:focus-visible { text-decoration: none; color: var(--color-text); }
.cat-bar__chip.is-active:hover, .cat-bar__chip.is-active:focus-visible { color: var(--color-accent-fg); }

.cat-bar__chip:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ---- Results area ---- */

.results { min-width: 0; }

.results__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-block-end: var(--space-3);
}

.results__count {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.results__tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* The sort dropdown sizes to its content here; the global .select width:100%
   would otherwise stretch it and squeeze the view-toggle next to it. */
.results__tools .select {
  width: auto;
}

/* List / Map segmented toggle */
.view-toggle {
  display: inline-flex;
  flex-shrink: 0; /* fixed-size control: never shrink/clip the Map button */
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.view-toggle__btn {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target-min); /* level with the 44px sort select beside it (#473) */
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  background-color: var(--color-bg);
}

.view-toggle__btn + .view-toggle__btn {
  border-left: 1px solid var(--color-border-strong);
}

.view-toggle__btn.is-active {
  background-color: var(--color-accent);
  color: var(--color-accent-fg);
}

/* Active filter pills */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-block-end: var(--space-4);
}


/* Load more */
.load-more {
  display: flex;
  justify-content: center;
  margin-block-start: var(--space-8);
}

/* ---- Browse map (.map-overview, .map-bubble, .map-popup: live Leaflet); the listing inset is .listing-map below ---- */

/* ---- Live browse map ---------------------------------------------------- */

.map-overview__countries {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-block-end: var(--space-3);
}

.pill--country {
  cursor: pointer;
  border: 1px solid var(--color-border-strong);
  background-color: var(--color-bg);
}

.pill__count {
  font-weight: var(--font-weight-bold);
  margin-inline-start: var(--space-1);
}

/* Leaflet measures its container: the height must come from CSS and be non-zero when the panel first shows. */
.map-overview__canvas {
  height: clamp(360px, 60vh, 640px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background-color: var(--color-surface-2);
}

/* Fallback text when Leaflet did not load - centred in the empty box. */
.map-overview--unavailable .map-overview__canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.map-overview__note {
  margin-block-start: var(--space-3);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.map-overview__warn {
  display: inline-block;
  margin-inline-start: var(--space-2);
  /* Not --color-warning (3.19:1 on white): this line says results are missing from the map. On-white/on-soft split as badges (#207). */
  color: var(--color-warning-text);
}

/* The count bubble. Leaflet sizes the icon box; the span is what is seen, and
   its width/height are set inline because they scale with the count. */
.map-bubble__dot {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background-color: var(--color-accent);
  color: var(--color-accent-fg);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  border: 2px solid var(--color-bg);
  box-shadow: var(--shadow-sm);
}

/* Leaflet draws its own popup chrome; this styles only what goes inside. */
.leaflet-container {
  font: inherit;
}

.map-popup {
  width: 240px;
}

.map-popup__head {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-tight);
}

.map-popup__row {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-1) 0;
  border-block-start: 1px solid var(--color-border);
  color: inherit;
}

.map-popup__media {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background-color: var(--color-surface-2);
}

.map-popup__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.map-popup__title {
  font-size: var(--font-size-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-popup__price {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
}

.map-popup__all {
  display: block;
  margin-block-start: var(--space-3);
  text-align: center;
}

/* ---- Breadcrumb ---- */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-block-end: var(--space-4);
}

.breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.breadcrumb a:hover { color: var(--color-text); text-decoration: underline; }

.breadcrumb__sep { color: var(--color-text-subtle); }

.breadcrumb__current { color: var(--color-text); overflow-wrap: anywhere; } /* a 40-character unbroken title must not widen the page (#456) */

/* ---- Listing detail layout ---- */

.listing {
  display: grid;
  /* minmax(0, 1fr), not 1fr: a bare 1fr is minmax(auto, 1fr) and grows to the thumbnail row's min-content, which with
     five 72px thumbs is 392px - wider than a phone - and every right-hand control was clipped off-screen (#456). */
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}

@media (min-width: 960px) {
  .listing {
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
    column-gap: var(--space-8);
  }
  .listing__gallery   { grid-column: 1; grid-row: 1; }
  /* Not sticky, no inner scroll (#445): the panel is routinely taller than the viewport, and pinned it either hid its
     own bottom or grew a second scrollbar. It flows with the page: one scrollbar, nothing cut off. */
  .listing__panel     { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
  .listing__secondary { grid-column: 1; grid-row: 2; }
}

/* ---- Gallery: the container is .listing__gallery (page.listing) ---- */

.listing__gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Scroll-snap strip: the browser does swipe, momentum and snap; scrollbar hidden; desktop clicks a thumb (ui.js scrolls). */
.gallery__viewport {
  display: flex;
  /* Ratio from --gallery-ratio (#418, #419); fit stays contain - a buyer must see the whole photo. Capped, or the square
     sized by width alone pushed thumbs, title and price below a laptop's or an iPad's fold (#473). */
  aspect-ratio: var(--gallery-ratio);
  max-height: min(70vh, 40rem);
  width: 100%; /* or the cap keeps the ratio by narrowing the box, and the arrows float outside it */
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background-color: var(--color-surface-2);
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* touch-action stays auto: pan-x blocked the page scroll and the pinch-zoom from the photo, half a phone screen (#473). */
}
.gallery__viewport::-webkit-scrollbar { display: none; }

/* Edge arrows, pointer devices only: an invisible full-height strip per side with a small disc; positioned on .gallery__stage, not
   the scrolling viewport. ui.js hides the arrow at its end; [hidden] beats the display:flex (base.css !important). */
.gallery__stage { position: relative; }

.gallery__arrow {
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18%;
  min-width: 56px;
  margin: 0;
  padding: 0 var(--space-3);
  border: 0;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  align-items: center;
}
.gallery__arrow--prev { left: 0;  justify-content: flex-start; }
.gallery__arrow--next { right: 0; justify-content: flex-end; }

.gallery__arrow-disc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  opacity: 0.75;
  transition: opacity 0.15s, transform 0.15s;
}
.gallery__arrow-disc .icon { width: 22px; height: 22px; }
.gallery__arrow:hover .gallery__arrow-disc,
.gallery__arrow:focus-visible .gallery__arrow-disc { opacity: 1; transform: scale(1.08); }
.gallery__arrow:focus-visible { outline: none; }

@media (hover: hover) and (pointer: fine) {
  .gallery__arrow { display: flex; }
}

/* The strip is keyboard-focusable when there is more than one photo (tabindex in the template), so the arrow keys
   reach ui.js; show where focus is. */
.gallery__viewport:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.gallery__slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.gallery__thumbs {
  display: flex;
  flex-wrap: wrap; /* a second row beats a page wider than the phone (#456) */
  gap: var(--space-2);
}

.gallery__thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  background-color: var(--color-surface-2);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.gallery__thumb.is-active { border-color: var(--color-accent); }


/* ---- Account page: a member with no chosen name lands here (#344), so name, postal code and city must fit without scrolling.
   Scoped: .field and .form-section are shared with the post form and admin ---- */
.account-page .form-intro { margin-block-end: var(--space-4); }
/* Only matches when the intro paragraph is absent, which is the first visit: the heading would otherwise sit
   straight on top of the first section title. */
.account-page h1 + form { display: block; margin-block-start: var(--space-5); }
/* Bottom margin keeps the sticky action bar off a focused input the browser scrolled to on a phone. */
.account-page .field { margin-block-end: var(--space-3); scroll-margin-block-end: 88px; }
/* On a phone the bar's buttons stack and it is 121px tall (#456). */
@media (max-width: 599px) {
  .account-page .field { scroll-margin-block-end: 8.5rem; }
}
.account-page .form-section__title { margin-block-end: var(--space-3); }

/* Profile photo row (#469): the circle, then the pick and remove buttons; admin's user page reuses the row. */
.avatar-field__row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.avatar-field__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
/* The file input is sr-only, so the focus ring lives on its button - the same trick as .photo-dropzone. */
.avatar-field__pick { position: relative; cursor: pointer; }
.avatar-field__pick:focus-within { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.account-page .form-section + .form-section {
  margin-block-start: var(--space-5);
  padding-block-start: var(--space-4);
}

/* Unanswered fields pulse three times, then stop; ui.js drops the class on first input; reduced motion keeps the ring only. */
.field--attention .input {
  border-color: var(--color-accent);
  animation: field-attention 1.2s ease-out 3;
}

@keyframes field-attention {
  0%, 100% { box-shadow: 0 0 0 0 rgba(15, 23, 42, 0); }
  35%      { box-shadow: 0 0 0 4px var(--color-info-soft); }
}

@media (prefers-reduced-motion: reduce) {
  .field--attention .input { animation: none; box-shadow: 0 0 0 3px var(--color-info-soft); }
}

/* Save is sticky, not fixed: it stays in the column and stops at the form's end; the negative inline margin lets the tint reach the padding edge. */
.account-page .form-actions {
  position: sticky;
  bottom: 0;
  margin-inline: calc(var(--space-4) * -1);
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  z-index: 1;
  /* A row at every width: stacked, the pinned bar was 121px of a phone screen (#473). */
  flex-direction: row;
  justify-content: flex-end;
}

/* ---- Panel (price / title / actions / seller) ---- */

.listing__panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Seller-written text can be one long unbroken word; body clips overflow, so it must wrap (#438). */
.listing__title, .profile-header__name, .thread-header__title, .facts dd, .message__bubble, .auth-card__email,
.seller-contact a, .modal__intro strong { overflow-wrap: anywhere; } /* the last four joined in #473: a 52-character token ran 148px past a phone */
.seller-contact a { min-width: 0; }

.listing__title {
  font-size: var(--font-size-2xl);
  line-height: var(--line-height-tight);
}

.listing__price {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
}

.listing__loc {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.listing__cta {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* A reserve/release button sits in a form; display:contents makes the button the flex child, so it stretches like its siblings. */
.listing__cta form { display: contents; }

/* ---- Item details (definition list) ---- */

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2) var(--space-5);
  margin: 0;
}

.facts dt { color: var(--color-text-muted); font-size: var(--font-size-sm); }
.facts dd { margin: 0; font-weight: var(--font-weight-medium); }

/* The fact row's guide link: small, normal weight; its own line under 600px (the value column is 140px at 360px), beside the value from 600px. */
.facts__help {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-normal);
}

@media (min-width: 600px) {
  .facts__help {
    display: inline;
    margin-left: var(--space-2);
  }
}

/* ---- Seller card ---- */

.seller-card {
  display: flex;
  text-decoration: none;
  color: inherit;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.seller-card__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.seller-card__name { font-weight: var(--font-weight-semibold); }
.seller-card__meta { font-size: var(--font-size-sm); color: var(--color-text-muted); }

/* Seller mailto under the card: it cannot sit inside the card link. */
.seller-contact {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-block-start: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* ---- Secondary sections (description / details / map) ---- */

.listing-section + .listing-section { margin-block-start: var(--space-6); }

.listing-section__title {
  font-size: var(--font-size-lg);
  margin-block-end: var(--space-3);
}

.listing-section p { color: var(--color-text); line-height: var(--line-height-loose); }

/* ---- Safety note ---- */

.safety-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.safety-note .icon { color: var(--color-text-subtle); margin-top: 1px; }

/* ---- Forms: post a listing, and reusable form pieces ---- */

.form-intro {
  color: var(--color-text-muted);
  margin-block-end: var(--space-6);
}

.form-section + .form-section {
  margin-block-start: var(--space-8);
  padding-block-start: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.form-section__title {
  font-size: var(--font-size-lg);
  margin-block-end: var(--space-4);
}

/* Two fields on one row (e.g. postal code + city) */
.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 600px) {
  .field-row--postal { grid-template-columns: 1fr 2fr; }
  .field-row--2      { grid-template-columns: 1fr 1fr; }
  .field-row--roles  { grid-template-columns: 2fr 1fr auto; }
}

/* Leading addon (the one currency) OR trailing select (a choice of currencies), never both. */
.input-group { display: flex; align-items: stretch; }

.input-group__addon {
  display: inline-flex;
  align-items: center;
  padding-inline: var(--space-3);
  background-color: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* The text input takes the free space. `.input` carries width:100%, which two
   flex children would otherwise fight over. */
.input-group .input {
  flex: 1 1 auto;
  min-width: 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Whatever leads the group keeps its left corners: the addon when present, else the input - a squared edge against nothing looks broken. */
.input-group > .input:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

/* Trailing currency select: sizes to content, shares the input's border, takes the right corners. Two classes deep so .input-group .input does not win. */
.input-group .input-group__select {
  flex: 0 0 auto;
  width: auto;
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* ---- Photo uploader ---- */

.photo-uploader__hint {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-block-end: var(--space-2);
}

/* "Photos - 2 / 4": the limit is the shop's MaxPhotos, printed by the server and kept current by ui.js (#421). */
.photo-uploader__count {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  margin-block-end: var(--space-2);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

/* Under 360px a third of the row is 85px: the cover badge ran into the remove button and the drop zone's hint was cut (#456). */
@media (max-width: 359px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 600px) {
  /* As many tiles of at least 140px as fit (#426): four across the 700px form, three on a phone. */
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

.photo-slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.photo-slot--filled {
  border: 1px solid var(--color-border);
  background-color: var(--color-surface-2);
}

.photo-slot__badge {
  position: absolute;
  top: var(--space-1);
  left: var(--space-1);
}

/* The two round buttons on a filled slot: remove top right, make-cover bottom right (#421). */
.photo-slot__remove,
.photo-slot__cover {
  position: absolute;
  right: var(--space-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background-color: var(--color-bg);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

.photo-slot__remove { top: var(--space-1); }
.photo-slot__cover  { bottom: var(--space-1); }
.photo-slot__remove:hover { color: var(--color-danger); }
.photo-slot__cover:hover  { color: var(--color-accent); }

/* The one "add" tile (#421): alone it stretches across the grid as a drop target, beside photos it is a tile. Wraps the 1px file
   input and carries its focus ring (the category chips used it too until they became links in #456). */
.photo-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-2);
  border: 2px dashed var(--color-border-strong);
  background-color: var(--color-bg);
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: var(--font-size-sm);
  text-align: center;
}

.photo-dropzone:only-child {
  grid-column: 1 / -1;
  aspect-ratio: auto;
  min-height: 160px;
}

.photo-dropzone__title {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.photo-dropzone:hover,
.photo-grid.is-dragover .photo-dropzone {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.photo-dropzone:focus-within {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.photo-dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ---- Form actions ---- */

.form-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-2);
  margin-block-start: var(--space-8);
}

@media (min-width: 600px) {
  .form-actions {
    flex-direction: row;
    justify-content: flex-end;
  }
}

/* ---- Profile header (seller profile, account page) ---- */

.profile-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-block: var(--space-5);
  border-bottom: 1px solid var(--color-border);
  margin-block-end: var(--space-6);
}

@media (min-width: 600px) {
  .profile-header {
    flex-direction: row;
    align-items: center;
  }
}

.profile-header__info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.profile-header__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.profile-header__name {
  font-size: var(--font-size-2xl);
  margin: 0;
  line-height: var(--line-height-tight);
}

.profile-header__meta {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.profile-header__actions {
  display: flex;
  gap: var(--space-2);
}

/* ---- Danger zone card (delete account etc.) ---- */

.danger-zone {
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background-color: var(--color-danger-soft);
}

.danger-zone__title {
  color: var(--color-danger-text); /* danger on danger-soft is 3.95:1, the pair #424 fixed on .alert--danger */
  font-weight: var(--font-weight-semibold);
  margin-block-end: var(--space-2);
}

.danger-zone p {
  color: var(--color-text);
  margin-block-end: var(--space-3);
}

/* ---- Messages inbox (thread list) ---- */

.thread-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--color-border);
  margin-block-start: var(--space-3);
}

/* An empty inbox still renders the container, so no border/margin until it has a child. :has, not :empty - mustache leaves whitespace. */
.thread-list:not(:has(.thread-list__item)) { display: none; }

.thread-list__item {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
}

.thread-list__item:hover {
  background-color: var(--color-surface);
  color: inherit;
  text-decoration: none;
}

.thread-list__main {
  flex: 1;
  min-width: 0;
}

.thread-list__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
}

.thread-list__name {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-list__time {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Block, both: they are spans, and an inline box takes no ellipsis - a long preview ran 419px past a phone (#473). */
.thread-list__preview,
.thread-list__listing {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-list__preview {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-block-start: 2px;
}

.thread-list__listing {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted); /* subtle was 2.6:1 at 12px */
  margin-block-start: var(--space-1);
}

.thread-list__badge-col {
  display: flex;
  align-items: center;
}

/* Unread state: stronger name + preview, accent badge */
.thread-list__item--unread .thread-list__name,
.thread-list__item--unread .thread-list__preview {
  color: var(--color-text);
}

.thread-list__item--unread .thread-list__preview {
  font-weight: var(--font-weight-medium);
}

.thread-list__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-full);
  background-color: var(--color-accent);
  color: var(--color-accent-fg);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

/* ---- Thread (single conversation) ---- */

.thread-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-block: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  margin-block-end: var(--space-3);
}

.thread-header__back {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target-min); /* a 21px link was the way back to the inbox (#473) */
  gap: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  align-self: flex-start;
}

.thread-header__back:hover {
  color: var(--color-text);
}

.thread-header__top {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.thread-header__title {
  font-size: var(--font-size-xl);
  margin: 0;
  flex: 1;
  min-width: 0;
}

.thread-header__listing {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  font-size: var(--font-size-sm);
}

.thread-header__listing:hover {
  border-color: var(--color-border-strong);
  background-color: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
}

.thread-header__listing-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background-color: var(--color-surface-2);
  flex-shrink: 0;
}

.thread-header__listing-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.thread-header__listing-title {
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-header__listing-price {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

/* ---- Message bubbles ---- */

.messages {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-block: var(--space-4);
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  gap: 2px;
}

.message--in  { align-self: flex-start; align-items: flex-start; }
.message--out { align-self: flex-end;   align-items: flex-end; }

.message__bubble {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  line-height: var(--line-height-base);
}

.message--in .message__bubble {
  background-color: var(--color-surface-2);
  color: var(--color-text);
  border-bottom-left-radius: var(--radius-sm);
}

.message--out .message__bubble {
  background-color: var(--color-accent);
  color: var(--color-accent-fg);
  border-bottom-right-radius: var(--radius-sm);
}

.message__time {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.message__day-sep {
  align-self: center;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  padding: var(--space-1) var(--space-3);
  background-color: var(--color-surface);
  border-radius: var(--radius-full);
}

/* ---- Reply form (sticky at bottom of viewport on the thread page) ---- */

.reply-form {
  position: sticky;
  bottom: 0;
  background-color: var(--color-bg);
  padding-block: var(--space-3);
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-block-start: var(--space-4);
}

.reply-form .textarea {
  min-height: 80px;
}

@media (max-width: 599px) {
  .reply-form .textarea { min-height: 3.5rem; } /* the composer is sticky: every line of it is a line of conversation gone (#473) */
}

.reply-form__actions {
  display: flex;
  justify-content: flex-end;
}

/* ---- Legal pages (terms, privacy) ---- */

.legal {
  line-height: var(--line-height-loose);
}

/* base.css gives headings no bottom margin and the rules below space only h2/h3, so the h1 sat on its first paragraph. */
.legal h1 {
  margin-block-end: var(--space-3);
}

.legal h2 {
  margin-block-start: var(--space-10);
  margin-block-end: var(--space-3);
  padding-block-end: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

.legal h3 {
  margin-block-start: var(--space-6);
  margin-block-end: var(--space-2);
}

.legal p + p,
.legal ul,
.legal ol {
  margin-block-start: var(--space-3);
}

.legal ul,
.legal ol {
  padding-inline-start: var(--space-6);
}

.legal li + li {
  margin-block-start: var(--space-1);
}

.legal__updated {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin-block-end: var(--space-6);
}

.legal__toc {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-block: var(--space-4) var(--space-8); /* it sat flush on the intro paragraph (#473) */
}

/* An h2 since #473 - the h3 skipped a level under the h1 - so the section-heading rule above is undone here. */
.legal__toc h2 {
  margin: 0 0 var(--space-2) 0;
  padding: 0;
  border: 0;
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.legal__toc ol {
  margin: 0;
  padding-inline-start: var(--space-5);
}


/* ---- Auth / OTP login ---- */

.auth-header {
  display: flex;
  justify-content: center;
  padding: var(--space-6) var(--space-4) 0;
}

.auth-card {
  width: 100%;
  max-width: 26rem;
  margin-inline: auto;
  margin-block-start: var(--space-6);
  padding: var(--space-6);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 600px) {
  .auth-card { margin-block-start: var(--space-10); padding: var(--space-8); }
}

.auth-card__title {
  font-size: var(--font-size-2xl);
  margin-block-end: var(--space-2);
}

.auth-card__intro {
  color: var(--color-text-muted);
  margin-block-end: var(--space-5);
}

.auth-card__email {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.auth-card__alt {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-4);
  margin-block-start: var(--space-4);
  font-size: var(--font-size-sm);
}

.auth-card__alt button {
  color: var(--color-accent);
  font-size: var(--font-size-sm);
}

.auth-card__alt button:hover { color: var(--color-accent-hover); text-decoration: underline; }

.auth-fineprint {
  margin-block-start: var(--space-5);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted); /* subtle was 2.6:1 at 12px */
  text-align: center;
}

.auth-fineprint a { color: var(--color-text-muted); }

/* One-time-code input */
.otp-input {
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--font-size-2xl);
  letter-spacing: 0.4em;
  padding-inline: var(--space-2);
}

.otp-input::placeholder {
  letter-spacing: 0.4em;
  color: var(--color-text-subtle);
}

/* Real photos as background images: scale and centre. */
.gallery__thumb,
.photo-slot--filled,
.thread-header__listing-thumb {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ---- Listing location map: fixed height because Leaflet paints nothing in a 0px container ---- */

/* Leaflet never arrived (blocked CDN): the box says so instead of staying an empty grey square, like the browse map (#456). */
.listing-map--unavailable {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  text-align: center;
}

.listing-map {
  height: 220px;
  margin-block-end: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  /* The tiles are square and the container has rounded corners. */
  overflow: hidden;
}

.map-note {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* ---- Promo banner: an advertisement that looks like one - accent border and surface background, a notice, not a listing;
   quieter than the hero so the page keeps one voice ---- */

/* Up to three cards in a row, never a carousel: readable at once, no motion or focus handling, stacks on a phone. */
.promos {
  display: grid;
  gap: var(--space-2);
  margin-block-end: var(--space-4);
}

@media (min-width: 800px) {
  .promos--multi {
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  }

  /* In a ~300px column the row layout does not fit (flex-basis 20rem): stack the text above the button. */
  .promos--multi .promo {
    flex-direction: column;
    align-items: flex-start;
  }

  .promos--multi .promo__body {
    flex: 1 1 auto;
    width: 100%;
  }
}

.promo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  /* The row spacing belongs to the .promos grid now, so the card itself has
     no bottom margin to double it up with. */
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-inline-start: 3px solid var(--color-accent);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
}

.promo__body {
  /* Stops a long title stretching the row and squeezing the button onto its
     own line at widths where both would have fitted. */
  flex: 1 1 20rem;
  min-width: 0;
}

.promo__eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-1);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent);
}

/* The place is secondary to the date - people decide on "can I get there"
   after "is it while I am free". */
.promo__where {
  color: var(--color-text-muted);
  text-transform: none;
  letter-spacing: 0;
  font-weight: var(--font-weight-normal);
}

.promo__title {
  margin: 0;
  font-size: var(--font-size-md);
  line-height: var(--line-height-tight);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  text-wrap: balance;
}

.promo__text {
  margin: var(--space-1) 0 0;
  max-width: 60ch;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-base);
  color: var(--color-text-muted);
}

.promo__cta {
  flex: 0 0 auto;
}

/* From 800px the date/place line and the title share one row - at the top of the browse page every line costs results. Baseline
   alignment: a 12px eyebrow and a 16px title centred look adrift. */
@media (min-width: 800px) {
  .promo__body {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-1) var(--space-3);
  }

  .promo__eyebrow,
  .promo__title {
    margin: 0;
  }

  /* Full-width so it drops to its own line under the two above, rather than
     trying to squeeze in beside them and forcing a ragged three-column row. */
  .promo__text {
    flex: 1 0 100%;
    margin: 0;
  }
}

/* ---- Converted-price hint (#74): the seller's price restated in the shop currency from an admin-typed rate; quieter and smaller
   on purpose, absent (not empty) when there is nothing to say ---- */

/* Inline behind "~" inside the price element: a second line cost a row per card and read as a second price. */
.listing-card__approx,
.listing__price-approx {
  display: inline;
  margin-inline-start: var(--space-2);
  /* Reset the parent price's size and weight - these are nested inside it. */
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-normal);
  color: var(--color-text-muted);
  /* Tabular figures so a column of cards lines its digits up rather than
     shimmering as the widths change between rows. */
  font-variant-numeric: tabular-nums;
  /* The mark and the amount must never be split across a line break: a "~"
     stranded at the end of a line stops meaning "about". */
  white-space: nowrap;
}

.listing__price-approx {
  font-size: var(--font-size-sm);
}

/* The shop currency beside the Price label: a unit, muted; from the Shop document, so it survives a currency change. */
.filter-bar__cur {
  color: var(--color-text-muted);
  font-weight: var(--font-weight-normal);
}

/* ---- Handover preferences (#444): the sell form's checklist and the listing page's summary ---- */
.handover { border: 0; padding: 0; margin: var(--space-4) 0 0; min-width: 0; }
.handover legend { padding: 0; }
.handover__list,
.handover-list { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; gap: var(--space-2); }
.choice--stacked { align-items: flex-start; }
.choice--stacked input { margin-top: 3px; flex: none; }
.choice__text { display: flex; flex-direction: column; }
.choice__hint,
.handover-list__hint { font-size: var(--font-size-sm); color: var(--color-text-muted); }
/* Indented under the tick it belongs to, so the select reads as part of that row rather than a fifth field. */
.handover__value { margin: var(--space-2) 0 0 calc(18px + var(--space-2)); }
.handover-card { margin-block: var(--space-4); }
.handover-card__title,
.handover__legend { display: flex; align-items: center; gap: var(--space-2); }
.handover-card__title { margin: 0 0 var(--space-1); font-weight: var(--font-weight-semibold); }
.handover-card__title .icon,
.handover__legend .icon { color: var(--color-accent); }
.handover-list li { display: flex; flex-direction: column; }

/* ---- Print (#456): a listing brought to a handover is the photo, the price, the place and the seller on one sheet.
   Chrome, header and footer off: the navbar, actions, thumbnails, map and footer go; the gallery shows the first slide. ---- */
@media print {
  .navbar, .mobile-nav, .footer, .cat-bar, .filter-bar, .load-more, .toast,
  .listing__cta, .gallery__thumbs, .gallery__arrow, .listing-map, .listing__reserved { display: none !important; }
  .listing { grid-template-columns: 1fr; gap: var(--space-4); }
  .gallery__viewport { overflow: visible; }
  .gallery__slide + .gallery__slide { display: none; }
  body { background: var(--color-bg); color: var(--color-text); }
  a { color: inherit; text-decoration: none; }
}
