/* ============================================================
   ChannelCraft — signed-in workspace
   Tokens extracted live from imagine.art (see docs/research/
   imagineart-ui-spec.md): #0f0f0f bg · #171717 surfaces ·
   #212121 active · #8a3ffc accent · Inter · r12 buttons ·
   r24 borderless prompt box · 48px w400 hero.
   ============================================================ */

.app-body {
  /* token overrides (scoped to the app) — views.css inherits these */
  --bg: #0f0f0f;
  --surface: #171717;
  --surface-2: #1c1c1c;
  --surface-3: #242424;
  --border: #262626;
  --border-strong: #343434;
  --text: #ffffff;
  --text-dim: #b4b4b4;
  --text-faint: #8a8a8a;
  --violet: #8a3ffc;
  --violet-bright: #b585ff;
  --grad: linear-gradient(135deg, #b585ff, #7835d6 86%);
  --grad-soft: linear-gradient(135deg, #b585ff, #7835d6 86%);

  height: 100vh; overflow: hidden; display: flex; flex-direction: column;
  background: var(--bg);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  letter-spacing: 0;
}

/* ---------- PROMO BAR (legacy, removed from markup) ---------- */
.promo { display: none; }

/* ---------- SHELL ---------- */
.shell { flex: 1; display: flex; min-height: 0; }

/* ---------- SIDEBAR — 241px, transparent, no border ---------- */
.sidebar {
  width: 241px; flex-shrink: 0; background: transparent;
  display: flex; flex-direction: column; overflow-y: auto; padding: 14px 12px 10px; gap: 3px;
  /* Scrolls, but the scrollbar is hidden (Firefox + legacy Edge/IE). */
  scrollbar-width: none; -ms-overflow-style: none;
}
.sidebar::-webkit-scrollbar { width: 0; height: 0; display: none; }   /* hidden in WebKit/Blink */
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 10px; }
.side-logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; color: var(--text); }
.side-collapse { background: none; border: 0; color: var(--text-faint); cursor: pointer; padding: 4px; border-radius: 8px; }
.side-collapse:hover { background: var(--surface); color: var(--text); }
.side-collapse svg, .ws-chev, .snav-ico svg, .sb-ico svg, .ab-icon svg, .account svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side-collapse svg { width: 19px; height: 19px; }

/* workspace switcher — #171717, r12 */
.workspace {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; margin-bottom: 8px;
  background: var(--surface); border: 0; border-radius: 12px; cursor: pointer; color: var(--text); font: inherit;
  transition: background 0.15s;
}
.workspace:hover { background: var(--surface-2); }
.ws-avatar { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 0.82rem; color: #fff; background: linear-gradient(135deg, #b14bff, #ff2d9b); flex-shrink: 0; }
.ws-name { font-weight: 500; font-size: 0.92rem; flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-chev { width: 15px; height: 15px; color: var(--text-faint); flex-shrink: 0; }

/* nav — 6px 10px, r12, w400; active = #212121 */
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.snav { display: flex; align-items: center; gap: 11px; padding: 5px 10px; border-radius: 11px; color: var(--text); font-size: 0.92rem; font-weight: 400; cursor: pointer; transition: background 0.13s, box-shadow 0.13s; }
.snav:hover { background: var(--surface); }
.snav.active { background: rgba(255,255,255,0.02); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22); color: #fff; }
.snav-ico { display: grid; place-items: center; color: var(--text); opacity: 0.8; }
.snav.active .snav-ico { opacity: 1; }
.snav-ico svg { width: 18px; height: 18px; }
.tagnew { margin-left: auto; font-size: 0.62rem; font-weight: 600; color: #d4bbff; background: rgba(105,41,196,0.3); padding: 2px 8px; border-radius: 999px; }
.snav-label { font-size: 0.74rem; font-weight: 500; color: var(--text-faint); padding: 12px 10px 5px; }

.side-bottom { margin-top: auto; display: flex; gap: 2px; padding: 10px 4px 4px; }
.sb-ico { flex: 1; display: grid; place-items: center; padding: 8px; background: none; border: 0; border-radius: 10px; color: var(--text-faint); cursor: pointer; transition: background 0.13s, color 0.13s; }
.sb-ico:hover { background: var(--surface); color: var(--text); }
.sb-ico svg { width: 18px; height: 18px; }

/* ---------- MAIN — flat #0f0f0f, no tints ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
/* Soft purple hero glow — on the generation/hero pages (Home + the studios:
   Audio/Thumbnail/VTuber/Emote/Alert, Screens, Image). Sits behind the top bar
   so it merges seamlessly. Scoped via body[data-route] so list/utility pages
   (Assets, Search, Settings, Templates, Community, Admin) stay flat/decluttered. */
body[data-route="home"] .main,
body[data-route="studio"] .main,
body[data-route="video"] .main,
body[data-route="image"] .main { background: radial-gradient(85% 620px at 50% -40px, rgba(124, 58, 237, 0.32), transparent 72%), var(--bg); }
.appbar { flex-shrink: 0; display: flex; align-items: center; padding: 10px 20px; }
.appbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ab-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: transparent; border: 0; color: var(--text); cursor: pointer; transition: background 0.13s; }
.ab-icon:hover { background: var(--surface); }
.ab-icon svg { width: 18px; height: 18px; }
.ab-text { padding: 8px 13px; border-radius: 12px; background: var(--surface); border: 0; color: var(--text); font-size: 0.875rem; font-weight: 500; cursor: pointer; }
.ab-text:hover { background: var(--surface-2); }
.upgrade { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 12px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #8a3ffc, #6d28d9); color: #fff; font-weight: 700; font-size: 0.875rem; }
.upgrade:hover { filter: brightness(1.06); }
.upgrade svg { fill: currentColor; stroke: none; }
.upgrade-off { position: absolute; top: -9px; right: -8px; background: #ec4899; color: #fff; font-size: 0.62rem; font-weight: 700; padding: 2px 6px; border-radius: 999px; }
.account { display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px 5px 5px; border-radius: 12px; background: var(--surface); border: 0; color: var(--text); font-size: 0.875rem; font-weight: 500; cursor: pointer; }
.account:hover { background: var(--surface-2); }
/* Guests aren't a real account — render the chip as a plain "Log in" button. */
.account.is-guest { padding: 6px 15px; font-weight: 600; }
.account.is-guest .acc-av, .account.is-guest svg { display: none; }
.acc-av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #22d3ee, #3b82f6); color: #fff; font-weight: 700; font-size: 0.78rem; }
.ab-avatar { width: 34px; height: 34px; border-radius: 50%; border: 0; background: radial-gradient(circle at 35% 30%, #3a3550, #1c1c1c); cursor: pointer; }
/* generated profile avatars — deterministic SVG creature on a brand gradient */
.cc-hasav { overflow: hidden; padding: 0; color: #fff; }
.cc-hasav svg { width: 66%; height: 66%; display: block; }
.ab-avatar.cc-hasav { display: grid; place-items: center; }
.cc-av-chip { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; }

/* scroll area */
.main-scroll { flex: 1; overflow-y: auto; padding: 8px var(--page-gutter) 56px; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.main-scroll::-webkit-scrollbar { width: 8px; } .main-scroll::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }

/* ---------- HERO — compact (imagine.art density) ---------- */
/* Home hero fills one viewport frame, vertically centered (imagine.art).
   /0.85 compensates for the global zoom so it fills the real frame. */
.hero { max-width: var(--page-max-wide); margin: 0 auto; padding: 22px 16px; text-align: center; }
.hero .promptbox { max-width: 920px; margin: 0 auto; }
.hero-h1 { font-family: "Inter", sans-serif; font-weight: 500; letter-spacing: -0.025em; font-size: clamp(2rem, 3.6vw, 3.3rem); color: #fff; }
.hero-p { color: var(--text-faint); margin-top: 8px; font-size: 1rem; }

/* segmented — active = translucent purple pill, no container */
.seg { display: inline-flex; gap: 8px; margin: 16px 0 12px; background: transparent; border: 0; border-radius: 0; padding: 0; }
.seg-b { padding: 6px 12px; border-radius: 12px; border: 0; background: transparent; color: var(--text); font-weight: 500; font-size: 0.875rem; cursor: pointer; transition: background 0.13s, color 0.13s; }
.seg-b:hover { background: var(--surface); }
.seg-b.active { background: rgba(105, 41, 196, 0.3); color: #d4bbff; }
.seg-ext { opacity: 0.7; }

/* ---------- PROMPT BOX — #171717, r24, violet glow ---------- */
.promptbox {
  text-align: left; background: #171717; border: 1px solid rgba(138,63,252,0.45); border-radius: 24px;
  padding: 20px 12px 12px; position: relative;
  box-shadow: 0 0 0 1px rgba(138,63,252,0.12), 0 0 34px -6px rgba(138,63,252,0.35);
}
.promptbox textarea { width: 100%; resize: none; background: transparent; border: 0; outline: none; color: var(--text); font-size: 0.92rem; line-height: 1.5; font-family: "Inter", sans-serif; min-height: 44px; padding: 0 8px; }
.promptbox textarea::placeholder { color: var(--text-faint); }
.pb-bar { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.pb-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.pb-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 12px; border: 0; background: transparent; color: var(--text-faint); font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: background 0.13s, color 0.13s; }
.pb-tab .d { opacity: 0.9; }
.pb-tab:hover { background: #1f1f1f; color: var(--text-dim); }
.pb-tab.active { background: #2a2a2a; color: #fff; }
.pb-right { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.brandchip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 12px; background: rgba(105,41,196,0.3); border: 0; color: #d4bbff; font-size: 0.82rem; cursor: pointer; }
.brandchip b { font-weight: 600; color: #fff; }
.brandchip svg { fill: none; stroke: currentColor; stroke-width: 2; }
.bc-dot { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, #b14bff, #ff2d9b); }
.pb-submit { width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: linear-gradient(135deg, #b585ff, #7835d6 86%); color: #fff; transition: filter 0.15s, transform 0.15s; }
.pb-submit:hover { filter: brightness(1.1); transform: translateY(-1px); }
.pb-submit svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
/* "Surprise me" dice button — sits beside the submit; fills the prompt with a random idea. */
.pb-shuffle { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 13px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-dim); cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.2s; }
.pb-shuffle:hover { border-color: var(--violet); color: var(--text); background: var(--surface-3); }
.pb-shuffle:active { transform: rotate(-12deg) scale(0.92); }
.pb-shuffle svg { width: 21px; height: 21px; }
.vc-actions { display: flex; align-items: center; gap: 9px; }
.vc-actions .vc-generate { flex: 1; }
.pb-left { display: flex; align-items: center; }
.pb-cost { font-size: 0.74rem; color: var(--text-faint); font-family: var(--font-mono, monospace); }

/* Studios reuse the Home composer format: centered hero + prompt box + arrow */
.cstudio { max-width: var(--page-max); margin: 0 auto; padding-top: 8px; }
.cstudio-hero { text-align: center; margin-bottom: 18px; }
.cstudio-badge { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; margin-bottom: 12px; font-size: 1.15rem; background: linear-gradient(135deg, var(--a, #a855f7), var(--b, #ec4899)); color: #fff; }
.cstudio-title { font-family: var(--font-display); font-size: 2rem; font-weight: 800; margin: 0 0 6px; }
.cstudio-sub { color: var(--text-dim); max-width: 540px; margin: 0 auto; font-size: 0.92rem; line-height: 1.5; }
.cstudio-box { max-width: 760px; margin: 0 auto; }
.cstudio-box .opts-bar { max-width: none; margin: 12px 0 0; padding: 0; background: none; border: 0; gap: 18px; }
/* Emote studio: wide composer, compact height; properly-sized option pills */
.cstudio-box.em-box { max-width: 880px; padding-top: 14px; }
.em-box textarea { min-height: 38px; }
.em-modes.scr-modes { max-width: 880px; }   /* keep Normal/Animated toggle aligned with the box */
.vc-chips.dur { flex: 0 0 auto; gap: 8px; }
/* Quick-emote starter chips */
.em-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
/* Emote results shown AS emotes — transparent checkerboard + Twitch-size previews */
.em-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.em-asset { position: relative; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.em-checker, .em-canvas, .em-pv { background-color: #2b2b34; background-image: linear-gradient(45deg,#3a3a45 25%,transparent 25%),linear-gradient(-45deg,#3a3a45 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#3a3a45 75%),linear-gradient(-45deg,transparent 75%,#3a3a45 75%); background-size: 16px 16px; background-position: 0 0,0 8px,8px -8px,-8px 0; }
.em-canvas { width: 100%; aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; }
.em-canvas img { width: 88%; height: 88%; object-fit: contain; cursor: zoom-in; }
.em-sizes { display: flex; align-items: center; gap: 12px; }
.em-pv { border-radius: 6px; overflow: hidden; display: grid; place-items: center; flex: 0 0 auto; }
.em-pv img { width: 100%; height: 100%; object-fit: contain; }
.em-tip { margin-top: 14px; font-size: 0.8rem; color: var(--text-faint); line-height: 1.5; }
.vc-chips.dur .vc-chip { flex: 0 0 auto; min-width: 54px; padding: 9px 18px; }
.cstudio-ref { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; height: 32px; padding: 0 12px; border: 1px dashed var(--border-strong); border-radius: 9px; color: var(--text-faint); font-size: 0.8rem; cursor: pointer; transition: border-color 0.18s, color 0.18s; }
.cstudio-ref .dz-ico { font-size: 1rem; }
.cstudio-ref i { font-style: normal; opacity: 0.7; }
.cstudio-ref:hover { border-color: var(--violet); color: var(--text-dim); }
.cstudio-ref.has-img { padding: 0; height: 40px; width: 70px; border-style: solid; overflow: hidden; position: relative; }
.cstudio-ref.has-img .dz-prev { width: 100%; height: 100%; max-height: none; object-fit: cover; }
/* Thumbnail-style chips (Thumbnail studio) — tap to add a look to the prompt. */
.style-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.sp-l { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-faint); margin-right: 2px; }
.sp-chip { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-dim); font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s; }
.sp-chip:hover { border-color: var(--violet); color: var(--text); background: var(--surface-3); }
.sp-chip.on { border-color: var(--violet); background: var(--violet); color: #fff; box-shadow: 0 6px 16px -8px var(--violet); }
.cstudio-tip { margin-top: 12px; font-size: 0.8rem; color: var(--text-faint); line-height: 1.5; }
.cstudio-tip a { color: var(--violet-bright); font-weight: 600; }
.cstudio .ex-chips { margin-top: 16px; }
.cstudio-main { max-width: var(--page-max); margin: 24px auto 0; }
.cstudio-main .r-area:empty { display: none; }

/* quick tools — 52px gradient tiles */
.quicktools { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; margin-top: 14px; }
.qt { position: relative; width: 76px; padding: 10px 5px; border-radius: 14px; border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 7px; transition: background 0.13s; }
.qt:hover .qt-ico { transform: translateY(-2px); filter: brightness(1.15); background: radial-gradient(circle at 50% 36%, color-mix(in srgb, var(--a) 32%, transparent), rgba(255,255,255,0.03)); box-shadow: 0 0 26px -4px color-mix(in srgb, var(--a) 68%, transparent); }
/* Circular line-icon tiles (imagine.art style): dark glassy disc, accent-coloured
   glyph + soft colour glow — replaces the solid gradient squares. */
.qt-ico { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.3rem; color: var(--a); background: radial-gradient(circle at 50% 36%, color-mix(in srgb, var(--a) 20%, transparent), rgba(255,255,255,0.018)); border: 1px solid color-mix(in srgb, var(--a) 24%, transparent); box-shadow: 0 0 20px -7px color-mix(in srgb, var(--a) 55%, transparent), inset 0 0 12px -7px color-mix(in srgb, var(--a) 65%, transparent); transition: transform 0.15s, filter 0.15s, box-shadow 0.15s, background 0.15s; }
.qt-l { font-size: 0.8rem; color: var(--text-dim); font-weight: 400; display: inline-flex; align-items: center; gap: 3px; }
.qt-l i { font-style: normal; opacity: 0.55; }
.qt-tag { position: absolute; top: -5px; left: 50%; transform: translateX(-50%); z-index: 2; font-size: 0.55rem; font-weight: 700; letter-spacing: 0.04em; color: #fff; background: #8a3ffc; padding: 2px 8px; border-radius: 999px; }
/* the engine auto-picks the best model in the background — never shown or selectable */
.ipb-model, .vc-model { display: none !important; }

/* ---------- ROWS / CARDS ---------- */
.wn { max-width: var(--page-max-wide); margin: 26px auto 0; }
.wn-h { font-weight: 600; font-size: 1.25rem; letter-spacing: -0.01em; margin-bottom: 13px; color: #fff; }
.wn-sub { color: var(--text-faint); font-weight: 400; font-size: 1rem; }
/* ImagineArt-style horizontal carousel: one row of big cards that scrolls, the next
   card peeks at the edge, arrows reveal on hover. No page-level horizontal scrollbar. */
.scroller { display: flex; flex-wrap: nowrap; gap: 16px; overflow-x: auto; overflow-y: hidden;
  padding: 4px 0 6px; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.scroller::-webkit-scrollbar { height: 0; width: 0; display: none; }
.scroller > * { scroll-snap-align: start; }

.wn-card { flex: 0 0 300px; height: 168px; border-radius: 16px; padding: 16px; position: relative; overflow: hidden; border: 0;
  background: linear-gradient(140deg, color-mix(in srgb, var(--a) 60%, #141414), color-mix(in srgb, var(--b) 42%, #141414));
  display: flex; flex-direction: column; justify-content: flex-end; cursor: pointer; transition: transform 0.18s; }
.wn-card::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% 5%, rgba(255,255,255,0.16), transparent 55%); }
.wn-card:hover { transform: translateY(-2px); }
.wn-body { position: relative; z-index: 1; }
.wn-card h3 { font-weight: 600; font-size: 1.1rem; color: #fff; }
.wn-card p { color: rgba(255,255,255,0.82); font-size: 0.84rem; margin-top: 3px; }
.wn-tag { position: absolute; top: 12px; left: 12px; z-index: 1; font-size: 0.64rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,0.45); color: #fff; }
.wn-tag.live { background: rgba(0,255,163,0.18); color: #aaffdd; }
.wn-tag.beta { background: rgba(125,211,252,0.18); color: #cfeeff; }
.wn-tag.soon { color: #ddd; }

.tpl { flex: 0 0 clamp(230px, 23%, 330px); cursor: pointer; }
@media (max-width: 900px) { .tpl { flex-basis: 46%; } }
@media (max-width: 620px) { .tpl { flex-basis: 72%; } }
.tpl-art { height: 150px; border-radius: 14px; border: 0; position: relative; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--a) 70%, #141414), color-mix(in srgb, var(--b) 55%, #141414)); transition: transform 0.18s; }
.tpl-art::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 25% 18%, rgba(255,255,255,0.18), transparent 55%); }
.tpl:hover .tpl-art { transform: translateY(-2px); }
.tpl h4 { font-size: 0.875rem; font-weight: 400; margin-top: 9px; color: var(--text); }
.tpl:hover h4 { color: #fff; }

/* card mock visuals + sheen (gaming thumbnails/overlays/alerts) */
.tpl-art > * { z-index: 1; }
.tpl-art::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; z-index: 3; will-change: transform;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.14), transparent);
  animation: sheen 5s ease-in-out infinite; pointer-events: none; }
/* Animate transform (GPU-composited) instead of `left` to avoid per-frame layout. */
@keyframes sheen { 0%, 58% { transform: translateX(-160%) skewX(-14deg); } 84%, 100% { transform: translateX(320%) skewX(-14deg); } }
.ta-thumb, .ta-emote, .ta-alert, .ta-vt { position: absolute; inset: 0; display: grid; place-items: center; padding: 10px; }
.ta-emote { display: flex; gap: 8px; align-items: center; justify-content: center; }
.ta-emote span { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; color: #0f0f0f; background: rgba(255,255,255,0.92); }
.ta-title { font-weight: 800; font-size: 1rem; line-height: 1.06; color: #fff; text-align: center; text-shadow: 0 2px 10px rgba(0,0,0,0.6); }
.ta-badge { position: absolute; bottom: 8px; right: 8px; z-index: 2; font-size: 0.56rem; font-weight: 700; color: #fff; background: rgba(0,0,0,0.6); padding: 2px 7px; border-radius: 5px; }
.ta-play { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,0.92); color: #0f0f0f; font-size: 0.8rem; box-shadow: 0 4px 14px rgba(0,0,0,0.4); }
.ta-alertbar { position: absolute; bottom: 9px; left: 9px; right: 9px; z-index: 2; text-align: center; font-size: 0.6rem; font-weight: 700; color: #fff; background: rgba(0,0,0,0.5); border-radius: 6px; padding: 4px; }
.ta-vtface { font-size: 1.7rem; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.5); }
.ta-live { position: absolute; top: 9px; left: 9px; z-index: 2; font-size: 0.55rem; font-weight: 700; letter-spacing: 0.04em; color: #fff; background: #ff2d55; padding: 2px 7px; border-radius: 5px; }
.ta-cam { position: absolute; left: 9px; right: 36%; top: 26px; bottom: 12px; border-radius: 8px; border: 1.5px solid rgba(255,255,255,0.55); background: rgba(0,0,0,0.18); }
.ta-chat { position: absolute; right: 9px; top: 26px; bottom: 12px; width: 30%; border-radius: 7px; background: rgba(0,0,0,0.32); background-image: repeating-linear-gradient(transparent 0 5px, rgba(255,255,255,0.18) 5px 7px, transparent 7px 15px); }
@media (prefers-reduced-motion: reduce) { .tpl-art::before { display: none; } }

/* showcase portfolio images inside the boxes */
.tpl-art .tpl-img, .wn-card .tpl-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.tpl-art:has(.tpl-img)::after { display: none; }
.wn-scrim { position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(0,0,0,0.05) 35%, rgba(0,0,0,0.8) 100%); }

/* ---------- FLOATING ---------- */
.creditpop { position: fixed; top: 62px; right: 20px; width: 300px; display: flex; gap: 12px; padding: 15px; border-radius: 16px; z-index: 40;
  background: #171717; border: 0; box-shadow: 0 20px 50px -18px rgba(0,0,0,0.8); }
.creditpop.hide { display: none; }
.cp-gift { font-size: 1.3rem; }
.cp-body b { font-size: 0.9rem; font-weight: 600; }
.cp-body p { color: var(--text-faint); font-size: 0.78rem; margin-top: 3px; }
.cp-x { position: absolute; top: 10px; right: 12px; background: none; border: 0; color: var(--text-faint); cursor: pointer; font-size: 0.8rem; }
.cp-x:hover { color: var(--text); }
.dealcard { display: none; }

/* ---------- imagine.art-style extras ---------- */
.snav-ext { margin-left: auto; color: var(--text-faint); font-size: 0.85rem; }

/* What's new carousel — labels below cards, side arrows */
.carousel { position: relative; }
.wn-scroller { gap: 18px; }
.wn-scroller .wn-item { flex: 0 0 clamp(300px, 31%, 460px); max-width: none; }
@media (max-width: 900px) { .wn-scroller .wn-item { flex-basis: 64%; } }
@media (max-width: 620px) { .wn-scroller .wn-item { flex-basis: 84%; } }
.wn-item .wn-card { width: 100%; height: 250px; flex: none; padding: 0; }
.wn-label { margin-top: 11px; font-size: 0.92rem; font-weight: 600; letter-spacing: 0.02em; color: #fff; }
/* circular prev/next arrows, ImagineArt-style: hidden until the row is hovered */
.car-btn { position: absolute; top: 42%; transform: translateY(-50%); z-index: 5; width: 42px; height: 42px;
  border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: rgba(18,18,18,0.94); color: #fff; box-shadow: 0 8px 22px rgba(0,0,0,0.55);
  opacity: 0; pointer-events: none; transition: opacity 0.16s, background 0.13s, transform 0.13s; }
.carousel:hover .car-btn { opacity: 1; pointer-events: auto; }
.car-btn:hover { background: #2c2c2c; transform: translateY(-50%) scale(1.07); }
.car-btn.prev { left: -16px; } .car-btn.next { right: -16px; }
@media (max-width: 760px) { .car-btn { display: none; } }   /* touch: swipe instead */

/* big bottom banner — fanned art + wordmark */
.bigbanner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 200px;
  border-radius: 20px; background: #141414; overflow: hidden; padding: 26px 30px; position: relative; cursor: pointer; }
.bigbanner::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 120% at 50% 50%, rgba(138,63,252,0.14), transparent 70%); pointer-events: none; }
.bb-fan { display: flex; align-items: center; }
.bb-card { width: 120px; height: 150px; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 28px rgba(0,0,0,0.55); position: relative; }
.bb-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bb-fan .bb-card:nth-child(1) { transform: rotate(-8deg) translateX(14px); }
.bb-fan .bb-card:nth-child(2) { transform: rotate(0deg); z-index: 1; }
.bb-fan .bb-card:nth-child(3) { transform: rotate(8deg) translateX(-14px); }
.bb-fan.right .bb-card:nth-child(1) { transform: rotate(8deg) translateX(14px); }
.bb-fan.right .bb-card:nth-child(3) { transform: rotate(-8deg) translateX(-14px); }
.bb-center { text-align: center; z-index: 1; }
.bb-word { font-size: clamp(1.6rem, 3.4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; color: #fff; }
.bb-word i { font-style: normal; color: #b585ff; padding: 0 4px; }
.bb-sub { display: block; margin-top: 6px; color: var(--text-faint); font-size: 0.875rem; }

/* tool sub-page — left settings panel + canvas */
.tool-layout { display: grid; grid-template-columns: 340px minmax(0,1fr); gap: 18px; max-width: var(--page-max-wide); margin: 6px auto 0; align-items: start; }
/* prompt now lives inside the control panel */
.tp-field { display: flex; flex-direction: column; gap: 7px; }
.tp-prompt { background: var(--surface-3); border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; transition: border-color 0.15s; }
.tp-prompt:focus-within { border-color: var(--violet); }
.tp-prompt textarea { width: 100%; min-height: 64px; resize: none; background: transparent; border: 0; outline: none; color: var(--text); font: inherit; font-size: 0.9rem; line-height: 1.45; }
.tp-prompt textarea::placeholder { color: var(--text-faint); }
.tp-note { font-size: 0.74rem; color: var(--violet-bright); }
/* right side is a single result "stage" canvas */
.r-stage { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px; min-height: 70vh; display: flex; flex-direction: column; }
.r-stage .r-area { margin: 0; max-width: none; min-height: 0; flex: 1; display: flex; flex-direction: column; }
.r-stage .r-placeholder { border: 0; margin: auto; padding: 12px; }
.r-stage .r-head { margin-bottom: 16px; }
.tool-panel { background: #171717; border-radius: 18px; padding: 16px; position: sticky; top: 4px; display: flex; flex-direction: column; gap: 14px; }
.tp-head { display: flex; align-items: center; gap: 11px; }
.tp-head b { display: block; font-size: 1rem; font-weight: 600; }
.tp-head span { font-size: 0.74rem; color: var(--text-faint); }
.tp-desc { font-size: 0.82rem; color: var(--text-dim); line-height: 1.45; }
.tp-sec { display: flex; flex-direction: column; gap: 7px; }
.tp-lbl { font-size: 0.74rem; font-weight: 500; color: var(--text-faint); }
.tp-brand { justify-content: flex-start; width: fit-content; }
.tool-panel .opts-bar { flex-direction: column; align-items: stretch; gap: 13px; padding: 0; background: none; border: 0; margin: 0; max-width: none; }
.tool-panel .opt { flex-direction: column; align-items: flex-start; gap: 7px; }
.tool-panel .opt-l { font-size: 0.74rem; }
.tool-panel .opt-text { min-width: 0; width: 100%; }
.tool-panel .opt-input { width: 100%; background: #1f1f1f; border-color: #2e2e2e; }
.tp-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid #242424; padding-top: 13px; }
.tp-cost { font-size: 0.78rem; color: var(--violet-bright); }
.tp-craft { width: 100%; justify-content: center; }
.tool-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.tool-main .promptbox { border-radius: 18px; }
@media (max-width: 900px) { .tool-layout { grid-template-columns: 1fr; } .tool-panel { position: static; } }

/* community art */
.comm-art { position: relative; overflow: hidden; }
.comm-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* floating help bubble */
.helpbubble { position: fixed; right: 22px; bottom: 22px; z-index: 55; width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: #fff; color: #0f0f0f; box-shadow: 0 10px 28px rgba(0,0,0,0.5); transition: transform 0.15s; }
.helpbubble:hover { transform: scale(1.07); }

/* toast */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); background: #212121; border: 0; color: var(--text); padding: 12px 20px; border-radius: 12px; font-size: 0.875rem; box-shadow: 0 18px 44px -14px rgba(0,0,0,0.7); opacity: 0; pointer-events: none; transition: all 0.3s; z-index: 60; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1080px) { .creditpop { display: none; } }
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 80; transform: translateX(-100%); transition: transform 0.25s; background: #141414; }
  .sidebar.open { transform: none; }
}
@media (max-width: 620px) {
  .ab-text, .account span { display: none; }
  .main-scroll { padding: 10px 14px 30px; }
  .hero { padding: 18px 0 10px; }
  .hero-h1 { font-size: clamp(1.5rem, 6vw, 2.1rem); }
  .hero-p { font-size: 0.9rem; }
  .quicktools { gap: 2px; }
  .qt { width: 76px; }
}

/* ============================================================
   ICON-RAIL SIDEBAR — imagine.art-style compact rail (desktop).
   Overrides the wide text nav above; mobile keeps a full drawer.
   ============================================================ */
/* near-black with a soft violet glow up top — depth like imagine.art (not flat black) */
html { background: #08060e; }   /* fallback behind the zoomed body — no bare strip */
.app-body {
  --bg: #0a0a0a;
  background:
    radial-gradient(1300px 820px at 50% -8%, #2c2150 0%, rgba(44,33,80,0) 66%),
    linear-gradient(180deg, #1b1531 0%, #130e22 100%);
}

/* "More" overflow menu — flyout on the desktop rail, inline list in the mobile drawer.
   Base rules go BEFORE the media queries so the queries can override them. */
.more-menu { display: none; }
.snav-more { font-family: inherit; background: none; border: 0; cursor: pointer; }
.snav-more .snav-ico svg circle { fill: currentColor; stroke: none; }
/* Sidebar overflow items (Guides/Community/Templates/etc.): match the studio
   nav buttons (.snav) exactly. Scoped to .more-menu so it beats the generic
   .mm-item (modal list, padding 12px) defined later — otherwise they render
   oversized in the sidebar/drawer. */
.more-menu .mm-item { display: flex; align-items: center; gap: 11px; padding: 5px 10px; border: 0; border-radius: 11px; color: var(--text); font-size: 0.92rem; font-weight: 400; white-space: nowrap; cursor: pointer; transition: background 0.13s; }
.more-menu .mm-item:hover { background: var(--surface); border-color: transparent; }
.more-menu .mm-item.active { background: rgba(255,255,255,0.05); color: #fff; }
.more-menu .mm-item svg { width: 18px; height: 18px; }
.mm-item svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }

/* workspace / account menu — opens from the avatar chip (fixed popover) */
.ws-menu { position: fixed; left: 70px; top: 52px; z-index: 200; min-width: 214px; display: none; background: #161616; border: 1px solid var(--border-strong); border-radius: 14px; padding: 6px; box-shadow: 0 26px 70px -20px rgba(0,0,0,0.85); }
.ws-menu.open { display: block; }
.wsm-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.wsm-head .ws-avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 0.95rem; }
.wsm-id { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.wsm-id b { font-size: 0.9rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.wsm-id span { font-size: 0.76rem; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }

@media (min-width: 861px) {
  /* desktop-only global zoom-out — kept off mobile so touch targets stay full size */
  .app-body { zoom: 0.85; height: calc(100vh / 0.85); }
  /* home hero sits in the upper area with breathing room, then "What's new"
     flows right below — no forced full-viewport centering (avoids big blank). */
  .hero { padding: clamp(16px, 4.5vh, 52px) 0 22px; }
  /* EXPANDED, labeled sidebar is the desktop DEFAULT (imagine.art style):
     section headers, workspace name, text labels. The collapse toggle adds
     .collapsed to shrink it to the icon rail. */
  .sidebar { border-right: 1px solid rgba(255,255,255,0.06); overflow-y: auto; }
  .side-collapse { display: inline-flex; align-items: center; }
  .sidebar:not(.collapsed) .snav-more { display: none; }                 /* no "More" button when expanded */
  .sidebar:not(.collapsed) .more-menu { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }

  /* ---- COLLAPSED = compact icon rail ---- */
  .sidebar.collapsed {
    width: 82px; padding: 12px 6px 8px; align-items: center; gap: 2px;
    scrollbar-width: none;
  }
  .sidebar.collapsed::-webkit-scrollbar { width: 0; height: 0; }
  .sidebar.collapsed .side-top { flex-direction: column; justify-content: center; gap: 7px; padding: 2px 0 6px; }
  .sidebar.collapsed .side-logo span { display: none; }
  .sidebar.collapsed .workspace { width: auto; padding: 0; margin: 0 0 6px; background: none; justify-content: center; position: relative; }
  .sidebar.collapsed .workspace:hover { background: none; }
  .sidebar.collapsed .ws-name,
  .sidebar.collapsed .snav-label,
  .sidebar.collapsed .snav-ext,
  .sidebar.collapsed .tagnew { display: none; }
  .sidebar.collapsed .ws-chev { display: block; position: absolute; right: -3px; bottom: -3px; width: 14px; height: 14px; padding: 1.5px; background: #1c1c1c; border-radius: 50%; opacity: 0.9; }
  .sidebar.collapsed .ws-avatar { width: 34px; height: 34px; border-radius: 11px; font-size: 0.95rem; }
  .sidebar.collapsed .side-nav { width: 100%; gap: 2px; }
  .sidebar.collapsed .snav {
    flex-direction: column; gap: 5px; padding: 9px 2px; border-radius: 13px;
    font-size: 0.605rem; font-weight: 500; line-height: 1.12; text-align: center; color: var(--text-faint);
  }
  .sidebar.collapsed .snav:hover { background: var(--surface); color: var(--text); }
  .sidebar.collapsed .snav.active { background: rgba(255,255,255,0.05); box-shadow: none; color: #fff; }
  .sidebar.collapsed .snav.active .snav-ico { color: var(--violet-bright); opacity: 1; }
  .sidebar.collapsed .snav-ico svg { width: 21px; height: 21px; }
  .sidebar.collapsed .snav-more { display: flex; width: 100%; }
  .sidebar.collapsed .more-menu {
    position: fixed; left: 72px; bottom: 14px; z-index: 200; min-width: 202px;
    background: #161616; border: 1px solid var(--border-strong); border-radius: 14px;
    padding: 6px; box-shadow: 0 26px 70px -20px rgba(0,0,0,0.85); display: none;
  }
  .sidebar.collapsed .more-menu.open { display: flex; flex-direction: column; gap: 2px; }
  .sidebar.collapsed .side-bottom { flex-direction: column; gap: 4px; padding: 10px 0 2px; }
  .sidebar.collapsed .sb-ico { width: 100%; }
}

/* Mobile: restore a usable full-width drawer (the rail would be too cramped) */
@media (max-width: 860px) {
  .sidebar { width: 240px; padding: 14px 12px; align-items: stretch; }
  .side-logo span { display: inline; }
  .workspace { width: 100%; padding: 8px 10px; margin-bottom: 8px; background: var(--surface); justify-content: flex-start; }
  .ws-name { display: block; } .ws-chev { display: inline; }
  .snav { flex-direction: row; gap: 11px; padding: 7px 10px; font-size: 0.92rem; text-align: left; color: var(--text); }
  .snav-label { display: block; }
  /* mobile drawer: no "More" button — its items show inline in the list */
  .snav-more { display: none; }
  .more-menu { display: flex; flex-direction: column; gap: 2px; }
}

/* ============================================================
   IMAGE PAGE · VIDEO PAGE · TOOL FLYOUT · MODEL MODAL
   ============================================================ */

/* --- inspirations grid (masonry) + tabs --- */
.img-top { display: flex; flex-direction: column; gap: 6px; }
.img-tabs, .vtabs { display: flex; gap: 6px; margin-bottom: 4px; }
.itab { background: transparent; border: 0; color: var(--text-faint); font: inherit; font-size: 0.9rem; padding: 7px 14px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.itab:hover { color: var(--text-dim); background: var(--surface); }
.itab.active { color: var(--text); background: var(--surface-2); }
.img-title { font-size: 1.9rem; font-weight: 600; margin: 2px 0 0; }
.img-sub { color: var(--text-faint); margin: 0 0 4px; font-size: 0.95rem; }

.ins-grid { columns: 5 220px; column-gap: 12px; margin-top: 4px; }
.ins-tile { display: block; position: relative; margin: 0 0 12px; break-inside: avoid; border-radius: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); content-visibility: auto; contain-intrinsic-size: auto 220px; }
.ins-tile img { width: 100%; display: block; transition: transform 0.45s ease; }
.ins-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(165,110,255,.15), rgba(125,42,232,.3)); opacity: 0; transition: opacity 0.3s; }
.ins-tile:hover img { transform: scale(1.05); }
.ins-tile:hover::after { opacity: 1; }

/* --- one-image hero on the Image page (replaces the jumpy masonry) --- */
.ins-hero { position: relative; margin: 6px 0 2px; border-radius: 20px; overflow: hidden; border: 1px solid var(--border-strong); background: var(--surface); aspect-ratio: 16/7; min-height: 340px; }
.ins-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ins-hero-veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,8,16,0.15) 0%, rgba(10,8,16,0.6) 55%, rgba(10,8,16,0.9) 100%), radial-gradient(90% 55% at 15% 100%, rgba(124,58,237,0.4), transparent 60%); }
.ins-hero-copy { position: absolute; left: 34px; right: 34px; bottom: 30px; max-width: 620px; display: flex; flex-direction: column; gap: 12px; }
.ins-hero-tag { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.78); background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); backdrop-filter: blur(6px); padding: 5px 11px; border-radius: 999px; }
.ins-hero-title { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; font-size: clamp(1.8rem, 3.4vw, 2.7rem); line-height: 1.08; color: #fff; margin: 0; text-shadow: 0 4px 20px rgba(0,0,0,0.55); }
.ins-hero-sub { color: rgba(255,255,255,0.78); font-size: 1rem; line-height: 1.55; margin: 0; max-width: 520px; }
.ins-hero-cta { display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.ins-hero-cta .btn { padding: 11px 22px; border-radius: 12px; font-size: 0.95rem; }
@media (max-width: 720px){ .ins-hero { aspect-ratio: 4/5; min-height: 420px; } .ins-hero-copy { left: 20px; right: 20px; bottom: 22px; } }

/* --- premium loading state — replaces the plain 20px spinner --- */
.r-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 54px 30px 60px; color: var(--text-dim); text-align: center; }
.r-loading .spinner { display: none; }  /* legacy circle no longer used */
.r-loading::before { content: ""; width: 52px; height: 52px; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0deg, #7c3aed 90deg, #ec4899 200deg, transparent 340deg); -webkit-mask: radial-gradient(circle at center, transparent 44%, #000 46%); mask: radial-gradient(circle at center, transparent 44%, #000 46%); animation: r-orb-spin 1.4s linear infinite; box-shadow: 0 0 40px 4px rgba(124,58,237,0.28), 0 0 90px 12px rgba(236,72,153,0.14); }
.r-loading::after { content: ""; position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 12px 3px rgba(255,255,255,0.6); animation: r-orb-pulse 1.4s ease-in-out infinite; transform: translateY(-24px); }
.r-loading { position: relative; }
@keyframes r-orb-spin { to { transform: rotate(360deg); } }
@keyframes r-orb-pulse { 0%,100% { opacity: 0.4; transform: translateY(-24px) scale(0.85); } 50% { opacity: 1; transform: translateY(-24px) scale(1.15); } }
.r-loading > * { position: relative; z-index: 1; }
.r-loading-cap { font-size: 1.02rem; color: var(--text); font-weight: 500; letter-spacing: -0.005em; }
.r-loading-sub { font-size: 0.82rem; color: var(--text-faint); }
/* Shimmer skeleton bar under the caption while assets stream in. */
.r-loading-shim { display: flex; gap: 10px; margin-top: 6px; }
.r-loading-shim i { width: 46px; height: 6px; border-radius: 999px; background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.22) 50%, rgba(255,255,255,0.05) 100%); background-size: 200% 100%; animation: r-shim 1.2s linear infinite; }
.r-loading-shim i:nth-child(2) { animation-delay: 0.18s; }
.r-loading-shim i:nth-child(3) { animation-delay: 0.36s; }
@keyframes r-shim { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* --- floating prompt bar (image page) --- */
.img-promptbar { position: sticky; bottom: 16px; z-index: 20; display: flex; align-items: center; gap: 11px; margin: 22px auto 8px; max-width: var(--page-max); padding: 14px 14px 14px 20px; background: rgba(23,23,23,0.97); backdrop-filter: blur(8px); border: 1px solid var(--border-strong); border-radius: 20px; box-shadow: 0 20px 56px -20px rgba(0,0,0,0.85); }
.ipb-add { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-3); border: 1px solid var(--border); color: var(--text-dim); font: inherit; font-size: 0.85rem; padding: 8px 12px; border-radius: 12px; cursor: pointer; white-space: nowrap; }
.ipb-add:hover { color: var(--text); border-color: var(--border-strong); }
.ipb-plus { font-size: 1.05rem; line-height: 1; }
.ipb-input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text); font: inherit; font-size: 1.1rem; line-height: 1.4; padding: 6px 2px; outline: none; }
.ipb-input::placeholder { color: var(--text-faint); }
.ipb-model { display: inline-flex; align-items: center; gap: 7px; background: var(--surface-3); border: 1px solid var(--border); color: var(--text-dim); font: inherit; font-size: 0.82rem; padding: 8px 12px; border-radius: 12px; cursor: pointer; white-space: nowrap; }
.ipb-model b { color: var(--text); font-weight: 500; }
.ipb-model:hover { border-color: var(--violet); }
.ipb-create { padding: 12px 26px; border-radius: 13px; font-size: 0.98rem; }

/* --- Image Tools flyout --- */
.tool-flyout { position: fixed; z-index: 200; width: 560px; max-width: 92vw; max-height: calc(100vh - 24px); overflow-y: auto; background: #131313; border: 1px solid var(--border-strong); border-radius: 18px; padding: 16px 18px 18px; box-shadow: 0 30px 80px -24px rgba(0,0,0,0.85); opacity: 0; transform: translateX(-6px); pointer-events: none; transition: opacity 0.16s, transform 0.16s; }
.tool-flyout.open { opacity: 1; transform: none; pointer-events: auto; }
.tf-head { font-size: 1.1rem; font-weight: 600; margin-bottom: 12px; }
.tf-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; }
.tf-lbl { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-bottom: 6px; }
.tf-item { display: flex; align-items: center; gap: 11px; padding: 7px 8px; border-radius: 11px; text-decoration: none; color: var(--text); }
.tf-item:hover { background: var(--surface-2); }
.tf-ico { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--surface-3); font-size: 1.05rem; color: var(--violet-bright); }
.tf-body { display: flex; flex-direction: column; min-width: 0; }
.tf-body b { font-size: 0.88rem; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.tf-body span { font-size: 0.74rem; color: var(--text-faint); }
.tf-badge { font-style: normal; font-size: 0.56rem; font-weight: 700; letter-spacing: 0.05em; padding: 2px 5px; border-radius: 5px; color: #fff; line-height: 1.4; }
.tf-badge.best { background: linear-gradient(135deg, #8a3ffc, #b585ff); }
.tf-badge.new { background: #16a34a; }
.tf-badge.hot { background: #e0245e; }
.tf-badge.pro { background: rgba(138,63,252,0.18); color: var(--violet-bright); }
.tf-badge.default { background: rgba(177,75,255,0.18); color: var(--violet-bright); }
.tf-badge.text { background: #0ea5e9; }
.tf-badge.logo { background: #22c55e; }
.tf-badge.custom { background: #f97316; }
.tf-badge.owner { background: linear-gradient(135deg, #f59e0b, #f97316); }

/* admin: owner-only sections (user management + billing) */
.adm-section { margin-top: 26px; }
.adm-tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.adm-table th { text-align: left; padding: 9px 12px; color: var(--text-faint); font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
.adm-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--text-dim); }
.adm-table tr:last-child td { border-bottom: 0; }
.adm-table .adm-num { font-variant-numeric: tabular-nums; color: #fff; font-weight: 600; }
.adm-usermeta { color: var(--text-faint); font-size: 0.8rem; margin: 4px 0 10px; }
.adm-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.adm-stat { flex: 1; min-width: 120px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.adm-stat b { display: block; font-size: 1.5rem; font-weight: 700; color: #fff; line-height: 1.1; }
.adm-stat span { font-size: 0.78rem; color: var(--text-faint); }

/* --- Video page --- */
.video-layout { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
.tp-head { display: flex; align-items: center; gap: 11px; }
.tp-head > div { display: flex; flex-direction: column; }
.tp-head b { font-size: 0.98rem; }
.tp-head span { font-size: 0.76rem; color: var(--text-faint); }
.tp-lbl { font-size: 0.74rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: -6px; }
.tp-lbl i { font-style: normal; text-transform: none; letter-spacing: 0; }
.vm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vm-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--text); }
.vm-art { position: relative; aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--border); }
.vm-card:hover .vm-art { border-color: var(--violet); }
.vm-label { font-size: 0.84rem; font-weight: 500; text-align: center; }
.vm-art .tpl-img, .vh-card .tpl-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }

.vh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.vh-card { position: relative; aspect-ratio: 3/4; border-radius: 14px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #1a1a1a, #121212); border: 1px solid var(--border); display: grid; place-items: center; }
.vh-q { display: inline-flex; align-items: center; gap: 7px; position: absolute; top: 10px; left: 10px; font-size: 0.74rem; color: var(--text-dim); background: rgba(0,0,0,0.4); padding: 4px 9px; border-radius: 8px; z-index: 1; }
.vh-q .spinner { width: 14px; height: 14px; border-width: 2px; }

/* create-video form */
.vc-back { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-3); color: var(--text); text-decoration: none; font-size: 1.1rem; }
.vc-back:hover { background: var(--border-strong); }
.vc-model { display: flex; align-items: center; gap: 9px; background: var(--surface-3); border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; color: var(--text); font: inherit; cursor: pointer; }
.vc-model b { font-weight: 500; flex: 1; text-align: left; }
.vc-model:hover { border-color: var(--violet); }
.vc-cv { color: var(--text-faint); }
.vc-drop { padding: 22px !important; margin: 0 !important; }
.vc-drop .dz-ico { font-size: 1.4rem; margin: 0; }
.vc-prompt { position: relative; background: var(--surface-3); border: 1px solid var(--border); border-radius: 14px; padding: 12px; }
.vc-prompt textarea { width: 100%; min-height: 78px; resize: vertical; background: transparent; border: 0; color: var(--text); font: inherit; font-size: 0.9rem; outline: none; }
.vc-enh { margin-top: 6px; background: var(--surface); border: 1px solid var(--border); color: var(--violet-bright); font: inherit; font-size: 0.78rem; padding: 5px 11px; border-radius: 9px; cursor: pointer; }
.vc-chips { display: flex; gap: 8px; }
.vc-chip { flex: 1; text-align: center; background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px; padding: 9px 0; font-size: 0.82rem; color: var(--text-dim); cursor: pointer; font: inherit; }
.vc-chip:hover { border-color: var(--border-strong); color: var(--text); }
.vc-chip.on { border-color: var(--violet); color: #fff; background: color-mix(in srgb, var(--violet) 18%, var(--surface-3)); }
.vc-generate { width: 100%; padding: 13px; border-radius: 13px; font-size: 0.95rem; margin-top: 4px; }
.vc-generate:disabled { opacity: 0.6; cursor: progress; }
.vc-hero { text-align: center; padding: 30px 0 6px; }
.vc-hero h2 { font-size: 1.5rem; font-weight: 600; margin: 0; }
.vc-hero p { color: var(--text-faint); margin: 6px 0 0; font-size: 0.9rem; }
/* ---------- Video Studio (inline compose + generate on #video) ---------- */
.vstudio { max-width: var(--page-max); margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.vstudio-hero { text-align: center; padding: 6px 0 0; }
.vh-badge { display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--violet-bright); background: rgba(138,63,252,0.14); border: 1px solid rgba(138,63,252,0.3); padding: 5px 12px; border-radius: 999px; }
.vstudio-title { font-family: var(--font-display); font-size: 2.1rem; font-weight: 800; margin: 13px 0 6px; background: linear-gradient(120deg,#fff,#c9a8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.vstudio-sub { color: var(--text-dim); max-width: 560px; margin: 0 auto; font-size: 0.92rem; line-height: 1.5; }
.vmode-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
/* Screens: numbered steps + icon type cards + example chips */
.scr-steps { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; margin: -2px auto 4px; }
.scr-step { display: inline-flex; align-items: center; gap: 7px; font-size: 0.78rem; color: var(--text-faint); }
.scr-step i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border); font-style: normal; font-size: 0.66rem; color: var(--violet-bright); }
.scr-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 600px; margin: 0 auto; }
.scr-type { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 16px 12px; background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px; cursor: pointer; color: var(--text-dim); font: inherit; transition: border-color 0.18s, transform 0.12s, box-shadow 0.18s, background 0.18s; }
.scr-type:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.scr-type.on { border-color: var(--violet); background: color-mix(in srgb, var(--violet) 10%, var(--surface)); box-shadow: 0 0 0 1px var(--violet), 0 16px 34px -22px var(--violet); }
.scr-type-ico { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--surface-3); color: var(--violet-bright); transition: background 0.18s, color 0.18s; }
.scr-type-ico svg { width: 20px; height: 20px; }
.scr-type.on .scr-type-ico { background: linear-gradient(135deg, var(--violet, #8a3ffc), #ff2d9b); color: #fff; }
.scr-type-name { font-family: var(--font-display); font-size: 0.95rem; font-weight: 600; color: var(--text); }
.scr-type-sub { font-size: 0.7rem; color: var(--text-faint); }
.scr-modes { max-width: 600px; margin: 0 auto; }
.scr-lbl { font-size: 0.7rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.scr-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 14px; padding-top: 4px; }
.scr-ex-lbl { font-size: 0.74rem; color: var(--text-faint); margin-right: 2px; }
.plat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.plat-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px; padding: 8px 11px; cursor: pointer; color: var(--text-dim); font: inherit; }
.plat-chip b { font-size: 0.82rem; color: var(--text); }
.plat-chip span { font-size: 0.66rem; color: var(--text-faint); font-family: var(--font-mono, monospace); }
.plat-chip:hover { border-color: var(--border-strong); }
.plat-chip.on { border-color: var(--violet); background: color-mix(in srgb, var(--violet) 16%, var(--surface-3)); }
.plat-chip.on b { color: #fff; }
.vmode { position: relative; display: flex; flex-direction: column; gap: 7px; padding: 0; background: none; border: 0; cursor: pointer; color: var(--text-dim); font: inherit; }
.vmode-art { position: relative; aspect-ratio: 16/10; border-radius: 12px; overflow: hidden; border: 2px solid transparent; background: var(--surface); transition: border-color 0.18s, box-shadow 0.18s; }
.vmode-art .tpl-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vmode-label { font-size: 0.74rem; text-align: center; }
.vmode:hover .vmode-art { border-color: var(--border-strong); }
.vmode.on .vmode-art { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(138,63,252,0.25); }
.vmode.on .vmode-label { color: #fff; font-weight: 600; }
.vcomposer { display: grid; grid-template-columns: 1fr 240px; gap: 14px; align-items: stretch; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 20px; padding: 14px; box-shadow: 0 20px 56px -28px rgba(0,0,0,0.8); }
.vcomposer-prompt { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.vc-ref { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 1px dashed var(--border-strong); border-radius: 9px; color: var(--text-faint); font-size: 0.8rem; cursor: pointer; transition: border-color 0.18s, color 0.18s; white-space: nowrap; }
.vc-ref .dz-ico { font-size: 1rem; }
.vc-ref i { font-style: normal; opacity: 0.7; }
.vc-ref:hover { border-color: var(--violet); color: var(--text-dim); }
.vc-ref.has-img { padding: 0; height: 40px; width: 70px; border-style: solid; overflow: hidden; position: relative; }
.vc-ref.has-img .dz-prev { width: 100%; height: 100%; max-height: none; object-fit: cover; }
.vcomposer-ta { flex: 1; background: transparent; border: 0; resize: none; color: var(--text); font: inherit; font-size: 1rem; line-height: 1.5; outline: none; min-height: 96px; padding: 4px; }
.vcomposer-side { display: flex; flex-direction: column; gap: 10px; justify-content: space-between; }
.vcomposer-opts { display: flex; gap: 8px; }
.vcomposer-opts .vc-chips { flex: 1; }
.vstudio-suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.vsugg { background: var(--surface-3); border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px; font-size: 0.8rem; color: var(--text-dim); cursor: pointer; font: inherit; transition: border-color 0.16s, color 0.16s; }
.vsugg:hover { border-color: var(--violet); color: #fff; }
.vstudio-note { text-align: center; color: var(--text-faint); font-size: 0.76rem; margin: 0; }
.vstudio-history { margin-top: 8px; }
.vsh-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.vsh-head h2 { font-family: var(--font-display); font-size: 1.2rem; margin: 0; }
.vsh-all { font-size: 0.84rem; color: var(--violet-bright); text-decoration: none; }
.vsh-all:hover { text-decoration: underline; }
.vstudio-history .vh-card { aspect-ratio: 16/9; }
/* per-clip download/open affordance */
.vh-dl { position: absolute; top: 6px; right: 6px; z-index: 3; width: 26px; height: 26px; display: grid; place-items: center; border: none; border-radius: 8px; background: rgba(0,0,0,0.6); color: #fff; cursor: pointer; text-decoration: none; font-size: 14px; opacity: 0; transition: opacity 0.18s, background 0.16s; }
.vh-card.done:hover .vh-dl { opacity: 1; }
.vh-dl:hover { background: var(--violet); }
.vh-card.done { cursor: pointer; }

/* per-asset download button (results + history tiles) */
.r-asset { position: relative; }
.r-dl { position: absolute; top: 8px; right: 8px; z-index: 3; width: 30px; height: 30px; display: grid; place-items: center; border: none; border-radius: 9px; background: rgba(0,0,0,0.62); color: #fff; cursor: pointer; font-size: 15px; opacity: 0; transition: opacity 0.16s, background 0.16s; }
.r-asset:hover .r-dl, .ins-tile:hover .r-dl { opacity: 1; }
.r-dl:hover { background: var(--violet); }
/* "Edit in Studio" pencil — sits left of the download button on tiles/results */
.r-edit { position: absolute; top: 8px; right: 44px; z-index: 3; width: 30px; height: 30px; display: grid; place-items: center; border: none; border-radius: 9px; background: rgba(0,0,0,0.62); color: #fff; cursor: pointer; font-size: 14px; opacity: 0; transition: opacity 0.16s, background 0.16s; }
.r-asset:hover .r-edit, .ins-tile:hover .r-edit { opacity: 1; }
.r-edit:hover { background: var(--violet); }
.r-dlall { margin-left: auto; }

/* Emote studio mode toggle (Normal sticker / Animated dance) */
.em-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.em-mode { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left; background: var(--surface-3); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; cursor: pointer; color: var(--text-dim); font: inherit; }
.em-mode b { font-size: 0.9rem; color: var(--text); }
.em-mode span { font-size: 0.7rem; color: var(--text-faint); }
.em-mode:hover { border-color: var(--border-strong); }
.em-mode.on { border-color: var(--violet); background: color-mix(in srgb, var(--violet) 16%, var(--surface-3)); box-shadow: 0 0 0 1px var(--violet); }
.em-mode.on b { color: #fff; }
.dance-chips { flex-wrap: wrap; }
.dance-chips .vc-chip { flex: 0 1 auto; padding: 8px 12px; }

/* real audio clips — custom player with a beat-reactive waveform */
.aud-list { display: flex; flex-direction: column; gap: 12px; }
.ap { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.ap-play { width: 44px; height: 44px; flex: none; border: none; border-radius: 50%; background: linear-gradient(135deg, var(--violet, #8a3ffc), #ff2d9b); color: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: 0 6px 18px -6px var(--violet, #8a3ffc); transition: box-shadow 0.2s, transform 0.1s; }
.ap-play:hover { transform: scale(1.05); }
.ap.playing .ap-play { box-shadow: 0 0 0 4px color-mix(in srgb, var(--violet, #8a3ffc) 30%, transparent), 0 6px 18px -6px var(--violet, #8a3ffc); }
.ap-main { min-width: 0; }
.ap-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.ap-head b { font-family: var(--font-display); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-meta { font-size: 0.72rem; color: var(--text-faint); font-family: var(--font-mono, monospace); white-space: nowrap; }
.ap-wave { display: flex; align-items: center; gap: 2px; height: 40px; }
.ap-wave i { flex: 1; min-width: 2px; height: 100%; border-radius: 2px; transform: scaleY(var(--b, 0.4)); transform-origin: center; background: color-mix(in srgb, var(--violet, #8a3ffc) 38%, var(--surface-3)); transition: background 0.25s; }
.ap.playing .ap-wave i { background: linear-gradient(180deg, #ff2d9b, var(--violet, #8a3ffc)); animation: ap-eq var(--dur, 0.6s) ease-in-out var(--del, 0s) infinite alternate; }
@keyframes ap-eq { from { transform: scaleY(var(--b, 0.4)); } to { transform: scaleY(calc(var(--b, 0.4) + 0.6)); } }
@media (prefers-reduced-motion: reduce) { .ap.playing .ap-wave i { animation: none; } }
.ap-dl { width: 34px; height: 34px; flex: none; border: none; border-radius: 9px; background: var(--surface-3); color: #fff; cursor: pointer; font-size: 15px; display: grid; place-items: center; }
.ap-dl:hover { background: var(--violet, #8a3ffc); }

/* per-studio History strip */
.studio-history { margin-top: 22px; }
.sh-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sh-head b { font-family: var(--font-display); font-size: 1rem; }
.sh-grid { columns: 5 170px; }
@media (max-width: 900px){ .sh-grid { columns: 3 130px; } }

/* video lightbox (open + play a generated clip) */
#vidLightbox .vlb-box { width: min(900px, 92vw); display: flex; flex-direction: column; gap: 12px; background: #0d0d0d; border: 1px solid var(--border-strong); border-radius: 18px; padding: 16px; position: relative; transform: scale(0.97); transition: transform 0.16s; }
#vidLightbox.open .vlb-box { transform: none; }
#vidLightbox video { width: 100%; max-height: 70vh; border-radius: 12px; background: #000; }
.vlb-dl { align-self: center; }
.vlb-box .modal-x { position: absolute; top: 12px; right: 12px; z-index: 2; }
/* Image lightbox (click any generated image to expand) */
#imgLightbox .ilb-box { max-width: min(1100px, 94vw); max-height: 92vh; display: flex; flex-direction: column; align-items: center; gap: 14px; position: relative; transform: scale(0.97); transition: transform 0.16s; }
#imgLightbox.open .ilb-box { transform: none; }
.ilb-img { max-width: 100%; max-height: 80vh; border-radius: 12px; background: #000; box-shadow: 0 24px 80px -20px rgba(0,0,0,0.85); object-fit: contain; }
.ilb-x { position: absolute; top: 8px; right: 8px; z-index: 2; }
.ilb-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
/* generated images read as clickable (expand) */
.r-asset img, .ins-tile img, .r-tilewrap img, #imgGrid img, #studioHistory img { cursor: zoom-in; }
@media (max-width: 820px){
  .vmode-row { grid-template-columns: repeat(3, 1fr); }
  .vcomposer { grid-template-columns: 1fr; }
}

/* video create result */
.vc-result:empty { display: none; }
.vc-result { min-height: 0; display: grid; place-items: center; }
.vc-video { width: 100%; max-width: 860px; border-radius: 16px; box-shadow: 0 20px 60px -28px rgba(0,0,0,0.8); }
.vc-cap { text-align: center; color: var(--text-faint); font-size: 0.78rem; margin-top: 8px; font-family: var(--font-mono, monospace); }
/* real video History tiles */
.vh-card video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
/* uploaded start-frame / reference preview */
.dropzone.has-img, .ipb-add.has-img { position: relative; padding: 0; overflow: hidden; min-height: 96px; }
.ipb-add.has-img { width: 96px; height: 56px; flex: none; }
.dz-prev { width: 100%; height: 100%; max-height: 150px; object-fit: cover; display: block; border-radius: 12px; }
.dz-clear { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border: none; border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff; cursor: pointer; line-height: 1; font-size: 14px; }
.dz-clear:hover { background: rgba(0,0,0,0.85); }
.vc-gallery { columns: 4 160px; }

/* --- model picker modal --- */
.modal-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); display: grid; place-items: center; opacity: 0; transition: opacity 0.16s; padding: 20px; }
.modal-overlay.open { opacity: 1; }
.modal-box { width: 560px; max-width: 100%; max-height: 80vh; display: flex; flex-direction: column; background: #131313; border: 1px solid var(--border-strong); border-radius: 18px; padding: 18px; transform: scale(0.97); transition: transform 0.16s; }
.modal-overlay.open .modal-box { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-head b { font-size: 1.15rem; }
.modal-x { background: var(--surface-3); border: 0; color: var(--text-dim); width: 30px; height: 30px; border-radius: 9px; cursor: pointer; font-size: 0.9rem; }
.modal-x:hover { color: var(--text); }
.modal-search { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 10px 13px; color: var(--text); font: inherit; font-size: 0.88rem; outline: none; margin-bottom: 10px; }
.modal-search::placeholder { color: var(--text-faint); }
.modal-list { overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }

/* --- owner: load/give credits modal --- */
.cred-box { width: 460px; }
.cred-cur { font-size: 0.9rem; color: var(--text-dim); margin-bottom: 6px; }
.cred-cur b { color: var(--text); font-size: 1.05rem; }
.cred-sec { display: flex; flex-direction: column; gap: 9px; padding: 14px 0; border-top: 1px solid var(--border); }
.cred-lbl { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); }
.cred-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.cred-chip { padding: 8px 16px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-3); color: var(--text); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: border-color 0.14s, background 0.14s, color 0.14s; }
.cred-chip:hover { border-color: var(--violet); background: rgba(138,63,252,0.16); color: #d4bbff; }
.cred-row { display: flex; gap: 8px; }
.cred-row .opt-input { flex: 1; }
.cred-unlimrow { flex-direction: row; flex-wrap: wrap; align-items: center; }
.cred-zero { margin-left: auto; }
.mm-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 12px; background: transparent; border: 1px solid transparent; cursor: pointer; text-align: left; color: var(--text); font: inherit; }
.mm-item:hover { background: var(--surface-2); border-color: var(--border); }
.mm-ico { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--surface-3); font-size: 1.1rem; }
.mm-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mm-body b { font-size: 0.92rem; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.mm-body > span { font-size: 0.78rem; color: var(--text-faint); }
.mm-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.mm-tags em { font-style: normal; font-size: 0.7rem; color: var(--text-dim); background: var(--surface-3); padding: 3px 7px; border-radius: 7px; }

@media (max-width: 900px) {
  .video-layout { grid-template-columns: 1fr; }
  .ins-grid { columns: 3 150px; }
  .vc-gallery { columns: 3 130px; }
  .img-promptbar { max-width: none; }
}

/* ============================================================
   STUDIO PAGE REDESIGN — branded panel, icon, skeleton, audio
   ============================================================ */

/* premium left panel */
.tool-panel { border: 1px solid #232323; box-shadow: 0 20px 50px -30px rgba(0,0,0,0.9); }

/* clean, compact header — neutral surface, no colour fill */
.tp-card { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); }
.tp-id { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tp-id b { font-size: 0.98rem; font-weight: 700; line-height: 1; }
.tp-badge { align-self: flex-start; font-size: 0.58rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 6px; background: rgba(255,255,255,0.08); color: var(--text-dim); }
.tp-badge.beta { background: rgba(255,255,255,0.08); color: var(--violet-bright); }
.tp-badge.new, .tp-badge.live { background: #16a34a; color: #fff; }
.tp-badge.soon { background: rgba(255,255,255,0.08); color: var(--text-faint); }

/* clean icon tile — subtle dark surface, no saturated/gradient fill */
.ph-ico { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center;
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text); box-shadow: none; }
.ph-ico svg { width: 20px; height: 20px; }
.ph-glyph { font-size: 1.15rem; line-height: 1; }
/* SVG icon sizing for the remaining icon chips (clean stroked icons, no glyphs) */
.qt-ico svg { width: 26px; height: 26px; }
.tf-ico svg { width: 19px; height: 19px; }
.mm-ico svg { width: 20px; height: 20px; }
.cstudio-badge svg { width: 26px; height: 26px; }

.tp-craft { box-shadow: 0 12px 28px -12px rgba(138,63,252,0.7); }
.tp-cost { display: inline-flex; align-items: center; gap: 5px; }

/* branded skeleton empty-state (replaces the generic big-icon box) */
.r-placeholder { border: 1.5px dashed var(--border-strong); border-radius: 20px; padding: 28px 26px 30px; text-align: center; color: var(--text-faint); }
.ph-skel { margin-bottom: 20px; }
.ph-text { max-width: 420px; margin: 0 auto; font-size: 0.92rem; line-height: 1.5; }
.ph-text b { color: var(--text-dim); font-weight: 600; }

.sk-grid { display: grid; gap: 12px; }
.sk-grid.sk-emote { grid-template-columns: repeat(6, 1fr); }
.sk-grid.sk-cards { grid-template-columns: repeat(3, 1fr); }
.sk-tile, .sk-card, .sk-bar, .sk-dot, .sk-wave > span {
  background: linear-gradient(110deg, #1b1b1b 30%, color-mix(in srgb, var(--a, #8a3ffc) 16%, #262626) 50%, #1b1b1b 70%);
  background-size: 220% 100%; animation: skShimmer 1.7s ease-in-out infinite; }
.sk-tile { aspect-ratio: 1; border-radius: 16px; }
.sk-card { aspect-ratio: 16/10; border-radius: 14px; }
.sk-aud { display: flex; flex-direction: column; gap: 12px; }
.sk-row { display: flex; align-items: center; gap: 13px; }
.sk-dot { width: 34px; height: 34px; flex: none; border-radius: 50%; }
.sk-wave { flex: 1; display: flex; align-items: center; gap: 3px; height: 34px; }
.sk-wave > span { flex: 1; min-width: 2px; border-radius: 2px; height: 42%; }
.sk-wave > span:nth-child(3n) { height: 84%; } .sk-wave > span:nth-child(4n) { height: 62%; } .sk-wave > span:nth-child(5n) { height: 96%; }
.sk-bar { height: 48px; border-radius: 12px; }
@keyframes skShimmer { 0% { background-position: 220% 0; } 100% { background-position: -220% 0; } }
@media (prefers-reduced-motion: reduce) { .sk-tile, .sk-card, .sk-bar, .sk-dot, .sk-wave > span { animation: none; } }

/* audio results — waveform cards */
.r-audio { display: flex; flex-direction: column; gap: 14px; max-width: 660px; }
.r-aud { display: flex; align-items: center; gap: 15px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.aud-play { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; cursor: pointer; color: #fff; font-size: 0.85rem;
  background: linear-gradient(135deg, var(--k1), var(--k2)); box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--k1) 75%, transparent); }
.aud-play:hover { filter: brightness(1.08); }
.aud-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.aud-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.aud-head b { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aud-head span { font-size: 0.74rem; color: var(--text-faint); flex: none; }
.wave { display: flex; align-items: center; gap: 2px; height: 36px; }
.wb { flex: 1; min-width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--k1) 85%, transparent), color-mix(in srgb, var(--k2) 55%, transparent)); }

@media (max-width: 620px) { .sk-grid.sk-emote { grid-template-columns: repeat(3, 1fr); } }

/* ============================================================
   VIDEO PAGE — History / Community / Tutorial tabs
   ============================================================ */

/* finished History cards (no more perpetual "Queued") */
.vh-card.done { display: block; position: relative; cursor: pointer; text-decoration: none; }
.vh-card.done:hover { border-color: var(--violet); }
.vh-scrim { position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, rgba(0,0,0,0.78), rgba(0,0,0,0) 55%); }
.vh-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(4px); color: #fff; font-size: 0.8rem; opacity: 0; transition: opacity 0.2s; }
.vh-card.done:hover .vh-play { opacity: 1; }
.vh-meta { position: absolute; left: 11px; right: 11px; bottom: 10px; z-index: 2; display: flex; flex-direction: column; gap: 1px; }
.vh-meta b { font-size: 0.82rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vh-meta span { font-size: 0.72rem; color: rgba(255,255,255,0.72); }

/* community grid play badge */
.ins-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(3px); color: #fff; font-size: 0.72rem; opacity: 0; transition: opacity 0.2s; }
.ins-tile:hover .ins-play { opacity: 1; }

/* Tutorial tab — player + tutorial list */
.tut-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.tut-head { margin-bottom: 14px; }
.tut-yt { display: inline-flex; align-items: center; gap: 9px; font-size: 1.08rem; font-weight: 700; }
.tut-yt i { font-style: normal; display: grid; place-items: center; width: 27px; height: 20px; border-radius: 5px; background: #e0245e; color: #fff; font-size: 0.66rem; }
.tut-head p { color: var(--text-faint); margin: 7px 0 0; font-size: 0.9rem; }
.tut-player { position: relative; aspect-ratio: 16/9; border-radius: 18px; overflow: hidden; border: 1px solid var(--border); background: #101010; }
.tut-player .tpl-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tut-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: 64px; height: 64px; border: 0; border-radius: 50%; cursor: pointer; color: #fff; font-size: 1.2rem;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); transition: background 0.2s; }
.tut-play:hover { background: var(--violet); }
.tut-dur { position: absolute; right: 12px; bottom: 12px; z-index: 2; font-size: 0.76rem; color: #fff; background: rgba(0,0,0,0.62); padding: 3px 8px; border-radius: 7px; }
.tut-cap { position: absolute; left: 16px; bottom: 14px; z-index: 2; display: flex; flex-direction: column; gap: 2px; }
.tut-cap span { font-size: 0.66rem; letter-spacing: 0.1em; font-weight: 700; color: rgba(255,255,255,0.78); }
.tut-cap b { font-size: 1.05rem; color: #fff; }
.tut-list { display: flex; flex-direction: column; gap: 10px; }
.tut-card { display: flex; gap: 12px; padding: 8px; border-radius: 14px; border: 1px solid transparent; text-decoration: none; color: var(--text); }
.tut-card:hover { background: var(--surface-2); border-color: var(--border); }
.tut-thumb { position: relative; width: 100px; flex: none; aspect-ratio: 16/10; border-radius: 10px; overflow: hidden; background: var(--surface-3); }
.tut-thumb .tpl-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tut-tag { position: absolute; left: 5px; top: 5px; z-index: 2; font-size: 0.5rem; font-weight: 800; letter-spacing: 0.06em; padding: 2px 5px; border-radius: 4px; background: rgba(0,0,0,0.62); color: #fff; }
.tut-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; justify-content: center; }
.tut-info b { font-size: 0.86rem; font-weight: 600; }
.tut-info span { font-size: 0.76rem; color: var(--text-faint); line-height: 1.35; }
@media (max-width: 900px) { .tut-layout { grid-template-columns: 1fr; } }

/* ─────────── Screens composer — single styled pill (Intro/BRB/Outro · mode · platform on top;
   Ref + prompt + gradient Generate below). Reuses the existing screen-* controls. ─────────── */
.scr-composer { max-width: var(--page-max); margin: 6px auto 0; background: #14111f; border: 1px solid var(--border-strong); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 56px -28px rgba(0,0,0,0.8); }
.scr-comp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.scr-comp-main { gap: 11px; }
.scr-comp-sep { width: 1px; align-self: stretch; background: var(--border); margin: 2px 0; }
/* Intro/BRB/Outro compact tabs (reuse .scr-type so the existing handler toggles .on) */
.scr-typetabs { display: flex; gap: 4px; flex-wrap: wrap; }
.scr-typetab { padding: 8px 15px; border-radius: 12px; border: 0; background: transparent; color: var(--text-faint); font: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: background .15s, color .15s; }
.scr-typetab:hover { color: var(--text-dim); background: var(--surface-2); }
.scr-typetab.on { background: #2a2733; color: #fff; }
.scr-composer .scr-modes { max-width: none; margin: 0; }
.scr-composer .em-mode { padding: 8px 14px; }
.scr-composer .plat-inline { display: flex; gap: 6px; flex-wrap: wrap; }
.scr-composer .plat-inline .plat-chip { padding: 6px 11px; }
.scr-composer .scr-dur { display: flex; gap: 6px; }
.scr-ref { display: inline-flex; align-items: center; gap: 6px; flex: none; background: var(--surface-3); border: 1px solid var(--border); color: var(--text-dim); font: inherit; font-size: 0.85rem; padding: 9px 13px; border-radius: 12px; cursor: pointer; white-space: nowrap; }
.scr-ref:hover { color: var(--text); border-color: var(--border-strong); }
.scr-ref .dz-ico { font-size: 1rem; }
.scr-comp-input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text); font: inherit; font-size: 1.05rem; padding: 8px 4px; outline: none; }
.scr-comp-input::placeholder { color: var(--text-faint); }
.scr-composer .vc-generate { width: auto; margin: 0; white-space: nowrap; padding: 11px 22px; }
@media (max-width: 720px) { .scr-comp-main { flex-wrap: wrap; } .scr-composer .vc-generate { flex: 1; } }

/* Compact upload button next to the Generate/Craft button (Thumbnail composer). */
.pb-ref { height: 42px; width: 44px; padding: 0; justify-content: center; border-radius: 12px; flex: none; }
.pb-ref .dz-ico { font-size: 1.05rem; }
.pb-ref.has-img { height: 42px; width: 56px; }

/* Templates search bar + Assets toolbar search. */
.tpl-bar { max-width: var(--page-max); margin: 0 auto 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tpl-bar .chips2 { margin: 0; flex: 1 1 auto; }
.tpl-search { position: relative; flex: 0 0 auto; display: flex; align-items: center; }
.tpl-search svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--text-faint, #8a8a99); pointer-events: none; }
.tpl-search input { width: 230px; max-width: 100%; height: 40px; padding: 0 14px 0 36px; border-radius: 11px; border: 1px solid var(--border, #26262f); background: var(--surface-2, #16161d); color: var(--text, #ececf1); font-size: 0.88rem; }
.tpl-search input:focus { outline: none; border-color: #8e2dff; }
.tpl-none { grid-column: 1 / -1; padding: 40px 4px; color: var(--text-faint, #8a8a99); font-size: 0.9rem; }
.tpl-none a { color: #bd7bff; text-decoration: none; }
.tpl-none a:hover { text-decoration: underline; }

/* Media tiles shared by Assets (real projects). Templates keep their original
   placeholder look; these rules only touch tiles that carry real media. */
.asset-tile { cursor: default; margin: 0; }
.asset-tile .tpl-art::before, .asset-tile .tpl-art::after { display: none; } /* no shimmer over real media */
.tpl2 .tpl-art .tpl-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.tpl-aud { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(135deg, #7c3aed, #ec4899); color: #fff; z-index: 0; }
.tpl-aud svg { width: 40px; height: 40px; }
.tpl-name { margin: 10px 2px 2px; font-size: 0.9rem; font-weight: 600; color: var(--text, #ececf1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; outline: none; }
.tpl-name.editing { white-space: normal; overflow: visible; text-overflow: clip; border-bottom: 1px solid #8e2dff; cursor: text; }
.asset-tile .tpl2-c { padding: 0 2px; }
.r-rename { position: absolute; top: 8px; right: 80px; z-index: 3; width: 30px; height: 30px; display: grid; place-items: center; border: none; border-radius: 9px; background: rgba(0,0,0,0.62); color: #fff; cursor: pointer; font-size: 12px; font-weight: 700; opacity: 0; transition: opacity 0.16s, background 0.16s; }
.asset-tile:hover .r-rename { opacity: 1; }
.r-rename:hover { background: var(--violet, #8e2dff); }
.r-fav { position: absolute; top: 8px; left: 8px; z-index: 3; width: 30px; height: 30px; display: grid; place-items: center; border: none; border-radius: 9px; background: rgba(0,0,0,0.62); color: #fff; cursor: pointer; font-size: 15px; opacity: 0; transition: opacity 0.16s, transform 0.12s; }
.asset-tile:hover .r-fav { opacity: 1; }
.r-fav.on { opacity: 1; color: #ffcf3f; }
.r-fav:hover { transform: scale(1.12); }
.ins-tile video { width: 100%; display: block; }

/* My Assets — sectioned overview + section pages. */
.asset-topsearch { max-width: var(--page-max); margin: 0 auto 22px; }
.asset-topsearch input { width: 320px; }
.tpl-back { display: inline-block; max-width: var(--page-max); margin: 0 auto 14px; color: var(--text-faint, #8a8a99); text-decoration: none; font-size: 0.85rem; }
.tpl-back:hover { color: var(--text, #fff); }
.asset-sec { max-width: var(--page-max); margin: 0 auto 30px; }
.asset-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 13px; }
.asset-sec-head h3 { font-size: 1.02rem; font-weight: 700; margin: 0; }
.asset-seeall { font-size: 0.82rem; font-weight: 600; color: #bd7bff; text-decoration: none; white-space: nowrap; }
.asset-seeall:hover { text-decoration: underline; }
.asset-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; max-height: 200px; overflow: hidden; }
#assetLib.searching .asset-row { max-height: none; overflow: visible; }
.asset-row .tpl2 .tpl-art { height: 150px; }
.asset-full { max-width: var(--page-max); margin: 0 auto; }
.asset-fav-hint { padding: 16px 18px; border: 1px dashed var(--border, #26262f); border-radius: 13px; color: var(--text-faint, #8a8a99); font-size: 0.88rem; }
.asset-fav-hint b { color: var(--text, #ececf1); }
.asset-ctx { position: fixed; z-index: 9999; min-width: 190px; padding: 6px; border-radius: 12px; background: var(--surface-2, #16161d); border: 1px solid var(--border, #2a2a35); box-shadow: 0 18px 44px rgba(0,0,0,0.5); display: flex; flex-direction: column; gap: 2px; }
.asset-ctx button { text-align: left; padding: 9px 12px; border: 0; background: none; color: var(--text, #ececf1); font-size: 0.86rem; border-radius: 8px; cursor: pointer; }
.asset-ctx button:hover { background: rgba(142,45,255,0.16); color: #fff; }
/* Touch devices have no hover and no right-click — keep tile actions visible. */
@media (hover: none) {
  .asset-tile .r-fav, .asset-tile .r-rename, .asset-tile .r-dl, .asset-tile .r-edit { opacity: 1; }
}
