/* ============================================================
   MarketMatch V3 — shared design foundation (Phase 1 shell)
   Static, additive. Job-board clarity + light marketplace polish.
   Brand tokens are canonical (see CLAUDE.md / index.html).
   ============================================================ */

:root {
  --red:        #C5120B;
  --red-dark:   #A30E09;
  --red-soft:   #FDF2F3;
  --red-bd:     #FECACA;
  --navy:       #1F2A44;
  --navy-soft:  #253354;
  --ink:        #1F2A44;
  --muted:      #5C6370;
  --light:      #9CA3AF;
  --line:       #E7E2DD;
  --bg:         #FFFFFF;
  --bg-soft:    #F7F6F4;
  --bg-warm:    #FBF8F4;
  --green:      #059669;
  --green-soft: #ECFDF5;
  --amber:      #B45309;
  --amber-soft: #FEF3E2;
  --blue:       #1D4ED8;
  --blue-soft:  #EEF2FF;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(31,42,68,.04), 0 4px 16px rgba(31,42,68,.05);
  --maxw: 1160px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg-soft);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { color: var(--navy); line-height: 1.2; margin: 0; }
p { margin: 0; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; width: 100%; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ── NAV ─────────────────────────────────────────── */
.v3-nav { background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 100; }
.v3-nav-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; height: 66px; display: flex; align-items: center; justify-content: space-between; }
.v3-logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; letter-spacing: -.3px; }
.v3-logo b { color: var(--red); }
.v3-logo .pill { font-size: 10px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 20px; padding: 2px 8px; letter-spacing: .04em; white-space: nowrap; flex-shrink: 0; }
.v3-nav-links { display: flex; align-items: center; gap: 8px; }
.v3-nav-links a { color: var(--muted); font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: var(--radius-sm); }
.v3-nav-links a:hover { color: var(--navy); background: var(--bg-soft); }
/* Primary CTA button in the nav keeps white text (nav-link colour must not override it). */
.v3-nav-links a.btn-primary, .v3-nav-links a.btn-primary:hover { color: #fff; background: var(--red); }
.v3-nav-links a.btn-primary:hover { background: var(--red-dark); }

/* ── BUTTONS ─────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--sans);
  font-weight: 700; font-size: 15px; padding: 12px 22px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s; text-align: center; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-secondary { background: var(--navy); color: #fff; }
.btn-secondary:hover { background: var(--navy-soft); }
.btn-outline { background: var(--bg); color: var(--navy); border-color: var(--line); }
.btn-outline:hover { border-color: var(--navy); }
.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn-block { width: 100%; }

/* ── BADGES ──────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; line-height: 1.4; white-space: nowrap; }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
/* opportunity type */
.type-local_job { background: var(--green-soft); color: var(--green); }
.type-private_quote_request { background: var(--blue-soft); color: var(--blue); }
.type-tender_level_opportunity { background: var(--amber-soft); color: var(--amber); }
/* source */
.src-marketmatch_posted { background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); }
.src-find_a_tender_import { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.src-admin_created { background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); }
/* status (V3 canonical lifecycle) */
.status-open { background: var(--green-soft); color: var(--green); }
.status-closing_soon { background: var(--amber-soft); color: var(--amber); }
.status-closed { background: var(--bg-soft); color: var(--light); }
.status-pending_review { background: var(--blue-soft); color: var(--blue); }
.status-draft { background: var(--bg-soft); color: var(--muted); }
.status-rejected { background: var(--red-soft); color: var(--red); }
/* legacy aliases (kept for safety) */
.status-approved { background: var(--green-soft); color: var(--green); }
.status-pending { background: var(--amber-soft); color: var(--amber); }
.badge-cat { background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); }
.badge-promoted { background: var(--red-soft); color: var(--red); border: 1px solid var(--red-bd); }

/* ── HERO ────────────────────────────────────────── */
.hero { background: linear-gradient(180deg, #fff 0%, var(--bg-soft) 100%); border-bottom: 1px solid var(--line); padding: 72px 0 64px; }
.hero h1 { font-size: 48px; letter-spacing: -1.2px; }
.hero .sub { font-size: 19px; color: var(--muted); max-width: 640px; margin: 18px auto 0; }
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.hero .note { font-size: 13px; color: var(--light); margin-top: 16px; }

/* ── SECTIONS ────────────────────────────────────── */
.section { padding: 56px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.section-head h2 { font-size: 30px; letter-spacing: -.5px; }
.section-head p { color: var(--muted); margin-top: 10px; font-size: 16px; }
.section-alt { background: var(--bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ── GRID ────────────────────────────────────────── */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 880px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } .hero h1 { font-size: 36px; } }

/* ── LAYER CARDS (home) ──────────────────────────── */
.layer-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.layer-card h3 { font-size: 19px; margin-bottom: 8px; }
.layer-card p { color: var(--muted); font-size: 14px; }
.layer-card ul { margin: 14px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.layer-card li { margin: 4px 0; }
.layer-card .action { margin-top: 16px; font-size: 13px; font-weight: 700; color: var(--navy); }

/* ── HOW IT WORKS ────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 880px) { .steps { grid-template-columns: 1fr 1fr; } }
.step { text-align: center; padding: 8px; }
.step .num { width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.step h4 { margin: 0 0 6px; font-size: 15px; color: var(--navy); }
.step p { font-size: 13px; color: var(--muted); }

/* ── OPPORTUNITY CARD ────────────────────────────── */
.opp-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; transition: border-color .15s, box-shadow .15s; }
.opp-card:hover { border-color: #d8d2cb; box-shadow: 0 2px 4px rgba(31,42,68,.06), 0 8px 28px rgba(31,42,68,.08); }
.opp-card-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.opp-card h3 { font-size: 17px; letter-spacing: -.2px; }
.opp-card .desc { color: var(--muted); font-size: 14px; }
.opp-card .meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.opp-card .meta span { display: inline-flex; align-items: center; gap: 5px; }
.opp-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 2px; }
.opp-card .posted { font-size: 12px; color: var(--light); }

/* ── OPPORTUNITY LIST (board: vertical job/tender directory) ── */
.opp-list { display: flex; flex-direction: column; gap: 10px; }
.opp-row {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px 20px; transition: border-color .12s;
}
.opp-row:hover { border-color: #cfc9c1; }
.opp-row-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.opp-row-title { font-size: 17px; letter-spacing: -.2px; margin: 0; flex: 1 1 auto; min-width: 0; line-height: 1.35; }
.opp-row-title a:hover { color: var(--red); }
.opp-row-cta { flex: 0 0 auto; white-space: nowrap; }
.opp-row-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.opp-row-desc {
  color: var(--light); font-size: 13px; line-height: 1.5; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.opp-row-meta { display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 13px; color: var(--ink); }
.opp-row-meta .meta-item { color: var(--ink); }
.opp-row-meta .meta-posted { color: var(--light); }
/* labelled metadata (shared by board list, cards, detail) */
.meta-label { color: var(--muted); margin-right: 5px; }
@media (max-width: 720px) {
  .opp-row { padding: 16px; }
  .opp-row-head { flex-direction: column; gap: 12px; }
  .opp-row-cta { width: 100%; text-align: center; }
}

/* ── FILTER BAR ──────────────────────────────────── */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.tab { font-size: 14px; font-weight: 600; padding: 9px 16px; border-radius: 22px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); cursor: pointer; }
.tab[aria-selected="true"], .tab:hover { border-color: var(--navy); color: var(--navy); }
.tab[aria-selected="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.filters { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 12px; margin-bottom: 26px; box-shadow: var(--shadow); }
@media (max-width: 880px) { .filters { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 700; color: var(--muted); }
.field input, .field select, .field textarea { font-family: var(--sans); font-size: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--ink); width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy); }
.field textarea { resize: vertical; min-height: 110px; }
/* Anchor targets sit clear of the sticky nav when linked to (e.g. #supplier-list, #request-form). */
#request-form, #supplier-list { scroll-margin-top: 84px; }

/* ── EMPTY STATE ─────────────────────────────────── */
.empty { text-align: center; background: var(--bg); border: 1px dashed var(--line); border-radius: var(--radius); padding: 48px 24px; color: var(--muted); }
.empty h3 { font-size: 18px; margin-bottom: 8px; }
.empty p { font-size: 14px; max-width: 420px; margin: 0 auto 18px; }

/* ── DETAIL PAGE ─────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }
@media (max-width: 880px) { .detail-grid { grid-template-columns: 1fr; } }
.panel { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 20px; }
.detail-meta { list-style: none; padding: 0; margin: 0; }
.detail-meta li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.detail-meta li:last-child { border-bottom: none; }
.detail-meta .k { color: var(--muted); }
.detail-meta .v { color: var(--navy); font-weight: 600; text-align: right; }
.privacy-note { background: var(--bg-warm); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 13px; color: var(--muted); margin-top: 18px; }
.privacy-note b { color: var(--navy); }

/* ── CHOICE CARDS (post) ─────────────────────────── */
.choice-card { background: var(--bg); border: 2px solid var(--line); border-radius: var(--radius); padding: 22px; cursor: pointer; transition: border-color .15s; }
.choice-card:hover, .choice-card[aria-pressed="true"] { border-color: var(--red); }
.choice-card h3 { font-size: 17px; margin-bottom: 6px; }
.choice-card p { font-size: 13px; color: var(--muted); }

/* ── CTA SECTION ─────────────────────────────────── */
.cta-band { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 40px; text-align: center; }
.cta-band h2 { color: #fff; font-size: 26px; }
.cta-band p { color: #c7cedb; margin: 10px auto 22px; max-width: 520px; }
.cta-band .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.cta-band .btn-outline:hover { border-color: #fff; }

/* ── FORM NOTE ───────────────────────────────────── */
.form-note { font-size: 13px; color: var(--muted); background: var(--green-soft); border: 1px solid #C7F0DD; color: #0f7a52; border-radius: var(--radius-sm); padding: 10px 14px; display: inline-flex; gap: 8px; align-items: center; }

/* ── FOOTER ──────────────────────────────────────── */
.v3-footer { margin-top: auto; background: var(--bg); border-top: 1px solid var(--line); padding: 32px 0; }
.v3-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }
.v3-footer .links { display: flex; flex-wrap: wrap; gap: 18px; }
.v3-footer a { color: var(--muted); font-size: 13px; }
.v3-footer a:hover { color: var(--navy); }
.v3-footer .copy { font-size: 12px; color: var(--light); }

/* ── PHASE BANNER (shell only) ───────────────────── */
.phase-banner { background: var(--amber-soft); color: var(--amber); text-align: center; font-size: 13px; font-weight: 600; padding: 7px 16px; border-bottom: 1px solid #F3D9B0; }

/* ============================================================
   Section B / Phase 5.7 — shared mobile chrome polish
   Fixes pre-existing overflow on nav, hero, CTA bands, filters
   at small widths. No board-logic / layout-system changes.
   ============================================================ */
/* Backstop: never allow horizontal scrolling of the page chrome. */
html, body { max-width: 100%; overflow-x: hidden; }
.cta-band, .hero, .opp-row, .panel { overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  /* Nav: let logo + links + CTA wrap instead of overflowing the 66px row. */
  .v3-nav-inner { height: auto; min-height: 58px; flex-wrap: wrap; padding: 8px 16px; gap: 6px 10px; }
  .v3-nav-links { flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
  .v3-nav-links a { padding: 6px 8px; font-size: 13px; }
  .v3-logo { font-size: 16px; }
  /* Hero scales down so the headline never overflows. */
  .hero { padding: 44px 0 36px; }
  .hero h1 { font-size: 28px; letter-spacing: -.6px; }
  .hero .sub { font-size: 15px; }
  .hero-ctas .btn { width: 100%; }
  /* Section headings + dark CTA band stay within the viewport. */
  .section { padding: 40px 0; }
  .section-head h2 { font-size: 22px; }
  .cta-band { padding: 26px 18px; }
  .cta-band h2 { font-size: 20px; }
  .cta-band p { font-size: 14px; }
  .cta-band .btn { width: 100%; }
}
/* Filters stack to a single column on narrow phones (kept 2-up at 880, see above). */
@media (max-width: 560px) {
  .filters { grid-template-columns: 1fr; }
}

/* ── FORM SECTIONS + CHECKBOX GRID (provider-alerts / forms) ── */
.form-section-h {
  font-size: 13px; font-weight: 700; color: var(--navy); text-transform: uppercase;
  letter-spacing: .05em; margin: 26px 0 14px; padding-bottom: 7px; border-bottom: 1px solid var(--line);
}
.form-section-h:first-of-type { margin-top: 0; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin-top: 6px; }
.check-grid-1 { grid-template-columns: 1fr; }
.check-item {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  font-size: 14px; font-weight: 500; color: var(--ink);
  padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); cursor: pointer; transition: border-color .12s, background .12s;
}
.check-item:hover { border-color: #cfc9c1; }
/* override .field input{width:100%;padding:10px 12px} so the box stays a normal native checkbox */
.check-item input[type="checkbox"] { flex: 0 0 auto; width: 16px; height: 16px; min-width: 16px; padding: 0; margin: 0; }
.check-item span { flex: 1 1 auto; min-width: 0; white-space: normal; }   /* labels wrap at word boundaries, never mid-word */
@media (max-width: 560px) { .check-grid { grid-template-columns: 1fr; } }

/* ── MULTI-STEP POST FLOW (Phase: post flow redesign) ── */
.stepper { margin: 0 0 26px; }
.stepper-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.stepper-head .step-name { color: var(--navy); }
.stepper-track { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.stepper-fill { height: 100%; width: 25%; background: var(--red); border-radius: 999px; transition: width .25s ease; }
.post-step { display: none; }
.post-step.active { display: block; }
.post-step > h3 { font-size: 18px; margin: 0 0 4px; }
.post-step > .step-sub { font-size: 14px; color: var(--muted); margin: 0 0 18px; }
.step-actions { display: flex; gap: 12px; align-items: center; margin-top: 26px; flex-wrap: wrap; }
.step-actions .spacer { flex: 1 1 auto; }
/* Review summary */
.review-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 6px; background: var(--bg); }
.review-box + .review-box { margin-top: 14px; }
.review-box h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 12px; }
.review-grid { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: 14px; }
.review-grid dt { color: var(--muted); font-weight: 600; }
.review-grid dd { margin: 0; overflow-wrap: anywhere; }
.review-private { background: var(--bg-soft); }
@media (max-width: 560px) {
  .review-grid { grid-template-columns: 1fr; gap: 2px 0; }
  .review-grid dd { margin: 0 0 8px; }
  .step-actions .btn { flex: 1 1 auto; }
}

/* ── BOARD FILTER SYSTEM (sidebar on desktop, drawer on mobile) ── */
.board-search { display: flex; gap: 12px; align-items: flex-end; margin: 0 0 14px; }
.board-search .field { flex: 1 1 auto; margin: 0; }
.board-search .sort-field { flex: 0 0 auto; width: 190px; }
.board-controls { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.board-controls #result-count { margin: 0; font-size: 14px; }
.filter-toggle-btn { display: none; }              /* desktop: hidden (sidebar always visible) */
.filter-count-badge { background: var(--red); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 700; padding: 1px 7px; margin-left: 6px; }

/* active filter chips */
.active-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.active-chips:empty { margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--navy);
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1; padding: 0; }
.chip button:hover { color: var(--red); }
.chip-clear { color: var(--red); cursor: pointer; font-weight: 700; font-size: 13px; background: none; border: 0; padding: 4px 6px; }

/* layout: sidebar + results */
.board-layout { display: grid; grid-template-columns: 248px 1fr; gap: 28px; align-items: start; }
.filter-sidebar { position: sticky; top: 84px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px; }
.filter-drawer-head { display: none; }
.filter-group { padding: 16px 0; border-bottom: 1px solid var(--line); }
.filter-group:last-of-type { border-bottom: 0; }
.filter-group h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 10px; }
.filter-check { display: flex; align-items: center; gap: 9px; font-size: 14px; padding: 4px 0; cursor: pointer; }
.filter-check input[type="checkbox"] { flex: 0 0 auto; width: 15px; height: 15px; margin: 0; }
.filter-check span { overflow-wrap: anywhere; }
.loc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.loc-chip { font-size: 12px; font-weight: 600; color: var(--navy); background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.loc-chip:hover, .loc-chip[aria-pressed="true"] { border-color: var(--red); color: var(--red); }
.filter-actions { display: flex; gap: 10px; padding: 16px 0; flex-wrap: wrap; }
#apply-filters { display: none; }                  /* desktop: live filtering, no Apply needed */
.filter-backdrop { display: none; }

/* tablet/mobile: sidebar becomes a slide-in drawer */
@media (max-width: 880px) {
  .board-layout { grid-template-columns: 1fr; gap: 0; }
  .filter-toggle-btn { display: inline-flex; }
  .filter-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(340px, 86vw); z-index: 200;
    border-radius: 0; border: 0; border-right: 1px solid var(--line); padding: 0 18px 18px;
    overflow-y: auto; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow);
  }
  .filter-sidebar.open { transform: translateX(0); }
  .filter-drawer-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0;
    background: var(--bg); padding: 16px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
  .filter-drawer-head h3 { font-size: 17px; }
  .filter-drawer-head button { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted);
    min-width: 44px; min-height: 44px; padding: 8px; margin: -8px -8px -8px 0; display: inline-flex; align-items: center; justify-content: center; }
  #apply-filters { display: inline-flex; }
  .filter-actions { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); }
  .filter-actions .btn { flex: 1 1 auto; }
  .filter-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(31,42,68,.4); z-index: 190; }
  .board-search { flex-wrap: wrap; }
  .board-search .sort-field { width: 100%; }
}

/* ── CONSENT BANNER + MANAGE MODAL (UK GDPR/PECR) ── */
.mm-consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 300; background: var(--bg); border-top: 1px solid var(--line); box-shadow: 0 -2px 16px rgba(31,42,68,.08); }
.mm-consent-inner { max-width: var(--maxw); margin: 0 auto; padding: 16px 24px; display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.mm-consent-text { font-size: 13px; color: var(--muted); max-width: 720px; line-height: 1.5; }
.mm-consent-text strong { color: var(--navy); }
.mm-consent-text a { color: var(--red); font-weight: 600; }
.mm-consent-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.mm-manage-backdrop { position: fixed; inset: 0; z-index: 310; background: rgba(31,42,68,.45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.mm-manage { position: relative; background: var(--bg); border-radius: var(--radius); padding: 26px; max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); }
.mm-manage h3 { font-size: 19px; }
.mm-manage-sub { font-size: 14px; color: var(--muted); margin: 6px 0 16px; }
.mm-toggle-row { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--line); }
.mm-toggle-meta { display: flex; flex-direction: column; gap: 3px; }
.mm-toggle-label { font-weight: 700; font-size: 14px; color: var(--navy); }
.mm-toggle-desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.mm-toggle-row input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; }
.mm-manage-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; flex-wrap: wrap; }
.mm-manage-close { position: absolute; top: 14px; right: 16px; border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }
@media (max-width: 560px) {
  .mm-consent-inner { padding: 14px 16px; }
  .mm-consent-actions { width: 100%; }
  .mm-consent-actions .btn { flex: 1 1 auto; }
}

/* ── ADS LANDING / CATEGORY PAGES (buyer-acquisition) ── */
.lp-hero { text-align: center; padding: 52px 0 38px; background: linear-gradient(180deg, #fff 0%, var(--bg-soft) 100%); border-bottom: 1px solid var(--line); }
.lp-hero h1 { font-size: 34px; letter-spacing: -.8px; }
.lp-hero .sub { font-size: 17px; color: var(--muted); max-width: 560px; margin: 14px auto 0; }
.lp-hero .lp-cta { margin-top: 24px; }
.lp-hero .trust { font-size: 13px; color: var(--light); margin-top: 16px; max-width: 560px; margin-left: auto; margin-right: auto; }
.steps-3 { grid-template-columns: repeat(3, 1fr); }
.lp-examples { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.lp-chip { font-size: 13px; font-weight: 600; color: var(--navy); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; }
.lp-chip:hover { border-color: var(--red); color: var(--red); }
@media (max-width: 880px) { .steps-3 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .lp-hero { padding: 40px 0 30px; } .lp-hero h1 { font-size: 27px; } .lp-hero .lp-cta .btn { width: 100%; } }

/* ============================================================
   MOBILE DENSITY REFINEMENT (≤560 / ≤400) — compact paid-search feel.
   Appended last so it overrides earlier mobile rules. Structure unchanged.
   ============================================================ */
@media (max-width: 560px) {
  body { line-height: 1.5; }
  /* Private-preview banner: smaller, less first-screen space */
  .phase-banner { font-size: 11.5px; padding: 4px 14px; line-height: 1.35; }
  /* Header / nav: tighter, smaller red CTA */
  .v3-nav-inner { min-height: 50px; padding: 6px 14px; gap: 4px 8px; }
  .v3-logo { font-size: 15px; gap: 7px; }
  .v3-logo .pill { font-size: 9px; padding: 1px 6px; }
  .v3-nav-links { gap: 2px; }
  .v3-nav-links a { font-size: 12.5px; padding: 5px 7px; }
  .v3-nav-links a.btn { padding: 7px 12px; font-size: 13px; }
  /* Buttons: tappable (~46px) but not giant */
  .btn { padding: 13px 18px; font-size: 15px; }
  .btn-sm { padding: 9px 14px; font-size: 13px; }
  /* Hero (ads landing + provider .hero): compact */
  .lp-hero { padding: 28px 0 22px; }
  .lp-hero h1 { font-size: 26px; line-height: 1.15; letter-spacing: -.4px; }
  .lp-hero .sub { font-size: 15px; line-height: 1.45; margin-top: 10px; }
  .lp-hero .lp-cta { margin-top: 16px; }
  .lp-hero .trust { font-size: 12px; margin-top: 12px; }
  .hero { padding: 30px 0 24px; }
  .hero h1 { font-size: 26px; line-height: 1.15; }
  .hero .sub { font-size: 15px; line-height: 1.45; }
  /* Sections + headings: less vertical space, tighter gaps */
  .section { padding: 34px 0; }
  .section-head { margin: 0 auto 20px; }
  .section-head h2 { font-size: 21px; }
  .section-head p { font-size: 14px; margin-top: 6px; }
  /* Cards compact */
  .panel { padding: 18px; }
  .layer-card { padding: 18px; }
  .steps { gap: 12px; }
  .step { padding: 4px; }
  .step .num { width: 32px; height: 32px; margin-bottom: 8px; }
  /* Form stays comfortable, just a touch tighter */
  .field input, .field select, .field textarea { font-size: 16px; padding: 11px 12px; } /* 16px avoids iOS zoom */
  .lp-examples { gap: 6px; }
}
@media (max-width: 400px) {
  .lp-hero h1, .hero h1 { font-size: 24px; }
  .lp-hero .sub, .hero .sub { font-size: 14.5px; }
  .section { padding: 30px 0; }
}

/* ============================================================
   MOBILE REQUEST-FORM DENSITY (≤560) — fast, compact, mobile-native.
   Shared by /v3 inline form, category forms, and /v3/post steps.
   Inputs stay 16px (no iOS zoom) and ≥44px tall.
   ============================================================ */
@media (max-width: 560px) {
  /* tighter field stacking */
  .grid { gap: 12px; }
  .field { gap: 4px; }
  .field label { font-size: 12px; line-height: 1.3; }
  .field input, .field select, .field textarea { font-size: 16px; padding: 10px 12px; min-height: 44px; }
  .field textarea { min-height: 84px; }
  .field input::placeholder, .field textarea::placeholder { font-size: 15px; }
  /* compact card */
  .panel { padding: 16px; }
  /* submit stays reachable above the fixed consent banner */
  .btn-block, #lp-submit, #submit-btn { min-height: 46px; scroll-margin-bottom: 150px; }
  #request-form, #supplier-list { scroll-margin-top: 72px; }
  /* multi-step (/v3/post) compactness */
  .stepper { margin-bottom: 18px; }
  .stepper-head { font-size: 12px; margin-bottom: 6px; }
  .post-step > h3 { font-size: 16px; }
  .post-step > .step-sub { font-size: 13px; margin: 0 0 12px; }
  .step-actions { margin-top: 18px; gap: 10px; }
  /* consent checkbox row: compact but readable */
  #lp-form > label, #post-form label[style*="align-items:flex-start"] { font-size: 13.5px; }
}

/* ============================================================
   HOMEPAGE responsive form vs desktop landing.
   Mobile-first: inline form shown; desktop landing hidden.
   ≥700px (tablet/desktop): hide inline form, show landing grid + CTA.
   ============================================================ */
.mm-only-desktop { display: none; }
@media (min-width: 700px) {
  .mm-only-mobile { display: none; }
  .mm-only-desktop { display: block; }
}
.lp-cta-final { text-align: center; margin-top: 26px; }

/* ============================================================
   HOMEPAGE (procurement notice board) — route cards + trust strip.
   ============================================================ */
.route-card { display: flex; flex-direction: column; }
.route-card .btn { margin-top: 16px; align-self: flex-start; }
.route-card-primary { border-color: var(--red-bd); }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.trust-item { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--bg); font-weight: 600; font-size: 14px; color: var(--navy); }
.trust-item::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red); flex: 0 0 auto; }
.rr-meta { font-size: 13px; color: var(--muted); margin: 8px 0 6px; }
@media (max-width: 880px) { .trust-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .route-card .btn { width: 100%; align-self: stretch; } }

/* ── HOMEPAGE route-section polish ── */
.route-badge { align-self: flex-start; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 10px; border-radius: 999px; margin-bottom: 12px; }
.route-badge-buyer { background: var(--red-soft); color: var(--red); border: 1px solid var(--red-bd); }
.route-badge-supplier { background: var(--bg-soft); color: var(--navy); border: 1px solid var(--line); }
.route-card-primary { box-shadow: 0 1px 2px rgba(31,42,68,.05), 0 6px 22px rgba(197,18,11,.07); }
/* desktop: bring hero + route choice tighter so above-the-fold feels intentional, not sparse */
@media (min-width: 700px) {
  .lp-hero { padding: 40px 0 28px; }
  .route-section { padding-top: 32px; }
  .route-card { padding: 24px 26px; }
}

/* ── HOMEPAGE hero polish (scoped: .lp-hero-home only; category heroes unchanged) ── */
.lp-hero-home { background: var(--bg-warm); }
.lp-hero-home .trust { font-size: 13px; }
@media (min-width: 700px) {
  .lp-hero-home { padding: 40px 0 30px; }
  /* subtle notice-board card so the hero isn't flat text on a flat band */
  .lp-hero-card { max-width: 780px; margin: 0 auto; background: var(--bg); border: 1px solid var(--line);
    border-radius: 18px; padding: 40px 52px; box-shadow: 0 1px 2px rgba(31,42,68,.04), 0 10px 34px rgba(31,42,68,.06); }
  .lp-hero-home + .section { padding-top: 30px; }   /* bring How it works closer */
  .steps-3 { max-width: 900px; margin-left: auto; margin-right: auto; }  /* keep the 3 steps visually connected */
}

/* ── MOBILE compact how-it-works (≤700): number badge left, text right ── */
@media (max-width: 700px) {
  .steps-3 { grid-template-columns: 1fr; gap: 0; }
  .steps-3 .step { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 2px; text-align: left; padding: 14px 0; border-top: 1px solid var(--line); }
  .steps-3 .step:first-child { border-top: 0; padding-top: 4px; }
  .steps-3 .step .num { grid-column: 1; grid-row: 1 / span 2; width: 30px; height: 30px; margin: 0; font-size: 14px; }
  .steps-3 .step h4 { grid-column: 2; grid-row: 1; margin: 0; font-size: 15px; }
  .steps-3 .step p { grid-column: 2; grid-row: 2; margin: 0; font-size: 13px; }
}

/* ── MOBILE compact route cards (≤700): action-row feel, not bulky cards ── */
@media (max-width: 700px) {
  .route-section .grid-2 { gap: 12px; }
  .route-card { padding: 16px 16px; }
  .route-card .route-badge { margin-bottom: 8px; font-size: 10.5px; padding: 2px 9px; }
  .route-card h3 { font-size: 17px; margin-bottom: 4px; }
  .route-card p { font-size: 13px; }
  /* compact inline CTA (overrides the ≤560 full-width rule); still ≥44px tap height */
  .route-card .btn { width: auto; align-self: flex-start; margin-top: 12px; padding: 11px 18px; min-height: 44px; }
}

/* ============================================================
   Homepage redesign (SaaS-style landing) — scoped .home-* classes only.
   ============================================================ */
body.home { background: var(--bg-warm); }
.home-hero { padding: 56px 0 40px; }
.home-hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.home-hero-left h1 { font-size: 46px; letter-spacing: -1px; line-height: 1.08; }
.home-hero-left .home-sub { color: var(--muted); font-size: 18px; line-height: 1.55; margin: 20px 0 24px; max-width: 34em; }
.home-trust-row { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.home-trust-item { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--navy); }
.home-trust-item .tick { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--red-soft); color: var(--red); font-size: 12px; font-weight: 700; flex-shrink: 0; }
.home-hero-card { background: var(--bg); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 6px 30px rgba(31,42,68,.09); padding: 34px; text-align: center; }
.home-hero-card h2 { font-size: 22px; letter-spacing: -.3px; }
.home-hero-card .card-sub { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 12px 0 22px; }
.home-hero-card .card-ctas { display: flex; flex-direction: column; gap: 10px; }
.home-hero-card .card-ctas .btn { width: 100%; }
.home-hero-card .card-fine { font-size: 12px; color: var(--light); margin-top: 16px; }

.home-benefits { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 18px; background: var(--bg); overflow: hidden; box-shadow: var(--shadow); }
.home-benefit { padding: 26px 22px; border-left: 1px solid var(--line); }
.home-benefit:first-child { border-left: 0; }
.home-benefit .b-icon { width: 42px; height: 42px; border-radius: 11px; background: var(--red-soft); color: var(--red); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 13px; }
.home-benefit h3 { font-size: 16px; letter-spacing: -.2px; }
.home-benefit p { color: var(--muted); font-size: 14px; margin-top: 6px; line-height: 1.5; }

.home-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; position: relative; margin-top: 8px; }
.home-steps::before { content: ""; position: absolute; top: 24px; left: 16.66%; right: 16.66%; border-top: 2px dotted var(--line); z-index: 0; }
.home-step { text-align: center; padding: 0 14px; position: relative; z-index: 1; }
.home-step-num { width: 48px; height: 48px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; font-size: 18px; display: inline-flex; align-items: center; justify-content: center; margin: 0 auto 16px; box-shadow: 0 0 0 6px var(--bg-soft); }
.home-step h3 { font-size: 18px; letter-spacing: -.2px; }
.home-step p { color: var(--muted); font-size: 15px; margin-top: 8px; line-height: 1.55; }
.home-statement { text-align: center; font-size: 22px; font-weight: 700; color: var(--navy); letter-spacing: -.3px; margin-top: 40px; }
.home-statement .hs-red { color: var(--red); }

@media (max-width: 860px) {
  .home-hero { padding: 36px 0 28px; }
  .home-hero-inner { grid-template-columns: 1fr; gap: 26px; }
  .home-hero-left h1 { font-size: 34px; }
  .home-hero-left .home-sub { font-size: 16px; }
  .home-benefits { grid-template-columns: 1fr 1fr; }
  .home-benefit { border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
  .home-benefit:nth-child(1), .home-benefit:nth-child(2) { border-top: 0; }
  .home-benefit:nth-child(odd) { border-left: 0; }
  .home-steps { grid-template-columns: 1fr; gap: 26px; }
  .home-steps::before { display: none; }
  .home-step-num { box-shadow: none; }
  .home-statement { font-size: 19px; }
}
@media (max-width: 480px) {
  .home-hero-left h1 { font-size: 29px; }
  .home-benefits { grid-template-columns: 1fr; }
  .home-benefit { border-left: 0; border-top: 1px solid var(--line); }
  .home-benefit:first-child { border-top: 0; }
}
