/* Page-specific layouts: home hero and search, the listing page and its
 * gallery, the post form, and the admin queue. */

/* ── Home: hero + search ────────────────────────────────────────────────── */
.hero {
  padding: var(--s-6) 0 var(--s-5);
  text-align: center;
}
.hero h1 { margin-bottom: var(--s-2); }
.hero .lede {
  color: var(--muted);
  font-size: var(--t-md);
  max-width: 34rem;
  margin-inline: auto;
}
.hero h1 { font-size: var(--t-2xl); letter-spacing: -0.03em; }
.hero-cta {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-5);
}
@media (min-width: 48rem) {
  .hero { padding: var(--s-10) 0 var(--s-6); }
}

/* Home: the natural-language ask. One question, nothing else, until a search
 * actually runs. */
.ask {
  padding: var(--s-8) 0 var(--s-2);
  text-align: center;
}
.ask h1 { font-size: var(--t-2xl); letter-spacing: -0.03em; margin-bottom: var(--s-2); }
.ask .lede {
  color: var(--muted);
  font-size: var(--t-md);
  max-width: 34rem;
  margin-inline: auto;
}
@media (min-width: 48rem) { .ask { padding: var(--s-12) 0 var(--s-3); } }

/* One pill at every width: the field with a compact button on the right, so
 * the phone doesn't get a big stacked full-width button. */
.search {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--s-1);
  margin-top: var(--s-5);
  max-width: 44rem;
  margin-inline: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: var(--s-1);
  box-shadow: var(--shadow-sm);
}
.search input {
  border: 0; background: transparent; box-shadow: none;
}
.search input:focus { box-shadow: none; }
/* Compact, rounded button that sits inside the pill. */
.search .btn { border-radius: var(--r-pill); white-space: nowrap; }

.search-field { position: relative; }
.search-field svg {
  position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2;
  pointer-events: none;
}
.search-field input { padding-left: 2.6rem; }

/* ── Sign-up nudge ──────────────────────────────────────────────────────────
 * A secondary invitation under the search bar (and on the post-confirmation
 * page). Centered on the same 44rem axis as the search so it reads as one
 * column, and kept visually quieter than the ad cards so it never competes
 * with the board: a soft surface, a gold hairline that ties to the Verified
 * accent, no heavy shadow. */
.signup-cta {
  max-width: 44rem;
  margin: var(--s-4) auto 0;
  padding: var(--s-4) var(--s-5);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--r-lg);
  text-align: center;
}
.signup-cta p {
  color: var(--muted);
  font-size: var(--t-sm);
  margin: 0 0 var(--s-3);
}
.signup-cta p strong { color: var(--ink); font-weight: 700; }
.signup-cta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.signup-cta-login { color: var(--muted); font-size: var(--t-sm); font-weight: 600; }
.signup-cta-login:hover { color: var(--ink); }

/* On the post-confirmation page it follows an .empty block, so it needs a
 * little more breathing room above it. */
.signup-cta-post { margin-top: var(--s-6); text-align: left; }
.signup-cta-post .signup-cta-actions { justify-content: flex-start; }

.result-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-3); margin-bottom: var(--s-3);
}
.result-head h2 { font-size: var(--t-lg); }

/* ── Search results: conversational intro ───────────────────────────────────
 * Speaks to the kabayan instead of printing a bare query. A soft card on the
 * same measure as the board, quiet enough that the ads below stay the hero. */
.result-intro {
  margin: var(--s-6) 0 var(--s-5);
}
.result-intro-count {
  font-size: var(--t-lg);
  line-height: 1.35;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.01em;
}
.result-intro-count strong { color: var(--gold); font-weight: 800; }
.result-intro-sub {
  margin: var(--s-2) 0 0;
  color: var(--muted);
  font-size: var(--t-sm);
}
@media (min-width: 48rem) {
  .result-intro { margin-top: var(--s-8); }
  .result-intro-count { font-size: var(--t-xl); }
}

/* ── Search again (foot of results) ─────────────────────────────────────────
 * The one search box on the results page, moved below the ads and framed as an
 * invitation. A hairline above it separates it from the last card; the pill
 * reuses .search so it's pixel-identical to the landing field. */
.search-again {
  margin-top: var(--s-8);
  padding-top: var(--s-6);
  border-top: 1px solid var(--line);
}
.search-again-cue {
  text-align: center;
  color: var(--ink);
  font-weight: 700;
  font-size: var(--t-md);
  margin: 0;
}
.search-again .search { margin-top: var(--s-4); }
@media (min-width: 48rem) {
  .search-again { margin-top: var(--s-10); }
}

/* Empty-state buttons sit in a row that wraps cleanly on a phone. The gap
 * owns the spacing, so the legacy .btn + .btn margin is cancelled inside. */
.empty-actions {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--s-3);
}
.empty .empty-actions .btn + .btn { margin-left: 0; }

/* ── Listing detail ─────────────────────────────────────────────────────── */
.detail { display: grid; gap: var(--s-5); }
@media (min-width: 64rem) {
  /* The gallery holds the left column and the seller panel sticks beside it,
   * so the contact button is always in view without scrolling back. */
  .detail {
    grid-template-columns: minmax(0, 1.6fr) minmax(18rem, 1fr);
    gap: var(--s-8);
    align-items: start;
  }
  .detail-main { grid-column: 1; }
  .detail-aside { grid-column: 2; position: sticky; top: calc(var(--header-h) + var(--s-4)); }
}

/* Swipeable on a phone, exactly like a native gallery: one photo per screen,
 * snapping, with the rest a thumb-flick away. No JavaScript involved. */
.gallery {
  display: flex;
  gap: var(--s-2);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: var(--r);
  background: var(--surface-2);
  -webkit-overflow-scrolling: touch;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery img {
  flex: none;
  width: 100%;
  scroll-snap-align: center;
  aspect-ratio: var(--card-ratio);
  /* Fill the frame and keep the photo's own proportions — crop the overflow
   * rather than letterbox it, so the container never shows bands of surface
   * around a portrait shot. */
  object-fit: cover;
  background: var(--surface-2);
}
.gallery-wrap { position: relative; }
.gallery-dots {
  display: flex; justify-content: center; gap: 0.3rem; margin-top: var(--s-2);
}
.gallery-dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--line-2); transition: background var(--ease), width var(--ease);
}
.gallery-dots i.on { background: var(--gold); width: 18px; border-radius: var(--r-pill); }
@media (min-width: 64rem) { .gallery img { aspect-ratio: 16 / 11; } }

/* The hint names the gesture the visitor actually has — a phone swipes, a
 * mouse clicks the arrows. `pointer: fine` is the only honest signal for it. */
.gallery-hint { text-align: center; }
.gallery-hint .on-mouse { display: none; }

/* Arrows are for pointers only. A thumb has the whole rail to flick and the
 * buttons would just sit on top of the photo, so touch never sees them. */
.gallery-nav { display: none; }
@media (pointer: fine) {
  .gallery-hint .on-touch { display: none; }
  .gallery-hint .on-mouse { display: inline; }
  .gallery-nav {
    display: grid;
    place-items: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px; height: 40px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--ease), background var(--ease);
  }
  .gallery-nav-prev { left: var(--s-3); }
  .gallery-nav-next { right: var(--s-3); }
  .gallery-nav:hover { background: var(--surface-2); }
  /* Revealed on approach, but never hidden from a keyboard that tabs to it.
   * `:not([disabled])` rather than a separate disabled rule, which would lose
   * the specificity contest against the hover selector and show a dead end. */
  .gallery-wrap:hover .gallery-nav:not([disabled]),
  .gallery-nav:focus-visible:not([disabled]) { opacity: 1; }
  .gallery-nav[disabled] { pointer-events: none; }
}

.detail h1 { font-size: var(--t-xl); margin-block: var(--s-3) var(--s-1); }
.detail .price-lg { font-size: var(--t-2xl); font-weight: 800; color: var(--ink); }
.detail-badges { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.detail .desc {
  margin-top: var(--s-4);
  white-space: pre-wrap;           /* keep the seller's own line breaks */
  color: var(--ink-2);
  font-size: var(--t-md);
}
.spec {
  display: grid; grid-template-columns: auto 1fr; gap: var(--s-2) var(--s-4);
  margin-top: var(--s-5); padding-top: var(--s-4);
  border-top: 1px solid var(--line);
  font-size: var(--t-sm);
}
.spec dt { color: var(--muted); }
.spec dd { color: var(--ink); font-weight: 600; }

.seller-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s-5);
  box-shadow: var(--shadow-sm);
}
.seller-who { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-4); }
.avatar {
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: var(--t-md);
}
.seller-who .name { font-weight: 700; color: var(--ink); }

/* On a phone the contact button is pinned above the bottom bar: the one thing
 * a buyer came to do, always under the thumb. */
.contact-bar {
  position: fixed;
  inset: auto 0 calc(var(--bottomnav-h) + env(safe-area-inset-bottom)) 0;
  z-index: 55;
  padding: var(--s-3) var(--s-4);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
/* It floats over the page, so the end of the listing needs room to clear both
   it and the bottom bar — otherwise the last detail sits underneath. */
.has-contact-bar main { padding-bottom: 5.5rem; }
.detail-aside .btn-wa { display: none; }
@media (min-width: 64rem) {
  .contact-bar { display: none; }
  .has-contact-bar main { padding-bottom: 0; }
  .detail-aside .btn-wa { display: inline-flex; }
}

.safety-note {
  margin-top: var(--s-4);
  padding: var(--s-3);
  background: var(--gold-soft);
  border-radius: var(--r-sm);
  font-size: var(--t-sm);
  color: var(--ink-2);
}
.safety-note strong { color: var(--ink); }

/* ── Share row ──────────────────────────────────────────────────────────── */
.share-row {
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}
.share-label {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: var(--s-3);
}
.share-label svg { width: 18px; height: 18px; }
.share-btns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: transform .12s var(--ease), background .12s var(--ease),
              color .12s var(--ease), border-color .12s var(--ease);
}
.share-btn svg { width: 20px; height: 20px; }
.share-btn:hover,
.share-btn:focus-visible { transform: translateY(-1px); }
.share-fb:hover,   .share-fb:focus-visible   { background: #1877f2; border-color: #1877f2; color: #fff; }
.share-x:hover,    .share-x:focus-visible    { background: #000;    border-color: #000;    color: #fff; }
.share-wa:hover,   .share-wa:focus-visible   { background: #25d366; border-color: #25d366; color: #fff; }
.share-tg:hover,   .share-tg:focus-visible   { background: #2aabee; border-color: #2aabee; color: #fff; }
.share-copy:hover, .share-copy:focus-visible { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.share-copy.ok  { background: #25d366; border-color: #25d366; color: #fff; }
.share-copy.err { background: var(--gold-soft); color: var(--ink); }
.share-ig { margin-top: var(--s-3); }

/* ── Seller social links (on the ad page) ───────────────────────────────── */
.seller-socials {
  margin-top: var(--s-4);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.social-links { display: inline-flex; gap: var(--s-2); }
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  transition: transform .12s var(--ease), background .12s var(--ease),
              color .12s var(--ease), border-color .12s var(--ease);
}
.social-link svg { width: 19px; height: 19px; }
.social-link:hover, .social-link:focus-visible { transform: translateY(-1px); }
.social-fb:hover,  .social-fb:focus-visible  { background: #1877f2; border-color: #1877f2; color: #fff; }
.social-ig:hover,  .social-ig:focus-visible  { background: #e4405f; border-color: #e4405f; color: #fff; }
.social-tt:hover,  .social-tt:focus-visible  { background: #000;    border-color: #000;    color: #fff; }
.social-web:hover, .social-web:focus-visible { background: var(--gold); border-color: var(--gold); color: var(--ink); }

/* Social fields in the profile form: a tinted group so they read as one
   optional block, with each label's brand glyph inline. */
.social-fields .field .label svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }

/* ── Post form ──────────────────────────────────────────────────────────── */
.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  box-shadow: var(--shadow-sm);
  max-width: 46rem;
}
@media (min-width: 48rem) { .form-card { padding: var(--s-8); } }

.dropzone {
  border: 2px dashed var(--line-2);
  border-radius: var(--r);
  padding: var(--s-6) var(--s-4);
  text-align: center;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--gold); background: var(--gold-soft); }
.dropzone svg { width: 30px; height: 30px; margin-inline: auto; stroke: var(--muted); fill: none; stroke-width: 1.7; }
.dropzone .big { display: block; font-weight: 700; color: var(--ink); margin-top: var(--s-2); }
.dropzone input[type=file] { display: none; }

.previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: var(--s-2);
  margin-top: var(--s-3);
}
.previews:empty { display: none; }
.preview { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview .first {
  position: absolute; inset: auto 0 0 0;
  background: rgba(13, 34, 55, .75); color: #fff;
  font-size: var(--t-xs); font-weight: 700; text-align: center; padding: 2px;
}

/* A photo being processed: the local preview is dimmed under a spinner until
   the server hands back the real thumb. */
.preview.is-uploading img { opacity: .45; }
.preview-spinner {
  position: absolute; inset: 0; margin: auto;
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .55);
  border-top-color: #fff;
  animation: preview-spin .7s linear infinite;
}
@keyframes preview-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .preview-spinner { animation-duration: 2s; }
}

.preview-remove {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: rgba(13, 34, 55, .78); color: #fff;
  font-size: 15px; line-height: 1; cursor: pointer; padding: 0;
  display: grid; place-items: center;
}
.preview-remove:hover { background: var(--ink); }

.preview.is-failed img { opacity: .3; }
.preview-error {
  position: absolute; inset: 0;
  display: grid; place-items: center; padding: var(--s-2);
  background: rgba(176, 42, 42, .82); color: #fff;
  font-size: var(--t-xs); font-weight: 600; text-align: center;
}

.upload-status {
  margin-top: var(--s-2); color: var(--muted);
  font-size: var(--t-sm); font-weight: 600;
}

/* ── Admin ──────────────────────────────────────────────────────────────── */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-5); }
.admin-row {
  display: grid;
  gap: var(--s-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s-4);
  margin-bottom: var(--s-3);
}
@media (min-width: 48rem) {
  .admin-row { grid-template-columns: 7rem minmax(0, 1fr) auto; align-items: start; }
}
.admin-thumbs { display: flex; gap: var(--s-1); flex-wrap: wrap; }
.admin-thumbs img { width: 3.25rem; height: 3.25rem; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); }
.admin-row .no-photo-sm {
  width: 3.25rem; height: 3.25rem; border-radius: var(--r-sm);
  background: var(--surface-2); display: grid; place-items: center;
  color: var(--muted); font-size: var(--t-xs); text-align: center;
}
.admin-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.admin-row .desc { font-size: var(--t-sm); color: var(--ink-2); margin-top: var(--s-2); }
.admin-section-head { margin: var(--s-8) 0 var(--s-3); font-size: var(--t-lg); }
.admin-head-actions { display: flex; gap: var(--s-2); }

/* ── Admin: users ───────────────────────────────────────────────────────── */
.admin-users { display: flex; flex-direction: column; gap: var(--s-3); }
/* Each user is now a full-width button that opens a details modal. */
.admin-user {
  display: grid; gap: var(--s-3); padding: var(--s-4); width: 100%;
  grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card);
  text-align: left; font: inherit; color: inherit; cursor: pointer;
  transition: border-color var(--t-sm) var(--ease), background var(--t-sm) var(--ease);
}
.admin-user:hover { border-color: var(--ink-2); background: var(--surface-2); }
.admin-user-info { min-width: 0; }
.admin-user-info p { margin: var(--s-1) 0 0; }
.admin-user-chev { transform: rotate(180deg); opacity: 0.5; }
.admin-user-chev svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

/* Account status badges. */
.ustatus {
  display: inline-block; padding: 0.05rem 0.5rem; border-radius: var(--r-pill);
  font-size: var(--t-xs); font-weight: 600; vertical-align: middle;
}
.ustatus-active  { background: var(--ok-soft); color: var(--ok); }
.ustatus-blocked { background: var(--surface-2); color: var(--ink-2); }
.ustatus-banned  { background: var(--danger-soft); color: var(--danger); }

/* ── Admin: user modal ──────────────────────────────────────────────────── */
.modal {
  /* The global `* { margin: 0 }` reset (base.css) wipes the UA dialog's
     margin:auto, which is what normally centres an open <dialog>. Centre it
     explicitly instead so it doesn't pin to the top-left. */
  position: fixed; inset: 0; margin: auto;
  width: min(32rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem); overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg); background: var(--card); color: var(--ink);
  padding: var(--s-5); box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.modal::backdrop { background: rgba(0,0,0,0.45); }
.modal-x { display: flex; justify-content: flex-end; margin: calc(-1 * var(--s-2)) calc(-1 * var(--s-2)) 0 0; }
.modal-x button {
  border: 0; background: transparent; color: var(--ink-2);
  font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0 var(--s-1);
}
.modal-title { margin: 0 0 var(--s-3); display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.modal-spec { margin: 0 0 var(--s-4); }
.modal-links { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.modal-edit { margin-bottom: var(--s-3); border-top: 1px solid var(--line); padding-top: var(--s-3); }
.modal-edit > summary { cursor: pointer; font-weight: 600; }
.modal-form { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-3); }
.modal-form .field { margin: 0; }
.modal-actions {
  display: flex; gap: var(--s-2); flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: var(--s-4); margin-top: var(--s-2);
}
.modal-actions form { margin: 0; }

/* ── Admin: settings ────────────────────────────────────────────────────── */
.settings-intro { max-width: 46rem; margin-bottom: var(--s-5); }
.settings-form { display: flex; flex-direction: column; gap: var(--s-4); }
.settings-card {
  padding: var(--s-4);
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--card);
}
.settings-card > p.muted { max-width: 46rem; margin: var(--s-1) 0 var(--s-3); }
.settings-card .field { margin-bottom: 0; }
.settings-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3); margin-bottom: var(--s-1);
}
.settings-card-head h2 { margin: 0; font-size: var(--t-lg); }

/* A pill switch. The real checkbox drives it and stays keyboard-reachable;
 * the track is its sibling-less label text turned into a toggle. */
.switch {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-weight: 700; font-size: var(--t-sm); white-space: nowrap; cursor: pointer;
}
.switch input {
  appearance: none; -webkit-appearance: none;
  flex: none; width: 44px; height: 26px; min-height: 0; margin: 0; padding: 0;
  border-radius: var(--r-pill); border: 1px solid var(--line-2);
  background: var(--surface-2); position: relative; cursor: pointer;
  transition: background var(--ease), border-color var(--ease);
}
.switch input::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm);
  transition: transform var(--ease);
}
.switch input:checked { background: var(--gold); border-color: var(--gold); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.settings-note {
  margin: var(--s-2) 0 0; padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm); font-size: var(--t-sm);
}
.settings-note code { font-size: 0.92em; }
.settings-note-ok { background: color-mix(in srgb, var(--gold) 14%, transparent); }
.settings-note-warn {
  background: color-mix(in srgb, #c0392b 12%, transparent);
  border: 1px solid color-mix(in srgb, #c0392b 35%, transparent);
}
.settings-actions { margin-top: var(--s-2); }

/* ── Analytics ──────────────────────────────────────────────────────────── */
.range-tabs { display: flex; gap: var(--s-2); margin-bottom: var(--s-5); }
.range-tab {
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: var(--t-sm);
  color: var(--ink-2);
  background: var(--surface);
}
.range-tab.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--s-3);
  margin-bottom: var(--s-6);
}
.stat-tile {
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-align: center;
}
.stat-num { font-size: var(--t-xl, 1.9rem); font-weight: 700; color: var(--ink); line-height: 1.1; }
.stat-cap { margin-top: var(--s-1); font-size: var(--t-sm); color: var(--muted); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--s-4);
}
.stat-card {
  padding: var(--s-4) var(--s-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.stat-card h2 { font-size: var(--t-lg); margin: 0 0 var(--s-3); }

.bar-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.bar-row {
  display: grid;
  grid-template-columns: minmax(70px, 34%) 1fr auto;
  align-items: center;
  gap: var(--s-3);
  font-size: var(--t-sm);
}
.bar-label { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: var(--surface-2); border-radius: var(--r-pill); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--gold); border-radius: var(--r-pill); min-width: 2px; }
.bar-val { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-pct { color: var(--muted); margin-left: var(--s-2); font-size: var(--t-xs); }

/* Demand signals card (admin analytics): trending chips + empty-search gaps. */
.stat-grid-demand { margin-top: var(--s-4); }
.stat-card h2 .muted { font-weight: 400; font-size: var(--t-sm); }
.gap-list .gap-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-3);
  font-size: var(--t-sm);
}

/* ── Trending searches + popular rail (behaviour-driven home) ───────────── */
.trending {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-3);
  margin: var(--s-4) 0 var(--s-2);
}
.trending-lead { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.trending-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.trending .chip { text-decoration: none; }

.cat-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
}
.cat-filter .chip { text-decoration: none; }

.popular { margin-top: var(--s-6); }
.popular-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 82%;
  gap: var(--s-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: var(--s-2);
  margin: 0 calc(-1 * var(--s-4));
  padding-inline: var(--s-4);
}
.popular-rail::-webkit-scrollbar { display: none; }
.popular-rail > * { scroll-snap-align: start; }
@media (min-width: 640px) { .popular-rail { grid-auto-columns: 46%; } }
@media (min-width: 900px) { .popular-rail { grid-auto-columns: 31%; } }

/* ── Account hub (mobile-first) ─────────────────────────────────────────── */
.account-greet { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-4); }
.account-greet h1 { margin: 0; }
.account-greet p { margin: var(--s-1) 0 0; }
.account-avatar {
  flex: 0 0 auto; width: 3rem; height: 3rem; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: var(--t-lg);
  background: var(--ink); color: var(--bg);
}

/* Tab bar across every account page — one tap between the three destinations. */
.account-tabs {
  display: flex; gap: var(--s-1); margin: 0 0 var(--s-5);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--s-1); position: sticky; top: var(--s-2); z-index: 5;
}
.account-tabs a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: var(--s-2); border-radius: var(--r-sm); text-decoration: none;
  color: var(--ink-2); font-size: var(--t-sm); font-weight: 600;
}
.account-tabs a svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.account-tabs a.is-active { background: var(--surface-2); color: var(--ink); }

.account-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr)); gap: var(--s-2); margin-bottom: var(--s-4); }
.account-stats .stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); text-decoration: none; color: var(--ink);
}
.account-stats .stat-num { font-size: var(--t-xl); font-weight: 800; line-height: 1; }
.account-stats .stat-label { font-size: var(--t-xs); color: var(--ink-2); }

.account-menu { list-style: none; padding: 0; margin: var(--s-4) 0; display: flex; flex-direction: column; gap: var(--s-2); }
.account-menu a {
  display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4);
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  text-decoration: none; color: var(--ink);
}
.account-menu a > svg:first-child { flex: 0 0 auto; width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 1.8; }
.account-menu a > svg:last-child { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: var(--ink-2); stroke-width: 2; transform: rotate(180deg); opacity: .5; }
.account-menu-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.account-menu-text .muted { font-size: var(--t-sm); }

/* ── Error page ─────────────────────────────────────────────────────────── */
.error-page {
  text-align: center;
  padding: var(--s-12) var(--s-4);
  max-width: 34rem;
  margin-inline: auto;
}
.error-page .error-mark { font-size: 2.75rem; line-height: 1; display: block; }
.error-page .code {
  font-size: 4rem; font-weight: 800; color: var(--line-2); line-height: 1;
  margin-top: var(--s-2);
}
.error-page h1 { margin: var(--s-3) 0 var(--s-2); }
.error-page .error-lead {
  color: var(--muted);
  margin-bottom: var(--s-6);
  text-wrap: balance;
}
.error-page .error-actions {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--s-2);
  margin-bottom: var(--s-8);
}
.error-page .error-links {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: var(--s-2) var(--s-4);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}
.error-page .error-links-label { color: var(--muted); font-size: var(--t-sm); }
.error-page .error-links a {
  font-weight: 600; color: var(--ink-2); font-size: var(--t-sm);
  padding-block: 0.4rem;
}
.error-page .error-links a:hover { color: var(--gold); }

/* ── Safety & guide prose ───────────────────────────────────────────────── */
.prose { max-width: 42rem; }
.prose h2 { margin-top: var(--s-8); margin-bottom: var(--s-2); font-size: var(--t-lg); }
.prose h3 { margin-top: var(--s-5); margin-bottom: var(--s-1); font-size: var(--t-md); }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 1.1rem; display: grid; gap: var(--s-2); }
.prose p + p { margin-top: var(--s-3); }

/* ── A palit's "wants in return" ────────────────────────────────────────── */
/* Given the weight a price gets on a sale, because it is the same thing: the
 * terms of the deal. Green ties it to the Palit tag. */
.swap-box {
  margin-top: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ok);
  border-radius: var(--r);
  background: var(--ok-soft);
}
.swap-label {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: var(--t-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ok);
  margin-bottom: var(--s-2);
}
.swap-label svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.swap-box p { color: var(--ink); font-weight: 600; font-size: var(--t-md); }

/* ── A negosyo's menu ───────────────────────────────────────────────────── */
/* Name on the left, price on the right, held apart by a dotted leader — the
 * way a printed menu does it, so the eye can run across one line. The leader is
 * a background on the row that the two spans sit on top of, which keeps it
 * honest whatever the name's length. */
.menu {
  margin-top: var(--s-6);
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.menu h2 {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: var(--t-md);
  margin-bottom: var(--s-3);
}
.menu h2 svg { width: 20px; height: 20px; stroke: var(--gold); fill: none; stroke-width: 1.8; }
/* padding-left is reset explicitly: the browser's default list indent pushes
 * every item away from the heading above it and breaks the column. */
.menu ul { list-style: none; display: grid; gap: var(--s-1); padding-left: 0; }
.menu li {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  padding: var(--s-2) 0;
  border-bottom: 1px dotted var(--line);
}
.menu li:last-child { border-bottom: 0; }
.menu-item { flex: 1; color: var(--ink); font-weight: 600; }
.menu-price {
  flex: none;
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;   /* prices line up down the column */
}
.menu > .muted { margin-top: var(--s-3); }

/* ── Menu rows on the post form ─────────────────────────────────────────── */
.menu-fields {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s-4);
  background: var(--surface-2);
}
/* `.field` sets display, and an author rule beats the browser's own
 * `[hidden] { display: none }` — without this a kind-specific field is never
 * actually hidden, and a sofa gets offered a price list. */
.kind-field[hidden] { display: none; }
.menu-fields legend { padding-inline: var(--s-2); }
.menu-row {
  display: grid;
  grid-template-columns: 1fr 8rem auto;
  gap: var(--s-2);
  margin-bottom: var(--s-2);
}
/* On a phone the price would be squeezed to nothing beside a name, so it takes
 * the second row and the remove button stays beside it. */
@media (max-width: 30rem) {
  .menu-row { grid-template-columns: 1fr auto; }
  .menu-row input:first-child { grid-column: 1 / -1; }
}
.menu-drop {
  width: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.menu-drop:hover { color: var(--danger); border-color: var(--danger); }

/* ── Guide ──────────────────────────────────────────────────────────────── */
.guide-hero { padding: var(--s-6) 0 var(--s-5); max-width: 36rem; }
.guide-hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: var(--t-xs);
  font-weight: 700;
  color: var(--gold);
  margin-bottom: var(--s-2);
}
.guide-hero h1 { font-size: var(--t-2xl); letter-spacing: -0.03em; margin-bottom: var(--s-3); }
.guide-hero .lede { color: var(--muted); font-size: var(--t-md); }

/* Three steps, counted. Numerals rather than a bullet, because the order is
 * the point and a reader should be able to tell where they are. */
.steps {
  list-style: none;
  display: grid;
  gap: var(--s-4);
  margin: var(--s-5) 0 var(--s-10);
}
@media (min-width: 48rem) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s-5);
  box-shadow: var(--shadow-sm);
}
.step-n {
  display: grid; place-items: center;
  width: 2rem; height: 2rem;
  border-radius: 50%;
  background: var(--ink); color: #fff;
  font-weight: 800; font-size: var(--t-sm);
  margin-bottom: var(--s-3);
}
.steps h2 { font-size: var(--t-md); margin-bottom: var(--s-1); }
.steps p { color: var(--ink-2); font-size: var(--t-base); }

.kind-cards { display: grid; gap: var(--s-3); margin: var(--s-4) 0 var(--s-6); }
@media (min-width: 48rem) { .kind-cards { grid-template-columns: repeat(3, 1fr); } }
.kind-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s-4);
  background: var(--surface);
}
.kind-card h3 { margin: var(--s-2) 0 var(--s-1); font-size: var(--t-md); }
.kind-card p { font-size: var(--t-base); }

/* The worked example. Dressed as the real thing so an owner recognises what
 * they are about to fill in. */
.menu-sample {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: var(--s-5);
  margin: var(--s-4) 0;
  box-shadow: var(--shadow-sm);
}
.menu-sample-head {
  font-weight: 800; color: var(--ink);
  padding-bottom: var(--s-2); margin-bottom: var(--s-2);
  border-bottom: 2px solid var(--gold);
}
.menu-sample ul { list-style: none; display: grid; gap: var(--s-1); padding-left: 0; }
.menu-sample li {
  display: flex; align-items: baseline; gap: var(--s-2);
  padding: var(--s-1) 0;
  border-bottom: 1px dotted var(--line);
}
.menu-sample li:last-child { border-bottom: 0; }

.guide-end {
  text-align: center;
  margin-top: var(--s-10);
  padding: var(--s-8) var(--s-4);
  border-top: 1px solid var(--line);
}
.guide-end h2 { font-size: var(--t-xl); margin-bottom: var(--s-2); }
.guide-end p { color: var(--muted); margin-bottom: var(--s-5); }
.guide-end .btn + .btn { margin-left: var(--s-2); }

/* ── Account: profile, "signed as", my postings ───────────────────────────── */
.signed-as {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-4);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.signed-as .small { white-space: nowrap; }

.postings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.postings-head h1 { margin: 0; }
.postings-head .btn svg { width: 1em; height: 1em; vertical-align: -.1em; }

.posting-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.posting {
  display: flex;
  gap: var(--s-4);
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.posting-cover {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-2);
  display: grid;
  place-items: center;
}
.posting-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.posting-noimg svg { width: 32px; height: 32px; stroke: var(--line-2); fill: none; }

.posting-body { flex: 1 1 auto; min-width: 0; }
.posting-top { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.posting-title {
  margin: var(--s-2) 0 var(--s-1);
  font-size: var(--t-lg, 1.1rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.posting-meta { margin: 0; font-size: .9rem; }
.posting-note { margin: var(--s-2) 0 0; }

.posting-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-3);
}
.inline-form { display: inline; margin: 0; }

.status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.5;
}
.status-approved    { background: var(--ok-soft);     color: var(--ok); }
.status-pending     { background: var(--gold-soft);   color: var(--gold); }
.status-rejected    { background: var(--danger-soft); color: var(--danger); }
.status-draft       { background: var(--surface-2);   color: var(--muted); }
.status-unpublished { background: var(--surface-2);   color: var(--ink-2); }

/* Existing photos on the edit form: uncheck a tile to drop it. */
.keep-photos {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin: var(--s-2) 0 var(--s-3);
}
.keep-photo {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--ok);
}
.keep-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.keep-photo input { position: absolute; opacity: 0; pointer-events: none; }
.keep-photo-x {
  position: absolute;
  inset: auto 0 0 0;
  text-align: center;
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 0;
  background: rgba(13, 34, 55, .72);
  color: #fff;
  opacity: 0;
  transition: opacity .12s;
}
/* Unchecked = dropped: dim it and show the "Remove" label as the active state. */
.keep-photo:has(input:not(:checked)) { border-color: var(--line-2); filter: grayscale(1) opacity(.5); }
.keep-photo:hover .keep-photo-x,
.keep-photo:has(input:not(:checked)) .keep-photo-x { opacity: 1; }

@media (max-width: 560px) {
  .posting { flex-direction: row; }
  .posting-cover { width: 72px; height: 72px; }
  .posting-actions .btn { flex: 1 1 auto; }
}

/* ── Admin: audit log ───────────────────────────────────────────────────── */
.audit-list { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-3); }
.audit-row {
  display: grid; gap: var(--s-1); padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card);
}
@media (min-width: 640px) {
  .audit-row { grid-template-columns: minmax(0,1fr) auto; align-items: baseline; }
  .audit-ts { grid-row: 1; grid-column: 2; }
  .audit-detail { grid-column: 1; }
}
.audit-when { display: flex; gap: var(--s-2); align-items: baseline; flex-wrap: wrap; }
.audit-action { font-weight: 600; font-family: var(--mono, monospace); }
.audit-detail { word-break: break-word; }
.audit-clear { margin-top: var(--s-5); }
.pager { display: flex; gap: var(--s-3); align-items: center; justify-content: center; margin-top: var(--s-4); }

/* ── Admin: danger zone ─────────────────────────────────────────────────── */
.danger-zone { margin-top: var(--s-8); border-color: var(--danger); }
.danger-zone h2 { color: var(--danger); }
.danger-form { display: flex; gap: var(--s-3); align-items: flex-end; flex-wrap: wrap; margin-top: var(--s-3); }
.danger-form .field { margin: 0; min-width: 12rem; }
