/* profile editor top half (17 Nov 2026): the Instagram-style photo, the crop sheet, the labelled preview, right now.
   features/profile-photo.js */

/* 1. the photo: one big circle, a text button under it, no card around it */
#edsheet .ed-photo.pp{flex-direction:column!important;align-items:center;gap:10px!important;margin:4px 0 6px;padding:6px 0 4px!important;background:none!important;border:0!important;text-align:center}
#edsheet .ed-photo.pp .acts{display:none!important}
#edsheet .ed-photo.pp #ed-seal{cursor:pointer;border-radius:50%;-webkit-tap-highlight-color:transparent}
#edsheet .ed-photo.pp #ed-seal:focus-visible{outline:2px solid var(--blu);outline-offset:4px}
#edsheet .ed-photo.pp #ed-seal .seal{width:96px!important;height:96px!important;font-size:30px!important;box-shadow:0 0 0 1px rgba(250,248,243,.14)}
#edsheet .ed-photo.pp #ed-seal .seal img{width:100%;height:100%;object-fit:cover}
#edsheet .ed-photo.pp #ed-seal:active .seal{transform:scale(.97)}
.pp-edit{min-height:44px;padding:0 14px;border:0;background:none;color:var(--blu);font:600 15px/1.2 var(--ui);letter-spacing:-.01em;white-space:nowrap;cursor:pointer;-webkit-tap-highlight-color:transparent}
.pp-edit:active{opacity:.55}

/* the action sheet: two grouped panels, iOS order (actions, then Cancel on its own) */
#pp-acts{position:fixed;inset:0;z-index:2147482500;pointer-events:none}
#pp-acts .pp-scrim{position:absolute;inset:0;background:rgba(0,0,0,.5);opacity:0;transition:opacity .22s ease}
#pp-acts .pp-panel{position:absolute;left:10px;right:10px;bottom:calc(10px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;gap:8px;transform:translateY(110%);transition:transform .32s cubic-bezier(.2,.8,.2,1)}
#pp-acts.on{pointer-events:auto}
#pp-acts.on .pp-scrim{opacity:1}
#pp-acts.on .pp-panel{transform:none}
#pp-acts .pp-grp{display:flex;flex-direction:column;overflow:hidden;border-radius:14px;background:color-mix(in srgb,#FAF8F3 7%,#1E1E1E)}
#pp-acts .pp-grp button{display:flex;align-items:center;justify-content:center;width:100%;text-align:center;min-height:56px;border:0;border-top:1px solid rgba(250,248,243,.08);background:none;color:var(--blu);font:400 18px/1.2 var(--ui);letter-spacing:-.01em;white-space:nowrap}
#pp-acts .pp-grp button:first-child{border-top:0}
#pp-acts .pp-grp button:active{background:rgba(250,248,243,.06)}
#pp-acts .pp-danger{color:#FAF8F3!important}   /* the brandbook has no red: destructive reads by its word and its place, not a colour */
#pp-acts .pp-cancel{font-weight:600!important}

/* 2. move and scale: black, the photo under a circle window, Cancel / Done in the bar */
#pp-crop{position:fixed;inset:0;z-index:2147482600;display:flex;flex-direction:column;background:#000;color:#FAF8F3;opacity:0;transition:opacity .22s ease;touch-action:none}
#pp-crop.on{opacity:1}
#pp-crop .pc-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:calc(10px + env(safe-area-inset-top,0px)) 8px 10px}
#pp-crop .pc-bar button{min-height:44px;min-width:72px;padding:0 12px;border:0;background:none;color:#FAF8F3;font:400 17px/1 var(--ui)}
#pp-crop .pc-bar .pc-ok{color:var(--blu);font-weight:600}
#pp-crop .pc-t{font:600 16px/1 var(--ui);letter-spacing:-.01em}
#pp-crop .pc-stage{position:relative;width:min(100vw,440px);aspect-ratio:1;margin:auto auto 0;flex:none;overflow:hidden;cursor:grab;touch-action:none}
#pp-crop .pc-stage:active{cursor:grabbing}
#pp-crop .pc-stage img{position:absolute;left:50%;top:50%;max-width:none;user-select:none;-webkit-user-select:none;pointer-events:none}
#pp-crop .pc-ring{position:absolute;inset:0;border-radius:50%;box-shadow:0 0 0 100vmax rgba(0,0,0,.62);outline:1px solid rgba(250,248,243,.7);outline-offset:-1px;pointer-events:none}
#pp-crop .pc-zoom{display:flex;align-items:center;gap:14px;width:min(100% - 48px,360px);margin:28px auto 0;color:rgba(250,248,243,.6);font:400 20px/1 var(--ui)}
#pp-crop .pc-zoom input{flex:1;accent-color:var(--blu)}
#pp-crop .pc-hint{margin:14px auto auto;padding-bottom:calc(28px + env(safe-area-inset-bottom,0px));font:400 13px/1.4 var(--ui);color:rgba(250,248,243,.6);text-align:center}

/* 3. the preview is labelled and takes no taps */
#edsheet .pp-pvh{margin:2px 20px 8px}
#ed-pv{pointer-events:none}

/* 4. Instagram: the @ sits fixed in front of the handle */
#edsheet .ed-at{position:relative}
#edsheet .ed-at>span{position:absolute;z-index:1;left:40px;top:50%;transform:translateY(-52%);font:400 16px/1 var(--ui);color:rgba(250,248,243,.6);pointer-events:none}   /* after the Instagram glyph the field already draws at 14px */
#edsheet .ed-at>.nfield{padding-left:56px!important;width:100%}

@media (prefers-reduced-motion: reduce){#pp-acts .pp-panel,#pp-acts .pp-scrim,#pp-crop{transition:none}}
