/* ===== Profil (#profile-dialog, js/profil.js) : Information et Réalisations =====
   Fond crème uni arrondi sans contour (brun sombre avec « Fenêtres sombres »), taille fixe : seuls les volets .pfl-pane défilent.
   Chaque règle est limitée à la fenêtre par « :where(#profile-dialog) » (sans poids dans la cascade) : le préfixe pr- appartient aux
   lignes de la fenêtre Plans, les classes du profil commencent par pfl- ou ac-. */
#profile-dialog {
  --op-bg: #fdeecc; --op-ink: #3a2412; --op-ink-2: #5a3a1b; --op-muted: #6b4c2c; --op-accent: #8a5a10; --op-line: #e3cc9c;
  --op-card: #f3dfb4; --op-sel: #f7d583; --pfl-ok: #1f6b34; --pfl-hot: #fff6d2; --pfl-done: #e6e6b8; --pfl-star-off: #cdb383;
  width: min(920px, calc(100vw - 32px)); height: min(820px, calc(100dvh - 32px)); max-height: none; box-sizing: border-box; padding: 20px; overflow: hidden;
  border: 0; border-radius: 18px; background: var(--op-bg); color: var(--op-ink); box-shadow: 0 10px 40px rgba(0, 0, 0, .6); font-size: 16px; line-height: 1.3;
}
html.dark-win #profile-dialog {
  --op-bg: var(--dw-bg); --op-ink: var(--dw-ink); --op-ink-2: var(--dw-ink-2); --op-muted: #cbb693; --op-accent: var(--dw-accent); --op-line: var(--dw-line);
  --op-card: #3f3124; --op-sel: #5f4724; --pfl-ok: var(--dw-ok); --pfl-hot: #57431a; --pfl-done: #33381f; --pfl-star-off: #6b5236; color-scheme: dark;
}
#profile-dialog p, #profile-dialog h2, #profile-dialog h3 { margin: 0; }
#profile-dialog h2, #profile-dialog h3 { text-transform: none; }
#profile-dialog small { font-size: 16px; }
#profile-dialog img.ui-ico { margin: 0; object-fit: contain; }
#profile-dialog :is(button, input):focus-visible, #profile-dialog .ac:focus-visible { outline: 3px solid var(--op-accent); outline-offset: 2px; }
:where(#profile-dialog) .pfl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
:where(#profile-dialog) .pfl-box { height: 100%; display: flex; flex-direction: column; gap: 12px; }

/* Barres (XP, paliers) */
:where(#profile-dialog) .pfl-bar { position: relative; display: flex; height: 24px; box-sizing: border-box; overflow: hidden; border-radius: 12px; background: #2a1c10; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .7); }
:where(#profile-dialog) .pfl-bar > i { display: block; flex: none; height: 100%; background: linear-gradient(#ffd971, #e0a22a); box-shadow: inset 0 -3px 4px rgba(120, 70, 0, .4), inset 0 2px 3px rgba(255, 255, 255, .4); transition: width .25s ease-out; }
:where(#profile-dialog) .pfl-bar > i.more { background: linear-gradient(#7fe69b, #1f8a48); }
:where(#profile-dialog) .pfl-bar > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-bottom: 2px; box-sizing: border-box; font-size: 14px; font-weight: 700; line-height: 1; color: #fff; -webkit-text-stroke: 3px #1d150e; paint-order: stroke fill; white-space: nowrap; }

/* En-tête */
:where(#profile-dialog) .pfl-head { flex: none; display: flex; align-items: flex-start; gap: 12px; }
#profile-dialog .pfl-head .btn.close { flex: none; width: 40px; height: 40px; }
html:not(.dark-win) #profile-dialog .btn.close { filter: drop-shadow(0 2px 2px rgba(58, 36, 18, .6)); }
:where(#profile-dialog) .pfl-card { flex: 1; min-width: 0; min-height: 116px; box-sizing: border-box; display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 24px; padding: 12px 20px 12px 16px; border-radius: 14px;
  background: radial-gradient(circle at 62px 50%, rgba(255, 224, 138, .28), transparent 120px), linear-gradient(90deg, #1f6b4a, #1f5440 45%, #18432f); color: #fff; }
:where(#profile-dialog) .pfl-av { position: relative; width: 92px; height: 92px; }
:where(#profile-dialog) .pfl-av > img { width: 92px; height: 92px; box-sizing: border-box; border-radius: 50%; border: 4px solid #e9b949; object-fit: cover; object-position: center 15%; background: radial-gradient(circle at 50% 35%, #f8e2a8, #b98a3c); box-shadow: 0 3px 8px rgba(0, 0, 0, .45); }
:where(#profile-dialog) .pfl-lvl { position: absolute; right: -12px; bottom: -8px; width: 46px; height: 48px; display: grid; place-items: center; background: url("../img/ui/profil.png") center / contain no-repeat; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
:where(#profile-dialog) .pfl-lvl b { padding-bottom: 5px; font: 400 18px/1 var(--font-title); color: #fff; text-shadow: 0 2px 2px #000; }
:where(#profile-dialog) .pfl-who { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
:where(#profile-dialog) .pfl-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; min-height: 40px; }
:where(#profile-dialog) .pfl-name h2 { min-width: 0; font: 400 28px/1.1 var(--font-title); color: #fff; text-shadow: 0 2px 2px rgba(0, 0, 0, .6); overflow-wrap: anywhere; }
:where(#profile-dialog) .pfl-mini { min-height: 30px; padding: 2px 12px 4px; border: 0; border-radius: 15px; background: rgba(255, 255, 255, .14); color: #f7e7bd; font: 400 16px/1 var(--font-title); cursor: pointer; }
:where(#profile-dialog) .pfl-mini:hover { background: rgba(255, 255, 255, .26); color: #fff; }
#profile-dialog .pfl-card :focus-visible { outline-color: #ffe08a; }
:where(#profile-dialog) .pfl-on { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; color: #c8f0d2; white-space: nowrap; }
:where(#profile-dialog) .pfl-on i { width: 10px; height: 10px; border-radius: 50%; background: #5ee08a; box-shadow: 0 0 6px #5ee08a; }
:where(#profile-dialog) .pfl-xp { height: 28px; border-radius: 14px; }
:where(#profile-dialog) .pfl-xp > span { font-size: 16px; }
:where(#profile-dialog) .pfl-edit { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 40px; }
:where(#profile-dialog) .pfl-edit input { flex: 1 1 160px; min-width: 0; max-width: 260px; min-height: 40px; box-sizing: border-box; padding: 4px 12px; border: 0; border-radius: 10px; background: #fff8e6; color: #3a2a14; font: 16px var(--font-text, inherit); }
#profile-dialog .pfl-edit .btn { min-height: 40px; padding: 4px 16px 6px; font-size: 16px; }
#profile-dialog #pf-pseudo-msg { min-height: 28px; color: #ffe0ad; line-height: 1.2; }

/* Onglets */
:where(#profile-dialog) .pfl-tabs { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
:where(#profile-dialog) .pfl-tab { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 8px 2px; border: 0; border-radius: 10px; background: var(--op-card); color: var(--op-ink-2); font: 400 18px/1 var(--font-title); cursor: pointer; }
:where(#profile-dialog) .pfl-tab:hover { color: var(--op-ink); filter: brightness(1.03); }
:where(#profile-dialog) .pfl-tab.on { background: var(--op-sel); color: var(--op-ink); box-shadow: inset 0 -3px 0 #e9b949; }
:where(#profile-dialog) .pfl-tab i { display: inline-grid; place-items: center; min-width: 14px; height: 24px; padding: 0 7px 1px; box-sizing: border-box; border-radius: 12px; background: #23783f; color: #fff; font: 700 15px/1 var(--font-text); }
:where(#profile-dialog) .pfl-panes { flex: 1; min-height: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
:where(#profile-dialog) .pfl-pane { grid-area: 1 / 1; min-width: 0; min-height: 0; overflow: hidden auto; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--op-accent) transparent; overscroll-behavior: contain; padding: 0 6px 4px 4px; outline: none; }
:where(#profile-dialog) .pfl-pane.off { visibility: hidden; pointer-events: none; }

/* Familles : couleur du fond des icônes */
:where(#profile-dialog) .f-shop { --fam: #a45a17; } :where(#profile-dialog) .f-plans { --fam: #1f5440; } :where(#profile-dialog) .f-craft { --fam: #7c3f2b; } :where(#profile-dialog) .f-hero { --fam: #54387f; } :where(#profile-dialog) .f-city { --fam: #235a8c; } :where(#profile-dialog) .f-arena { --fam: #7d2330; }

/* Information */
:where(#profile-dialog) .pfl-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
:where(#profile-dialog) .pfl-block { min-width: 0; padding: 14px 16px; border-radius: 14px; background: var(--op-card); }
:where(#profile-dialog) .pfl-block h3 { display: flex; align-items: center; gap: 12px; margin-bottom: 8px !important; font: 400 19px/1.15 var(--font-title); color: var(--op-ink); }
:where(#profile-dialog) .pfl-ico { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--fam, #1f5440); }
#profile-dialog .pfl-ico img.ui-ico { width: 30px; height: 30px; }
:where(#profile-dialog) .pfl-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 38px; }
:where(#profile-dialog) .pfl-row + .pfl-row { border-top: 1px solid var(--op-line); }
:where(#profile-dialog) .pfl-i { display: grid; place-items: center; }
#profile-dialog .pfl-i img { width: 26px; height: 26px; object-fit: contain; }
:where(#profile-dialog) .pfl-l { color: var(--op-ink-2); }
:where(#profile-dialog) .pfl-row b, :where(#profile-dialog) .pfl-part b { text-align: right; font: 400 17px/1.2 var(--font-title); color: var(--op-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
:where(#profile-dialog) .pfl-none { padding: 8px 0; color: var(--op-muted); }
:where(#profile-dialog) .pfl-net { grid-column: 1 / -1; --fam: #1f5440; }
:where(#profile-dialog) .pfl-net h3 > b { margin-left: auto; font: 400 28px/1 var(--font-title); color: var(--op-accent); white-space: nowrap; }
:where(#profile-dialog) .pfl-split { display: flex; gap: 2px; height: 16px; margin: 4px 0 12px; overflow: hidden; border-radius: 8px; background: var(--op-line); }
:where(#profile-dialog) .pfl-split i { flex: 1 1 0; min-width: 4px; }
:where(#profile-dialog) .c-gold { background: #e0a22a; } :where(#profile-dialog) .c-stock { background: #8a56b8; } :where(#profile-dialog) .c-shop { background: #2f9a5a; } :where(#profile-dialog) .c-hero { background: #c8452f; } :where(#profile-dialog) .c-city { background: #2f78b8; }
:where(#profile-dialog) .pfl-parts { display: grid; grid-template-columns: repeat(5, auto); justify-content: space-between; gap: 8px 16px; }
:where(#profile-dialog) .pfl-part { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
:where(#profile-dialog) .pfl-part .pfl-l { display: flex; align-items: center; gap: 8px; }
:where(#profile-dialog) .pfl-part .pfl-l i { flex: none; width: 10px; height: 10px; border-radius: 50%; }
:where(#profile-dialog) .pfl-part b { text-align: left; padding-left: 18px; }

/* Réalisations : résumé */
:where(#profile-dialog) .ac-sum { position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 16px 20px; height: 100px; box-sizing: border-box; padding: 10px 16px; border-radius: 14px; background: var(--op-card); }
:where(#profile-dialog) .ac-cup { display: grid; place-items: center; }
#profile-dialog .ac-cup img.ui-ico { width: 54px; height: 54px; }
:where(#profile-dialog) .ac-tot p { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px !important; }
:where(#profile-dialog) .ac-tot p b { font: 400 24px/1 var(--font-title); color: var(--op-accent); }
:where(#profile-dialog) .ac-tot em { flex: none; font: 400 18px/1 var(--font-title); color: var(--op-ink); }
:where(#profile-dialog) .ac-all { display: grid; justify-items: center; gap: 8px; min-width: 210px; }
:where(#profile-dialog) .ac-gains { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 12px; min-height: 22px; font: 400 17px/1.2 var(--font-title); color: var(--pfl-ok); }
:where(#profile-dialog) .ac-gains small { font-family: var(--font-text); color: var(--op-muted); }
:where(#profile-dialog) .ac-gains > span, :where(#profile-dialog) .ac-rw, :where(#profile-dialog) .ac-gain > span { white-space: nowrap; }
#profile-dialog :is(.ac-gains, .ac-side, .ac-gain) img.ui-ico { height: 1.15em; width: auto; vertical-align: -.2em; }
#profile-dialog .ac-all .btn { min-width: 210px; font-size: 16px; }
#profile-dialog .ac-all.on .btn { min-height: 44px; font-size: 18px; }

/* Filtres (collés sous le résumé) */
:where(#profile-dialog) .ac-fil { position: sticky; top: 100px; z-index: 3; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; padding: 12px 0; background: var(--op-bg); }
:where(#profile-dialog) .ac-sum::before { content: ""; position: absolute; inset: 0 0 50%; z-index: -1; background: var(--op-bg); } /* coins hauts opaques au défilement */
:where(#profile-dialog) .ac-sum { isolation: isolate; background: none; }
:where(#profile-dialog) .ac-sum::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 14px; background: var(--op-card); }
:where(#profile-dialog) .ac-f { display: flex; flex-wrap: wrap; gap: 8px; }
:where(#profile-dialog) .ac-fb { position: relative; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px 2px; border: 0; border-radius: 10px; background: var(--op-card); color: var(--op-ink-2); font: 400 16px/1 var(--font-title); white-space: nowrap; cursor: pointer; }
:where(#profile-dialog) .ac-fb b { font: 700 16px/1 var(--font-text); color: var(--op-muted); font-variant-numeric: tabular-nums; }
:where(#profile-dialog) .ac-fb:hover { color: var(--op-ink); filter: brightness(1.04); }
:where(#profile-dialog) .ac-fb.on { background: var(--op-sel); color: var(--op-ink); box-shadow: inset 0 -3px 0 #e9b949; }
:where(#profile-dialog) .ac-fb.on b { color: var(--op-ink); }
:where(#profile-dialog) .ac-fb.hot b { color: var(--pfl-ok); }
:where(#profile-dialog) .ac-fb.ico { width: 44px; padding: 0; }
#profile-dialog .ac-fb img.ui-ico { width: 28px; height: 28px; }
:where(#profile-dialog) .ac-fb .dot { position: absolute; top: -2px; right: -2px; width: 12px; height: 12px; border-radius: 50%; background: #2f9a5a; box-shadow: 0 0 0 2px var(--op-bg); }

/* Cartes */
:where(#profile-dialog) .ac-list { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-content: start; padding-bottom: 4px; }
:where(#profile-dialog) .ac { position: relative; min-width: 0; border-radius: 14px; background: var(--op-card); scroll-margin-top: 176px; }
:where(#profile-dialog) .ac-in { height: 100%; box-sizing: border-box; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-rows: 1fr auto; align-items: center; gap: 8px 12px; padding: 12px 14px; }
:where(#profile-dialog) .ac-ico { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 12px; background: var(--fam, #1f5440); box-shadow: inset 0 0 0 2px rgba(255, 224, 138, .35), inset 0 -8px 12px rgba(0, 0, 0, .25); }
#profile-dialog .ac-ico img.ui-ico { width: 38px; height: 38px; }
:where(#profile-dialog) .ac-txt { min-width: 0; }
:where(#profile-dialog) .ac-txt b { display: block; font: 400 18px/1.15 var(--font-title); color: var(--op-ink); }
:where(#profile-dialog) .ac-txt small { display: block; margin-top: 2px; line-height: 1.2; color: var(--op-ink-2); }
:where(#profile-dialog) .ac-side { justify-self: end; text-align: right; font: 400 18px/1.2 var(--font-title); white-space: nowrap; }
:where(#profile-dialog) .ac-rw { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 6px; border-radius: 99px; background: var(--op-bg); color: var(--op-accent); }
#profile-dialog .ac-side .btn { min-height: 44px; padding: 4px 16px 6px; font-size: 18px; }
:where(#profile-dialog) .ac-prog { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
:where(#profile-dialog) .ac-prog .pfl-bar { flex: 1; min-width: 0; }
:where(#profile-dialog) .ac-stars { flex: none; display: flex; gap: 3px; }
/* Étoile découpée dans l'image du jeu : creuse, gagnée (or), à récupérer (verte qui pulse) */
:where(#profile-dialog) .ac-star { width: 22px; height: 22px; filter: drop-shadow(0 1px 0 rgba(58, 36, 18, .55)); }
:where(#profile-dialog) .ac-star::before { content: ""; display: block; width: 100%; height: 100%; background: var(--pfl-star-off); -webkit-mask: url("../img/vente/serie.png") center / contain no-repeat; mask: url("../img/vente/serie.png") center / contain no-repeat; }
:where(#profile-dialog) .ac-star:not(.won):not(.due) { filter: none; }
:where(#profile-dialog) .ac-star.won::before { background: linear-gradient(#ffc933, #cf7d06); }
:where(#profile-dialog) .ac-star.due::before { background: linear-gradient(#5fd683, #1f8a48); }
:where(#profile-dialog) .ac-star.due { animation: pflDue 1.2s ease-in-out infinite alternate; }
@keyframes pflDue { from { transform: scale(.88); } to { transform: scale(1.14); } }
:where(#profile-dialog) .ac-star.pop { animation: pflPop .45s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes pflPop { from { transform: scale(2) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }
:where(#profile-dialog) .ac-gain { position: absolute; right: 14px; top: 14px; z-index: 2; display: flex; gap: 10px; padding: 6px 14px 8px; border-radius: 99px; background: #1f6b34; color: #fff; font: 400 18px/1.2 var(--font-title); pointer-events: none; animation: pflGain 1.1s ease-out both; }
@keyframes pflGain { 0% { transform: translateY(8px) scale(.8); opacity: 0; } 18% { transform: none; opacity: 1; } 65% { transform: translateY(-6px); opacity: 1; } 100% { transform: translateY(-22px); opacity: 0; } }

:where(#profile-dialog) .ac.ready { background: var(--pfl-hot); box-shadow: inset 0 0 0 2px #e9b949, 0 0 8px rgba(233, 185, 73, .6); }
:where(#profile-dialog) .ac.done { background: var(--pfl-done); }
:where(#profile-dialog) .ac.done .ac-in { grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 4px 12px; padding: 8px 14px; align-content: center; }
:where(#profile-dialog) .ac.done .ac-ico { grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 10px; }
#profile-dialog .ac.done .ac-ico img.ui-ico { width: 30px; height: 30px; }
:where(#profile-dialog) .ac.done .ac-txt { grid-row: 1 / 3; }
:where(#profile-dialog) .ac.done .ac-prog { grid-column: 3; justify-content: flex-end; }
:where(#profile-dialog) .ac.done .ac-star { width: 18px; height: 18px; }
:where(#profile-dialog) .ac-ok { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; color: var(--pfl-ok); }
#profile-dialog .ac-ok img.ui-ico { height: 16px; }
:where(#profile-dialog) .ac.soon { background: none; box-shadow: inset 0 0 0 2px var(--op-line); }
:where(#profile-dialog) .ac.soon .ac-in { padding: 8px 14px; grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-rows: 1fr; }
:where(#profile-dialog) .ac.soon .ac-ico { width: 40px; height: 40px; border-radius: 10px; filter: grayscale(1); opacity: .55; }
#profile-dialog .ac.soon .ac-ico img.ui-ico { width: 28px; height: 28px; }
:where(#profile-dialog) .ac.soon .ac-txt b, :where(#profile-dialog) .ac.soon .ac-txt small { color: var(--op-muted); }
:where(#profile-dialog) .ac-tag { padding: 4px 12px 5px; border-radius: 99px; background: var(--op-line); color: var(--op-ink-2); white-space: nowrap; }
:where(#profile-dialog) .ac-empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 12px; padding: 48px 16px; text-align: center; color: var(--op-muted); }
#profile-dialog .ac-empty img.ui-ico { width: 72px; height: 72px; filter: grayscale(1); opacity: .45; }

/* Largeurs réduites, fenêtres basses, téléphone */
@media (max-width: 860px) {
  :where(#profile-dialog) .pfl-name h2 { font-size: 24px; }
  :where(#profile-dialog) .ac-list { grid-template-columns: minmax(0, 1fr); }
  :where(#profile-dialog) .pfl-parts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  :where(#profile-dialog) .pfl-part { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; }
}
@media (max-width: 860px), (max-height: 860px) {
  :where(#profile-dialog) .ac-sum { position: relative; }
  :where(#profile-dialog) .ac-fil { top: 0; }
  :where(#profile-dialog) .ac { scroll-margin-top: 130px; }
}
@media (max-width: 620px) {
  :where(#profile-dialog) .ac-in { column-gap: 8px; }
  #profile-dialog .ac-side .btn { padding: 4px 10px 6px; font-size: 16px; }
  :where(#profile-dialog) .pfl-in { grid-template-columns: minmax(0, 1fr); }
  :where(#profile-dialog) .pfl-card { grid-template-columns: 76px minmax(0, 1fr); gap: 22px; padding: 10px 12px; min-height: 116px; }
  :where(#profile-dialog) .pfl-av, :where(#profile-dialog) .pfl-av > img { width: 76px; height: 76px; }
  :where(#profile-dialog) .pfl-name { gap: 4px 10px; } :where(#profile-dialog) .pfl-name h2 { font-size: 22px; flex: 1 1 100%; }
  :where(#profile-dialog) .pfl-on { margin-left: 0; }
  :where(#profile-dialog) .pfl-who { gap: 8px; }
  :where(#profile-dialog) .ac-sum { height: auto; min-height: 136px; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; padding: 12px; }
  #profile-dialog .ac-cup img.ui-ico { width: 46px; height: 46px; }
  :where(#profile-dialog) .ac-all { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) auto; align-items: center; justify-items: start; gap: 12px; min-width: 0; min-height: 44px; }
  :where(#profile-dialog) .ac-gains { justify-content: flex-start; }
  #profile-dialog .ac-all .btn { min-width: 0; }
  :where(#profile-dialog) .ac-f { width: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: auto; gap: 8px; }
  :where(#profile-dialog) .ac-fams { grid-auto-columns: minmax(0, 1fr); }
  :where(#profile-dialog) .ac-fb { flex-direction: column; gap: 4px; padding: 4px; min-height: 48px; font-size: 14px; }
  :where(#profile-dialog) .ac-fb.ico { width: auto; min-height: 44px; }
}
html.tel #profile-dialog { width: 100%; height: 100dvh; max-width: none; margin: 0; border-radius: 0; padding: calc(8px + var(--st)) calc(12px + var(--sr)) calc(10px + var(--sb)) calc(12px + var(--sl)); }
html.tel :where(#profile-dialog) .pfl-box { gap: 8px; }
html.tel :where(#profile-dialog) .pfl-head { position: relative; display: block; }
html.tel #profile-dialog .pfl-head .btn.close { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; filter: none; }
html.tel :where(#profile-dialog) .pfl-name h2 { padding-right: 36px; box-sizing: border-box; }
html.tel :where(#profile-dialog) .pfl-mini { min-height: 44px; padding: 0 14px 2px; border-radius: 12px; }
html.tel :where(#profile-dialog) .pfl-edit { padding-right: 40px; }
html.tel #profile-dialog .pfl-edit .btn, html.tel :where(#profile-dialog) .pfl-edit input, html.tel #profile-dialog .ac-all .btn { min-height: 44px; }
html.tel :where(#profile-dialog) .pfl-pane { padding: 0 4px 4px 0; scrollbar-gutter: auto; }
@media (max-height: 520px) { /* téléphone couché */
  html.tel :where(#profile-dialog) .pfl-card { min-height: 0; padding: 4px 60px 4px 12px; grid-template-columns: 56px minmax(0, 1fr); }
  html.tel :where(#profile-dialog) .pfl-av, html.tel :where(#profile-dialog) .pfl-av > img { width: 56px; height: 56px; }
  html.tel :where(#profile-dialog) .pfl-lvl { width: 36px; height: 38px; } html.tel :where(#profile-dialog) .pfl-lvl b { font-size: 15px; }
  html.tel :where(#profile-dialog) .pfl-who { gap: 4px; }
  html.tel :where(#profile-dialog) .pfl-name h2, html.tel :where(#profile-dialog) .pfl-edit { padding-right: 0; }
  html.tel :where(#profile-dialog) .ac-fil { position: relative; }
}
@media (prefers-reduced-motion: reduce) {
  :where(#profile-dialog) .ac-star.due, :where(#profile-dialog) .ac-star.pop { animation: none; }
  :where(#profile-dialog) .ac-gain { display: none; }
  :where(#profile-dialog) .pfl-bar > i { transition: none; }
}
