/* ==========================================================================
   Scrappy
   Visual system borrowed from the Wild Haven template: near-neutral palette,
   one desaturated sage accent, light headings carried by 11px uppercase
   kickers, 8px cards on an off-white page. Adapted for a marketplace, which
   means tighter vertical rhythm and heavier weights on anything that is data
   (price, quantity, distance) rather than atmosphere.
   ========================================================================== */

:root {
  /* Surfaces. The paper/card split is load-bearing: it is what makes a card
     read as a card when the shadow is this faint. */
  --paper: #FCFCFC;
  --card: #FFFFFF;
  --sunk: #F4F6F3;
  --line: #E6E9E5;
  --line-soft: #EFF1EE;

  /* Text. Both verified against --paper: ink 11.5:1, muted 4.9:1. */
  --ink: #2F3A33;
  --muted: #67716B;

  /* The one real hue. --sage is decorative only (it is far too light to put
     text on); --sage-deep is the interactive fill at 6.0:1 on paper. */
  --sage: #A7BEB2;
  --sage-pale: #EFF4F0;
  --sage-deep: #3F6B49;
  --sage-dark: #335739;

  --warn: #F2E6D7;
  --warn-ink: #6A4A24;
  --focus: #4A7BA7;
  --slate: #333333;

  --shadow-soft: 0 2px 8px rgba(47, 58, 51, 0.05);
  --shadow-lift: 0 10px 18px -4px rgba(47, 58, 51, 0.1), 0 4px 8px -4px rgba(47, 58, 51, 0.06);
  --shadow-pop: 0 12px 32px rgba(47, 58, 51, 0.16);

  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 14px;

  --sans: "DM Sans", "Avenir Next", "Segoe UI", system-ui, sans-serif;

  /* 400ms is the template's signature hover duration. Slower than typical,
     and most of why it feels unhurried. */
  --ease: cubic-bezier(0, 0, 0.2, 1);
  --hover: 400ms var(--ease);

  --gutter: clamp(16px, 4vw, 48px);
  --shell: 1240px;
}

html { scroll-behavior: smooth; }

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

a { color: var(--sage-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }

/* --- Type scale ----------------------------------------------------------
   Headings are small and light; the uppercase kicker above them does the
   structural work. That inversion is the template's whole character. */

h1, h2, h3 {
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.18;
  color: var(--ink);
}

h1 { font-size: clamp(1.75rem, 3.2vw, 2.25rem); margin: 0 0 0.5rem; }
h2 { font-size: 1.3125rem; margin: 2rem 0 0.625rem; }
h3 { font-size: 1.0625rem; font-weight: 400; margin: 1.5rem 0 0.5rem; }

.kicker,
.intro-kicker,
.field-label,
.card-kicker {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

.lead {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.65;
}

.quiet, .count, .meta, .empty { color: var(--muted); }
.meta { margin: 0 0 4px; font-size: 0.8125rem; }
.count { font-size: 0.8125rem; letter-spacing: 0.02em; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 60;
  background: var(--card);
  padding: 8px 12px;
  border-radius: var(--r-md);
}
.skip:focus { top: 12px; }

/* --- Scroll reveal -------------------------------------------------------
   Matches the template's framer-motion fade-up: 30px, 800ms, fires once. */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 800ms var(--ease), transform 800ms var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Header -------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(252, 252, 252, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 300ms var(--ease);
}

.site-header.is-stuck { box-shadow: var(--shadow-soft); }

.header-inner, main {
  width: min(var(--shell), calc(100% - (var(--gutter) * 2)));
  margin: 0 auto;
}

.header-inner { padding: 14px 0 0; }

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
  transition: transform var(--hover);
}
.brand:hover { color: var(--ink); transform: scale(1.02); }

/* Was a 36px circle with a sage-pale fill, which suited the old badge because
   the badge was itself a circle. The mark is now a squarish drawing -- the dog
   plus the table of supplies in front of him -- so a round crop takes the
   corners off the palette and the glue bottles. The frame is left open, and the
   whole thing is given a few more pixels, because the drawing has a lot more in
   it than the badge did and needs the room to stay legible. */
.logo-frame {
  width: 44px;
  height: 44px;
  flex: none;
}
.logo { width: 100%; height: 100%; object-fit: contain; }

.word {
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* --- Search band --------------------------------------------------------- */

.find-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  padding: 16px 0 2px;
}

.search-cluster {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  padding: 5px 16px 5px 5px;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 300ms var(--ease), border-color 300ms var(--ease);
}
.search-cluster:focus-within { border-color: var(--sage); box-shadow: var(--shadow-lift); }

.find-form {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 2px;
}

.search-divider {
  flex: none;
  width: 1px;
  align-self: stretch;
  margin: 12px 14px 12px 6px;
  background: var(--line);
}

.offer-menu { position: relative; flex: none; }

.offer-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 18px;
  list-style: none;
  cursor: pointer;
  background: var(--sage-pale);
  color: var(--ink);
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background var(--hover);
}
.offer-menu summary:hover { background: #E4EDE7; }
.offer-menu summary::-webkit-details-marker { display: none; }
.offer-menu .chevron { display: block; transition: transform 300ms var(--ease); }
.offer-menu[open] .chevron { transform: rotate(180deg); }

.offer-panel, .location-panel, .account-panel {
  position: absolute;
  z-index: 40;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
}

.offer-panel {
  top: calc(100% + 10px);
  left: 0;
  min-width: 230px;
  padding: 6px;
}

.offer-panel button {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: background var(--hover);
}
.offer-panel button:hover { background: var(--sage-pale); }

.top-search {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 46px;
  padding: 0 4px 0 6px;
}

.top-search input[type="search"] {
  width: 100%;
  border: 0;
  background: transparent;
  min-height: 46px;
  padding: 8px 0;
  font-size: 0.9375rem;
  font-weight: 400;
}
.top-search input[type="search"]:focus { outline: none; }
.top-search input::placeholder { color: var(--muted); }

.search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px;
  cursor: pointer;
  transition: color var(--hover);
}
.search-icon:hover { color: var(--sage-deep); }

.location-picker { position: relative; flex: none; }

.location-picker summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 2px 6px 6px;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
  transition: opacity var(--hover);
}
.location-picker summary:hover { opacity: 0.6; }
.location-picker summary svg { color: var(--sage-deep); }
.location-picker summary::-webkit-details-marker { display: none; }

.location-panel {
  top: calc(100% + 10px);
  right: 0;
  left: auto;
  width: min(300px, calc(100vw - 32px));
  display: grid;
  gap: 14px;
  padding: 18px;
}
.location-panel form { display: grid; gap: 14px; }
.location-panel .quiet { font-size: 0.75rem; margin: 0; }

.account-menu { position: relative; }
.account-menu summary { list-style: none; cursor: pointer; }
.account-menu summary::-webkit-details-marker { display: none; }

.account-panel {
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  display: grid;
  gap: 2px;
  padding: 6px;
}

.account-panel a, .account-panel .linkish {
  display: block;
  padding: 9px 12px;
  border-radius: var(--r-md);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.875rem;
  text-align: left;
  transition: background var(--hover);
}
.account-panel a:hover, .account-panel .linkish:hover { background: var(--sage-pale); color: var(--ink); }
.account-panel form { margin: 0; }
.account-panel .linkish { width: 100%; }

/* --- Category row -------------------------------------------------------- */

.cat-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 0;
}

.cat-links {
  display: flex;
  align-items: center;
  gap: 30px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 2px;
}

.mode-pill, .cat-link {
  flex: none;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.mode-pill {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  transition: background var(--hover), border-color var(--hover), color var(--hover);
}
.mode-pill:hover { background: var(--sage-pale); border-color: var(--sage); color: var(--ink); }

.mode-pill.is-on {
  background: var(--sage-deep);
  border-color: var(--sage-deep);
  color: #fff;
}
.mode-pill.is-on:hover { background: var(--sage-dark); border-color: var(--sage-dark); color: #fff; }

.cat-link {
  padding: 8px 0;
  border-bottom: 1px solid transparent;
  transition: opacity var(--hover), border-color var(--hover);
}
.cat-link:hover { opacity: 0.6; color: var(--ink); }
.cat-link.is-on { border-bottom-color: var(--sage-deep); color: var(--sage-deep); }

.cat-divider {
  flex: none;
  align-self: stretch;
  width: 1px;
  margin: 8px 2px;
  background: var(--line);
}

/* --- Buttons ------------------------------------------------------------- */

.button, button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--sage-deep);
  color: #fff;
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--hover), color var(--hover), border-color var(--hover);
}
.button:hover { background: var(--sage-dark); color: #fff; }

.header-actions .button { min-height: 36px; padding: 8px 16px; gap: 6px; }

.button.button-post { background: var(--sage-deep); color: #fff; }
.button.button-post:hover { background: var(--sage-dark); }

.button.button-outline {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}
.button.button-outline:hover { background: var(--sage-pale); border-color: var(--sage); color: var(--ink); }

/* Retained so older markup keeps working; now a plain secondary. */
.button.button-gold { background: var(--sage-deep); color: #fff; }
.button.button-gold:hover { background: var(--sage-dark); }

.button.button-quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.button.button-quiet:hover { background: var(--sunk); }

.text-link, .linkish {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.875rem;
  transition: opacity var(--hover);
}
.text-link:hover, .linkish:hover { opacity: 0.6; color: var(--ink); }

.linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.pip {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--sage-deep);
  color: #fff;
  font-size: 0.6875rem;
  letter-spacing: 0;
  text-align: center;
}

/* --- Forms --------------------------------------------------------------- */

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

input, select, textarea {
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  min-height: 42px;
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}

input:focus, select:focus, textarea:focus {
  background: var(--card);
  border-color: var(--sage);
}

input::placeholder, textarea::placeholder { color: var(--muted); }

textarea { min-height: 96px; resize: vertical; line-height: 1.55; }

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
}

.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.875rem;
  letter-spacing: normal;
  text-transform: none;
}
.check input { min-height: auto; width: 1.05rem; height: 1.05rem; accent-color: var(--sage-deep); }

.stack { display: flex; flex-direction: column; gap: 18px; }
.stack label { flex: 1; }

/* Groups a question with its own answers, so the offer / ISO radios read as
   one choice rather than two loose checkboxes mid-form. */
.kind-field { display: flex; flex-direction: column; gap: 10px; }
.kind-field .field-label { margin: 0; }
.kind-field[hidden] { display: none; }

/* --- Listing photo picker ------------------------------------------------ */

.photo-field {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--sunk);
}
.photo-field .field-label { margin: 0 0 12px; }

.photo-grid {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.photo-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-preview img[hidden] { display: none; }

.photo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}
/* display:flex outranks the hidden attribute's default display:none, so the
   placeholder needs its own rule or it keeps sitting next to the preview. */
.photo-empty[hidden] { display: none; }

.photo-controls { display: grid; gap: 10px; justify-items: start; }
.photo-controls .quiet { margin: 0; }
.photo-controls .check { margin-top: 2px; }

/* The real input is driven by the label, so it is kept reachable by keyboard
   rather than display:none, and the span beside it carries the button look. */
.photo-pick { display: inline-block; cursor: pointer; }
.photo-pick input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.photo-pick .button { cursor: pointer; }
.photo-pick input:focus-visible + .button,
.photo-pick:hover .button { border-color: var(--sage-deep); color: var(--sage-deep); }
.photo-pick input:focus-visible + .button { outline: 2px solid var(--focus); outline-offset: 2px; }

.quiet.is-bad { color: var(--warn-ink); }

@media (max-width: 560px) {
  .photo-grid { grid-template-columns: 1fr; }
  .photo-preview { max-width: 220px; }
}

.narrow { max-width: 440px; margin-inline: auto; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* --- Chips & badges ------------------------------------------------------
   Deliberately square (4px) against all the rounded elements around them. */

.badges, .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  background: var(--sunk);
  color: var(--ink);
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-free { background: var(--sage-pale); color: var(--sage-dark); }
.badge-price { background: var(--sunk); color: var(--ink); }
.badge-warn { background: var(--warn); color: var(--warn-ink); }
.badge-plain { background: var(--sunk); color: var(--ink); }

.id-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 7px;
  border-radius: var(--r-sm);
  background: var(--sunk);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* --- Page intro ---------------------------------------------------------- */

main { padding: 36px 0 72px; }

.intro {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
  max-width: 40rem;
}
.intro > * { margin: 0; }
.intro h1 { font-size: clamp(1.75rem, 3.2vw, 2.25rem); }
.intro p:not(.intro-kicker) {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.6;
  max-width: 34rem;
}

.feed-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.feed-bar p { margin: 0; }

/* --- Listing grid -------------------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 300ms var(--ease), box-shadow 300ms var(--ease);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.card-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  color: inherit;
  text-decoration: none;
}

.card-shot {
  position: relative;
  height: 190px;
  overflow: hidden;
  background: var(--sunk);
  flex: none;
}

.card-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms var(--ease);
}
.card:hover .card-shot img { transform: scale(1.05); }

/* Photos and drawn swatches fill their box and are cropped to it, which is what
   both are for. The corgi placeholder is a square line drawing on a transparent
   ground, so cropping it to a wide card would show a zoomed-in band of its
   middle. It is fitted whole and centred instead. Because the drawing has no
   background of its own, the tile's own tint shows through the space around it,
   so the box still reads as filled rather than letterboxed. */
.card-shot img.art-placeholder,
.detail-shot img.art-placeholder {
  object-fit: contain;
  padding: 16px;
  background: var(--sunk);
}
/* Nudging the placeholder on hover only draws the eye to the one tile with
   nothing in it, so the zoom stays with real pictures. */
.card:hover .card-shot img.art-placeholder { transform: none; }

/* Glass tag, the template's recurring recipe: white wash + blur + light rule. */
.card-flag {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--sage-dark);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* An ISO card is a want ad sitting in a grid of things you can actually take,
   so its flag is filled rather than translucent -- enough to tell the two
   apart at a glance without adding a second visual language. */
/* --- Pickup area map ----------------------------------------------------- */

.map-area { margin-bottom: 8px; }
.map-canvas {
  height: 260px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  /* Shows through before the tiles land, so the block does not flash white. */
  background: var(--sage-pale);
}
.map-note { margin-top: 10px; }
/* Leaflet ships its own type and chrome; pull both back to the site's. */
.map-canvas.leaflet-container { font: inherit; }
.map-canvas .leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.86);
  font-size: 0.625rem;
  color: var(--muted);
}
.map-canvas .leaflet-bar a {
  color: var(--ink);
  border-bottom-color: var(--line);
}

/* Trade sits between the two: tinted, so it is not mistaken for Free, but
   not filled, so it is not mistaken for a want ad. */
.card-flag-trade { background: var(--sage-pale); color: var(--sage-deep); }

.card-flag-iso {
  background: var(--sage-deep);
  color: #fff;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  padding: 20px;
}

.card-kicker { font-size: 0.625rem; letter-spacing: 0.08em; }

.card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.card-where {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
}
.card-where svg { flex: none; color: var(--sage); }

.card-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.price {
  font-size: 1.25rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
/* Free and in-search-of are both "no amount here", so they share the price
   slot's size and weight and differ only in colour. Giving ISO its own
   smaller, bolder treatment made it read as a third kind of thing sitting in
   a row that only has two. */
.price.is-free,
.price.is-trade,
.price.is-iso { color: var(--sage-deep); }

.price-note { color: var(--muted); font-size: 0.75rem; margin-left: 2px; }

.card-go {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--sage-deep);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: gap var(--hover);
}
.card:hover .card-go { gap: 8px; }

/* The save control floats above the card link so it stays clickable. */
.save-form {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

/* A paw on a small white chip. The chip is what keeps it legible over any
   photo; the paw alone disappeared against busy or dark pictures. */
.save-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--sage-deep);
  cursor: pointer;
  line-height: 0;
  box-shadow: 0 1px 4px rgba(47, 58, 51, 0.18);
  transition: transform 200ms var(--ease), background 200ms var(--ease);
}

.paw {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}
.save-mark.is-saved .paw { fill: currentColor; }
.save-mark:hover { transform: translateY(-2px); background: #fff; }
.save-mark[disabled] { cursor: progress; }

/* A small pop so the in-place toggle still reads as "that did something". */
.save-mark.just-changed .paw { animation: save-pop 0.34s var(--ease); }

@keyframes save-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .card:hover { transform: none; }
  .card:hover .card-shot img { transform: none; }
  .save-mark:hover { transform: none; }
}

.photo-placeholder {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  margin: 0;
  background: var(--sunk);
}
.photo-placeholder img { width: 86%; height: 86%; object-fit: contain; }

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

.crumb { margin: 0 0 18px; font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; }
.crumb a { color: var(--muted); text-decoration: none; transition: opacity var(--hover); }
.crumb a:hover { opacity: 0.6; color: var(--muted); }

.detail {
  display: grid;
  gap: 32px;
  align-items: start;
}

.detail-shot {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--sunk);
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  /* Keeps a wide column from turning the swatch into a billboard. */
  max-height: 430px;
}
.detail-shot img { width: 100%; height: 100%; object-fit: cover; }

.detail-buy {
  display: flex;
  flex-direction: column;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}
.detail-buy h1 { margin: 8px 0 10px; font-size: clamp(1.5rem, 2.4vw, 1.875rem); }
.detail-buy h2 { margin: 22px 0 12px; font-size: 1rem; }
.detail-buy > :first-child { margin-top: 0; }
.detail-buy .callout { margin: 16px 0 0; }
.detail-buy .reply-form { width: 100%; }

.detail-main > :first-child { margin-top: 0; }
.detail-main p { font-weight: 300; line-height: 1.7; }

.price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 16px 0 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.price-row .price { font-size: 1.875rem; }

.spec-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 0;
  padding: 0;
}
.spec-list div { display: grid; gap: 4px; }
.spec-list dt {
  color: var(--muted);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.spec-list dd { margin: 0; font-size: 0.9375rem; }

.seller-card {
  display: grid;
  gap: 6px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}
.seller-card p { margin: 0; }
.seller-card .seller-name { font-size: 1rem; font-weight: 400; }

.actions, .split {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 22px;
}

/* Off the card, the bookmark is a normal inline control again. */
.actions .save-form { position: static; }
.actions .save-mark { width: 42px; height: 42px; border: 1px solid var(--line); box-shadow: none; }

/* --- Panels, notices ----------------------------------------------------- */

.sheet, .prose {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px 22px;
  box-shadow: var(--shadow-soft);
}

.prose { max-width: 46rem; }
.prose p, .prose li { font-weight: 300; line-height: 1.7; }
.prose > :first-child { margin-top: 0; }

.callout, .errors, .flashes { list-style: none; padding: 0; }

.callout, .flash, .errors {
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin: 14px 0;
  font-size: 0.875rem;
}

.callout p { margin: 0 0 6px; }
.callout p:last-child { margin-bottom: 0; }

.flash-error, .errors {
  background: #F7E8E3;
  color: #6E2E24;
  border-color: #E8CDC4;
}

.flash-success {
  background: var(--sage-pale);
  color: var(--sage-dark);
  border-color: #D5E4DA;
}

.errors { padding-left: 28px; list-style: disc; }
.flashes { margin: 0 0 20px; }

.contact-head {
  max-width: 32rem;
  margin: 0 auto 28px;
  text-align: center;
}
.contact-head h1 { margin: 10px 0 10px; }
.contact-head p:last-child { color: var(--muted); font-weight: 300; margin: 0; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 32rem;
  margin: 0 auto;
}
.contact-form label { display: flex; flex-direction: column; gap: 10px; }
.contact-form textarea { resize: vertical; }

.contact-notes {
  max-width: 32rem;
  margin: 26px auto 0;
  color: var(--muted);
  font-size: 0.875rem;
}

/* --- Messages ------------------------------------------------------------ */

.thread-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }

.thread-row a {
  display: grid;
  gap: 5px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: var(--ink);
  transition: border-color var(--hover), box-shadow var(--hover);
}
.thread-row a:hover { border-color: var(--sage); box-shadow: var(--shadow-soft); color: var(--ink); }
.thread-row.is-unread a { border-left: 3px solid var(--sage-deep); }

.thread-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.thread-top .quiet { margin-left: auto; font-size: 0.8125rem; }
.thread-title { font-size: 0.8125rem; color: var(--muted); }
.thread-snip {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-weight: 300;
}

.chat { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }

.bubble {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 0.9375rem;
}

.bubble.is-mine {
  margin-left: auto;
  background: var(--sage-pale);
  border-color: #D5E4DA;
}

.bubble > * { margin: 0; }
.bubble-who { font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.bubble-body { white-space: pre-wrap; overflow-wrap: anywhere; }

.reply-form { display: grid; gap: 14px; justify-items: start; }
.reply-form label { width: 100%; }

.quick-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }

.quick-chip {
  font: inherit;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-height: 34px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: background var(--hover), border-color var(--hover);
}
.quick-chip:hover { border-color: var(--sage); background: var(--sage-pale); }

/* --- Footer -------------------------------------------------------------- */

.site-footer {
  margin-top: 80px;
  padding: clamp(56px, 7vw, 80px) 0 28px;
  background: var(--slate);
  color: rgba(252, 252, 252, 0.7);
  font-size: 0.875rem;
  font-weight: 300;
}

.footer-inner, .footer-base {
  width: min(var(--shell), calc(100% - (var(--gutter) * 2)));
  margin: 0 auto;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.footer-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* Square and unclipped, to match the header: the mark is a drawing with
   corners, not a round badge. */
.footer-mark img { width: 34px; height: 34px; object-fit: contain; }

.footer-brand p {
  margin: 0;
  max-width: 24rem;
  font-size: 0.875rem;
  line-height: 1.7;
}

.site-footer h4 {
  margin: 0 0 18px;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.site-footer a {
  color: rgba(252, 252, 252, 0.7);
  text-decoration: none;
  transition: color var(--hover);
}
.site-footer a:hover { color: #fff; }

.footer-pages {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
  font-size: 0.875rem;
}
.footer-contact a { display: inline-flex; align-items: center; gap: 8px; }
.footer-contact p { margin: 0; }

.footer-social { display: flex; align-items: center; gap: 18px; }
.footer-social a { display: inline-flex; transition: opacity var(--hover); }
.footer-social a:hover { opacity: 0.6; }

.footer-base {
  margin-top: clamp(40px, 6vw, 56px);
  padding-top: 28px;
  border-top: 1px solid rgba(252, 252, 252, 0.2);
  color: rgba(252, 252, 252, 0.55);
  font-size: 0.75rem;
  line-height: 1.7;
  text-align: center;
}
.footer-base p { margin: 0 0 8px; }
.footer-base p:last-child { margin-bottom: 0; }
.footer-base a { color: rgba(252, 252, 252, 0.7); text-decoration: underline; }

/* --- Landing hero -------------------------------------------------------- */

.landing-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px var(--gutter);
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform var(--hover);
}
.landing-brand:hover { color: #fff; transform: scale(1.02); }
.landing-brand img { width: 36px; height: 36px; object-fit: contain; }

.landing-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
}

.landing-links a {
  color: #fff;
  text-decoration: none;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: opacity var(--hover);
}
.landing-links a:hover { opacity: 0.6; color: #fff; }

.landing-cta {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  transition: background var(--hover), border-color var(--hover);
}
.landing-cta:hover {
  background: rgba(167, 190, 178, 0.85);
  border-color: rgba(167, 190, 178, 0.85);
  opacity: 1 !important;
}

/* A band rather than the whole first screen, so the listings start above the
   fold. The floor is what the headline, line and button need to sit under the
   nav without colliding; the ceiling stops a tall monitor turning the band back
   into a full-screen wall. */
.hero {
  position: relative;
  height: 62svh;
  min-height: 480px;
  max-height: 680px;
  overflow: hidden;
}

/* Blends the last sliver of photo into the paper the app sits on. */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 90px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(252, 252, 252, 0) 0%, var(--paper) 100%);
}

.hero-stage { position: absolute; inset: 0; will-change: transform; }
.hero-words, .hero-scroll { will-change: transform, opacity; }

.hero-shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}
.hero-shot.is-on { opacity: 1; }

/* Two layers. The vertical one was all there was when the backdrops were
   dark, even landscapes. The craft photos are bright, busy tabletops, and the
   small line under the headline got lost in them -- so a second gradient
   darkens only the left side, where the words sit, and leaves the right of
   each photo at full brightness. */
.hero-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.26) 40%, rgba(0, 0, 0, 0) 68%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.38) 0%, rgba(0, 0, 0, 0.2) 45%, rgba(0, 0, 0, 0.55) 100%);
}

.hero-words {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(74px, 12vh, 132px);
  z-index: 2;
  max-width: 36rem;
  color: #fff;
}

.hero-words h1 {
  display: flex;
  flex-direction: column;
  font-weight: 300;
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: #fff;
  margin: 0 0 16px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.3);
}

.hero-words p {
  margin: 0 0 26px;
  font-size: clamp(0.9375rem, 1.6vw, 1.0625rem);
  font-weight: 300;
  max-width: 28rem;
  color: rgba(255, 255, 255, 0.92);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 12px 24px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background var(--hover), color var(--hover);
}
.hero-cta:hover { background: rgba(255, 255, 255, 0.88); color: var(--ink); }

.hero-bars {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 34px;
  z-index: 2;
  display: flex;
  gap: 8px;
}

.hero-bar {
  flex: 1;
  height: 2px;
  padding: 0;
  border: 0;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  overflow: hidden;
}

/* Full width, scaled down to zero and grown from the left. Driven by
   transform rather than width so the progress bar costs no layout. */
.hero-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
}

.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 54px;
  z-index: 2;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: hero-nudge 2.4s ease-in-out infinite;
}
.hero-scroll:hover { background: rgba(167, 190, 178, 0.85); border-color: rgba(167, 190, 178, 0.85); color: #fff; }

@keyframes hero-nudge {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-scroll { animation: none; }
  .hero-shot { transition: none; }
}

/* --- Breakpoints --------------------------------------------------------- */

/* Below this the three controls cannot share one line without crushing the
   input to nothing, so the pill becomes two rows: the search field gets the
   full width, and the two filters split the row underneath it. */
@media (max-width: 660px) {
  .search-cluster {
    flex-wrap: wrap;
    border-radius: var(--r-xl);
    padding: 8px 12px;
    gap: 2px 10px;
  }
  .find-form { flex: 1 1 100%; order: 1; }
  .search-divider { display: none; }
  .offer-menu { order: 2; flex: 0 1 auto; }
  .location-picker {
    order: 3;
    flex: 0 1 auto;
    margin-left: auto;
  }
  .offer-menu summary { min-height: 38px; padding: 7px 14px; }
  .location-picker summary { min-height: 38px; }
  /* Both filters now sit low enough that a left-anchored panel would run off
     the right edge, so each opens back toward the middle. */
  .offer-panel { left: 0; right: auto; min-width: 0; width: min(230px, 60vw); }
  .location-panel { right: 0; left: auto; }
}

@media (min-width: 640px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .sheet, .prose { padding: 32px; }
}

@media (min-width: 900px) {
  .detail {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 32px 40px;
  }
  .detail-shot { grid-column: 1; grid-row: 1; }
  .detail-main { grid-column: 1; grid-row: 2; }
  .detail-buy {
    grid-column: 2;
    grid-row: 1 / span 2;
    position: sticky;
    top: var(--sticky-top, 24px);
    align-self: start;
  }
}

@media (min-width: 1040px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1360px) {
  .cards { grid-template-columns: repeat(4, 1fr); }
}
