/* Profile v2 — built from scratch. Works on phone, app and desktop. Tokens come from mobile-redesign.css. */
.pf-page { color: var(--m-ink); }
.pf { max-width: 560px; margin: 0 auto; display: grid; gap: 14px; font-size: 14px; line-height: 1.6; }
.pf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.pf button, .pf input, .pf select { font-family: inherit; }

.pf-hero { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--m-line); border-radius: 20px; background: linear-gradient(160deg, color-mix(in srgb, var(--m-accent) 12%, var(--m-surface)), var(--m-surface) 70%); }
.pf-avatar { position: relative; flex: none; width: 76px; height: 76px; padding: 0; border: 0; border-radius: 24px; background: var(--m-raised); cursor: pointer; transition: transform .15s; -webkit-tap-highlight-color: transparent; }
.pf-avatar:active { transform: scale(.96); }
.pf-avatar-img { display: block; width: 100%; height: 100%; border-radius: inherit; overflow: hidden; font-size: 38px; line-height: 76px; text-align: center; }
.pf-avatar-edit { position: absolute; inset-block-end: -4px; inset-inline-start: -4px; display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid var(--m-surface); border-radius: 50%; background: var(--m-accent); color: var(--m-on-accent); }
.pf-avatar-edit svg { width: 14px; height: 14px; }
.pf-who { min-width: 0; display: grid; gap: 2px; }
.pf-who h2 { margin: 0; font-size: 18px; line-height: 1.45; font-weight: 800; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.pf-handle { font-size: 12px; color: var(--m-muted); justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pf-tags b { padding: 1px 10px; border-radius: 999px; background: var(--m-raised); font-size: 11.5px; font-weight: 600; color: var(--m-muted); }

.pf-stats { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.pf-stats > div { display: grid; justify-items: center; gap: 1px; padding: 10px 6px; border: 1px solid var(--m-line); border-radius: 16px; background: var(--m-surface); }
.pf-stats svg { width: 18px; height: 18px; color: var(--m-accent); }
.pf-stats strong { font-size: 17px; font-weight: 800; }
.pf-stats span { font-size: 11px; color: var(--m-muted); }

.pf-group { display: grid; border: 1px solid var(--m-line); border-radius: 18px; background: var(--m-surface); overflow: hidden; }
.pf-group h3 { margin: 0; padding: 12px 16px 4px; font-size: 12px; font-weight: 700; color: var(--m-muted); }
.pf-row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 16px; border: 0; background: none; color: var(--m-ink); text-align: start; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color .15s; }
.pf-row + .pf-row::before { content: ''; position: absolute; inset-block-start: 0; inset-inline: 16px; height: 1px; background: var(--m-line); }
button.pf-row:active { background: var(--m-raised); }
.pf-ico { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 11px; background: color-mix(in srgb, var(--m-accent) 13%, transparent); color: var(--m-accent); }
.pf-ico svg { width: 19px; height: 19px; }
.pf-text { flex: 1; min-width: 0; display: grid; }
.pf-text strong { font-size: 14px; font-weight: 700; }
.pf-text small { font-size: 12px; color: var(--m-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-chev { flex: none; width: 8px; height: 8px; border: solid var(--m-muted); border-width: 0 0 2px 2px; transform: rotate(45deg); }
.pf-danger .pf-ico { background: color-mix(in srgb, var(--m-bad) 14%, transparent); color: var(--m-bad); }
.pf-danger strong { color: var(--m-bad); }
.pf-danger .pf-text small { white-space: normal; }

.pf-switch { position: relative; flex: none; width: 48px; height: 28px; padding: 0; border: 0; border-radius: 999px; background: var(--m-line); cursor: pointer; transition: background-color .2s; }
.pf-switch::after { content: ''; position: absolute; inset: -8px -4px; }
.pf-switch i { position: absolute; inset-block-start: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .22s cubic-bezier(.22,1,.36,1); }
.pf-switch[aria-checked="true"] { background: var(--m-accent); }
.pf-switch[aria-checked="true"] i { transform: translateX(-20px); }
.pf-switch:disabled { opacity: .6; }

.pf-sheet { padding: 0; border: 0; border-radius: 22px; background: var(--m-surface); color: var(--m-ink); width: min(440px, 100% - 24px); max-height: 90dvh; overflow: hidden; }
.pf-sheet::backdrop { background: rgba(8, 12, 22, .55); }
.pf-form { display: flex; flex-direction: column; max-height: 90dvh; }
.pf-form header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.pf-form h2 { margin: 0; font-size: 16px; font-weight: 800; }
.pf-close { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--m-raised); color: var(--m-ink); cursor: pointer; }
.pf-close svg { width: 16px; height: 16px; }
.pf-body { display: grid; gap: 14px; padding: 8px 16px 12px; overflow-y: auto; overscroll-behavior: contain; }
.pf-body label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: var(--m-muted); }
.pf-body input:not([type="checkbox"]):not([type="file"]), .pf-body select { width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid var(--m-line); border-radius: 12px; background: var(--m-bg); color: var(--m-ink); font-size: 16px; }
.pf-body input:focus, .pf-body select:focus { outline: 0; border-color: var(--m-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--m-accent) 22%, transparent); }
.pf-body input:disabled { opacity: .6; }
.pf-body small { font-weight: 400; font-size: 11.5px; color: var(--m-muted); }
.pf-body h3 { margin: 4px 0 0; font-size: 13px; }
.pf-check { display: flex !important; align-items: center; gap: 8px; min-height: 36px; }
.pf-msg { min-height: 0; margin: 0; padding: 0 16px; font-size: 12.5px; color: var(--m-bad); }
.pf-msg:not(:empty) { padding-block: 4px; }
.pf-form footer { display: flex; gap: 8px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--m-line); }
.pf-form footer button { flex: 1; min-height: 46px; border-radius: 12px; font-size: 14px; font-weight: 700; cursor: pointer; }
.pf-cancel { border: 1px solid var(--m-line); background: var(--m-raised); color: var(--m-ink); }
.pf-save { flex: 1.5 !important; border: 0; background: var(--m-accent); color: var(--m-on-accent); }
.pf-save:disabled { opacity: .6; cursor: wait; }

.pf-preview { width: 96px; height: 96px; margin: 0 auto; border-radius: 28px; overflow: hidden; background: var(--m-raised); font-size: 48px; line-height: 96px; text-align: center; }
.pf-upload { display: flex !important; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border: 1px dashed var(--m-accent); border-radius: 12px; color: var(--m-accent) !important; font-size: 13px !important; cursor: pointer; }
.pf-upload svg { width: 18px; height: 18px; }
.pf-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pf-upload:has(+ .pf-file:focus-visible) { outline: 3px solid var(--m-accent); }
.pf-hint { text-align: center; margin-top: -6px; }
.pf-faces { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.pf-faces button { position: relative; aspect-ratio: 1; padding: 2px; border: 2px solid transparent; border-radius: 14px; background: none; cursor: pointer; }
.pf-faces button[aria-pressed="true"] { border-color: var(--m-accent); background: var(--m-raised); }
.pf-faces button::after { content: ''; position: absolute; inset: -3px; }
.pf-reset { min-height: 40px; border: 0; background: none; color: var(--m-muted); font-size: 12.5px; cursor: pointer; }
.pf .ps-avatar-art { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

@media (max-width: 720px) {
    .pf-sheet { width: 100%; max-width: none; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: min(90dvh, calc(var(--m-vvh, 100dvh) - 8px)); }
    .pf-sheet[open] { animation: m-sheet-up .32s cubic-bezier(.22,1,.36,1); }
    .pf-form { max-height: min(90dvh, calc(var(--m-vvh, 100dvh) - 8px)); }
    .pf-form header::before { content: ''; position: absolute; inset-block-start: 8px; inset-inline: 0; width: 36px; height: 4px; margin: 0 auto; border-radius: 2px; background: var(--m-line); }
    .pf-form header { position: relative; padding-top: 20px; }
}
@media (prefers-reduced-motion: reduce) { .pf *, .pf-sheet { animation: none !important; transition-duration: .01ms !important; } }
html[data-motion="off"] .pf *, html[data-motion="off"] .pf-sheet { animation: none !important; transition-duration: .01ms !important; }

.pf-close:focus:not(:focus-visible), .pf-sheet :focus:not(:focus-visible) { outline: none; }
