:root {
  --bg: #07070d;
  --bg2: #0c0d17;
  --s1: rgba(255, 255, 255, 0.045);
  --s2: rgba(255, 255, 255, 0.075);
  --s3: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.085);
  --line2: rgba(255, 255, 255, 0.16);
  --tx: #f4f2ff;
  --tx2: rgba(238, 236, 255, 0.68);
  --tx3: rgba(238, 236, 255, 0.42);
  --peri: #8ea2ff;
  --lav: #b48cff;
  --pink: #ff8dbb;
  --peach: #ffc28e;
  --cyan: #7fd6ff;
  --grad: linear-gradient(115deg, #8ea2ff 0%, #b48cff 36%, #ff8dbb 70%, #ffc28e 100%);
  --grad-soft: linear-gradient(115deg, rgba(142, 162, 255, 0.22), rgba(180, 140, 255, 0.2) 40%, rgba(255, 141, 187, 0.18) 75%, rgba(255, 194, 142, 0.16));
  --r: 22px;
  --r-sm: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --display: 'Unbounded', 'Onest', system-ui, sans-serif;
  --body: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-t: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-b: max(var(--tg-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));
  --gutter: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--tx); }
html { overflow-x: hidden; overscroll-behavior-y: none; scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }
body {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: rgba(180, 140, 255, 0.35); }

/* ───────── sky ───────── */
.sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: radial-gradient(120% 80% at 50% -10%, #141533 0%, var(--bg) 55%); }
#stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.aurora { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5; will-change: transform; }
.a1 { width: 70vmax; height: 70vmax; left: -30vmax; top: -25vmax; background: radial-gradient(circle, rgba(110, 130, 255, 0.55), transparent 65%); animation: drift1 26s var(--ease) infinite alternate; }
.a2 { width: 60vmax; height: 60vmax; right: -28vmax; top: 10vh; background: radial-gradient(circle, rgba(255, 120, 180, 0.4), transparent 65%); animation: drift2 32s var(--ease) infinite alternate; }
.a3 { width: 55vmax; height: 55vmax; left: 10vw; bottom: -35vmax; background: radial-gradient(circle, rgba(170, 120, 255, 0.45), transparent 65%); animation: drift3 38s var(--ease) infinite alternate; }
@keyframes drift1 { to { transform: translate3d(12vw, 10vh, 0) scale(1.15); } }
@keyframes drift2 { to { transform: translate3d(-14vw, 14vh, 0) scale(0.9); } }
@keyframes drift3 { to { transform: translate3d(10vw, -12vh, 0) scale(1.2); } }
.grain {
  position: absolute; inset: -50%; opacity: 0.07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 33% { transform: translate(-3%, 2%); } 66% { transform: translate(2%, -3%); } 100% { transform: translate(0, 0); } }

/* ───────── layout ───────── */
.app { position: relative; z-index: 1; min-height: 100%; max-width: 560px; margin: 0 auto; overflow-x: clip; padding: calc(var(--safe-t) + 8px) var(--gutter) 0; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: calc(var(--safe-t) + 8px) var(--gutter) 10px; margin: calc(-1 * (var(--safe-t) + 8px)) calc(-1 * var(--gutter)) 0; background: linear-gradient(to bottom, rgba(7, 7, 13, 0.92) 40%, rgba(7, 7, 13, 0)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.brand { display: flex; align-items: center; gap: 10px; }
.mark { position: relative; width: 30px; height: 30px; border-radius: 10px; background: radial-gradient(circle at 30% 30%, #2a2d66, #0d0e1f 70%); box-shadow: inset 0 0 0 1px var(--line2), 0 6px 18px -6px rgba(140, 150, 255, 0.6); overflow: hidden; }
.mark i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px 2px rgba(190, 200, 255, 0.9), 0 0 16px 4px rgba(150, 140, 255, 0.5); }
.mark i:first-child { left: 8px; top: 8px; }
.mark i:last-child { right: 7px; bottom: 7px; background: #ffe7cf; box-shadow: 0 0 8px 2px rgba(255, 210, 170, 0.9), 0 0 16px 4px rgba(255, 140, 180, 0.45); }
.mark.big { width: 64px; height: 64px; border-radius: 20px; }
.mark.big i { width: 11px; height: 11px; }
.mark.big i:first-child { left: 16px; top: 16px; }
.mark.big i:last-child { right: 15px; bottom: 15px; }
.brand-text { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: -0.02em; color: var(--tx); }
.brand-text b { font-weight: 500; color: var(--tx3); margin-left: 3px; }
.balance-pill { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 10px; border-radius: 999px; background: var(--s2); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-variant-numeric: tabular-nums; transition: transform 0.25s var(--spring); }
.balance-pill:active { transform: scale(0.94); }
.bolt { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--grad); font-size: 12px; filter: saturate(1.1); }
.pro-chip { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; padding: 3px 6px; border-radius: 6px; background: var(--grad); color: #1a1030; }

.view { display: none; padding-bottom: calc(176px + var(--safe-b)); }
.view.is-active { display: block; animation: viewIn 0.5s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.spacer { height: 12px; }
.view-title { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -0.03em; margin: 18px 0 4px; }
.view-sub { color: var(--tx2); margin: 0 0 18px; }
.group-title { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tx3); margin: 26px 2px 12px; }

/* ───────── hero ───────── */
.hero { position: relative; padding: 26px 0 22px; min-height: 196px; }
.constellation { position: absolute; right: 0; top: -6px; width: 60%; max-width: 260px; aspect-ratio: 1; opacity: 0.95; overflow: visible; }
.constellation line { stroke: rgba(190, 196, 255, 0.55); stroke-width: 0.35; stroke-linecap: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 1.6s var(--ease) forwards; }
.constellation circle.s { fill: #fff; animation: twinkle 3.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.constellation circle.h { fill: url(#halo); opacity: 0.7; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.eyebrow { position: relative; display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--tx2); background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: blur(8px); }
.eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 10px rgba(180, 140, 255, 0.9); }
.hero-title { position: relative; font-family: var(--display); font-weight: 600; font-size: clamp(32px, 9.2vw, 44px); line-height: 1.04; letter-spacing: -0.045em; margin: 0; max-width: 11ch; }
.grad-text { background: var(--grad); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 6s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.reveal { animation: rise 0.8s var(--ease) backwards; }
.reveal:nth-child(2) { animation-delay: 0.06s; }
.reveal:nth-child(3) { animation-delay: 0.12s; }
.reveal:nth-child(4) { animation-delay: 0.18s; }
.reveal:nth-child(5) { animation-delay: 0.24s; }
.reveal:nth-child(6) { animation-delay: 0.3s; }
.reveal:nth-child(7) { animation-delay: 0.36s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ───────── segmented ───────── */
.segmented { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 16px; background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 14px; }
.seg { position: relative; z-index: 1; height: 40px; border-radius: 12px; font-weight: 600; font-size: 14px; color: var(--tx2); transition: color 0.3s; }
.seg.is-on { color: var(--tx); }
.seg-ind { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 12px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06)); box-shadow: inset 0 0 0 1px var(--line2), 0 8px 24px -10px rgba(150, 140, 255, 0.7); transition: transform 0.45s var(--spring); }
.segmented[data-mode='edit'] .seg-ind { transform: translateX(100%); }

/* ───────── cards ───────── */
.card { position: relative; border-radius: var(--r); background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)); box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); }
.composer { padding: 14px; transition: box-shadow 0.3s; }
.composer.is-focus { box-shadow: inset 0 0 0 1px rgba(180, 160, 255, 0.45), 0 0 0 4px rgba(150, 140, 255, 0.08), 0 20px 50px -24px rgba(150, 140, 255, 0.6); }
.prompt-wrap { position: relative; }
#prompt { width: 100%; min-height: 84px; max-height: 220px; resize: none; border: 0; outline: 0; background: transparent; color: var(--tx); font: 500 17px/1.45 var(--body); letter-spacing: -0.01em; padding: 2px 2px 0; }
.prompt-ph { position: absolute; left: 2px; top: 2px; right: 2px; pointer-events: none; color: var(--tx3); font: 500 17px/1.45 var(--body); }
.prompt-ph .caret { display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: -3px; background: var(--lav); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.composer-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.ghost-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--tx2); background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.25s var(--spring), color 0.2s, background 0.2s; }
.ghost-btn:active { transform: scale(0.95); }
.ghost-btn:hover { color: var(--tx); }
.ghost-btn.is-busy .spark { animation: spin 0.9s linear infinite; }
.spark { display: inline-block; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.counter { font-size: 12px; color: var(--tx3); font-variant-numeric: tabular-nums; }

/* upload */
.upload { margin-bottom: 12px; }
.drop { display: grid; justify-items: center; gap: 6px; padding: 22px 12px; border-radius: 16px; border: 1.5px dashed rgba(180, 170, 255, 0.28); background: radial-gradient(120% 120% at 50% 0%, rgba(150, 140, 255, 0.12), transparent 70%); cursor: pointer; transition: border-color 0.2s, transform 0.25s var(--spring); }
.drop:active { transform: scale(0.98); }
.drop-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--grad); box-shadow: 0 10px 30px -10px rgba(180, 140, 255, 0.8); }
.drop-icon svg { width: 22px; height: 22px; fill: none; stroke: #140f2b; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.drop-title { font-weight: 600; }
.drop-sub { font-size: 12px; color: var(--tx3); }
.thumb { position: relative; border-radius: 16px; overflow: hidden; max-height: 260px; background: #000; }
.thumb img { width: 100%; max-height: 260px; object-fit: contain; }
.thumb-x { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); font-size: 13px; }
.chips { display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; margin: -8px calc(-1 * var(--gutter)) -14px; padding: 8px var(--gutter) 16px; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); overscroll-behavior-x: contain; }
.chips::-webkit-scrollbar, .styles::-webkit-scrollbar { display: none; }
.composer .chips { margin: 4px -14px -14px; padding: 8px 14px 16px; scroll-padding-inline: 14px; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 12px; font-size: 13.5px; font-weight: 600; color: var(--tx2); background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); scroll-snap-align: start; transition: transform 0.25s var(--spring), color 0.2s, box-shadow 0.25s, background 0.25s; }
.chip:active { transform: scale(0.94); }
.chip.is-on { color: var(--tx); background: var(--grad-soft); box-shadow: inset 0 0 0 1px rgba(190, 170, 255, 0.55), 0 8px 22px -12px rgba(180, 140, 255, 0.9); }
.ar { display: inline-block; border: 1.6px solid currentColor; border-radius: 3px; opacity: 0.85; }

/* blocks */
.block { margin-top: 22px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 10px; }
.block-head h3 { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tx3); margin: 0; }
.block-val { font-size: 13px; color: var(--tx2); }

/* styles */
.styles { display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; margin: -10px calc(-1 * var(--gutter)) -14px; padding: 14px var(--gutter) 22px; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); overscroll-behavior-x: contain; }
.style { flex: none; width: 92px; scroll-snap-align: start; text-align: center; transition: transform 0.3s var(--spring); }
.style:active { transform: scale(0.94); }
.style-art { position: relative; display: block; width: 92px; height: 115px; border-radius: 18px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 0.3s, transform 0.4s var(--spring); }
.style.is-on .style-art { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #c9b5ff, 0 12px 24px -14px rgba(180, 140, 255, 1); transform: translateY(-3px); }
.style-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.35)); }
.style-name { display: block; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--tx2); }
.style.is-on .style-name { color: var(--tx); }
.style-art img { width: 100%; height: 100%; object-fit: cover; }

.st-none { background: radial-gradient(circle at 50% 45%, rgba(190, 180, 255, 0.35), transparent 45%), #12132a; }
.st-none::before { content: '✦'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; color: #fff; text-shadow: 0 0 18px rgba(200, 190, 255, 0.9); }
.st-photo { background: radial-gradient(circle at 70% 30%, #ffd9a3 0 12%, transparent 13%), linear-gradient(180deg, #f6a96b 0%, #c4577a 55%, #2b1d3d 56%, #1b1428 100%); }
.st-cinema { background: linear-gradient(180deg, #000 0 14%, transparent 14% 86%, #000 86%), linear-gradient(120deg, #0f4c5c, #e36414 120%); }
.st-anime { background: radial-gradient(circle at 30% 30%, #fff 0 2%, transparent 3%), radial-gradient(circle at 70% 55%, #fff 0 1.5%, transparent 2.5%), linear-gradient(180deg, #ff9ec7, #a9c6ff); }
.st-toon3d { background: radial-gradient(circle at 35% 40%, #ffd166 0 18%, transparent 19%), radial-gradient(circle at 65% 65%, #5ec8ff 0 22%, transparent 23%), radial-gradient(circle at 35% 35%, #fff6 0, transparent 40%), linear-gradient(160deg, #3a2f80, #1a1640); }
.st-watercolor { background: radial-gradient(circle at 30% 30%, rgba(255, 140, 170, 0.75), transparent 40%), radial-gradient(circle at 70% 60%, rgba(120, 190, 255, 0.75), transparent 42%), radial-gradient(circle at 40% 80%, rgba(255, 220, 140, 0.7), transparent 40%), #f7f1e8; }
.st-oil { background: repeating-linear-gradient(115deg, rgba(0, 0, 0, 0.12) 0 2px, transparent 2px 6px), linear-gradient(140deg, #6b2d1a, #c8862e 45%, #3a5a40); }
.st-comic { background: radial-gradient(circle, #000 22%, transparent 24%) 0 0 / 9px 9px, linear-gradient(135deg, #ffd60a, #ff6b35); }
.st-pixel { background: repeating-conic-gradient(#7b5cff 0 25%, #4d3bd1 0 50%) 0 0 / 16px 16px; }
.st-pixel::before { content: ''; position: absolute; left: 28px; top: 34px; width: 32px; height: 32px; background: #ffd166; box-shadow: 8px 8px 0 #ff6b9e; }
.st-cyber { background: linear-gradient(transparent 60%, rgba(0, 255, 255, 0.35) 61%, transparent 62%), repeating-linear-gradient(90deg, rgba(255, 0, 200, 0.35) 0 1px, transparent 1px 14px), linear-gradient(180deg, #120428, #3a0d5c 60%, #05010f); }
.st-clay { background: radial-gradient(circle at 40% 38%, #ffb38a 0 20%, transparent 21%), radial-gradient(circle at 62% 62%, #8ad1c2 0 24%, transparent 25%), linear-gradient(160deg, #f3d9c4, #d8b49a); }
.st-figure { background: radial-gradient(ellipse at 50% 92%, rgba(0, 0, 0, 0.5) 0 18%, transparent 19%), radial-gradient(circle at 50% 42%, #cfd4ff 0 18%, transparent 19%), linear-gradient(180deg, #d9dcf2, #8f93b8); }
.st-logo { background: #0f0f14; }
.st-logo::before { content: ''; position: absolute; left: 50%; top: 46%; width: 34px; height: 34px; transform: translate(-50%, -50%) rotate(45deg); border-radius: 8px; background: var(--grad); }
.st-sticker { background: radial-gradient(circle at 50% 45%, #ff8dbb 0 24%, #fff 25% 31%, transparent 32%), #d7f0ff; }
.st-retro { background: linear-gradient(180deg, rgba(255, 200, 120, 0.35), transparent), linear-gradient(140deg, #d9895a, #4a8c8c); filter: saturate(0.85); }
.st-neon { background: radial-gradient(ellipse at 50% 50%, transparent 30%, transparent 31%), #13060f; }
.st-neon::before { content: ''; position: absolute; left: 22px; right: 22px; top: 44px; height: 22px; border-radius: 12px; border: 3px solid #ff4fd8; box-shadow: 0 0 12px #ff4fd8, inset 0 0 10px #ff4fd8, 0 0 30px rgba(255, 79, 216, 0.6); }

/* quality */
.quality { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.q { position: relative; padding: 12px 10px 11px; border-radius: 16px; text-align: left; background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.25s var(--spring), box-shadow 0.25s, background 0.25s; }
.q:active { transform: scale(0.96); }
.q.is-on { background: var(--grad-soft); box-shadow: inset 0 0 0 1px rgba(190, 170, 255, 0.55), 0 12px 28px -16px rgba(180, 140, 255, 1); }
.q-name { display: block; font-weight: 700; font-size: 14px; }
.q-sub { display: block; font-size: 11.5px; color: var(--tx3); margin-top: 2px; min-height: 2.6em; line-height: 1.3; }
.q-price { display: inline-flex; margin-top: 6px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.25); }

/* ───────── buttons ───────── */
.btn-primary { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 54px; padding: 0 22px; border-radius: 18px; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; color: #150e2e; background: var(--grad); background-size: 160% 100%; box-shadow: 0 14px 36px -14px rgba(180, 140, 255, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.45); overflow: hidden; text-decoration: none; transition: transform 0.3s var(--spring), filter 0.2s, opacity 0.2s, background-position 0.6s var(--ease); }
.btn-primary::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.55) 48%, transparent 66%); transform: translateX(-120%); animation: sheen 3.6s var(--ease) infinite; }
@keyframes sheen { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { filter: grayscale(0.7) brightness(0.7); opacity: 0.7; }
.btn-primary:disabled::after { display: none; }
.btn-primary.small { height: 44px; font-size: 14px; border-radius: 14px; }
.btn-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 16px; border-radius: 16px; font-weight: 600; font-size: 14px; background: var(--s2); box-shadow: inset 0 0 0 1px var(--line2); transition: transform 0.25s var(--spring), background 0.2s; }
.btn-secondary:active { transform: scale(0.96); background: var(--s3); }
.chip-btn { flex: none; height: 32px; padding: 0 12px; border-radius: 10px; font-size: 12.5px; font-weight: 700; background: var(--s2); box-shadow: inset 0 0 0 1px var(--line2); }
.chip-btn:active { transform: scale(0.95); }

.cta-bar { position: fixed; z-index: 30; left: 0; right: 0; bottom: calc(76px + var(--safe-b)); padding: 0 var(--gutter); max-width: 560px; margin: 0 auto; transition: transform 0.45s var(--ease), opacity 0.3s; }
.cta-bar.is-hidden { transform: translateY(40px); opacity: 0; pointer-events: none; }
.cta { width: 100%; justify-content: space-between; }
.cta-cost { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 12px; background: rgba(20, 12, 46, 0.16); font-size: 14px; }

/* ───────── tabbar ───────── */
.tabbar { position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b)); width: min(calc(100% - 2 * var(--gutter)), 528px); height: 60px; display: grid; grid-template-columns: repeat(5, 1fr); padding: 5px; border-radius: 22px; background: rgba(16, 16, 30, 0.72); box-shadow: inset 0 0 0 1px var(--line2), 0 20px 50px -20px rgba(0, 0, 0, 0.9); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4); }
.tab { position: relative; z-index: 1; display: grid; justify-items: center; align-content: center; gap: 3px; border-radius: 17px; color: var(--tx3); font-size: 10.5px; font-weight: 600; transition: color 0.3s; }
.tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; transition: transform 0.4s var(--spring); }
.tab.is-on { color: var(--tx); }
.tab.is-on svg { transform: translateY(-1px) scale(1.08); stroke: url(#tabGrad); }
.tab-ind { position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc((100% - 10px) / 5); border-radius: 17px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)); box-shadow: inset 0 0 0 1px var(--line2); transition: transform 0.5s var(--spring); }

/* ───────── tools ───────── */
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tool { position: relative; display: grid; gap: 10px; align-content: start; min-height: 128px; padding: 14px; border-radius: 20px; text-align: left; background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025)); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; transition: transform 0.3s var(--spring); }
.tool:active { transform: scale(0.96); }
.tool::before { content: ''; position: absolute; width: 120px; height: 120px; right: -40px; top: -40px; border-radius: 50%; background: var(--tool-c, #8ea2ff); opacity: 0.18; filter: blur(24px); }
.tool-ic { display: grid; place-items: center; width: 46px; height: 46px; margin: -4px 0 0 -4px; }
.tool-name { font-weight: 700; font-size: 14.5px; letter-spacing: -0.01em; }
.tool-sub { font-size: 12px; color: var(--tx3); line-height: 1.35; }
.tool-cost { position: absolute; right: 12px; top: 14px; font-size: 11px; font-weight: 700; color: var(--tx2); }
.guest-card { display: flex; align-items: center; gap: 14px; padding: 16px; margin-top: 22px; overflow: hidden; }
.guest-orb { flex: none; width: 44px; height: 44px; border-radius: 50%; background: conic-gradient(from 0deg, #8ea2ff, #b48cff, #ff8dbb, #ffc28e, #8ea2ff); animation: spin 6s linear infinite; mask: radial-gradient(circle, transparent 46%, #000 48%); -webkit-mask: radial-gradient(circle, transparent 46%, #000 48%); }
.guest-title { font-weight: 700; }
.guest-sub { font-size: 13px; color: var(--tx2); }
.guest-card .chip-btn { margin-left: auto; }

/* ───────── gallery ───────── */
.masonry { columns: 2; column-gap: 10px; }
.g-item { position: relative; display: block; width: 100%; break-inside: avoid; margin-bottom: 10px; border-radius: 18px; overflow: hidden; background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); animation: popIn 0.6s var(--ease) backwards; }
.g-item img { width: 100%; height: auto; }
.g-item .g-q { position: absolute; left: 8px; top: 8px; font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 7px; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(6px); }
@keyframes popIn { from { opacity: 0; transform: scale(0.97); } }
.empty { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 40px 10px; color: var(--tx2); }
.empty-art { position: relative; width: 120px; height: 90px; }
.empty-art span { position: absolute; width: 64px; height: 80px; border-radius: 14px; background: var(--s2); box-shadow: inset 0 0 0 1px var(--line2); }
.empty-art span:nth-child(1) { left: 6px; transform: rotate(-12deg); }
.empty-art span:nth-child(2) { left: 28px; top: -4px; background: var(--grad-soft); }
.empty-art span:nth-child(3) { left: 50px; transform: rotate(12deg); }
.more { display: flex; margin: 10px auto 0; }

/* ───────── wallet ───────── */
.balance-card { padding: 22px 20px 20px; margin-top: 14px; overflow: hidden; }
.bc-glow { position: absolute; width: 240px; height: 240px; right: -60px; top: -90px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 141, 187, 0.45), transparent 60%); filter: blur(10px); }
.bc-label { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tx3); }
.bc-amount { position: relative; display: flex; align-items: baseline; gap: 6px; margin: 6px 0 4px; font-family: var(--display); font-weight: 600; font-size: 56px; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.bc-unit { font-size: 30px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bc-sub { color: var(--tx2); }
.bc-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.meta-pill { font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 10px; background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); color: var(--tx2); }
.pro-card { padding: 18px; margin-top: 12px; }
.pro-card::before { content: ''; position: absolute; inset: 0; padding: 1.5px; border-radius: var(--r); background: conic-gradient(from var(--a, 0deg), #8ea2ff, #b48cff, #ff8dbb, #ffc28e, #8ea2ff); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: rotA 6s linear infinite; pointer-events: none; }
@property --a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes rotA { to { --a: 360deg; } }
.pro-head { display: flex; align-items: center; justify-content: space-between; }
.pro-badge { font-family: var(--display); font-weight: 600; font-size: 20px; letter-spacing: -0.03em; }
.pro-price { font-weight: 700; color: var(--tx2); }
.pro-list { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; gap: 8px; }
.pro-list li { display: flex; gap: 10px; align-items: center; color: var(--tx2); }
.pro-list li::before { content: '✓'; display: grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 800; color: #150e2e; background: var(--grad); }
.pro-card .btn-primary { width: 100%; }
.pro-card.is-active .btn-primary { display: none; }
.packs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pack { position: relative; padding: 16px 14px 14px; border-radius: 20px; text-align: left; background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025)); box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.3s var(--spring); overflow: hidden; }
.pack:active { transform: scale(0.96); }
.pack.hot { box-shadow: inset 0 0 0 1px rgba(255, 170, 200, 0.5), 0 16px 40px -22px rgba(255, 141, 187, 0.9); }
.pack-credits { font-family: var(--display); font-weight: 600; font-size: 26px; letter-spacing: -0.04em; }
.pack-credits small { font-size: 15px; margin-left: 2px; }
.pack-price { display: inline-flex; margin-top: 10px; padding: 6px 10px; border-radius: 10px; font-weight: 700; font-size: 13px; background: var(--s2); }
.pack-tag { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 800; padding: 3px 7px; border-radius: 7px; color: #150e2e; background: var(--grad); }
.pack-note { display: block; font-size: 11.5px; color: var(--tx3); margin-top: 2px; }
.ref-card { padding: 18px; margin-top: 22px; display: grid; gap: 10px; }
.ref-title { font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -0.03em; }
.ref-sub { color: var(--tx2); font-size: 13.5px; }
.ref-link { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); box-shadow: inset 0 0 0 1px var(--line); }
.ref-link code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--tx2); }
.ref-stats { font-size: 12.5px; color: var(--tx3); }
.fine { text-align: center; font-size: 12px; color: var(--tx3); margin: 18px 0 0; }

/* ───────── generating overlay ───────── */
.gen { position: fixed; inset: 0; z-index: 80; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; background: rgba(6, 6, 12, 0.72); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); animation: fade 0.35s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.gen-core { position: relative; width: 180px; height: 180px; display: grid; place-items: center; margin-bottom: 10px; }
.ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, transparent, #8ea2ff, #b48cff, #ff8dbb, #ffc28e, transparent 70%); animation: spin 2.4s linear infinite; -webkit-mask: radial-gradient(circle, transparent 62%, #000 63%, #000 66%, transparent 67%); mask: radial-gradient(circle, transparent 62%, #000 63%, #000 66%, transparent 67%); filter: drop-shadow(0 0 12px rgba(180, 140, 255, 0.8)); }
.orbit { position: absolute; inset: 30px; animation: spin 3.2s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite; }
.twin { position: absolute; width: 14px; height: 14px; border-radius: 50%; top: 50%; left: 50%; margin: -7px; }
.twin.t1 { transform: translateX(-34px); background: #eef1ff; box-shadow: 0 0 14px 4px rgba(170, 185, 255, 0.95), 0 0 40px 12px rgba(120, 140, 255, 0.5); }
.twin.t2 { transform: translateX(34px); background: #ffe8d2; box-shadow: 0 0 14px 4px rgba(255, 205, 165, 0.95), 0 0 40px 12px rgba(255, 140, 180, 0.5); }
.gen-status { font-family: var(--display); font-weight: 600; font-size: 20px; letter-spacing: -0.03em; text-align: center; min-height: 1.4em; animation: statusIn 0.5s var(--ease); }
@keyframes statusIn { from { opacity: 0; transform: translateY(6px); filter: blur(4px); } }
.gen-timer { font-variant-numeric: tabular-nums; color: var(--tx3); font-weight: 600; }
.gen-hint { font-size: 13px; color: var(--tx3); }

/* ───────── sheet ───────── */
.sheet { position: fixed; inset: 0; z-index: 90; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(4, 4, 10, 0.6); backdrop-filter: blur(6px); animation: fade 0.3s; }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: calc(100% - var(--safe-t) - 20px); overflow: auto; padding: 10px var(--gutter) calc(18px + var(--safe-b)); border-radius: 28px 28px 0 0; background: linear-gradient(180deg, #15152a, #0c0c18); box-shadow: inset 0 1px 0 var(--line2), 0 -30px 80px -30px rgba(150, 140, 255, 0.5); animation: sheetUp 0.55s var(--ease); }
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line2); margin: 0 auto 12px; }
.result-frame { position: relative; border-radius: 20px; overflow: hidden; background: #000; box-shadow: inset 0 0 0 1px var(--line); }
.result-frame img { width: 100%; max-height: 62vh; object-fit: contain; animation: reveal 1.1s var(--ease); }
@keyframes reveal { from { filter: blur(24px) saturate(1.6); transform: scale(1.06); opacity: 0.4; } }
.result-prompt { margin: 14px 2px 6px; color: var(--tx2); font-size: 14px; }
.result-meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 2px 14px; }
.result-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.result-actions .btn-secondary { flex-direction: column; height: 64px; gap: 2px; font-size: 12.5px; }
.result-actions .btn-secondary span:first-child { font-size: 18px; }
.result-sent { display: flex; justify-content: center; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--tx3); }
.result-sent span:first-child { color: #8ff0c4; font-weight: 800; }

/* ───────── toast, gate, confetti ───────── */
.toast { position: fixed; z-index: 100; left: 50%; top: calc(var(--safe-t) + 14px); transform: translate(-50%, -20px); max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 16px; font-size: 14px; font-weight: 600; background: rgba(24, 22, 44, 0.92); box-shadow: inset 0 0 0 1px var(--line2), 0 20px 40px -20px #000; backdrop-filter: blur(14px); opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.45s var(--spring); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.confetti { position: fixed; inset: 0; z-index: 110; pointer-events: none; width: 100%; height: 100%; }
.gate { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 24px; background: rgba(7, 7, 13, 0.8); backdrop-filter: blur(16px); }
.gate-card { display: grid; justify-items: center; gap: 14px; text-align: center; max-width: 320px; }
.gate-card h2 { font-family: var(--display); margin: 6px 0 0; letter-spacing: -0.03em; }
.gate-card p { color: var(--tx2); margin: 0; }

@media (min-width: 600px) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
}

/* ───────── animated premium icons ───────── */
.ic { position: relative; display: inline-grid; place-items: center; flex: none; }
.ic > img, .ic > svg { width: 100% !important; height: 100% !important; object-fit: contain; }
.ic > img { filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35)); }

/* ───────── showcase marquee ───────── */
.showcase { position: relative; margin: 2px calc(-1 * var(--gutter)) 20px; overflow: hidden; display: grid; gap: 10px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent); mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent); }
.sc-row { display: flex; gap: 10px; width: max-content; animation: marquee 48s linear infinite; will-change: transform; }
.sc-row.rev { animation-direction: reverse; animation-duration: 56s; }
.showcase:active .sc-row { animation-play-state: paused; }
.sc-item { position: relative; flex: none; width: 104px; height: 138px; border-radius: 18px; overflow: hidden; background: var(--s1); box-shadow: inset 0 0 0 1px var(--line), 0 14px 30px -18px rgba(0, 0, 0, 0.9); transition: transform 0.35s var(--spring); }
.sc-item img { width: 100%; height: 100%; object-fit: cover; }
.sc-item::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.35)); }
.sc-item:active { transform: scale(0.95); }
@keyframes marquee { to { transform: translateX(-50%); } }
.sc-hint { display: flex; align-items: center; gap: 8px; margin: -8px 2px 16px; font-size: 12px; color: var(--tx3); }
.sc-hint .ic { width: 18px; height: 18px; }

/* quality icons, wallet icons */
.q .ic { position: absolute; right: 8px; top: 8px; width: 26px; height: 26px; }
.bc-icon { position: absolute; right: 14px; top: 14px; width: 74px; height: 74px; }
.pro-head .ic { width: 34px; height: 34px; margin-right: 4px; }
.pro-badge { display: inline-flex; align-items: center; }
.pack .ic { width: 34px; height: 34px; margin-bottom: 6px; }
.ref-head { display: flex; align-items: center; gap: 10px; }
.ref-head .ic { width: 40px; height: 40px; }
.guest-card .ic { width: 44px; height: 44px; }
.tab-badge { position: absolute; top: 6px; right: calc(50% - 22px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; font-size: 10px; font-weight: 800; line-height: 16px; color: #150e2e; background: var(--grad); }
@media (max-width: 360px) { .hero-title { font-size: 30px; } .quality { gap: 6px; } .q { padding: 10px 8px; } }

.ic > div { position: absolute; inset: 0; }
.ic > div svg { width: 100% !important; height: 100% !important; transform: translateZ(0); }

.tool-ic .ic { width: 100%; height: 100%; }

.ref-card { grid-template-columns: minmax(0, 1fr); }
.ref-card > * { min-width: 0; }
.ref-sub { overflow-wrap: anywhere; }

/* brand icons: gentle float + glow */
.ic > img { animation: icFloat 5.5s ease-in-out infinite; animation-delay: var(--d, 0s); filter: drop-shadow(0 6px 14px rgba(150, 120, 255, 0.35)); }
@keyframes icFloat { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-3px) rotate(-2deg); } }
.tool:active .ic > img, .q:active .ic > img, .pack:active .ic > img { transform: scale(0.9); }

/* desktop carousels */
.styles, .chips { cursor: grab; }
.styles.is-dragging, .chips.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.styles.is-dragging *, .chips.is-dragging * { pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .styles { scrollbar-width: thin; scrollbar-color: rgba(180, 160, 255, 0.35) transparent; }
  .styles::-webkit-scrollbar { display: block; height: 6px; }
  .styles::-webkit-scrollbar-thumb { background: rgba(180, 160, 255, 0.35); border-radius: 3px; }
}

/* payment method sheet */
.pay-panel { padding-bottom: calc(22px + var(--safe-b)); }
.pay-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 4px 14px; color: var(--tx2); font-weight: 600; }
.pay-head b { font-family: var(--display); font-size: 22px; color: var(--tx); letter-spacing: -0.03em; }
.pay-list { display: grid; gap: 10px; }
.pay-m { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px; border-radius: 18px; text-align: left; font-weight: 600; background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.25s var(--spring), background 0.2s; }
.pay-m:active { transform: scale(0.97); background: var(--s2); }
.pay-m .ic { width: 36px; height: 36px; }
.pay-m span:not(.ic) { flex: 1; min-width: 0; }
.pay-m svg { width: 18px; height: 18px; fill: none; stroke: var(--tx3); stroke-width: 2; }

/* glossy light sweep over brand icons (same shape via mask, synced with the float) */
.ic[style*="--m"]::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  -webkit-mask: var(--m) center / contain no-repeat;
  mask: var(--m) center / contain no-repeat;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.85) 50%, transparent 62%) 160% 0 / 260% 100% no-repeat;
  animation: icFloat 5.5s ease-in-out infinite, icShine 6.5s ease-in-out infinite;
  animation-delay: var(--d, 0s), calc(var(--d, 0s) * 2.7);
}
@keyframes icShine {
  0%, 72% { background-position: 160% 0; }
  94%, 100% { background-position: -60% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ic::after, .ic > img { animation: none !important; }
}

/* brand icons in place of system emoji */
.ib img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(150, 120, 255, 0.35)); }
.bolt { background: none !important; }
.bolt img, .bc-unit img { width: 100%; height: 100%; object-fit: contain; }
.bc-unit { display: inline-block; width: 0.8em; height: 0.8em; margin-left: 4px; vertical-align: -0.05em; }
.ra-ic { width: 24px; height: 24px; fill: none; stroke: url(#tabGrad); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.q-price .ib, .tool-cost .ib, .pack-price .ib { width: 15px; height: 15px; vertical-align: -3px; }
.cta-cost .ib { width: 18px; height: 18px; vertical-align: -4px; }
.pack-credits small .ib { width: 0.85em; height: 0.85em; vertical-align: -0.05em; }
.md .ib { width: 1.15em; height: 1.15em; vertical-align: -0.22em; }

/* photo tool sheet */
.tool-panel { display: grid; gap: 14px; }
.ts-head { display: flex; align-items: center; gap: 12px; }
.ts-ic { flex: none; width: 52px; height: 52px; margin: 0; }
.ts-text { flex: 1; min-width: 0; }
.ts-title { font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: -0.03em; }
.ts-sub { font-size: 13px; color: var(--tx3); margin-top: 2px; }
.ts-x { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--s2); color: var(--tx2); font-size: 13px; }
.ts-drop { padding: 34px 12px; }
.ts-preview { position: relative; border-radius: 20px; overflow: hidden; background: #000; box-shadow: inset 0 0 0 1px var(--line); animation: fade 0.3s; }
.ts-preview img { display: block; width: 100%; max-height: 42vh; object-fit: contain; }
.ts-change { position: absolute; right: 10px; bottom: 10px; padding: 8px 12px; border-radius: 12px; font-size: 13px; font-weight: 700; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); cursor: pointer; }
.ts-label { font-size: 12px; font-weight: 600; color: var(--tx3); margin: 0 2px 8px; }
.ts-recent-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.ts-recent-row::-webkit-scrollbar { display: none; }
.ts-recent-row button { flex: none; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.25s var(--spring); }
.ts-recent-row button:active { transform: scale(0.92); }
.ts-recent-row img { width: 100%; height: 100%; object-fit: cover; }
.ts-note { width: 100%; height: 48px; padding: 0 14px; border-radius: 14px; border: 0; outline: 0; color: var(--tx); font: 500 15px var(--body); background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); }
.ts-note:focus { box-shadow: inset 0 0 0 1.5px rgba(190, 170, 255, 0.6); }
.ts-note::placeholder { color: var(--tx3); }
.ts-go { width: 100%; }

/* language */
.top-right { display: flex; align-items: center; gap: 8px; }
.lang-btn { display: flex; align-items: center; gap: 5px; height: 36px; padding: 0 11px 0 9px; border-radius: 999px; background: var(--s2); box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--tx2); text-transform: uppercase; transition: transform 0.25s var(--spring); }
.lang-btn:active { transform: scale(0.92); }
.lang-btn svg, .lang-auto-ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.lang-panel { display: grid; gap: 12px; }
.lang-auto { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 18px; text-align: left; font-weight: 600; background: var(--grad-soft); box-shadow: inset 0 0 0 1px rgba(190, 170, 255, 0.35); }
.lang-auto > span:nth-child(2) { flex: 1; }
.lang-auto small { font-weight: 500; color: var(--tx3); }
.lang-auto-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--s2); color: var(--tx); }
.lang-check { color: var(--lav); font-weight: 800; visibility: hidden; }
.lang-check.is-on { visibility: visible; }
.lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lang-item { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 46px; padding: 0 14px; border-radius: 14px; text-align: left; font-size: 14.5px; font-weight: 600; background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.2s var(--spring), background 0.2s; }
.lang-item:active { transform: scale(0.96); }
.lang-item.is-on { background: var(--grad-soft); box-shadow: inset 0 0 0 1px rgba(190, 170, 255, 0.55); }
.lang-item.is-on::after { content: '✓'; color: var(--lav); font-weight: 800; }

/* pages without the Create button bar only need room for the tab bar */
.view[data-view="tools"], .view[data-view="gallery"], .view[data-view="wallet"] { padding-bottom: calc(84px + var(--safe-b)); }
.tab { min-width: 0; padding: 0 2px; }
.tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg, .chip-btn, #ctaLabel, #smartToggle span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* long single words (German, Finnish, …) wrap inside the narrow tool cards */
.tool-name, .tool-sub, .fc-title, .fc-sub, .guest-title, .guest-sub { overflow-wrap: anywhere; hyphens: auto; -webkit-hyphens: auto; }
.tool-grid-3 .tool-name { font-size: 13.5px; }

/* sheets never get wider than the screen (a horizontal row inside a grid used to stretch it) */
.sheet-panel { overflow-x: hidden; }
.tool-panel, .lang-panel { grid-template-columns: minmax(0, 1fr); }
.tool-panel > *, .lang-panel > * { min-width: 0; }
.ts-recent-row { margin: 0; padding: 0; scroll-padding-inline: 0; }

/* ── Studio 2 ── */
.cf-left { display: flex; gap: 6px; flex-wrap: wrap; }
.dice-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.dice-btn svg circle { fill: currentColor; stroke: none; }
.dice-btn.roll svg { animation: spin 0.5s var(--ease); }
.recent { margin-top: 14px; }
.recent-title { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tx3); margin: 0 2px 8px; }
.recent .chip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 38px; }
.counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cnt { height: 46px; border-radius: 14px; font-weight: 700; font-size: 15px; color: var(--tx2); background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); display: flex; align-items: center; justify-content: center; gap: 8px; transition: transform 0.25s var(--spring), background 0.25s, color 0.2s; }
.cnt:active { transform: scale(0.95); }
.cnt.is-on { color: var(--tx); background: var(--grad-soft); box-shadow: inset 0 0 0 1px rgba(190, 170, 255, 0.55); }
.cnt-tiles { display: inline-grid; grid-template-columns: repeat(2, 7px); gap: 2px; }
.cnt-tiles i { width: 7px; height: 7px; border-radius: 2px; background: currentColor; opacity: 0.8; }

/* effect cards */
.fx-group { margin-top: 22px; }
.fx-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 520px) { .fx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fx { position: relative; display: block; border-radius: 20px; overflow: hidden; text-align: left; background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.3s var(--spring); }
.fx:active { transform: scale(0.96); }
.fx-img { display: block; aspect-ratio: 4 / 5; background: #111 center / cover; }
.fx-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s var(--ease); }
.fx:hover .fx-img img { transform: scale(1.04); }
.fx-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px; background: linear-gradient(to top, rgba(6, 6, 14, 0.92), rgba(6, 6, 14, 0)); }
.fx-name { display: block; font-weight: 700; font-size: 14px; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.fx-sub { display: block; font-size: 11.5px; color: var(--tx2); margin-top: 2px; overflow-wrap: anywhere; }
.fx-cost { position: absolute; right: 8px; top: 8px; padding: 4px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.fx-new { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 9px; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #150e2e; background: var(--grad); }

/* before / after */
.ba { position: relative; aspect-ratio: 4 / 5; max-height: 38vh; margin: 0 auto; width: auto; border-radius: 18px; overflow: hidden; background: #000; touch-action: none; user-select: none; -webkit-user-select: none; cursor: ew-resize; --pos: 50%; }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ba-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); }
.ba-line span { position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: #fff; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4); }
.ba-line span::before, .ba-line span::after { content: ''; position: absolute; top: 10px; border: 5px solid transparent; }
.ba-line span::before { left: 2px; border-right-color: #333; }
.ba-line span::after { right: 2px; border-left-color: #333; }
.ba-tag { position: absolute; bottom: 10px; padding: 4px 9px; border-radius: 9px; font-size: 11px; font-weight: 700; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ba-tag.l { left: 10px; }
.ba-tag.r { right: 10px; }

/* viewer */
.r-count { position: absolute; right: 10px; top: 10px; padding: 4px 9px; border-radius: 10px; font-size: 12px; font-weight: 700; background: rgba(0, 0, 0, 0.55); }
.r-vars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.r-vars button { aspect-ratio: 1; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); opacity: 0.6; transition: opacity 0.2s, transform 0.25s var(--spring); }
.r-vars button.is-on { opacity: 1; box-shadow: 0 0 0 2px rgba(190, 170, 255, 0.9); }
.r-vars img { width: 100%; height: 100%; object-fit: cover; }
.result-frame img.swipe-l { animation: swipeL 0.28s var(--ease); }
.result-frame img.swipe-r { animation: swipeR 0.28s var(--ease); }
@keyframes swipeL { from { transform: translateX(40px); opacity: 0.3; } to { transform: none; opacity: 1; } }
@keyframes swipeR { from { transform: translateX(-40px); opacity: 0.3; } to { transform: none; opacity: 1; } }
.result-actions + .result-actions { margin-top: 8px; }

/* profile */
.me-btn { width: 36px; height: 36px; border-radius: 50%; padding: 0; overflow: hidden; background: var(--s2); box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.25s var(--spring); }
.me-btn:active { transform: scale(0.92); }
.me-ava { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; font-weight: 800; font-size: 14px; color: #150e2e; background: var(--grad) center / cover; }
.me-ava.big { flex: none; width: 58px; height: 58px; font-size: 22px; }
.me-panel { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.me-head { display: flex; align-items: center; gap: 14px; }
.me-id { min-width: 0; }
.me-name { font-family: var(--display); font-weight: 600; font-size: 20px; letter-spacing: -0.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-sub { font-size: 13px; color: var(--tx3); margin-top: 2px; }
.me-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.me-stat { padding: 12px 10px; border-radius: 16px; background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); }
.me-stat b { display: block; font-family: var(--display); font-size: 18px; letter-spacing: -0.02em; }
.me-stat small { display: block; font-size: 11.5px; color: var(--tx3); margin-top: 2px; }
.me-list { display: grid; gap: 8px; margin-top: 14px; }
.me-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 10px 14px; border-radius: 18px; text-align: left; background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.2s var(--spring), background 0.2s; }
.me-row:active { transform: scale(0.98); background: var(--s2); }
.me-ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--s2); font-size: 18px; }
.me-ic .ib { width: 22px; height: 22px; }
.me-t { flex: 1; min-width: 0; display: grid; }
.me-t b { font-weight: 650; font-size: 15px; }
.me-t small { color: var(--tx3); font-size: 12.5px; margin-top: 1px; }
.me-row > svg, .me-back svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--tx3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.me-pane-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.me-pane-head b { font-family: var(--display); font-size: 19px; letter-spacing: -0.03em; }
.me-back { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--s2); }
.me-back svg { stroke: var(--tx); }
.mem-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.mem-list li { padding: 12px 14px; border-radius: 14px; background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; line-height: 1.4; }
.me-empty { padding: 26px 10px; text-align: center; color: var(--tx3); font-size: 14px; line-height: 1.5; }
.me-danger { width: 100%; margin-top: 12px; color: #ff9b9b; }
.led { display: grid; gap: 2px; }
.led-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.led-row:last-child { border-bottom: 0; }
.led-ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--s1); font-size: 16px; }
.led-ic .ib { width: 20px; height: 20px; }
.led-t { flex: 1; min-width: 0; }
.led-t b { display: block; font-weight: 600; font-size: 14px; }
.led-t small { color: var(--tx3); font-size: 12px; }
.led-d { font-weight: 700; font-variant-numeric: tabular-nums; }
.led-d.plus { color: #7ee2b0; }
.led-d.minus { color: var(--tx2); }
.ib { display: inline-block; vertical-align: -3px; }

/* narrow phones: the language button is just a globe, the logo keeps its room */
@media (max-width: 420px) { #langCode { display: none; } .lang-btn { width: 36px; padding: 0; justify-content: center; } .top-right { gap: 6px; } .brand { min-width: 0; } .brand-text { white-space: nowrap; } }
@media (max-width: 350px) { .brand-text b { display: none; } }
.ba { height: min(36vh, 330px); width: auto; max-width: 100%; max-height: none; justify-self: center; }
.tool-panel .ba { margin: 0; }

/* ── onboarding ── */
.onb { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 14px) 0 calc(var(--safe-b) + 18px); background: radial-gradient(120% 70% at 50% 0%, rgba(120, 110, 255, 0.28), transparent 60%), linear-gradient(180deg, #0b0b18, #07070d); animation: fade 0.4s var(--ease); }
.onb-skip { position: absolute; top: calc(var(--safe-t) + 12px); right: var(--gutter); z-index: 2; height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--tx2); background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); }
.onb-view { flex: 1; min-height: 0; overflow: hidden; touch-action: pan-y; }
.onb-track { display: flex; height: 100%; transition: transform 0.55s var(--ease); }
.onb-slide { flex: 0 0 100%; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 34px var(--gutter) 0; text-align: center; }
.onb-art { position: relative; width: min(78vw, 330px); height: min(46vh, 360px); margin-bottom: 18px; }
.onb-title { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(24px, 7vw, 32px); letter-spacing: -0.04em; line-height: 1.1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; overflow-wrap: anywhere; }
.onb-sub { margin: 0; max-width: 360px; color: var(--tx2); font-size: 15.5px; line-height: 1.5; overflow-wrap: anywhere; }
.onb-foot { display: grid; gap: 10px; justify-items: center; padding: 14px var(--gutter) 0; }
.onb-dots { display: flex; gap: 7px; }
.onb-dots i { width: 7px; height: 7px; border-radius: 4px; background: var(--line2); transition: width 0.35s var(--spring), background 0.3s; }
.onb-dots i.is-on { width: 22px; background: var(--grad); }
.onb-bonus { margin: 2px 0 0; font-size: 13.5px; font-weight: 600; color: var(--tx2); }
.onb-bonus .ib { width: 18px; height: 18px; vertical-align: -4px; }
.onb-cta { width: min(100%, 420px); }
.onb-alt { height: 38px; }
/* slide 1: fanned artworks */
.art-draw img { position: absolute; top: 50%; left: 50%; width: 58%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 22px; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.9), inset 0 0 0 1px var(--line); animation: floaty 5s ease-in-out infinite; }
.art-draw img:nth-child(1) { transform: translate(-95%, -52%) rotate(-12deg); animation-delay: -1.2s; }
.art-draw img:nth-child(2) { transform: translate(-5%, -50%) rotate(11deg); animation-delay: -2.6s; }
.art-draw img:nth-child(3) { z-index: 2; transform: translate(-50%, -46%); }
@keyframes floaty { 50% { translate: 0 -8px; } }
/* slide 2: before / after */
.art-fx { display: grid; place-items: center; }
.onb-ba { height: 100%; width: auto; aspect-ratio: 4 / 5; border-radius: 24px; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.9); cursor: default; }
.onb-ba .ba-after { transition: opacity 0.4s; }
/* slide 3: chat */
.art-chat { display: flex; flex-direction: column; justify-content: center; gap: 12px; text-align: left; }
.onb-bub { max-width: 86%; padding: 12px 15px; border-radius: 20px; font-size: 14.5px; line-height: 1.45; animation: bubIn 0.6s var(--ease) both; }
.onb-bub.me { align-self: flex-end; color: #150e2e; font-weight: 600; background: var(--grad); border-bottom-right-radius: 6px; }
.onb-bub.ai { align-self: flex-start; display: flex; gap: 10px; background: var(--s2); box-shadow: inset 0 0 0 1px var(--line); border-bottom-left-radius: 6px; animation-delay: 0.35s; }
.onb-ai-ic { flex: none; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #b48cff 45%, #ff8dbb); }
@keyframes bubIn { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
.onb-caps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.onb-caps span { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--tx2); background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); animation: bubIn 0.6s var(--ease) both; }
.onb-caps .ib { width: 18px; height: 18px; }
@media (max-height: 640px) { .onb-art { height: 34vh; } .onb-sub { font-size: 14px; } }

/* "New" badge on icon tool cards */
.tool-new { position: absolute; right: 12px; bottom: 12px; padding: 3px 8px; border-radius: 9px; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #150e2e; background: var(--grad); }
.tool .tool-sub { display: inline-block; padding-right: 2px; }
.tool-new { bottom: auto; top: 34px; right: 10px; }

/* ── owner dashboard ── */
.adm-panel { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); max-height: calc(100% - var(--safe-t) - 10px); }
.adm-head { display: flex; align-items: center; justify-content: space-between; }
.adm-head b { font-family: var(--display); font-size: 19px; letter-spacing: -0.03em; }
.adm-head .ib { width: 22px; height: 22px; }
.adm-seg { margin: 0; }
.adm-seg[data-p='week'] .seg-ind { transform: translateX(100%); }
.adm-seg[data-p='month'] .seg-ind { transform: translateX(200%); }
.adm-seg { --n: 3; }
.adm-seg .seg-ind { width: calc((100% - 8px) / 3); }
.adm-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.adm-kpi { padding: 14px; border-radius: 18px; background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); }
.adm-kpi small { display: block; font-size: 12px; color: var(--tx3); font-weight: 600; }
.adm-kpi b { display: block; margin-top: 4px; font-family: var(--display); font-size: 22px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.adm-kpi.good b { color: #7ee2b0; }
.adm-kpi.bad b { color: #ff9b9b; }
.adm-kpi.main { grid-column: 1 / -1; background: var(--grad-soft); box-shadow: inset 0 0 0 1px rgba(190, 170, 255, 0.35); }
.adm-kpi.main b { font-size: 30px; }
.adm-card { padding: 14px; border-radius: 18px; background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); }
.adm-card h4 { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tx3); }
.adm-chart { width: 100%; height: 130px; display: block; }
.adm-legend { display: flex; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--tx3); }
.adm-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.adm-rows { display: grid; gap: 0; }
.adm-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.adm-row:last-child { border-bottom: 0; }
.adm-row span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-row .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.adm-row .m { color: var(--tx3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.adm-bar { height: 6px; border-radius: 3px; background: var(--grad); margin-top: 4px; }
.adm-note { font-size: 12px; color: var(--tx3); line-height: 1.45; }

/* ── AI photoshoot ── */
.ps-card { margin-bottom: 10px; background: linear-gradient(120deg, rgba(255, 141, 187, 0.22), rgba(142, 162, 255, 0.2)); }
.ps-packs { display: grid; gap: 8px; }
.ps-pack { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 18px; text-align: left; background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.2s var(--spring), background 0.2s, box-shadow 0.2s; }
.ps-pack:active { transform: scale(0.98); }
.ps-pack.is-on { background: var(--grad-soft); box-shadow: inset 0 0 0 1.5px rgba(190, 170, 255, 0.7); }
.ps-pack .ic { flex: none; width: 40px; height: 40px; }
.ps-pack-t { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ps-pack-t b { font-size: 15px; }
.ps-pack-t small { font-size: 12px; color: var(--tx3); line-height: 1.35; overflow-wrap: anywhere; }
.ps-pack-n { flex: none; font-size: 12px; font-weight: 700; color: var(--tx2); }
.ps-note { margin: -4px 2px 0; font-size: 12px; color: var(--tx3); text-align: center; }
.ps-preview img { max-height: 30vh; }

.trend-ic { display: grid; place-items: center; width: 100%; height: 100%; font-size: 30px; }
.trend-ic .ib { width: 38px; height: 38px; }

/* Pro+ */
.pp-card { margin-top: 12px; background: linear-gradient(135deg, rgba(126, 226, 176, 0.16), rgba(142, 162, 255, 0.16) 55%, rgba(255, 141, 187, 0.14)); }
.pp-card.is-active { box-shadow: inset 0 0 0 1.5px rgba(126, 226, 176, 0.6); }

/* music */
.mu-prompt { width: 100%; min-height: 88px; padding: 12px 14px; border-radius: 16px; border: 0; outline: 0; resize: none; color: var(--tx); font: 500 15px/1.45 var(--body); background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); }
.mu-prompt:focus { box-shadow: inset 0 0 0 1.5px rgba(190, 170, 255, 0.6); }
.mu-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mu-kind { padding: 12px; border-radius: 16px; text-align: left; background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.2s var(--spring); }
.mu-kind b { display: block; font-size: 14.5px; }
.mu-kind small { color: var(--tx3); font-size: 12px; }
.mu-kind.is-on { background: var(--grad-soft); box-shadow: inset 0 0 0 1.5px rgba(190, 170, 255, 0.7); }
.mu-result { display: grid; gap: 8px; }
.mu-result audio { width: 100%; }
.mu-lyrics summary { cursor: pointer; color: var(--tx2); font-weight: 600; font-size: 13px; }
.mu-lyrics pre { white-space: pre-wrap; font: 500 13.5px/1.5 var(--body); color: var(--tx2); margin: 8px 0 0; }
.adm-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.adm-seg .seg { min-width: 0; }

/* ───────── 🎬 video ───────── */
.vd-card { margin-bottom: 10px; background: linear-gradient(120deg, rgba(142, 162, 255, 0.24), rgba(126, 226, 176, 0.16) 60%, rgba(255, 196, 120, 0.14)); }
.sc-hint + .vd-card { margin: 4px 0 14px; }
.fc-new { display: inline-block; margin-left: 8px; padding: 2px 7px; border-radius: 7px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em; vertical-align: 2px; color: #11131c; background: linear-gradient(90deg, #9fe8c9, #b7c3ff); }
.vd-panel { gap: 12px; }
.vd-photo { display: grid; }
.vd-add { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; cursor: pointer; background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); }
.vd-add-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--grad-soft); flex: none; }
.vd-add-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.vd-add-t { display: grid; min-width: 0; }
.vd-add-t b { font-size: 14.5px; }
.vd-add-t small { color: var(--tx3); font-size: 12px; }
.vd-thumb { position: relative; width: 96px; border-radius: 14px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.vd-thumb img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.vd-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.vd-row .segmented { margin: 0; }
.vd-seg[data-on='1'] .seg-ind { transform: translateX(100%); }
.vd-stage { position: relative; display: grid; place-items: center; min-height: 220px; border-radius: 20px; overflow: hidden; background: radial-gradient(120% 90% at 50% 0%, rgba(142, 162, 255, 0.22), transparent 60%), var(--s1); box-shadow: inset 0 0 0 1px var(--line); }
.vd-stage video { display: block; width: 100%; max-height: 52vh; background: #000; }
.vd-wait { display: grid; justify-items: center; gap: 6px; padding: 26px 18px; text-align: center; }
.vd-wait b { font: 700 26px/1 var(--display, inherit); letter-spacing: -0.02em; }
.vd-wait p { margin: 0; color: var(--tx2); font-size: 14px; }
.vd-wait small { color: var(--tx3); font-size: 12px; }
.vd-orb { position: relative; width: 74px; height: 74px; margin-bottom: 6px; }
.vd-orb span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: #9fe8c9; border-right-color: #b7c3ff; animation: vdSpin 1.6s linear infinite; }
.vd-orb span:nth-child(2) { inset: 10px; border-top-color: #ff8dbb; border-right-color: transparent; border-left-color: #b7c3ff; animation-duration: 2.3s; animation-direction: reverse; }
.vd-orb span:nth-child(3) { inset: 22px; border: 0; background: radial-gradient(circle, rgba(183, 195, 255, 0.9), rgba(183, 195, 255, 0) 70%); animation: vdPulse 1.8s ease-in-out infinite; }
@keyframes vdSpin { to { transform: rotate(360deg); } }
@keyframes vdPulse { 50% { transform: scale(0.7); opacity: 0.6; } }
.r-animate { width: 100%; margin-top: 8px; gap: 8px; }
.r-animate .ic { width: 20px; height: 20px; }
#resultFrame video { display: block; width: 100%; max-height: 62vh; background: #000; border-radius: inherit; }

/* ───────── gallery: two real columns, row-by-row reveal ───────── */
.masonry { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; columns: auto; }
.m-col { display: grid; gap: 10px; min-width: 0; }
.masonry .g-item { margin: 0; animation: gIn 0.75s var(--ease) backwards; animation-delay: var(--d, 0ms); }
.masonry .g-item.no-anim { animation: none; }
.masonry .g-item::before { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.06) 50%, transparent 70%) var(--s1); background-size: 220% 100%; animation: gShimmer 1.4s linear infinite; }
.masonry .g-item.is-loaded::before { opacity: 0; animation: none; transition: opacity 0.4s; }
.masonry .g-item img { position: relative; display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.035); transition: opacity 0.6s var(--ease), transform 0.9s var(--ease); }
.masonry .g-item.is-loaded img { opacity: 1; transform: none; }
.g-play { position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px; display: grid; place-items: center; border-radius: 50%; background: rgba(10, 12, 20, 0.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
.g-play svg { width: 18px; height: 18px; margin-left: 2px; fill: #fff; }
.g-dur { position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 7px; font-size: 11px; font-weight: 700; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(6px); }
@keyframes gIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
@keyframes gShimmer { to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) { .masonry .g-item { animation: none; } .masonry .g-item img { transition: none; } }
.ar-ic { display: inline-block; width: 9px; height: 14px; margin-right: 7px; border: 1.6px solid currentColor; border-radius: 3px; vertical-align: -2px; opacity: 0.85; }
.ar-ic.h { width: 15px; height: 9px; vertical-align: 0; }
.vd-stage video { width: auto; max-width: 100%; margin: 0 auto; border-radius: 16px; background: transparent; }
/* rows of viewer actions stay full when a button is hidden (e.g. "Edit" on a clip) */
.result-actions { display: flex; }
.result-actions > .btn-secondary { flex: 1 1 0; min-width: 0; }
.result-actions > [hidden] { display: none; }

/* promo screenshots: no toasts, no caret blink */
.is-shot .toast { display: none !important; }
