/* ==========================================================================
   Nearpin Public Web — design system (docs/action_plan.md Phase 3, generated
   for Phase 2 pages). Mobile-first. The premium gradient/blur aesthetic
   proven by the admin login page, themed Task 1: yellow-primary brand
   (the golden brand logo) with green/red/blue as the supporting accent families
   — every yellow fill carries dark ink text (WCAG AA; white-on-yellow
   fails at ~1.4:1), so the yellow/black identity is also the
   accessible one. Hand-written, embedded in the binary via internal/web
   (go:embed static), served at /static/css/public.css — CSP `style-src
   'self'` allows it with zero nonce friction.
   ========================================================================== */

:root {
  /* Brand (Task 1 theme): yellow-primary (the golden brand logo) with
     green/red/blue as the supporting accent families.
       --brand-1/--brand-2  yellow→amber gradient fill (buttons, active chips)
       --brand-ink          dark ink ON yellow fills (WCAG AA+; white-on-yellow
                            would fail ~1.4:1, so every yellow surface in this
                            system carries dark text — the yellow/black
                            identity)
       --brand-text         yellow-family text on WHITE surfaces (amber-700,
                            AA for normal text — yellow-500 on white is ~2.4:1) */
  --brand-1: #eab308;   /* yellow-500 */
  --brand-2: #f59e0b;   /* amber-500 */
  --brand-grad: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  --brand-grad-soft: linear-gradient(135deg, rgba(234, 179, 8, 0.12), rgba(245, 158, 11, 0.12));
  --brand-ink: #1e293b;
  --brand-text: #b45309;   /* amber-700 */
  --brand-glow: rgba(234, 179, 8, 0.45);
  --brand-line: rgba(234, 179, 8, 0.4);
  --accent-blue: #2563eb;  /* info */
  --accent-green: #16a34a; /* success (= --success) */
  --accent-red: #dc2626;   /* danger */
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --surface: #ffffff;
  --success: #10b981;
  --success-ink: #065f46;
  --success-bg: #d1fae5;
  --warn-ink: #92400e;
  --warn-bg: #fef3c7;
  --radius: 1.1rem;
  --radius-sm: 0.7rem;
  --shadow-lift: 0 18px 40px -18px rgba(15, 23, 42, 0.28), 0 2px 8px -2px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 26px 52px -20px rgba(15, 23, 42, 0.34), 0 4px 12px -2px rgba(15, 23, 42, 0.1);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Layout shells ---------- */
.site-main {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 2rem 1rem 3.5rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.footer-links a:hover {
  color: var(--ink);
}

/* ---------- Top navigation ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  min-height: 44px;
}

.brand-logo {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.7rem;
  border-radius: 0.6rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.nav-links a:hover {
  background: rgba(234, 179, 8, 0.1);
  color: var(--ink);
}

.nav-links a.is-active {
  color: var(--brand-text);
  background: rgba(234, 179, 8, 0.12);
}

.nav-auth {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Signed-in chip (nav). Task 1: the chip is the account hub link + identity
   ("My ads" and "Sign out" live inside /profile) plus the visitor's saved
   pincode for reference — the redundant header affordances are gone. */
.user-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.25rem 0.25rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  min-width: 0;
}

/* Saved pincode in the header (Task 1 v0.34.1): a small chip that links to
   /profile so the user can update their saved pincode (it no longer
   re-runs the browse feed — the profile page owns the pincode now).
   Digits-only (validated 6-digit pincode), so the chip is safe to render. */
.user-pincode {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 32px;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: rgba(234, 179, 8, 0.12);
  color: var(--brand-text);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.user-pincode:hover {
  background: rgba(234, 179, 8, 0.2);
}

.pin-glyph {
  font-size: 0.9rem;
  line-height: 1;
}

.user-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--brand-grad);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  overflow: hidden;
  flex-shrink: 0;
  text-decoration: none;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  font-size: 0.925rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 0.8rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  line-height: 1.2;
  text-align: center;
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(245, 158, 11, 0.5);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--brand-grad);
  color: var(--brand-ink);
  box-shadow: 0 10px 24px -10px rgba(234, 179, 8, 0.5);
}

.btn-primary:hover {
  box-shadow: 0 14px 30px -10px rgba(234, 179, 8, 0.6);
  filter: brightness(1.06);
}

.btn-ink {
  background: var(--ink);
  color: #fff;
}

.btn-ink:hover {
  background: #334155;
}

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.btn-secondary:hover {
  background: #f1f5f9;
}

.btn-lg {
  min-height: 52px;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  border-radius: 0.9rem;
}

.btn-block {
  width: 100%;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.6rem;
  padding: 2.5rem 1.5rem 2rem;
  margin-bottom: 1.75rem;
  background:
    radial-gradient(1200px 500px at 110% -20%, rgba(234, 179, 8, 0.26), transparent 60%),
    radial-gradient(900px 420px at -10% 120%, rgba(34, 197, 94, 0.16), transparent 55%),
    linear-gradient(160deg, #0f172a, #1e293b);
  color: #fff;
  box-shadow: var(--shadow-lift);
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.06) 0, transparent 40%);
  pointer-events: none;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero .accent {
  background: linear-gradient(90deg, #fde047, #86efac);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  margin: 0 0 1.5rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1rem;
  max-width: 46rem;
}

/* Task 1 — hero growth kicker pill above the headline, on the dark hero
   gradient (the hero is the one dark surface of the design system). The
   three-point hero-trust strip was REMOVED (Task 1 follow-up): point claims
   like "Post in 2 minutes" / "WhatsApp-verified sellers" / "Pincode-local
   results" read as overstated for an early app, and the 2-minute promise
   moved into the home page's creation callout (components_public_pincode_bar
   / home.html app-callout) where it drives the actual conversion — see
   docs/action_plan.md. */
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(253, 224, 71, 0.35);
  color: #fde047;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.pincode-form {
  display: flex;
  gap: 0.5rem;
  max-width: 34rem;
  flex-wrap: wrap;
}

.pincode-input {
  flex: 1 1 14rem;
  min-height: 48px;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.pincode-input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.pincode-input:focus {
  outline: none;
  border-color: rgba(253, 224, 71, 0.7);
  box-shadow: 0 0 0 4px rgba(234, 179, 8, 0.3);
}

/* ---------- Hero keyword search (Task 1 v0.30.0) ----------
   The signed-in variant of the home hero entry (visitor has a saved pincode —
   shown in the header chip + already ranking /browse): a dark-glass search
   chip in the same family as the pincode input, going straight to
   /browse?search=…. A small hint names the implicit search location and links
   to /profile to change it (the header chip already links to the filtered
   feed). */
.hero-search {
  display: flex;
  gap: 0.5rem;
  max-width: 34rem;
  flex-wrap: wrap;
}

.hero-search-input {
  flex: 1 1 14rem;
  min-height: 48px;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  -webkit-appearance: none;
  appearance: none;
}

.hero-search-input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.hero-search-input:focus {
  outline: none;
  border-color: rgba(253, 224, 71, 0.7);
  box-shadow: 0 0 0 4px rgba(234, 179, 8, 0.3);
}

.hero-search-hint {
  margin: 0.55rem 0 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

.hero-search-hint .pin-glyph {
  font-size: 0.9rem;
  line-height: 1;
}

.hero-search-hint a {
  color: #fde047;
  font-weight: 600;
}

.hero-search-hint a:hover {
  text-decoration: underline;
}

/* ---------- Sections ---------- */
.section {
  margin-bottom: 2rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.section-head h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-head .link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-text);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.section-head .link:hover {
  text-decoration: underline;
}

/* ---------- Chip rows (categories, filters, languages) ---------- */
.chip-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.15rem 0.25rem 0.6rem;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.chip .chip-emoji {
  font-size: 1.05rem;
  line-height: 1;
}

.chip:hover {
  border-color: rgba(234, 179, 8, 0.5);
}

.chip.is-active {
  background: var(--brand-grad);
  color: var(--brand-ink);
  border-color: transparent;
  box-shadow: 0 8px 18px -8px rgba(234, 179, 8, 0.5);
}

.chip.is-active:hover {
  filter: brightness(1.05);
}

/* ---------- Card grids ---------- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.card {
  display: flex;
  /* Task 1 v0.30.1: horizontal compact card at EVERY width — the vertical
     card (16:9 media band) is retired and with it the thumbnail image. The
     left chip + right info column is the dense classifieds-app pattern
     (OLX/Quikr/JustDial) — ~6 cards per screen on a phone and ~4 rows in
     the desktop 3-column grid, with every tap target still the whole
     ≥44px-tall card. */
  flex-direction: row;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 6px -2px rgba(15, 23, 42, 0.06);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

a.card {
  color: inherit;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--brand-line);
}

.card-media {
  /* v0.30.1: a fixed square emoji chip (76px) — the former full-width 16/9
     band and the YouTube thumbnail image are gone. The chip is the uniform
     card identity (category glyph), sized so the whole feed scans as a
     single visual family. */
  width: 4.75rem;
  height: 4.75rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  position: relative;
  background:
    radial-gradient(600px 260px at 85% -30%, rgba(234, 179, 8, 0.16), transparent 60%),
    radial-gradient(500px 240px at -20% 130%, rgba(34, 197, 94, 0.14), transparent 55%),
    linear-gradient(150deg, #fefce8, #ecfdf5);
}

/* Task 1 v0.30.1 — the ▶ marker on the emoji chip: the only card media
   affordance for a video-enabled entity (the i.ytimg.com thumbnail image was
   removed from feed cards — see the card templates). Presentation-only and
   aria-hidden in the templates; the title carries a visually-hidden
   "(video available)" for assistive tech. The video itself plays on the
   OPENED card (detail page inline player). */
.card-play {
  position: absolute;
  right: 0.4rem;
  bottom: 0.4rem;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.62);
  color: #fff;
  font-size: 0.62rem;
  padding-left: 0.12rem; /* optical centering for the ▶ glyph */
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.3);
}

.card-media::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  border-right: 1px solid rgba(226, 232, 240, 0.8);
}

.card-body {
  padding: 0.7rem 0.9rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  min-width: 0; /* let the info column shrink under the fixed chip */
}

.card-title {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.card-meta .pin {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.card-meta .pin svg {
  width: 0.9rem;
  height: 0.9rem;
}

.card-desc {
  font-size: 0.865rem;
  color: var(--muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  margin-top: 0;
  padding-top: 0.25rem;
}

/* Visually-hidden utility (Task 1 v0.30.1): screen-reader-only text, e.g.
   the "(video available)" suffix on video-enabled card titles. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  line-height: 1.4;
}

.badge-verified {
  background: var(--success-bg);
  color: var(--success-ink);
}

.badge-verified svg {
  width: 0.8rem;
  height: 0.8rem;
}

.badge-home {
  background: #dbeafe;
  color: #1e40af;
}

.badge-muted {
  background: #f1f5f9;
  color: var(--muted);
}

.badge-brand {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.14), rgba(245, 158, 11, 0.14));
  color: var(--brand-text);
}

/* ---------- Detail pages ---------- */
.detail {
  max-width: 840px;
  margin: 0 auto;
}

.detail-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  margin-bottom: 1rem;
}

.detail-media {
  aspect-ratio: 2.2 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.5rem;
  background:
    radial-gradient(700px 300px at 85% -30%, rgba(234, 179, 8, 0.16), transparent 60%),
    radial-gradient(600px 280px at -20% 130%, rgba(34, 197, 94, 0.14), transparent 55%),
    linear-gradient(150deg, #fefce8, #ecfdf5);
}

/* Task 1 — inline YouTube player on opened cards. The privacy-enhanced
   youtube-nocookie.com embed replaces the emoji media slot; the iframe fills
   the same top media block (16:9 — closer to the video's own shape than the
   2.2/1 emoji chip). frame-src in the CSP allowlists the embed host. */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f172a;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.detail-body {
  padding: 1.25rem 1.25rem 1.5rem;
}

.detail-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Phase 9 city anchor (D9.4): the derived city sits inside the detail H1 as
   a lighter secondary word — "Catering in Tiruchirappalli" — so the page's
   most prominent text carries the local-SEO query without crowding the
   listing name. Same muted-weight treatment as the pin line. */
.detail-city {
  color: var(--muted);
  font-weight: 600;
}

.detail-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.detail-sub .pin {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.detail-sub .pin svg {
  width: 1rem;
  height: 1rem;
}

.detail-text {
  font-size: 1rem;
  line-height: 1.7;
  color: #334155;
  white-space: pre-line;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem;
  margin: 1.1rem 0;
}

.meta-cell {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.meta-cell strong {
  display: block;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  margin-top: 0.15rem;
}

/* Contact panel (signed-in) */
.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.contact-panel {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.08), rgba(245, 158, 11, 0.08));
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-top: 1rem;
}

.contact-panel h3 {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.contact-number {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0.15rem 0 0.85rem;
}

/* Task 1 — tap-to-call phone affordance: a tel: link that opens the phone
   dialer on mobile devices, presented with a phone emoji (emoji-first, like
   the category glyphs). Only rendered inside signed-in contact panels. */
.contact-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
}

.contact-phone:hover {
  color: var(--brand-ink);
  text-decoration: underline;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* Paired action buttons inside a callout / app-callout (".cta-row"). */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

/* Sign-in CTA (anonymous — D5 conversion mechanic) */
.cta-card {
  background: var(--brand-grad);
  color: var(--brand-ink);
  border-radius: var(--radius);
  padding: 1.4rem 1.3rem;
  margin-top: 1rem;
  box-shadow: 0 16px 34px -16px rgba(234, 179, 8, 0.5);
  text-align: center;
}

.cta-card .cta-icon {
  font-size: 1.8rem;
  margin-bottom: 0.3rem;
}

.cta-card h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.cta-card p {
  margin: 0 auto 0.9rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 26rem;
}

.cta-card .btn {
  background: #fff;
  color: var(--ink);
}

/* ---------- Category grid (directory) ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.85rem;
}

.cat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 0.9rem;
  text-align: center;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  min-height: 118px;
}

.cat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--brand-line);
}

.cat-card .cat-emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.4rem;
}

.cat-card .cat-name {
  font-weight: 700;
  font-size: 0.92rem;
  display: block;
}

.cat-card .cat-count {
  font-size: 0.78rem;
  color: var(--muted);
  display: block;
  margin-top: 0.2rem;
}

.cat-card .cat-desc {
  font-size: 0.78rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.3rem;
}

/* ---------- Useful numbers directory ---------- */
.un-sections {
  display: grid;
  gap: 1.4rem;
}

.un-section h2 {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.un-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

.un-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.8rem;
}

.un-item .un-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-right: auto;
}

.un-item .un-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px; /* acceptance: tap targets ≥ 44px */
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: #f1f5f9;
  color: var(--ink);
}

.un-item .un-link:hover {
  background: rgba(234, 179, 8, 0.12);
  color: var(--brand-text);
}

.un-item .un-link svg {
  width: 0.95rem;
  height: 0.95rem;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
  color: var(--muted);
  font-size: 0.875rem;
}

/* ---------- Lazy-load region (htmx infinite scroll, Phase 3; Task 1
   v0.28.0 — scroll-triggered, no button) ----------
   The #load-more region sits under #feed-grid. An invisible sentinel with
   hx-trigger="revealed" fires the next-page GET as soon as it scrolls into
   view; the batch appends cards (hx-swap="beforeend") and the OOB swap
   re-arms the region with the NEXT page's sentinel (or the end state), so
   the state always reflects the server's hasNextPage. Needs a nonzero
   height for IntersectionObserver to observe it. */
#load-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.6rem;
  min-height: 2.75rem;
}

.feed-sentinel {
  width: 100%;
  min-height: 1px;
}

.feed-end {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- htmx indicators (Phase 3) ----------
   .htmx-indicator is hidden until the request it is named by is in flight
   (htmx adds .htmx-request to the element carrying hx-indicator). */
.htmx-indicator {
  display: none;
}

.htmx-indicator.htmx-request {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

/* Skeleton shimmer — the design system's loading affordance (Phase 3):
   shimmering placeholder bars, e.g. under the load-more button while a
   batch streams in. Pure CSS; `prefers-reduced-motion` slows it below. */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  background: #e2e8f0;
  display: inline-block;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: shimmer 1.3s infinite;
}

.skeleton-line {
  width: 9rem;
  height: 0.85rem;
}

.skeleton-line.short {
  width: 5.5rem;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* Compact spinner for the filter-bar submit indicator. */
.spinner {
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid rgba(234, 179, 8, 0.3);
  border-top-color: var(--brand-1);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Error page ---------- */
.error-wrap {
  max-width: 34rem;
  margin: 3rem auto 0;
  text-align: center;
}

.error-code {
  font-size: 4rem;
  font-weight: 800;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}

.error-wrap h1 {
  margin: 0.25rem 0 0.6rem;
  font-size: 1.35rem;
}

.error-wrap p {
  color: var(--muted);
  margin: 0 0 1.4rem;
}

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.empty .empty-emoji {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.empty h3 {
  color: var(--ink);
  margin: 0 0 0.3rem;
}

/* ---------- Page intros ---------- */
.page-head {
  margin-bottom: 1.25rem;
}

/* ---------- Breadcrumbs (Task 1 SEO — D6) ----------
   The visible crumb trail (same []breadcrumbEntry the BreadcrumbList schema
   uses). Muted, tight, no decoration — context, not chrome. */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: baseline;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumbs li {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.breadcrumbs li + li::before {
  content: "›";
  color: var(--muted);
}

.breadcrumbs a {
  color: var(--brand-text);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs [aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

/* Category-landing alias line (Task 1 SEO): curated "Popular searches"
   keywords from the category config — the same "also search" pattern local
   directory apps use. Muted, one line, no links (alias text is for matching,
   not navigation — the real destinations are the chips and cards). */
.page-alias {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.page-head h1 {
  margin: 0 0 0.3rem;
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem;
  margin-bottom: 1.25rem;
}

.filter-bar form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  flex: 1;
}

.filter-input {
  flex: 1 1 10rem;
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  font-size: 0.925rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: #f8fafc;
  color: var(--ink);
}

.filter-input:focus {
  outline: none;
  border-color: var(--brand-1);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.18);
}

.filter-bar .search-actions {
  display: flex;
  gap: 0.5rem;
}

/* ---------- Mobile bottom-hugging nav (Phase 3, CSS-only — no Alpine) ----------
   ≥44px tap targets, blurred-glass family of the sticky top nav. Shown only
   under 640px where the top nav links are hidden; the footer links are
   dropped too (the bottom nav covers the same destinations). Task 1: the
   signed-in variant is FOUR columns (`bottom-nav--four`) — the Profile hub
   slot is gone because the header chip already links to /profile, so the tab
   bar carries no duplicate destination; anonymous keeps the 👤 Sign in slot
   (five columns). No sign-out form lives in the tab bar either way. */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: none;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  padding: 0.3rem 0.3rem calc(0.35rem + env(safe-area-inset-bottom));
}

/* Signed-in tab bar: 4 items → 4 equal columns (Task 1). */
.bottom-nav--four {
  grid-template-columns: repeat(4, 1fr);
}

.bottom-nav-item {
  min-height: 52px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  padding: 0.25rem 0.1rem;
  border: none;
  border-radius: 0.7rem;
  background: transparent;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.bottom-nav-item .bn-emoji {
  font-size: 1.25rem;
  line-height: 1;
}

.bottom-nav-item:hover {
  color: var(--ink);
  background: rgba(234, 179, 8, 0.1);
}

.bottom-nav-item.is-active,
.bottom-nav-item.is-active:hover {
  color: var(--brand-text);
  background: rgba(234, 179, 8, 0.12);
}

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .un-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    padding: 3rem 2.5rem 2.4rem;
  }
}

@media (max-width: 639.98px) {
  .bottom-nav {
    display: grid;
  }

  /* Keep page content above the fixed nav + safe-area inset. */
  .site-main {
    padding-bottom: 5.5rem;
  }

  .site-footer {
    padding-bottom: calc(4.4rem + env(safe-area-inset-bottom));
  }

  /* The bottom nav owns mobile navigation: hide the top links and the
     duplicate footer links; keep the brand and the signed-in avatar chip.
     The footer's LEGAL links stay visible on phones (footer-legal — ToS and
     privacy policy must be reachable from every surface; they duplicate no
     bottom-nav destination). */
  .nav-links {
    display: none;
  }

  .footer-links {
    display: none;
  }

  .footer-links.footer-legal {
    display: flex;
  }

  .user-name {
    display: none;
  }

  /* Task 1 v0.30.1 — compact type scale for the (universal) horizontal card
     on phones. The card LAYOUT is one row-form at every width; here only the
     type/padding tighten so a phone screen holds ~6 cards (the text column is
     the height driver once the media is a small chip — the thumbnail removal
     alone buys little on mobile, this buys the rest). */
  .card-body {
    padding: 0.6rem 0.75rem 0.65rem;
    gap: 0.24rem;
  }

  .card-title {
    font-size: 0.95rem;
  }

  .card-meta {
    font-size: 0.76rem;
  }
}

/* Task 1 — the brand always shows the logo + wordmark at every width
   (v0.29.1): the header has room at 320px (logo 2rem + wordmark + pincode +
   Profile chip fit the nav-inner), so the earlier v0.27.0/v0.28.0 hide-or-
   scale dance and the v0.28.1 wordmark-hide are all gone — one simple
   always-on brand, no media query. */

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation-duration: 1.6s !important;
  }
}
/* ---------- Phase 8: signed-in dashboard + favorites ---------- */

/* Favorite toggle (listing detail + htmx swap payload). */
.favorite-wrap {
  margin-top: 1rem;
}

.favorite-form {
  margin: 0;
}

.btn-fav,
.btn-fav-saved {
  gap: 0.4rem;
}

.btn-fav {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.btn-fav:hover {
  border-color: var(--brand-text);
  color: var(--brand-text);
}

.btn-fav-saved {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: #b91c1c;
}

.btn-fav-saved:hover {
  background: rgba(220, 38, 38, 0.14);
}

.fav-heart {
  font-size: 1.05rem;
  line-height: 1;
}

.fav-count {
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
}

/* Status badges (My Ads) — one badge family, label from the server. */
.badge-status {
  white-space: nowrap;
}

.badge-status-approved {
  background: var(--success-bg);
  color: var(--success-ink);
}

.badge-status-pending,
.badge-status-draft {
  background: #eef2ff;
  color: #4338ca;
}

.badge-status-revision,
.badge-status-flagged {
  background: #fef3c7;
  color: #92400e;
}

.badge-status-rejected,
.badge-status-unpublished {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-status-expired,
.badge-status-deleted {
  background: #f1f5f9;
  color: var(--muted);
}

/* My Ads list rows. */
.my-ads-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.my-ad {
  display: flex;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 1rem 1.1rem;
}

.my-ad-media {
  flex-shrink: 0;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 0.9rem;
  background: var(--brand-grad-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.my-ad-body {
  flex: 1;
  min-width: 0;
}

.my-ad-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.my-ad-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.my-ad-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.83rem;
}

.my-ad-meta .pin {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.my-ad-meta .pin svg {
  width: 0.85rem;
  height: 0.85rem;
}

.my-ad-desc {
  margin: 0.6rem 0 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.my-ad-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.btn-sm {
  min-height: 36px;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

/* Review / moderator feedback lines (My Ads). */
.feedback {
  margin-top: 0.6rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.88rem;
  line-height: 1.45;
  border-radius: 0.7rem;
}

.feedback-admin {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #7f1d1d;
}

/* "Post from the app" callout (My Ads + My Listing). */
.app-callout {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.07), rgba(245, 158, 11, 0.07));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
  color: var(--ink);
}

.app-callout-icon {
  font-size: 1.5rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.app-callout strong {
  display: block;
  margin-bottom: 0.2rem;
}

.app-callout p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.app-callout code {
  background: rgba(234, 179, 8, 0.14);
  padding: 0.05rem 0.35rem;
  border-radius: 0.35rem;
  font-weight: 600;
}

/* Listing status banner (My Listing) — the owner's Live / Pending state,
   stated plainly at the top of the dashboard. Same layout family as the
   app-callout; the state modifier tints it like the matching status badge
   (green = live, indigo = pending — the badge-status palette). */
.listing-status {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
}

.listing-status-icon {
  font-size: 1.5rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.listing-status strong {
  display: block;
  margin-bottom: 0.2rem;
}

.listing-status p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.listing-status--live {
  background: var(--success-bg);
}

.listing-status--live strong {
  color: var(--success-ink);
}

.listing-status--live p {
  color: var(--success-ink);
}

.listing-status--pending {
  background: #eef2ff;
}

.listing-status--pending strong {
  color: #3730a3;
}

.listing-status--pending p {
  color: #4338ca;
}

/* Mobile: My Ads rows stack the media accent full-width. */
@media (max-width: 639px) {
  .my-ad {
    flex-direction: column;
    gap: 0.6rem;
  }

  .my-ad-media {
    width: 2.8rem;
    height: 2.8rem;
    font-size: 1.3rem;
  }
}

/* ---------- Phase 8A: web-first creation + WhatsApp handoff ---------- */

/* Creation tiles — shared by the /post landing (removed — Task 1) and now
   the /profile hub's quick actions (manage + create). */
.post-tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 720px) {
  .post-tiles {
    grid-template-columns: 1fr 1fr;
  }
}

.post-tile {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 1.5rem 1.4rem;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.15s ease;
}

.post-tile:hover {
  transform: translateY(-2px);
  border-color: var(--brand-1);
}

.post-tile-icon {
  font-size: 1.8rem;
}

.post-tile h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.post-tile p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  flex: 1;
}

/* ---------- Task 1: /profile — the signed-in account hub ---------- */

.profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .profile-grid {
    grid-template-columns: 1.15fr 1fr;
    align-items: start;
  }
}

.profile-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 1.4rem 1.4rem;
}

.profile-card > h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}

.profile-avatar {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
}

.profile-avatar--init {
  background: var(--brand-grad);
  color: var(--brand-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
}

.profile-name {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.profile-email {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  word-break: break-word;
}

.profile-hint {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.profile-form {
  margin: 1.25rem 0 0;
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
}

.profile-form .pincode-form {
  max-width: none;
}

/* Light-surface variant of the pincode controls — the hero input is a
   dark-glass chip on the hero gradient; on the white profile card it needs
   the light input family instead. */
.profile-form .pincode-input {
  flex: 1 1 12rem;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.profile-form .pincode-input::placeholder {
  color: var(--muted);
}

.profile-form .pincode-input:focus {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 4px rgba(234, 179, 8, 0.18);
}

.profile-field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.profile-signout {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.profile-signout .btn {
  width: 100%;
}

/* Success / error flash on the profile page (saved pincode etc). */
.profile-notice-ok {
  border-color: rgba(22, 163, 74, 0.4);
  background: rgba(240, 253, 244, 0.9);
}

.profile-notice-err {
  border-color: rgba(220, 38, 38, 0.4);
  background: rgba(254, 242, 242, 0.9);
}

/* Forms (classified + service). */
.web-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 1.4rem;
  max-width: 720px;
}

.form-field {
  margin-bottom: 1rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 1rem;
}

@media (min-width: 640px) {
  .form-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.form-label .req {
  color: #dc2626;
}

.form-input {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  font-size: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
}

textarea.form-input {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.18);
}

.form-hint {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--ink);
  margin: 0.75rem 0 1rem;
  cursor: pointer;
}

.form-check input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  accent-color: var(--brand-1);
}

/* Working-schedule picker (/post/listing, /my/listing/edit — Task 1): the
   day row is plain checkbox chips. Checked state via :has (same
   baseline-era CSS as the terms gate) — the strict public CSP allows no
   inline script, and the server composes the stored binary string, so the
   chips are pure native checkboxes. */
.day-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.day-chip {
  cursor: pointer;
}

.day-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.day-chip span {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.day-chip:has(input:checked) span {
  background: var(--brand-1);
  border-color: var(--brand-1);
  color: var(--brand-ink);
}

.day-chip input:focus-visible + span {
  outline: 3px solid rgba(245, 158, 11, 0.4);
  outline-offset: 1px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

/* Terms gate (/post/ad — Task 1): the classified form's submit action stays
   hidden until the Terms of Service checkbox is ticked. Pure CSS (:has) so
   the strict public CSP needs no inline script; when the checkbox is checked
   (including the server re-render after a validation error, where the prefill
   re-checks it) the action reappears. Graceful degradation: if :has is
   unsupported the button stays hidden — the form can never submit without
   consent, so the server-side versioned-consent check is never bypassed. */
.terms-gate {
  display: none;
}

.web-form:has(input[name="termsAccepted"]:checked) .terms-gate {
  display: flex;
}

.form-error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 0.7rem 1rem;
  border-radius: 0.7rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  max-width: 720px;
}

/* WhatsApp handoff card (shared partial). */
.handoff-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 1.4rem;
  max-width: 720px;
  margin-bottom: 1.25rem;
}

.handoff-row {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 0.9rem;
}

.handoff-icon {
  font-size: 1.6rem;
  line-height: 1.2;
}

.handoff-card h3 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.handoff-number {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.handoff-message {
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: 0.7rem;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.handoff-message code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.55;
}

.handoff-card .btn-block {
  width: 100%;
}

.handoff-hint {
  margin: 0.7rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.handoff-missing {
  border-color: #fde68a;
  background: #fffbeb;
}

.handoff-missing h3 {
  color: #92400e;
}

.handoff-missing p {
  color: #78350f;
}

/* "What happens next" explainer on confirm pages. */
.next-steps {
  max-width: 720px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
}

.next-steps h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.next-steps ol {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.next-steps code {
  background: #f1f5f9;
  padding: 0.05rem 0.35rem;
  border-radius: 0.35rem;
  font-weight: 600;
}

/* Verify-on-WhatsApp resume action (My Listing). */
.verify-form {
  margin-top: 0.75rem;
  max-width: 720px;
}

/* === Privacy & compliance surfaces (Task — docs/COMPLIANCE.md) ===
   /consent, /grievance, /cookies + the footer consent link and the
   cookie-consent banner. Styling reuses the design-system tokens. */
.compliance-list {
  margin: 0.5rem 0 1rem;
  padding-left: 1.2rem;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.7;
}
.compliance-list li { margin-bottom: 0.35rem; }

.compliance-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 1rem;
  font-size: 0.88rem;
}
.compliance-table th, .compliance-table td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.compliance-table th {
  font-weight: 700;
  color: var(--ink);
  background: #f8fafc;
}
.compliance-table code {
  background: #f1f5f9;
  padding: 0.05rem 0.35rem;
  border-radius: 0.35rem;
  font-weight: 600;
}

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.profile-ok {
  color: #047857;
  font-weight: 600;
}

.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 90;
  max-width: 34rem;
  margin: 0 auto;
  background: var(--ink);
  color: #fff;
  border-radius: 1rem;
  box-shadow: 0 18px 40px -14px rgba(15, 23, 42, 0.5);
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.cookie-banner-text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  flex: 1 1 18rem;
}
.cookie-banner-link {
  color: var(--brand-1);
  text-decoration: underline;
}
.cookie-banner-actions {
  display: flex;
  gap: 0.5rem;
}
.cookie-banner .btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
}
