/* ==========================================================================
   Carte unique « professionnel ». Utilisée partout : accueil, liste, domaines, carte.
   Hauteur identique dans une grille, texte qui se coupe au lieu de déborder.
   ========================================================================== */
.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  min-width: 0;
  height: 100%;
  padding: .95rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.pcard:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 14px 28px rgba(37, 99, 235, .12);
}
.pcard.is-sector { border-color: color-mix(in srgb, var(--success) 55%, var(--border)); }
.pcard.is-selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring, rgba(37, 99, 235, .3)); }
.pcard-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.pcard-link:focus-visible { outline: 3px solid var(--primary-ring, rgba(37, 99, 235, .4)); outline-offset: 3px; }
.pcard > :not(.pcard-link) { position: relative; z-index: 0; pointer-events: none; }

.pcard-head { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.pcard-photo {
  flex: none;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-soft), var(--success-soft));
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--border);
}
.pcard-photo img { width: 100%; height: 100%; object-fit: cover; }
.pcard-initial { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.pcard-id { min-width: 0; display: grid; gap: .15rem; }
.pcard-name {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.01em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
.pcard-role {
  margin: 0;
  font-size: .86rem;
  color: var(--text-secondary);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}

.pcard-tags { display: flex; flex-wrap: wrap; gap: .35rem; min-height: 26px; }
.pcard-tag {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  max-width: 100%;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid transparent;
}
.pcard-tag.is-domain { background: var(--primary-soft); color: var(--primary); }
.pcard-tag.is-sector { background: #D1FAE5; color: #047857; border-color: #10B981; }
.pcard-tag.is-cert { background: #DBEAFE; color: #1D4ED8; border-color: #93C5FD; }
.pcard-tag.is-premium { background: var(--surface); color: #047857; border-color: #10B981; }
:root[data-theme="dark"] .pcard-tag.is-sector,
:root:not([data-theme="light"]) .pcard-tag.is-sector { background: rgba(16, 185, 129, .18); color: #A7F3D0; }
:root[data-theme="dark"] .pcard-tag.is-cert,
:root:not([data-theme="light"]) .pcard-tag.is-cert { background: rgba(37, 99, 235, .22); color: #BFDBFE; }

.pcard-meta { margin: 0; display: grid; gap: .2rem; font-size: .86rem; }
.pcard-rating { font-weight: 700; color: var(--text-primary); }
.pcard-star { color: #F59E0B; }
.pcard-muted { color: var(--text-secondary); font-weight: 600; }
.pcard-place {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pcard-cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .9rem;
  font-weight: 800;
  color: var(--primary);
}

/* Grilles de cartes : même largeur minimale partout, sans débordement sur mobile. */
.pcard-grid {
  display: grid;
  gap: .9rem;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 560px) { .pcard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .pcard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Sécurité mobile : rien ne dépasse de l'écran. */
.app-main, .page, .pcard-grid, .pros, .pros-layout, .dm, .pc, .pv, .fp { min-width: 0; max-width: 100%; }
.page img, .page svg, .page video { max-width: 100%; height: auto; }
.page p, .page h1, .page h2, .page h3, .page li, .page a { overflow-wrap: anywhere; }
.page pre, .page code { white-space: pre-wrap; word-break: break-word; }
@media (max-width: 1023px) { body.app { overflow-x: hidden; } }

/* Accueil : deux colonnes sur téléphone, format compact pour tenir sans déborder. */
.pro-teaser-grid { display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pro-teaser-grid .pcard { padding: .9rem; gap: .6rem; }
.pro-teaser-grid .pcard-head { flex-direction: column; align-items: flex-start; gap: .55rem; }
.pro-teaser-grid .pcard-photo { width: 52px; height: 52px; }
.pro-teaser-grid .pcard-name { font-size: .92rem; }
.pro-teaser-grid .pcard-role, .pro-teaser-grid .pcard-place { display: none; }
@media (min-width: 900px) {
  .pro-teaser-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pro-teaser-grid .pcard { padding: 1.1rem; }
  .pro-teaser-grid .pcard-head { flex-direction: column; align-items: center; text-align: center; }
  .pro-teaser-grid .pcard-role, .pro-teaser-grid .pcard-place { display: block; }
  .pro-teaser-grid .pcard-tags { justify-content: center; }
  .pro-teaser-grid .pcard-meta { text-align: center; }
  .pro-teaser-grid .pcard-cta { justify-content: center; }
  .pro-teaser-grid .pcard-photo { width: 76px; height: 76px; }
}

/* ==========================================================================
   Assistant « complétez votre profil » : fenêtre centrée sur ordinateur,
   pleine hauteur sur téléphone, sans débordement.
   ========================================================================== */
.ob { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 1rem; }
.ob[hidden], .ob-step[hidden] { display: none !important; }
.ob-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); }
.ob-panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - 2rem);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--text-primary);
  border-radius: 26px;
  box-shadow: 0 30px 70px rgba(15, 23, 42, .3);
  overflow: hidden;
  outline: none;
}
.ob-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.25rem .4rem; }
.ob-count { font-size: .85rem; font-weight: 800; color: var(--primary); }
.ob-close { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--background); color: var(--text-secondary); cursor: pointer; }
.ob-close:hover { color: var(--text-primary); }
.ob-progress { height: 6px; margin: 0 1.25rem; border-radius: 999px; background: var(--slate-soft, #E2E8F0); overflow: hidden; }
.ob-progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--success)); transition: width .3s ease; }
.ob-form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.ob-step { padding: 1.25rem 1.5rem; overflow-y: auto; min-height: 0; display: grid; gap: .75rem; align-content: start; }
.ob-hero { width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.ob-hero.is-done { background: var(--success-soft); color: var(--success-ink, #047857); }
.ob-title { margin: 0; font-size: 1.35rem; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; overflow-wrap: anywhere; }
.ob-text { margin: 0; font-size: 1rem; color: var(--text-secondary); line-height: 1.5; }
.ob-points { margin: 0; padding-left: 1.1rem; display: grid; gap: .35rem; color: var(--text-primary); font-size: .98rem; }
.ob-label { font-size: .95rem; font-weight: 800; color: var(--text-primary); }
.ob-hint { margin: 0; font-size: .88rem; color: var(--text-secondary); }
.ob-input { width: 100%; min-height: 52px; padding: 0 1rem; border: 2px solid var(--border); border-radius: 16px; background: var(--background); color: var(--text-primary); font: inherit; font-size: 1rem; }
.ob-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring, rgba(37, 99, 235, .2)); }
.ob-fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: .5rem; min-width: 0; }
.ob-fieldset legend { padding: 0; margin-bottom: .25rem; }
.ob-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.ob-chip { position: relative; cursor: pointer; }
.ob-chip input { position: absolute; opacity: 0; pointer-events: none; }
.ob-chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .9rem; border-radius: 999px; border: 2px solid var(--border); background: var(--surface); font-size: .92rem; font-weight: 700; color: var(--text-primary); }
.ob-chip input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.ob-chip input:focus-visible + span { outline: 3px solid var(--primary-ring, rgba(37, 99, 235, .35)); outline-offset: 2px; }
.ob-options { display: grid; gap: .5rem; }
.ob-option { position: relative; cursor: pointer; }
.ob-option input { position: absolute; opacity: 0; pointer-events: none; }
.ob-option span { display: flex; align-items: center; min-height: 54px; padding: 0 1rem; border-radius: 16px; border: 2px solid var(--border); background: var(--surface); font-weight: 700; font-size: 1rem; color: var(--text-primary); }
.ob-option input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.ob-option input:focus-visible + span { outline: 3px solid var(--primary-ring, rgba(37, 99, 235, .35)); outline-offset: 2px; }
.ob-upload { position: relative; display: flex; align-items: center; gap: .9rem; min-height: 84px; padding: 1rem; border-radius: 20px; border: 2px dashed var(--primary); background: var(--primary-soft); color: var(--primary); cursor: pointer; }
.ob-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ob-upload-text { display: grid; gap: .15rem; min-width: 0; }
.ob-upload-text strong { color: var(--text-primary); font-size: 1rem; }
.ob-upload-text small { color: var(--text-secondary); font-size: .85rem; }
.ob-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; padding: 1rem 1.25rem 1.25rem; border-top: 1px solid var(--border); background: var(--surface); }
.ob-foot-right { display: flex; gap: .5rem; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.ob-btn { min-height: 48px; padding: 0 1.1rem; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); color: var(--text-primary); font: inherit; font-size: .98rem; font-weight: 800; cursor: pointer; }
.ob-btn:hover { border-color: var(--primary); color: var(--primary); }
.ob-btn.is-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.ob-btn.is-primary:hover { background: var(--primary-hover, #1D4ED8); color: #fff; }
.ob-btn.is-quiet { border-color: transparent; background: transparent; color: var(--text-secondary); padding: 0 .5rem; }
.ob-btn:focus-visible { outline: 3px solid var(--primary-ring, rgba(37, 99, 235, .35)); outline-offset: 2px; }
.ob-btn:disabled { opacity: .6; cursor: wait; }

/* Téléphone : pleine hauteur, boutons pleine largeur, rien ne déborde. */
@media (max-width: 599px) {
  .ob { padding: 0; align-items: end; }
  .ob-panel { max-width: none; max-height: 100dvh; border-radius: 24px 24px 0 0; }
  .ob-step { padding: 1rem 1.1rem; }
  .ob-title { font-size: 1.2rem; }
  .ob-foot { padding: .85rem 1rem calc(.85rem + env(safe-area-inset-bottom, 0px)); }
  .ob-foot-right { width: 100%; justify-content: stretch; }
  .ob-foot-right .ob-btn { flex: 1; }
  .ob-chip span { min-height: 42px; font-size: .88rem; }
}

/* ---- Carte compacte : nom + badge vérifié (style réseau social), région en clair ---- */
.pcard-name { display: flex; align-items: center; gap: .35rem; min-width: 0; }
.pcard-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-verified {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1877F2;
  color: #fff;
  box-shadow: 0 0 0 2px var(--surface);
}
.pcard-meta {
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .3rem;
  font-size: .86rem;
  min-width: 0;
}
.pcard-sep { color: var(--text-secondary); }
.pcard-region { min-width: 0; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-role { -webkit-line-clamp: 1; }
.pro-teaser-grid .pcard { padding: .8rem .75rem; gap: .5rem; }
.pro-teaser-grid .pcard-head { flex-direction: column; align-items: flex-start; }
.pro-teaser-grid .pcard-name { justify-content: flex-start; }
.pro-teaser-grid .pcard-meta { flex-direction: column; align-items: flex-start; gap: .1rem; }
.pro-teaser-grid .pcard-sep { display: none; }
.pro-teaser-grid .pcard-role { display: none; }
@media (min-width: 900px) {
  .pro-teaser-grid .pcard { padding: .95rem 1rem; }
  .pro-teaser-grid .pcard-head { flex-direction: row; align-items: center; }
  .pro-teaser-grid .pcard-role { display: -webkit-box; }
  .pro-teaser-grid .pcard-meta { flex-direction: row; align-items: center; }
  .pro-teaser-grid .pcard-sep { display: inline; }
}
