/*
 * Porchlot styles: the "Postmark Postcard" design system (DESIGN.md).
 * Plain CSS with no build step (ARCHITECTURE §5.1). Mobile-first.
 *
 * Every item is a picture postcard; the sale's place is a postmark, a round
 * mark that names a neighbourhood without an address. Cobalt owns the header
 * (a street map), postal navy carries text, white postcards sit on a cool
 * card-stock ground. State is shown by line form as well as colour.
 */

/* The one typeface, self-hosted (static/vendor/fonts/README.md). A variable
   font: weight 200–800, width 75–100%; headings use the condensed widths. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../vendor/fonts/bricolage-grotesque-latin.477b564b86e0.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Colour: every text pairing is checked against WCAG AA (DESIGN.md). */
  --c-cobalt: #1a3fb4;      /* header ground, primary actions, links, focus */
  --c-cobalt-deep: #132f8c; /* primary hover, pressed */
  --c-navy: #0c1d4f;        /* text, headings, prices */
  --c-on-cobalt: #dfe6fb;   /* secondary text on cobalt (7:1) */
  --c-tint: #e4eafb;        /* selected and info grounds, photo mat */
  --c-ground: #f2f5fc;      /* page ground: cool card stock */
  --c-card: #ffffff;        /* postcards and panels */
  --c-rule: #d5dcee;        /* decorative dividers and card edges */
  --c-border: #6f7fa6;      /* input and control borders (4:1 on white) */
  --c-soft: #46557d;        /* secondary text (7:1 on the ground) */
  --c-error: #b3261e;
  --c-error-bg: #fdf1f0;
  --c-ok: #1d6b3a;
  --c-ok-bg: #eef7f1;
  --c-disabled-bg: #e9edf6;
  --c-disabled-text: #5b6889;

  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Type ramp: importance steps along it, never between it. */
  --fs-12: 0.75rem;
  --fs-14: 0.875rem;
  --fs-16: 1rem;
  --fs-18: 1.125rem;
  --fs-22: 1.375rem;
  --fs-28: 1.75rem;
  --fs-36: 2.25rem;
  --fs-56: 3.5rem;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 56px;
  --gutter: 16px;
  --tap: 44px;
  --r-card: 8px;   /* postcards and panels */
  --r-photo: 4px;  /* photos inside a postcard */
  --r-control: 8px;
  /* Postcards rest a millimetre above the table; a dragged card lifts. */
  --lift-rest: 0 1px 2px rgba(12, 29, 79, 0.08), 0 8px 20px -12px rgba(12, 29, 79, 0.28);
  --lift-drag: 0 2px 6px rgba(12, 29, 79, 0.12), 0 24px 48px -16px rgba(12, 29, 79, 0.45);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 860px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--c-border) var(--c-ground); }
body {
  margin: 0;
  font: 400 var(--fs-16)/1.5 var(--font);
  color: var(--c-navy);
  background: var(--c-ground);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, figure { margin: 0; }
img { max-width: 100%; display: block; }
a { color: var(--c-cobalt); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: var(--c-cobalt); color: #fff; }
:focus-visible { outline: 3px solid var(--c-cobalt); outline-offset: 2px; border-radius: 2px; }
.masthead :focus-visible { outline-color: #fff; }
input, select, textarea, button { font: inherit; color: inherit; }
input, textarea { caret-color: var(--c-cobalt); }
textarea { resize: vertical; }
[hidden] { display: none !important; }

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

/* ---------- Masthead: cobalt, with a drawn street map ---------- */
.skip-link {
  position: absolute; left: var(--s-4); top: -60px; z-index: 40;
  background: var(--c-card); color: var(--c-navy); padding: var(--s-2) var(--s-4); border-radius: var(--r-control); font-weight: 700;
}
.skip-link:focus { top: var(--s-2); }

.masthead {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--c-cobalt) url("../img/streets.e763de9e3219.svg") center / cover no-repeat; color: #fff;
}
.masthead__bar {
  position: relative; max-width: 1200px; margin: 0 auto; padding: var(--s-3) var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 56px;
}
.brand {
  display: inline-flex; align-items: center; gap: var(--s-2);
  color: #fff; font-weight: 800; font-size: var(--fs-18); letter-spacing: -0.01em; text-decoration: none; white-space: nowrap;
}
.brand::before {
  content: ""; width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 2.5px solid currentColor; box-shadow: inset 0 0 0 4px var(--c-cobalt), inset 0 0 0 6px currentColor;
}
.masthead__meta { color: var(--c-on-cobalt); font-size: var(--fs-14); display: flex; gap: var(--s-4); align-items: center; min-width: 0; }
.masthead__meta a { color: #fff; white-space: nowrap; }
.masthead__meta form { margin: 0; }
.masthead__email { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 479px) { .masthead__email { display: none; } }

.masthead__title { position: relative; max-width: 1200px; margin: 0 auto; padding: var(--s-4) var(--gutter) var(--s-8); }
.masthead__title h1 {
  font-size: var(--fs-36); line-height: 0.98; letter-spacing: -0.02em; font-weight: 800; font-stretch: 78%;
  text-wrap: balance; max-width: 22ch;
}
.masthead__title p { color: var(--c-on-cobalt); margin-top: var(--s-3); max-width: 60ch; }
.masthead__title a { color: #fff; }
.masthead__crumb { font-size: var(--fs-14); margin: 0 0 var(--s-2); }
.masthead__title .masthead__crumb { margin-top: 0; }
@media (min-width: 860px) {
  .masthead__title { padding-top: var(--s-6); padding-bottom: var(--s-10); }
  .masthead__title h1 { font-size: var(--fs-56); letter-spacing: -0.03em; }
}

/* A form button that looks like a masthead link (sign out must be a POST). */
.link-button {
  border: 0; background: none; padding: 0; color: #fff; cursor: pointer; white-space: nowrap;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.link-button:hover { text-decoration-thickness: 2px; }

/* ---------- The postmark (templates/includes/postmark.html) ---------- */
.postmark { position: relative; display: inline-grid; place-items: center; width: 132px; height: 132px; color: #fff; flex: none; }
.postmark__ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.postmark__arc { font: 700 8.6px/1 var(--font); letter-spacing: 0.14em; fill: currentColor; }
.postmark__name {
  position: relative; max-width: 74px; text-align: center; font-weight: 800; font-stretch: 80%;
  font-size: var(--fs-16); line-height: 1.02; overflow-wrap: anywhere;
}
.postmark__cancel { position: absolute; right: 92%; top: 50%; width: 150px; height: 54px; transform: translateY(-50%); }
.postmark--sm { width: 92px; height: 92px; color: var(--c-cobalt); }
.postmark--sm .postmark__name { max-width: 52px; font-size: var(--fs-12); }
.postmark--sm .postmark__arc { font-size: 8px; }

/* ---------- Page layout ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: var(--s-6) var(--gutter) var(--s-12); }
.page--narrow { max-width: 680px; }
main:focus { outline: none; }

.panel { background: var(--c-card); border: 1px solid var(--c-rule); border-radius: var(--r-card); padding: var(--s-5); box-shadow: var(--lift-rest); }
.panel + .panel { margin-top: var(--s-4); }
.stack > * + * { margin-top: var(--s-4); }
.stack-sm > * + * { margin-top: var(--s-2); }
.section-title { font-size: var(--fs-22); font-weight: 800; font-stretch: 85%; letter-spacing: -0.01em; color: var(--c-navy); line-height: 1.15; margin-top: var(--s-8); margin-bottom: var(--s-3); }
.muted { color: var(--c-soft); }
.small { font-size: var(--fs-14); }
.messages { margin-bottom: var(--s-4); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--tap); padding: 0 var(--s-5); border-radius: var(--r-control);
  border: 2px solid var(--c-cobalt); background: var(--c-cobalt); color: #fff;
  font-weight: 700; font-size: var(--fs-16); line-height: 1.1; text-decoration: none; cursor: pointer;
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.btn:hover { background: var(--c-cobalt-deep); border-color: var(--c-cobalt-deep); }
.btn:active { transform: translateY(1px); }
.btn--secondary { background: var(--c-card); color: var(--c-cobalt); }
.btn--secondary:hover { background: var(--c-tint); border-color: var(--c-cobalt); }
.btn--quiet { background: transparent; border-color: transparent; color: var(--c-cobalt); padding: 0 var(--s-2); }
.btn--quiet:hover { background: var(--c-tint); border-color: var(--c-tint); }
.btn--block { width: 100%; }
.btn[aria-disabled="true"], .btn:disabled {
  background: var(--c-disabled-bg); border-color: var(--c-disabled-bg); color: var(--c-disabled-text); cursor: not-allowed; transform: none;
}
.btn[aria-busy="true"]::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }
/* The one call to action on cobalt: white ground, navy text. */
.btn--on-navy { background: #fff; border-color: #fff; color: var(--c-navy); }
.btn--on-navy:hover { background: var(--c-tint); border-color: var(--c-tint); }
.masthead__title .btn--on-navy { color: var(--c-navy); }
/* Destructive or final seller actions stand apart, with room around them. */
.btn--apart { margin-top: var(--s-6); }

/* ---------- Forms ---------- */
.field + .field { margin-top: var(--s-5); }
.field label, .field .label { display: block; font-weight: 700; font-size: var(--fs-14); margin-bottom: 6px; }
.field .opt { font-weight: 400; color: var(--c-soft); }
.hint { color: var(--c-soft); font-size: var(--fs-14); margin-top: var(--s-1); }
.input {
  width: 100%; min-height: 48px; padding: 10px 14px; background: var(--c-card);
  border: 1.5px solid var(--c-border); border-radius: var(--r-control);
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.input:hover { border-color: var(--c-navy); }
.input:focus-visible { outline: none; border-color: var(--c-cobalt); box-shadow: 0 0 0 3px rgba(26, 63, 180, 0.28); }
.input::placeholder { color: #5d6a8c; }
textarea.input { min-height: 96px; }
.input[aria-invalid="true"] { border-color: var(--c-error); border-width: 2px; }
.field-error { color: var(--c-error); font-size: var(--fs-14); font-weight: 700; margin-top: var(--s-1); display: flex; gap: 6px; align-items: flex-start; }
.field-error__mark { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.input--code { font-size: var(--fs-28); font-weight: 700; letter-spacing: 0.35em; text-align: center; max-width: 260px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.row-2 .field + .field { margin-top: 0; }
.row-2 + .field, .field + .row-2 { margin-top: var(--s-5); }
.check { display: flex; gap: var(--s-3); align-items: flex-start; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--c-cobalt); flex: none; }
.privacy-label {
  display: inline-flex; gap: var(--s-1); align-items: center; color: var(--c-cobalt); font-size: var(--fs-12); font-weight: 700;
  border: 1.5px dashed var(--c-cobalt); border-radius: 999px; padding: 0 8px; margin-left: var(--s-2); vertical-align: 1px;
}
/* Disabled "coming soon" option (AC-01.9): a disabled native button keeps it out of
   pointer, keyboard, and assistive-technology activation while still being listed. */
.coming-soon {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  min-height: var(--tap); padding: 0 var(--s-4); border-radius: var(--r-control);
  border: 1.5px dashed var(--c-border); background: var(--c-disabled-bg); color: var(--c-disabled-text);
  font-weight: 700; cursor: not-allowed;
}

/* ---------- Messages ---------- */
.notice { border-radius: var(--r-card); padding: var(--s-3) var(--s-4); border: 1.5px solid; font-size: var(--fs-16); }
.notice strong { display: block; margin-bottom: 2px; }
.notice--error { border-color: var(--c-error); background: var(--c-error-bg); color: var(--c-error); }
.notice--error ul { margin: var(--s-1) 0 0; padding-left: var(--s-5); }
.notice--error a { color: var(--c-error); font-weight: 700; }
.notice--ok { border-color: var(--c-ok); background: var(--c-ok-bg); color: var(--c-ok); }
.notice--info { border-color: var(--c-cobalt); background: var(--c-tint); color: var(--c-navy); }
.notice:focus { outline: 3px solid var(--c-cobalt); outline-offset: 2px; }

/* ---------- Tags: state by line form as well as colour ---------- */
.tag {
  display: inline-block; font-size: var(--fs-12); font-weight: 700; letter-spacing: 0.01em;
  border: 1.5px solid currentColor; border-radius: 999px; padding: 0 8px; line-height: 1.6; white-space: nowrap;
}
.tag--draft { color: var(--c-soft); border-style: dashed; }
.tag--live { color: #fff; background: var(--c-cobalt); border-color: var(--c-cobalt); }
.tag--ready { color: var(--c-ok); }
.tag--needs { color: var(--c-error); white-space: normal; }
.masthead__title .tag--draft { color: var(--c-on-cobalt); }
.masthead__title .tag--live { background: #fff; color: var(--c-cobalt); border-color: #fff; }

/* ---------- Seller item list (workspace, your sales) ---------- */
/* A postcard per row: photo, name and state, price. */
.ads { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.ad {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: var(--s-3); align-items: center;
  padding: var(--s-2) var(--s-3) var(--s-2) var(--s-2); background: var(--c-card);
  border: 1px solid var(--c-rule); border-radius: var(--r-card); box-shadow: var(--lift-rest);
}
.ad__thumb { width: 64px; height: 64px; border-radius: var(--r-photo); background: var(--c-tint); color: var(--c-cobalt); display: grid; place-items: center; overflow: hidden; }
.ad__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ad__thumb svg { width: 55%; height: 55%; }
.ad__lead { display: block; font-weight: 700; font-size: var(--fs-16); line-height: 1.3; overflow-wrap: anywhere; text-wrap: pretty; }
.ad__detail { color: var(--c-soft); font-size: var(--fs-14); line-height: 1.4; margin-top: 2px; overflow-wrap: anywhere; }
.ad__meta { margin-top: var(--s-1); display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; font-size: var(--fs-14); }
.ad__price { font-size: var(--fs-22); font-weight: 800; font-stretch: 85%; text-align: right; line-height: 1.1; white-space: nowrap; }
.ad__price--missing { font-size: var(--fs-14); font-weight: 700; color: var(--c-error); }
.ad a.ad__edit { color: inherit; text-decoration: none; }
.ad a.ad__edit::after { content: ""; position: absolute; inset: 0; }
.ad:has(a.ad__edit) { position: relative; transition: border-color 160ms var(--ease-out); }
.ad:has(a.ad__edit):hover { border-color: var(--c-cobalt); }
.ad a.ad__edit:hover .ad__lead { text-decoration: underline; text-underline-offset: 3px; }
.ad a.ad__edit:focus-visible { outline: none; }
.ad:has(a.ad__edit:focus-visible) { outline: 3px solid var(--c-cobalt); outline-offset: 2px; }

.empty { text-align: center; padding: var(--s-10) var(--s-5); background: var(--c-card); border: 1.5px dashed var(--c-border); border-radius: var(--r-card); }
.empty strong { display: block; color: var(--c-navy); font-size: var(--fs-22); font-weight: 800; font-stretch: 85%; margin-bottom: var(--s-1); }

/* ---------- Seller workspace ---------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: grid; grid-template-columns: 30px 1fr; gap: var(--s-2); padding: var(--s-3) 0; border-bottom: 1px solid var(--c-rule); }
.checklist li:last-child { border-bottom: 0; }
.mark { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 2px dashed var(--c-border); color: var(--c-soft); margin-top: 1px; font-weight: 800; font-size: var(--fs-14); }
.mark--done { background: var(--c-ok); border: 2px solid var(--c-ok); color: #fff; }
.mark--bad { border: 2px solid var(--c-error); color: var(--c-error); }
.mark svg { width: 12px; height: 12px; }

.section-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); }
/* Workspace layout: a main column and a side panel from 860 px. On phones the
   side panel (what to do next) comes first, so it isn't below a long item list. */
@media (max-width: 859px) {
  .split:not(.split--left) { display: flex; flex-direction: column; gap: var(--s-6); }
  .split:not(.split--left) > aside { order: -1; }
  .split:not(.split--left) > .messages { order: -2; }
  .split:not(.split--left) > aside > .section-title:first-child { margin-top: 0; }
}
@media (min-width: 860px) {
  .split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s-8); align-items: start; }
  .sticky-side { position: sticky; top: calc(var(--s-5) + 52px); }
  .sticky-side > .section-title:first-child { margin-top: 0; }
}
.split > .messages { grid-column: 1 / -1; }

.share { display: flex; gap: var(--s-2); }
.share .input { flex: 1; min-width: 0; }

/* Photos (item editor) */
.field .photo-drop {
  display: grid; place-items: center; text-align: center; gap: var(--s-1); padding: var(--s-6) var(--s-4); margin: 0;
  border: 2px dashed var(--c-border); border-radius: var(--r-card); background: var(--c-card); cursor: pointer;
  transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.photo-drop:hover { border-color: var(--c-cobalt); background: var(--c-tint); }
.photo-drop strong { color: var(--c-cobalt); font-size: var(--fs-16); }
/* The file input is visually hidden; its focus is shown on the visible drop area. */
.field:has(input[type="file"]:focus-visible) .photo-drop { outline: 3px solid var(--c-cobalt); outline-offset: 2px; }
.photo-preview { display: grid; grid-template-columns: 120px 1fr; gap: var(--s-4); align-items: center; }
.photo-preview__img { width: 120px; height: 120px; border-radius: var(--r-photo); overflow: hidden; background: var(--c-tint); color: var(--c-cobalt); display: grid; place-items: center; border: 6px solid var(--c-card); box-shadow: var(--lift-rest); }
.photo-preview__img img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview__img svg { width: 60%; height: 60%; }
.progress { height: 8px; border-radius: 4px; background: var(--c-disabled-bg); overflow: hidden; margin-top: var(--s-2); }
.progress span { display: block; height: 100%; background: var(--c-cobalt); transition: width 180ms linear; }
.js-upload .upload__submit { display: none; }
.photo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); }

/* Pickup windows and slots */
.windows { list-style: none; margin: 0; padding: 0; }
.window { padding: var(--s-3) 0; border-bottom: 1px solid var(--c-rule); }
.window:last-child { border-bottom: 0; }
.window strong { color: var(--c-navy); }
.window__head { display: flex; justify-content: space-between; gap: var(--s-3); align-items: baseline; }
.slots { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); list-style: none; padding: 0; }
.slots li { font-size: var(--fs-14); }
.slots form { margin: 0; }
.slot-toggle {
  font: inherit; font-size: var(--fs-14); font-weight: 600; min-height: var(--tap); padding: 2px 12px; cursor: pointer;
  border: 1.5px solid var(--c-border); border-radius: 999px; background: var(--c-card); color: var(--c-navy);
}
.slot-toggle:hover { border-color: var(--c-cobalt); }
.slot--blocked .slot-toggle { background: var(--c-disabled-bg); color: var(--c-disabled-text); text-decoration: line-through; border-style: dashed; }

/* ---------- Storefront ---------- */
/* Header: the area map as a postcard laid on the cobalt street map, the
   postmark cancelling its corner; the title and sale facts beside it. */
.sale-head { position: relative; max-width: 1200px; margin: 0 auto; padding: var(--s-2) var(--gutter) var(--s-8); display: grid; gap: var(--s-5); }
.sale-head__text h1 { font-size: var(--fs-36); line-height: 0.98; letter-spacing: -0.02em; font-weight: 800; font-stretch: 78%; text-wrap: balance; }
.sale-head__text p { color: var(--c-on-cobalt); margin-top: var(--s-3); max-width: 56ch; }
.sale-facts { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-4) 0 0; padding: 0; list-style: none; }
.sale-facts li {
  font-size: var(--fs-14); font-weight: 700; color: #fff; padding: 5px 12px; border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
}
.area-map { position: relative; margin: 0; }
.area-map__frame {
  position: relative; background: #fff; padding: 6px; border-radius: var(--r-card);
  box-shadow: 0 2px 6px rgba(5, 14, 48, 0.25), 0 18px 36px -18px rgba(5, 14, 48, 0.6);
}
.area-map__img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-photo); background: var(--c-tint); }
/* No map (provider down): the frame keeps its place with the drawn street texture. */
.area-map--unavailable .area-map__frame::before {
  content: ""; display: block; aspect-ratio: 16 / 9; border-radius: var(--r-photo);
  background: var(--c-cobalt-deep) url("../img/streets.e763de9e3219.svg") center / cover no-repeat;
}
/* The postmark cancels the map's corner, its wavy lines running back over the map. */
/* Inked in cobalt on the map, like a cancel on a postcard; a pale backing
   keeps it legible over streets. */
.area-map .postmark, .sample .postmark { position: absolute; right: 12px; bottom: 12px; width: 104px; height: 104px; color: var(--c-cobalt); transform: rotate(-7deg); }
.area-map .postmark::before, .sample .postmark::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: rgba(255, 255, 255, 0.82); }
.area-map .postmark__name, .sample .postmark__name { font-size: var(--fs-14); max-width: 58px; }
.area-map .postmark__arc, .sample .postmark__arc { font-size: 8px; }
.area-map .postmark__cancel { width: 84px; height: 40px; opacity: 0.8; }
.area-map figcaption { margin-top: var(--s-3); color: var(--c-on-cobalt); font-size: var(--fs-14); max-width: 46ch; }
.area-map figcaption strong { display: block; color: #fff; font-size: var(--fs-16); }
/* Phones: the map is a strip, so the items arrive in the first screen; the
   address rule is repeated in the sticky band right below. */
@media (max-width: 859px) {
  .sale-head { gap: var(--s-4); padding-bottom: var(--s-5); }
  /* The map strip leads; the title sits under it, lower left. */
  .sale-head .area-map { order: -1; }
  .area-map__img, .area-map--unavailable .area-map__frame::before { aspect-ratio: 3.2 / 1; }
  .area-map .postmark { width: 92px; height: 92px; right: -6px; bottom: -26px; }
  .area-map .postmark__name { font-size: var(--fs-12); max-width: 50px; }
  /* The caption repeats the area named by the postmark and the sticky band:
     kept for screen readers only on phones. */
  .area-map figcaption { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sale-head__text p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: var(--s-2); font-size: var(--fs-14); }
  /* Facts as one line of text, not chips. */
  .sale-facts { margin-top: var(--s-2); gap: 0; }
  .sale-facts li { border: 0; padding: 0; font-size: var(--fs-14); }
  .sale-facts li + li::before { content: "·"; margin: 0 6px; color: var(--c-on-cobalt); }
}
@media (min-width: 860px) {
  .area-map figcaption { margin-top: var(--s-4); }
  .area-map .postmark { width: 124px; height: 124px; }
  .area-map .postmark__name { font-size: var(--fs-16); max-width: 70px; }
}
@media (min-width: 860px) {
  .sale-head { grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); align-items: center; gap: var(--s-10); padding-top: var(--s-2); padding-bottom: var(--s-8); }
  .sale-head__text h1 { font-size: var(--fs-56); letter-spacing: -0.03em; }
  .area-map__frame { transform: rotate(1.2deg); }
}

/* Sticky band: one message, the area and the address rule, while the list scrolls. */
.area-band { position: sticky; top: 0; z-index: 10; background: var(--c-card); border-bottom: 1px solid var(--c-rule); box-shadow: 0 6px 16px -14px rgba(12, 29, 79, 0.5); }
.area-band__inner { max-width: 1200px; margin: 0 auto; padding: 12px var(--gutter); display: flex; gap: var(--s-2); align-items: center; font-size: var(--fs-14); color: var(--c-navy); }
.area-band__inner svg { flex: none; color: var(--c-cobalt); }

/* Category filter: chips, server-side links (no script needed). */
.tabs { display: flex; gap: var(--s-2); overflow-x: auto; scrollbar-width: none; padding: 2px 2px var(--s-1); margin: 0 -2px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none; min-height: 40px; display: inline-flex; align-items: center; padding: 0 var(--s-4);
  border: 1.5px solid var(--c-rule); border-radius: 999px; background: var(--c-card);
  color: var(--c-navy); font-size: var(--fs-14); font-weight: 600; text-decoration: none;
  transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.tabs a:hover { border-color: var(--c-cobalt); }
.tabs a[aria-current="page"] { background: var(--c-navy); border-color: var(--c-navy); color: #fff; }
.tabs.can-scroll-right { mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
.tabs.can-scroll-left { mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); }
.tabs.can-scroll-left.can-scroll-right { mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); }

/* The postcard grid: photos lead. Every photo sits in the same 4:3 frame. */
.postcards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4) var(--s-3); }
/* Wider screens: as many columns as keep a card at least 210 px, whatever
   the side column takes: four beside the pickup panel at 1200 px. */
@media (min-width: 640px) { .postcards { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s-5) var(--s-4); } }
.postcard {
  position: relative; display: flex; flex-direction: column; height: 100%;
  background: var(--c-card); border: 1px solid var(--c-rule); border-radius: var(--r-card); padding: 6px 6px var(--s-3);
  color: var(--c-navy); text-decoration: none; box-shadow: var(--lift-rest); scroll-margin-top: 72px;
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out), border-color 220ms var(--ease-out);
}
a.postcard:hover { transform: translateY(-3px) rotate(-0.6deg); box-shadow: var(--lift-drag); border-color: #b9c5e6; }
a.postcard:active { transform: translateY(-1px); }
a.postcard:focus-visible { outline-offset: 3px; }
.postcard__photo { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: var(--r-photo); overflow: hidden; background: var(--c-tint); }
.postcard__photo img { width: 100%; height: 100%; object-fit: cover; }
/* The stamp corner carries one fact: how many photos the card holds. */
.postcard__stamp {
  position: absolute; top: 6px; right: 6px; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 7px; border-radius: 3px; background: #fff; color: var(--c-navy);
  font-size: var(--fs-12); font-weight: 700; outline: 1.5px dashed var(--c-cobalt); outline-offset: -4px;
}
.postcard__body { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s-2); align-items: baseline; padding: var(--s-2) var(--s-1) 0; }
.postcard__title { font-weight: 700; font-size: var(--fs-16); line-height: 1.25; overflow-wrap: anywhere; text-wrap: pretty; }
.postcard__price { font-weight: 800; font-size: var(--fs-22); font-stretch: 82%; line-height: 1; white-space: nowrap; }
.postcard__meta { grid-column: 1 / -1; margin-top: 2px; color: var(--c-soft); font-size: var(--fs-14); }
a.postcard:hover .postcard__title { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
@media (max-width: 380px), (min-width: 860px) and (max-width: 1240px) {
  .postcard__body { grid-template-columns: 1fr; }
  .postcard__price { margin-top: 2px; }
}

.store-tools { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; justify-content: space-between; }
.store-tools h2 { font-size: var(--fs-22); font-weight: 800; font-stretch: 85%; }
.store-foot { color: var(--c-soft); font-size: var(--fs-14); margin-top: var(--s-8); max-width: 60ch; }

/* Storefront layout: on phones the items come first and the pickup panel after;
   from 860 px the pickup panel sits on the right. */
.split--left { display: flex; flex-direction: column; gap: var(--s-8); }
.split--left > aside { order: 2; }
.split--left > .preview-banner, .split--left > .messages { order: -1; }
@media (min-width: 860px) {
  .split--left { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s-8); align-items: start; }
  .split--left > aside { order: 0; grid-column: 2; grid-row: 1 / span 3; }
  .split--left > .preview-banner { grid-column: 1 / -1; }
  .split--left > aside.sticky-side { top: 72px; }
  /* No pickup times yet: the items take the full width. */
  .split--left:not(:has(> aside)) { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Item card (one item, full screen; static/js/card.js) ---------- */
.masthead--slim .masthead__bar { min-height: 52px; padding-top: var(--s-2); padding-bottom: var(--s-2); }
.card-bar { position: sticky; top: 0; z-index: 20; background: var(--c-card); border-bottom: 1px solid var(--c-rule); }
.card-bar__inner { max-width: 640px; margin: 0 auto; padding: 0 var(--gutter); min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); font-size: var(--fs-14); }
.card-bar__back { display: inline-flex; align-items: center; gap: var(--s-1); min-height: var(--tap); font-weight: 700; text-decoration: none; white-space: nowrap; }
.card-bar__back:hover { text-decoration: underline; }
.card-bar__count { color: var(--c-soft); white-space: nowrap; }
.card-bar__hint { color: var(--c-soft); }
@media (max-width: 379px) { .card-bar__hint-more { display: none; } }
@media (hover: hover) and (pointer: fine) { .card-bar__hint { display: none; } }

/* Room for the fixed button bar below the card. */
.page--card { max-width: 640px; padding: var(--s-4) var(--s-3) calc(96px + env(safe-area-inset-bottom)); }
/* The stack: the current card on top; while dragging, the next one waits
   underneath (absolutely placed, so it never moves the page). */
.card-stage { position: relative; overflow-x: clip; overflow-y: visible; padding: 0 var(--s-1) var(--s-4); margin: 0 calc(var(--s-1) * -1); }
.item-card {
  position: relative; z-index: 1; background: var(--c-card); border: 1px solid var(--c-rule); border-radius: 12px;
  padding: 8px 8px 0; box-shadow: var(--lift-rest);
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.item-card.is-dragging { cursor: grabbing; box-shadow: var(--lift-drag); }
/* At rest, the edge of the next postcard shows behind this one: there is more to swipe to. */
.card-stage:has(> [data-card]:not([data-next=""]))::before {
  content: ""; position: absolute; z-index: 0; top: 18px; bottom: 34px; left: 14px; right: 0;
  background: var(--c-card); border: 1px solid var(--c-rule); border-radius: 12px;
  transform: rotate(1.6deg); transform-origin: 0 0; box-shadow: var(--lift-rest);
}
.item-card--under {
  position: absolute; left: var(--s-1); right: var(--s-1); z-index: 0; pointer-events: none;
  transform: scale(0.94); transform-origin: 50% 0; max-height: 100vh; overflow: hidden;
  --under-dim: 0.14;
}
/* A card lying underneath: opaque, dimmed with navy until it rises. */
.item-card--under::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--c-navy); opacity: var(--under-dim); pointer-events: none; }
/* Reduced motion: a committed move dims the card at once instead of sliding it. */
.item-card.is-leaving { opacity: 0.5; }
.item-card__notice { margin: var(--s-1) 0 var(--s-3); }
/* Every photo in the same frame, shown whole (contain), never cropped: buyers
   judge condition from it, and swiping compares like with like. */
.item-card__photo { margin: 0; aspect-ratio: 1; max-height: 64vh; width: 100%; border-radius: 6px; background: var(--c-tint); display: flex; justify-content: center; align-items: center; overflow: hidden; }
.item-card__photo img { width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; }
.item-card__body { padding: var(--s-4) var(--s-2) var(--s-3); }
/* Title and price share a line; when a long title needs the room, the price
   moves below it instead of squeezing the title into a narrow column. */
.item-card__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; column-gap: var(--s-4); row-gap: var(--s-1); }
.item-card__title { flex: 1 1 14rem; font-size: var(--fs-28); font-weight: 800; font-stretch: 82%; letter-spacing: -0.015em; line-height: 1.05; overflow-wrap: anywhere; text-wrap: pretty; }
.item-card__price { font-size: var(--fs-36); font-weight: 800; font-stretch: 80%; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; color: var(--c-cobalt); }
.item-card__meta { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-3) 0 0; padding: 0; list-style: none; }
.item-card__meta li { font-size: var(--fs-14); font-weight: 600; padding: 3px 12px; border-radius: 999px; border: 1.5px solid var(--c-rule); }
.item-card__desc { margin-top: var(--s-4); max-width: 60ch; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
.item-card__more { list-style: none; margin: 0; padding: 0 var(--s-2) var(--s-2); display: grid; gap: var(--s-2); }
.item-card__more img { width: 100%; height: auto; border-radius: 6px; background: var(--c-tint); -webkit-user-drag: none; }
.item-card__pickup { margin: var(--s-3) calc(var(--s-2) * -1) 0; padding: var(--s-5) var(--s-4) var(--s-5); border-top: 1.5px dashed var(--c-rule); }
.item-card__pickup > * + * { margin-top: var(--s-3); }
.item-card__pickup .postmark { float: right; margin: 0 0 var(--s-2) var(--s-3); }
.area-line { display: flex; gap: var(--s-2); align-items: center; color: var(--c-navy); font-size: var(--fs-14); }
.area-line svg { flex: none; color: var(--c-cobalt); }

/* Previous / Next in thumb reach, fixed to the bottom of the screen. */
.card-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--c-card); border-top: 1px solid var(--c-rule); box-shadow: 0 -8px 20px -16px rgba(12, 29, 79, 0.5); padding-bottom: env(safe-area-inset-bottom); }
.card-nav__inner { max-width: 640px; margin: 0 auto; padding: var(--s-2) var(--gutter); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); }
.card-nav__btn { padding: 0 var(--s-4); }
.card-nav__btn:not(.btn--secondary):not([aria-disabled="true"]) { min-height: 52px; }
/* The always-visible price: what a buyer wants first, on every card. */
.card-nav__summary { min-width: 0; text-align: center; line-height: 1.15; }
.card-nav__title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-soft); font-size: var(--fs-14); }
.card-nav__price { display: block; font-size: var(--fs-22); font-weight: 800; font-stretch: 82%; white-space: nowrap; }
/* Phones: round arrow buttons so the title and price get the room. */
@media (max-width: 559px) {
  .card-nav__btn:not(.card-nav__btn--text) { width: 52px; min-height: 52px; padding: 0; border-radius: 50%; }
  .card-nav__btn:not(.card-nav__btn--text) .card-nav__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .card-nav__btn--text { padding: 0 var(--s-3); }
}

/* ---------- Home page ---------- */
.home-hero { position: relative; max-width: 1200px; margin: 0 auto; padding: var(--s-4) var(--gutter) var(--s-10); display: grid; gap: var(--s-8); }
.home-hero h1 { font-size: var(--fs-56); line-height: 0.92; letter-spacing: -0.03em; font-weight: 800; font-stretch: 75%; text-wrap: balance; max-width: 12ch; }
.home-hero p { color: var(--c-on-cobalt); margin-top: var(--s-4); max-width: 46ch; font-size: var(--fs-18); }
.home-hero .btn { margin-top: var(--s-6); min-height: 52px; padding: 0 var(--s-6); font-size: var(--fs-18); }
@media (min-width: 860px) {
  .home-hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; padding-top: var(--s-8); padding-bottom: var(--s-12); }
  .home-hero h1 { font-size: 5rem; }
}
/* A sample postcard: what a buyer sees, labelled as an example. */
.sample { position: relative; justify-self: center; width: min(100%, 380px); }
.sample__stack { position: relative; isolation: isolate; }
.sample .postcard { transform: rotate(-2deg); box-shadow: 0 2px 6px rgba(5, 14, 48, 0.25), 0 24px 48px -20px rgba(5, 14, 48, 0.65); }
.sample .postcard + .postcard { position: absolute; inset: 0; z-index: -1; transform: rotate(4deg) translate(18px, 10px); }
.sample .postmark { right: auto; bottom: auto; left: -14px; top: -22px; z-index: 2; transform: rotate(-8deg); }
.sample .postmark__cancel { display: none; }
.sample__label { margin-top: var(--s-5); text-align: center; color: var(--c-on-cobalt); font-size: var(--fs-14); }
.sample__art { display: grid; place-items: center; width: 100%; height: 100%; color: var(--c-cobalt); }
.sample__art svg { width: 46%; height: auto; }

.home-grid { display: grid; gap: var(--s-4); align-items: start; }
@media (min-width: 860px) { .home-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--s-8); } }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: var(--s-4) 0 var(--s-4) 52px; border-bottom: 1px solid var(--c-rule); }
.steps li:last-child { border-bottom: 0; padding-bottom: 0; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: var(--s-3); width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; border: 2px solid var(--c-cobalt); color: var(--c-cobalt);
  font-weight: 800; font-size: var(--fs-18);
}
.steps strong { color: var(--c-navy); }
.proof { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-4); align-items: center; }

/* ---------- Utilities (replacing inline style attributes) ---------- */
.mt-0 { margin-top: 0 !important; }
.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mb-0 { margin-bottom: 0 !important; }
/* Forms start with hidden inputs (CSRF token, next URL), which would otherwise
   push the first visible field down via the stack spacing. */
.stack > input[type="hidden"] + :not(input[type="hidden"]) { margin-top: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  a.postcard:hover { transform: none; }
}
