/* ===== KYcard : la carte ouverte en plein écran =====
   Un cadre à la taille de l'écran (aucun défilement de la page), le fond de la carte deviné tout autour, flou.
   Deux faces (recto · verso) qui se retournent ; la carte ne défile jamais : infos générales et raccourcis.
   Le KY-CV est une page à part (kycv.php), qu'on lit en entier.
   Les couleurs viennent du thème choisi par le membre (--bg, --text, --btn… : page.css). */

html:has(.kyc-page), .kyc-page { height: 100%; overflow: hidden; }
.kyc-page { display: flex; flex-direction: column; min-height: 0; background: #0b1433; overscroll-behavior: none; }

/* Fond : la photo floutée (ou le fond du thème) */
.kyc-backdrop { position: fixed; inset: -40px; z-index: 0; background: var(--bg); background-size: cover; background-position: center;
    filter: blur(26px) saturate(1.2) brightness(.82); transform: scale(1.08); }
.kyc-backdrop::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(8,14,40,.35), rgba(8,14,40,.1) 40%, rgba(8,14,40,.45)); }

/* Barre du haut : retour · langue · options */
.kyc-top { position: relative; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left)); color: #fff; }
.kyc-top .page-back, .kyc-top .share-btn, .kyc-top .lang-float { position: static; inset: auto; margin: 0; transform: none; }
.kyc-round { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; color: #fff; cursor: pointer; text-decoration: none;
    background: rgba(10,16,40,.38); border: 1.5px solid rgba(255,255,255,.6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 1px rgba(255,255,255,.3), 0 2px 10px rgba(0,0,0,.18); transition: background .15s; }
.kyc-round:hover { background: rgba(10,16,40,.55); }

/* Scène : la carte prend toute la hauteur disponible */
.kyc-stage { position: relative; z-index: 10; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 4px max(12px, env(safe-area-inset-right)) 40px max(12px, env(safe-area-inset-left)); }
.kyc-stage .moderation-banner { flex-shrink: 0; width: min(440px, 100%); margin: 0 0 8px; }

/* Le cadre */
.kyc { position: relative; display: flex; flex-direction: column; width: min(440px, 100%); height: 100%; max-height: 900px; min-height: 0;
    border-radius: 30px; overflow: hidden; background: var(--bg); color: var(--text);
    border: 1.5px solid rgba(255,255,255,.75); box-shadow: 0 30px 80px rgba(4,10,30,.45), 0 0 0 6px rgba(255,255,255,.08);
    transform-origin: 50% 50%; }
.kyc__faces { position: relative; flex: 1; min-height: 0; transition: filter .25s; }
.kyc__face { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; }
.kyc__face .kyc__body { flex: 1; min-height: 0; overflow: hidden; }
.kyc__face[hidden] { display: none; }
.kyc__face.face--back { padding-top: 0; transform: none; }
.kyc__face::-webkit-scrollbar { width: 0; height: 0; }
.kyc__face { scrollbar-width: none; }

/* Retournement : la carte pivote jusqu'à la tranche, change de face, puis revient */
.kyc.is-turning-out { animation: kyc-out .2s ease-in forwards; }
.kyc.is-turning-in { animation: kyc-in .24s ease-out; }
@keyframes kyc-out { to { transform: perspective(1400px) rotateY(90deg); } }
@keyframes kyc-in { from { transform: perspective(1400px) rotateY(-90deg); } }
[dir="rtl"] .kyc.is-turning-out { animation-name: kyc-out-rtl; }
[dir="rtl"] .kyc.is-turning-in { animation-name: kyc-in-rtl; }
@keyframes kyc-out-rtl { to { transform: perspective(1400px) rotateY(-90deg); } }
@keyframes kyc-in-rtl { from { transform: perspective(1400px) rotateY(90deg); } }

/* ----- Recto ----- */
.kyc__hero { position: relative; height: 44%; min-height: 190px; overflow: hidden;
    background: linear-gradient(160deg, rgba(255,255,255,.35), rgba(255,255,255,0)), var(--bg); }
.kyc__photo { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; }
.kyc__hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; pointer-events: none;
    background: linear-gradient(to top, var(--kyc-fade, rgba(255,255,255,.0)), transparent); }
.kyc__initial { display: grid; place-items: center; height: 100%; font-size: 120px; font-weight: 600; color: var(--text); opacity: .85; }
.kyc__brand { position: absolute; top: 14px; inset-inline-end: 14px; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 2px;
    color: #fff; text-decoration: none; font-size: 9px; font-weight: 700; letter-spacing: .32em; padding-inline-start: .32em; text-shadow: 0 1px 6px rgba(0,0,0,.45); }
.kyc__brand span { direction: ltr; unicode-bidi: isolate; }
.kyc__brand img { filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)); }
.kyc__fav { position: absolute; z-index: 2; top: 14px; inset-inline-start: 14px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%;
    color: #fff; cursor: pointer; border: 1.5px solid rgba(255,255,255,.7);
    background: radial-gradient(120% 120% at 30% 20%, rgba(255,255,255,.5), rgba(255,255,255,.12) 55%, rgba(20,40,90,.2));
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: inset 0 1px 1px rgba(255,255,255,.8), 0 4px 12px rgba(10,20,50,.25); transition: transform .15s; }
.kyc__fav svg { fill: rgba(255,255,255,.15); stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.kyc__fav.is-on { color: #f5c542; }
.kyc__fav.is-on svg { fill: #f5c542; stroke: #c99416; }
.kyc__fav.is-pop { animation: kyc-pop .35s ease; }
@keyframes kyc-pop { 40% { transform: scale(1.25); } }
.kyc__qr { position: absolute; z-index: 2; inset-inline-end: 14px; bottom: 14px; width: 30%; max-width: 116px; aspect-ratio: 1; padding: 7px; border: 0; border-radius: 14px;
    background: #fff; box-shadow: 0 6px 18px rgba(10,20,50,.3); cursor: zoom-in; }
.kyc__qr img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.kyc__qr b { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 24%; aspect-ratio: 1; border-radius: 4px;
    background: #fff; color: #0b1433; font: 900 15px/1 'Plus Jakarta Sans', system-ui, sans-serif; }

.kyc__body { padding: 16px 20px 22px; }
.kyc__name { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.kyc__headline { margin: 4px 0 0; font-size: 16px; opacity: .85; }
.kyc__bio { margin: 12px 0 0; font-size: 15px; line-height: 1.45; opacity: .9; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.kyc__where { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 0; font-size: 15px; justify-content: flex-start; }
.kyc__where .flag { font-size: 22px; line-height: 1; }
.kyc__body .socials { justify-content: flex-start; gap: 12px; margin: 16px 0 0; }
.kyc__body .region-switch { margin: 14px 0 0; justify-content: flex-start; }

/* ----- Verso ----- */
.kyc__hero--back { height: 24%; min-height: 120px; background-size: cover; background-position: center;
    background-image: linear-gradient(135deg, #1d4ed8, #6d3dff 60%, #ef4c2f); }
/* Nom et métier posés en bas de la photo du verso, sur un léger voile pour rester lisibles */
.kyc__hero--back::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0) 60%); pointer-events: none; }
.kyc__back-id { position: absolute; z-index: 2; left: 20px; right: 20px; bottom: 14px; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.45); }
.kyc__back-name { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.kyc__back-headline { margin: 2px 0 0; font-size: 14px; opacity: .92; }
.kyc__section { margin: 0 0 16px; }
.kyc__hero { flex-shrink: 0; }
.kyc__body--back { display: flex; flex-direction: column; padding-top: 14px; padding-bottom: 14px; }
.kyc__body--back > .kyc__section { flex-shrink: 0; }
/* Les raccourcis prennent la place restante ; s'il en manque, ils sont coupés (le bouton KY CV reste visible) */
.kyc__body--back > .kyc__links { flex: 0 0 auto; margin-bottom: 0; }
.kyc__about p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 15px; }
/* « Ce que je fais » | « Mes projets & envies » : deux colonnes séparées d'un trait, icône fine + texte */
.kyc-cols { flex-shrink: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 12px; }
.kyc-cols--one { grid-template-columns: minmax(0, 1fr); }
.kyc-col { min-width: 0; padding-inline-end: 12px; }
.kyc-col + .kyc-col { padding-inline: 12px 0; border-inline-start: 1px solid color-mix(in srgb, var(--text) 18%, transparent); }
.kyc-col .kyc__title { font-size: 16px; margin-bottom: 8px; line-height: 1.2; }
.kyc-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.kyc-col li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; line-height: 1.2; }
.kyc-col li svg { width: 20px; height: 20px; }
.kyc-col li svg { flex-shrink: 0; opacity: .9; }
.kyc-col li span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* « ▸ Liens & réseaux » suivi d'un trait, puis une seule ligne d'icônes */
.kyc__title--rule { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.kyc__title--rule::before { content: '▸'; font-size: 13px; }
.kyc__title--rule::after { content: ''; flex: 1; height: 1px; background: color-mix(in srgb, var(--text) 18%, transparent); }
.kyc-ln-row { display: block; }
/* Les icônes vont à la ligne quand il y en a beaucoup : colonnes régulières de 48 px */
.kyc-ln { display: grid !important; grid-template-columns: repeat(auto-fill, 48px); grid-auto-rows: 56px; justify-content: start; gap: 8px !important; margin: 0 !important;
    align-items: start; justify-items: center; max-height: calc(56px * 2 + 8px); overflow: hidden; } /* 2 lignes au plus */
.kyc-ln.is-one-row { max-height: 56px; } /* posé par card.js si la carte manque de place */
.kyc-ln > * { flex-shrink: 0; }
.kyc .socials.kyc-ln-cv { margin: 12px 0 0; justify-content: flex-start; }
.kyc .socials a.kyc-ln__link { width: 48px; height: auto; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0; border: 0; border-radius: 0;
    background: none; box-shadow: none; opacity: 1; color: var(--text); text-decoration: none; }
.kyc .socials a.kyc-ln__link:hover { transform: translateY(-2px); }
/* Toutes les tuiles ont la même forme que les réseaux */
.kyc-ln__tile { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; text-decoration: none; }
.kyc-ln__brand { background: var(--c); color: #fff; box-shadow: 0 3px 10px rgba(0,0,0,.15); }
.kyc-ln__brand svg { width: 20px; height: 20px; fill: currentColor; }
.kyc-ln__emoji { font-size: 21px; line-height: 1; background: color-mix(in srgb, #fff 70%, transparent); border: 1px solid color-mix(in srgb, var(--text) 14%, transparent); }
.kyc-ln__plain { background: var(--btn); color: var(--btn-text); border: 1px solid color-mix(in srgb, var(--btn-text) 18%, transparent); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
/* Titre court sous chaque lien (les réseaux se reconnaissent à leur logo) */
.kyc-ln__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; font-weight: 600; line-height: 1.2; opacity: .85; }
/* Réseaux (recto et verso) : carrés aux couleurs de chaque réseau, comme sur la maquette */
.kyc .socials > a[style*="--c"], .kyc .socials > .social-id { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border-radius: 12px; border: 0; outline: 0;
    background: var(--c, #555); color: #fff; opacity: 1; box-shadow: 0 3px 10px rgba(0,0,0,.15); overflow: hidden; text-decoration: none; }

.kyc .socials > a[style*="--c"] svg, .kyc .socials > .social-id svg { width: 22px; height: 22px; fill: currentColor; }
/* KY CV : petite pastille à côté des icônes de réseaux */
.kyc-cv { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 11px; border-radius: 10px; text-decoration: none; font-size: 13px; font-weight: 800;
    letter-spacing: .02em; color: var(--text); border: 1.5px solid color-mix(in srgb, var(--text) 35%, transparent); background: color-mix(in srgb, var(--text) 6%, transparent); }
.kyc-cv:hover { background: color-mix(in srgb, var(--text) 14%, transparent); }
.kyc-cv--ghost { border-style: dashed; opacity: .75; }
/* (plus précis que les ronds de réseaux du thème Ouest-Est) */
.kyc .socials a.kyc-cv { width: auto; height: 42px; display: inline-flex; align-self: center; border-radius: 10px; opacity: 1; box-shadow: none;
    color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); border: 1.5px solid color-mix(in srgb, var(--text) 35%, transparent); }
.kyc .socials a.kyc-cv svg { width: 16px; height: 16px; }
.kyc .socials a.kyc-cv--ghost { border-style: dashed; opacity: .75; }
.kyc__section p { margin: 0; line-height: 1.5; }
.kyc__title { margin: 0 0 10px; font-size: 18px; font-weight: 700; }
.kyc__section .links { margin-top: 4px; }
.kyc__section .upcoming__title { display: none; }
.kyc__cv .cvb__head, .kyc__cv .cvb__actions .cvb__btn[data-flip] { display: none; }
.kyc__empty { padding: 24px 6px; text-align: center; opacity: .85; line-height: 1.5; }
.kyc__empty-btn { display: inline-block; margin-top: 10px; padding: 10px 18px; border-radius: 999px; background: var(--btn); color: var(--btn-text); text-decoration: none; font-weight: 700; border: var(--border, none); }

/* ----- Barre d'actions ----- */
.kyc__bar { flex-shrink: 0; position: relative; z-index: 4; display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end;
    padding: 10px 10px max(10px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
    background: color-mix(in srgb, var(--text) 4%, transparent); }
.kyc__act { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 2px; border: 0; background: none; color: var(--text); cursor: pointer;
    font: inherit; text-decoration: none; border-radius: 14px; -webkit-tap-highlight-color: transparent; transition: background .15s; }
.kyc__act:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.kyc__act svg, .kyc__act img { margin-bottom: 3px; }
.kyc__act b { position: relative; font-size: 14px; font-weight: 700; line-height: 1.15; }
.kyc__act small { font-size: 12px; opacity: .75; line-height: 1.2; }
.kyc__act:first-child { justify-self: start; min-width: 76px; }
.kyc__act--center { justify-self: center; }
.kyc__act--flip { justify-self: end; min-width: 76px; }
.kyc__dot { position: absolute; top: -2px; inset-inline-end: -9px; width: 7px; height: 7px; border-radius: 50%; background: #f5a623; }
.kyc__to-front, .on-back .kyc__to-back { display: none; }
.on-back .kyc__to-front { display: inline; }

/* ----- KY Memo : fenêtre posée sur le bas de la carte, qui devient floue ----- */
.kyc.memo-open .kyc__faces, .kyc.memo-open .kyc__bar { filter: blur(7px); pointer-events: none; }
.kyc-memo { position: absolute; z-index: 6; left: 10px; right: 10px; bottom: 10px; max-height: calc(100% - 70px); overflow-y: auto; padding: 14px 16px 16px;
    border-radius: 24px; color: #1b2440; background: rgba(250,250,252,.9); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
    border: 1px solid rgba(255,255,255,.9); box-shadow: 0 -10px 40px rgba(4,10,30,.3); animation: kyc-memo-in .26s ease-out; }
.kyc-memo[hidden] { display: none; }
@keyframes kyc-memo-in { from { transform: translateY(30px); opacity: 0; } }
.kyc-memo__head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid rgba(20,30,60,.1); }
.kyc-memo__title { flex: 1; margin: 0; font-size: 17px; font-weight: 700; }
.kyc-memo__close { width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(20,30,60,.07); color: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
.kyc-memo__help { margin: 10px 0 12px; font-size: 13.5px; line-height: 1.5; color: #4a5372; }
.kyc-memo__field { position: relative; }
.kyc-memo textarea { display: block; width: 100%; min-height: 128px; padding: 12px 54px 12px 14px; border-radius: 16px; border: 1px solid rgba(20,30,60,.15);
    background: #fff; color: #1b2440; font: inherit; font-size: 16px; line-height: 1.5; resize: vertical; }
.kyc-memo textarea::placeholder { color: rgba(27,36,64,.38); }
.kyc-memo textarea:focus { outline: 2px solid #1d4ed8; outline-offset: 1px; }
.kyc-memo__mic { position: absolute; inset-inline-end: 10px; bottom: 10px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%;
    border: 1px solid rgba(20,30,60,.12); background: #eef2fc; color: #1b2440; cursor: pointer; }
.kyc-memo__mic.is-on { background: #e5383b; color: #fff; border-color: #e5383b; animation: kyc-mic 1.2s ease-in-out infinite; }
@keyframes kyc-mic { 50% { box-shadow: 0 0 0 8px rgba(229,56,59,.18); } }
.kyc-memo__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.kyc-memo__status { font-size: 13px; color: #16803c; }
.kyc-memo__status.is-error { color: #c0262d; }
.kyc-memo__save { display: inline-block; padding: 10px 20px; border: 0; border-radius: 999px; background: linear-gradient(95deg, #1d6bff, #6d3dff); color: #fff;
    font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.kyc-memo__login { display: block; text-align: center; }

/* Lien maison : clair sur le fond flou */
.kyc-page .home-link { color: #fff; filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }

/* Mode sombre du site : fenêtre KY Memo sombre */
:root[data-theme="dark"] .kyc-memo { background: rgba(16,24,58,.92); color: #eef3ff; border-color: rgba(255,255,255,.14); }
:root[data-theme="dark"] .kyc-memo__help { color: #a9b6d8; }
:root[data-theme="dark"] .kyc-memo textarea { background: rgba(255,255,255,.06); color: #eef3ff; border-color: rgba(255,255,255,.16); }
:root[data-theme="dark"] .kyc-memo textarea::placeholder { color: rgba(238,243,255,.35); }
:root[data-theme="dark"] .kyc-memo__mic { background: rgba(255,255,255,.1); color: #eef3ff; }

/* Petits écrans (hauteur) : photo un peu moins haute */
@media (max-height: 700px) {
    .kyc__hero { height: 40%; min-height: 160px; }
    .kyc__name { font-size: 24px; }
    .kyc__bio { -webkit-line-clamp: 3; }
}

@media (prefers-reduced-motion: reduce) {
    .kyc.is-turning-out, .kyc.is-turning-in, .kyc-memo, .kyc__fav.is-pop, .kyc-memo__mic.is-on { animation: none; }
}

/* Impression (KY-CV) : la carte redevient une page normale */
@media print {
    html:has(.kyc-page), .kyc-page { height: auto; overflow: visible; display: block; background: #fff; }
    .kyc-backdrop, .kyc-top, .kyc__bar, .kyc-memo, .kyc__hero, .face--front { display: none !important; }
    .kyc-stage { display: block; padding: 0; }
    .kyc { height: auto; max-height: none; border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
    .kyc__face { position: static; overflow: visible; }
    .kyc__face[hidden] { display: block; }
}

/* Menu « … » : liens légaux en petit (l'ancien pied de page) */
.sheet__legal { margin: 12px 0 2px; text-align: center; font-size: 12px; opacity: .7; }
.sheet__legal a { color: inherit; }

/* ===== KY-CV : page à part, qui se lit en défilant ===== */
.kycv-page { min-height: 100vh; background: #0b1433; }
.kycv-page .kyc-backdrop { position: fixed; }
.kycv-top { position: sticky; top: 0; }
.kycv { position: relative; z-index: 5; width: min(760px, calc(100% - 24px)); margin: 4px auto 70px; }
.kycv__kicker { margin: 0 0 10px; text-align: center; color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .4em; padding-inline-start: .4em; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.kycv .cvb { padding: 26px 24px; border-radius: 26px; }
.kycv .cvb__actions .cvb__btn[data-flip] { display: inline-flex; }
.kycv__edit { text-align: center; margin: 14px 0 0; }
.kycv__edit a { color: #fff; font-weight: 700; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.kycv-page .home-link { color: #fff; filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }
@media print {
    .kycv-page { background: #fff; }
    .kycv-page .kyc-backdrop, .kycv-top, .kycv__kicker, .kycv__edit { display: none !important; }
    .kycv { width: auto; margin: 0; }
}

/* Verso : réseaux un peu plus petits pour tenir sur une ligne */
.kyc .kyc-ln > a[style*="--c"], .kyc .kyc-ln > .social-id { width: 38px; height: 38px; border-radius: 11px; }
.kyc .kyc-ln > a[style*="--c"] svg, .kyc .kyc-ln > .social-id svg { width: 20px; height: 20px; }
.kyc .kyc-ln-cv a.kyc-cv { height: 38px; }
/* Verso : aucun bloc ne se tasse (c'est card.js qui retire des lignes s'il manque de place) */
.kyc__body--back > * { flex-shrink: 0; }
.kyc-col li[hidden] { display: none; }

/* Verso : réseaux sur une ligne, liens en dessous */
.kyc-ln--nets { grid-auto-rows: 40px; max-height: calc(40px * 2 + 8px); }
.kyc .socials.kyc-ln-row2 { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin: 12px 0 0; flex-wrap: nowrap; }
.kyc-ln-row2 .kyc-ln--links { flex: 1; min-width: 0; }
.kyc .socials a.kyc-ln__cv { flex-shrink: 0; }
.kyc-ln__cv--ghost .kyc-ln__tile { border-style: dashed; background: transparent; box-shadow: none; opacity: .8; }
.kyc-ln__cv .kyc-ln__tile svg { width: 20px; height: 20px; }

/* ===== Recto : itinéraire (d'où je viens → ici → où je vais → mon rêve) =====
   Une fine ligne de trajet, des points comme des escales ; « ici » est plein, le rêve est une étoile. */
.kyc-itin { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: relative; }
.kyc-itin::before { content: ''; position: absolute; top: 6px; left: 12%; right: 12%; height: 0; border-top: 1.5px dashed color-mix(in srgb, var(--text) 45%, transparent); }
.kyc-itin__stop { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; min-width: 0; padding: 0 2px; }
.kyc-itin__dot { width: 13px; height: 13px; border-radius: 50%; background: var(--bg); border: 2px solid var(--text); box-sizing: border-box; position: relative; z-index: 1; }
.kyc-itin__stop--here .kyc-itin__dot { background: var(--text); box-shadow: 0 0 0 4px color-mix(in srgb, var(--text) 18%, transparent); }
.kyc-itin__stop--next .kyc-itin__dot { border-style: dashed; }
.kyc-itin__stop--dream .kyc-itin__dot { width: 15px; height: 15px; border: 0; border-radius: 0; background: var(--text);
    clip-path: polygon(50% 0, 61% 36%, 100% 38%, 69% 60%, 80% 100%, 50% 76%, 20% 100%, 31% 60%, 0 38%, 39% 36%); margin-top: -1px; }
.kyc-itin__place { max-width: 100%; font-size: 13px; font-weight: 700; line-height: 1.2; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.kyc-itin__place .flag { font-size: 14px; }
.kyc-itin__label { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; opacity: .65; }
/* Recto : le top 3 des moyens de contact */
.kyc .kyc-ln--top { margin-top: 16px !important; max-height: none; }
/* Bouton « Enregistrer » (bas à gauche, carte des autres) */
.kyc__save .kyc__save-on, .kyc__save.is-on .kyc__save-off { display: none; }
.kyc__save.is-on .kyc__save-on { display: inline; }
.kyc__save.is-on svg { fill: currentColor; }
.kyc__save.is-pop svg { animation: kyc-pop .35s ease; }
/* KY Memo : choix de la langue de la dictée, texte de confidentialité */
.kyc-memo__private { margin-top: -4px; font-size: 12.5px; opacity: .85; }
.kyc-memo__lang { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; }
.kyc-memo__lang select { padding: 4px 8px; border-radius: 10px; border: 1px solid rgba(20,30,60,.15); background: #fff; color: #1b2440; font: inherit; font-size: 13px; }
.kyc-memo__lang[hidden] { display: none; }
:root[data-theme="dark"] .kyc-memo__lang select { background: rgba(255,255,255,.08); color: #eef3ff; border-color: rgba(255,255,255,.16); }

/* ===== Petits téléphones (faible hauteur : iPhone SE, Android compacts) : tout se resserre ===== */
@media (max-height: 640px) {
    .kyc-top { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: 4px; }
    .kyc-round { width: 38px; height: 38px; }
    .kyc-stage { padding-bottom: 32px; }
    .kyc { border-radius: 24px; }
    .kyc__hero { height: 34%; min-height: 130px; }
    .kyc__hero--back { height: 20%; min-height: 96px; }
    .kyc__qr { width: 26%; padding: 5px; }
    .kyc__brand span { display: none; }
    .kyc__body { padding: 10px 16px 12px; }
    .kyc__name { font-size: 22px; }
    .kyc__headline { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
    .kyc__bio { margin-top: 6px; font-size: 14px; }
    .kyc-itin { margin-top: 10px; }
    .kyc-itin__label { display: none; }
    .kyc .kyc-ln--top { margin-top: 10px !important; }
    .kyc__bar { padding-top: 6px; padding-bottom: 6px; }
    .kyc__act svg, .kyc__act img { width: 20px; height: 20px; margin-bottom: 1px; }
    .kyc__act b { font-size: 13px; }
    .kyc__act small { font-size: 11px; }
    .kyc__back-name { font-size: 20px; }
    .kyc-cols { margin-bottom: 8px; }
    .kyc-col .kyc__title, .kyc__title--rule { font-size: 15px; margin-bottom: 6px; }
    .kyc .socials.kyc-ln-row2 { margin-top: 8px; }
    .kyc-page .home-link { height: 30px; bottom: max(2px, env(safe-area-inset-bottom)); }
}
.kyc__bio.is-hidden { display: none; }
/* KY Memo : le bouton Enregistrer reste toujours visible (bas de la fenêtre), même sur petit écran / clavier ouvert */
.kyc-memo__form { display: flex; flex-direction: column; }
.kyc-memo__foot { position: sticky; bottom: -16px; margin: 10px -16px -16px; padding: 10px 16px 14px; background: inherit; border-radius: 0 0 24px 24px;
    background: linear-gradient(to top, rgba(250,250,252,.98) 70%, rgba(250,250,252,0)); }
:root[data-theme="dark"] .kyc-memo__foot { background: linear-gradient(to top, rgba(16,24,58,.98) 70%, rgba(16,24,58,0)); }
@media (max-height: 640px) {
    .kyc-memo { top: 8px; max-height: none; padding: 10px 14px 14px; }
    .kyc-memo__head { padding-bottom: 6px; }
    .kyc-memo__title { font-size: 15px; }
    .kyc-memo__help { margin: 6px 0 8px; font-size: 12px; line-height: 1.4; }
    .kyc-memo textarea { min-height: 84px; font-size: 16px; } /* 16 px : iOS ne zoome pas */
    .kyc-memo__foot { margin: 8px -14px -14px; padding: 8px 14px 12px; bottom: -14px; }
}
/* Téléphone à l'horizontale (très faible hauteur) : exception, la face défile dans son cadre plutôt que de cacher des infos */
@media (max-height: 480px) {
    .kyc__face { overflow-y: auto; }
    .kyc__face .kyc__body { overflow: visible; flex: none; }
    .kyc__hero { height: 150px; min-height: 0; }
    .kyc__hero--back { height: 90px; }
}

/* Filet de sécurité (posé par card.js) : la face qui dépasse encore défile dans son cadre */
.kyc__face.is-scrollable .kyc__body { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
/* Verso de sa propre carte, colonnes vides : petit rappel compact */
.kyc__fill { flex-shrink: 0; display: block; margin: 0 0 14px; padding: 10px 14px; border-radius: 14px; text-align: center; text-decoration: none; font-size: 14px; font-weight: 600;
    color: var(--text); border: 1.5px dashed color-mix(in srgb, var(--text) 40%, transparent); background: color-mix(in srgb, var(--text) 5%, transparent); }

/* ===== KYP : patch sur les cartes, carte privée ===== */
.kyp-patch { display: inline-flex; align-items: center; gap: 3px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .06em;
    color: #6b4700; background: linear-gradient(135deg, #fff1c4, #f5c542); border: 1px solid #e0a92a; box-shadow: 0 2px 8px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.7); }
.kyp-patch--card { position: absolute; z-index: 2; top: 16px; inset-inline-start: 14px; }
.kyp-flash { width: min(440px, 100%); margin: 0 0 8px; padding: 10px 14px; border-radius: 14px; background: rgba(22,163,74,.92); color: #fff; font-size: 14px; }
.kyp-flash--error { background: rgba(192,38,45,.92); }
.kyp-memo-peek { margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; background: color-mix(in srgb, var(--text) 6%, transparent); }
.kyp-ln { grid-template-columns: repeat(auto-fill, 48px) !important; }
.kyc__fav.is-on { width: auto; padding: 0 11px 0 9px; border-radius: 999px; display: inline-flex; gap: 4px; color: #6b4700;
    background: linear-gradient(135deg, #fff1c4, #f5c542); border-color: #e0a92a; }
.kyc__fav.is-on::after { content: 'KYP'; font-size: 12px; font-weight: 800; letter-spacing: .05em; }
.kyc .socials button.kyc-ln__link { padding: 0; border: 0; background: none; box-shadow: none; font: inherit; cursor: pointer; width: 48px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--text); }

/* ===== Ranger la carte dans mes annuaires (sous la KY-card) ===== */
.kyc-dirs { width: min(420px, calc(100vw - 32px)); margin: 12px auto 0; border-radius: 18px; background: rgba(255,255,255,.92); border: 1px solid rgba(15,23,42,.1);
    box-shadow: 0 8px 24px rgba(10,20,50,.12); color: #0f172a; }
.kyc-dirs__sum { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; list-style: none; }
.kyc-dirs__sum::-webkit-details-marker { display: none; }
.kyc-dirs__ico { font-size: 18px; }
.kyc-dirs__chips { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.kyc-dirs__chips i { font-style: normal; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; color: #1d4ed8; background: #eaf0ff; }
.kyc-dirs__chips em { font-style: normal; font-size: 13px; color: #64748b; }
.kyc-dirs__btn { flex-shrink: 0; font-size: 13px; padding: 6px 12px; border-radius: 999px; color: #fff; background: #1d4ed8; }
.kyc-dirs[open] .kyc-dirs__btn { background: #64748b; }
.kyc-dirs__form { padding: 0 14px 14px; }
.kyc-dirs__title { margin: 2px 0 8px; font-weight: 800; font-size: 14px; }
.kyc-dirs__list { display: flex; flex-direction: column; gap: 2px; max-height: 40vh; overflow: auto; margin-bottom: 10px; }
.kyc-dirs__opt { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-radius: 10px; font-size: 15px; cursor: pointer; }
.kyc-dirs__opt:hover { background: #f1f5f9; }
.kyc-dirs__opt input { width: 20px; height: 20px; accent-color: #1d4ed8; }
.kyc-dirs__opt--sub { padding-inline-start: 30px; font-size: 14px; }
.kyc-dirs__new { display: flex; flex-wrap: wrap; gap: 6px; }
.kyc-dirs__new input, .kyc-dirs__new select { flex: 1 1 140px; min-width: 0; padding: 10px 12px; font: inherit; font-size: 16px; color: inherit; background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; }
.kyc-dirs__save { width: 100%; margin-top: 10px; padding: 12px; border: 0; border-radius: 999px; font: inherit; font-weight: 800; color: #fff; background: linear-gradient(95deg, #1a5cf0, #6d3dff); cursor: pointer; }
:root[data-theme="dark"] .kyc-dirs { background: rgba(14,22,58,.94); border-color: rgba(255,255,255,.14); color: #eef3ff; }
:root[data-theme="dark"] .kyc-dirs__chips i { color: #b9cdff; background: rgba(143,180,255,.16); }
:root[data-theme="dark"] .kyc-dirs__opt:hover { background: rgba(255,255,255,.06); }
:root[data-theme="dark"] .kyc-dirs__new input, :root[data-theme="dark"] .kyc-dirs__new select { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.2); }

/* ===== Relier A et B sur WeChat (KY-card privée scannée depuis un QR Code WeChat) ===== */
.kyp-wx { width: min(420px, calc(100vw - 32px)); margin: 12px auto 0; border-radius: 18px; color: #0f172a; background: rgba(255,255,255,.94);
    border: 1px solid rgba(15,23,42,.1); box-shadow: 0 8px 24px rgba(10,20,50,.12); }
.kyp-wx.is-focus { border: 2px solid #07c160; box-shadow: 0 10px 34px rgba(7,193,96,.28); }
.kyp-wx__sum { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; }
.kyp-wx__sum::-webkit-details-marker { display: none; }
.kyp-wx__sum strong { display: block; font-size: 15px; }
.kyp-wx__sum small { display: block; font-size: 12.5px; color: #16a34a; font-weight: 700; }
.kyp-wx__ico svg { width: 26px; height: 26px; fill: currentColor; }
.kyp-wx__body { padding: 0 14px 14px; }
.kyp-wx__lang { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; color: #475569; }
.kyp-wx__lang select { padding: 6px 10px; font: inherit; font-size: 16px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: inherit; }
.kyp-wx__steps { margin: 10px 0; padding-inline-start: 20px; display: grid; gap: 12px; }
.kyp-wx__steps li strong { display: block; margin-bottom: 4px; font-size: 14px; }
.kyp-wx__steps textarea { width: 100%; padding: 8px 10px; font: inherit; font-size: 14px; line-height: 1.4; resize: none; border: 1px solid #cbd5e1; border-radius: 10px; background: #f8fafc; color: inherit; }
.kyp-wx__steps small { display: block; margin-top: 4px; font-size: 12px; color: #64748b; }
.kyp-wx__btn { width: 100%; margin-top: 6px; padding: 11px; border: 1px solid #cbd5e1; border-radius: 999px; font: inherit; font-weight: 700; color: #0f172a; background: #fff; cursor: pointer; }
.kyp-wx__btn--main { border: 0; color: #fff; background: #07c160; box-shadow: 0 6px 18px rgba(7,193,96,.35); }
.kyp-wx form { margin: 0; }
.kyp-wx__done { width: 100%; padding: 12px; border: 0; border-radius: 999px; font: inherit; font-weight: 800; color: #fff; background: linear-gradient(95deg, #1a5cf0, #6d3dff); cursor: pointer; }
.kyp-wx__note { margin: 8px 0 0; font-size: 11.5px; color: #64748b; text-align: center; }
:root[data-theme="dark"] .kyp-wx { background: rgba(14,22,58,.94); border-color: rgba(255,255,255,.14); color: #eef3ff; }
:root[data-theme="dark"] .kyp-wx__steps textarea, :root[data-theme="dark"] .kyp-wx__lang select, :root[data-theme="dark"] .kyp-wx__btn:not(.kyp-wx__btn--main) { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.2); color: inherit; }
:root[data-theme="dark"] .kyp-wx__lang, :root[data-theme="dark"] .kyp-wx__steps small, :root[data-theme="dark"] .kyp-wx__note { color: #a9b6d8; }
