/* ── Profile tab (/profile), redesigned 2026-10-09 (owner picked mockup C) ──
   Green hero card like the Home tab (avatar, name, stage, 5-square bar,
   next reward), then settings-style lists under gold-diamond headings.
   No emojis. Markup: profile.html + js/profile.js. */

#profile-page { gap: 18px; }
#profile-page > h1 { text-align: center; }

/* 1. Hero */
.pf-hero {
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px; border-radius: 20px;
  background: linear-gradient(160deg, var(--z-primary) 0%, color-mix(in srgb, var(--z-primary) 82%, #f7f5f0) 100%);   /* follows the mode colour */
  color: #f7f5f0; box-shadow: 0 6px 20px rgb(63 94 79 / 0.25);
}
.pf-hero { position: relative; cursor: pointer; }
.pf-edit {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px;
  display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;
  background: rgb(255 255 255 / 0.16); cursor: pointer;
}
.pf-edit svg { width: 18px; height: 18px; fill: none; stroke: #f7f5f0; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pf-hero-text { padding-right: 36px; }
.pf-hero-top { display: flex; align-items: center; gap: 14px; }
.pf-avatar { flex: none; display: block; border-radius: 50%; text-decoration: none; }
.pf-hero .profile-avatar { width: 72px; height: 72px; background: rgb(255 255 255 / 0.14); box-shadow: 0 0 0 3px #d4c19e; }
.pf-hero .profile-avatar svg { stroke: #f7f5f0; }
.pf-hero .totem-visual--avatar { --size: 72px; }
.pf-hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pf-name {
  padding: 0; border: 0; background: none; text-align: left;
  font: inherit; font-size: 19px; font-weight: 800; line-height: 1.2; color: #fff; overflow-wrap: break-word;
}
.pf-name.is-empty { font-size: 16px; font-weight: 700; color: #d4c19e; }
.pf-sub { font-size: 13px; color: #d1e1d9; }
.pf-plume { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; margin-top: 6px; padding: 3px 10px 3px 7px; border-radius: 999px; background: #fbf6ec; color: #7a6236; font-size: 12px; font-weight: 700; }
.pf-plume.hidden { display: none; }
.pf-plume svg { width: 14px; height: 14px; fill: none; stroke: #b8975a; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pf-bar { display: flex; gap: 5px; }
.pf-bar i { flex: 1; height: 8px; border-radius: 4px; background: rgb(255 255 255 / 0.22); }
.pf-bar i.on { background: #d4c19e; }
.pf-next { font-size: 14px; color: #d6e4dd; line-height: 1.4; }
.pf-next b { display: inline-block; padding: 1px 9px; border-radius: 999px; background: #f0e7d6; color: #7a6236; font-size: 13px; }
.pf-pick { align-self: flex-start; padding: 8px 14px; border-radius: 999px; background: #f7f5f0; color: var(--z-primary); font-size: 14px; font-weight: 700; text-decoration: none; }

/* 2. Section headings: gold diamond, spaced capitals, fine rule (as /home, /totem) */
.tab-page h2.pf-kick {
  display: flex; align-items: center; gap: 10px; margin: 0 0 10px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--z-primary);
}
.pf-kick::before { content: ''; flex: none; width: 7px; height: 7px; background: #b8975a; transform: rotate(45deg); }
.pf-kick::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, #b8975a66, transparent); }

/* 3. Settings-style rows */
.pf-group { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid #ebe9e3; border-radius: 16px; overflow: hidden; }
.pf-group > li + li { border-top: 1px solid #f2f1ed; }
.pf-row {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  border: 0; background: none; font: inherit; text-align: left; cursor: pointer;
  color: var(--tab-ink); text-decoration: none;
}
.pf-row:hover { background: #f6f9f8; }
.pf-ico { flex: none; width: 32px; height: 32px; border-radius: 9px; background: #eff4f2; display: grid; place-items: center; }
.pf-ico svg { width: 18px; height: 18px; fill: none; stroke: var(--z-primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pf-lbl { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 16px; }
.pf-lbl small { font-size: 13px; color: var(--tab-muted); overflow-wrap: anywhere; }
.pf-chev { flex: none; font-size: 22px; line-height: 1; color: #8a8f92; }
.pf-row--danger { color: #b23a3a; }
.pf-row--danger .pf-ico { background: #faf0f0; }
.pf-row--danger .pf-ico svg { stroke: #b23a3a; }
.pf-row--static { cursor: default; }
.pf-row--static:hover { background: none; }

/* Language: FR | EN segmented control (buttons keep .lang-btn for js/i18n.js) */
.pf-seg { flex: none; display: inline-flex; padding: 3px; border-radius: 999px; background: #f2f1ed; }
.pf-seg .lang-btn {
  padding: 6px 16px; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; color: var(--tab-muted); text-decoration: none;
}
.pf-seg .lang-btn.active { background: #fff; color: var(--tab-ink); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }

/* "Mon bilan" (moved from Accueil 2026-10-12, js/summary.js): 2 × 2 key
   figures with the money saved in gold, then favourite treatments as bars. */
.hm-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hm-stat { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 16px; background: #fff; border: 1px solid #e4e6e3; }
.hm-stat b { font-size: 26px; line-height: 1.1; color: var(--tab-ink); }
.hm-stat span { font-size: 12px; color: #6f7477; }
.hm-stat.is-gold { background: #faf5ea; border-color: #e3d3b0; }
.hm-stat.is-gold b { color: #7a6236; }

.hm-likes { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 16px; background: #fff; border: 1px solid #e4e6e3; }
.hm-like { display: grid; grid-template-columns: 116px 1fr 24px; align-items: center; gap: 10px; font-size: 13px; color: #2e3235; }
.hm-like span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-like i { display: block; height: 10px; border-radius: 5px; background: var(--z-primary); }
.hm-like em { font-style: normal; font-weight: 700; text-align: right; color: var(--tab-ink); }
.hm-summary-hint { margin: 8px 2px 0; font-size: 13px; color: #6f7477; }
.hm-summary-hint.hidden { display: none; }
.tab-page h3.pf-likes-h { margin: 16px 2px 8px; font-size: 13px; font-weight: 700; color: var(--z-primary); }

/* Practitioner entries of the Profil tab (owner fix 2026-10-12). */
.pf-pro-btn { display: block; margin: 0 0 14px; padding: 12px; border-radius: 12px; background: var(--tab-accent, var(--z-primary)); color: #fff; text-align: center; font-weight: 700; text-decoration: none; }
.pf-pro-link { margin: 6px 6px 0; font-size: 13px; color: #6b6b6b; }
.pf-pro-link a { color: inherit; text-decoration: underline; }

/* Practitioner mode (owner pick A, 2026-10-14): inside the orange card, a line,
   the chips of what is still missing (only while missing), then a cream button. */
.pf-hero .pf-pro-box { display: flex; flex-direction: column; gap: 14px; padding-top: 14px; border-top: 1px solid rgb(255 255 255 / 0.22); }
.pf-hero .pf-pro-box.hidden { display: none; }
.pf-pro-state { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-pro-state.hidden { display: none; }
.pf-pro-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; background: rgb(0 0 0 / 0.16); color: #fff; font-size: 13px; }
.pf-pro-chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #f0d9a8; }
.pf-pro-chip.is-alert::before { background: #ffb4a2; }
.pf-hero .pf-pro-btn { display: flex; justify-content: space-between; align-items: center; margin: 0; padding: 13px 16px; border-radius: 12px; background: #f7f5f0; color: #9c4419; font-size: 16px; text-align: left; }
body.mode-practitioner #me-summary-box, body.mode-practitioner #me-likes-box { display: none; }

/* Practitioner photo (2026-10-13): avatar of the hero + picker in "Modifier mes informations". */
.profile-avatar.has-photo { overflow: hidden; background: #fff; }
.profile-avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
body.mode-practitioner .pf-hero .pf-avatar { cursor: pointer; }
body.mode-practitioner .pf-hero { cursor: default; }
.pf-photo { display: flex; align-items: center; gap: 14px; margin: 2px 0 6px; }
.pf-photo-preview {
  flex: none; width: 72px; height: 72px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: var(--z-primary-soft, #f2f1ed); box-shadow: 0 0 0 2px var(--z-primary);
}
.pf-photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-photo-preview svg { width: 34px; height: 34px; fill: none; stroke: var(--z-primary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pf-photo-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.pf-photo-btn { padding: 9px 14px; border: 0; border-radius: 999px; background: var(--z-primary); color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.pf-photo-text small { font-size: 12px; color: #4b5a52; line-height: 1.35; }
.pf-photo-text .auth-error:empty { display: none; }
.pf-photo-text .auth-error { margin: 0; }
/* Practitioner hero on orange (AA, tests/contrast-check.js): darker gradient end, white text, cream ring. */
body[data-mode="practitioner"] .pf-hero { background: linear-gradient(160deg, #b4521f 0%, #9c4419 100%); box-shadow: 0 6px 20px rgb(180 82 31 / 0.25); }
body[data-mode="practitioner"] .pf-sub { color: #fff; }
body[data-mode="practitioner"] .pf-hero .profile-avatar { box-shadow: 0 0 0 3px #f7f5f0; }
/* Rating on the practitioner card (2026-10-13): stars + average + count, opens the reviews. */
.pf-rating {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; white-space: nowrap;
  margin-top: 4px; padding: 4px 12px; border-radius: 999px; background: rgb(255 255 255 / 0.16);
  color: #fff; font-size: 13px; text-decoration: none;
}
.pf-rating::after { content: '›'; font-weight: 700; }
.pf-rating strong { font-weight: 800; }
.pf-stars { color: #f0d9a8; letter-spacing: 1px; font-size: 14px; }

/* Share my page (practitioner mode, 2026-10-14): small QR icon left of the pencil + sheet. */
.pf-hero .pf-qr { right: 56px; }
.pf-hero .pf-qr.hidden { display: none; }
body.mode-practitioner .pf-hero-text, body[data-mode="practitioner"] .pf-hero-text { padding-right: 80px; }
.pf-qr-box { align-items: stretch; }
.pf-qr-code { align-self: center; width: min(240px, 70vw); aspect-ratio: 1; padding: 10px; border: 1px solid #ebe9e3; border-radius: 16px; background: #fff; }
.pf-qr-code svg { display: block; width: 100%; height: 100%; }
.pf-qr-link { margin: 0; text-align: center; font-size: 14px; color: #5f6467; word-break: break-all; user-select: all; }
.pf-qr-copy { background: #f7f5f0; color: #2e3235; border: 1px solid #dbd7ca; }
.si-choice .me-save.hidden { display: none; }

/* Next session booked (owner, 2026-10-15, layout A, js/next-booking.js): white
   card under the member card: one line day · time · practitioner, address,
   access notes, small map, « Itinéraire » (→ the maps apps) + « Copier », links. */
#profile-nb-box.hidden, body.mode-practitioner #profile-nb-box { display: none; }
.pf-nb { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 16px; background: #fff; border: 1px solid #e4e6e3; }
.pf-nb-line { margin: 0; font-size: 15px; line-height: 1.35; color: var(--z-ink, #2e3235); }
.pf-nb-when { font-weight: 800; }
.pf-nb-status { align-self: flex-start; padding: 2px 10px; border-radius: 999px; background: #eef3f0; color: var(--z-green, #3f5e4f); font-size: 12px; font-weight: 700; }
.pf-nb-addr { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 14px; line-height: 1.35; color: #5f6467; }
.pf-nb-pin { flex: none; display: grid; place-items: center; }
.pf-nb-pin svg { width: 18px; height: 18px; fill: none; stroke: var(--z-gold, #b8975a); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pf-nb-addr-text { flex: 1; min-width: 0; overflow-wrap: anywhere; user-select: all; }
.pf-nb-access { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: #faf5ea; border: 1px solid #e3d3b0; }
.pf-nb-access-h { font-size: 12px; font-weight: 700; color: #7a6236; }
.pf-nb-access-text { font-size: 14px; line-height: 1.35; color: var(--z-ink, #2e3235); overflow-wrap: anywhere; white-space: pre-line; }
.pf-nb-mapimg { display: block; border-radius: 12px; overflow: hidden; border: 1px solid #e4e6e3; aspect-ratio: 640 / 260; background: #eaefe9; }
.pf-nb-mapimg img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pf-nb-btns { display: flex; gap: 8px; }
.pf-nb-go, .pf-nb-copy { flex: 1; padding: 10px; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.pf-nb-go { border: 0; background: var(--z-green, #3f5e4f); color: #fff; }
.pf-nb-copy { border: 1px solid #dbd7ca; background: #f7f5f0; color: var(--z-ink, #2e3235); }
.pf-nb-copy.is-done { background: var(--z-green, #3f5e4f); border-color: var(--z-green, #3f5e4f); color: #fff; }
.pf-nb-apps { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 12px; background: #f7f5f0; }
.pf-nb-apps.hidden { display: none; }
.pf-nb-map { padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid #e4e6e3; color: var(--z-ink, #2e3235); font-size: 14px; font-weight: 700; text-decoration: none; }
.pf-nb-links { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-top: 10px; border-top: 1px solid #f2f1ed; }
.pf-nb-link { font-size: 14px; font-weight: 700; color: var(--z-green, #3f5e4f); text-decoration: none; }
.pf-nb-link::after { content: ' ›'; }
body[data-mode="practitioner"] .pf-plume { display: none; }

/* « Ma carte membre » row in « Mon compte » (owner, 2026-10-19): mini card in the member card colour. */
.pf-card-mini { width: 22px; height: 15px; border-radius: 3px; background: linear-gradient(135deg, #7d9384, #536d5e); box-shadow: inset 0 0 0 1.5px rgb(247 245 240 / .35); }
.pf-card-mini.is-lin { background: linear-gradient(135deg, #fbf8f1, #e6ddca); box-shadow: inset 0 0 0 1.5px rgb(95 122 106 / .4), 0 0 0 1px #d8cdb6; }
.pf-card-mini.is-foret { background: linear-gradient(135deg, #4c6456, #2c3c33); box-shadow: inset 0 0 0 1.5px rgb(226 214 190 / .4); }
body[data-mode="practitioner"] #profile-card-row { display: none; }
/* « Voir l'évolution de ma loutre » line at the foot of the green card (owner mockup, 2026-10-19). */
.pf-evol { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -20px -4px; padding: 14px 20px 0; border-top: 1px solid rgb(255 255 255 / 0.18); color: #f7f5f0; font-size: 16px; font-weight: 700; text-decoration: none; }
.pf-evol.hidden, body[data-mode="practitioner"] .pf-evol { display: none; }
.pf-evol-chev { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #f0e7d6; color: #536d5e; font-size: 20px; line-height: 1; padding-bottom: 2px; }

/* « Mon compte » lighter (owner pick A, 2026-11-02): sign out + delete as small
   links under the box, the other spaces behind « Mes espaces » (sheet). */
.pf-foot { margin: 10px 0 0; text-align: center; }
.pf-foot-links { margin: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 22px; }
.pf-foot-link { border: 0; background: none; padding: 6px 4px; font: inherit; font-size: 14px; color: #6b6b6b; text-decoration: underline; cursor: pointer; }
.pf-foot-link--danger { color: #b23a3a; }
.pf-foot-mail { margin: 2px 0 0; font-size: 12px; color: #8a8f92; overflow-wrap: anywhere; }
#profile-spaces-sheet .pf-group { margin-bottom: 6px; }
