/* Glow Studio design system: Golden Hour (deep ink surfaces, pearl text, one warm gold light for the main action, Pro and AI). Shared by Camera, Editor, onboarding and sheets. */

/* Tokens. Dark is the default; light follows the system unless the user picks one in Settings.
   --line is for decorative dividers only; --control (3:1 or better on every surface) outlines
   anything you can press, drag or type into. */
:root, .dark {
  color-scheme: dark;
  --bg: #0d0d10; --surface: #18181c; --surface-2: #232328; --line: #2e2e34; --control: #86868e;
  --text: #f7f3ea; --muted: #a9a59c; --accent: #f7f3ea; --on-accent: #15140f;
  --tint: rgb(255 255 255 / 0.07); --free: #9fd8b0; --danger: #ffa3a3; --scrim: rgb(14 14 16 / 0.72);
  --checker-a: #26262a; --checker-b: #18181c; --viewer: #0d0d10; --blush: rgb(255 255 255 / 0.10);
  --rose: #f3c062; --glass: rgb(24 24 28 / 0.62); --toast-bg: #f7f3ea; --toast-fg: #15140f;
  --cta: linear-gradient(135deg, #ffe3a3, #f3b54a); --cta-fg: #1a1206; --cta-glow: 0 0 0 1px rgb(255 217 138 / 0.35), 0 8px 26px -6px rgb(243 181 74 / 0.55);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #faf7f0; --surface: #ffffff; --surface-2: #f0ebe0; --line: #e7e1d4; --control: #85817b;
    --text: #15140f; --muted: #625d52; --accent: #15140f; --on-accent: #ffffff;
    --tint: rgb(23 23 26 / 0.06); --free: #2c6e48; --danger: #b3261e; --scrim: rgb(23 23 26 / 0.45);
    --checker-a: #efe9de; --checker-b: #ffffff; --viewer: #faf7f0; --blush: #f3ece0;
    --rose: #8a5a10; --glass: rgb(255 255 255 / 0.74); --toast-bg: #15140f; --toast-fg: #faf7f0;
    --cta: #15140f; --cta-fg: #ffe3a3; --cta-glow: 0 8px 22px -8px rgb(217 150 46 / 0.55);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #faf7f0; --surface: #ffffff; --surface-2: #f0ebe0; --line: #e7e1d4; --control: #85817b;
  --text: #15140f; --muted: #625d52; --accent: #15140f; --on-accent: #ffffff;
  --tint: rgb(23 23 26 / 0.06); --free: #2c6e48; --danger: #b3261e; --scrim: rgb(23 23 26 / 0.45);
  --checker-a: #efe9de; --checker-b: #ffffff; --viewer: #faf7f0; --blush: #f3ece0;
  --rose: #8a5a10; --glass: rgb(255 255 255 / 0.74); --toast-bg: #15140f; --toast-fg: #faf7f0;
  --cta: #15140f; --cta-fg: #ffe3a3; --cta-glow: 0 8px 22px -8px rgb(217 150 46 / 0.55);
}
/* Safe areas (notch, status bar, gesture bar). The phone app's Capacitor also passes them as
   --safe-area-inset-*, which older Android WebViews need because their env() reports 0 there. */
:root { --sa-top: max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px)); --sa-bottom: max(env(safe-area-inset-bottom, 0px), var(--safe-area-inset-bottom, 0px));
  --sa-left: max(env(safe-area-inset-left, 0px), var(--safe-area-inset-left, 0px)); --sa-right: max(env(safe-area-inset-right, 0px), var(--safe-area-inset-right, 0px)); }
:root {
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --gutter: 16px;
  --r-btn: 26px; --r-well: 14px; --r-card: 20px; --r-sheet: 28px;
  --t-select: 140ms; --t-press-down: 80ms; --t-press-up: 120ms; --t-sheet: 260ms; --t-result: 180ms;
  --font: Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: Fraunces, "Iowan Old Style", Georgia, serif;
  --champagne: linear-gradient(120deg, #ffe3a3, #f3b54a);
  --nav-h: 64px;
}
@media (min-width: 600px) { :root { --gutter: 24px; } }

/* Type scale (rem, so enlarged text settings carry through). */
.t-h { font-size: 1.75rem; line-height: 2.125rem; font-weight: 700; margin: 0; }
.t-section { font-size: 1.25rem; line-height: 1.625rem; font-weight: 700; margin: 0; }
.t-body { font-size: 1rem; line-height: 1.5rem; }
.t-meta { font-size: 0.75rem; line-height: 1rem; color: var(--muted); }
.t-display { font: 600 2.25rem/2.5rem var(--font-display); margin: 0; letter-spacing: 0.2px; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 1rem/1.5rem var(--font); }
body { overflow: hidden; overscroll-behavior: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { width: 24px; height: 24px; display: block; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a { color: var(--accent); }

/* App shell: one screen at a time, bottom navigation underneath. */
#app { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg);
  padding: var(--sa-top) var(--sa-right) 0 var(--sa-left); }
.screen { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; width: 100%; max-width: 560px; margin: 0 auto; }
.screen.wide { max-width: none; }

/* Top bar */
.topbar { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 56px; padding: 0 calc(var(--gutter) - 6px); }
.topbar > :last-child { justify-self: end; }
.wordmark { margin: 0; font: 600 1.625rem/1 var(--font-display); letter-spacing: 0.4px; text-align: center; }
.spacer { width: 44px; height: 44px; }
.topbar.compact { height: 48px; grid-template-columns: auto 1fr auto; }
.topbar.compact .wordmark { font-size: 1.5rem; color: var(--accent); }
/* "Glow Studio" stays on one line: in the editor's busy top bar it shrinks on narrow phones. */
.topbar.compact .wordmark { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(1.0625rem, 5.6vw, 1.5rem); }
.topbar.compact .pill { min-height: 44px; padding: 0 var(--s4); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); width: 100%; min-height: 52px;
  padding: 0 var(--s4); border: 0; border-radius: var(--r-btn); background: var(--accent); color: var(--on-accent);
  font-size: 1rem; font-weight: 700; line-height: 1.25rem; text-align: center;
  transition: transform var(--t-press-up) ease-out, opacity var(--t-select); }
.btn:active { transform: scale(0.98); transition-duration: var(--t-press-down); }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--control); }
.btn.quiet { background: var(--surface-2); color: var(--text); }
/* Golden Hour: the gold light is kept for the actions that make a photo glow (choose a photo, Enhance) and for Pro. */
.btn.glow { background: var(--cta); color: var(--cta-fg); box-shadow: var(--cta-glow); }
.btn.glow:disabled { opacity: 1; background: var(--surface-2); color: var(--muted); box-shadow: none; }
.btn.small { min-height: 44px; width: auto; font-size: 0.9375rem; }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn svg { width: 20px; height: 20px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--r-well);
  background: transparent; color: var(--text); transition: transform var(--t-press-up), background var(--t-select); }
.icon-btn:active { transform: scale(0.98); transition-duration: var(--t-press-down); }
.icon-btn:disabled { opacity: 0.5; cursor: default; }
.icon-btn[aria-pressed="true"] { color: var(--accent); }
.pill { min-height: 44px; padding: 0 var(--s5); border: 0; border-radius: 22px; background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 0.9375rem; transition: transform var(--t-press-up); }
.pill:active { transform: scale(0.98); transition-duration: var(--t-press-down); }
.pill:disabled { opacity: 0.5; }
.link-btn { min-height: 44px; padding: 0 var(--s3); border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 0.9375rem; }
.row { display: flex; gap: var(--s3); }
.row > * { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px var(--s3); border-radius: 999px; font-size: 0.8125rem; line-height: 1.125rem;
  font-weight: 600; white-space: nowrap; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.chip.free { color: var(--free); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--free) 55%, transparent); }

/* Bottom navigation (Camera / Editor landing only) */
.nav { flex: none; display: flex; justify-content: center; gap: var(--s2); height: calc(var(--nav-h) + var(--sa-bottom));
  padding: var(--s1) var(--gutter) var(--sa-bottom); background: var(--bg); border-top: 1px solid var(--line); }
.nav button { flex: 0 1 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none;
  color: var(--muted); font-size: 0.75rem; line-height: 1rem; font-weight: 600; border-radius: var(--r-well); transition: color var(--t-select); }
.nav button[aria-current="page"] { color: var(--text); }
.nav button[aria-current="page"] svg { color: var(--accent); }
.nav button[aria-current="page"] span { text-decoration: underline 2px var(--accent); text-underline-offset: 4px; }
.dark.nav, .nav.dark { border-top-color: #ffffff1a; background: #000; }

/* Toast and live messages */
.toast { position: fixed; left: 50%; top: calc(var(--sa-top) + 64px); transform: translateX(-50%); z-index: 80;
  width: max-content; max-width: min(92vw, 480px); padding: 10px var(--s4); border-radius: var(--r-btn); background: var(--surface-2); color: var(--text);
  box-shadow: 0 0 0 1px var(--line); font-size: 0.9375rem; line-height: 1.375rem; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity var(--t-result); }
.toast.on { opacity: 1; pointer-events: auto; }
/* As a popover (see say()): drop the browser's popover box so it keeps the toast's own place and look. */
.toast[popover] { inset: auto; left: 50%; top: calc(var(--sa-top) + 64px); margin: 0; border: 0; overflow: visible; }
.toast.err { box-shadow: 0 0 0 1px var(--danger); }
.toast-act { min-height: 44px; margin: -10px -8px -10px 4px; padding: 0 var(--s3); border: 0; background: none; color: var(--accent); font-weight: 700; }

/* ---------- Camera ---------- */
#cameraScreen { max-width: none; background: #000; color: var(--text); }
.cam-top { position: relative; z-index: 2; }
.viewfinder { position: relative; flex: 1 1 auto; min-height: 0; display: grid; place-items: center; overflow: hidden; touch-action: none; }
.viewfinder canvas, .viewfinder img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.vf-state { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--s5); text-align: center; background: #000; }
.vf-card { max-width: 340px; display: grid; gap: var(--s3); justify-items: center; }
.vf-card p { margin: 0; color: var(--muted); }
.vf-card .btn { margin-top: var(--s2); }
.art { width: 72px; height: 72px; border-radius: 24px; display: grid; place-items: center; background: var(--tint); color: var(--accent); }
.art svg { width: 32px; height: 32px; }
.vf-note { position: absolute; left: var(--s4); right: var(--s4); bottom: var(--s3); margin: 0; padding: var(--s2) var(--s3); border-radius: var(--r-btn);
  background: var(--scrim); color: #fff; font-size: 0.8125rem; line-height: 1.125rem; text-align: center; }
.cam-controls { flex: none; padding: var(--s2) 0 var(--s3); background: #000; width: 100%; max-width: 560px; margin: 0 auto; }
.looks { display: flex; gap: var(--s2); overflow-x: auto; padding: 0 var(--gutter) var(--s3); scrollbar-width: none; justify-content: safe center; }
.looks::-webkit-scrollbar { display: none; }
.look { flex: none; min-height: 44px; padding: 0 var(--s4); border: 0; border-radius: 22px; background: #ffffff14; color: #fff;
  font-size: 0.875rem; font-weight: 600; transition: background var(--t-select), color var(--t-select); }
.look[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.look.adjust { display: inline-flex; align-items: center; gap: 6px; background: transparent; box-shadow: inset 0 0 0 1px #ffffff99; }
.look.adjust[aria-expanded="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.look.adjust svg { width: 18px; height: 18px; }
.look.add { background: transparent; box-shadow: inset 0 0 0 1px #ffffff99; }
.adjust-panel { margin: 0 var(--gutter) var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-card); background: #ffffff10; display: grid; gap: var(--s1); }
.slider { display: grid; grid-template-columns: 6.5rem 1fr 2.25rem; align-items: center; gap: var(--s2); min-height: 44px; font-size: 0.9375rem; }
.slider output { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.8125rem; }
/* Sliders: a 3:1 track and a thumb that keeps its shape in both themes. */
input[type="range"] { width: 100%; height: 44px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--control); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--control); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -10px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
#cameraScreen input[type="range"]::-webkit-slider-runnable-track { background: #ffffff80; }
#cameraScreen input[type="range"]::-moz-range-track { background: #ffffff80; }
.capture-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 var(--s5); }
.capture-row > :first-child { justify-self: start; }
.capture-row > :last-child { justify-self: end; }
.round-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center; background: #ffffff1f; color: #fff; padding: 0; overflow: hidden;
  transition: transform var(--t-press-up); }
.round-btn:active { transform: scale(0.98); transition-duration: var(--t-press-down); }
.round-btn img { width: 100%; height: 100%; object-fit: cover; }
.round-btn:disabled { opacity: 0.35; }
/* Shutter: 72px white centre, thin blush ring, 88px touch target. */
.shutter { width: 88px; height: 88px; border: 0; border-radius: 50%; background: none; padding: 0; display: grid; place-items: center; }
.shutter::before { content: ""; width: 72px; height: 72px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 3px #000, 0 0 0 5px var(--accent); transition: transform var(--t-press-up); }
.shutter:active::before { transform: scale(0.94); transition-duration: var(--t-press-down); }
.shutter:disabled::before { opacity: 0.4; }
.review-row { display: grid; grid-template-columns: auto 1fr 1fr; gap: var(--s2); padding: 0 var(--gutter); }
.review-row .btn { min-height: 52px; padding: 0 var(--s3); white-space: nowrap; }
.cam-flash { position: fixed; inset: 0; background: #fff; z-index: 90; pointer-events: none; animation: camflash 0.35s ease-out forwards; }
@keyframes camflash { to { opacity: 0; } }

/* ---------- Editor landing ---------- */
.home { flex: 1 1 auto; overflow-y: auto; padding: var(--s2) var(--gutter) var(--s5); display: flex; flex-direction: column; gap: var(--s4); }
.card { background: var(--surface); border-radius: var(--r-card); padding: var(--s4); }
.resume { display: grid; grid-template-columns: 64px 1fr; gap: var(--s3); align-items: center; }
.resume img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-well); background: var(--surface-2); }
.resume h2 { font-size: 1rem; line-height: 1.5rem; margin: 0; }
.resume p { margin: 0; }
.resume .row { grid-column: 1 / -1; }

/* ---------- Active editor ---------- */
/* Layout: the photo takes whatever height is left. Everything under it (view bar, demo bar,
   tabs, the chip/search slot and the tool row) has a fixed height, so switching categories
   never resizes the photo. */
/* The photo's surround: warm ivory in light mode, a quiet neutral in dark mode. On screen only. */
#editorScreen { max-width: 560px; --canvas: var(--viewer); --tile-h: calc(8px + 46px + 4px + 1rem); --tools-h: calc(var(--s1) * 2 + var(--tile-h)); }
.canvas-col { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.stage { position: relative; flex: 1 1 auto; min-height: 160px; margin: 0 var(--gutter); border-radius: 16px; overflow: hidden;
  background: var(--canvas); touch-action: none; user-select: none; -webkit-user-select: none; }
/* The frame is sized to the photo itself (contain), so both images, the divider and the
   labels line up with the picture, not with the empty canvas around it. */
/* Inspection zoom: #view holds both pictures and is moved and scaled as one (transform only),
   so Original and Edited stay pixel-aligned at any zoom. It never changes the picture itself. */
.frame { position: absolute; inset: 0; overflow: hidden; }
.face-pick { position: absolute; inset: 0; pointer-events: none; }
.face-ring { position: absolute; min-width: 44px; min-height: 44px; padding: 0; border: 2px dashed rgb(255 255 255 / 0.9); border-radius: 50%; background: none;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.35), inset 0 0 0 1px rgb(0 0 0 / 0.35); pointer-events: auto; cursor: pointer; }
.face-ring.on { border: 3px solid #fff; box-shadow: 0 0 0 2px var(--accent), 0 0 0 9999px rgb(0 0 0 / 0.18); }
.face-ring:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.face-tag { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); padding: 2px 8px; border-radius: 10px; background: var(--accent); color: var(--on-accent);
  font-size: 0.75rem; line-height: 1rem; font-weight: 700; white-space: nowrap; }
.stage:not([data-view="edited"]) .face-pick { display: none; }
.frame.pannable { cursor: grab; } .frame.pannable:active { cursor: grabbing; }
.view { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.view img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
.view img.alpha { background: repeating-conic-gradient(var(--checker-a) 0 25%, var(--checker-b) 0 50%) 0 0 / 16px 16px; }
#after { transition: opacity var(--t-result) ease-out; }
#after.fade { opacity: 0; }
.stage[data-view="original"] #after { opacity: 0; }
.stage[data-view="edited"] #after { clip-path: none !important; }
.stage[data-view="edited"].has-after #before { opacity: 0; }
/* --vx/--vy/--vw/--vh: the part of the photo that is visible right now (set by applyView). */
.divider { position: absolute; top: var(--vy, 0px); height: var(--vh, 100%); left: 50%; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 4px #0008; pointer-events: none; }
/* 26px visible knob inside a 44px target, three-quarters of the way down, clear of faces. */
.handle { position: absolute; top: 75%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 0; padding: 0; border-radius: 50%;
  background: none; display: grid; place-items: center; pointer-events: auto; cursor: ew-resize; touch-action: none; }
.handle i { width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px #0007; display: grid; place-items: center; color: #15140f; }
.handle i svg { width: 16px; height: 16px; }
.handle:focus-visible { outline: none; }
.handle:focus-visible i { box-shadow: 0 0 0 2px #15140f, 0 0 0 4px #f3c062; }
.stage:not([data-view="split"]) .divider, .stage:not(.has-after) .divider { display: none; }
.tag { position: absolute; top: var(--s2); padding: 2px var(--s2); border-radius: 8px; background: rgb(18 18 20 / 0.72); color: #fff;
  font-size: 0.75rem; line-height: 1.125rem; font-weight: 600; pointer-events: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame .tag { top: calc(var(--vy, 0px) + var(--s2)); }
.tag.left { left: calc(var(--vx, 0px) + var(--s2)); } .tag.right { right: max(calc(100% - var(--vx, 0px) - var(--vw, 100%) + var(--s2)), 56px); }
/* Expand / close full view: always there, small, top-right of the viewer. */
.viewer-toggle { position: absolute; top: var(--s1); right: var(--s1); border-radius: 50%; color: #fff; }
.viewer-toggle { color: #2a2a2e; }
.viewer-toggle::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: rgb(250 249 246 / 0.85); }
.viewer-toggle svg { position: relative; width: 18px; height: 18px; }
.stage.cropping .viewer-toggle, .stage:not(.has-photo) .viewer-toggle { display: none; }
/* The sample's disclosure: a small "AI sample" badge on the photo's top-left corner. */
.sample-badge { position: absolute; top: var(--s2); left: var(--s2); z-index: 3; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 var(--s3);
  border: 0; border-radius: 16px; background: rgb(250 249 246 / 0.92); color: var(--accent, #15140f); font-size: 0.8125rem; font-weight: 600; }
.sample-badge::after { content: ""; position: absolute; inset: -6px; }   /* 44px touch target */
.sample-badge svg { width: 14px; height: 14px; }
.sample-badge[hidden], .stage.cropping .sample-badge { display: none; }
/* While comparing, the Original / Edited labels take the top corners, so the badge moves below them. */
.stage.has-after:not([data-view="edited"]) .sample-badge { top: calc(var(--s2) + 40px); }
/* Full view: everything but the photo and Original / Compare / Edited steps aside. */
#editorScreen.viewer-expanded .topbar, #editorScreen.viewer-expanded .side, #editorScreen.viewer-expanded .viewbar > :not(#compareBtn) { display: none; }
#editorScreen.viewer-expanded .stage { margin: 0; border-radius: 0; }
#editorScreen.viewer-expanded .viewbar { justify-content: center; padding-bottom: calc(var(--s2) + var(--sa-bottom)); }
#editorScreen.viewer-expanded .canvas-col { grid-column: 1 / -1; grid-row: 1 / -1; padding: 0; }
#editorScreen.viewer-expanded .viewer-toggle { top: var(--s2); right: var(--s2); }
.frame.narrow .tag.bottom { display: none; }
.frame.narrow .tag { font-size: 0.6875rem; max-width: 48%; }
.frame .tag.bottom { top: auto; bottom: calc(100% - var(--vy, 0px) - var(--vh, 100%) + var(--s2)); left: calc(var(--vx, 0px) + var(--s2)); max-width: calc(var(--vw, 100%) - 72px); }
.frame.hinting .tag.bottom { display: none; }
.tag:empty { display: none; }
.history { display: flex; align-items: center; gap: 0; flex: none; }
.history .icon-btn { border-radius: 50%; color: var(--text); }
.history .icon-btn svg { width: 20px; height: 20px; }
.history .icon-btn:disabled { opacity: 0.35; }
/* Zoom in / out / fit: shown while the photo is being handled, while zoomed, or when focused. */
.zoomctl { position: absolute; bottom: var(--s2); right: var(--s2); display: flex; flex-direction: column; gap: var(--s1); transition: opacity 0.2s ease-out; }
.zoomctl .icon-btn { border-radius: 50%; background: rgb(18 18 20 / 0.62); color: #fff; }
.zoomctl .icon-btn svg { width: 20px; height: 20px; }
.zoomctl .icon-btn:disabled { opacity: 0.4; }
.zoomctl:not(.show):not(:focus-within) { opacity: 0; pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .stage:hover .zoomctl { opacity: 1; pointer-events: auto; } }
.stage:not(.has-photo) .zoomctl { display: none; }
.stage.cropping .zoomctl, .stage.cropping .zoom-hint { display: none; }
.zoom-hint { position: absolute; left: 50%; bottom: var(--s2); transform: translateX(-50%); margin: 0; padding: 4px var(--s3); border-radius: 12px;
  background: rgb(18 18 20 / 0.72); color: #fff; font-size: 0.8125rem; line-height: 1.125rem; white-space: nowrap; pointer-events: none; transition: opacity 0.4s ease-out; }
.zoom-hint.gone { opacity: 0; }
.busy { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #fff; background: rgb(18 18 20 / 0.6); padding: var(--s5); }
.busy p { margin: var(--s2) 0 0; font-size: 0.8125rem; color: #ffffffcc; }
.spinner { width: 36px; height: 36px; margin: 0 auto var(--s3); border-radius: 50%; border: 3px solid #ffffff33; border-top-color: var(--accent); animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner.small { width: 20px; height: 20px; margin: 0; border-width: 2px; border-color: var(--control); border-top-color: var(--accent); flex: none; }
#brush { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; opacity: 0.55; cursor: crosshair; }
.frame.placing { cursor: move; }
/* Crop and rotate: the photo moves under a fixed frame. Outside the frame is dimmed; the
   frame has a rule-of-thirds grid and corner/edge handles with 44px targets. */
.stage.cropping .frame { display: none; }
.crop-view { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; outline: none; }
.crop-view:active { cursor: grabbing; }
.crop-view:focus-visible .crop-box { outline: 2px solid var(--accent); outline-offset: 3px; }
#cropImg { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
.crop-box { position: absolute; box-shadow: 0 0 0 200vmax rgb(12 11 14 / 0.72); border: 1px solid #fffd; pointer-events: none; }
.crop-grid { position: absolute; inset: 0; opacity: 0.5;
  background: linear-gradient(90deg, transparent calc(33.333% - 0.5px), #fff calc(33.333% - 0.5px) calc(33.333% + 0.5px), transparent 0,
      transparent calc(66.667% - 0.5px), #fff calc(66.667% - 0.5px) calc(66.667% + 0.5px), transparent 0),
    linear-gradient(transparent calc(33.333% - 0.5px), #fff calc(33.333% - 0.5px) calc(33.333% + 0.5px), transparent 0,
      transparent calc(66.667% - 0.5px), #fff calc(66.667% - 0.5px) calc(66.667% + 0.5px), transparent 0); }
.crop-h { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; pointer-events: auto; touch-action: none; }
.crop-h::after { content: ""; position: absolute; left: 50%; top: 50%; }
.crop-h.c::after { width: 20px; height: 20px; border: 0 solid #fff; filter: drop-shadow(0 0 2px #0009); }
.crop-h.nw { left: 0; top: 0; cursor: nwse-resize; } .crop-h.nw::after { margin: -2px 0 0 -2px; border-width: 4px 0 0 4px; }
.crop-h.ne { left: 100%; top: 0; cursor: nesw-resize; } .crop-h.ne::after { margin: -2px 0 0 -18px; border-width: 4px 4px 0 0; }
.crop-h.se { left: 100%; top: 100%; cursor: nwse-resize; } .crop-h.se::after { margin: -18px 0 0 -18px; border-width: 0 4px 4px 0; }
.crop-h.sw { left: 0; top: 100%; cursor: nesw-resize; } .crop-h.sw::after { margin: -18px 0 0 -2px; border-width: 0 0 4px 4px; }
.crop-h.edge::after { background: #fff; border-radius: 2px; box-shadow: 0 0 3px #0009; }
.crop-h.n, .crop-h.s { left: 50%; cursor: ns-resize; } .crop-h.n { top: 0; } .crop-h.s { top: 100%; }
.crop-h.n::after, .crop-h.s::after { width: 24px; height: 4px; margin: -2px 0 0 -12px; }
.crop-h.e, .crop-h.w { top: 50%; cursor: ew-resize; } .crop-h.e { left: 100%; } .crop-h.w { left: 0; }
.crop-h.e::after, .crop-h.w::after { width: 4px; height: 24px; margin: -12px 0 0 -2px; }
.crop-box.small .crop-h.edge { display: none; }
.crop-hint { position: absolute; left: 50%; top: var(--s2); transform: translateX(-50%); margin: 0; padding: 4px var(--s3); border-radius: 12px;
  background: rgb(18 18 20 / 0.72); color: #fff; font-size: 0.8125rem; line-height: 1.125rem; white-space: nowrap; pointer-events: none;
  transition: opacity 0.4s ease-out; }
.crop-hint.gone { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .crop-view.settle #cropImg, .crop-view.settle .crop-box { transition: left 0.18s ease-out, top 0.18s ease-out, width 0.18s ease-out, height 0.18s ease-out; }
}
.crop-tools { display: flex; gap: var(--s2); }
.crop-tools .btn { flex: 1; }

/* One compact utility row under the photo: Undo | Redo | Compare | Share (or Use your photo) | More.
   Each control is an icon over a short label, in an equal share of the row. */
.viewbar { flex: none; display: flex; align-items: center; padding: 2px var(--s1) 0; }
.viewbar > .sep { flex: none; width: 1px; height: 24px; background: var(--line); }
.util { flex: 1 1 0; min-width: 44px; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  padding: 2px 0; border: 0; border-radius: 12px; background: none; color: var(--accent); font-size: 0.8125rem; line-height: 1rem; font-weight: 600; white-space: nowrap;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; transition: background var(--t-select), opacity var(--t-select); }
.util svg { width: 22px; height: 22px; stroke-width: 1.5; }
.util:disabled { opacity: 0.4; cursor: default; }
.util.on { background: var(--blush); }
.viewbar .demo-own { flex: 1 1 0; display: flex; }
.viewbar .demo-own[hidden], .util[hidden] { display: none; }
.more { position: relative; flex: 1 1 0; display: flex; }
.more-menu { position: absolute; right: 0; bottom: calc(100% + 4px); z-index: 20; min-width: 220px; padding: var(--s1); border-radius: var(--r-card);
  background: var(--surface); box-shadow: 0 8px 28px rgb(0 0 0 / 0.18), inset 0 0 0 1px var(--line); }
.more-menu[hidden] { display: none; }
.more-menu button { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 44px; padding: 0 var(--s3); border: 0; border-radius: 10px;
  background: none; color: var(--text); font-size: 0.9375rem; text-align: left; }
.more-menu button svg { width: 20px; height: 20px; color: var(--accent); }
.more-menu button:disabled { opacity: 0.45; }
.more-menu button[hidden] { display: none; }
.more-menu button:not(:disabled):hover, .more-menu button:focus-visible { background: var(--tint); }
.credit-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 var(--s3); border: 0; border-radius: 22px; background: none;
  color: var(--text); font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: var(--s1); }
.top-actions .credit-chip { padding: 0 var(--s1); }
.demo-own .link-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 var(--s2); font-size: 0.875rem; white-space: nowrap; }
.demo-own .link-btn svg { width: 18px; height: 18px; }
@media (max-width: 359px) { .demo-own .lbl { display: none; } }
.panel-head .head-extra.link-btn { min-height: 44px; padding: 0 var(--s2); }
.credit-chip span { padding: 4px var(--s3); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--control); display: inline-flex; align-items: center; gap: 6px; }
.credit-chip svg { width: 16px; height: 16px; color: var(--accent); }
.credit-chip.demo span { box-shadow: inset 0 0 0 1px var(--accent); }


/* AI job status: shows while an AI edit is running, can't be confirmed, failed, or came back late. */
.jobbar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin: var(--s2) var(--gutter) 0; padding: var(--s2) var(--s3);
  border-radius: var(--r-btn); background: var(--surface); box-shadow: inset 0 0 0 1px var(--control); }
.jobbar p { flex: 1 1 12rem; margin: 0; font-size: 0.875rem; line-height: 1.25rem; }
.jobbar .row { flex: 0 0 auto; gap: var(--s2); }
.jobbar .row:empty { display: none; }

/* The four categories: a bottom bar of outline icons; the open one is plum on a blush pill. */
.tabs { flex: none; display: flex; padding: 0 var(--s2) var(--sa-bottom); border-top: 1px solid var(--line); background: var(--bg); }
.tools::-webkit-scrollbar { display: none; }
.tab { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px;
  padding: 4px 0 8px; border: 0; background: none; color: var(--muted); font-size: 0.75rem; line-height: 1rem; font-weight: 600; white-space: nowrap;
  transition: color var(--t-select); }
.tab svg { width: 22px; height: 22px; stroke-width: 1.5; }
.tab > span:first-child { display: grid; place-items: center; width: 56px; height: 30px; border-radius: 15px; transition: background var(--t-select); }
.tab[aria-selected="true"] { color: var(--accent); font-weight: 700; }
.tab[aria-selected="true"] > span:first-child { background: var(--blush); }
.search-row { flex: none; display: flex; align-items: center; gap: var(--s1); padding: var(--s2) calc(var(--gutter) - 6px) 0 var(--gutter); }
.search-row[hidden] { display: none; }
.search { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s3); min-height: 44px; border-radius: var(--r-btn);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--control); }
.search svg { width: 18px; height: 18px; color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 44px; border: 0; background: none; outline: none; font-size: 1rem; }
.search:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }

/* Group chips over a tab's tool row (phones): plain words, the group in view on a blush pill. */
.subchips { flex: none; display: flex; gap: var(--s1); overflow-x: auto; scrollbar-width: none; padding: var(--s2) var(--gutter) 0;
  border-top: 1px solid var(--line); overscroll-behavior-x: contain; }
.subchips::-webkit-scrollbar { display: none; }
.subchips[hidden] { display: none; }
.subchip { flex: none; min-height: 32px; padding: 0 var(--s3); border: 0; border-radius: 16px; background: none; color: var(--muted);
  font-size: 0.8125rem; line-height: 1rem; font-weight: 600; white-space: nowrap; transition: background var(--t-select), color var(--t-select); }
.subchip[aria-pressed="true"] { background: var(--blush); color: var(--text); font-weight: 700; }
.subchip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tools-open .subchips { display: none; }

/* The tools scroll on their own, inside a fixed height. */
.tools { flex: none; height: var(--tools-h); display: flex; align-items: flex-start; gap: var(--s3); overflow-x: auto; overflow-y: hidden;
  padding: var(--s2) var(--gutter); scrollbar-width: none; scroll-padding: 0 var(--gutter); overscroll-behavior-x: contain; }
.tools::after { content: ""; flex: none; width: 1px; } /* lets the last tool scroll fully into view */
.group { flex: none; display: flex; flex-direction: column; gap: 2px; }
.group-label { padding-left: var(--s2); font-size: 0.75rem; line-height: 1rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.group-items { display: flex; gap: var(--s1); }
.tool { position: relative; flex: none; width: 72px; padding: 4px 2px; border: 0; border-radius: var(--r-well); background: none; color: var(--muted);
  font-size: 0.75rem; line-height: 1rem; font-weight: 500; text-align: center; box-shadow: inset 0 0 0 2px transparent;
  transition: background var(--t-select), box-shadow var(--t-select), color var(--t-select), transform var(--t-press-up); }
.tool:active { transform: scale(0.98); transition-duration: var(--t-press-down); }
.tool .well { position: relative; width: 40px; height: 40px; margin: 0 auto 4px; display: grid; place-items: center; border-radius: var(--r-well);
  background: var(--surface); color: var(--text); background-size: cover; background-position: center 30%; font-style: normal; box-shadow: inset 0 0 0 1px var(--line); }
.tool .well svg { width: 24px; height: 24px; stroke-width: 1.5; }
.tool:not(.thumb) .well { width: 46px; height: 46px; border-radius: 50%; background: none; box-shadow: inset 0 0 0 1px var(--line); color: var(--accent); }   /* outlined circles, as in the mockup */
.tool .name { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* Selected: a 2px ring, bold label and a check, not color alone. */
.tool[aria-pressed="true"] { background: var(--tint); box-shadow: inset 0 0 0 2px var(--accent); color: var(--text); font-weight: 700; }
.tool[aria-pressed="true"] .well::before { content: ""; position: absolute; left: -5px; bottom: -5px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 10px no-repeat;
  box-shadow: 0 0 0 2px var(--bg); }
.tool .cost { position: absolute; top: -7px; right: -14px; padding: 0 5px; border-radius: 6px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--control);
  color: var(--text); font-size: 0.6875rem; line-height: 1rem; font-weight: 700; white-space: nowrap; }
.empty-note { margin: 0; padding: var(--s2) var(--s2); color: var(--muted); font-size: 0.875rem; }

/* All, expanded: a taller catalog that scrolls down, with group headings. */
.tools-open .tools { height: min(52dvh, 520px); flex-direction: column; gap: var(--s3); overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; }
.tools-open .tools::after { display: none; }
.tools-open .group-items { flex-wrap: wrap; }
.tools-open .group-label { position: sticky; top: calc(-1 * var(--s2)); z-index: 1; background: var(--bg); padding: 4px var(--s2); }

.panel { flex: none; margin-top: var(--s1); padding: var(--s2) var(--gutter) calc(var(--s2) + var(--sa-bottom)); background: var(--surface);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0; animation: rise var(--t-sheet) cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
.editing-tool .tools { padding-bottom: var(--s2); height: calc(var(--s2) * 2 + var(--tile-h)); }
.panel-head { display: flex; align-items: center; gap: var(--s1); min-height: 44px; }
.panel-head h2 { flex: 0 1 auto; min-width: 0; margin-right: auto; font-size: 1.0625rem; line-height: 1.375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-head .chip { display: block; flex: 0 100 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.75rem; padding: 2px var(--s2); }
#collapseBtn svg { transition: transform 0.2s ease-out; }
.panel.collapsed #collapseBtn svg { transform: rotate(180deg); }
.panel.collapsed .panel-note, .panel.collapsed .panel-body { display: none; }
.panel-head .chip { flex: none; }
.panel-note { margin: 0; color: var(--muted); font-size: 0.8125rem; line-height: 1.125rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.panel-note:empty { display: none; }
.panel-note:empty { display: none; }
.panel-body { margin-top: var(--s1); display: grid; gap: var(--s1); }
.panel-body:empty { display: none; }
.panel .slider { grid-template-columns: auto 1fr 2.5rem; }
.swatches { display: flex; flex-wrap: wrap; gap: var(--s2); }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; background: none; }
.swatch i { width: 32px; height: 32px; border-radius: 50%; box-shadow: 0 0 0 1px var(--control); }
.swatch[aria-pressed="true"] i { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.opts { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; }
.opt { flex: none; min-height: 44px; padding: 0 var(--s4); border: 0; border-radius: 22px; background: var(--surface-2); color: var(--text); font-size: 0.875rem; font-weight: 600; }
.opt[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.opt.save-look { background: none; box-shadow: inset 0 0 0 1px var(--control); color: var(--accent); }
/* Full / Person / Background: which part the Adjust slider changes. A small picture of the photo
   (the chosen part tinted red) and a name; one row, same height whether or not the pictures are ready. */
.areas-wrap { display: grid; gap: 4px; }
.areas { display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.areas::-webkit-scrollbar { display: none; }
.area { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 12px 4px 4px; border: 0; border-radius: 22px;
  background: var(--surface-2); color: var(--text); font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.area i { width: 34px; height: 34px; border-radius: 17px; background: var(--control) center / cover no-repeat; flex: none; }
@media (max-width: 380px) { .area i { width: 28px; height: 28px; } .area { padding-right: 10px; gap: 5px; } }
.area[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.area:disabled { opacity: 0.45; }
.area.loading i { animation: area-pulse 1.1s ease-in-out infinite alternate; }
@keyframes area-pulse { from { opacity: 0.35; } to { opacity: 0.9; } }
/* While refining, the tool rows step aside so the photo is as big as it can be. */
#editorScreen.refining #tabs, #editorScreen.refining #tools, #editorScreen.refining #subchips { display: none !important; }
.refine-acts { display: flex; gap: var(--s2); flex-wrap: wrap; }
.refine-acts .opt:disabled { opacity: 0.45; }
.area-note { margin: 0; font-size: 0.8125rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .area.loading i { animation: none; } }
/* One scrolling row of colors: "+" (any color), the dropper, the curated shades, then her own. */
.color-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: var(--s1); }
.color-row::-webkit-scrollbar, .opts::-webkit-scrollbar { display: none; }
.swatch { flex: none; }
.swatch.more i { display: grid; place-items: center; background: var(--surface-2); color: var(--text); }
.swatch.more svg { width: 18px; height: 18px; }
.swatch.more[aria-pressed="true"] i { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.color-slider input::-webkit-slider-runnable-track { height: 12px; border-radius: 6px; background: var(--track, var(--control)); box-shadow: inset 0 0 0 1px var(--line); }
.color-slider input::-moz-range-track { height: 12px; border-radius: 6px; background: var(--track, var(--control)); }
.color-slider input::-moz-range-progress { background: transparent; }
.color-slider input::-webkit-slider-thumb { margin-top: -6px; }
.panel .color-slider { grid-template-columns: 5.5rem 1fr 0; }
.pick-swatch { flex: none; width: 28px; height: 28px; border-radius: 50%; box-shadow: 0 0 0 1px var(--control); }
.stage.dropping, .stage.dropping * { cursor: crosshair; }
.outfit-pick { display: flex; align-items: center; gap: var(--s3); }
.outfit-pick img { width: 52px; height: 52px; object-fit: cover; border-radius: var(--r-well); }
.brush-row { display: flex; align-items: center; gap: var(--s2); }
.brush-row .slider { flex: 1; min-width: 0; }
.brush-modes { flex: none; gap: var(--s1); }
.brush-modes .opt { width: 44px; padding: 0; display: grid; place-items: center; }
.brush-modes .opt svg { width: 20px; height: 20px; }
.prompt input { width: 100%; min-height: 44px; padding: 0 var(--s3); border: 0; border-radius: var(--r-btn); background: var(--bg); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--control); font-size: 1rem; outline: none; }
.prompt input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.panel-actions { display: grid; grid-template-columns: 1fr 2fr; gap: var(--s3); margin-top: var(--s2); }
.panel-actions .btn { min-height: 44px; }

/* While a tool is open on a phone, the categories step aside so the photo keeps its room. */
@media (max-width: 959px) {
  .editing-tool:not(:has(.panel.live)) .tabs, .editing-tool .slot, .tools-open .tabs { display: none; }   /* Adjust keeps the tabs, like Photoshop Express */
  .panel-collapsed .tools { display: none; }
}
@media (max-height: 600px) and (max-width: 959px) {
  .editing-tool .tools, .editing-tool .subchips { display: none; }
  .stage { min-height: 140px; }
}

/* Desktop: photo on the left, tools on the right. */
@media (min-width: 960px) {
  #editorScreen { max-width: 1280px; display: grid; grid-template-columns: 1fr 400px; grid-template-rows: 56px minmax(0, 1fr); column-gap: var(--s5); }
  #editorScreen .topbar { grid-column: 1 / -1; }
  #editorScreen .canvas-col { grid-column: 1; grid-row: 2; padding: 0 0 var(--s5) var(--s5); }
  #editorScreen .stage, #editorScreen .viewbar { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  #editorScreen .side { grid-column: 2; grid-row: 2; min-height: 0; display: flex; flex-direction: column; padding-bottom: var(--s5); }
  #editorScreen .tools, .tools-open .tools { flex: 1 1 auto; height: auto; min-height: 0; flex-direction: column; flex-wrap: nowrap; gap: var(--s3); overflow-x: hidden; overflow-y: auto; }
  #editorScreen .tools::after { display: none; }
  #editorScreen .group-items { flex-wrap: wrap; }
  #editorScreen .panel { flex: none; border-radius: var(--r-card); margin: var(--s3) var(--gutter) 0; }
  #expandBtn { display: none; }
  #editorScreen .subchips { display: none; }   /* the side column shows every group with its name */
}
.side { display: contents; }
@media (min-width: 960px) { .side { display: flex; } }
/* Phones: the controls under the photo keep one height (the dock), so the photo keeps its size
   while tools open and change. Collapsing the panel, or expanding All, is the only way it grows. */
@media (max-width: 959px) {
  /* The controls take only the height they need: no reserved space. An open tool's panel adds its
     own height (up to 62% of the screen, then it scrolls); closing it gives the room back to the photo. */
  #editorScreen { --dock-h: 17.125rem; }
  #editorScreen .stage { margin: 0 10px; border-radius: 16px; }
  #editorScreen .side { display: flex; flex-direction: column; flex: none; max-height: 62dvh; overflow: hidden; padding-bottom: var(--sa-bottom); }
  #editorScreen .side > .tools { flex: none; height: auto; min-height: 0; padding-top: var(--s1); padding-bottom: var(--s1); border-top: 1px solid var(--line); }
  #editorScreen.has-chips:not(.tools-open) .side > .tools { border-top: 0; }
  /* Photo tiles stand a little taller than icon tiles; every tab's row keeps the taller height. */
  #editorScreen:not(.tools-open):not(.editing-tool) .side > .tools { min-height: calc(var(--tile-h) + 6px + var(--s1) * 2); }
  /* A thin line between groups, so where one ends and the next starts is visible without words. */
  #editorScreen:not(.tools-open) .side > .tools > .group[data-group] + .group { position: relative; margin-left: var(--s2); }
  #editorScreen:not(.tools-open) .side > .tools > .group[data-group] + .group::before { content: ""; position: absolute; left: -6.5px; top: 10px; height: 38px; width: 1px; background: var(--line); }
  #editorScreen.no-tools .side > .subchips, #editorScreen.panel-collapsed .side > .subchips { display: none; }
  #editorScreen.no-tools.has-chips .side > .panel, #editorScreen.panel-collapsed.has-chips .side > .panel { border-top: 0; }
  /* Five tools fit across a phone, as in the approved design; more follow on scroll. */
  #editorScreen .side > .tools, #editorScreen .side > .tools .group-items { gap: var(--s1); }
  #editorScreen .side > .tools .tool { width: clamp(64px, calc((100vw - 2 * var(--gutter) - 4 * var(--s1)) / 5), 80px); }
  #editorScreen.editing-tool .side > .tools { flex: none; height: calc(var(--s2) * 2 + var(--tile-h)); }
  #editorScreen.no-tools .side > .tools { display: none; }
  #editorScreen .side > .panel { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  #editorScreen.panel-collapsed .side { height: auto; min-height: 0; }
  #editorScreen.tools-open .side { height: min(68dvh, calc(var(--dock-h) + 300px)); max-height: none; }   /* the expanded catalog scrolls inside */
  #editorScreen.panel-collapsed .side > .panel { flex: none; }
  /* Every open tool's panel is the same height (title, three rows of controls, buttons), so the
     photo never changes size when moving from one tool to another. */
  #editorScreen .side > .panel:not(.collapsed) { display: flex; flex-direction: column;
    min-height: min(62dvh, calc(var(--s2) * 3 + 44px + var(--s1) + 44px * 3 + var(--s1) * 2 + 44px + var(--sa-bottom))); }
  #editorScreen .side > .panel:not(.collapsed) .panel-actions { margin-top: auto; padding-top: var(--s2); }
  /* Try on while a look is made or shown: just Your looks and the buttons, so the photo is big. */
  #editorScreen .side > .panel.try-compact:not(.collapsed) { min-height: 0; }
}
@media (max-width: 959px) and (max-height: 600px) { #editorScreen { --dock-h: 14rem; } }
/* Phones held sideways: the same side-by-side layout, so the photo isn't squeezed into a strip.
   The side insets keep both columns clear of a notch or camera cutout. */
@media (max-width: 959px) and (min-width: 560px) and (max-height: 560px) and (orientation: landscape) {
  #editorScreen { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) min(340px, 42vw); grid-template-rows: 48px minmax(0, 1fr); column-gap: var(--s3);
    padding-left: var(--sa-left); padding-right: var(--sa-right); }
  #editorScreen .topbar { grid-column: 1 / -1; }
  #editorScreen .canvas-col { grid-column: 1; grid-row: 2; padding: 0 0 calc(var(--s2) + var(--sa-bottom)) var(--gutter); }
  #editorScreen .stage, #editorScreen .viewbar { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  #editorScreen .stage { min-height: 0; }
  #editorScreen .side { grid-column: 2; grid-row: 2; min-height: 0; height: auto; display: flex; flex-direction: column; overflow-y: auto; padding-bottom: var(--sa-bottom); }
  #editorScreen .tools, .tools-open .tools { flex: 1 0 auto; height: auto; min-height: var(--tile-h); }
  #editorScreen .demorow { margin-top: 0; }
  #editorScreen .panel { flex: none; border-radius: var(--r-card); margin: var(--s2) 0 0; }
  #editorScreen .tabs, #editorScreen .slot, #editorScreen .tools { margin-left: 0; margin-right: 0; }
  #editorScreen.editing-tool .tools { display: flex; flex: none; height: calc(var(--s2) * 2 + var(--tile-h)); }   /* the side column has room for the tool row */
  #editorScreen.panel-collapsed .tools { display: none; }
}

/* ---------- Welcome (first launch only) ---------- */
#onboarding { padding: calc(var(--s4) + var(--sa-top)) var(--gutter) calc(var(--s3) + var(--sa-bottom)); overflow-y: auto; }
.ob-slide { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: var(--s3); padding-bottom: var(--s4); }
/* The whole portrait, at its own 3:4 shape: never cropped. */
.ob-photo { position: relative; flex: none; height: clamp(200px, 54dvh, 600px); aspect-ratio: 3 / 4; max-width: 100%; border-radius: var(--r-card); overflow: hidden;
  background: var(--canvas, #18171b); margin-bottom: var(--s1); }
.ob-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.ob-photo .tag.bottom { top: auto; bottom: var(--s2); left: var(--s2); right: auto; max-width: calc(100% - 16px); }
.ob-slide h1 { font: 600 2rem/2.375rem var(--font-display); margin: 0; letter-spacing: 0.2px; max-width: 22rem; }
.ob-slide p { margin: 0; color: var(--muted); max-width: 22rem; font-size: 1rem; line-height: 1.5rem; }
.ob-actions { flex: none; display: grid; gap: var(--s2); width: min(100%, 400px); margin: 0 auto; }
.ob-cam { justify-self: center; display: inline-flex; align-items: center; gap: var(--s2); }
.ob-cam svg { width: 20px; height: 20px; }
@media (max-height: 640px) { .ob-photo { height: clamp(150px, 42dvh, 320px); } .ob-slide h1 { font-size: 1.75rem; line-height: 2.125rem; } }

/* ---------- Sheets and dialogs ---------- */
dialog { border: 0; padding: 0; color: var(--text); background: var(--surface); max-height: 92dvh; overflow-y: auto; }
dialog::backdrop { background: rgb(0 0 0 / 0.6); }
dialog.sheet { width: 100%; max-width: 560px; margin: auto auto 0; border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  padding: var(--s5) var(--gutter) calc(var(--s5) + var(--sa-bottom)); }
dialog.sheet[open] { animation: sheet var(--t-sheet) cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet { from { transform: translateY(40px); opacity: 0.4; } }
@media (min-width: 600px) { dialog.sheet { margin: auto; border-radius: var(--r-sheet); width: min(92vw, 480px); } }
dialog.alert { width: min(92vw, 400px); border-radius: var(--r-card); padding: var(--s5); }
.ask-figure { margin: var(--s3) 0 0; }
.ask-figure img { display: block; width: 100%; max-height: 46dvh; object-fit: contain; border-radius: var(--r-well); background: var(--surface-2); }
.ask-figure figcaption { margin-top: var(--s1); color: var(--muted); font-size: 0.8125rem; text-align: center; }
/* "Add Glow Studio to your home screen" (homescreen.js): the app icon with a soft gold light, then the two iPhone taps. */
dialog.home-add { text-align: center; }
.home-add-icon { display: block; width: 72px; height: 72px; margin: 0 auto var(--s4); border-radius: 18px; box-shadow: 0 0 0 1px rgb(255 217 138 / 0.28), 0 10px 30px -8px rgb(243 181 74 / 0.55); }
dialog.home-add #homeAddText { color: var(--muted); margin: var(--s2) 0 0; }
.home-add-steps { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: var(--s2); text-align: left; counter-reset: step; }
.home-add-steps li { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border-radius: var(--r-well); background: var(--surface-2); font-size: 0.9375rem; line-height: 1.35; }
.home-add-steps li::before { counter-increment: step; content: counter(step); flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; background: var(--cta); color: var(--cta-fg); }
.home-add-steps [data-icon] { display: inline-flex; flex: none; color: var(--rose); }
.home-add-steps [data-icon] svg { width: 24px; height: 24px; }
.sheet-head { display: flex; align-items: flex-start; gap: var(--s2); margin-bottom: var(--s3); }
.sheet-head > :first-child { flex: 1; }
.sheet-head .icon-btn { margin: -10px -10px 0 0; }
dialog p { margin: var(--s2) 0; color: var(--muted); font-size: 0.9375rem; line-height: 1.375rem; }
dialog .stack { display: grid; gap: var(--s3); margin-top: var(--s4); }
.setting { display: grid; gap: var(--s2); padding: var(--s3) 0; border-top: 1px solid var(--line); }
.setting h3 { margin: 0; font-size: 0.9375rem; line-height: 1.375rem; font-weight: 700; }
.seg { display: flex; padding: 2px; border-radius: var(--r-btn); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--control); }
.seg button { flex: 1; min-height: 44px; border: 0; border-radius: 14px; background: none; color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1.5px var(--accent); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 44px; font-size: 0.9375rem; }
.toggle input { -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 48px; height: 28px; margin: 0; border-radius: 14px;
  background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--control); cursor: pointer; transition: background var(--t-select); }
.toggle input::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--control);
  transition: transform var(--t-select), background var(--t-select); }
.toggle input:checked { background: var(--accent); box-shadow: none; }
.toggle input:checked::after { transform: translateX(20px); background: var(--on-accent); }
.enh-prefs { display: grid; gap: 2px; }
.enh-prefs label { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 44px; font-size: 0.9375rem; }
.enh-prefs select { min-height: 36px; max-width: 50%; padding: 0 var(--s2); border-radius: 10px; border: 1px solid var(--line); background: var(--surface, transparent); color: inherit; font: inherit; font-size: 0.875rem; }
.links { display: flex; flex-wrap: wrap; gap: 0 var(--s2); margin-top: var(--s2); font-size: 0.875rem; }
.links a, .links button { min-height: 44px; display: inline-flex; align-items: center; padding: 0 var(--s1); border: 0; background: none; color: var(--accent); font-size: 0.875rem; }
.danger { color: var(--danger) !important; }

/* Paywall */
.pw-sub { margin: var(--s1) 0 var(--s4) !important; color: var(--text) !important; font-size: 1rem !important; font-weight: 600; }
.perks { list-style: none; padding: 0; margin: 0 0 var(--s4); color: var(--muted); font-size: 0.9375rem; line-height: 1.375rem; }
.perks li { display: flex; gap: var(--s3); margin: var(--s2) 0; }
.perks svg { width: 20px; height: 20px; color: var(--accent); }
.plans { display: grid; gap: var(--s3); }
.plan { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 72px; padding: var(--s3) var(--s4);
  text-align: left; border: 0; border-radius: var(--r-btn); background: var(--bg); box-shadow: inset 0 0 0 1px var(--control); font-size: 0.9375rem;
  transition: box-shadow var(--t-select), background var(--t-select); }
.plan b { display: block; font-size: 1rem; }
.plan small { display: block; color: var(--muted); font-size: 0.75rem; line-height: 1rem; }
.plan .price { font-weight: 700; white-space: nowrap; }
.plan[aria-checked="true"] { background: var(--tint); box-shadow: inset 0 0 0 2px var(--accent); }
.plan .radio { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--control); flex: none; display: grid; place-items: center; }
.plan[aria-checked="true"] .radio { box-shadow: inset 0 0 0 2px var(--accent); }
.plan[aria-checked="true"] .radio::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.plan em { position: absolute; top: -10px; right: var(--s3); padding: 2px var(--s2); border-radius: 8px; background: var(--accent); color: var(--on-accent);
  font-style: normal; font-size: 0.6875rem; font-weight: 700; line-height: 1rem; }
.fine { font-size: 0.75rem !important; line-height: 1.125rem !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* The editor's wordmark carries a small blush sparkle, as in the mockup. */
.wordmark .spark { display: inline-block; width: 0.42em; height: 0.42em; margin-left: 2px; vertical-align: 0.55em;
  background: #f3c062; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
#saveBtn { background: var(--accent); }
/* A small Save pill, as in the mockup; the invisible ::after keeps a 44px touch target. */
#editorScreen #saveBtn { position: relative; min-height: 34px; padding: 0 var(--s4); border-radius: 17px; font-size: 0.9375rem; }
#editorScreen #saveBtn::after { content: ""; position: absolute; inset: -5px -2px; }
.search-tile .well svg { color: var(--muted); }

/* Glow Up checklist: groups of tick chips that wrap, in a body that scrolls on short screens. */
.panel-body:has(.glow-group) { grid-auto-rows: max-content; max-height: calc(44px * 3 + var(--s1) * 2); overflow-y: auto; overscroll-behavior: contain; padding-bottom: var(--s1); }
.glow-group { display: grid; gap: 6px; }
.glow-label { font-size: 0.75rem; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; }
.glow-opts { flex-wrap: wrap; overflow: visible; }
.opt.check { display: inline-flex; align-items: center; gap: 6px; }
.opt.check::before { content: ""; width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1.5px currentColor; flex: none; }
.opt.check[aria-pressed="true"]::before { content: "✓"; box-shadow: none; width: 14px; height: auto; font-weight: 800; line-height: 1; text-align: center; }
#saveRoutine { justify-self: start; }

/* ---------- Stone & Ink ----------
   One strong color (ink) for actions, stone for soft highlights, champagne-bronze for small accents,
   champagne only for Pro and AI. Display type is Fraunces with its soft axis. */
.t-display, .wordmark, .ob-slide h1, .t-h, #splash .sp-word, .enh-hero .cap h1 {
  font-family: var(--font-display); font-weight: 500; font-variation-settings: "SOFT" 100, "WONK" 0; letter-spacing: -0.01em; }
.wordmark { letter-spacing: 0; }
.t-h em, .t-display em, .ob-slide h1 em { font-style: italic; font-variation-settings: "SOFT" 100, "WONK" 1; color: var(--rose); }
.topbar.compact .wordmark { color: var(--text); }
.wordmark .spark { background: var(--rose); }
a, .link-btn, .links a, .links button, .toast-act { color: var(--rose); }

/* Actions are pills; they press in a little and spring back. */
.btn.quiet { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.btn, .pill, .icon-btn, .tool, .look, .tab { transition-timing-function: cubic-bezier(.3, .7, .4, 1.4); }
.btn:active, .pill:active, .icon-btn:active, .tool:active { transform: scale(0.96); }
.chip { color: var(--rose); box-shadow: inset 0 0 0 1px currentColor; }

/* Toasts: a small ink pill, never a red-bordered banner. */
.toast { background: var(--toast-bg); color: var(--toast-fg); box-shadow: 0 10px 30px -12px rgb(0 0 0 / 0.45); border-radius: 999px; padding: 10px 18px; }
.toast.err { box-shadow: 0 10px 30px -12px rgb(0 0 0 / 0.45); }
.toast .toast-act { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* Save waits quietly, then wakes up with a small pop once there is something to save. */
#editorScreen #saveBtn:disabled { opacity: 1; background: var(--surface-2); color: var(--muted); }
#editorScreen #saveBtn:not(:disabled) { animation: glow-pop 420ms cubic-bezier(.3, .7, .4, 1.4); }
@keyframes glow-pop { 0% { transform: scale(0.92); } 55% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* Tools: blush squircles with rose icons instead of outlined circles; photo tiles keep their picture. */
.tool:not(.thumb) .well { border-radius: 16px; background: var(--blush); box-shadow: none; color: var(--rose); }
.tool .well svg { stroke-width: 1.5; }
.tool.thumb .well { border-radius: 14px; box-shadow: none; }
.tool[aria-pressed="true"] { background: none; box-shadow: none; color: var(--text); }
.tool[aria-pressed="true"] .well { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.tool[aria-pressed="true"] .well::before { left: auto; right: -6px; bottom: auto; top: -6px; z-index: 1; }
.tool .cost { background: var(--champagne); box-shadow: none; color: #15140f; border-radius: 999px; }

/* Tabs: text-first, the open one sits on a blush pill; no hairline above. */
.tabs { border-top: 0; }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"] svg { color: var(--rose); }
.nav { border-top: 0; }
.nav button[aria-current="page"] span { text-decoration: none; }
.nav button[aria-current="page"] svg { color: var(--rose); }

/* Sheets: softer settled shadow and a springier entrance. */
dialog.sheet[open] { animation: sheet 320ms cubic-bezier(.2, 1.1, .3, 1); }
dialog::backdrop { background: rgb(14 14 16 / 0.55); backdrop-filter: blur(2px); }
.seg button[aria-pressed="true"] { box-shadow: 0 0 0 1.5px var(--text); }

/* Welcome: the portrait is the cover, the headline does the talking. */
.ob-photo { border-radius: 28px; box-shadow: 0 24px 48px -28px rgb(20 20 24 / 0.45); }
.ob-slide h1 { font-size: 2.375rem; line-height: 2.5rem; }
@media (max-height: 640px) { .ob-slide h1 { font-size: 1.875rem; line-height: 2.125rem; } }

/* Paywall: show the result first, three short perks, two plan cards side by side. */
dialog.pw { padding-top: 0; overflow-x: hidden; }
.pw-hero { position: relative; margin: 0 calc(-1 * var(--gutter)) var(--s4); aspect-ratio: 780 / 503; max-height: 34dvh; width: calc(100% + 2 * var(--gutter)); overflow: hidden; background: var(--viewer); }
.pw-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.pw-hero .pw-a { clip-path: inset(0 0 0 50%); animation: pw-wipe 6s ease-in-out infinite; }
.pw-seam { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 12px rgb(255 255 255 / 0.9); animation: pw-seam 6s ease-in-out infinite; }
.pw-hero::after { content: ""; position: absolute; inset: auto 0 0; height: 36%; background: linear-gradient(transparent, var(--surface)); }
.pw-tag { position: absolute; bottom: 22%; z-index: 1; padding: 3px 10px; border-radius: 999px; background: rgb(23 23 26 / 0.5); color: #fff;
  font-size: 0.6875rem; line-height: 1rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.pw-tag.l { left: var(--s3); } .pw-tag.r { right: var(--s3); }
@keyframes pw-wipe { 0%, 12% { clip-path: inset(0 0 0 85%); } 50%, 62% { clip-path: inset(0 0 0 15%); } 100% { clip-path: inset(0 0 0 85%); } }
@keyframes pw-seam { 0%, 12% { left: 85%; } 50%, 62% { left: 15%; } 100% { left: 85%; } }
.pw-x { position: absolute; top: var(--s3); right: var(--s3); z-index: 2; border-radius: 50%; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.pw-chip { display: inline-block; margin-top: calc(-1 * var(--s5)); position: relative; padding: 4px 12px; border-radius: 999px; background: var(--champagne); color: #15140f;
  font-size: 0.6875rem; line-height: 1rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
dialog.pw .t-h { margin: var(--s2) 0 var(--s3); font-size: 2rem; line-height: 2.25rem; }
dialog.pw .perks { color: var(--text); font-weight: 500; }
dialog.pw .perks li { align-items: center; margin: var(--s2) 0; }
dialog.pw .perks svg { box-sizing: content-box; width: 18px; height: 18px; padding: 6px; border-radius: 10px; background: var(--blush); color: var(--rose); }
dialog.pw .plans { grid-template-columns: 1fr 1fr; gap: var(--s3); margin-top: var(--s4); }
dialog.pw .plan { display: grid; align-content: start; justify-items: start; gap: 2px; min-height: 0; padding: var(--s4) var(--s3) var(--s3); border-radius: 20px;
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow var(--t-select), transform var(--t-press-up); }
dialog.pw .plan b { font-size: 0.9375rem; }
dialog.pw .plan .price { font-size: 1.25rem; line-height: 1.75rem; font-variant-numeric: tabular-nums; }
dialog.pw .plan small { font-size: 0.75rem; line-height: 1rem; }
dialog.pw .plan[aria-checked="true"] { background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent), 0 12px 24px -16px rgb(23 23 26 / 0.6); }
dialog.pw .plan em { top: -10px; left: var(--s3); right: auto; border-radius: 999px; padding: 2px 8px; letter-spacing: 0.04em; }
dialog.pw #buyBtn { margin-top: var(--s4); position: relative; overflow: hidden; }
dialog.pw #buyBtn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / 0.16) 50%, transparent 70%);
  transform: translateX(-100%); animation: pw-shine 3.4s ease-in-out 1s infinite; }
@keyframes pw-shine { 0% { transform: translateX(-100%); } 40%, 100% { transform: translateX(100%); } }
dialog.pw #adBtn { margin-top: var(--s3); }
dialog.pw .pw-packs { display: block; margin: var(--s3) auto 0; padding: var(--s2); min-height: 44px; border: 0; background: none; color: var(--muted); font-size: 0.875rem; }
dialog.pw .pw-packs u { color: var(--text); text-underline-offset: 3px; }
.packs-sub { margin: 0 0 var(--s4); color: var(--muted); }
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
.pack { position: relative; display: grid; justify-items: center; gap: 2px; padding: var(--s4) var(--s2) var(--s3); border-radius: 20px;
  border: 0; background: var(--surface); color: var(--text); text-align: center; box-shadow: inset 0 0 0 1.5px var(--line); }
.pack b { font-family: Fraunces, Georgia, serif; font-size: 1.75rem; line-height: 2rem; font-weight: 500; }
.pack .unit { font-size: 0.8125rem; color: var(--muted); }
.pack .price { margin-top: var(--s2); font-weight: 700; font-variant-numeric: tabular-nums; }
.pack small { font-size: 0.6875rem; line-height: 1rem; color: var(--muted); }
.pack em { position: absolute; top: -10px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-style: normal; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; }
.pack:disabled { opacity: 0.55; }
.pack[aria-busy="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
#packsSheet .fine { margin-top: var(--s4); }
@media (max-width: 340px) { .packs { grid-template-columns: 1fr; } .pack { grid-template-columns: auto 1fr auto; justify-items: start; align-items: baseline; gap: var(--s2); } .pack .price { margin: 0; } .pack em { right: var(--s3); } }
dialog.pw .pw-free { margin: var(--s3) 0 0; font-size: 0.8125rem; line-height: 1.125rem; text-align: center; }
dialog.pw .fine { text-align: center; }
dialog.pw .links { justify-content: center; }
@media (prefers-reduced-motion: reduce) { .pw-hero .pw-a { clip-path: inset(0 0 0 50%); } .pw-seam { left: 50%; } }

/* Fixed-light chips on the photo keep ink text in both themes; the selected-tool check uses rose. */
.sample-badge { color: #15140f; }
.tool[aria-pressed="true"] .well::before { background-color: var(--rose); }
/* Quieter utility row and glass zoom buttons. (The photo sits on the page itself: --viewer matches --bg.) */
.util-row .sep, .utils .sep, i.sep { opacity: 0; }
.zoomctl .icon-btn { background: var(--glass); color: var(--text); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* Photo tiles: the face the tool will change, with the tool's icon on a small blush badge. */
.tool.photo .well { width: 52px; height: 52px; border-radius: 16px; background-color: var(--surface-2); background-size: cover; background-position: center; box-shadow: none; }
.tool.photo .glyph { position: absolute; right: -5px; bottom: -5px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(var(--blush), var(--blush)), var(--bg); color: var(--rose); box-shadow: 0 0 0 2px var(--bg); }
.tool.photo .glyph svg { width: 13px; height: 13px; stroke-width: 2.2; }

/* Phones: Undo, Redo, Compare, Share and More sit in the top bar where the wordmark was, so nothing
   covers the photo and the photo gets the row's height. Labels stay for screen readers. Share is in
   More on narrow phones. The expanded viewer keeps its own Compare button at the bottom. */
@media (max-width: 959px) and (min-height: 601px) {
  #editorScreen { position: relative; }
  #editorScreen .topbar .wordmark { visibility: hidden; }
  #editorScreen:not(.viewer-expanded) .viewbar { position: absolute; left: calc(var(--sa-left) + var(--gutter) - 6px + 44px); top: calc(var(--sa-top) + 2px);
    z-index: 6; height: 44px; gap: 0; padding: 0; }
  #editorScreen .viewbar > .sep { display: none; }
  #editorScreen .viewbar .util, #editorScreen .viewbar .more, #editorScreen .viewbar .demo-own { flex: none; }
  #editorScreen .viewbar .util { width: 40px; min-width: 40px; min-height: 44px; border-radius: 50%; color: var(--text); }
  #editorScreen .viewbar .util.on { background: var(--text); color: var(--bg); }
  #editorScreen .viewbar .util > span + span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #editorScreen:not(.viewer-expanded) .viewbar .more { position: static; }   /* the menu lines up with the row, under it */
  #editorScreen:not(.viewer-expanded) .viewbar .more-menu { top: calc(100% + 4px); bottom: auto; left: 0; right: auto; }
  #editorScreen:has(.stage.cropping) .viewbar { visibility: hidden; }
  #editorScreen .zoomctl, #editorScreen .zoom-hint { bottom: var(--s3); }
}
#shareMenuBtn { display: none; }
@media (max-width: 419px) and (min-height: 601px) {
  #editorScreen:not(.viewer-expanded) .viewbar #shareBtn { display: none; }
  #editorScreen #shareMenuBtn:not([hidden]) { display: flex; }
}
@media (max-width: 339px) and (min-height: 601px) {
  #editorScreen .viewbar .util { width: 36px; min-width: 36px; }
  #editorScreen .top-actions .credit-chip { display: none; }
}

/* Phones: an open tool's panel is only as tall as its controls (no empty band), the tool's
   one-line note opens on tap, and the group chips step aside while a tool is open. */
@media (max-width: 959px) {
  #editorScreen.editing-tool .side > .subchips { display: none; }
  #editorScreen.editing-tool .side > .tools { border-top: 1px solid var(--line); }
  #editorScreen .side > .panel:not(.collapsed) { min-height: 0; }
  #editorScreen .side > .panel { margin-top: 0; padding-top: var(--s1); padding-bottom: calc(var(--s2) + var(--sa-bottom)); }
  #editorScreen .panel-head { min-height: 40px; }
  #editorScreen .panel-note { -webkit-line-clamp: 1; cursor: pointer; }
  #editorScreen .panel-note.open { -webkit-line-clamp: unset; }
  #editorScreen .panel-actions .btn { min-height: 44px; }
  #editorScreen .side > .panel:not(.collapsed) .panel-actions { padding-top: 0; }
}

/* ---------- Motion ----------
   Springs on selection, a shimmer while AI works, a sparkle when a save lands.
   The reduced-motion rule near the top of the file turns all of these into instant changes. */
@keyframes glow-in { 0% { transform: scaleX(0.55); opacity: 0.4; } 70% { transform: scaleX(1.06); } 100% { transform: scaleX(1); opacity: 1; } }
.tab[aria-selected="true"] > span:first-child { animation: glow-in 300ms cubic-bezier(.3, .7, .4, 1.3); }
.tool[aria-pressed="true"] .well { animation: glow-pop 380ms cubic-bezier(.3, .7, .4, 1.4); }
.plan { transition: box-shadow var(--t-select), transform 160ms cubic-bezier(.3, .7, .4, 1.4); }
.plan:active { transform: scale(0.97); }

/* AI working: a soft light sweeps across the photo under the progress text. */
.busy { background: rgb(14 14 16 / 0.42); overflow: hidden; }
.busy::before { content: ""; position: absolute; inset: -20% -60%; background: linear-gradient(105deg, transparent 38%, rgb(255 250 240 / 0.28) 50%, transparent 62%);
  animation: glow-sweep 1.8s cubic-bezier(.4, 0, .2, 1) infinite; pointer-events: none; }
.busy > div { position: relative; padding: var(--s3) var(--s4); border-radius: 20px; background: rgb(14 14 16 / 0.55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.busy .spinner { border-color: rgb(255 255 255 / 0.25); border-top-color: #f3c062; }
@keyframes glow-sweep { from { transform: translateX(-45%); } to { transform: translateX(45%); } }

/* Saved: a quiet blush pill, with a sparkle the moment it lands. */
#editorScreen #saveBtn.saved:disabled { background: var(--blush); color: var(--rose); }
#editorScreen #saveBtn.just-saved::before { content: ""; position: absolute; top: -6px; left: -6px; width: 14px; height: 14px; background: var(--rose);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: glow-twinkle 900ms ease-out both; pointer-events: none; }
@keyframes glow-twinkle { 0% { transform: scale(0) rotate(0); opacity: 0; } 35% { transform: scale(1.2) rotate(30deg); opacity: 1; } 100% { transform: translate(-6px, -8px) scale(0) rotate(90deg); opacity: 0; } }

/* Sheet and alert titles use the display serif, like every other title. */
dialog .sheet-head .t-section, dialog.alert .t-section { font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; line-height: 1.875rem;
  font-variation-settings: "SOFT" 100, "WONK" 0; letter-spacing: -0.01em; }

/* Credits sheet: a balance card, then short facts with icons */
.cr-card { background: linear-gradient(160deg, var(--tint), transparent 70%), var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 18px 18px 16px; margin: 4px 0 14px; }
.cr-card p { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.35rem; }
.cr-card p.cr-note { margin-top: 6px; font-size: .8125rem; }
.cr-num { display: flex; align-items: baseline; gap: 8px; }
.cr-num b { font-family: var(--font-display); font-variation-settings: "SOFT" 100; font-weight: 500; font-size: 3rem; line-height: 1; color: var(--text); }
.cr-num span { color: var(--text); font-weight: 600; font-size: .9375rem; }
.cr-bar { height: 6px; border-radius: 3px; background: var(--surface-2); margin: 12px 0 10px; overflow: hidden; }
.cr-bar i { display: block; height: 100%; border-radius: 3px; background: var(--champagne); }
.cr-facts { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 14px; }
.cr-facts li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; }
.cr-facts svg { width: 36px; height: 36px; padding: 8px; border-radius: 12px; background: var(--blush); color: var(--rose); box-sizing: border-box; }
.cr-facts b { display: block; font-size: .9375rem; line-height: 1.25rem; font-weight: 600; color: var(--text); }
.cr-facts span { display: block; color: var(--muted); font-size: .8125rem; line-height: 1.2rem; margin-top: 2px; }

/* Settings: plan card, quieter links */
#settings .plan-card { background: linear-gradient(120deg, rgb(239 220 184 / .35), rgb(217 191 144 / .35)), var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 16px; margin: 4px 0 8px; display: grid; gap: 12px; }
#settings .plan-card #planLine { margin: 0; font-family: var(--font-display); font-variation-settings: "SOFT" 100; font-size: 1.25rem; line-height: 1.6rem; color: var(--text); }
#settings .plan-card .row { margin: 0; }
#settings .plan-card .btn { flex: 1; }
#settings .setting .fine { color: var(--muted); }
#settings .links a { color: var(--muted); text-decoration: none; }
#settings .links a.danger { color: var(--rose); }
#settings .build-id { opacity: .6; }

/* Group names: Search and wide screens only; a phone tab stays one clean row */
#editorScreen:not(.tools-open) .group-label { display: none; }
@media (min-width: 960px) {
  #editorScreen .group-label { display: block !important; position: static; background: none; padding: 0 0 6px 2px; font-family: var(--font-display); font-variation-settings: "SOFT" 100; font-weight: 500; font-size: 1rem; line-height: 1.375rem; color: var(--text); }
  #editorScreen .tools > .group:last-child .group-label { display: none !important; }
}
#editorScreen.tools-open .zoom-hint { display: none; }
/* ---------- Live beauty camera: Adjust tabs, shade swatches, hold to compare ---------- */
#cameraScreen.adjusting .viewfinder canvas { object-fit: cover; }
#cameraScreen .adjust-panel { padding: var(--s2) var(--s3); margin-bottom: var(--s2); gap: 0; }
#cameraScreen .adjust-panel .slider { min-height: 36px; }
#cameraScreen .adjust-panel input[type="range"] { height: 36px; }
.adj-tabs { display: flex; gap: var(--s1); margin: 0 0 var(--s1); }
.adj-tabs button { flex: 1; min-height: 40px; border: 0; border-radius: 20px; background: transparent; color: #ffffffb3; font-size: 0.875rem; font-weight: 600; }
.adj-tabs button[aria-selected="true"] { background: #ffffff1f; color: #fff; }
.adj-group { display: grid; gap: var(--s1); }
.swatches { display: flex; gap: var(--s2); padding: 0 0 var(--s1) calc(6.5rem + var(--s2)); }
.cam-swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #000; box-shadow: 0 0 0 1px #ffffff55; padding: 0; }
.cam-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--rose); }
/* The note floats over the preview, so it coming and going never resizes the preview. */
.adjust-panel { position: relative; }
.adj-note { position: absolute; left: 50%; bottom: calc(100% + var(--s2)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 2 * var(--s3));
  margin: 0; padding: 4px var(--s3); border-radius: 14px; background: var(--scrim); color: #fff; font-size: 0.8125rem; text-align: center; pointer-events: none; }
.vf-pill { position: absolute; top: var(--s3); left: 50%; transform: translateX(-50%); margin: 0; padding: 4px var(--s3); border-radius: 14px;
  background: var(--scrim); color: #fff; font-size: 0.8125rem; font-weight: 600; pointer-events: none; }
.adj-parts { display: flex; gap: var(--s2); }
.adj-parts button { min-height: 36px; padding: 0 var(--s3); border: 0; border-radius: 18px; background: transparent; box-shadow: inset 0 0 0 1px #ffffff55;
  color: #fff; font-size: 0.8125rem; font-weight: 600; }
.adj-parts button[aria-checked="true"] { background: #fff; color: #000; box-shadow: none; }

/* Small phones (320 px): keep the Settings buttons on one line */
@media (max-width: 359px) {
  #settings .plan-card .btn { padding-left: 12px; padding-right: 12px; font-size: .875rem; white-space: nowrap; }
}

/* Contact support */
.support-form { display: grid; gap: var(--s3); }
.support-form label { display: grid; gap: var(--s1); font-size: 0.875rem; font-weight: 600; }
.support-form select, .support-form textarea, .support-form input { width: 100%; box-sizing: border-box; min-height: 44px; padding: 10px 12px;
  border: 0; border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--control); color: var(--text); font: 400 1rem/1.4 var(--font); }
.support-form textarea { resize: vertical; min-height: 120px; }
.support-form .stack { margin-top: 0; }

/* ---------- Full-screen camera ----------
   Like a phone's own camera: the preview fills the screen edge to edge (cropped, not shrunk) and
   the controls float over it on soft fades. The saved photo is cropped to the same framing. */
#cameraScreen { position: relative; }
#cameraScreen .viewfinder { position: absolute; inset: 0; z-index: 0; }
#cameraScreen .viewfinder canvas, #cameraScreen .viewfinder img { object-fit: cover; }
#cameraScreen .cam-top { background: linear-gradient(#000a, #0000); }
#cameraScreen .cam-top .wordmark { visibility: hidden; }
#cameraScreen .cam-controls { position: relative; z-index: 2; margin-top: auto; padding-top: var(--s6, 32px); max-width: none;
  background: linear-gradient(#0000, #0000008c 30%, #000000b3); }
#cameraScreen .cam-controls > * { max-width: 560px; margin-left: auto; margin-right: auto; }
#cameraScreen .look:not([aria-pressed="true"]) { background: #0000004d; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
#cameraScreen .look.adjust, #cameraScreen .look.add { background: #00000033; }
#cameraScreen .round-btn { background: #0000004d; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
#cameraScreen .adjust-panel { background: #000000a6; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
#cameraScreen .vf-note, #cameraScreen .vf-pill { top: 68px; bottom: auto; }
#cameraScreen .vf-note { left: var(--s4); right: var(--s4); }
#cameraScreen .vf-state { z-index: 3; }

/* AI Enhance in the camera: the switch in the top bar and the one-photo button on review. */
.cam-right { display: flex; align-items: center; gap: var(--s1); justify-self: end; }
.cam-ai { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 12px 0 10px; margin: 4px 0; border: 0; border-radius: 18px;
  background: #0000004d; box-shadow: inset 0 0 0 1px #ffffff80; color: #fff; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.3px;
  transition: background var(--t-select), color var(--t-select); }
.cam-ai svg { width: 16px; height: 16px; }
.cam-ai[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.vf-ai { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; width: calc(100% - 2 * var(--gutter)); margin: 0 auto var(--s3) !important;
  border: 0; border-radius: 24px; background: #ffffff26; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; font-weight: 700; font-size: 0.9375rem; box-shadow: inset 0 0 0 1px #ffffff40; }
.vf-ai > svg { color: var(--rose, var(--accent)); }
.vf-ai[hidden] { display: none; }
.vf-ai svg { width: 18px; height: 18px; }
.vf-ai .cost { margin-left: 4px; padding: 2px 8px; border-radius: 10px; background: #ffffff26; font-size: 0.75rem; font-weight: 600; }

/* ---------- Compact Adjust ----------
   One row of setting chips and one slider, see-through over the photo (no dark box), so the face
   stays in view while it changes. The group tabs and makeup part buttons are replaced by chips. */
#cameraScreen .adjust-panel { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: var(--s2); row-gap: 2px;
  margin: 0 0 var(--s1); padding: 0 var(--gutter); border-radius: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
#cameraScreen .adjust-panel > * { grid-column: 1; }
#cameraScreen .adj-chips, #cameraScreen .adj-note { grid-column: 1 / -1; }
#cameraScreen .adj-tabs, #cameraScreen .adj-parts { display: none; }
.adj-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 2px; }
.adj-chips::-webkit-scrollbar { display: none; }
.adj-chips button { flex: none; min-height: 34px; padding: 0 12px; border: 0; border-radius: 17px; background: #0000004d; color: #ffffffd9;
  font-size: 0.8125rem; font-weight: 600; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.adj-chips button[aria-checked="true"] { background: #fff; color: #000; }
.adj-chips .adj-reset-all { display: inline-flex; align-items: center; gap: 4px; background: transparent; box-shadow: inset 0 0 0 1px #ffffff80; color: #fff; }
.adj-chips .adj-reset-all svg, .adj-reset1 svg { width: 16px; height: 16px; }
#cameraScreen .adj-reset1 { grid-column: 2; grid-row: 2; align-self: start; width: 40px; height: 40px; border: 0; border-radius: 50%; padding: 0; display: grid; place-items: center;
  background: #0000004d; color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
#cameraScreen .adjust-panel .slider { grid-template-columns: 4.5rem 1fr 2rem; min-height: 40px; font-size: 0.875rem; text-shadow: 0 1px 3px #000c; }
#cameraScreen .adjust-panel .slider output { color: #fff; }
#cameraScreen .swatches { padding: 0 0 2px calc(4.5rem + var(--s2)); }
#cameraScreen #adjFilter .looks { padding-top: 0 !important; }

/* Setting name on one line: the chip already names it, so the slider row is just the slider. */
#cameraScreen .adjust-panel .slider { grid-template-columns: 0 1fr 2rem; column-gap: var(--s2); font-size: 0; margin-left: calc(-1 * var(--s2)); }
#cameraScreen .adjust-panel .slider output { font-size: 0.875rem; }
#cameraScreen .swatches { padding-left: 0; }
#cameraScreen .adj-chips button { white-space: nowrap; }

/* Selfie screen flash: a soft warm white over everything, at full strength, for the shot. */
.screen-flash { position: fixed; inset: 0; z-index: 95; background: #fff; pointer-events: none; }
#flashBtn.sflash { position: relative; }
#flashBtn .fa { position: absolute; right: 6px; bottom: 6px; font-size: 0.625rem; font-weight: 800; line-height: 1; }

/* ---------- Try on (tryon.js) ---------- */
.try-seg { gap: var(--s1); }
.try-seg .opt { min-height: 38px; padding: 0 var(--s3); }
.try-cards, .try-closet, .try-looks { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; padding: 4px 2px; }
.try-cards::-webkit-scrollbar, .try-closet::-webkit-scrollbar, .try-looks::-webkit-scrollbar { display: none; }
.try-card { flex: none; width: 68px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 0.75rem; font-weight: 600; line-height: 1rem; text-align: center; }
.try-card .well { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 4px; border-radius: 16px; background: var(--blush); color: var(--rose); background-size: cover; background-position: center; }
.try-card .well svg { width: 26px; height: 26px; stroke-width: 1.5; }
.try-card span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.try-card[aria-pressed="true"] { color: var(--text); font-weight: 700; }
.try-card[aria-pressed="true"] .well { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.try-colors { gap: var(--s1); }
.try-color { min-height: 36px; min-width: 36px; padding: 0 var(--s3); display: grid; place-items: center; }
.try-color i { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
.try-color:has(i) { padding: 0; width: 36px; }
.try-color[aria-pressed="true"]:has(i) { background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--accent); }
.try-add, .try-item { position: relative; flex: none; width: 60px; height: 60px; padding: 0; border: 0; border-radius: var(--r-well); }
.try-add { display: grid; place-items: center; align-content: center; gap: 2px; background: var(--surface-2); color: var(--text); font-size: 0.6875rem; font-weight: 600; }
.try-add svg { width: 20px; height: 20px; }
.try-item { background: var(--surface-2) center / cover no-repeat; }
.try-item[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.try-remove { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--text); color: var(--bg); }
.try-remove svg { width: 14px; height: 14px; }
.try-parts .opt { min-height: 36px; padding: 0 var(--s3); }
.try-looks { align-items: center; }
.try-looks-label { flex: none; color: var(--muted); font-size: 0.75rem; font-weight: 700; margin-right: 2px; }
.try-look:not(.try-tile) { flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px; background: var(--surface-2) center top / cover no-repeat; }
.try-look:not(.try-tile)[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }

/* ---------- Settings rows and the in-app help pages ---------- */
.set-list { display: grid; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; background: var(--surface); }
.set-list a { display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding: 0 var(--s3); color: var(--text); text-decoration: none; font-size: 0.9375rem; }
.set-list a + a { border-top: 1px solid var(--line); }
.set-list a[hidden] { display: none; }
.set-list a[hidden] + a, .set-list a:first-child[hidden] + a { border-top: 0; }
.set-list a::after { content: ""; margin-left: auto; width: 8px; height: 8px; border: solid var(--muted); border-width: 0 1.75px 1.75px 0; transform: rotate(-45deg); flex: none; }
.set-list a:active { background: var(--surface-2, rgb(0 0 0 / 0.04)); }
.set-list [data-icon] { display: inline-flex; color: var(--rose); }
.set-list [data-icon] svg { width: 22px; height: 22px; }
.set-list.plain a { min-height: 48px; }
#settings .build-id { cursor: pointer; }
dialog.doc-sheet { height: 92dvh; display: none; grid-template-rows: auto 1fr; padding-left: 0; padding-right: 0; padding-bottom: 0; overflow: hidden; }
dialog.doc-sheet[open] { display: grid; }
dialog.doc-sheet .sheet-head { padding: 0 var(--gutter); }
#docFrame { width: 100%; height: 100%; border: 0; background: var(--surface); }
@media (min-width: 600px) { dialog.doc-sheet { width: min(92vw, 640px); max-width: 640px; } }
.setting.locked input[type=checkbox] { opacity: 0.55; }

/* Phone app: the native camera (GlowCamera plugin) draws the picture behind the page. */
html.native-cam, html.native-cam body, html.native-cam #app, html.native-cam #cameraScreen { background: transparent !important; }
html.native-cam #camCanvas { visibility: hidden; }

/* Shutter timer */
#camTimer { position: relative; }
#camTimer .fa { position: absolute; right: 6px; bottom: 6px; font-size: 0.625rem; font-weight: 800; line-height: 1; }
.cam-count { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; pointer-events: none;
  color: #fff; font-size: 7rem; font-weight: 800; line-height: 1; text-shadow: 0 2px 24px #0008; font-variant-numeric: tabular-nums; }

/* A camera filter's film effects over the live preview (renderCamFx); the photo gets the same in paintFx. */
.cam-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cam-fx > i { position: absolute; inset: 0; }
.cam-fx .fx-wash { mix-blend-mode: soft-light; }
.cam-fx .fx-leak { mix-blend-mode: screen; }
.cam-fx .fx-grain { mix-blend-mode: overlay; background-repeat: repeat; }
html.native-cam .cam-fx .fx-leak, html.native-cam .cam-fx .fx-grain { mix-blend-mode: normal; }
.cam-fx .fx-date { position: absolute; font: bold 16px/1 "Courier New", ui-monospace, monospace; color: rgba(255,160,70,0.95);
  text-shadow: 0 0 0.35em rgba(255,70,0,0.85); letter-spacing: 0; }

/* ---------- Adjust, Photoshop Express style ----------
   An Adjust tool is one row (name, slider, value, info) that keeps its change as you go: no title
   row, note or Cancel / Apply. Full / Person / Background sit on the photo's bottom edge. */
.panel.live .panel-head, .panel.live .panel-actions { display: none; }
.panel.live:not(.show-note) .panel-note { display: none; }
.panel.live .panel-note { -webkit-line-clamp: unset; margin-top: var(--s1); }
.panel.live .panel-body { margin-top: 0; }
.panel.live.collapsed .panel-body { display: grid; }
.live-row { display: flex; align-items: center; gap: 2px; }
.live-row .slider { flex: 1; min-width: 0; grid-template-columns: minmax(0, max-content) 1fr 2.75rem; }
.live-row .slider > :first-child, .live-row .slider { font-weight: 600; }
.live-row .slider output { font-weight: 500; cursor: pointer; padding: 10px 0; }
.live-row .info-btn { flex: none; width: 40px; min-width: 40px; color: var(--muted); }
.panel.show-note .info-btn { color: var(--text); }
.area-bar { position: absolute; left: 8px; right: 8px; bottom: 10px; z-index: 4; display: flex; justify-content: center; pointer-events: none; }
.area-bar[hidden] { display: none; }
.area-bar .areas-wrap { pointer-events: auto; justify-items: center; min-width: 0; max-width: 100%; }
.area-bar .areas { padding: 4px; border-radius: 26px; max-width: 100%;
  background: color-mix(in srgb, var(--surface) 80%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 4px 18px rgb(0 0 0 / 0.16); }
.area-bar .area { min-height: 40px; padding: 3px 12px 3px 3px; font-size: 0.875rem; background: transparent; }
.area-bar .area i { width: 32px; height: 32px; }
.area-bar .area[aria-pressed="true"] { background: var(--accent); }
.area-bar .area.refine { width: 40px; padding: 0; justify-content: center; color: var(--text); border-radius: 20px; }
.area-bar .area.refine.done { color: var(--accent); }
.area-bar .area.refine svg { width: 18px; height: 18px; }
.area-bar .area-note { padding: 4px 10px; border-radius: 12px; background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--text); text-align: center; max-width: 300px; }
@media (max-width: 380px) { .area-bar .area { padding-right: 9px; font-size: 0.8125rem; gap: 4px; } .area-bar .area i { width: 28px; height: 28px; } .area-bar { bottom: 8px; } }
.viewer-expanded .area-bar, .stage.cropping .area-bar { display: none; }
/* Phones: the slider sits right under the photo and the tool row under it, like Photoshop Express. */
@media (max-width: 959px) {
  #editorScreen .side > .panel.live { order: -1; margin: 0; border-radius: 0; box-shadow: none; background: transparent; border: 0;
    padding: 2px var(--gutter) 0; }
  #editorScreen .side > .panel.live.show-note { padding-bottom: var(--s1); }
  #editorScreen.editing-tool:has(.panel.live) .side > .tools { border-top: 0; }
}
#editorScreen:has(.area-bar:not([hidden])) .zoom-hint, #editorScreen:has(.area-bar:not([hidden])) .zoomctl { bottom: 64px; }
/* The slider row takes the group chips' place, so the photo keeps the same size as while browsing. */
@media (max-width: 959px) {
  #editorScreen.editing-tool:has(.panel.live:not(.show-note)) .side > .tools { height: auto; }
  #editorScreen .side > .panel.live:not(.show-note) { padding-top: 0; }
  #editorScreen .panel.live .live-row .slider { min-height: 41px; }
  #editorScreen .panel.live .info-btn { min-height: 41px; height: 41px; position: relative; }
  #editorScreen .panel.live .info-btn::after { content: ""; position: absolute; inset: -2px 0; }
}
/* Refine sits beside the chips, outside their scrolling row, so it can't be pushed off a narrow
   screen or by large text. The live panel never scrolls. */
.area-bar .areas-wrap { display: flex; align-items: center; gap: 6px; }
.area-bar .areas-wrap > .area-note { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); }
.area-bar .areas { flex: 0 1 auto; min-width: 0; }
.area-bar .area.refine { flex: none; width: 48px; height: 48px; min-height: 48px; border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 80%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 4px 18px rgb(0 0 0 / 0.16); }
.area-bar .area.refine svg { width: 20px; height: 20px; }
.area-bar .area { padding-right: 10px; gap: 5px; }
@media (max-width: 380px) { .area-bar .area.refine { width: 44px; height: 44px; min-height: 44px; } }
#editorScreen .side > .panel.live { overflow: visible; }

/* Golden Hour moment (glowBurst in app.js): a warm light sweeps across, sparkles pop. Decorative. */
.glow-burst { position: absolute; inset: 0; z-index: 6; overflow: hidden; pointer-events: none; border-radius: inherit; }
.glow-burst.page { position: fixed; z-index: 400; border-radius: 0; }
.glow-burst::before { content: ""; position: absolute; inset: -10% -60%; mix-blend-mode: screen;
  background: linear-gradient(105deg, transparent 38%, rgb(255 227 163 / 0.0) 40%, rgb(255 222 150 / 0.55) 50%, rgb(243 181 74 / 0.0) 60%, transparent 62%);
  transform: translateX(-60%); animation: glow-sweep 1100ms cubic-bezier(.3, .1, .2, 1) 80ms both; }
.glow-burst i { position: absolute; width: calc(22px * var(--s, 1)); height: calc(22px * var(--s, 1)); margin: calc(-11px * var(--s, 1));
  background: radial-gradient(circle, #fff 0 18%, #ffe3a3 40%, #f3b54a 70%); opacity: 0;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  filter: drop-shadow(0 0 6px rgb(255 210 120 / 0.9)); animation: glow-spark 720ms cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes glow-sweep { to { transform: translateX(60%); } }
@keyframes glow-spark { 0% { opacity: 0; transform: scale(0) rotate(0); } 40% { opacity: 1; transform: scale(1.15) rotate(30deg); } 100% { opacity: 0; transform: scale(.6) rotate(90deg); } }

/* ---------- Landscape phones: home screens and Welcome side by side (2026-11-01 audit) ----------
   Turned sideways, the sample photo filled the short screen and Choose a photo dropped below the fold.
   The photo stays on the left at full height; buttons scroll on the right (home screens: enhance.css). */
@media (orientation: landscape) and (max-height: 560px) {
  #onboarding { max-width: none; }
  /* Sheets: the screen is short, so use its width and nearly all its height. */
  dialog { max-height: calc(100dvh - var(--sa-top) - 8px); }
  dialog.sheet { width: min(92vw, 640px); max-width: none; }
  /* Pro: the before/after on the left, the plans and button on the right, with no scrolling to reach Continue. */
  dialog.pw[open] { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); column-gap: var(--s5); align-content: start; width: min(96vw, 860px); padding-bottom: var(--s3); }
  dialog.pw > * { grid-column: 2; }
  dialog.pw .pw-hero { grid-column: 1; grid-row: 1 / span 12; position: sticky; top: 0; align-self: start; width: calc(100% + var(--gutter)); margin: 0 0 0 calc(-1 * var(--gutter));
    aspect-ratio: auto; max-height: none; height: calc(100dvh - var(--sa-top) - 8px); }
  dialog.pw .pw-hero::after { inset: 0 0 0 auto; width: 30%; height: auto; background: linear-gradient(to right, transparent, var(--surface)); }
  dialog.pw .pw-x { grid-column: 1; grid-row: 1; right: auto; left: var(--s3); }
  dialog.pw .pw-chip { margin-top: var(--s4); justify-self: start; }
  dialog.pw .t-h { font-size: 1.625rem; line-height: 1.875rem; margin: var(--s2) 0 var(--s1); }
  dialog.pw .perks li { margin: 4px 0; }
  dialog.pw .plans { margin-top: var(--s3); }
  dialog.pw .plan { padding: var(--s3) var(--s3) var(--s2); }
  dialog.pw #buyBtn { margin-top: var(--s3); }
  #onboarding { display: grid; grid-template-columns: auto minmax(0, 26rem); grid-template-rows: 1fr auto auto auto 1fr; justify-content: center; column-gap: var(--s6);
    padding: calc(var(--s3) + var(--sa-top)) calc(var(--gutter) + var(--sa-right)) calc(var(--s3) + var(--sa-bottom)) calc(var(--gutter) + var(--sa-left)); }
  .ob-slide { display: contents; }
  .ob-photo { grid-column: 1; grid-row: 1 / -1; align-self: center; height: calc(100dvh - var(--sa-top) - var(--sa-bottom) - var(--s3) * 2); margin: 0; }
  .ob-slide h1 { grid-column: 2; grid-row: 2; text-align: left; font-size: 1.75rem; line-height: 2.125rem; }
  .ob-slide p { grid-column: 2; grid-row: 3; text-align: left; margin-bottom: var(--s3); }
  .ob-actions { grid-column: 2; grid-row: 4; width: 100%; margin: 0; }
}
/* Camera held sideways: the screen stays upright (like the phone's own camera) and only the icons
   turn to stay level. `rotate` is separate from `transform`, so press effects still work. */
#flashBtn, #camTimer, #camAI, #camSettingsBtn, #camGallery, #camFlip, #camCount {
  rotate: var(--cam-rot, 0deg); transition: rotate 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (prefers-reduced-motion: reduce) {
  #flashBtn, #camTimer, #camAI, #camSettingsBtn, #camGallery, #camFlip, #camCount { transition: none; }
}
/* The web camera on a phone held sideways (the phone apps keep the camera upright instead): the
   controls move to a column on the right, so they no longer cover the lower half of the picture
   and the people in it stay in view. */
@media (max-width: 959px) and (min-width: 560px) and (max-height: 560px) and (orientation: landscape) {
  #cameraScreen .cam-controls { position: absolute; top: 56px; right: 0; bottom: 0; width: min(340px, 42vw); margin: 0;
    display: flex; flex-direction: column; justify-content: flex-end; padding: var(--s2) var(--sa-right) var(--s2) 0;
    background: linear-gradient(90deg, #0000, #00000073 25%, #000000a6); }
  #cameraScreen .cam-controls > * { max-width: none; width: 100%; }
  #cameraScreen .looks { justify-content: flex-start; padding-bottom: var(--s2); }
  #cameraScreen .capture-row { padding: 0 var(--s3); }
  #cameraScreen .vf-note { right: calc(min(340px, 42vw) + var(--s3)); }
  #cameraScreen .cam-top { padding-left: max(var(--gutter), var(--sa-left)); padding-right: max(var(--gutter), var(--sa-right)); }
}

/* The picked tile's check sits top-left, so it never covers the "AI · 2" price at top-right (2026-11-01). */
.tool[aria-pressed="true"] .well::before { left: -6px; right: auto; top: -6px; bottom: auto; }

/* ---------- Pro camera controls (camerapro.js, 2026-11-01) ----------
   Like a Galaxy S26 / iPhone 18 Pro Max camera: lens buttons over the shutter with a zoom dial,
   tap to focus with a sun slider, photo shapes with the area outside the photo dimmed, grid, level. */
#cameraScreen { --cam-gold: #f3c062; }
#cameraScreen .cam-top { display: flex; justify-content: space-between; gap: var(--s1); }
#cameraScreen .cam-top .wordmark { display: none; }
.cam-left { display: flex; align-items: center; gap: 2px; }
.cam-left .spacer { width: 44px; }
.cam-left .spacer[hidden] { display: none; }
.cam-ratio { width: auto; min-width: 44px; padding: 0 6px; color: #fff; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.2px; font-variant-numeric: tabular-nums; }
.cam-quick { position: relative; z-index: 2; display: flex; justify-content: center; gap: var(--s2); padding: 0 var(--gutter) var(--s2); }
.cam-quick[hidden] { display: none; }
.cam-quick button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 18px; background: #0000004d; color: #fff; font-size: 0.8125rem; font-weight: 700;
  box-shadow: inset 0 0 0 1px #ffffff59; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.cam-quick button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.cam-quick button[hidden] { display: none; }
#camMore[aria-expanded="true"] svg { transform: rotate(180deg); }
#camMore svg { transition: transform var(--t-select); }

/* The photo frame: everything outside it is dimmed, like the phones' 3:4 / 1:1 frames. */
.cam-frame { position: absolute; pointer-events: none; z-index: 1; }
.cam-frame.masked { box-shadow: 0 0 0 100vmax #000000b8; }
#cameraScreen .viewfinder #camCanvas { will-change: transform; }
.cam-grid { position: absolute; inset: 0; }
.cam-grid[hidden], .cam-level[hidden] { display: none; }
.cam-grid i { position: absolute; background: #ffffff66; box-shadow: 0 0 1px #0006; }
.cam-grid i:nth-child(1), .cam-grid i:nth-child(2) { top: 0; bottom: 0; width: 1px; }
.cam-grid i:nth-child(1) { left: 33.333%; } .cam-grid i:nth-child(2) { left: 66.667%; }
.cam-grid i:nth-child(3), .cam-grid i:nth-child(4) { left: 0; right: 0; height: 1px; }
.cam-grid i:nth-child(3) { top: 33.333%; } .cam-grid i:nth-child(4) { top: 66.667%; }
/* Level: two short fixed marks and a centre line that stays level with the world; all gold when straight. */
.cam-level { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.cam-level i { position: absolute; left: 0; top: -1px; height: 2px; border-radius: 1px; background: #fff; box-shadow: 0 0 2px #0008; transform-origin: 0 50%; transition: background 0.15s; }
.cam-level .lv-l { width: 28px; transform: rotate(var(--lvl-base, 0deg)) translateX(-90px); }
.cam-level .lv-r { width: 28px; transform: rotate(var(--lvl-base, 0deg)) translateX(62px); }
.cam-level .lv-c { width: 100px; transform: rotate(var(--lvl, 0deg)) translateX(-50px); }
.cam-level.ok i { background: var(--cam-gold); }
.cam-level.ok .lv-c { transform: rotate(var(--lvl-base, 0deg)) translateX(-50px); }
.cam-level.flat { visibility: hidden; }

/* Tap to focus: a gold square, a sun slider beside it, and a lock. */
.cam-focus { position: absolute; z-index: 2; width: 0; height: 0; pointer-events: none; transition: opacity 0.4s; }
.cam-focus[hidden] { display: none; }
.cam-focus.dim { opacity: 0.45; }
.cf-box { position: absolute; left: -36px; top: -36px; width: 72px; height: 72px; border: 1.5px solid var(--cam-gold); border-radius: 4px; box-shadow: 0 0 2px #0006; }
.cam-focus.pop .cf-box { animation: cfpop 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes cfpop { from { transform: scale(1.45); opacity: 0.2; } to { transform: scale(1); opacity: 1; } }
.cf-sun { position: absolute; left: 44px; top: -44px; width: 20px; height: 88px; }
.cf-track { position: absolute; left: 9px; top: 0; bottom: 0; width: 1.5px; background: var(--cam-gold); opacity: 0; transition: opacity 0.2s; }
.cam-focus.ev-set .cf-track, .cam-focus:not(.dim) .cf-track { opacity: 0.6; }
.cf-knob { position: absolute; left: 0; top: 34px; width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle, var(--cam-gold) 0 4px, transparent 4.5px), conic-gradient(from 0deg, var(--cam-gold) 0 8deg, transparent 8deg 45deg, var(--cam-gold) 45deg 53deg, transparent 53deg 90deg, var(--cam-gold) 90deg 98deg, transparent 98deg 135deg, var(--cam-gold) 135deg 143deg, transparent 143deg 180deg, var(--cam-gold) 180deg 188deg, transparent 188deg 225deg, var(--cam-gold) 225deg 233deg, transparent 233deg 270deg, var(--cam-gold) 270deg 278deg, transparent 278deg 315deg, var(--cam-gold) 315deg 323deg, transparent 323deg);
  -webkit-mask: radial-gradient(circle, #000 0 4.5px, transparent 5px 6.5px, #000 7px 10px, transparent 10.5px); mask: radial-gradient(circle, #000 0 4.5px, transparent 5px 6.5px, #000 7px 10px, transparent 10.5px); }
.cf-sun b { position: absolute; left: 24px; top: 36px; color: var(--cam-gold); font-size: 0.75rem; font-weight: 700; text-shadow: 0 1px 2px #000a; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cf-lock { position: absolute; left: -22px; top: 42px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: #fff; display: grid; place-items: center; pointer-events: auto; }
.cf-lock svg { width: 18px; height: 18px; filter: drop-shadow(0 1px 2px #000a); }
.cf-lock[aria-pressed="true"] { color: var(--cam-gold); }
.cf-lock[hidden] { display: none; }
.cam-locked { position: absolute; left: 50%; translate: -50% 0; z-index: 2; background: var(--cam-gold) !important; color: #15140f !important; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; font-size: 0.6875rem; }

/* Lens buttons and the zoom dial, just above the looks and the shutter. */
.cam-zoom { position: relative; display: flex; justify-content: center; padding: 0 0 var(--s2); touch-action: none; user-select: none; -webkit-user-select: none; }
.cam-zoom[hidden] { display: none; }
#cameraScreen.adjusting .cam-zoom { display: none; }
.cam-lenses { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 22px; background: #00000059; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.cam-lenses button { min-width: 38px; height: 38px; padding: 0 4px; border: 0; border-radius: 19px; background: none; color: #fff; font-size: 0.75rem; font-weight: 700;
  font-variant-numeric: tabular-nums; rotate: var(--cam-rot, 0deg); transition: rotate 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), background var(--t-select), color var(--t-select); }
.cam-lenses button.on { min-width: 44px; background: #ffffff1f; color: var(--cam-gold); font-size: 0.8125rem; }
.cam-zoom.dialing .cam-lenses { opacity: 0; }
.cam-dial { position: absolute; left: 0; right: 0; bottom: var(--s2); height: 62px; overflow: hidden; pointer-events: none;
  -webkit-mask: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent); mask: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent); }
.cam-dial[hidden] { display: none; }
.cam-dial::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 2px; height: 26px; margin-left: -1px; border-radius: 1px; background: var(--cam-gold); }
.cam-dial-track { position: absolute; left: 50%; bottom: 0; height: 100%; will-change: transform; }
.cam-dial-track i { position: absolute; bottom: 0; width: 1px; height: 10px; background: #ffffffa6; }
.cam-dial-track i.mj { height: 18px; width: 1.5px; background: #fff; }
.cam-dial-track b { position: absolute; bottom: 22px; left: 0; translate: -50% 0; color: #fff; font-size: 0.6875rem; font-weight: 700; text-shadow: 0 1px 2px #000a; }
.cam-dial-val { position: absolute; left: 50%; top: 0; translate: -50% 0; padding: 2px 8px; border-radius: 10px; background: #0000008c; color: var(--cam-gold); font-size: 0.8125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
#camRatio, #camMore { rotate: var(--cam-rot, 0deg); transition: rotate 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
@media (prefers-reduced-motion: reduce) { .cam-lenses button, #camRatio, #camMore { transition: none; } .cam-focus.pop .cf-box { animation: none; } }
/* ---------- Camera controls, Golden Hour polish (2026-11-01) ----------
   Like the iPhone and Galaxy cameras and BeautyPlus/Meitu: Adjust swaps the Looks row for the
   settings row (Done on its left), so there are two rows over the picture, not three. Whatever is
   chosen is lit gold, sliders fill in gold, ↺ shows only once a setting has changed, and chip rows
   fade at their edges instead of cutting a chip in half. The camera is always dark, so --rose is gold here. */
#cameraScreen.adjusting #camLooks { display: none; }
#cameraScreen .adjust-panel { display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 0 var(--gutter); margin: 0 0 var(--s2); }
#cameraScreen .adjust-panel > * { min-width: 0; }
#cameraScreen .adj-bar { order: 9; display: flex; align-items: center; gap: var(--s2); min-height: 44px; margin: 2px calc(-1 * var(--gutter)) 0; padding-left: var(--gutter); }
#cameraScreen .adj-bar .adj-chips { flex: 1; min-width: 0; margin: 0; padding: 0 var(--gutter) 0 0; align-items: center; }
.adj-done { flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: #000000a6; color: var(--rose); box-shadow: inset 0 0 0 1.5px var(--rose); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.adj-done svg { width: 20px; height: 20px; stroke-width: 2.25; }
.adj-chips .adj-save { flex: none; min-height: 34px; padding: 0 12px; border: 0; border-radius: 17px; background: transparent; color: var(--rose);
  box-shadow: inset 0 0 0 1px var(--rose); font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.adj-chips .adj-save[hidden] { display: none; }
/* Chosen: a gold-lit chip. A Look (the main choice) is solid gold; a setting or filter is gold on glass. */
#cameraScreen .look[aria-pressed="true"]:not(.adjust):not(.add) { background: var(--cta); color: var(--cta-fg); box-shadow: 0 0 0 1px rgb(255 217 138 / 0.35), 0 6px 18px -8px rgb(243 181 74 / 0.7); }
#cameraScreen .adj-chips button[aria-checked="true"], #cameraScreen #camFilters .look[aria-pressed="true"] {
  background: linear-gradient(rgb(243 192 98 / 0.24), rgb(243 192 98 / 0.24)), #000000a6; color: #ffe3a3; box-shadow: inset 0 0 0 1.5px var(--rose); }
#cameraScreen .look.add { color: var(--rose); box-shadow: inset 0 0 0 1px var(--rose); }
/* Filters: the same compact chips as the settings row, edge to edge. */
#cameraScreen #camFilters { margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 2px !important; gap: 6px; justify-content: flex-start !important; }
#cameraScreen #camFilters .look { min-height: 36px; padding: 0 14px; border-radius: 18px; font-size: 0.875rem; }
#cameraScreen #adjFilter { gap: 2px; }
/* Makeup: shades sit above their slider, so the slider is always the row just above the settings. */
#cameraScreen #adjMakeup { display: flex; flex-direction: column; gap: 2px; }
#cameraScreen #adjMakeup[hidden] { display: none; }
#cameraScreen #swMakeup { order: -1; padding: 2px 0; }
/* Slider row: track, value, then room for ↺ so the two never touch. */
#cameraScreen .adjust-panel .slider { grid-template-columns: 0 1fr 2.25rem; padding-right: 48px; margin-left: calc(-1 * var(--s2)); }
#cameraScreen .adjust-panel .slider output { font-weight: 600; text-align: right; }
#cameraScreen .adj-reset1 { position: absolute; right: var(--gutter); bottom: 48px; width: 36px; height: 36px; grid-column: auto; grid-row: auto;
  border: 0; border-radius: 50%; padding: 0; display: grid; place-items: center; background: #000000a6; color: #fff;
  transition: opacity var(--t-select, 0.15s), transform var(--t-select, 0.15s); }
#cameraScreen .adj-reset1.off { opacity: 0; transform: scale(0.8); pointer-events: none; }
/* Gold slider: the track fills to the value (--p, set by paintRange), the thumb is gold. */
#cameraScreen .adjust-panel input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--rose) var(--p, 0%), #ffffff59 var(--p, 0%)); }
#cameraScreen .adjust-panel input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: #ffffff59; }
#cameraScreen .adjust-panel input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--rose); }
#cameraScreen .adjust-panel input[type="range"]::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -10px; border: 0;
  background: radial-gradient(circle at 50% 35%, #ffe9b8, #f3c062 70%); box-shadow: 0 0 0 1px #0000004d, 0 2px 8px #00000080; }
#cameraScreen .adjust-panel input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border: 0; background: #f3c062; box-shadow: 0 0 0 1px #0000004d, 0 2px 8px #00000080; }
#cameraScreen .adjust-panel input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
/* Rows that scroll sideways fade out at their edges, so a cut-off chip reads as "more this way". */
#cameraScreen #camLooks, #cameraScreen .adj-bar .adj-chips, #cameraScreen #camFilters {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 28px), transparent); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { #cameraScreen #camLooks, #cameraScreen .adj-chips, #cameraScreen #camFilters { scroll-behavior: auto; } }
/* Inside a faded row, a blurred chip loses its glass in Chromium, so these chips use a plain see-through tint. */
#cameraScreen #camLooks .look:not([aria-pressed="true"]):not(.adjust):not(.add), #cameraScreen .adj-chips button:not([aria-checked="true"]):not(.adj-reset-all):not(.adj-save),
#cameraScreen #camFilters .look:not([aria-pressed="true"]) { background: #00000061; box-shadow: inset 0 0 0 1px #ffffff24; -webkit-backdrop-filter: none; backdrop-filter: none; }

/* ---------- Camera held sideways (web), 2026-11-01 redesign ----------
   Like the iPhone and Galaxy cameras turned sideways: a slim rail on the right edge holds the
   shutter (centred), the camera flip above it and the gallery below it, and the Looks / Adjust rows
   run along the bottom of the picture to the left of the rail, over a soft fade. The picture stays
   open edge to edge instead of losing its right 40% to a panel. */
@media (max-width: 959px) and (min-width: 560px) and (max-height: 560px) and (orientation: landscape) {
  #cameraScreen { --rail: calc(104px + var(--sa-right)); }
  #cameraScreen .cam-top { position: relative; z-index: 3; }
  #cameraScreen .cam-controls { position: absolute; inset: 0; width: auto; margin: 0; padding: 0; display: block; pointer-events: none;
    background: linear-gradient(90deg, #0000 calc(100% - var(--rail) - 72px), #00000066 calc(100% - var(--rail)), #0000008c), linear-gradient(#0000 45%, #00000040 65%, #00000099); }
  #cameraScreen:has(#liveControls[hidden]) .cam-controls, #cameraScreen .cam-controls:has(#reviewControls:not([hidden])) { background: none; }
  #cameraScreen .cam-controls > * { max-width: none; width: auto; margin: 0; }
  #cameraScreen #liveControls > *, #cameraScreen .review-row, #cameraScreen .vf-ai { pointer-events: auto; }
  /* The rail */
  #cameraScreen .capture-row { position: absolute; top: 0; right: 0; bottom: 0; width: var(--rail); box-sizing: border-box; padding: 60px var(--sa-right) var(--s3) 0;
    display: flex; flex-direction: column-reverse; align-items: center; justify-content: space-evenly; gap: var(--s2); }
  #cameraScreen .capture-row > * { justify-self: auto; }
  #cameraScreen .capture-row #camFlip[hidden] { display: grid; visibility: hidden; }
  #cameraScreen .capture-row .round-btn { width: 46px; height: 46px; }
  #cameraScreen .shutter { width: 76px; height: 76px; flex: none; }
  #cameraScreen .shutter::before { width: 62px; height: 62px; }
  /* The rows along the bottom, left of the rail */
  #cameraScreen #camLooks, #cameraScreen .adjust-panel { position: absolute; left: var(--sa-left); right: var(--rail); bottom: 0; margin: 0;
    padding-bottom: var(--s2); }
  #cameraScreen #camLooks { justify-content: flex-start; }
  #cameraScreen #camLooks .look { min-height: 40px; }
  #cameraScreen .adjust-panel { padding: 0 max(var(--gutter), var(--sa-left)) var(--s2); }
  #cameraScreen .adjust-panel .slider { max-width: 460px; }
  #cameraScreen .adj-reset1 { bottom: calc(48px + var(--s2)); right: auto; left: min(calc(100% - var(--gutter) - 36px), calc(var(--gutter) + 460px - 40px)); }
  /* After the shot: Retake / Edit / Save and AI Enhance along the bottom, full width. */
  #cameraScreen .review-row { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--s2) max(var(--gutter), var(--sa-right)) var(--s3) max(var(--gutter), var(--sa-left));
    background: linear-gradient(#0000, #0000009e); grid-template-columns: auto minmax(0, 200px) minmax(0, 200px); justify-content: center; }
  #cameraScreen .vf-ai { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); width: auto; padding: 0 var(--s5); margin: 0 !important; }
  #cameraScreen .vf-note { right: calc(var(--rail) + var(--s3)); }
  /* The lens pill floats just above the Looks row, centred on the picture (not the rail). */
  #cameraScreen #camZoom { position: absolute; left: 0; right: var(--rail); bottom: 60px; padding: 0; }
}

/* Hide controls (setCamMin): a small chevron folds the lens pill and the Looks / Adjust rows away,
   so the picture shows full screen with only the shutter row; the chevron brings them back. */
#cameraScreen #liveControls { position: relative; }
.cam-hide { position: absolute; right: var(--gutter); top: -44px; z-index: 1; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: #00000061; color: #fff; box-shadow: inset 0 0 0 1px #ffffff2e; }
.cam-hide svg { width: 20px; height: 20px; stroke-width: 2.25; }
.cam-hide[aria-pressed="true"] { color: var(--rose); box-shadow: inset 0 0 0 1.5px var(--rose); background: #000000a6; }
#cameraScreen.cam-min #camZoom, #cameraScreen.cam-min #camLooks, #cameraScreen.cam-min #adjustPanel { display: none !important; }
#cameraScreen.cam-min .cam-controls { background: linear-gradient(#0000 60%, #00000066); padding-top: 52px; }
/* Over the photo after a shot there's nothing to fold. */
#cameraScreen #liveControls[hidden] .cam-hide { display: none; }
@media (max-width: 959px) and (min-width: 560px) and (max-height: 560px) and (orientation: landscape) {
  #cameraScreen #liveControls { position: static; }
  .cam-hide { top: 64px; right: calc(var(--rail) + var(--s2)); }
  #cameraScreen.cam-min .cam-controls { background: linear-gradient(90deg, #0000 calc(100% - var(--rail) - 40px), #0000008c); padding-top: 0; }
}

/* After the shot (2026-11-01, user's Android screenshot): the tab bar is hidden there, so the buttons
   now keep clear of the phone's own navigation bar (--sa-bottom), and the row lines up with the
   AI Enhance bar above it: same side margins, three equal buttons, one height. Save is the gold
   main action; Saved turns to a quiet gold tick instead of a washed-out white button. */
#cameraScreen.reviewing .cam-controls { padding-bottom: calc(var(--s3) + var(--sa-bottom)); }
#cameraScreen .review-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); max-width: 560px; }
#cameraScreen .review-row .btn { min-height: 52px; padding: 0 var(--s2); gap: 6px; font-size: 0.9375rem; border-radius: 26px; }
#cameraScreen .review-row .btn svg { width: 20px; height: 20px; flex: none; }
#cameraScreen #retakeBtn { background: #00000061; color: #fff; box-shadow: inset 0 0 0 1px #ffffff59; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
#cameraScreen #editShotBtn { background: #000000b3; color: #fff; box-shadow: inset 0 0 0 1px #ffffff1f; }
#cameraScreen #saveShotBtn { background: var(--cta); color: var(--cta-fg); box-shadow: 0 0 0 1px rgb(255 217 138 / 0.35); }
#cameraScreen #saveShotBtn:disabled { opacity: 1; background: #000000b3; color: var(--rose); box-shadow: inset 0 0 0 1.5px var(--rose); }
#cameraScreen .vf-ai { max-width: 560px; border-radius: 26px; min-height: 52px; }
@media (max-width: 959px) and (min-width: 560px) and (max-height: 560px) and (orientation: landscape) {
  #cameraScreen.reviewing .cam-controls { padding-bottom: 0; }
  #cameraScreen .review-row { max-width: none; padding-bottom: calc(var(--s3) + var(--sa-bottom)); grid-template-columns: repeat(3, minmax(0, 180px)); }
  #cameraScreen .vf-ai { bottom: calc(84px + var(--sa-bottom)); }
}

/* Your messages: support conversations with replies from Glow Studio. */
.count-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--cta); color: var(--cta-fg); font-size: 0.75rem; font-weight: 700; display: inline-grid; place-items: center; }
.count-badge[hidden] { display: none; }
.set-list a:has(.count-badge:not([hidden]))::after { margin-left: var(--s2); }
.icon-btn.has-dot { position: relative; }
.icon-btn.has-dot::after { content: ""; position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--rose); box-shadow: 0 0 0 2px var(--bg); }
.msgs { display: grid; gap: var(--s3); }
.msgs .convo { border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); padding: var(--s3); }
.msgs .convo summary { list-style: none; cursor: pointer; display: flex; gap: var(--s2); align-items: center; font-weight: 600; }
.msgs .convo summary::-webkit-details-marker { display: none; }
.msgs .convo summary { align-items: flex-start; }
.msgs .convo-head { display: grid; gap: 2px; min-width: 0; }
.msgs .convo-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgs .convo-sub { font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.msgs .convo summary .st { margin-left: auto; flex: none; font-size: 0.75rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface); color: var(--muted); white-space: nowrap; }
.msgs .convo summary .st.new { color: var(--cta-fg); background: var(--cta); }
.msgs .convo summary .st.done { color: var(--text); }
.msgs .bubbles { display: grid; gap: var(--s2); margin-top: var(--s3); }
.msgs .b { max-width: 88%; padding: 10px 12px; border-radius: 14px; background: var(--surface); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.9375rem; }
.msgs .b.support { justify-self: start; border: 1px solid rgb(243 192 98 / 0.35); }
.msgs .b.you { justify-self: end; background: var(--tint); }
.msgs .b small { display: block; color: var(--muted); font-size: 0.75rem; margin-bottom: 2px; font-weight: 600; }
.msgs textarea { width: 100%; box-sizing: border-box; min-height: 48px; max-height: 200px; resize: none; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; margin-top: var(--s3); }
.msgs .acts { display: flex; gap: var(--s2); justify-content: flex-end; align-items: center; margin-top: var(--s2); flex-wrap: wrap; }
.msgs .acts .btn.small { padding: 0 22px; }
.msgs .acts .shot-add { padding: 0 4px; font-size: 0.875rem; }
.msgs-foot { display: flex; align-items: center; gap: var(--s3); justify-content: space-between; flex-wrap: wrap; padding: 0 var(--s1); }
.msgs-foot .fine { margin: 0; color: var(--muted); font-size: 0.8125rem; flex: 1 1 180px; }
.msgs-foot .btn.small { padding: 0 18px; }
.msgs .rate { display: flex; gap: var(--s2); align-items: center; margin-top: var(--s3); color: var(--muted); font-size: 0.875rem; flex-wrap: wrap; }
.msgs .rate button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--text); font: inherit; cursor: pointer; }
.msgs .empty { color: var(--muted); }
/* Screenshots on a support message. */
.shots { display: grid; gap: var(--s2); }
.shot-row { display: flex; gap: var(--s2); flex-wrap: wrap; }
.shot-row:empty { display: none; }
.shot { position: relative; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot-x { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgb(0 0 0 / 0.6); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.shot-add { display: inline-flex; align-items: center; gap: 6px; justify-self: start; min-height: 40px; }
.shot-add[hidden] { display: none; }
.shot-add svg { width: 20px; height: 20px; }
.msgs .acts .shots { margin-right: auto; }
.msgs .b-shots { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.msgs .b-shots img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; display: block; }

/* "Support replied" card, above the tab bar on the home screens. */
.reply-card { position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--sa-bottom)); z-index: 40; max-width: 520px; margin: 0 auto;
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 4px 10px; padding: 12px 8px 12px 14px;
  background: #18181c; border: 1px solid rgb(243 192 98 / 0.4); border-radius: 18px; box-shadow: 0 12px 32px rgb(0 0 0 / 0.5);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--text);
  opacity: 0; transform: translateY(16px); transition: opacity .25s ease, transform .25s ease; }
.reply-card.over-nav { bottom: calc(var(--nav-h) + var(--sa-bottom) + 10px); }
.reply-card.on { opacity: 1; transform: none; }
.reply-card[hidden] { display: none; }
.reply-card .reply-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgb(243 192 98 / 0.16); color: rgb(243 192 98); }
.reply-card .reply-ic svg { width: 20px; height: 20px; }
.reply-card .reply-body { all: unset; cursor: pointer; display: grid; gap: 2px; min-width: 0; }
.reply-card .reply-body strong { font-size: 0.9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-card .reply-body span { font-size: 0.8125rem; line-height: 1.35; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.reply-card .reply-go { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--cta); color: var(--cta-fg); font: inherit; font-weight: 700; font-size: 0.875rem; cursor: pointer; }
.reply-card .reply-x { width: 36px; height: 36px; border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; border-radius: 50%; }
@media (prefers-reduced-motion: reduce) { .reply-card { transition: none; } }

/* 2026-11-02 missing controls: any-color chip (Color background) and the crop's flip chips. */
.opt.color-well { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.opt.color-well i { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.2); }
.opt.color-well input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.crop-flips { margin-top: 4px; }
#settings .setting select { min-height: 36px; max-width: 55%; padding: 0 var(--s2); border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2, transparent); color: inherit; font: inherit; font-size: 0.875rem; }

/* Honest billing: the free trial's timeline on the Pro screen, and credit history. */
.pw-timeline { list-style: none; margin: 0 0 var(--s3, 12px); padding: 0; display: grid; gap: 10px; position: relative; }
.pw-timeline li { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: baseline; font-size: 0.875rem; }
.pw-timeline b { color: var(--cta, #f3c062); font-weight: 600; }
.pw-timeline span { color: var(--ink-2, inherit); opacity: 0.85; }
.cr-history { margin-top: 16px; }
.cr-history h3 { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.6; margin: 14px 0 6px; font-weight: 600; }
.cr-history ul { list-style: none; margin: 0; padding: 0; }
.cr-history li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line, rgba(255,255,255,0.08)); font-size: 0.875rem; }
.cr-history li small { display: block; opacity: 0.6; font-size: 0.75rem; }
.cr-history .amt { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.cr-history .amt.plus { color: var(--ok, #7fd49b); }

/* Settings > Our promises */
.promises { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.promises li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 0.875rem; line-height: 1.4; }
.promises li > span:first-child svg { width: 18px; height: 18px; color: var(--cta, #f3c062); margin-top: 1px; }
.promises b { font-weight: 600; }

/* ---------- Studio (2026-11-02): Trends, Headshot pack, Try-on grid, Old photo, Group fix, Motion, Me ---------- */
.studio-wrap { margin: var(--s5) 0 var(--s3); }
.studio-wrap-h { font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s2); font-weight: 600; }
.studio-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 148px; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; scrollbar-width: none; }
.studio-strip::-webkit-scrollbar { display: none; }
.studio-card { scroll-snap-align: start; position: relative; display: grid; align-content: start; gap: 4px; text-align: left; padding: 14px; min-height: 132px;
  border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); color: var(--text); font: inherit; cursor: pointer; }
.studio-card b { font-size: 0.9375rem; font-weight: 600; }
.studio-card small { font-size: 0.75rem; color: var(--muted); line-height: 1.35; }
.studio-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--blush); color: var(--rose); margin-bottom: 4px; }
.studio-ic svg { width: 20px; height: 20px; }
.studio-new { justify-self: start; margin-top: 6px; max-width: 100%; font-size: 0.625rem; font-weight: 700; padding: 3px 7px; border-radius: 99px; background: var(--champagne); color: var(--cta-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
dialog.studio, dialog.studio-view { width: 100%; max-width: 640px; height: 100%; max-height: 100%; margin: 0 auto; padding: 0; border: 0; background: var(--bg); color: var(--text);
  display: none; flex-direction: column; }
dialog.studio[open], dialog.studio-view[open] { display: flex; }
dialog.studio::backdrop, dialog.studio-view::backdrop { background: var(--scrim); }
.studio-head { display: flex; gap: var(--s3); align-items: center; padding: calc(var(--sa-top, 0px) + 10px) var(--gutter) 10px; }
.studio-head p { margin: 2px 0 0; }
.studio-body { flex: 1; overflow-y: auto; padding: 0 var(--gutter) var(--s4); }
.studio-foot { padding: var(--s3) var(--gutter) calc(var(--sa-bottom, 0px) + var(--s3)); display: grid; gap: var(--s2); border-top: 1px solid var(--line); background: var(--bg); }
.studio-foot .btn { width: 100%; }
.studio-pics { display: flex; gap: 10px; flex-wrap: wrap; margin: var(--s2) 0 var(--s4); }
.studio-slot { position: relative; width: 104px; height: 132px; border-radius: var(--r-well); border: 1.5px dashed var(--control); background: var(--surface); color: var(--muted);
  display: grid; place-items: center; align-content: center; gap: 6px; padding: 8px; font: inherit; font-size: 0.75rem; text-align: center; overflow: hidden; cursor: pointer; }
.studio-slot svg { width: 22px; height: 22px; }
.studio-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.studio-slot:has(img) { border-style: solid; border-color: var(--line); }
.studio-slot:has(img) > span { position: absolute; bottom: 6px; left: 6px; right: 6px; padding: 3px; border-radius: 99px; background: var(--glass); color: var(--text); font-weight: 600; }
.studio-slot.filled { border-style: solid; }
.studio-x { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; min-height: 0; background: var(--glass); }
.studio-scan { align-self: center; }
.studio-scan svg { width: 18px; height: 18px; }
.studio-h { font-size: 0.875rem; font-weight: 600; margin: var(--s4) 0 var(--s2); display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.studio-h small { font-weight: 400; color: var(--muted); font-size: 0.75rem; }
.studio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
.studio-pick { position: relative; display: grid; gap: 3px; align-content: start; text-align: left; padding: 12px 12px 30px; min-height: 108px; border-radius: var(--r-well);
  background: var(--surface); border: 1.5px solid var(--line); color: var(--text); font: inherit; cursor: pointer; }
.studio-pick b { font-size: 0.875rem; font-weight: 600; }
.studio-pick small { font-size: 0.75rem; color: var(--muted); line-height: 1.3; }
.studio-pick[aria-pressed="true"], .studio-pick[aria-checked="true"] { border-color: var(--rose); box-shadow: inset 0 0 0 1px var(--rose); }
.studio-pick .studio-ic { width: 30px; height: 30px; border-radius: 10px; }
.studio-badge { position: absolute; top: 10px; right: 10px; font-size: 0.625rem; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--champagne); color: var(--cta-fg); }
.studio-cost { position: absolute; bottom: 10px; right: 10px; display: inline-flex; gap: 2px; align-items: center; font-size: 0.75rem; color: var(--muted); }
.studio-cost svg { width: 12px; height: 12px; }
.studio-row { display: flex; gap: var(--s2); flex-wrap: wrap; }
.studio-row .btn { flex: 1 1 140px; }
.studio-note { margin: var(--s3) 0 0; }
.studio-note .link-btn { display: inline; padding: 0; min-height: 0; }
.studio-motions { margin-top: var(--s2); flex-wrap: wrap; }
.studio-toggle { display: flex; justify-content: space-between; align-items: center; margin-top: var(--s4); }
.studio-results { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: var(--s2); }
.studio-results.one { grid-template-columns: 1fr; }
.studio-res { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r-well); overflow: hidden; background: var(--surface); display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; padding: 8px; color: var(--muted); font-size: 0.8125rem; }
.studio-results.one .studio-res { aspect-ratio: auto; min-height: 50vh; }
.studio-res img, .studio-res video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.studio-results.one .studio-res img, .studio-results.one .studio-res video { object-fit: contain; }
.studio-res.done { cursor: pointer; padding: 0; }
.studio-lbl { position: absolute; left: 8px; bottom: 8px; padding: 4px 10px; border-radius: 99px; background: var(--glass); color: var(--text); font-weight: 600; font-size: 0.75rem; }
.studio-warn { position: absolute; left: 8px; top: 8px; padding: 4px 10px; border-radius: 99px; background: var(--danger); color: #1a0d0d; font-weight: 700; font-size: 0.6875rem; }
.studio-fail { color: var(--text); font-weight: 600; }
.studio-view-pic { flex: 1; display: grid; place-items: center; overflow: hidden; padding: 0 var(--gutter); }
.studio-view-pic img, .studio-view-pic video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--r-well); }
dialog.studio-view .studio-row { padding: var(--s3) var(--gutter) calc(var(--sa-bottom, 0px) + var(--s3)); }

/* One-tap Eraser */
.find-distractions { margin-top: var(--s2); width: 100%; }
.find-distractions svg { width: 18px; height: 18px; }

/* Studio: motion description, takes per style */
.studio-field { display: block; margin-top: var(--s3); }
.studio-field input { width: 100%; min-height: 44px; padding: 0 var(--s3); border-radius: var(--r-well); border: 1px solid var(--control); background: var(--surface); color: var(--text); font: inherit; }
.studio-vars { margin-top: var(--s2); }
.studio-pick .studio-sample { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: calc(var(--r-well) - 4px); margin-bottom: var(--s2); background: var(--surface-2); }

/* ---------- Premium editor layout (phones, portrait) ----------
   Like Lightroom, Facetune and VSCO: the controls live in one dock of a fixed height, so the photo
   is the same size while browsing and in every tool. An open tool swaps what is inside the dock
   (its controls scroll inside it) instead of growing it. Photo actions sit in the top bar, never on
   the photo. Option chips scroll sideways, one row per group. */
@media (max-width: 959px) and (min-height: 601px) {
  #editorScreen { --dock: clamp(12.5rem, 26dvh, 14.5rem); }
  /* #app already sits below the status bar, so the toolbar needs no second inset. */
  #editorScreen:not(.viewer-expanded) .viewbar { top: 2px; }
  #editorScreen .side { flex: none; height: calc(var(--dock) + var(--sa-bottom)); max-height: none; min-height: 0; }
  #editorScreen.panel-collapsed .side { height: calc(var(--dock) + var(--sa-bottom)); }
  #editorScreen:not(.editing-tool):not(.tools-open) .side > .tabs { margin-top: auto; }
  #editorScreen:not(.editing-tool) .side > .tools { display: flex; align-items: center; }
  /* The fixed dock makes Hide controls pointless: the photo is already as big as it gets. */
  #editorScreen #collapseBtn { display: none; }
  #editorScreen .side > .panel.collapsed .panel-note, #editorScreen .side > .panel.collapsed .panel-body { display: revert; }
  /* An open tool: title row, its controls (scrolling, faded at the edges), then Cancel ✕ and the action. */
  #editorScreen .side > .panel:not(.live) { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
    margin: 0; padding: 0 var(--gutter) calc(var(--s2) + var(--sa-bottom)); border-radius: 22px 22px 0 0; border-top: 0;
    background: var(--surface); box-shadow: 0 -1px 0 var(--line); }
  #editorScreen .side > .panel:not(.live) .panel-head { flex: none; min-height: 44px; }
  #editorScreen .side > .panel:not(.live) .panel-head h2 { font-size: 1rem; line-height: 1.25rem; font-weight: 650; letter-spacing: 0.01em; }
  #editorScreen .side > .panel:not(.live) .panel-note { flex: none; }
  #editorScreen .side > .panel:not(.live) .panel-body { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior: contain;
    align-content: start; grid-auto-rows: max-content; padding: 2px 0 var(--s2); scrollbar-width: none;
    -webkit-mask-image: linear-gradient(transparent 0, #000 6px, #000 calc(100% - 14px), transparent);
    mask-image: linear-gradient(transparent 0, #000 6px, #000 calc(100% - 14px), transparent); }
  #editorScreen .side > .panel:not(.live) .panel-body::-webkit-scrollbar { display: none; }
  #editorScreen .side > .panel:not(.live) .panel-actions { flex: none; margin-top: 0; padding-top: var(--s1); grid-template-columns: 44px 1fr; gap: var(--s3); align-items: center; }
  #editorScreen .side > .panel:not(.live) #cancelBtn { position: relative; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%;
    font-size: 0; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); background: transparent; }
  #editorScreen .side > .panel:not(.live) #cancelBtn::before { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / contain no-repeat; }
  #editorScreen .side > .panel:not(.live) #applyBtn { min-height: 44px; border-radius: 22px; font-size: 0.9375rem; font-weight: 700; background: var(--cta); color: var(--cta-fg); box-shadow: var(--cta-glow); }
  #editorScreen .side > .panel:not(.live) #applyBtn:disabled { background: var(--surface-2); color: var(--muted); box-shadow: none; opacity: 1; }
  /* The tool row steps aside while a tool's own controls need the room (see fitDock). */
  #editorScreen.editing-tool:has(.panel:not(.live):not([hidden])) .side > .tools { border-top: 0; }
  /* Glow Up: each group is one row (name, then chips that scroll sideways), not a wall of chips. */
  #editorScreen .panel-body .glow-group { grid-template-columns: minmax(3rem, max-content) minmax(0, 1fr); align-items: center; gap: var(--s2); }
  #editorScreen .panel-body .glow-label { font-size: 0.6875rem; line-height: 0.875rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
  #editorScreen .panel-body .glow-opts { flex-wrap: nowrap; overflow-x: auto; margin-right: calc(-1 * var(--gutter)); padding-right: var(--gutter);
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  #editorScreen .panel-body:has(.glow-group) { gap: 2px; }
}
/* Option chips in the editor: a 36px pill drawn inside a 44px touch target, quiet until chosen,
   then outlined and lettered in gold (Golden Hour). */
#editorScreen .panel .opt { border: 4px solid transparent; background-clip: padding-box; border-radius: 22px; padding: 0 12px; font-size: 0.8125rem; font-weight: 600;
  background-color: var(--surface-2); color: var(--text); }
#editorScreen .panel .opt[aria-pressed="true"] { background-color: color-mix(in srgb, var(--rose) 16%, var(--surface)); color: var(--rose); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rose) 70%, transparent); }
#editorScreen .panel .opt.check::before { width: 12px; height: 12px; }
/* Badges on the photo: small dark glass, so they read as labels and not as buttons fighting the toolbar. */
#editorScreen .sample-badge { min-height: 28px; padding: 0 10px; gap: 5px; border-radius: 14px; font-size: 0.75rem; font-weight: 600;
  background: rgb(14 14 16 / 0.5); color: #fff; -webkit-backdrop-filter: blur(12px) saturate(1.3); backdrop-filter: blur(12px) saturate(1.3); }
#editorScreen .sample-badge svg { color: #f3c062; width: 13px; height: 13px; }
#editorScreen .frame .tag { min-height: 24px; display: inline-flex; align-items: center; border-radius: 12px; padding: 0 9px; font-size: 0.6875rem; letter-spacing: 0.02em;
  background: rgb(14 14 16 / 0.5); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
#editorScreen .frame .tag:empty { display: none; }
#editorScreen .viewer-toggle { color: #fff; }
#editorScreen .viewer-toggle::before { inset: 8px; background: rgb(14 14 16 / 0.45); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
#editorScreen .viewer-toggle svg { width: 16px; height: 16px; }
/* The grip: shown when a tool's controls don't fit the dock. It lifts the panel over the lower part
   of the photo; the photo keeps its size and place underneath, and the grip puts it back. */
.dock-grip { display: none; }
@media (max-width: 959px) and (min-height: 601px) {
  #editorScreen .side > .panel:not(.live) { position: relative; }
  #editorScreen .dock-grip:not([hidden]) { display: grid; place-items: center; flex: none; width: 64px; height: 22px; margin: 0 auto -6px; padding: 0; border: 0; background: none; touch-action: none; position: relative; }
  #editorScreen .dock-grip::after { content: ""; position: absolute; inset: -11px -20px -4px; }   /* 44px touch target */
  #editorScreen .dock-grip i { width: 36px; height: 4px; border-radius: 2px; background: var(--control); opacity: 0.7; transition: transform var(--t-select); }
  #editorScreen.sheet-up .dock-grip i { background: var(--rose); opacity: 1; }
  #editorScreen.sheet-up .canvas-col { margin-bottom: calc(var(--dock) + var(--sa-bottom)); }
  #editorScreen.sheet-up .side { position: absolute; left: 0; right: 0; bottom: 0; z-index: 8; height: auto; min-height: calc(var(--dock) + var(--sa-bottom)); max-height: calc(min(66dvh, var(--dock) + 280px) + var(--sa-bottom)); }
  #editorScreen.sheet-up .side > .panel:not(.live) { flex: 1 1 auto; }
  #editorScreen.sheet-up .side > .panel:not(.live) { box-shadow: 0 -12px 40px rgb(0 0 0 / 0.35), 0 -1px 0 var(--line);
    background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2); }
  #editorScreen.sheet-up .side > .tools, #editorScreen.sheet-up .side > .subchips, #editorScreen.sheet-up .side > .tabs { display: none; }
  @media (prefers-reduced-motion: no-preference) { #editorScreen.sheet-up .side > .panel { animation: sheet-rise 220ms cubic-bezier(.2, .8, .2, 1); } }
}
@keyframes sheet-rise { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
/* A one-row tool keeps the tool row above it: the title row steps aside (the chosen tile carries
   the name, the action button the price), and the star sits at the end of the action row. */
@media (max-width: 959px) and (min-height: 601px) {
  #editorScreen.dock-compact .side > .panel:not(.live) .panel-head { display: contents; }
  #editorScreen.dock-compact .side > .panel:not(.live) .panel-head > *,
  #editorScreen.dock-compact .side > .panel:not(.live) .panel-note { display: none; }
  #editorScreen.dock-compact .side > .panel:not(.live) #favBtn { display: none; }
  #editorScreen.dock-compact .side > .panel:not(.live) .panel-body { padding: 0; -webkit-mask-image: none; mask-image: none; }
  #editorScreen.dock-compact .side > .panel:not(.live) { padding-top: var(--s1); border-radius: 0; box-shadow: none; background: transparent; }
}
/* A running or finished AI job: a glass card just above the dock, over the photo's lower edge, so
   the dock keeps its height and nothing inside it is cut off. Full view puts the photo first. */
@media (max-width: 959px) and (min-height: 601px) {
  #editorScreen .side { position: relative; overflow: visible; }
  #editorScreen .side > .jobbar { position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(100% + var(--s2)); z-index: 9; margin: 0;
    padding: var(--s2) var(--s3); border-radius: 18px; background: color-mix(in srgb, var(--surface) 90%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2); box-shadow: 0 8px 28px rgb(0 0 0 / 0.3), inset 0 0 0 1px var(--line); }
  #editorScreen.sheet-up .side > .jobbar { display: none; }
  #editorScreen.viewer-expanded.sheet-up .canvas-col { margin-bottom: 0; }
}
/* Search: the full catalog rises over the photo as a sheet; the photo keeps its size underneath. */
@media (max-width: 959px) and (min-height: 601px) {
  #editorScreen.tools-open:not(.viewer-expanded) .canvas-col { margin-bottom: calc(var(--dock) + var(--sa-bottom)); }
  #editorScreen.tools-open .side { position: absolute; left: 0; right: 0; bottom: 0; z-index: 8; height: min(70dvh, calc(var(--dock) + 320px)); max-height: none;
    border-radius: 22px 22px 0 0; background: color-mix(in srgb, var(--bg) 94%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    box-shadow: 0 -12px 40px rgb(0 0 0 / 0.35), 0 -1px 0 var(--line); padding-top: var(--s2); }
  #editorScreen.tools-open .side > .tools { flex: 1 1 auto; height: auto; min-height: 0; }
}
/* Full / Person / Background on phones: a slim text segmented control (no thumbnails), so the
   labels never clip, even with large system text; the refine pencil sits apart as its own 44px
   glass button. Both hug the photo's bottom edge. */
@media (max-width: 959px) {
  #editorScreen .area-bar { bottom: 6px; left: 6px; right: 6px; }
  #editorScreen .area-bar .areas-wrap { gap: 8px; max-width: 100%; }
  #editorScreen .area-bar .areas { padding: 0 2px; gap: 0; border-radius: 22px; overflow: hidden; background: rgb(14 14 16 / 0.55); box-shadow: 0 4px 16px rgb(0 0 0 / 0.25); }
  #editorScreen .area-bar .area:not(.refine) { flex: 0 1 auto; min-width: 0; min-height: 44px; padding: 0 12px; gap: 0; border: 4px solid transparent; border-left-width: 0; border-right-width: 0;
    background-clip: padding-box; border-radius: 22px; font-size: 0.8125rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #editorScreen .area-bar .area:not(.refine) i { display: none; }
  /* The chosen area is gold text with a short gold line under it, as in Lightroom's mode switches;
     no filled oval. The others are dimmed white. */
  #editorScreen .area-bar .area:not(.refine) { position: relative; background: transparent; color: rgb(255 255 255 / 0.72); font-weight: 500; }
  #editorScreen .area-bar .area[aria-pressed="true"]:not(.refine) { background: transparent; color: #f3c062; font-weight: 700; }
  #editorScreen .area-bar .area[aria-pressed="true"]:not(.refine)::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 14px; height: 2px; margin-left: -7px; border-radius: 1px; background: #f3c062; }
  #editorScreen .area-bar .area.refine { width: 44px; height: 44px; min-height: 44px; border-radius: 22px; color: #fff; background: rgb(14 14 16 / 0.55); }
  #editorScreen .area-bar .area.refine.done { color: #f3c062; }
  /* The tool row fades at its edge, so a tile cut by the screen edge reads as "more this way". */
  #editorScreen .side > .tools { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
}
/* Tab names never run into each other with large system text: a long one shortens with "…". */
.tab > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
/* Long names fit instead of cutting off: tabs share the row by the length of their name, try-on
   ideas wrap to two short lines, and tool names tighten slightly before they shorten with "…". */
#editorScreen .tab { flex: 1 1 auto; }
.try-card span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 0.9375rem; overflow-wrap: anywhere; }
.tool .name { letter-spacing: -0.015em; }
@media (max-width: 959px) { #editorScreen .side > .tools .tool .name { font-size: 0.6875rem; line-height: 1rem; } }
/* ---------- Try on wardrobe (2026-11-02) ----------
   Its own tab; the panel reads like a clothes changer: Outfits / Color / Pattern / Fabric / Part,
   then categories, then a row of outfit pictures starting with None, + Yours and Describe. The dock
   keeps its height, so the photo stays the same size. */
.try-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--s1)); }
.try-tabs::-webkit-scrollbar, .try-cats::-webkit-scrollbar, .try-strip::-webkit-scrollbar { display: none; }
.try-tab { position: relative; flex: 1 0 auto; min-height: 34px; padding: 0 10px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 0.875rem; font-weight: 500; white-space: nowrap; }
.try-tab[aria-selected="true"] { color: var(--rose); font-weight: 700; }
.try-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 16px; height: 2px; margin-left: -8px; border-radius: 1px; background: var(--rose); }
.try-tab.set::before { content: ""; position: absolute; top: 6px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--rose); }
.try-cats { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 1px 0;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
.try-cat { flex: none; min-height: 34px; padding: 0 12px; border: 3px solid transparent; background-clip: padding-box; border-radius: 18px; background-color: transparent;
  color: var(--muted); font: inherit; font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.try-cat[aria-pressed="true"] { background-color: color-mix(in srgb, var(--rose) 18%, var(--surface)); color: var(--rose); }
.try-strip { --tw: 60px; --th: 78px; display: flex; align-items: flex-start; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 6px 2px 5px; margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter);
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
@media (max-height: 800px) { .try-strip { --tw: 58px; --th: 74px; } }
/* A tile is one card, its name inside at the bottom (as in shop apps), so the row stays short. */
.try-tile { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; width: var(--tw); height: var(--th); padding: 3px 3px 0; border: 0; border-radius: 12px;
  background: var(--surface-2); color: var(--muted); font: inherit; text-align: center; }
.try-tile .well { position: relative; flex: 1 1 auto; min-height: 0; width: 100%; display: grid; place-items: center; border-radius: 9px; background: center / cover no-repeat; color: var(--text); }
.try-tile .well > svg { width: 100%; height: 100%; }
.try-tile.outfit { background: #ece7df; color: #4b463e; }
.try-tile.outfit[aria-pressed="true"] .name { color: #15140f; }
.try-tile.add .well { color: var(--rose); }
.try-tile.add .well > svg, .try-tile.none .well > svg { width: 24px; height: 24px; }
.try-tile.none { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.try-tile.none[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px var(--line), 0 0 0 2px var(--surface), 0 0 0 4px var(--rose); }
.try-tile.none .well { color: var(--muted); }
.try-tile.swatch .well > svg { width: 34px; height: 34px; border-radius: 50%; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.12), inset 0 0 0 1px rgb(0 0 0 / 0.15); }
.try-tile.photo .well { background-color: #ece7df; }
.try-tile.locked { opacity: 0.55; }
.try-tile .name { flex: none; display: block; width: 100%; padding: 0 1px; font-size: 0.65625rem; line-height: 1.25rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.try-tile[aria-pressed="true"] .name { color: var(--text); font-weight: 700; }
.try-tile[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--rose); }
.try-tile[aria-pressed="true"]:not(.none):not(.add)::after { content: ""; position: absolute; right: -5px; top: -5px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--rose) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1206' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat;
  box-shadow: 0 0 0 2px var(--surface); }
.try-sep { flex: none; align-self: center; width: 1px; height: 44px; background: var(--line); }
.try-tile .try-remove { position: absolute; top: -8px; left: -8px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgb(0 0 0 / 0.35); }
.try-tile .try-remove svg { width: 12px; height: 12px; }
.try-words { display: block; }
.try-words input { min-height: 40px; background: var(--surface-2); }
.try-hint { margin: 6px 0 0; color: var(--muted); font-size: 0.8125rem; line-height: 1.15rem; }
@media (max-width: 959px) and (min-height: 601px) {
  #editorScreen .side > .panel.try-full:not(.live) .panel-head, #editorScreen .side > .panel.try-full:not(.live) .panel-note { display: none; }
  #editorScreen .side > .panel.try-full:not(.live) { padding-top: 2px; overflow: visible; }
  #editorScreen .side > .panel.try-full:not(.live) .panel-body { gap: 2px; padding-top: 0; padding-bottom: 0; -webkit-mask-image: none; mask-image: none; }
  /* Cancel and Try on float as a glass pill just above the dock, over the photo's lower edge, so
     the wardrobe gets the whole dock and the photo keeps its size. */
  #editorScreen .side > .panel.try-full:not(.live) .panel-actions { position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); z-index: 9;
    width: min(300px, calc(100vw - 2 * var(--gutter))); padding: 5px; border-radius: 28px; grid-template-columns: 44px 1fr; gap: 8px;
    background: rgb(14 14 16 / 0.55); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2); box-shadow: 0 8px 24px rgb(0 0 0 / 0.3); }
  #editorScreen .side > .panel.try-full:not(.live) #cancelBtn { color: #fff; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.25); }
  #editorScreen .side > .panel.try-full:not(.live) #applyBtn:disabled { background: rgb(255 255 255 / 0.14); color: rgb(255 255 255 / 0.7); }
  #editorScreen.sheet-up .side > .panel.try-full:not(.live) .panel-actions { bottom: calc(100% + 10px); }
  #editorScreen:has(.panel.try-full:not([hidden])) .zoom-hint { display: none; }
}
/* While the grip is dragged the sheet follows the finger (no rise animation mid-drag); a job bar
   sits above Try on's floating buttons. */
@media (max-width: 959px) and (min-height: 601px) {
  #editorScreen.sheet-drag .side > .panel { animation: none !important; }
  #editorScreen:has(.panel.try-full:not([hidden])) .side > .jobbar { bottom: calc(100% + 74px); }
}

/* ---------- Share sheet ----------
   The picture that will be sent, what to send (Photo / Before & after / Video), then Save and the
   gold Share. The picture is never cropped: it sits whole in a fixed stage, so switching formats
   doesn't make the buttons jump. */
dialog.share-sheet[open] { display: flex; flex-direction: column; gap: var(--s3); padding-top: var(--s3); overflow: hidden; }
.sh-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.sh-head h2 { margin: 0; }
.sh-stage { position: relative; flex: none; display: grid; place-items: center; height: clamp(150px, calc(92dvh - 300px), 470px);
  border-radius: var(--r-card); background: var(--surface-2); overflow: hidden; }
.sh-stage > img, .sh-stage > canvas, .sh-stage > video { grid-area: 1 / 1; width: 100%; height: 100%; object-fit: contain; display: block; transition: opacity 200ms; }
.sh-stage > [hidden] { display: none; }
.sh-busy { position: absolute; left: 50%; bottom: var(--s3); transform: translateX(-50%); display: flex; align-items: center; gap: var(--s2); white-space: nowrap;
  padding: 8px 16px 8px 12px; border-radius: 999px; background: rgb(13 13 16 / 0.74); color: #fff; font-weight: 600; font-size: 0.875rem; }
.sh-busy[hidden] { display: none; }
.sh-formats { flex: none; }
.sh-formats button { min-height: 40px; }
.sh-note { margin: calc(var(--s1) * -1) 0 0; text-align: center; font-size: 0.8125rem; line-height: 1.125rem; }
.sh-acts { display: grid; grid-template-columns: 1fr 1.7fr; gap: var(--s3); }
.sh-acts .btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 56px; border-radius: 28px; font-size: 1.0625rem; }
.sh-acts .btn svg { width: 20px; height: 20px; }
@media (orientation: landscape) and (max-height: 560px) {
  dialog.share-sheet[open] { display: grid; grid-template-columns: 1.3fr 1fr; grid-template-rows: auto 1fr auto auto; column-gap: var(--s4); width: min(96vw, 760px); max-width: none; }
  .sh-head { grid-column: 1 / -1; }
  .sh-stage { grid-column: 1; grid-row: 2 / 5; height: calc(92dvh - 120px); }
  .sh-formats, .sh-note, .sh-acts { grid-column: 2; }
  .sh-formats { align-self: end; }
  .sh-acts { grid-template-columns: 1fr; }
}
.sh-formats button { white-space: nowrap; }
@media (orientation: landscape) and (max-height: 560px) { .sh-formats button { font-size: 0.8125rem; padding: 0 6px; } }
/* Try on, premium pass (2026-11-03): quieter type, hairline icons, outlined chips. */
.try-tab { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.try-tab[aria-selected="true"] { font-weight: 700; }
.try-cat { font-weight: 500; letter-spacing: 0.01em; }
.try-cat[aria-pressed="true"] { background-color: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rose) 75%, transparent); color: var(--rose); font-weight: 600; }
.try-tile .name { font-weight: 500; letter-spacing: 0.01em; }
.try-tile.add .well > svg, .try-tile.none .well > svg { width: 22px; height: 22px; stroke-width: 1.3; }
.try-tile.add .well > svg *, .try-tile.none .well > svg * { stroke-width: 1.3; }
.try-tile.add .well > svg [fill="currentColor"] { fill-opacity: 0; }
.try-tile.add { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.try-tile.outfit, .try-tile.photo { box-shadow: 0 1px 0 rgb(255 255 255 / 0.04), 0 6px 14px -8px rgb(0 0 0 / 0.6); }
.try-tile[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--rose); }
/* Try on outfit photos (2026-11-03): the photo fills the card, the name sits on a soft shade. */
.try-strip:has(.try-tile.shot) { --tw: 64px; --th: 86px; }
@media (max-height: 800px) { .try-strip:has(.try-tile.shot) { --tw: 60px; --th: 80px; } }
.try-tile.shot { padding: 0; overflow: hidden; background: #e9e4dc; }
.try-tile.shot .well { position: absolute; inset: 0; border-radius: inherit; background-position: center 18%; }
.try-tile.part.top .well { background-position: center 12%; }
.try-tile.part.bottom .well { background-position: center 80%; }
.try-tile.shot .name { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 4px 3px; color: #fff; font-weight: 500; text-align: center;
  background: linear-gradient(to top, rgb(0 0 0 / 0.62), rgb(0 0 0 / 0)); text-shadow: 0 1px 2px rgb(0 0 0 / 0.35); }
.try-tile.shot[aria-pressed="true"] .name { color: #fff; font-weight: 600; }
.try-tile.shot.locked { opacity: 0.45; }
.try-tile .try-tag { position: absolute; left: 4px; top: 4px; width: 16px; height: 16px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 1.5px #fff, 0 1px 3px rgb(0 0 0 / 0.4); }
.try-tile .try-tag svg { width: 100%; height: 100%; display: block; }
.try-tile[aria-pressed="true"]::after { display: none; }   /* one thin gold ring marks the pick; no badge */
/* Beside the photos, None / Yours / Describe / Paste are slim so more outfits show. */
.try-strip:has(.try-tile.shot) .try-tile.add:not(.part), .try-strip:has(.try-tile.shot) .try-tile.none { width: 50px; }
.try-strip:has(.try-tile.shot) .try-tile.add:not(.part) .name, .try-strip:has(.try-tile.shot) .try-tile.none .name { font-size: 0.625rem; }
.try-strip { padding-left: calc(var(--gutter) + 10px); }
.try-shoes .try-tile.shot .well { background-position: center 60%; }
.try-shoes + .try-hint { margin-top: 2px; }

/* ---------- Shooting methods (shoot.js, 2026-11-04): Show palm, floating shutter, camera settings ---------- */
.cam-quick { flex-wrap: wrap; }
/* The open hand Show palm found: a gold box that fills in once the palm has been held. */
.cam-palm { position: absolute; z-index: 2; border: 2px solid var(--cam-gold); border-radius: 14px; box-shadow: 0 0 0 1px #0004, 0 0 18px #f3c06240;
  pointer-events: none; transition: left 0.12s linear, top 0.12s linear, width 0.12s linear, height 0.12s linear, background-color 0.2s; }
.cam-palm[hidden] { display: none; }
.cam-palm span { position: absolute; top: -14px; left: 50%; translate: -50% 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--cam-gold); color: #15140f; }
.cam-palm span svg { width: 17px; height: 17px; }
.cam-palm.held { background: #f3c0622e; animation: palm-pop 0.35s ease-out; }
@keyframes palm-pop { 50% { transform: scale(1.06); } }
.cam-palm-hint { display: flex; align-items: center; gap: 6px; z-index: 2; width: max-content; max-width: calc(100% - 32px); text-align: center; }
.cam-palm-hint[hidden] { display: none; }
.cam-palm-hint svg { width: 16px; height: 16px; color: var(--cam-gold); }
#cameraScreen .cam-palm-hint { top: 112px; }
/* The floating shutter: a smaller copy of the shutter you can drag anywhere. */
.cam-float { position: absolute; z-index: 3; width: 64px; height: 64px; padding: 0; border: 3px solid #fffd; border-radius: 50%; background: #ffffff38;
  box-shadow: 0 2px 10px #0006; touch-action: none; cursor: grab; }
.cam-float::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #fff; transition: transform var(--t-press-up, 0.15s); }
.cam-float:active::before { transform: scale(0.9); }
.cam-float[hidden] { display: none; }
.cam-settings .cs-h { margin: var(--s4) 0 var(--s2); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted, #8a8580); }
.cam-settings .cs-h:first-of-type { margin-top: var(--s2); }
.cam-settings .cs-all { width: 100%; margin-top: var(--s4); }
@media (prefers-reduced-motion: reduce) { .cam-palm { transition: none; } .cam-palm.held { animation: none; } }

/* Voice commands: a small microphone while listening, gold when a photo word is heard. */
.cam-voice { position: absolute; z-index: 2; top: 112px; left: 12px; margin: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: #0008; color: #fff; box-shadow: 0 0 0 1px #fff3; pointer-events: none; transition: background 0.2s, color 0.2s; }
.cam-voice[hidden] { display: none; }
.cam-voice svg { width: 16px; height: 16px; }
.cam-voice.heard { background: var(--cam-gold); color: #111; animation: palm-pop 0.35s ease-out; }
@media (prefers-reduced-motion: reduce) { .cam-voice.heard { animation: none; } }
/* ---------- 2026-11-04 audit: the dock's own room ----------
   The phone's gesture bar was counted twice under the dock (once by the dock, again by the tool
   panel and the tab bar), which left an empty strip under Apply and hid a row of controls (lip
   shades, Glow Up choices, Straighten). The dock keeps its height, so the photo keeps its size. */
@media (max-width: 959px) and (min-height: 601px) {
  #editorScreen .side { padding-bottom: 0; }
  /* The grip floats on the panel's top edge instead of taking a row of its own. */
  #editorScreen .dock-grip:not([hidden]) { position: absolute; top: 0; left: 50%; margin: 0 0 0 -32px; height: 14px; z-index: 2; }
  #editorScreen .dock-grip:not([hidden]) ~ .panel-head { padding-top: 6px; }
}
/* Crop: Straighten and the two flips on one row. */
.crop-row { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.crop-row > .slider { flex: 1 1 auto; min-width: 0; }
.crop-row .crop-flips { flex: none; margin: 0; flex-wrap: nowrap; gap: 0; }
#editorScreen .panel .crop-flips .opt { width: 44px; min-width: 44px; padding: 0; display: grid; place-items: center; }
.crop-flips .opt svg { width: 20px; height: 20px; }
.crop-flips .flip-v svg { transform: rotate(90deg); }
/* Camera review: the shot is taken, so flash, shape, timer and the quick settings step aside
   (as in the iPhone camera and Snapchat). Settings stays. */
#cameraScreen.reviewing .cam-left > *, #cameraScreen.reviewing #camTimer, #cameraScreen.reviewing #camMore { visibility: hidden; pointer-events: none; }
#cameraScreen.reviewing #camQuick { display: none; }
@media (max-width: 959px) and (min-height: 601px) {
  /* The buttons sit at the bottom of the dock in every tool (no gap under them). */
  #editorScreen .side > .panel:not(.live):not(.try-full) .panel-actions { margin-top: auto; }
  #editorScreen .side > .panel:not(.live) .panel-body { -webkit-mask-image: linear-gradient(transparent 0, #000 4px, #000 calc(100% - 8px), transparent); mask-image: linear-gradient(transparent 0, #000 4px, #000 calc(100% - 8px), transparent); }
}

/* Camera polish (2026-11-17, user's Samsung screenshots). */
/* Phone portrait: the top bar's controls are spread evenly, like the phones' own cameras. */
@media (max-width: 559px) {
  #cameraScreen .cam-top { justify-content: space-between; }
  #cameraScreen .cam-top .cam-left, #cameraScreen .cam-top .cam-right { display: contents; }
}
/* Before the camera is on: only the permission card, Settings and the tab bar. */
#cameraScreen.cam-off .cam-left, #cameraScreen.cam-off #camTimer, #cameraScreen.cam-off #camAI, #cameraScreen.cam-off #camMore,
#cameraScreen.cam-off #camQuick, #cameraScreen.cam-off #liveControls, #cameraScreen.cam-off #shotAIBtn { visibility: hidden; pointer-events: none; }
#cameraScreen.cam-off .cam-top { background: none; }
#cameraScreen.cam-off .cam-controls { background: none; }
#cameraScreen .vf-card .art { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; color: var(--cam-gold);
  background: radial-gradient(circle at 50% 30%, rgb(243 192 98 / .16), rgb(243 192 98 / .04)); box-shadow: inset 0 0 0 1px rgb(243 192 98 / .3); }
/* Hide controls: a full-view icon in the lens row (no second chevron next to the top bar's). */
#cameraScreen .cam-hide { top: 4px; }
#cameraScreen.cam-min .cam-hide, #cameraScreen #liveControls:has(#camZoom[hidden]) .cam-hide { top: -44px; }
#cameraScreen.adjusting .cam-hide { display: none; }
/* The Looks row fades at the edge, so a cut-off chip reads as "scroll for more". */
#cameraScreen #camLooks { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
/* Voice commands: a labelled pill under the top bar instead of a lone microphone. */
.cam-voice { top: 108px; left: 50%; transform: translateX(-50%); width: auto; height: 30px; padding: 0 12px 0 10px; gap: 6px; border-radius: 15px;
  display: flex; align-items: center; font-size: 0.75rem; font-weight: 600; white-space: nowrap; background: #0000008c; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.cam-voice[hidden] { display: none; }
.cam-voice.heard { animation: none; }
