/* <pg-photo-maker> (tool.js). Tokens mirror widgets.css so the tool sits with the guide widgets. */
pg-photo-maker{
  --pm-ink:#1d1d1f;--pm-muted:#6e6e73;--pm-panel:#f2f1ee;--pm-card:#fff;--pm-line:rgba(0,0,0,.1);--pm-fill:rgba(0,0,0,.055);
  --pm-orange:#ff8a1f;--pm-accent:#c25e00;--pm-cyan:#7fe9ff;--pm-stage:#1c1c1e;--pm-bad:#d70015;--pm-good:#248a3d;
  --pm-ease:cubic-bezier(.22,1,.36,1);
  display:block;margin:40px 0;color:var(--pm-ink);font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",InterLocal,system-ui,sans-serif;
  -webkit-tap-highlight-color:transparent
}
@media (prefers-color-scheme:dark){
  pg-photo-maker{--pm-ink:#f5f5f7;--pm-muted:#98989d;--pm-panel:#141416;--pm-card:#1f1f22;--pm-line:rgba(255,255,255,.12);--pm-fill:rgba(255,255,255,.08);
    --pm-accent:#ff9f3f;--pm-stage:#0b0b0c;--pm-bad:#ff6961;--pm-good:#30d158}
}
pg-photo-maker[data-upgraded]>:not(.pm-ui){display:none}
.pm-ui{position:relative;background:var(--pm-panel);border-radius:28px;padding:clamp(16px,3.6vw,30px);container-type:inline-size;font-size:16px;line-height:1.5}
.pm-ui :focus-visible{outline:2px solid var(--pm-orange);outline-offset:3px}
.pm-ui button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:pointer}
.pm-ui button:disabled{cursor:default;opacity:.4}
.pm-ui p{margin:0}
.pm-ui [hidden]{display:none!important}
.pm-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

.pm-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 16px;margin-bottom:22px}
.pm-eyebrow{font-size:13px;font-weight:650;letter-spacing:.01em;color:var(--pm-accent)}
.pm-private{display:inline-flex;align-items:center;gap:8px;padding:7px 14px 7px 11px;border-radius:999px;background:color-mix(in srgb,var(--pm-good) 12%,var(--pm-card));color:var(--pm-ink);font-size:14px;line-height:1.3}
.pm-private svg{width:16px;height:16px;flex:none;color:var(--pm-good)}

.pm-step+.pm-step{margin-top:30px;padding-top:28px;border-top:1px solid var(--pm-line)}
.pm-ui .pm-step-title{display:flex;align-items:flex-start;gap:10px;margin:0 0 8px;font-size:clamp(18px,2.4vw,21px);font-weight:700;letter-spacing:-.015em;line-height:1.3}
.pm-num{flex:none;display:grid;place-items:center;width:26px;height:26px;margin-top:-1px;border-radius:50%;background:var(--pm-ink);color:var(--pm-panel);font-size:14px;font-weight:700}
.pm-step-help{max-width:46em;margin-bottom:18px!important;color:var(--pm-muted);font-size:15.5px}
.pm-dot{display:inline-grid;place-items:center;width:20px;height:20px;border-radius:50%;font-size:12px;font-weight:700;vertical-align:1px;color:#1a0d00}
.pm-dot-1{background:var(--pm-orange)}.pm-dot-2{background:var(--pm-cyan);color:#00262e}

/* Slots */
.pm-slots{grid-area:slots;display:grid;grid-template-columns:1fr 1fr;gap:clamp(10px,2.4vw,20px);align-items:start}
.pm-slot{position:relative;min-width:0;border-radius:20px}
.pm-file{display:none}
.pm-drop-btn{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;width:100%;aspect-ratio:3/4;padding:16px;border-radius:20px;background:var(--pm-card);
  box-shadow:inset 0 0 0 1.5px var(--pm-line);text-align:center;transition:box-shadow .2s,background .2s,transform .25s var(--pm-ease)}
.pm-ui .pm-drop-btn:hover{box-shadow:inset 0 0 0 1.5px var(--pm-orange)}
.pm-ui .pm-drop-btn:active{transform:scale(.985)}
.pm-over .pm-drop-btn,.pm-over .pm-photo{box-shadow:inset 0 0 0 2px var(--pm-orange),0 0 0 4px rgba(255,138,31,.18);background:color-mix(in srgb,var(--pm-orange) 8%,var(--pm-card))}
.pm-plus{display:grid;place-items:center;width:44px;height:44px;border-radius:50%;background:var(--pm-orange);color:#1a0d00;margin-bottom:6px;box-shadow:0 8px 20px -8px rgba(255,138,31,.7)}
.pm-plus svg{width:22px;height:22px}
.pm-drop-title{font-size:16px;font-weight:650}
.pm-drop-sub{font-size:13.5px;color:var(--pm-muted)}
.pm-slot.pm-has .pm-drop-btn{display:none}
.pm-slot:not(.pm-has) .pm-photo,.pm-slot:not(.pm-has) .pm-slot-tools{display:none}

.pm-photo{position:relative;width:100%;border-radius:16px;background:var(--pm-stage);touch-action:pan-y;user-select:none;-webkit-user-select:none}
.pm-frame{position:absolute;inset:0;border-radius:inherit;overflow:hidden}
.pm-frame canvas{display:block;width:100%;height:100%}
.pm-line{position:absolute;height:0;border-top:2px dashed rgba(255,255,255,.85);transform-origin:0 0;pointer-events:none;filter:drop-shadow(0 0 2px rgba(0,0,0,.6))}
.pm-ui .pm-handle{position:absolute;z-index:2;width:30px;height:30px;margin:-15px 0 0 -15px;border-radius:50%;display:grid;place-items:center;font-size:13px;font-weight:750;color:#1a0d00;
  background:var(--pm-orange);box-shadow:0 0 0 2.5px #fff,0 4px 14px rgba(0,0,0,.45);touch-action:none;cursor:grab;transition:transform .2s var(--pm-ease)}
.pm-ui .pm-handle::before{content:"";position:absolute;inset:-9px;border-radius:50%}
.pm-ui .pm-handle-2{background:var(--pm-cyan);color:#00262e}
.pm-ui .pm-handle:active{cursor:grabbing;transform:scale(1.12)}
.pm-ui .pm-handle:focus-visible{outline:3px solid #fff;outline-offset:3px}
.pm-loupe{position:absolute;z-index:3;width:110px;height:110px;margin:-55px 0 0 -55px;border-radius:50%;box-shadow:0 0 0 3px #fff,0 10px 30px rgba(0,0,0,.45);pointer-events:none;opacity:0;transform:scale(.8);transition:opacity .15s,transform .2s var(--pm-ease)}
.pm-dragging .pm-loupe{opacity:1;transform:none}
.pm-slot-tools{display:flex;align-items:center;gap:14px;margin-top:8px;font-size:14px}
.pm-slot-name{font-weight:650;margin-right:auto}
.pm-ui .pm-link{color:var(--pm-accent);font-weight:600;font-size:14px;padding:6px 0;text-decoration:none}
.pm-ui .pm-link:hover:not(:disabled){text-decoration:underline}

.pm-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px;margin-top:16px}
.pm-ui .pm-secondary{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px;padding:0 18px;border-radius:999px;background:var(--pm-card);font-size:15px;font-weight:600;
  box-shadow:inset 0 0 0 1px var(--pm-line),0 1px 2px rgba(0,0,0,.05);transition:transform .25s var(--pm-ease),box-shadow .2s}
.pm-ui .pm-secondary:hover:not(:disabled){box-shadow:inset 0 0 0 1px var(--pm-orange)}
.pm-ui .pm-secondary:active:not(:disabled){transform:scale(.97)}
.pm-secondary svg,.pm-primary svg{width:18px;height:18px}
.pm-note{font-size:12.5px;color:var(--pm-muted);margin-left:auto!important}
.pm-status{min-height:1.5em;margin-top:12px!important;font-size:14px;color:var(--pm-muted);font-variant-numeric:tabular-nums}
.pm-status.pm-error{color:var(--pm-bad);font-weight:550}

/* Studio: preview + controls */
.pm-studio{display:grid;gap:22px;align-items:start}
@container (min-width:760px){.pm-studio{grid-template-columns:minmax(0,1fr) 290px;gap:28px}}
.pm-stage-wrap{position:relative;min-width:0;display:flex;justify-content:center}
.pm-stage{position:relative;width:100%;aspect-ratio:4/5;max-height:72svh;border-radius:18px;overflow:hidden;background:var(--pm-stage);touch-action:pan-y;user-select:none;-webkit-user-select:none;cursor:grab;
  box-shadow:0 0 0 1px rgba(255,255,255,.06),0 30px 60px -30px rgba(0,0,0,.5);isolation:isolate}
pg-photo-maker:not([data-has-photos]) .pm-stage{width:100%!important;height:auto!important;max-width:420px;cursor:default}
pg-photo-maker[data-mode=side] .pm-stage{border-radius:10px}
.pm-stage.pm-grabbing{cursor:grabbing}
.pm-stage canvas{position:absolute;inset:0;width:100%;height:100%;display:block}
.pm-stage:focus-visible{outline:2px solid var(--pm-orange);outline-offset:4px}
.pm-empty{position:absolute;inset:0;display:grid;place-content:center;gap:6px;padding:24px;text-align:center;color:#a1a1a6;font-size:14.5px;
  background:radial-gradient(120% 80% at 50% 0%,rgba(255,138,31,.16),transparent 60%)}
.pm-ui .pm-empty-title{color:#f5f5f7;font-size:17px;font-weight:650}
.pm-divider{position:absolute;top:0;bottom:0;left:var(--pos,50%);width:2px;margin-left:-1px;background:rgba(255,255,255,.95);box-shadow:0 0 12px rgba(0,0,0,.35);pointer-events:none}
.pm-knob{position:absolute;top:50%;left:var(--pos,50%);width:44px;height:44px;margin:-22px 0 0 -22px;border-radius:50%;display:grid;place-items:center;color:#fff;pointer-events:none;
  background:rgba(40,40,40,.45);box-shadow:0 0 0 1px rgba(255,255,255,.25) inset,0 8px 24px rgba(0,0,0,.3);-webkit-backdrop-filter:blur(16px) saturate(1.6);backdrop-filter:blur(16px) saturate(1.6)}
.pm-knob svg{width:22px;height:22px}
.pm-split-input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.pm-split-input:focus-visible~.pm-stage .pm-knob,.pm-stage-wrap:has(.pm-split-input:focus-visible) .pm-knob{box-shadow:0 0 0 2px var(--pm-orange),0 8px 24px rgba(0,0,0,.35)}
.pm-ui .pm-align{position:absolute;bottom:12px;left:50%;z-index:3;transform:translateX(-50%);display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 14px 0 11px;border-radius:999px;font-size:14px;font-weight:600;
  color:#1a0d00;background:var(--pm-orange);box-shadow:0 0 0 1px rgba(255,255,255,.35) inset,0 6px 20px -6px rgba(255,138,31,.7);transition:background .25s,color .25s,transform .2s var(--pm-ease)}
.pm-ui .pm-align[aria-pressed=false]{color:#fff;background:rgba(30,30,30,.55);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px)}
.pm-ui .pm-align:active{transform:translateX(-50%) scale(.95)}
.pm-align svg{width:15px;height:15px}

.pm-controls{min-width:0;margin:0;padding:0;border:0;display:grid;gap:22px}
.pm-controls:disabled{opacity:.5}
.pm-group{display:grid;gap:12px}
.pm-label{font-size:13px;font-weight:650;letter-spacing:.01em;color:var(--pm-muted)}
.pm-sub{font-size:14px;color:var(--pm-muted)}
.pm-hint{font-size:13px;color:var(--pm-muted);line-height:1.4}

.pm-seg{display:flex;padding:3px;border-radius:999px;background:var(--pm-fill)}
.pm-ui .pm-seg button{flex:1 1 auto;min-width:0;height:34px;padding:0 10px;border-radius:999px;font-size:14px;font-weight:550;color:var(--pm-muted);white-space:nowrap;transition:color .2s,background .25s,box-shadow .25s}
.pm-ui .pm-seg button[aria-pressed=true]{color:var(--pm-ink);background:var(--pm-card);box-shadow:0 1px 2px rgba(0,0,0,.08),0 3px 10px -2px rgba(0,0,0,.12)}
.pm-ui .pm-seg button:focus-visible{outline-offset:-2px}
@media (prefers-color-scheme:dark){.pm-ui .pm-seg button[aria-pressed=true]{background:rgba(255,255,255,.16);box-shadow:none}}

.pm-range-row{display:flex;align-items:center;gap:12px;font-size:14px}
.pm-range-row label{min-width:40px;color:var(--pm-muted)}
.pm-range-row output{min-width:44px;text-align:right;font-variant-numeric:tabular-nums;color:var(--pm-muted)}
.pm-ui input[type=range]{flex:1;min-width:0;height:28px;margin:0;accent-color:var(--pm-orange);cursor:pointer}

.pm-toggles{display:flex;flex-wrap:wrap;align-items:center;gap:10px 18px}
.pm-switch{display:inline-flex;align-items:center;gap:9px;font-size:15px;cursor:pointer}
.pm-switch input{appearance:none;-webkit-appearance:none;position:relative;width:42px;height:26px;margin:0;border-radius:999px;background:var(--pm-fill);box-shadow:inset 0 0 0 1px var(--pm-line);cursor:pointer;transition:background .25s}
.pm-switch input::after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.3);transition:transform .3s var(--pm-ease)}
.pm-switch input:checked{background:var(--pm-orange)}
.pm-switch input:checked::after{transform:translateX(16px)}
.pm-switch input:focus-visible{outline:2px solid var(--pm-orange);outline-offset:3px}
.pm-labels{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.pm-labels input{width:100%;min-width:0;height:40px;padding:0 12px;border:0;border-radius:12px;background:var(--pm-card);color:var(--pm-ink);font:inherit;font-size:16px;box-shadow:inset 0 0 0 1px var(--pm-line)}
.pm-labels input:focus{outline:2px solid var(--pm-orange);outline-offset:0}
.pm-bg-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.pm-swatches{display:flex;align-items:center;gap:8px}
.pm-ui .pm-swatches button,.pm-swatches input{width:30px;height:30px;border-radius:50%;flex:none}
.pm-ui .pm-swatches button{background:var(--c);box-shadow:inset 0 0 0 1px rgba(128,128,128,.4);transition:box-shadow .2s,transform .2s var(--pm-ease)}
.pm-ui .pm-swatches button[aria-checked=true],.pm-swatches input.on{box-shadow:inset 0 0 0 1px rgba(128,128,128,.4),0 0 0 2px var(--pm-panel),0 0 0 4px var(--pm-orange)}
.pm-swatches input{appearance:none;-webkit-appearance:none;padding:0;border:0;cursor:pointer;background:conic-gradient(#ff4f6d,#ff9f3f,#ffe07a,#7fe9ff,#c9a7ff,#ff4f6d)}
.pm-swatches input::-webkit-color-swatch-wrapper{padding:0}
.pm-swatches input::-webkit-color-swatch{border:0;border-radius:50%;opacity:0}
.pm-swatches input::-moz-color-swatch{border:0;opacity:0}

.pm-size{font-size:13.5px;color:var(--pm-muted);font-variant-numeric:tabular-nums}
.pm-actions{display:flex;gap:10px}
.pm-ui .pm-primary{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:50px;padding:0 22px;border-radius:999px;background:var(--pm-orange);color:#1a0d00;font-size:16px;font-weight:650;
  box-shadow:0 1px 0 rgba(255,255,255,.35) inset,0 8px 24px -8px rgba(255,138,31,.6);transition:transform .25s var(--pm-ease)}
.pm-ui .pm-primary:active:not(:disabled){transform:scale(.97)}
.pm-actions .pm-secondary{min-height:50px}

@container (max-width:520px){
  .pm-step-title{font-size:18px}
  .pm-ui .pm-handle{width:28px;height:28px;margin:-14px 0 0 -14px}
  .pm-drop-sub{font-size:12.5px}
  .pm-row .pm-secondary{flex:1 1 auto}
  .pm-note{margin-left:0!important;width:100%}
}
@media (prefers-reduced-motion:reduce){pg-photo-maker *{transition:none!important}}

/* No-JS fallback */
pg-photo-maker:not([data-upgraded]) figure{margin:0}
pg-photo-maker:not([data-upgraded]) .pm-fallback{padding:20px 22px;border-radius:22px;background:var(--pm-panel)}

.pm-s1{display:grid;grid-template-areas:"help" "slots" "row" "status"}
.pm-step-help{grid-area:help}.pm-s1>.pm-row{grid-area:row}.pm-s1>.pm-status{grid-area:status}
@container (min-width:760px){
  .pm-s1{grid-template-columns:minmax(0,600px) minmax(220px,1fr);grid-template-rows:auto auto 1fr;grid-template-areas:"slots help" "slots row" "slots status";column-gap:32px}
  .pm-s1>.pm-row{margin-top:0;flex-direction:column;align-items:flex-start}
  .pm-s1 .pm-note{margin-left:0!important}
}
@container (max-width:520px){
  .pm-slot-tools{flex-wrap:wrap;gap:0 12px}
  .pm-slot-name{width:100%;margin-bottom:-4px}
}
