/* ==========================================================================
   Appariement annonce ↔ prestataire (match.js, match-ui.js)
   Pastilles de raisons, « Demandes pour vous » (tableau de bord), bandeau de correspondance (annonce),
   « Prestataires recommandés » (annonce du client). Chargé après les feuilles de pages.
   ========================================================================== */

/* ---------- Pastilles de raisons ---------- */
.match-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.match-chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 2px 9px; border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink-2); font-size: var(--fs-xs); font-weight: 600; line-height: 1.3; white-space: nowrap;
}
.match-chip .icon { color: var(--muted); }
.match-chip.is-invited { background: var(--brand-soft); color: var(--brand-ink); }
.match-chip.is-invited .icon { color: var(--brand); }
.match-chip.is-near, .match-chip.is-region { background: var(--info-soft); color: #1e3a8a; }
.match-chip.is-near .icon, .match-chip.is-region .icon { color: var(--info); }
.match-chip.is-first { background: var(--warning-soft); color: #7a4d00; }
.match-chip.is-first .icon { color: var(--warning); }
.match-chip.is-verified, .match-chip.is-rated { background: var(--success-soft); color: #05602e; }
.match-chip.is-verified .icon, .match-chip.is-rated .icon { color: var(--success); }

/* ---------- Tableau de bord : « Demandes pour vous » ---------- */
.db-match { margin-bottom: 24px; border-color: color-mix(in srgb, var(--brand) 22%, var(--line)); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(209, 69, 10, 0.06); }
.db-match .db-card-head { background: linear-gradient(180deg, var(--brand-soft), #fff); }
.db-match-list { list-style: none; margin: 0; padding: 0; }
.db-match-item { display: flex; align-items: center; gap: 16px; padding: 14px 24px; border-top: 1px solid var(--line); transition: background 0.15s; }
.db-match-item:hover { background: color-mix(in srgb, var(--surface) 70%, #fff); }
.db-match-media { flex-shrink: 0; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05); }
.db-match-media .cover-img { width: 100%; height: 100%; object-fit: cover; }
.db-match-media .category-cover-icon { width: 40px; height: 40px; border-radius: 11px; box-shadow: none; backdrop-filter: none; }
.db-match-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.db-match-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-match-title:hover { color: var(--brand); }
.db-match-meta { margin: 0; font-size: var(--fs-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-match-meta strong { color: var(--ink); font-weight: 600; }
.db-match-cta { flex-shrink: 0; }
.db-match-empty { padding-top: 20px; }
.db-match-empty p { max-width: 520px; }
.db-match-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }

@media (max-width: 720px) {
  .db-match-item { flex-wrap: wrap; padding: 14px 16px; gap: 12px; }
  .db-match-media { width: 52px; height: 52px; }
  .db-match-body { flex-basis: calc(100% - 64px); }
  .db-match-title, .db-match-meta { white-space: normal; }
  .db-match-cta { width: 100%; }
}

/* ---------- /annonces : bouton « Mes métiers » et raison sur les cartes ---------- */
.sr-mine-btn.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.sr-mine-btn.is-active:hover { background: #000; }
.listing-card-note { margin-top: 8px; position: relative; z-index: 1; pointer-events: none; }

/* ---------- Annonce : bandeau de correspondance (prestataire) ---------- */
.ld-match {
  display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; padding: 12px 14px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-soft), #fff); border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line));
}
.ld-match-title { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--brand-ink); }
.ld-match-title .icon { color: var(--brand); }
.ld-match .match-chip { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- Annonce : prestataires recommandés (client) ---------- */
.ld-reco {
  margin: 0 0 28px; border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line)); border-radius: var(--radius-lg); background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(209, 69, 10, 0.06); overflow: hidden; scroll-margin-top: calc(var(--header-h) + 16px);
}
.ld-reco-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 14px; background: linear-gradient(180deg, var(--brand-soft), #fff); }
.ld-reco-title { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: var(--fs-md); }
.ld-reco-title .icon { color: var(--brand); }
.ld-reco-sub { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.ld-reco-list { list-style: none; margin: 0; padding: 0; }
.ld-reco-item { display: flex; align-items: center; gap: 12px 16px; padding: 12px 20px; border-top: 1px solid var(--line); }
.ld-reco-logo { flex-shrink: 0; text-decoration: none !important; }
.ld-reco-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ld-reco-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-reco-name:hover { color: var(--brand); text-decoration: none; }
.ld-reco-place { display: flex; align-items: center; gap: 4px; font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-reco-main .match-chips { margin-top: 3px; }
.ld-reco-btn { flex-shrink: 0; min-width: 96px; }
.ld-reco-done { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex-shrink: 0; min-width: 96px; min-height: 36px; font-size: var(--fs-sm); font-weight: 600; color: var(--success); }
.ld-reco-more { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.ld-reco-more:hover { color: var(--brand); text-decoration: none; background: var(--surface); }

@media (max-width: 720px) {
  .ld-reco-head { flex-direction: column; padding: 16px; }
  .ld-reco-head .btn { width: 100%; }
  .ld-reco-item { padding: 12px 16px; }
  .ld-reco-btn, .ld-reco-done { min-width: 0; }
  .ld-reco-name { white-space: normal; overflow-wrap: anywhere; }
}

/* ---------- Profil prestataire : « Inviter à répondre » à l'une de ses annonces ---------- */
.pf-invite { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius); background: linear-gradient(135deg, var(--brand-soft), #fff); border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line)); }
.pf-invite-label { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: var(--fs-sm); font-weight: 600; color: var(--brand-ink); }
.pf-invite-label .icon { color: var(--brand); }
.pf-invite-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pf-invite-list li { display: flex; flex-direction: column; gap: 6px; }
.pf-invite-title { font-size: var(--fs-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-invite-list .btn { align-self: flex-start; }
.pf-invite-done { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--success); }
