/* Profile editor and public profile, second pass: a cover hero with the photo on it, the background picker first, numbered cards, a
   profile-strength meter, a stronger public card and a preview stage with a Desktop / Phone toggle.
   Loaded after profile-studio.css and profile-backdrops.css. Colours come from the shared tokens, so every palette and dark mode follows. */

/* ---------- the cover hero: the photo card sits on the chosen background ---------- */
#account-edit-view .pe-hero { position: relative; gap: 0; padding: 0; overflow: hidden; border-radius: 24px; }
#account-edit-view .pe-hero::before { content: "Cover preview"; position: absolute; z-index: 3; top: 14px; inset-inline-start: 16px; padding: 4px 11px; border-radius: 99px; background: rgb(255 255 255 / .78); color: #2b3138; font: 700 .62rem/1.4 system-ui, sans-serif; letter-spacing: .1em; text-transform: uppercase; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
#account-edit-view .pe-hero-cover { height: 172px; border-radius: 0; transition: background .5s ease; }
#account-edit-view .pe-hero .profile-photo-editor { position: relative; z-index: 2; display: flex; align-items: flex-end; gap: 22px; margin-top: -52px; padding: 0 26px 24px; }
#account-edit-view .pe-hero .pe-avatar .profile-avatar { width: 112px; height: 112px; font-size: 40px; border: 5px solid var(--bg-card); box-shadow: 0 14px 28px -12px rgb(0 0 0 / .4); }
#account-edit-view .pe-hero .pe-avatar-badge { width: 34px; height: 34px; inset-inline-end: 0; bottom: 2px; transition: transform .25s var(--ease-out, ease); }
#account-edit-view .pe-hero .pe-avatar:hover .pe-avatar-badge { transform: scale(1.12) rotate(-6deg); }
#account-edit-view .pe-hero #profile-photo-form { padding-top: 62px; }
#account-edit-view .pe-hero .pe-card-title { font: 600 1.15rem/1.25 var(--studio-serif, Georgia, serif); }

/* ---------- numbered cards ---------- */
#account-edit-view .profile-editor-forms, #account-edit-view .pe-form { gap: 18px; }
#account-edit-view .pe-form { counter-reset: pe-step; }
#account-edit-view .pe-card { padding: 24px 26px; border-radius: 22px; gap: 20px; }
#account-edit-view .pe-form .pe-card-title { display: flex; align-items: center; gap: 12px; font: 600 1.18rem/1.25 var(--studio-serif, Georgia, serif); letter-spacing: -.01em; }
#account-edit-view .pe-form .pe-card-title::before { counter-increment: pe-step; content: counter(pe-step); display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--accent-color) 14%, transparent); color: var(--accent-color); font: 700 .78rem/1 system-ui, sans-serif; }
#account-edit-view .pe-card-head { gap: 5px; }
#account-edit-view .pe-card-head .pe-help { padding-inline-start: 40px; }
#account-edit-view .pe-head-split { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
#account-edit-view .pe-head-split .pe-button svg { width: 16px; height: 16px; }
#account-edit-view .pe-label { font-size: .8rem; letter-spacing: .01em; }
#account-edit-view .pe-input { min-height: 50px; border-radius: 14px; padding-inline: 16px; }
#account-edit-view .pe-control > .pe-input { padding-inline-start: 44px; }
#account-edit-view .pe-textarea { min-height: 128px; padding-block: 14px; line-height: 1.6; }

/* ---------- the background picker ---------- */
#account-edit-view .pe-backdrops { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 14px; }
#account-edit-view .pe-backdrop-option { gap: 8px; }
#account-edit-view .pe-swatch { aspect-ratio: 16 / 10; border-radius: 16px; box-shadow: inset 0 0 0 1px color-mix(in srgb, #000 10%, transparent), 0 10px 18px -14px rgb(0 0 0 / .45); transition: transform .25s var(--ease-out, ease), box-shadow .25s; }
#account-edit-view .pe-backdrop-option:hover .pe-swatch { transform: translateY(-3px) scale(1.02); box-shadow: inset 0 0 0 1px color-mix(in srgb, #000 10%, transparent), 0 18px 26px -16px rgb(0 0 0 / .5); }
#account-edit-view .pe-backdrop-option input:checked + .pe-swatch { box-shadow: 0 0 0 3px var(--bg-card), 0 0 0 5px var(--accent-color), 0 16px 26px -14px rgb(0 0 0 / .5); }
#account-edit-view .pe-swatch-check { top: 8px; inset-inline-end: 8px; width: 24px; height: 24px; opacity: 0; transform: scale(.6); transition: opacity .2s, transform .25s var(--ease-out, ease); }
#account-edit-view .pe-backdrop-option input:checked + .pe-swatch .pe-swatch-check { opacity: 1; transform: none; }
#account-edit-view .pe-swatch-label { font-size: .78rem; }
#account-edit-view .pe-backdrop-option input:checked ~ .pe-swatch-label { color: var(--accent-color); }

/* ---------- the live column: strength, then the preview ---------- */
#account-edit-view .profile-live-preview { gap: 14px; }
.pe-strength { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 4px 16px; padding: 18px; border: 1px solid var(--line); border-radius: 22px; background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--accent-color) 11%, transparent), transparent 62%), var(--bg-card); }
.pe-strength-ring { position: relative; width: 76px; height: 76px; }
.pe-strength-ring svg { width: 100%; height: 100%; }
.pe-ring-track, .pe-ring-fill { fill: none; stroke-width: 5.2; }
.pe-ring-track { stroke: color-mix(in srgb, var(--muted) 20%, transparent); }
.pe-ring-fill { stroke: var(--accent-color); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 30px 30px; transition: stroke-dasharray .7s var(--ease-out, ease); }
.pe-strength-ring strong { position: absolute; inset: 0; display: grid; place-items: center; font: 600 1.28rem/1 var(--studio-serif, Georgia, serif); font-variant-numeric: tabular-nums; color: var(--ink); }
.pe-strength-ring small { font-size: .62em; margin-inline-start: 1px; color: var(--muted); }
.pe-strength-copy { display: grid; gap: 2px; min-width: 0; }
.pe-strength-copy > strong { font: 600 1.15rem/1.2 var(--studio-serif, Georgia, serif); color: var(--ink); }
.pe-strength-copy p { margin: 2px 0 0; font-size: .78rem; line-height: 1.45; color: var(--muted); }
.pe-strength-list { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 10px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); list-style: none; }
.pe-strength-list li { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .72rem; line-height: 1.3; color: var(--muted); }
.pe-strength-list li > span { display: grid; place-items: center; flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%; border: 1.5px dashed color-mix(in srgb, var(--muted) 55%, transparent); }
.pe-strength-list li.is-done { color: var(--ink); }
.pe-strength-list li.is-done > span { border: 0; background: var(--accent-color); color: var(--on-accent, #fff); }
.pe-strength-icon { width: 11px; height: 11px; stroke-width: 2.6; }
.pe-strength-list li:not(.is-done) .pe-strength-icon { width: 10px; height: 10px; color: var(--muted); }

/* ---------- the public profile card (live preview, public preview and the member dialog) ---------- */
.public-profile { border-radius: 26px; box-shadow: 0 30px 56px -40px rgb(0 0 0 / .5); }
.public-profile .public-profile-cover { height: 148px; }
.public-profile .public-profile-body { gap: 16px; padding: 0 26px 26px; }
.public-profile .profile-avatar { width: 96px; height: 96px; margin-top: -48px; font-size: 36px; border: 5px solid var(--bg-card); box-shadow: 0 16px 28px -14px rgb(0 0 0 / .45); background: linear-gradient(135deg, color-mix(in srgb, var(--profile-accent) 38%, var(--bg-card)), color-mix(in srgb, var(--profile-accent) 18%, var(--bg-card))); }
.public-profile .profile-member-heading h2 { font: 500 clamp(1.7rem, 3.4vw, 2.2rem)/1.1 var(--studio-serif, Georgia, serif); letter-spacing: -.02em; }
.public-profile .profile-bio { font-size: .95rem; line-height: 1.7; }
.profile-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.profile-pills li { display: inline-flex; align-items: center; gap: 7px; min-width: 0; padding: 7px 13px; border: 1px solid color-mix(in srgb, var(--profile-accent) 28%, var(--line)); border-radius: 99px; background: color-mix(in srgb, var(--profile-accent) 8%, transparent); font-size: .78rem; color: var(--ink); }
.profile-pills .pe-icon { width: 15px; height: 15px; flex: 0 0 15px; color: var(--profile-accent); }
.profile-pills a { display: inline-flex; align-items: center; gap: 7px; color: inherit; text-decoration: none; }
.profile-pills a:hover span { text-decoration: underline; text-underline-offset: 3px; }
.profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; margin: 0; }
.profile-stats > div { display: grid; gap: 3px; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--profile-accent) 9%, var(--bg-surface, transparent)); border: 1px solid color-mix(in srgb, var(--profile-accent) 16%, var(--line)); }
.profile-stats dt { font: 700 .6rem/1.3 system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.profile-stats dd { margin: 0; font: 500 1.05rem/1.25 var(--studio-serif, Georgia, serif); color: var(--ink); overflow-wrap: anywhere; }
.public-profile section { padding-top: 18px; }
.public-profile h3 { display: flex; align-items: center; gap: 9px; }
.public-profile h3::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--profile-accent); }
.public-profile .profile-signature-card { gap: 16px; padding: 14px; border-radius: 20px; background: linear-gradient(135deg, color-mix(in srgb, var(--profile-accent) 13%, transparent), transparent 70%), var(--bg-card); border-color: color-mix(in srgb, var(--profile-accent) 26%, var(--line)); }
.public-profile .profile-signature .catalog-art.product-photo { width: 76px; height: 92px; border-radius: 14px; }
.public-profile .profile-signature .text-button { font-size: 1.3rem; }
.profile-signature-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.profile-signature-tags em { padding: 3px 10px; border-radius: 99px; background: color-mix(in srgb, var(--profile-accent) 14%, transparent); font: 600 .66rem/1.3 system-ui, sans-serif; font-style: normal; color: var(--ink); }

/* ---------- the public preview tab ---------- */
.pp-preview-bar { align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.pp-preview-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.pp-device { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 99px; background: var(--bg-surface, var(--soft)); }
.pp-device button { min-height: 34px; padding: 0 16px; border: 0; border-radius: 99px; background: transparent; color: var(--muted); font: 700 .74rem/1 system-ui, sans-serif; cursor: pointer; transition: background .2s, color .2s; }
.pp-device button[aria-pressed=true] { background: var(--ink); color: var(--bg-card); }
.pp-device button:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; }
#account-preview-view .profile-preview-stage { padding: clamp(36px, 7vw, 80px) clamp(14px, 4vw, 48px); border-radius: 28px; min-height: 520px; align-content: start; }
.pp-frame { container-type: inline-size; width: min(780px, 100%); transition: width .55s var(--ease-out, ease), padding .4s, border-radius .4s, box-shadow .4s; }
#account-preview-view .profile-preview-stage[data-device=phone] .pp-frame { width: 392px; max-width: 100%; padding: 12px; border-radius: 46px; background: #15171c; box-shadow: 0 40px 70px -34px rgb(0 0 0 / .65), inset 0 0 0 2px rgb(255 255 255 / .12); }
#account-preview-view .profile-preview-stage[data-device=phone] .pp-frame #profile-public-card { overflow: hidden; border-radius: 34px; }
#account-preview-view .profile-preview-stage[data-device=phone] .public-profile-cover { display: block; height: 120px; }
#account-preview-view .profile-preview-stage[data-device=phone] .public-profile .public-profile-body { margin-top: 0; padding: 0 20px 22px; border: 0; border-radius: 0; background: var(--bg-card); box-shadow: none; }
#account-preview-view .public-profile { filter: drop-shadow(0 30px 40px rgb(0 0 0 / .2)); }
#account-preview-view .public-profile .public-profile-body { border-radius: 26px; }
/* a wide card puts the signature scent and the notes side by side */
@container (min-width: 620px) {
  #account-preview-view .public-profile .public-profile-body { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 18px 26px; }
  #account-preview-view .public-profile .public-profile-body > :not(.profile-signature):not(.profile-favorites) { grid-column: 1 / -1; }
  #account-preview-view .public-profile .profile-signature, #account-preview-view .public-profile .profile-favorites { align-content: start; }
}
.pp-visibility { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.pp-visibility section { display: grid; gap: 12px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--bg-card); }
.pp-visibility h3 { display: flex; align-items: center; gap: 9px; margin: 0; font: 700 .68rem/1.3 system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pp-visibility h3 svg { width: 16px; height: 16px; color: var(--positive, #2f8f5b); }
.pp-visibility .is-private h3 svg { color: var(--muted); }
.pp-visibility ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pp-visibility li { display: flex; align-items: center; gap: 10px; font-size: .84rem; color: var(--ink); }
.pp-visibility li::before { content: "✓"; display: grid; place-items: center; flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%; background: color-mix(in srgb, var(--positive, #2f8f5b) 16%, transparent); color: var(--positive, #2f8f5b); font-size: .7rem; font-weight: 800; }
.pp-visibility .is-private li::before { content: "🔒"; background: color-mix(in srgb, var(--muted) 14%, transparent); font-size: .62rem; }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  body[data-motion=on] #account-edit-view .pe-card { animation: pe-rise .55s var(--ease-out, ease) backwards; }
  body[data-motion=on] #account-edit-view .pe-form .pe-card:nth-of-type(2) { animation-delay: .06s; }
  body[data-motion=on] #account-edit-view .pe-form .pe-card:nth-of-type(3) { animation-delay: .12s; }
  body[data-motion=on] #account-edit-view .pe-form .pe-card:nth-of-type(4) { animation-delay: .18s; }
  body[data-motion=on] .pe-strength-list li.is-done > span { animation: pe-pop .4s var(--ease-out, ease); }
  body[data-motion=on] .public-profile-cover.pp-backdrop::before { animation: pp-drift 24s ease-in-out infinite alternate; }
}
@keyframes pe-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes pe-pop { 40% { transform: scale(1.3); } }

@media (max-width: 900px) {
  #account-edit-view .pe-backdrops { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  #account-edit-view .pe-hero .profile-photo-editor { flex-direction: column; align-items: flex-start; gap: 6px; padding-bottom: 20px; }
  #account-edit-view .pe-hero #profile-photo-form { padding-top: 0; }
  #account-edit-view .pe-backdrops { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #account-edit-view .pe-card { padding: 20px 18px; }
  .pp-visibility { grid-template-columns: 1fr; }
  .pe-strength-list { grid-template-columns: 1fr; }
}

/* the hero card has no inner padding, so the cover runs edge to edge (this must come after the generic card padding above) */
#account-edit-view .pe-card.pe-hero { padding: 0; gap: 0; }
.pe-strength-ring strong { display: flex; align-items: center; justify-content: center; gap: 1px; }
#account-preview-view #profile-public-card { width: 100%; }

/* ---------- the camera window ---------- */
.pc-dialog { width: min(460px, calc(100vw - 24px)); padding: 0; border: 1px solid var(--line); border-radius: 28px; background: var(--bg-card); color: var(--ink); box-shadow: 0 40px 90px -30px rgb(0 0 0 / .6); overflow: hidden; }
.pc-dialog::backdrop { background: rgb(8 10 16 / .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.pc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 14px; }
.pc-head .eyebrow { margin: 0; font-size: .62rem; letter-spacing: .15em; }
.pc-head h2 { margin: 4px 0 0; font: 600 1.4rem/1.15 var(--studio-serif, Georgia, serif); }
.pc-close { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--bg-surface, var(--soft)); color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.pc-close:hover { background: var(--ink); color: var(--bg-card); }
.pc-stage { position: relative; aspect-ratio: 1; margin: 0 22px; border-radius: 22px; overflow: hidden; background: #0d0f14; }
.pc-video, .pc-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pc-video.is-mirrored { transform: scaleX(-1); }
.pc-video[hidden], .pc-still[hidden] { display: none; }
/* the round guide: everything outside the circle is dimmed, which is the part of the picture that is cropped away on a round avatar */
.pc-guide { position: absolute; inset: 7%; border-radius: 50%; box-shadow: 0 0 0 999px rgb(8 10 16 / .5), inset 0 0 0 2px rgb(255 255 255 / .75); pointer-events: none; transition: opacity .3s; }
.pc-stage[data-state=error] .pc-guide, .pc-stage[data-state=starting] .pc-guide { opacity: 0; }
.pc-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.pc-flash.is-on { animation: pc-flash .5s ease-out; }
@keyframes pc-flash { from { opacity: .85; } to { opacity: 0; } }
.pc-count { position: absolute; inset: 0; display: grid; place-items: center; font: 600 7rem/1 var(--studio-serif, Georgia, serif); color: #fff; text-shadow: 0 6px 30px rgb(0 0 0 / .55); pointer-events: none; }
.pc-count:not(:empty) { animation: pc-count 1s ease-out infinite; }
@keyframes pc-count { from { transform: scale(1.5); opacity: 0; } 30% { opacity: 1; } to { transform: scale(.9); opacity: .6; } }
.pc-message { position: absolute; inset-inline: 18px; bottom: 16px; margin: 0; padding: 10px 14px; border-radius: 14px; background: rgb(8 10 16 / .72); color: #fff; font-size: .82rem; line-height: 1.5; text-align: center; }
.pc-message[hidden] { display: none; }
.pc-stage[data-state=error] .pc-message { position: absolute; inset: 22px; display: grid; place-items: center; background: transparent; font-size: .92rem; padding: 0; }
.pc-actions { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 18px 22px 8px; }
.pc-actions[hidden] { display: none; }
.pc-shutter { position: relative; display: grid; place-items: center; width: 74px; height: 74px; padding: 0; border: 4px solid color-mix(in srgb, var(--ink) 88%, transparent); border-radius: 50%; background: transparent; cursor: pointer; transition: transform .2s var(--ease-out, ease); }
.pc-shutter i { width: 54px; height: 54px; border-radius: 50%; background: var(--ink); transition: transform .2s var(--ease-out, ease), background .2s; }
.pc-shutter:hover i { transform: scale(.92); }
.pc-shutter:active i { transform: scale(.82); }
.pc-shutter:focus-visible, .pc-side:focus-visible, .pc-close:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 3px; }
.pc-side { display: grid; justify-items: center; gap: 4px; min-width: 64px; padding: 6px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font: 700 .68rem/1 system-ui, sans-serif; cursor: pointer; }
.pc-side[hidden] { display: none; }
.pc-side svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pc-side[aria-pressed=true] { color: var(--accent-color); }
.pc-actions[data-for=review] .pe-button, .pc-actions[data-for=review] .primary { min-height: 46px; padding-inline: 22px; }
.pc-note { margin: 0; padding: 6px 26px 20px; text-align: center; font-size: .72rem; line-height: 1.5; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .pc-flash.is-on, .pc-count:not(:empty) { animation: none !important; } }
