/* One-tap Enhance: the launch animation, the Enhance home, the pick sheet, Result and Share.
   Uses the tokens from styles.css; Result and Share are always dark so the photo leads. */

/* ---------- Launch animation: Aperture (about 1.1 s; reduced motion: a short fade) ----------
   Starts on the same frame as the iPhone launch image (the icon's lens on ink), then the sparkle glints,
   the iris opens onto the app's own color and we fly through the lens. Only transform and opacity move,
   so it stays smooth while the app is still starting. */
#splash { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; overflow: hidden; background: #121014; /* matches the native splash (tools/app-icon/build.py INK) */
  --sp-size: 42vmin; }
#splash.ios { --sp-size: 26vmax; }
#splash .sp-lens { position: relative; width: var(--sp-size); aspect-ratio: 1; }
#splash .sp-lens > * { position: absolute; inset: 0; width: 100%; height: 100%; }
#splash .sp-light { opacity: 0; }
#splash .sp-light polygon { fill: var(--bg); }
#splash .sp-spark { transform-origin: 33% 33%; }
#splash.go .sp-spark { animation: sp-spark 420ms cubic-bezier(.3, 1.5, .5, 1) both; }
#splash.go .sp-iris { animation: sp-iris 440ms cubic-bezier(.6, 0, .2, 1) 120ms both; }
#splash.go .sp-light { animation: sp-iris 440ms cubic-bezier(.6, 0, .2, 1) 120ms both, sp-in 220ms ease-out 300ms both; }
#splash.go .sp-lens { animation: sp-fly 520ms cubic-bezier(.55, 0, .85, .25) 360ms both; }
#splash.go { animation: sp-out 220ms ease-out 830ms both; }
#splash.out { animation: sp-out 200ms ease-out both; }
@keyframes sp-spark { 0% { transform: scale(1) rotate(0); } 45% { transform: scale(1.5) rotate(45deg); } 100% { transform: scale(1) rotate(90deg); } }
@keyframes sp-iris { to { transform: scale(1.55) rotate(-60deg); } }
@keyframes sp-in { to { opacity: 1; } }
@keyframes sp-fly { to { transform: scale(24); } }
@keyframes sp-out { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  #splash.go .sp-lens, #splash.go .sp-lens > * { animation: none; }
  #splash.go { animation-delay: 150ms; }
}

/* ---------- Enhance home ---------- */
#enhanceHome .enh-home { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--s4); padding: var(--s2) var(--gutter) var(--s4); overflow-y: auto; }
.enh-hero { position: relative; flex: 1 1 auto; min-height: 240px; border-radius: var(--r-card); overflow: hidden; background: var(--viewer); isolation: isolate; }
.enh-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.enh-hero .after { clip-path: inset(0 0 0 var(--sweep, 50%)); animation: enh-sweep 5.2s cubic-bezier(.45, 0, .55, 1) 1.6s infinite; }
.enh-hero .line { position: absolute; top: 0; bottom: 0; left: var(--sweep, 50%); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 12px rgb(255 255 255 / .6);
  animation: enh-sweep-line 5.2s cubic-bezier(.45, 0, .55, 1) 1.6s infinite; }
@property --sweep { syntax: "<percentage>"; inherits: true; initial-value: 50%; }
@keyframes enh-sweep { 0%, 100% { --sweep: 50%; } 30% { --sweep: 18%; } 70% { --sweep: 82%; } }
@keyframes enh-sweep-line { 0%, 100% { --sweep: 50%; } 30% { --sweep: 18%; } 70% { --sweep: 82%; } }
.enh-hero .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 56px var(--s4) var(--s4); color: #fff;
  background: linear-gradient(to top, rgb(14 11 16 / .82), rgb(14 11 16 / 0)); }
.enh-hero .cap h1 { margin: 0; font: 600 2.25rem/2.4rem var(--font-display); }
.enh-hero .cap p { margin: 4px 0 0; font-size: 0.9375rem; line-height: 1.25rem; color: #f3e9ee; }
.enh-pill { position: absolute; top: var(--s3); padding: 4px var(--s3); border-radius: 999px; background: rgb(18 18 20 / .66); color: #fff;
  font-size: 0.8125rem; font-weight: 700; line-height: 1.125rem; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.enh-pill.left { left: var(--s3); } .enh-pill.right { right: var(--s3); }
.enh-hero .enh-pill.ai { top: auto; bottom: auto; right: var(--s3); top: 48px; font-weight: 600; font-size: 0.6875rem; }
.enh-cta { display: grid; gap: var(--s2); flex: none; }
.enh-cta .btn { min-height: 56px; font-size: 1.0625rem; border-radius: 28px; }
.enh-cta .btn svg { width: 22px; height: 22px; }
.enh-meta { display: flex; justify-content: center; }
.enh-meta button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--s3); border: 0; border-radius: 18px; background: none;
  color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.enh-meta svg { width: 16px; height: 16px; color: var(--accent); }

/* ---------- Editor home: the same hero, cycling through real results on the sample ---------- */
.ed-hero .lk { opacity: 0; animation: ed-look 12s ease-in-out infinite backwards; }
.ed-hero .lk:nth-of-type(2) { animation-delay: 2.4s; } .ed-hero .lk:nth-of-type(3) { animation-delay: 4.8s; }
.ed-hero .lk:nth-of-type(4) { animation-delay: 7.2s; } .ed-hero .lk:nth-of-type(5) { animation-delay: 9.6s; }
.ed-looks { position: absolute; top: var(--s3); left: var(--s3); display: grid; }
.ed-looks span { grid-area: 1 / 1; padding: 4px var(--s3); border-radius: 999px; background: rgb(18 18 20 / .66); color: #fff; font-size: 0.8125rem; font-weight: 700;
  line-height: 1.125rem; white-space: nowrap; justify-self: start; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; animation: ed-look 12s ease-in-out infinite backwards; }
.ed-looks span:nth-child(2) { animation-delay: 2.4s; } .ed-looks span:nth-child(3) { animation-delay: 4.8s; }
.ed-looks span:nth-child(4) { animation-delay: 7.2s; } .ed-looks span:nth-child(5) { animation-delay: 9.6s; }
@keyframes ed-look { 0% { opacity: 0; } 4%, 20% { opacity: 1; } 24%, 100% { opacity: 0; } }
/* Labels never overlap: one fades out before the next fades in (two pills on top of each other
   read as garbled text). The photos underneath still crossfade. */
.ed-looks span { animation-name: ed-label; }
@keyframes ed-label { 0%, 2% { opacity: 0; } 4%, 17% { opacity: 1; } 19%, 100% { opacity: 0; } }
/* The first label is already showing when the page opens. */
.ed-looks span:first-child { animation-name: ed-label-first; }
@keyframes ed-label-first { 0%, 17% { opacity: 1; } 19%, 99% { opacity: 0; } 100% { opacity: 1; } }
.ed-hero .enh-pill.ai { top: var(--s3); }
#editorHome .enh-meta button svg { width: 16px; height: 16px; color: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  .ed-hero .lk, .ed-looks span { animation: none; }
  .ed-looks span:first-child { opacity: 1; }
}

/* ---------- Editor home: Quick actions ----------
   Six photo tiles under Choose a photo (Photoshop Express-style home, kept to 3 x 2). The hero gives
   up some height so the tiles show without scrolling on a phone. Tiles: real results on the sample. */
#editorHome.has-qa .ed-hero { flex: 0 0 auto; height: clamp(150px, calc(100vh - 560px), 340px); min-height: 0; }
#editorHome.has-qa .ed-hero .cap { padding-top: 40px; --cap-top: 40px; }
.qa-sec { flex: none; }
.qa-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin: 2px 2px var(--s3); }
.qa-head h2 { margin: 0; font: 500 1.3125rem/1.75rem var(--font-display); font-variation-settings: "SOFT" 100; color: var(--text); }
.qa-sample { border: 0; background: none; padding: 6px 0; min-height: 36px; color: var(--muted); font: 600 0.875rem/1.25rem var(--font); text-decoration: underline; text-decoration-color: transparent; }
.qa-sample:hover { color: var(--text); text-decoration-color: currentColor; }
.qa-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3) var(--s3); }
.qa { display: grid; align-content: start; gap: 6px; padding: 0; border: 0; background: none; color: var(--text); text-align: center; font: 600 0.8125rem/1.125rem var(--font); -webkit-tap-highlight-color: transparent; }
.qa-ph { position: relative; display: block; aspect-ratio: 1; border-radius: 20px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line);
  transition: transform .18s cubic-bezier(.3, 1.4, .5, 1), box-shadow .2s; }
.qa-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qa-ph i { position: absolute; left: 7px; bottom: 7px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: rgb(13 13 16 / .72); color: #ffe3a3; box-shadow: 0 0 0 1px rgb(255 217 138 / .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.qa-ph i svg { width: 17px; height: 17px; }
.qa-ph em { position: absolute; right: 7px; top: 7px; padding: 2px 7px; border-radius: 999px; font: 700 0.625rem/0.9375rem var(--font); font-style: normal; letter-spacing: .04em;
  background: linear-gradient(135deg, #ffe3a3, #f3b54a); color: #1a1206; }
.qa:active .qa-ph { transform: scale(.96); }
.qa:focus-visible { outline: none; }
.qa:focus-visible .qa-ph { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #f3b54a; }
.qa-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 720px) { .qa-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } .qa-name { white-space: normal; } }
@media (prefers-reduced-motion: reduce) { .qa-ph { transition: none; } }

/* ---------- Pick sheet: the photo, the kind of edit, one big button ----------
   2026-10-31 redesign (competitor research: Remini, Lensa, Facetune, PhotoRoom, Picsart, EPIK).
   Phones get a full-screen page: the photo on a soft, blurred copy of itself (no grey bars), and a
   porcelain panel at the bottom with the button in thumb reach. While the AI works the button
   becomes a progress bar with the step it is on, and light moves over the photo and its faces.
   Wider screens keep a centered card with the same parts. */
dialog.enh-sheet { width: min(92vw, 460px); height: min(92dvh, 880px); max-height: none; margin: auto; padding: 0; border: 0; border-radius: var(--r-sheet);
  overflow: hidden; display: none; flex-direction: column; background: #111113; color: var(--text); box-shadow: 0 24px 64px rgb(0 0 0 / .45); }
dialog.enh-sheet[open] { display: flex; animation: enh-pop 300ms cubic-bezier(.2, .9, .3, 1.15); }
dialog.enh-sheet::backdrop { background: rgb(10 8 12 / .72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
@keyframes enh-pop { from { opacity: 0; transform: scale(.92) translateY(12px); } }
@keyframes enh-rise { from { opacity: 0; transform: translateY(32px); } }
@media (max-width: 599px) {
  dialog.enh-sheet { width: 100vw; max-width: none; height: 100dvh; border-radius: 0; box-shadow: none; }
  dialog.enh-sheet[open] { animation: enh-rise 280ms cubic-bezier(.2, .9, .3, 1); }
  dialog.enh-sheet::backdrop { background: #111113; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
/* The photo: contained, never cropped, on a blurred and darkened copy of itself. */
.enh-sheet .ph { position: relative; flex: 1 1 auto; min-height: 0; display: grid; place-items: center; overflow: hidden; isolation: isolate; container-type: size;
  padding: calc(60px + var(--sa-top)) var(--s3) calc(var(--s4) + 20px); box-sizing: border-box; }
.enh-sheet .ph-fill { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; z-index: -1;
  filter: blur(36px) saturate(1.15) brightness(.62); transform: scale(1.05); }
.enh-sheet .ph::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgb(18 14 17 / .5), rgb(18 18 20 / 0) 22%, rgb(18 18 20 / 0) 70%, rgb(18 14 17 / .35)); }
.enh-sheet .ph-pic { position: relative; border-radius: var(--r-card); overflow: hidden; box-shadow: 0 18px 48px rgb(0 0 0 / .45), 0 0 0 1px rgb(255 255 255 / .08);
  transition: transform 500ms cubic-bezier(.2, .9, .3, 1); }
.enh-sheet .ph-pic img { display: block; max-width: 100cqw; max-height: 100cqh; object-fit: contain; }
.enh-sheet.working .ph-pic { transform: scale(.985); }
.enh-sheet .x { position: absolute; top: calc(var(--s3) + var(--sa-top)); left: var(--s3); width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgb(18 18 20 / .45); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: opacity 200ms; }
.enh-sheet .x:disabled { opacity: 0; pointer-events: none; }
.enh-sheet > .ph > .enh-pill.ai { top: calc(var(--s3) + 10px + var(--sa-top)); right: var(--s3); bottom: auto; }

/* The panel: porcelain (dark surface in dark mode), lifted over the photo's blur. */
.enh-sheet .foot { position: relative; z-index: 1; flex: none; display: grid; gap: var(--s3); margin-top: -20px; padding: var(--s5) var(--s4) calc(var(--s4) + var(--sa-bottom));
  border-radius: var(--r-sheet) var(--r-sheet) 0 0; background: var(--surface); box-shadow: 0 -10px 30px rgb(0 0 0 / .18); }
@media (min-width: 600px) { .enh-sheet .foot { padding-bottom: var(--s4); } }

/* Kind of edit: cards with a line on what each one does and what it costs (shown when there is a choice). */
.enh-style { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--s2); transition: opacity 200ms; }
.enh-style[hidden] { display: none; }
.enh-style button { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: var(--s2); align-items: center; text-align: left;
  min-height: 64px; padding: var(--s2) var(--s3); border: 0; border-radius: 18px; background: var(--surface-2); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow var(--t-select), background var(--t-select), transform var(--t-press-up); }
.enh-style button:active { transform: scale(.98); }
.enh-style .ic { grid-row: 1 / 3; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface); color: var(--rose); }
.enh-style .ic svg { width: 20px; height: 20px; }
.enh-style b { font-size: 0.9375rem; line-height: 1.25rem; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.enh-style small { font-size: 0.75rem; line-height: 1rem; color: var(--muted); }
.enh-style .pro-chip { font-size: 0.625rem; padding: 1px 6px; }
.enh-style button[aria-checked="true"] { background: var(--blush); box-shadow: inset 0 0 0 2px var(--text); }
.enh-style button[aria-checked="true"] .ic { background: var(--text); color: var(--bg); }
.enh-sheet.working .enh-style { opacity: .45; pointer-events: none; }

/* The button, and the progress bar that takes its place while the AI works. */
.enh-act { position: relative; min-height: 60px; }
.enh-go { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: var(--s2); width: 100%; min-height: 60px;
  border: 0; border-radius: 30px; background: var(--cta); color: var(--cta-fg); box-shadow: var(--cta-glow); font-size: 1.1875rem; font-weight: 700; transition: transform var(--t-press-up), opacity 200ms; }
.enh-go:active { transform: scale(.98); }
.enh-go svg { width: 22px; height: 22px; color: currentColor; }
.enh-go:disabled { cursor: default; }
.enh-go.busy::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / .45) 50%, transparent 70%);
  background-size: 250% 100%; animation: enh-shine 1.4s linear infinite; }
@keyframes enh-shine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.enh-go .go-cost { position: absolute; right: 10px; display: inline-flex; align-items: center; gap: 3px; min-height: 30px; padding: 0 10px 0 12px; border-radius: 15px;
  background: color-mix(in srgb, currentColor 14%, transparent); font-size: 0.875rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.enh-go .go-cost svg { width: 15px; height: 15px; }
.enh-sheet .enh-go.busy { opacity: 0; pointer-events: none; }
.enh-prog { position: absolute; inset: 0; display: grid; align-content: center; gap: 10px; padding: 0 var(--s1); opacity: 0; pointer-events: none; transition: opacity 220ms; }
.enh-sheet.working .enh-prog { opacity: 1; }
.enh-prog-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.enh-prog .lbl { font-size: 1.0625rem; line-height: 1.5rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.enh-prog .lbl.swap { animation: enh-lbl 360ms cubic-bezier(.2, .9, .3, 1); }
@keyframes enh-lbl { from { opacity: 0; transform: translateY(8px); } }
.enh-prog .pct { font-size: 0.875rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.enh-prog-bar { position: relative; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.enh-prog-bar i { position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); border-radius: 4px; background: linear-gradient(90deg, #ffe3a3, var(--rose)); transition: width 300ms linear; }
.enh-prog-bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgb(255 255 255 / .55), transparent); background-size: 60% 100%;
  background-repeat: no-repeat; animation: enh-bar 1.3s ease-in-out infinite; }
@keyframes enh-bar { from { background-position: -80% 0; } to { background-position: 180% 0; } }
.enh-sheet .cost { margin: 0; min-height: 1.125rem; text-align: center; font-size: 0.8125rem; line-height: 1.125rem; color: var(--muted); }
.enh-sheet .cost b { color: var(--text); }
.enh-sheet .cost.err { color: var(--danger); font-weight: 600; }
.enh-sheet .cost .link-btn { min-height: 32px; padding: 0 4px; font-size: 0.8125rem; }

/* While the AI works: a soft band of light sweeps down the photo, faces get a glowing ring, sparkles twinkle. */
.enh-scan { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 300ms; overflow: hidden; }
.enh-sheet.working .enh-scan, .bt.working .enh-scan { opacity: 1; }
.enh-scan::before { content: ""; position: absolute; left: -10%; right: -10%; height: 46%; top: -46%;
  background: linear-gradient(to bottom, transparent, rgb(255 246 230 / .10) 35%, rgb(255 250 240 / .42) 50%, rgb(255 246 230 / .10) 65%, transparent);
  mix-blend-mode: screen; animation: enh-scan 2.4s cubic-bezier(.45, 0, .55, 1) infinite; }
.enh-scan::after { content: ""; position: absolute; inset: 0; background: rgb(14 11 16 / .14); }
@keyframes enh-scan { to { top: 100%; } }
.enh-rings { position: absolute; inset: 0; pointer-events: none; }
.enh-rings i { position: absolute; border-radius: 50%; box-shadow: 0 0 0 1.5px rgb(255 255 255 / .9), 0 0 18px 2px rgb(243 192 98 / .65), inset 0 0 16px rgb(243 192 98 / .35);
  opacity: 0; transform: scale(.7); transition: opacity 400ms, transform 600ms cubic-bezier(.2, .9, .3, 1.3); }
.enh-sheet.faces .enh-rings i { opacity: 1; transform: scale(1); animation: enh-ring 1.6s ease-in-out 600ms infinite; }
@keyframes enh-ring { 50% { transform: scale(1.06); box-shadow: 0 0 0 1.5px rgb(255 255 255 / .6), 0 0 26px 6px rgb(243 192 98 / .5), inset 0 0 20px rgb(243 192 98 / .25); } }
.enh-sheet .sparkles { position: absolute; inset: 0; pointer-events: none; }
.enh-sheet .sparkles i { position: absolute; width: 14px; height: 14px; background: #fff4f7; opacity: 0;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.enh-sheet.working .sparkles i { animation: enh-twinkle 1.8s ease-in-out infinite; }
.enh-sheet .sparkles i:nth-child(2) { animation-delay: .45s !important; } .enh-sheet .sparkles i:nth-child(3) { animation-delay: .9s !important; }
.enh-sheet .sparkles i:nth-child(4) { animation-delay: 1.35s !important; }
@keyframes enh-twinkle { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
/* The finished photo fades in over the original for a moment before the Result opens. */
.enh-sheet .ph-pic .done { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; max-height: none; clip-path: inset(0 0 100% 0);
  transition: clip-path 650ms cubic-bezier(.6, 0, .2, 1); }
.enh-sheet .ph-pic .done.in { clip-path: inset(0 0 0 0); }
@media (prefers-reduced-motion: reduce) {
  .enh-scan::before, .enh-sheet.faces .enh-rings i, .enh-prog-bar i::after { animation: none; }
  .enh-sheet .ph-pic .done { transition: none; }
}

/* ---------- Result and Share (always dark) ---------- */
#enhanceResult, #enhanceShare { max-width: none; background: #000; color: #f7f3ea; }
.enh-top { flex: none; width: 100%; max-width: 680px; align-self: center; box-sizing: border-box; display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; height: 60px; padding: 0 calc(var(--gutter) - 6px); }
.enh-top h1 { margin: 0; text-align: center; font-size: 1.0625rem; font-weight: 700; }
.enh-top .icon-btn { color: #f7f3ea; }
.enh-top .end { justify-self: end; }
.enh-dl { width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center; background: #f7f3ea; color: #15140f;
  transition: transform var(--t-press-up); box-shadow: 0 0 0 0 rgb(243 192 98 / .5); }
.enh-dl:active { transform: scale(.94); }
.enh-dl.ready { animation: enh-nudge 1.8s ease-out 1.2s 2; }
@keyframes enh-nudge { 0% { box-shadow: 0 0 0 0 rgb(243 192 98 / .55); } 100% { box-shadow: 0 0 0 16px rgb(243 192 98 / 0); } }
.enh-done { justify-self: end; min-height: 44px; padding: 0 var(--s2); border: 0; background: none; color: #f7f3ea; font-size: 1rem; font-weight: 600; }

.enh-stage { position: relative; flex: 1 1 auto; min-height: 0; display: grid; place-items: center; padding: 0 var(--s2); }
.enh-frame { position: relative; overflow: hidden; border-radius: var(--r-card); touch-action: none; user-select: none; -webkit-user-select: none; cursor: ew-resize; background: #111; }
.enh-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; -webkit-user-drag: none; transform-origin: 0 0; }
.enh-frame .after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--split, 50%)); pointer-events: none; }
.enh-frame.zoomed { cursor: grab; }
.enh-frame.zooming img { transition: transform 240ms cubic-bezier(.3, 0, .2, 1); }
.enh-frame .line { position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 2px; margin-left: -1px; background: #fff; pointer-events: none; }
.enh-frame .knob { position: absolute; left: clamp(24px, var(--split, 50%), calc(100% - 24px)); top: 72%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; background: #fff; color: #15140f; box-shadow: 0 2px 12px rgb(0 0 0 / .35); cursor: ew-resize; }
.enh-frame .knob svg { width: 22px; height: 22px; }
.enh-frame.reveal .after, .enh-frame.reveal .line, .enh-frame.reveal .knob { transition: clip-path 900ms cubic-bezier(.6, 0, .2, 1), left 900ms cubic-bezier(.6, 0, .2, 1); }
.enh-frame .enh-pill { top: var(--s3); }
.enh-frame .enh-pill.ai { top: auto; bottom: var(--s3); left: var(--s3); right: auto; font-weight: 600; font-size: 0.6875rem; }
.enh-frame .enh-zoom { top: auto; bottom: var(--s3); right: var(--s3); min-height: 32px; display: inline-flex; align-items: center; gap: 6px; border: 0; font: inherit; font-weight: 600;
  font-variant-numeric: tabular-nums; cursor: pointer; }
.enh-frame .enh-zoom svg { width: 16px; height: 16px; }
.enh-working { position: absolute; left: 50%; bottom: var(--s4); transform: translateX(-50%); display: flex; align-items: center; gap: var(--s2);
  padding: 6px 14px 6px 8px; border-radius: 999px; background: rgb(0 0 0 / .6); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); pointer-events: none; opacity: 0; transition: opacity 160ms; }
.enh-working .spinner.small { border-color: rgb(255 255 255 / .25); border-top-color: var(--accent); }
.enh-working.on { opacity: 1; }

.enh-dock { flex: none; display: grid; }
.enh-dock > * { grid-area: 1 / 1; min-width: 0; }
.enh-dock > [hidden] { display: flex !important; visibility: hidden; pointer-events: none; }
.enh-toggles { align-self: center; display: flex; gap: var(--s1); overflow-x: auto; scrollbar-width: none; padding: var(--s4) var(--gutter) calc(var(--s4) + var(--sa-bottom));
  scroll-snap-type: x proximity; }
.enh-toggles::-webkit-scrollbar { display: none; }
.enh-t { position: relative; flex: 0 0 auto; width: 92px; min-height: 84px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: var(--s2) 2px;
  border: 0; border-radius: var(--r-well); background: none; color: #a9a59c; font-size: 0.8125rem; line-height: 1.0625rem; font-weight: 600; text-align: center;
  scroll-snap-align: start; transition: color var(--t-select), background var(--t-select); }
.enh-t .ic { position: relative; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: #1d1d20; transition: background var(--t-select), box-shadow var(--t-select); }
.enh-t .ic svg { width: 26px; height: 26px; }
.enh-t[aria-pressed="true"] { color: #f7f3ea; }
.enh-t[aria-pressed="true"] .ic { background: rgb(243 192 98 / .16); box-shadow: inset 0 0 0 1.5px #f3c062; color: #f3c062; }
.enh-t .tick { position: absolute; top: -5px; right: -5px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: #f3c062; color: #15140f; transform: scale(0); transition: transform 180ms cubic-bezier(.3, 1.6, .5, 1); }
.enh-t .tick svg { width: 13px; height: 13px; stroke-width: 3; }
.enh-t[aria-pressed="true"] .tick { transform: scale(1); }
.enh-t:disabled { opacity: .4; cursor: default; }
.enh-t.more .ic { background: none; box-shadow: inset 0 0 0 1px #45454b; }

/* A tool's levels (Disabled, 1, 2, 3...), in place of the tool row. */
.enh-levels { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s2) 0 calc(var(--s2) + var(--sa-bottom)); }
.enh-default { align-self: center; display: inline-flex; align-items: center; gap: var(--s3); min-height: 40px; color: #f7f3ea; font-weight: 600; font-size: 0.9375rem; cursor: pointer; }
.enh-default input { appearance: none; -webkit-appearance: none; margin: 0; width: 46px; height: 28px; border-radius: 14px; background: #45454b; position: relative; cursor: pointer;
  transition: background var(--t-select); }
.enh-default input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #f7f3ea; transition: transform 180ms cubic-bezier(.3, 1.3, .5, 1); }
.enh-default input:checked { background: #f3c062; }
.enh-default input:checked::after { transform: translateX(18px); }
.enh-default input:focus-visible { outline: 2px solid #f3c062; outline-offset: 3px; }
.enh-lv-row { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; padding: 2px var(--gutter); scroll-snap-type: x proximity; }
.enh-lv-row::-webkit-scrollbar { display: none; }
.enh-lv { flex: 0 0 auto; width: 76px; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: #1d1d20; color: #f7f3ea; font: inherit; font-size: 0.8125rem; font-weight: 600;
  scroll-snap-align: center; box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow var(--t-select), background var(--t-select), color var(--t-select); }
.enh-lv img { display: block; width: 100%; height: 52px; object-fit: cover; }
.enh-lv span { display: block; padding: 6px 2px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.enh-lv.off { margin-right: var(--s2); }
.enh-lv[aria-checked="true"] { background: #f7f3ea; color: #15140f; box-shadow: inset 0 0 0 2px #f7f3ea; }
.enh-lv-bar { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; padding: 0 calc(var(--gutter) - 6px); }
.enh-lv-bar h2 { margin: 0; text-align: center; font-size: 1.0625rem; font-weight: 700; color: #f7f3ea; }
.enh-lv-bar .icon-btn { color: #f7f3ea; }
.enh-lv-bar .icon-btn:last-child { justify-self: end; }

.enh-share-ph { position: relative; flex: 1 1 auto; min-height: 0; display: grid; place-items: center; padding: var(--s2) var(--gutter); }
.enh-share-ph .enh-card { position: relative; border-radius: var(--r-card); overflow: hidden; background: #111; }
.enh-share-ph img { display: block; width: 100%; height: 100%; object-fit: cover; }
.enh-saved { position: absolute; left: 50%; bottom: var(--s3); transform: translateX(-50%); display: flex; align-items: center; gap: var(--s2); }
.enh-saved .state { display: inline-flex; align-items: center; gap: var(--s2); min-height: 48px; padding: 0 var(--s2) 0 var(--s4); border-radius: 24px; background: #f7f3ea;
  color: #15140f; font-weight: 700; font-size: 0.9375rem; white-space: nowrap; animation: enh-pop 380ms cubic-bezier(.2, .9, .3, 1.3) both; }
.enh-saved .state .ok { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #15140f; color: #f7f3ea; }
.enh-saved .state .ok svg { width: 16px; height: 16px; stroke-width: 3; }
.enh-saved .share { width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center; background: #f7f3ea; color: #15140f; flex: none; }
.enh-share-foot { flex: none; display: grid; width: 100%; max-width: 520px; margin: 0 auto; gap: var(--s2); padding: var(--s4) var(--gutter) calc(var(--s4) + var(--sa-bottom)); }
.enh-share-foot .btn { min-height: 60px; border-radius: 30px; font-size: 1.125rem; background: linear-gradient(135deg, #ffe3a3, #f3b54a); color: #1a1206;
  box-shadow: 0 0 0 1px rgb(255 217 138 / .35), 0 8px 26px -6px rgb(243 181 74 / .55); }
.enh-share-foot .btn svg { color: currentColor; }
.enh-share-foot .link-btn { color: #f3c062; justify-self: center; }

@media (min-width: 900px) {
  .enh-toggles { justify-content: center; }
}

/* ---------- Batch Enhance (Pro): a link on the home screen, then a grid that fills in ---------- */
.enh-batch-link { justify-self: center; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--text); font-size: 0.875rem; }
.enh-batch-link svg { width: 18px; height: 18px; }
.pro-chip { padding: 2px 7px; border-radius: 999px; background: #f3c062; color: #15140f; font-size: 0.6875rem; font-weight: 800; line-height: 1rem; letter-spacing: .04em; text-transform: uppercase; }
#enhanceBatch { max-width: none; background: #000; color: #f7f3ea; }
.batch-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; width: 100%; max-width: 680px; align-self: center; box-sizing: border-box; display: grid;
  grid-template-columns: repeat(3, 1fr); gap: var(--s2); align-content: start; padding: var(--s2) var(--gutter); }
@media (min-width: 600px) { .batch-grid { grid-template-columns: repeat(4, 1fr); } }
.bt { position: relative; aspect-ratio: 3 / 4; }
.bt-ph { position: absolute; inset: 0; width: 100%; padding: 0; border: 0; border-radius: var(--r-well); overflow: hidden; background: #1d1d20; color: #f7f3ea; }
.bt-ph img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity 240ms; }
.bt.queued img { opacity: .45; }
.bt.done img { animation: enh-pop 380ms cubic-bezier(.2, .9, .3, 1.15); }
.bt.working .enh-scan { opacity: 1; }
.bt-state { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 2px var(--s2); border-radius: 999px;
  background: rgb(18 18 20 / .7); font-size: 0.75rem; font-weight: 700; line-height: 1.125rem; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.bt-state:empty { display: none; }
.bt-state svg { width: 14px; height: 14px; }
.bt.done .bt-state { left: auto; right: 6px; top: 6px; bottom: auto; width: 24px; height: 24px; padding: 0; justify-content: center; background: #f3c062; color: #15140f; }
.bt.done .bt-state svg { stroke-width: 3; }
.bt.failed img { opacity: .4; }
.bt.failed .bt-state { left: 50%; bottom: 50%; transform: translate(-50%, 50%); white-space: nowrap; background: #f7f3ea; color: #15140f; }
.bt-x { position: absolute; top: -6px; right: -6px; width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: #f7f3ea; color: #15140f; box-shadow: 0 2px 8px rgb(0 0 0 / .4); }
.bt-x::after { content: ""; position: absolute; inset: -8px; }   /* 44px touch target */
.bt-x svg { width: 15px; height: 15px; stroke-width: 2.5; }
.batch-foot { flex: none; width: 100%; max-width: 520px; margin: 0 auto; box-sizing: border-box; display: grid; gap: var(--s2);
  padding: var(--s3) var(--gutter) calc(var(--s4) + var(--sa-bottom)); }
#enhanceBatch .enh-go { background: linear-gradient(135deg, #ffe3a3, #f3b54a); color: #1a1206; }
#enhanceBatch .enh-go svg { color: currentColor; }
#enhanceBatch .enh-go.off { opacity: .55; }
#enhanceBatch .cost { margin: 0; min-height: 1.125rem; text-align: center; font-size: 0.8125rem; line-height: 1.125rem; color: #a9a59c; }
#enhanceBatch .cost b { color: #f7f3ea; }
#enhanceBatch .cost .link-btn { min-height: 32px; padding: 0 4px; font-size: 0.8125rem; color: #f3c062; }

/* Pro Edit on the Result: what it changed, and how strong it is (original to full Pro). */
.enh-pro { display: grid; gap: 6px; padding: 0 var(--s4) 4px; }
.enh-changes { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.enh-changes::-webkit-scrollbar { display: none; }
.enh-changes span { flex: none; padding: 4px 10px; border-radius: 999px; font-size: 0.75rem; line-height: 1rem; color: #fff; background: rgb(255 255 255 / .1); white-space: nowrap; }
.enh-changes span.ok { background: rgb(120 200 150 / .22); }
.enh-strength { display: flex; align-items: center; gap: 10px; font-size: 0.8125rem; color: rgb(255 255 255 / .8); }
.enh-strength input { flex: 1; min-height: 32px; accent-color: var(--accent); }
.enh-strength b { min-width: 3em; text-align: right; font-weight: 600; color: #fff; }

/* Recent: the last photos saved, on the Enhance and Editor home screens. Tap to keep editing. */
.recents { flex: none; display: grid; gap: var(--s2); }
.recents-head { display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
.recents-head h2 { margin: 0; font-size: 0.9375rem; font-weight: 700; color: var(--text); }
.recents-head .link-btn { min-height: 32px; padding: 0 var(--s1); border: 0; background: none; color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.recents-row { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter); scroll-snap-type: x proximity; }
.recents-row::-webkit-scrollbar { display: none; }
.recent { flex: none; width: 64px; height: 64px; padding: 0; border: 0; border-radius: 16px; overflow: hidden; background: var(--surface-2); scroll-snap-align: start;
  box-shadow: inset 0 0 0 1px var(--line); transition: transform var(--t-press-up); }
.recent:active { transform: scale(.95); }
.recent img { width: 100%; height: 100%; object-fit: cover; display: block; }
.recent:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }

/* ---------- Landscape phones (short and wide): photo on the left, controls in a column on the right ----------
   2026-11-01 audit: turned sideways, the bottom panels took the whole height and the photo shrank to a
   sliver (pick sheet, Result, Share). Same parts, side by side. */
@media (orientation: landscape) and (max-height: 560px) {
  dialog.enh-sheet { width: 100vw; max-width: none; height: 100dvh; border-radius: 0; box-shadow: none; flex-direction: row; }
  dialog.enh-sheet::backdrop { background: #111113; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .enh-sheet .ph { padding: calc(var(--s3) + var(--sa-top)) var(--s4) var(--s3) calc(60px + var(--sa-left)); }
  .enh-sheet > .ph > .enh-pill.ai { top: auto; bottom: var(--s3); right: var(--s3); }
  .enh-sheet .x { left: calc(var(--s3) + var(--sa-left)); }
  .enh-sheet .foot { width: min(340px, 44vw); margin: 0; align-content: center; overflow-y: auto; border-radius: var(--r-sheet) 0 0 var(--r-sheet);
    padding: calc(var(--s4) + var(--sa-top)) calc(var(--s4) + var(--sa-right)) calc(var(--s4) + var(--sa-bottom)) var(--s4); box-shadow: -10px 0 30px rgb(0 0 0 / .18); }
  .enh-style { grid-auto-flow: row; grid-auto-columns: auto; }

  #enhanceResult, #enhanceShare { display: grid; grid-template-columns: minmax(0, 1fr) min(320px, 42vw); grid-template-rows: auto minmax(0, 1fr) auto; }
  #enhanceResult > .enh-top, #enhanceShare > .enh-top { grid-column: 1 / -1; max-width: none; height: 52px; }
  #enhanceResult .enh-stage { grid-column: 1; grid-row: 2 / 4; padding: 0 var(--s2) calc(var(--s2) + var(--sa-bottom)); }
  #enhanceResult .enh-pro { grid-column: 2; grid-row: 2; align-self: start; }
  #enhanceResult .enh-dock { grid-column: 2; grid-row: 2 / 4; align-self: stretch; min-height: 0; overflow-y: auto; }
  #enhanceResult .enh-pro:not([hidden]) ~ .enh-dock { grid-row: 3; }
  .enh-toggles { flex-wrap: wrap; justify-content: center; align-content: flex-start; overflow-x: visible; padding: var(--s2) var(--s2) calc(var(--s2) + var(--sa-bottom)); }
  .enh-t { width: 88px; min-height: 80px; }
  .enh-levels { justify-content: center; }
  .enh-lv-row { flex-wrap: wrap; justify-content: center; overflow-x: visible; }
  .enh-lv.off { margin-right: 0; }
  #enhanceShare .enh-share-ph { grid-column: 1; grid-row: 2 / 4; padding: 0 var(--s4) calc(var(--s3) + var(--sa-bottom)); }
  #enhanceShare .enh-share-foot { grid-column: 2; grid-row: 2 / 4; align-self: center; padding: var(--s2) calc(var(--s4) + var(--sa-right)) calc(var(--s3) + var(--sa-bottom)) var(--s2); }
  .enh-share-foot .btn { min-height: 52px; font-size: 1rem; }
}

/* Landscape phones: the home screens' sample photo on the left at full height; buttons, Quick actions
   and Recent scroll on the right (2026-11-01 audit; Welcome is in styles.css). */
@media (orientation: landscape) and (max-height: 560px) {
  #enhanceHome, #editorHome { max-width: none; }
  #enhanceHome .enh-home, #editorHome .home { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); grid-auto-rows: min-content; align-content: start;
    gap: 0 var(--s5); padding: var(--s2) calc(var(--gutter) + var(--sa-right)) var(--s4) calc(var(--gutter) + var(--sa-left)); }
  #enhanceHome .enh-home > *, #editorHome .home > * { grid-column: 2; min-width: 0; margin-bottom: var(--s3); }
  #enhanceHome .enh-hero, #editorHome .ed-hero, #editorHome.has-qa .ed-hero { grid-column: 1; grid-row: 1 / span 8; position: sticky; top: 0; align-self: start; min-height: 0; margin: 0;
    height: calc(100dvh - var(--sa-top) - 56px - var(--nav-h) - var(--sa-bottom) - var(--s2) * 2); }
  #enhanceHome .enh-hero .cap h1, #editorHome .ed-hero .cap h1 { font-size: 1.75rem; line-height: 2rem; }
  .qa-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .qa-name { white-space: nowrap; }

}

/* ---------- Enhance Result on phones: the photo first ----------
   The dock under the photo is only as tall as the tool row: a tool's levels fit in the same height
   (level tiles, then one bar with Back, the tool's name, Default and Done), so the photo gets the
   rest of the screen and never changes size. The split handle and labels are small dark glass. */
@media (max-width: 959px) and (min-height: 601px) {
  #enhanceResult > .enh-top { height: 52px; }
  #enhanceResult .enh-stage { padding: 0 6px; }
  #enhanceResult .enh-frame { border-radius: 16px; }
  #enhanceResult .enh-toggles { padding: var(--s2) var(--gutter) calc(var(--s2) + var(--sa-bottom)); }
  #enhanceResult .enh-t { min-height: 0; padding: 6px 2px 4px; }
  #enhanceResult .enh-levels { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 44px; grid-template-rows: auto auto; align-items: center;
    column-gap: var(--s2); row-gap: 4px; padding: var(--s2) calc(var(--gutter) - 6px) calc(var(--s1) + var(--sa-bottom)); }
  #enhanceResult .enh-dock > .enh-levels[hidden] { display: grid !important; }
  #enhanceResult .enh-lv-row { grid-column: 1 / -1; grid-row: 1; margin: 0 calc(6px - var(--gutter)); }
  #enhanceResult .enh-lv img { height: 40px; }
  #enhanceResult .enh-lv span { padding: 4px 2px 5px; }
  #enhanceResult .enh-lv-bar { display: contents; }
  #enhanceResult .enh-lv-bar > :first-child { grid-column: 1; grid-row: 2; }
  #enhanceResult .enh-lv-bar h2 { grid-column: 2; grid-row: 2; text-align: left; font-size: 0.9375rem; line-height: 1.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #enhanceResult .enh-lv-bar > :last-child { grid-column: 4; grid-row: 2; justify-self: end; color: #f3c062; }
  #enhanceResult .enh-default { grid-column: 3; grid-row: 2; align-self: center; min-height: 44px; gap: var(--s2); font-size: 0; }
  #enhanceResult .enh-default > span { font-size: 0; }
  #enhanceResult .enh-default > span::before { content: "Default"; font-size: 0.8125rem; font-weight: 600; color: #a9a59c; }
  #enhanceResult .enh-default input { width: 40px; height: 24px; }
  #enhanceResult .enh-default input::after { width: 18px; height: 18px; }
  #enhanceResult .enh-default input:checked::after { transform: translateX(16px); }
}
/* Compare handle and Before / After labels: small dark glass on the photo. */
#enhanceResult .enh-frame .knob { background: transparent; color: #fff; box-shadow: none; }
#enhanceResult .enh-frame .knob::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: rgb(14 14 16 / .5); box-shadow: inset 0 0 0 1.5px #fff, 0 2px 10px rgb(0 0 0 / .35);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
#enhanceResult .enh-frame .knob svg { position: relative; width: 18px; height: 18px; }
#enhanceResult .enh-frame .enh-pill.left, #enhanceResult .enh-frame .enh-pill.right { padding: 3px 10px; font-size: 0.75rem; background: rgb(14 14 16 / .5);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* Saved screen: Share is the one gold button; Enhance another sits quietly under it. */
.enh-share-foot .btn.quiet { min-height: 52px; background: rgb(255 255 255 / 0.08); color: #f7f3ea; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14); font-size: 1rem; }
.enh-share-foot .btn { gap: var(--s2); }
.enh-share-foot .btn svg { width: 20px; height: 20px; }

/* =====================================================================================
   Premium pass (2026-11-17). Golden Hour, pushed further: a champagne wordmark, a jewel-like
   before/after seam, photo-led Create cards, a quiet gold nav indicator, a calmer action stack,
   and a soft rise as home screens appear. Only colors, borders, transforms and opacity move.
   ===================================================================================== */
.top-start { justify-self: start; display: flex; align-items: center; min-width: 44px; }
.home-chip { padding: 0 2px; }
.home-chip span { background: rgb(243 192 98 / .12); box-shadow: inset 0 0 0 1px rgb(243 192 98 / .42); color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; padding: 5px 12px 5px 10px; }
.home-chip svg { color: #f3c062; }

/* Wordmark on the two home screens: pearl with a slow champagne glint. */
#enhanceHome .wordmark, #editorHome .wordmark {
  background: linear-gradient(100deg, var(--text) 0%, var(--text) 40%, #ffe3a3 50%, var(--text) 60%, var(--text) 100%);
  background-size: 260% 100%; background-position: 100% 0; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gs-glint 9s ease-in-out 1.8s infinite; }
@keyframes gs-glint { 0% { background-position: 100% 0; } 22%, 100% { background-position: 0 0; } }
:root[data-theme="light"] #enhanceHome .wordmark, :root[data-theme="light"] #editorHome .wordmark { background-image: linear-gradient(100deg, var(--text) 0%, var(--text) 40%, #c48a1e 50%, var(--text) 60%, var(--text) 100%); }

/* Hero: fixed share of the screen so Create peeks in below; a gold hairline frame and a lit seam. */
#enhanceHome .enh-hero { box-shadow: 0 28px 60px -30px rgb(243 181 74 / .45); }
@media not ((orientation: landscape) and (max-height: 560px)) { #enhanceHome .enh-hero { flex: 0 0 auto; height: clamp(220px, 39dvh, 440px); min-height: 0; } }
.enh-hero::after, .ed-hero::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3;
  box-shadow: inset 0 0 0 1px rgb(255 227 163 / .18); }
.enh-hero .line { width: 2px; background: linear-gradient(to bottom, rgb(255 246 225 / .2), #ffe8b8 30%, #fff 50%, #ffe8b8 70%, rgb(255 246 225 / .2));
  box-shadow: 0 0 10px rgb(255 214 140 / .9), 0 0 28px rgb(243 181 74 / .55); }
.enh-hero .line::after { content: ""; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  background: rgb(18 16 14 / .38) radial-gradient(circle, rgb(255 227 163 / .9) 0 2.5px, transparent 3px); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1.5px rgb(255 240 210 / .9), 0 0 18px rgb(243 181 74 / .6); }
.enh-hero .enh-pill.ai, .ed-hero .enh-pill.ai { font-size: 0.625rem; font-weight: 600; letter-spacing: .02em; padding: 2px 8px; background: rgb(0 0 0 / .38); color: rgb(255 255 255 / .86); }
.enh-hero .enh-pill.left, .enh-hero .enh-pill.right { font-size: 0.75rem; letter-spacing: .04em; text-transform: uppercase; padding: 3px 10px; }
.enh-hero .cap h1, .ed-hero .cap h1 { letter-spacing: -0.01em; }
.enh-hero .cap h1::after, .ed-hero .cap h1::after { content: ""; display: block; width: 28px; height: 2px; margin: 8px 0 2px; border-radius: 1px; background: var(--champagne); }

/* Actions: one gold call, then two quiet halves side by side. */
.enh-cta { grid-template-columns: minmax(0, 1fr); }
.enh-duo { display: flex; gap: var(--s2); min-width: 0; }
.enh-duo > * { flex: 1 1 0; min-width: 0; }
.enh-duo .btn, .enh-duo .enh-batch-link { min-height: 48px; border-radius: 16px; font-size: 0.9375rem; font-weight: 600; gap: 6px; padding: 0 10px;
  background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; }
.enh-duo .btn svg, .enh-duo .enh-batch-link svg { width: 18px; height: 18px; color: #f3c062; }
.enh-duo small { font-size: 0.6875rem; font-weight: 700; color: var(--free); margin-left: 2px; }
.enh-duo .enh-batch-link .pro-chip { margin-left: 2px; }
.enh-duo .enh-batch-link:active, .enh-duo .btn:active { transform: scale(.97); }
:root[data-theme="light"] .enh-duo .btn svg, :root[data-theme="light"] .enh-duo .enh-batch-link svg { color: #a86f12; }

/* Create: photo-led cards (a real result on the sample in each), like a magazine's contents page. */
.studio-wrap { margin: var(--s2) 0 var(--s3); }
.studio-wrap-h { font: 600 1.25rem/1.5rem var(--font-display); letter-spacing: 0; text-transform: none; color: var(--text); margin: 0 0 var(--s3); display: flex; align-items: baseline; gap: 8px; }
.studio-wrap-h::after { content: "AI studio"; font: 700 0.625rem/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: #f3c062; }
.studio-strip { grid-auto-columns: 136px; gap: 10px; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 6px; scroll-padding: 0 var(--gutter); }
.studio-card.pic { padding: 12px; min-height: 0; aspect-ratio: 3 / 4; overflow: hidden; isolation: isolate; border: 0; align-content: end; gap: 2px; color: #fff;
  background: #1a1714; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06), 0 14px 28px -18px rgb(0 0 0 / .8); transition: transform var(--t-press-up) ease-out; }
.studio-card.pic::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgb(10 8 6 / .92) 0%, rgb(10 8 6 / .55) 34%, rgb(10 8 6 / 0) 62%); }
.studio-card.pic .studio-pic { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; transition: transform 600ms cubic-bezier(.2, .8, .2, 1); }
.studio-card.pic .studio-ic { display: none; }
.studio-card.pic b { font-size: 0.9375rem; line-height: 1.2rem; text-shadow: 0 1px 8px rgb(0 0 0 / .4); }
.studio-card.pic small { color: rgb(255 255 255 / .74); font-size: 0.6875rem; line-height: 0.9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.studio-card.pic .studio-new { position: absolute; top: 8px; left: 8px; right: 8px; margin: 0; justify-self: start; width: max-content; max-width: calc(100% - 16px); background: var(--champagne); color: #1a1206; }
.studio-card:active { transform: scale(.97); transition-duration: var(--t-press-down); }
.studio-card:active .studio-pic { transform: scale(1.04); }

/* Bottom navigation: a gold hairline instead of a rule, and a soft gold capsule behind the current icon. */
.nav { border-top: 0; position: relative; background: var(--bg); }
.nav::before { content: ""; position: absolute; top: 0; left: 12%; right: 12%; height: 1px; background: linear-gradient(90deg, transparent, rgb(243 192 98 / .32), transparent); pointer-events: none; }
.nav button > span:first-child { display: grid; place-items: center; width: 56px; height: 30px; border-radius: 15px; transition: background var(--t-select), box-shadow var(--t-select), transform 200ms cubic-bezier(.2, .9, .3, 1.3); }
.nav button[aria-current="page"] > span:first-child { background: rgb(243 192 98 / .14); box-shadow: inset 0 0 0 1px rgb(243 192 98 / .28); }
.nav button[aria-current="page"] svg { color: #f3c062; }
.nav button:active > span:first-child { transform: scale(.92); }
:root[data-theme="light"] .nav button[aria-current="page"] svg { color: #a86f12; }
.nav.dark::before, .dark.nav::before { opacity: .7; }

/* Home screens appear with a short, staggered rise. */
@keyframes gs-rise { from { opacity: 0; transform: translateY(10px); } }
#enhanceHome:not([hidden]) .enh-home > *, #editorHome:not([hidden]) .home > * { animation: gs-rise 420ms cubic-bezier(.2, .8, .2, 1) both; }
#enhanceHome .enh-home > :nth-child(2), #editorHome .home > :nth-child(2) { animation-delay: 60ms; }
#enhanceHome .enh-home > :nth-child(3), #editorHome .home > :nth-child(3) { animation-delay: 120ms; }
#enhanceHome .enh-home > :nth-child(n+4), #editorHome .home > :nth-child(n+4) { animation-delay: 180ms; }

/* Result: the save button is the gold moment of the flow. */
#enhanceResult .enh-dl { background: var(--cta); color: var(--cta-fg); box-shadow: 0 0 0 1px rgb(255 217 138 / .35), 0 8px 22px -8px rgb(243 181 74 / .7); }

/* Paywall: the chosen plan is lit in gold, the headline's accent is champagne. */
dialog.pw .plan[aria-checked="true"] { background: linear-gradient(160deg, rgb(255 227 163 / .12), rgb(243 181 74 / .03) 60%), var(--surface);
  box-shadow: inset 0 0 0 1.5px #f3c062, 0 14px 30px -18px rgb(243 181 74 / .7); }
dialog.pw #pwTitle em { background: var(--champagne); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 2px; }
:root[data-theme="light"] dialog.pw #pwTitle em { background: none; color: #8a5a10; }
:root[data-theme="light"] dialog.pw .plan[aria-checked="true"] { box-shadow: inset 0 0 0 1.5px #b07a1c, 0 14px 30px -18px rgb(176 122 28 / .5); }

/* Settings: the plan card reads like a membership card. */
#settings .plan-card { position: relative; overflow: hidden; background: radial-gradient(120% 140% at 100% 0%, rgb(243 192 98 / .22), transparent 55%), linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid rgb(243 192 98 / .28); }
#settings .plan-card #planLine { font-family: var(--font); font-variation-settings: normal; font-size: 1rem; line-height: 1.4rem; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  #enhanceHome .wordmark, #editorHome .wordmark { animation: none; background-position: 0 0; }
  #enhanceHome:not([hidden]) .enh-home > *, #editorHome:not([hidden]) .home > * { animation: none; }
}

/* Home polish (2026-11-17, user's Samsung screenshots): the AI-sample note sits on the title line,
   clear of the faces, the hair and the compare seam; Quick action icons are smaller so they cover
   less of the faces; both homes fade out above the tab bar instead of a hard cut. */
.enh-hero .cap > .enh-pill.ai, .ed-hero .cap > .enh-pill.ai { position: absolute; top: calc(var(--cap-top, 56px) + 12px); right: var(--s4); bottom: auto; left: auto; z-index: 1; }
.enh-hero .cap h1, .ed-hero .cap h1 { padding-right: 132px; }
#enhanceHome .enh-home, #editorHome .home { padding-bottom: 36px;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 32px), transparent); mask-image: linear-gradient(#000 calc(100% - 32px), transparent); }
.qa-ph i { left: 6px; bottom: 6px; width: 24px; height: 24px; background: rgb(13 13 16 / .6); box-shadow: 0 0 0 1px rgb(255 217 138 / .28); }
.qa-ph i svg { width: 14px; height: 14px; }
