/* Alpha Studio — VN-style UI in light and dark (theme.js sets html[data-theme] before the first paint). The interface uses
 Inter (text, tabular numbers) and Plus Jakarta Sans (headings) from /alpha/fonts/fonts.css; the brand-yellow "Alpha" tile;
 the brand yellow #FFD60A with ink text for buttons and selected states. The @font-face rules below are the TEMPLATE fonts — the canvas draws the
 templates' on-screen text with them (text.js, hud.js) — not the interface's. */

/* ---- template fonts (fontsource on jsdelivr, latin subset) ---- */
@font-face { font-family: "Archivo Black"; font-weight: 400; font-display: swap; src: url(https://cdn.jsdelivr.net/npm/@fontsource/archivo-black@5.3.0/files/archivo-black-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(https://cdn.jsdelivr.net/npm/@fontsource/barlow-condensed@5.3.0/files/barlow-condensed-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jost"; font-weight: 700; font-display: swap; src: url(https://cdn.jsdelivr.net/npm/@fontsource/jost@5.3.0/files/jost-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jost"; font-weight: 800; font-display: swap; src: url(https://cdn.jsdelivr.net/npm/@fontsource/jost@5.3.0/files/jost-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url(https://cdn.jsdelivr.net/npm/@fontsource/montserrat@5.3.0/files/montserrat-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Montserrat"; font-weight: 800; font-display: swap; src: url(https://cdn.jsdelivr.net/npm/@fontsource/montserrat@5.3.0/files/montserrat-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --head: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, sans-serif;
  --num: var(--ui);
  --display: var(--head);
  --brandfont: "Jost", "Futura", "Avenir Next", system-ui, sans-serif;
  --emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  --r-xl: 24px; --r-lg: 18px; --r: 14px; --r-sm: 10px; --r-xs: 7px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.3, 1.4, .5, 1);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --accent: #ffd60a; --accent-ink: #111214; --accent-rgb: 255, 214, 10;   /* the brand yellow (site, apps) */
  --brand: #ffd60a; --brand-ink: #0d0d0d; --cyan: #31d4f2;
}
/* dark: the website's charcoal */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0e11; --bg-1: #111418; --surface: #15181d; --surface-2: #1d2128; --surface-3: #272c34;
  --card: #15181d; --sheet: #16191e; --fill: #1b1e24; --fill-2: #24282f; --tile: #272b33; --bar: #111418; --stage: #0c0e11;
  --line: rgba(255, 255, 255, .075); --line-2: rgba(255, 255, 255, .14); --line-3: rgba(255, 255, 255, .24);
  --text: #eef0f3; --text-2: #a1a7b1; --text-3: #767d89;
  --accent-hi: #ffe14d; --accent-fg: #ffd60a; --accent-strong: #ffd60a; --ring: #ffd60a;
  --accent-soft: rgba(var(--accent-rgb), .15); --accent-line: rgba(var(--accent-rgb), .5);
  --danger: #ff5b4f; --ok: #3ccf7f; --heart: #ff4d6d;
  --glass: rgba(27, 30, 36, .76); --glass-line: rgba(255, 255, 255, .09);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 16px 40px rgba(0, 0, 0, .5);
  --shadow-bar: 0 14px 36px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .4);
  --ring: #ffffff; --seg-on: #2a2f37; --scrim: rgba(0, 0, 0, .62);
  --wave-dim: rgba(255, 255, 255, .28);
  --frame-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 24px 70px rgba(0, 0, 0, .55);
  --toast-bg: #f4f3ef; --toast-fg: #121212; --toast-ok: #148a45;
  --brand-line: #ffd60a; --warn-fg: #fbbf24; --warn-bg: rgba(245, 158, 11, .16);
}
/* light: VN-style white */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff; --bg-1: #f6f7f9; --surface: #f4f5f7; --surface-2: #eceef1; --surface-3: #dfe2e7;
  --card: #ffffff; --sheet: #ffffff; --fill: #f2f3f5; --fill-2: #e8eaee; --tile: #ffffff; --bar: #ffffff; --stage: #f1f2f4;
  --line: rgba(16, 19, 26, .08); --line-2: rgba(16, 19, 26, .13); --line-3: rgba(16, 19, 26, .22);
  --text: #111318; --text-2: #5a606a; --text-3: #8a9099;
  --accent-hi: #ffe14d; --accent-fg: #8a6a00; --accent-strong: #e0b000; --ring: #111214;
  --accent-soft: rgba(var(--accent-rgb), .22); --accent-line: rgba(224, 176, 0, .7);
  --danger: #dc3127; --ok: #1f9d55; --heart: #f0284a;
  --glass: rgba(255, 255, 255, .8); --glass-line: rgba(16, 19, 26, .07);
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
  --shadow-2: 0 14px 34px rgba(16, 24, 40, .13);
  --shadow-bar: 0 12px 32px rgba(16, 24, 40, .16), 0 2px 8px rgba(16, 24, 40, .07);
  --ring: #111318; --seg-on: #ffffff; --scrim: rgba(17, 19, 24, .42);
  --wave-dim: rgba(16, 19, 26, .2);
  --frame-shadow: 0 0 0 1px rgba(16, 19, 26, .06), 0 18px 46px rgba(16, 24, 40, .24);
  --toast-bg: #1c1e23; --toast-fg: #ffffff; --toast-ok: #3ccf7f;
  --brand-line: #f2c200; --warn-fg: #a8540a; --sel-ring: #111214; --warn-bg: rgba(245, 158, 11, .15);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font: 400 15px/1.5 var(--ui); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
/* iOS Safari zooms into a focused field whose text is under 16px (and stays zoomed): on touch screens and narrow windows
   every form control is at least 16px. Pinch zoom stays on (no maximum-scale / user-scalable in the viewport meta). */
@media (pointer: coarse), (max-width: 600px) { input, select, textarea { font-size: max(16px, 1em) !important; } }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img, video, canvas { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.muted { color: var(--text-2); }
.tc { font-family: var(--ui); font-weight: 600; font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes shimmer { to { background-position: -300% 0; } }
@keyframes blink { 50% { opacity: .25; } }
@keyframes pop { 30% { transform: scale(1.35); } 60% { transform: scale(.9); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- buttons ---- */
a.btn { text-decoration: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border-radius: 999px; background: var(--surface-3); color: var(--text); font: 600 15px/1 var(--ui); letter-spacing: -.005em;
  border: 1px solid var(--line); transition: transform .12s var(--ease), background .15s, border-color .15s, opacity .15s; user-select: none; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn:hover { border-color: var(--line-2); }
.btn.accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.accent:hover { background: var(--accent-hi); }
.btn.tonal { background: var(--fill); border-color: transparent; color: var(--text); }
.btn.tonal:hover { background: var(--fill-2); }
.btn.ghost { background: transparent; border-color: var(--line-2); }
.btn.danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn.block { width: 100%; }
.btn.lg { min-height: 54px; font-size: 16px; padding: 0 24px; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.xs { min-height: 34px; padding: 0 12px; font-size: 13.5px; gap: 6px; }
.btn[disabled], .btn.busy { opacity: .45; pointer-events: none; }
.icon-btn { width: 44px; height: 44px; border-radius: 999px; display: inline-grid; place-items: center; color: var(--text); transition: background .15s, color .15s; flex: none; }
.icon-btn:hover { background: var(--fill); }
.icon-btn.ghost { color: var(--text-2); }
.icon-btn.sm { width: 36px; height: 36px; }
.spin { display: inline-block; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; flex: none; }
.linkbtn { display: inline-flex; align-items: center; gap: 3px; min-height: 36px; padding: 0 2px; color: var(--text-2); font: 600 14px/1 var(--ui); flex: none; }
.linkbtn:hover { color: var(--text); }
.linkbtn.accent { color: var(--accent-fg); }
.linkbtn.accent:hover { color: var(--text); }
.linkbtn.inline { display: inline; min-height: 0; padding: 0; font: inherit; font-weight: 600; }
.kicker { font: 600 13px/1.2 var(--ui); color: var(--accent-fg); }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; font: 600 12px/1 var(--ui);
  background: var(--fill); color: var(--text-2); }
.pill.y { background: var(--accent-soft); color: var(--accent-fg); }

/* ---- brand: the yellow "Alpha" tile (Futura-like Jost bold with the short bar under it, as in the app icon) ---- */
.alpha-tile, .logo { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 34px; padding: 0 10px;
  border-radius: 9px; background: var(--brand); color: var(--brand-ink); font: 700 18px/1 var(--brandfont); letter-spacing: 0; flex: none; }
.alpha-tile i, .logo i { font-style: normal; display: block; margin-top: 2px; }
.alpha-tile::after, .logo::after { content: ""; display: block; width: 42%; height: 2.5px; border-radius: 2px; background: currentColor; }
.alpha-tile.sq { width: 72px; height: 72px; padding: 0; gap: 4px; border-radius: 19px; font-size: 21px; box-shadow: 0 10px 26px -10px rgba(255, 190, 0, .55); }
.alpha-tile.sq::after { height: 3px; }

/* ================================ HOME (gallery.js) ================================ */
.gallery { min-height: 100%; background: var(--bg); overflow-x: clip; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding-left: max(16px, var(--safe-l)); padding-right: max(16px, var(--safe-r)); }
.g-views { position: relative; padding-top: 4px; padding-bottom: calc(112px + var(--safe-b)); }
/* a status-bar strip for the iPhone home-screen app (black-translucent): nothing scrolls under the clock */
.g-safe { position: fixed; z-index: 35; top: 0; left: 0; right: 0; height: var(--safe-t); background: var(--bg); pointer-events: none; }
.skel { background: linear-gradient(100deg, var(--fill) 30%, var(--fill-2) 50%, var(--fill) 70%) 0 0 / 300% 100% !important; animation: shimmer 1.4s infinite linear !important; box-shadow: none !important; }
.tcard.skel { background: none !important; animation: none !important; }
.tcard.skel .media { background: linear-gradient(100deg, var(--fill) 30%, var(--fill-2) 50%, var(--fill) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s infinite linear; }
.tcard.skel h3, .tcard.skel .meta { height: 13px; border-radius: 6px; background: var(--fill); }
.tcard.skel .meta { width: 55%; }

/* phones: the big title ("Discover", "My Templates") above the sticky search bar */
.g-titlebar { display: flex; align-items: center; gap: 12px; padding-top: calc(var(--safe-t) + 18px); padding-bottom: 4px; }
.g-h1 { flex: 1; min-width: 0; margin: 0; font: 800 30px/1.1 var(--head); letter-spacing: -.03em; }
.g-tile { flex: none; border-radius: 10px; }
.g-tile .alpha-tile { height: 32px; font-size: 17px; }
.gallery[data-tab="search"] .g-titlebar { display: none; }
.gallery[data-tab="search"] { padding-top: var(--safe-t); }

/* the sticky bar — phones: the search field; desktop: logo · Home · My Templates · search · light/dark · account */
.g-top { position: sticky; top: var(--safe-t); z-index: 30; background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px); transition: box-shadow .2s; }
.g-top.lifted { box-shadow: 0 1px 0 var(--line); }
.g-bar { display: flex; align-items: center; gap: 10px; height: 64px; }
.g-brand, .g-nav, .theme-btn, .g-acct { display: none !important; }
.gallery[data-tab="mine"] .g-top { display: none; }
.g-search { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.g-search > svg { position: absolute; left: 15px; color: var(--text-3); pointer-events: none; }
.g-search input { width: 100%; height: 46px; border-radius: 999px; border: 1px solid transparent; background: var(--fill); padding: 0 42px 0 44px;
  font: 400 16px/1 var(--ui); color: var(--text); outline: none; -webkit-appearance: none; appearance: none; transition: background .15s, border-color .15s, box-shadow .15s; }
.g-search input::-webkit-search-cancel-button, .g-search input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.g-search input::placeholder { color: var(--text-3); opacity: 1; }
.g-search input:focus { background: var(--bg); border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.g-search input:placeholder-shown { padding-right: 14px; }
.s-clear { position: absolute; right: 6px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); }
.s-clear:hover { color: var(--text); background: var(--fill-2); }
.g-cancel { display: none; flex: none; height: 46px; padding: 0 4px; color: var(--accent-fg); font: 600 15px/1 var(--ui); }
.gallery[data-tab="search"] .g-cancel { display: inline-flex; align-items: center; }
.theme-btn { color: var(--text-2); }
.theme-btn:hover { color: var(--text); }
.g-acct .btn.sm { min-height: 38px; }
.acct-signin svg { display: none; }
.g-pagehead, .mine-h { display: none; }
.site-banner { margin: 12px 0 0; padding: 10px 14px; border-radius: var(--r); background: var(--accent-soft); color: var(--text); font: 600 14px/1.35 var(--ui); text-align: center; }

/* section heads */
.sec-h { display: flex; align-items: baseline; gap: 8px; margin: 0 0 12px; }
.sec-h h2 { margin: 0; font: 700 19px/1.2 var(--head); letter-spacing: -.02em; }
.sec-h .n { font: 500 14px/1 var(--ui); color: var(--text-3); font-variant-numeric: tabular-nums; }
.sec-h .linkbtn { margin-left: auto; align-self: center; }

/* Top Categories: one row of square cards you swipe — 2.5 on a phone (the half card says "swipe"), about 4.5 on a tablet
   and 6.5 on desktop (with arrows); it starts at the page padding and runs to the right edge */
.g-topcats { margin-top: 10px; }
.tc-arrows { display: none; margin-left: auto; gap: 6px; align-self: center; }
@media (hover: hover) and (pointer: fine) { .tc-arrows { display: flex; } }
.tc-arrow { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--text); transition: background .15s, opacity .15s; }
.tc-arrow:hover:not(:disabled) { background: var(--fill-2); }
.tc-arrow:disabled { opacity: .35; cursor: default; }
.mains { --per: 2.5; --gap: 10px; --lpad: max(16px, var(--safe-l));
  display: flex; gap: var(--gap); overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; margin-right: calc((100% + var(--side, 0px) - 100vw) / 2); padding: 2px max(16px, var(--safe-r)) 6px 0; scroll-padding: 0; border-radius: 4px; }
.mains::-webkit-scrollbar { display: none; }
.mains:focus-visible { outline-offset: 4px; }
.mcard { position: relative; isolation: isolate; overflow: hidden; display: block; flex: 0 0 calc((100vw - var(--side, 0px) - var(--lpad)) / var(--per) - var(--gap)); aspect-ratio: 1;
  scroll-snap-align: start; border-radius: 22px; text-align: left; color: #fff; background: linear-gradient(150deg, var(--c0), var(--c1));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); transition: transform .25s var(--ease), box-shadow .25s var(--ease); animation: rise .5s var(--ease) both; }
.mcard::before { content: ""; position: absolute; z-index: -1; right: -18%; bottom: -18%; width: 80%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0)); }
/* a soft shade behind the title, so it reads on any artwork */
.mcard::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit;
  background: linear-gradient(165deg, rgba(0, 0, 0, .3) 0%, rgba(0, 0, 0, .08) 34%, rgba(0, 0, 0, 0) 52%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.mc-txt { position: absolute; z-index: 2; left: 12px; top: 12px; right: 10px; display: grid; justify-items: start; gap: 6px; }
.mc-txt b { font: 800 15px/1.18 var(--head); letter-spacing: -.02em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .28), 0 2px 14px rgba(0, 0, 0, .3); }
.mc-n { height: 21px; padding: 0 8px; border-radius: 999px; background: rgba(10, 12, 15, .42); font: 600 11px/21px var(--ui); color: #fff; white-space: nowrap;
  font-variant-numeric: tabular-nums; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.mc-soon { height: 21px; padding: 0 8px; border-radius: 999px; background: rgba(255, 255, 255, .24); font: 600 11px/21px var(--ui); white-space: nowrap;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
/* the artwork: full bleed, fading in over the card's gradient */
.art.full { position: absolute; inset: 0; z-index: 0; display: block; }
.art.pic img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s var(--ease), transform .5s var(--ease); }
.art.pic.on img { opacity: 1; }
/* no artwork: the small drawing bottom-right */
.art.svg { color: color-mix(in srgb, var(--c1, #333) 76%, #000); filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .22)); }
.art svg { display: block; width: 100%; height: 100%; }
.mcard .art.svg { inset: auto 7% 7% auto; width: 52%; aspect-ratio: 1; }
.mcard:active { transform: scale(.96); }
.mcard.skel { aspect-ratio: 1; border-radius: 22px; }
@media (hover: hover) { .mcard:hover { transform: scale(1.025); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 14px 30px -16px var(--c1); }
  .mcard:hover .art.pic img { transform: scale(1.06); } .mcard:hover .art.svg { transform: translate(-2px, -3px) rotate(-5deg) scale(1.06); } }
@media (min-width: 600px) { .mains { --per: 4.5; --gap: 12px; } .mc-txt b { font-size: 16px; } }
@media (min-width: 1024px) { .mains { --per: 5.5; --gap: 14px; --lpad: max(16px, calc((100vw - var(--side, 0px) - var(--maxw)) / 2 + 16px)); }
  .mcard { border-radius: 24px; } .mc-txt { left: 16px; top: 15px; } .mc-txt b { font-size: 17.5px; } .mc-n { font-size: 12px; } }
@media (min-width: 1360px) { .mains { --per: 6.5; } }

/* All categories: light emoji cards, equal size; the first 12, then More / Less */
.g-all { margin-top: 32px; }
.agrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.acard { display: flex; align-items: center; gap: 10px; min-width: 0; height: 62px; padding: 0 12px 0 9px; border-radius: 16px; background: var(--fill);
  border: 1.5px solid transparent; text-align: left; color: var(--text); transition: background .15s, border-color .15s, transform .12s var(--ease); }
.acard:hover { background: var(--fill-2); }
.acard:active { transform: scale(.97); }
.acard .ae { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--tile); font: 22px/1 var(--emoji); box-shadow: var(--shadow-1); }
.acard .at { min-width: 0; display: grid; gap: 3px; }
.acard b { font: 600 14px/1.2 var(--ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acard .at span { font: 400 12.5px/1.2 var(--ui); color: var(--text-2); font-variant-numeric: tabular-nums; }
.acard.soon .at span { color: var(--text-3); }
.acard[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); }
.acard.rise { animation: rise .35s var(--ease) both; }
.amore { display: flex; align-items: center; gap: 6px; margin: 12px auto 0; height: 40px; padding: 0 16px 0 18px; border-radius: 999px; background: var(--fill); color: var(--text); font: 600 14px/1 var(--ui); transition: background .15s; }
.amore:hover { background: var(--fill-2); }
.amore .n { color: var(--text-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.amore svg { color: var(--text-2); transition: transform .25s var(--ease); }
.amore.open svg { transform: rotate(180deg); }

/* rows that scroll sideways on phones */
.drow, .rrow, .badges, .s-chips { display: flex; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  margin-left: calc(-1 * max(16px, var(--safe-l))); margin-right: calc(-1 * max(16px, var(--safe-r)));
  padding-left: max(16px, var(--safe-l)); padding-right: max(16px, var(--safe-r)); scroll-padding: 0 max(16px, var(--safe-l)); }
.drow::-webkit-scrollbar, .rrow::-webkit-scrollbar, .badges::-webkit-scrollbar, .s-chips::-webkit-scrollbar { display: none; }

/* Continue editing (drafts) */
.g-drafts, .g-recent { margin-top: 32px; }
.drow { gap: 10px; padding-top: 2px; padding-bottom: 10px; scroll-snap-type: x proximity; }
.dcard { flex: none; width: 256px; scroll-snap-align: start; display: flex; gap: 12px; padding: 8px 12px 8px 8px; border-radius: 18px; background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow-1); text-align: left; color: var(--text); transition: border-color .15s, transform .12s var(--ease); animation: rise .45s var(--ease) both; }
.dcard:hover { border-color: var(--line-2); }
.dcard:active { transform: scale(.98); }
.dcard .th { flex: none; width: 52px; height: 92px; border-radius: 10px; overflow: hidden; background: var(--fill); display: grid; place-items: center; color: var(--text-3); }
.dcard .th img { width: 100%; height: 100%; object-fit: cover; }
.dcard .bd { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 3px 0 2px; }
.dcard b { font: 600 14px/1.25 var(--ui); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dcard .sub { font: 400 12.5px/1.2 var(--ui); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.dcard .go { margin-top: auto; display: inline-flex; align-items: center; gap: 2px; color: var(--accent-fg); font: 600 13px/1 var(--ui); }
.prog { display: block; height: 4px; width: min(150px, 100%); border-radius: 2px; background: var(--fill-2); overflow: hidden; }
.prog i { display: block; height: 100%; border-radius: 2px; background: var(--accent-strong); }

/* Recently used */
.rrow { gap: 12px; padding-top: 2px; padding-bottom: 10px; }
.rcard { flex: none; width: 108px; display: grid; gap: 6px; align-content: start; text-align: left; color: var(--text); animation: rise .45s var(--ease) both; }
.rcard .th { position: relative; display: block; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: var(--fill); box-shadow: 0 0 0 1px var(--line); transition: transform .2s var(--ease); }
.rcard:active .th { transform: scale(.97); }
.rcard .th img { width: 100%; height: 100%; object-fit: cover; }
.rcard b { font: 600 13px/1.25 var(--ui); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rcard .sub { font: 400 12px/1.2 var(--ui); color: var(--text-3); }

/* the templates: heading and grid (the home's, and a category page's) */
.g-tpl { margin-top: 32px; }
.g-head { display: flex; align-items: baseline; gap: 8px; margin: 0 0 12px; min-height: 30px; }
.g-head h2 { margin: 0; min-width: 0; font: 700 19px/1.2 var(--head); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-head .n { flex: none; font: 500 14px/1 var(--ui); color: var(--text-3); font-variant-numeric: tabular-nums; }
.badges { gap: 8px; padding-top: 2px; padding-bottom: 4px; }
.badge { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px 0 14px; border-radius: 999px; background: var(--fill); color: var(--text);
  font: 500 14px/1 var(--ui); white-space: nowrap; transition: background .15s, color .15s, opacity .15s; }
.badge .be { font: 16px/1 var(--emoji); margin-left: -3px; }
.badge .n { color: var(--text-3); font-variant-numeric: tabular-nums; }
.badge:hover:not(:disabled) { background: var(--fill-2); }
.badge[aria-pressed="true"] { background: var(--text); color: var(--bg); font-weight: 600; }
.c-subs.tinted .badge[aria-pressed="true"] { background: linear-gradient(150deg, var(--c0), var(--c1)); color: #fff; }
.badge[aria-pressed="true"] .n { color: inherit; opacity: .72; }
.badge:disabled { opacity: .42; cursor: default; }

/* a category page */
.c-bar { position: sticky; top: var(--safe-t); z-index: 31; display: flex; align-items: center; gap: 2px; height: 56px;
  margin: 0 calc(-1 * max(16px, var(--safe-r))) 0 calc(4px - max(16px, var(--safe-l))); padding-right: 16px;
  background: var(--bg); background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  transition: box-shadow .2s; }
.c-bar.lifted { box-shadow: 0 1px 0 var(--line); }
.c-bar-t { min-width: 0; font: 700 17px/1.2 var(--head); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery[data-tab="cat"] { padding-top: var(--safe-t); }
.c-hero { margin: 2px 0 16px; }
.c-hero-in { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: flex-end; min-height: 150px; padding: 18px; border-radius: 24px; animation: rise .45s var(--ease) both; }
.c-hero-in.top { color: #fff; padding-right: 44%;
  background: radial-gradient(120% 110% at 0% 0%, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 55%), linear-gradient(150deg, var(--c0), var(--c1)); }
.c-hero-in.top::before { content: ""; position: absolute; z-index: -1; right: -8%; bottom: -30%; width: 58%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0)); }
.c-hero-in.top .art.hero { position: absolute; z-index: -1; top: 0; right: 0; bottom: 0; height: 100%; width: auto; aspect-ratio: 1; display: block;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 34%); mask-image: linear-gradient(90deg, transparent 0, #000 34%); }
.c-hero-in.top .art.hero.svg { inset: auto 5% 9% auto; width: auto; height: 82%; aspect-ratio: 1; -webkit-mask-image: none; mask-image: none; }
.c-hero-in.top .c-txt h1, .c-hero-in.top .c-txt p { text-shadow: 0 1px 12px rgba(0, 0, 0, .25); }
.c-hero-in.emo { gap: 16px; align-items: center; min-height: 0; background: var(--fill); }
.c-emoji { flex: none; width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center; background: var(--tile); box-shadow: var(--shadow-1); font: 42px/1 var(--emoji); }
.c-txt { position: relative; z-index: 1; display: grid; gap: 6px; min-width: 0; }
.c-txt h1 { margin: 0; font: 800 27px/1.1 var(--head); letter-spacing: -.03em; text-wrap: balance; }
.c-txt p { margin: 0; font: 500 14px/1.2 var(--ui); opacity: .86; font-variant-numeric: tabular-nums; }
.c-hero-in.emo .c-txt p { color: var(--text-2); opacity: 1; }
.c-txt p.soon { justify-self: start; height: 24px; padding: 0 10px; border-radius: 999px; background: rgba(255, 255, 255, .22); font: 600 12px/24px var(--ui); opacity: 1; }
.c-hero-in.emo .c-txt p.soon { background: var(--accent-soft); color: var(--accent-fg); }
.c-hero-back { display: none; }
.c-subs { margin-bottom: 18px; }
.gallery[data-tab="cat"] .g-titlebar, .gallery[data-tab="cat"] .g-top { display: none; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
.tcard { position: relative; display: flex; flex-direction: column; gap: 9px; min-width: 0; animation: rise .5s var(--ease) both; }
.tcard .media { position: relative; display: block; width: 100%; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; background: var(--fill); isolation: isolate;
  box-shadow: 0 0 0 1px var(--line); transition: transform .25s var(--ease), box-shadow .25s; }
.tcard .media img, .tcard .media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tcard .media video { opacity: 0; transition: opacity .3s; }
.tcard.playing .media video { opacity: 1; }
.tcard .media::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, .26) 0%, transparent 20%, transparent 70%, rgba(0, 0, 0, .42) 100%); }
@media (hover: hover) { .tcard:hover .media { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--line-2), var(--shadow-2); } }
.tcard .media:active { transform: scale(.98); }
.tcard .pb { position: absolute; z-index: 2; top: 8px; left: 8px; }
.tcard .afx { position: absolute; z-index: 2; left: 8px; bottom: 8px; }
.tcard .dur { position: absolute; z-index: 2; right: 8px; bottom: 8px; }
.tcard .afx, .tcard .dur, .rcard .dur { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 7px;
  background: rgba(10, 12, 15, .55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; font: 600 11.5px/1 var(--ui); font-variant-numeric: tabular-nums; }
.rcard .dur { position: absolute; right: 6px; bottom: 6px; height: 20px; font-size: 11px; }
.tcard .afx svg { color: #ffd60a; }
.tcard.playing .dur::before { content: ""; width: 6px; height: 6px; margin-right: 1px; border-radius: 50%; background: var(--accent); animation: blink 1.2s infinite; }
.price, .owned { display: inline-flex; align-items: center; gap: 4px; flex: none; height: 22px; padding: 0 8px; border-radius: 7px; white-space: nowrap;
  font: 700 12px/1 var(--ui); font-variant-numeric: tabular-nums; }
.price { background: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 10px rgba(0, 0, 0, .22); }
.owned { padding: 0 8px 0 6px; background: var(--ok); color: #04210f; }
.price.qr { padding: 0 8px 0 6px; background: var(--brand); color: var(--brand-ink); }
.price.sm, .owned.sm { height: 20px; font-size: 11.5px; align-self: flex-start; }
.heart { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(10, 12, 15, .36);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: color .15s, background .15s, transform .15s var(--ease); }
.heart svg { transition: fill .15s; }
.heart[aria-pressed="true"] { color: var(--heart); background: rgba(255, 255, 255, .95); }
.heart[aria-pressed="true"] svg { fill: currentColor; }
.heart:active { transform: scale(.88); }
.heart.pop svg { animation: pop .42s var(--spring); }
.tcard > .heart { position: absolute; z-index: 3; top: 8px; right: 8px; }
.tinfo { display: grid; gap: 3px; min-width: 0; }
.tcard h3 { margin: 0; font: 600 14.5px/1.3 var(--ui); letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard .meta { font: 400 12.5px/1.3 var(--ui); color: var(--text-2); display: flex; gap: 5px; align-items: center; min-width: 0; }
.tcard .meta > span:first-child { white-space: nowrap; flex: none; }
.tcard .meta svg { flex: none; color: var(--text-3); }
.song { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sep { flex: none; color: var(--text-3); margin: 0 1px; }
.tacts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; margin-top: 1px; }
.tacts .btn { min-height: 36px; padding: 0 6px; gap: 5px; font-size: 13px; letter-spacing: -.01em; }
.tacts .pv { padding: 0 10px; }
.tacts .pv svg { display: none; }
@media (max-width: 374px) { .tacts .btn { font-size: 12px; } .tacts .pv { padding: 0 8px; } }
@media (min-width: 1280px) { .tacts .pv svg { display: block; } }
.g-foot { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--text-3); font: 400 13px/1.4 var(--ui); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.g-foot a { display: inline-flex; align-items: center; gap: 2px; color: var(--text-2); text-decoration: none; font-weight: 600; }
.g-foot a:hover { color: var(--text); }

/* empty states */
.blank { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 36px 16px 28px; color: var(--text-2); }
.blank .bi, .signin-card .bi, .acct-signcard .bi { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-fg); margin-bottom: 6px; }
.blank strong { color: var(--text); font: 700 18px/1.3 var(--head); letter-spacing: -.015em; text-wrap: balance; }
.blank p { margin: 0; max-width: 360px; font-size: 14.5px; text-wrap: pretty; }
.blank .btn { margin-top: 10px; }
.blank.soon { padding-top: 28px; }
.soon-art { position: relative; width: 120px; height: 84px; margin-bottom: 8px; border-radius: 20px; overflow: hidden; background: linear-gradient(150deg, var(--c0), var(--c1)); }
.soon-art { width: 96px; height: 96px; border-radius: 26px; box-shadow: 0 12px 26px -14px var(--c1); }
.soon-art .art.svg { inset: auto 6% 6% auto; width: 80%; aspect-ratio: 1; }
.soon-emoji { width: 72px; height: 72px; margin-bottom: 8px; border-radius: 22px; display: grid; place-items: center; background: var(--fill); font: 38px/1 var(--emoji); }

/* the floating tab bar (phones): icons only; the current one sits in a soft highlight that slides */
.tabbar { position: fixed; z-index: 40; left: 50%; bottom: calc(12px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 4px; padding: 6px;
  border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--shadow-bar);
  -webkit-backdrop-filter: saturate(1.8) blur(22px); backdrop-filter: saturate(1.8) blur(22px); }
.tabbar .ind { position: absolute; top: 6px; left: 0; height: 48px; width: 64px; border-radius: 999px; background: var(--accent-soft); opacity: 0;
  transition: transform .42s var(--spring), width .3s var(--ease), opacity .2s; pointer-events: none; }
.tabbar .ind.on { opacity: 1; }
.tab { position: relative; z-index: 1; width: 64px; height: 48px; border-radius: 999px; display: grid; place-items: center; color: var(--text-2); transition: color .2s; }
.tab:hover { color: var(--text); }
.tab[aria-current="page"] { color: var(--accent-fg); }
.tab svg, .tab .tav { transition: transform .2s var(--ease); }
.tab:active svg, .tab:active .tav { transform: scale(.86); }
.tav { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; }
.tav.in { box-shadow: 0 0 0 1.5px var(--line-3); }
.tav img { width: 100%; height: 100%; object-fit: cover; }
.tav .acct-ini { font-size: 12px; }
.gallery.typing .tabbar { opacity: 0; pointer-events: none; transform: translate(-50%, 20px); }
.tabbar { transition: opacity .2s, transform .25s var(--ease); }

/* search */
.v-search { padding-top: 2px; min-height: 60vh; }
.s-chips { gap: 8px; padding-top: 4px; padding-bottom: 14px; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px 0 11px; border-radius: 999px; background: var(--fill);
  color: var(--text); font: 500 14px/1 var(--ui); white-space: nowrap; transition: background .15s, color .15s, opacity .15s; }
.chip svg { color: var(--text-2); flex: none; }
.chip .n { color: var(--text-3); font-variant-numeric: tabular-nums; }
.chip:hover:not(:disabled) { background: var(--fill-2); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.chip[aria-pressed="true"] svg, .chip[aria-pressed="true"] .n { color: inherit; opacity: .7; }
.chip:disabled { opacity: .4; cursor: default; }
.chip-sep { flex: none; width: 1px; margin: 8px 2px; background: var(--line-2); }
.sugg { display: flex; flex-wrap: wrap; gap: 8px; }
.sugg .chip { padding: 0 14px; }
.s-sec { margin: 4px 0 24px; }
.s-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.s-h h2 { margin: 0; font: 700 16px/1.2 var(--head); letter-spacing: -.015em; }
.recents { border-radius: 16px; background: var(--card); border: 1px solid var(--line); overflow: hidden; max-width: 640px; }
.recent { display: flex; align-items: center; border-top: 1px solid var(--line); }
.recent:first-child { border-top: 0; }
.recent .q { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 6px 0 14px; text-align: left; font-size: 15px; color: var(--text); }
.recent .q svg { flex: none; color: var(--text-3); }
.recent .q span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .x { flex: none; width: 44px; height: 44px; margin-right: 3px; display: grid; place-items: center; border-radius: 10px; color: var(--text-3); }
.recent .x:hover, .recent .q:hover svg { color: var(--text); }
.s-count { margin: 0 0 12px; font: 500 14px/1 var(--ui); color: var(--text-3); font-variant-numeric: tabular-nums; }
.srows, .rows { display: grid; gap: 10px; }
.srow, .lrow { display: flex; align-items: stretch; gap: 12px; min-width: 0; padding: 10px; border-radius: 18px; background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow-1); text-align: left; color: var(--text); animation: rise .35s var(--ease) both; }
.srow { align-items: center; transition: border-color .15s, background .15s; }
.srow:hover { border-color: var(--line-2); }
.srow .th, .lrow .th { flex: none; width: 54px; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; background: var(--fill); display: grid; place-items: center; color: var(--text-3); }
.lrow .th { width: 62px; align-self: flex-start; }
.srow .th img, .lrow .th img { width: 100%; height: 100%; object-fit: cover; }
.srow .bd, .lrow .bd { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.srow .tt, .lrow .tt { font: 600 15px/1.25 var(--ui); letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.srow .sub, .lrow .sub { display: flex; align-items: center; gap: 4px; min-width: 0; font: 400 13px/1.3 var(--ui); color: var(--text-2); font-variant-numeric: tabular-nums; }
.srow .sub svg { flex: none; color: var(--text-3); }
.srow .sub > span:first-child { flex: none; white-space: nowrap; }
.srow .why { font: 600 12.5px/1.2 var(--ui); color: var(--accent-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow .chev { flex: none; color: var(--text-3); }
.lrow .tiny { font: 500 13px/1.2 var(--ui); color: var(--text-3); font-variant-numeric: tabular-nums; }
.lrow .acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.lrow .acts .icon-btn, .lrow .acts .heart { margin-left: auto; }
.lrow .heart { background: var(--fill); color: var(--text-2); }
.lrow .heart[aria-pressed="true"] { background: color-mix(in srgb, var(--heart) 14%, transparent); color: var(--heart); }
.lrow .tags { display: flex; flex-wrap: wrap; gap: 6px 10px; font: 500 12px/1.2 var(--ui); color: var(--text-3); }
.lrow .tags:empty { display: none; }
.lrow .tags span { display: inline-flex; align-items: center; gap: 4px; }
.lrow .tags .again { color: var(--accent-fg); }
.ph { display: grid; place-items: center; width: 100%; height: 100%; color: var(--text-3); }

/* My Templates: underline tabs (icon, name, count) with a sliding yellow indicator, sticky; the plan as a slim card */
.mine-h { margin: 26px 0 8px; }
.mine-h h1 { margin: 0; font: 800 34px/1.1 var(--head); letter-spacing: -.03em; }
.mtabs-bar { position: sticky; top: var(--mt-top, var(--safe-t)); z-index: 25; margin: 0 calc(-1 * max(16px, var(--safe-r))) 14px calc(-1 * max(16px, var(--safe-l)));
  background: var(--bg); background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  box-shadow: inset 0 -1px 0 var(--line); }
.mtabs-scroll { position: relative; overflow-x: auto; scrollbar-width: none; padding: 0 max(6px, var(--safe-l)); }
.mtabs-scroll::-webkit-scrollbar { display: none; }
.mtabs { display: flex; min-width: max-content; }
.mtab { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 50px; padding: 0 7px; color: var(--text-2);
  font: 600 13.5px/1 var(--ui); white-space: nowrap; transition: color .2s; }
.mtab svg { flex: none; transition: color .2s, transform .2s var(--ease); }
.mtab .n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--fill); color: var(--text-2); font: 600 11.5px/20px var(--ui);
  text-align: center; font-variant-numeric: tabular-nums; transition: background .2s, color .2s; }
.mtab:hover { color: var(--text); }
.mtab:active svg { transform: scale(.9); }
.mtab[aria-selected="true"] { color: var(--text); }
.mtab[aria-selected="true"] svg { color: var(--text); }
.mtab[aria-selected="true"] .n { background: var(--brand); color: var(--brand-ink); }
.mtab:focus-visible { outline-offset: -4px; border-radius: 10px; }
.mt-ind { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; border-radius: 3px 3px 0 0; background: var(--brand-line); pointer-events: none;
  transition: transform .38s var(--spring), width .3s var(--ease); }
.planline { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin: -2px 0 14px; padding: 9px 14px; border-radius: 12px;
  background: var(--fill); font: 500 13.5px/1.3 var(--ui); }
.planline svg { color: var(--accent-fg); flex: none; }
.planline b { font-weight: 600; }
.planline span { color: var(--text-2); font-variant-numeric: tabular-nums; }
.mpanel { touch-action: pan-y; }                /* a sideways swipe changes the tab (gallery.js) */
.mpanel.from-r { animation: fromR .28s var(--ease); }
.mpanel.from-l { animation: fromL .28s var(--ease); }
@keyframes fromR { from { opacity: 0; transform: translateX(26px); } }
@keyframes fromL { from { opacity: 0; transform: translateX(-26px); } }
.signin-card { display: grid; justify-items: start; gap: 8px; max-width: 520px; padding: 20px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.signin-card .bi { margin-bottom: 4px; }
.signin-card strong { font: 700 18px/1.3 var(--head); letter-spacing: -.015em; }
.signin-card p { margin: 0 0 8px; color: var(--text-2); font-size: 14.5px; }
.fine { margin: 16px 2px 0; font: 400 13px/1.45 var(--ui); color: var(--text-3); }

/* the sidebar (desktop) */
.g-side { display: none; }
.side-brand { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; padding: 6px 8px; border-radius: 12px; color: var(--text); text-align: left; }
.side-brand .brand-name { display: block; font: 500 13px/1.15 var(--ui); color: var(--text-2); }
.side-brand .brand-name b { display: block; color: var(--text); font: 700 15px/1.15 var(--head); letter-spacing: -.01em; }
.side-nav { display: grid; gap: 4px; }
.side-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 48px; padding: 0 14px; border-radius: 14px; color: var(--text-2);
  font: 600 15px/1.2 var(--ui); text-align: left; text-decoration: none; transition: background .15s, color .15s; }
.side-item > span:not(.tav):not(.sw) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item:hover { background: var(--fill); color: var(--text); }
.side-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent-fg); }
.side-item svg { flex: none; }
.side-item .tav { width: 24px; height: 24px; flex: none; }
.side-foot { margin-top: auto; display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.side-link { font-size: 14px; }
.theme-row .sw { position: relative; flex: none; margin-left: auto; width: 38px; height: 22px; border-radius: 999px; background: var(--surface-3); transition: background .2s; }
.theme-row .sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s var(--ease); }
.theme-row[aria-checked="true"] .sw { background: var(--accent); }
.theme-row[aria-checked="true"] .sw::after { background: var(--accent-ink); }
.theme-row[aria-checked="true"] .sw::after { transform: translateX(16px); }
.gallery { --maxw: 1312px; }
@media (min-width: 600px) {
  .agrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 28px 16px; }
  .srows, .rows { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .rcard { width: 120px; }
}
@media (min-width: 1024px) {
  .gallery { --side: 236px; --mt-top: calc(72px + var(--safe-t)); }
  .g-side { position: fixed; z-index: 45; top: 0; bottom: 0; left: 0; width: var(--side); display: flex; flex-direction: column;
    padding: calc(18px + var(--safe-t)) 14px 16px; border-right: 1px solid var(--line); background: var(--bg); overflow-y: auto; }
  .g-main { margin-left: var(--side); }
  .wrap { max-width: var(--maxw); }
  .g-titlebar, .tabbar { display: none; }
  .gallery[data-tab="search"] { padding-top: 0; }
  .g-top { top: 0; padding-top: var(--safe-t); }
  .gallery[data-tab="mine"] .g-top, .gallery[data-tab="cat"] .g-top { display: block; }
  .g-bar { height: 72px; gap: 16px; }
  .g-search { max-width: 560px; }
  .g-search input { height: 46px; }
  .g-cancel { display: none !important; }
  .g-pagehead { display: block; margin: 22px 0 26px; }
  .g-pagehead h1 { margin: 0; font: 800 42px/1.05 var(--head); letter-spacing: -.035em; }
  .g-pagehead p { margin: 8px 0 0; color: var(--text-2); font-size: 15.5px; }
  .site-banner { margin: 0 0 18px; }
  .mine-h { display: block; }
  .g-views { padding-bottom: 72px; }
  .agrid { grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 10px; }
  .acard { height: 64px; }
  .g-all, .g-drafts, .g-recent { margin-top: 44px; }
  .g-tpl { margin-top: 48px; }
  .sec-h h2, .g-head h2 { font-size: 21px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 32px 18px; }
  .badges { flex-wrap: wrap; overflow: visible; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  .s-chips { flex-wrap: wrap; overflow: visible; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; padding-top: 22px; }
  .rcard { width: 132px; }
  .mtabs-scroll { padding: 0; }
  .mtabs-bar { margin-left: 0; margin-right: 0; background: var(--bg); }
  .mtabs { min-width: 0; }
  .mtab { flex: 0 0 auto; padding: 0 16px; }
  .gallery[data-tab="cat"] { padding-top: 0; }
  .c-bar { display: none; }
  .c-hero { margin: 26px 0 22px; }
  .c-hero-in { min-height: 230px; padding: 30px 34px; border-radius: 30px; }
  .c-hero-in.top { padding-right: 50%; }
  .c-hero-in.top .art.hero { right: 0; }
  .c-hero-in.emo { min-height: 0; padding: 28px 32px; }
  .c-emoji { width: 96px; height: 96px; border-radius: 28px; font-size: 52px; }
  .c-txt h1 { font-size: 42px; }
  .c-txt p { font-size: 15px; }
  .c-hero-back { position: absolute; z-index: 2; top: 20px; left: 26px; display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px 0 8px; border-radius: 999px;
    background: rgba(255, 255, 255, .2); color: inherit; font: 600 13.5px/1 var(--ui); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
  .c-hero-back:hover { background: rgba(255, 255, 255, .3); }
  .c-hero-in.emo .c-hero-back { background: var(--fill-2); }
  .c-hero-in.top .c-txt, .c-hero-in.emo .c-txt { padding-top: 44px; }
  .c-hero-in.emo .c-emoji { margin-top: 44px; }
  .c-subs { margin-bottom: 26px; }
}
@media (min-width: 1180px) { .srows { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ================================ PREVIEW (preview.js) ================================ */
.pvw { display: grid; gap: 16px; }
.pv-player { position: relative; justify-self: center; height: min(56vh, 540px); aspect-ratio: 9 / 16; max-width: 100%; border-radius: 20px; overflow: hidden; background: #000;
  box-shadow: 0 0 0 1px var(--line); }
.pv-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pv-tap { position: absolute; inset: 0; z-index: 1; cursor: pointer; }
.pv-big { position: absolute; z-index: 2; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff; pointer-events: none; opacity: 0; transform: scale(.88);
  transition: opacity .2s, transform .2s var(--ease); }
.pv-player.paused .pv-big { opacity: 1; transform: none; }
.pv-tag { position: absolute; z-index: 2; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px 0 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; font: 500 12px/1 var(--ui); pointer-events: none; }
.pv-snd { position: absolute; z-index: 3; right: 10px; bottom: 14px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; }
.pv-prog { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .25); pointer-events: none; }
.pv-prog i { display: block; height: 100%; background: #fff; transform-origin: 0 50%; transform: scaleX(0); }
.pv-info { display: grid; gap: 14px; align-content: start; min-width: 0; }
.pv-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.pv-cat { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px 0 9px; border-radius: 999px; background: var(--fill); color: var(--text);
  font: 500 13px/1 var(--ui); transition: background .15s; }
.pv-cat:hover { background: var(--fill-2); }
.pv-cat .be { font: 14px/1 var(--emoji); }
.pv-cat .dot { width: 10px; height: 10px; border-radius: 3px; background: linear-gradient(150deg, var(--c0, var(--accent)), var(--c1, var(--accent))); }
.pv-title { display: flex; align-items: flex-start; gap: 12px; }
.pv-title h2 { flex: 1; min-width: 0; margin: 0; font: 800 24px/1.15 var(--head); letter-spacing: -.025em; text-wrap: balance; }
.heart.lg { width: 44px; height: 44px; flex: none; background: var(--fill); color: var(--text); -webkit-backdrop-filter: none; backdrop-filter: none; }
.heart.lg[aria-pressed="true"] { background: color-mix(in srgb, var(--heart) 14%, transparent); color: var(--heart); }
/* Preview's heart: a small bump (1 → 1.2 → 1, 180 ms) instead of a toast; none under reduced motion (the rule at the end) */
.heart.lg.bump { animation: bump .18s ease-out; }
@keyframes bump { 50% { transform: scale(1.2); } }
.pv-more { display: grid; gap: 12px; }
.pv-more .sk { height: 64px; border-radius: 14px; background: var(--fill); }
.pv-close { position: absolute; z-index: 5; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--text); }
.pv-close:hover { background: var(--fill-2); }
.pv-sheet .modal-panel, .modal-panel.pv-sheet { position: relative; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; }
.fact { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 10px; background: var(--fill); font: 500 14px/1 var(--ui); font-variant-numeric: tabular-nums; }
.fact svg { color: var(--text-2); }
.fact.prem { background: var(--accent-soft); color: var(--accent-fg); font-weight: 600; }
.fact.prem b { color: var(--text); font-weight: 700; }
.fact.own { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); font-weight: 600; }
.fact.own svg { color: inherit; }
.fact.free { color: var(--text-2); }
.fact.qrf { background: color-mix(in srgb, var(--brand) 22%, transparent); color: var(--text); font-weight: 600; }
.songline { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--fill); font-size: 14px; }
.songline svg { flex: none; color: var(--accent-fg); margin-top: 2px; }
.songline b { font-weight: 600; }
.only { border-radius: var(--r); padding: 12px 14px; background: var(--accent-soft); }
.only-h { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font: 600 13.5px/1.2 var(--ui); color: var(--accent-fg); }
.only ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.only li { font: 500 13px/1.2 var(--ui); padding: 5px 9px; border-radius: 7px; background: var(--card); color: var(--text); }
.only p { margin: 8px 0 0; font-size: 13px; color: var(--text-2); }
/* Clips you need (as on the website's template page) */
.clips { display: grid; gap: 10px; }
.clips-h { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; font: 700 16px/1.2 var(--head); letter-spacing: -.015em; }
.clips-h .cnt { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 700 12px/22px var(--ui); text-align: center; }
.clips-sum { margin: -4px 0 0; font: 400 13.5px/1.4 var(--ui); color: var(--text-2); font-variant-numeric: tabular-nums; }
.tl { display: flex; gap: 2px; height: 10px; border-radius: 999px; overflow: hidden; }
.tl i { display: block; min-width: 2px; background: var(--text); opacity: .28; }
.tl i:nth-child(even) { opacity: .42; }
.tl i.old { background: #f59e0b; opacity: .9; }
.cslots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cslot { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.cs-media { position: relative; flex: none; width: 50px; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; background: var(--fill); }
.cs-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-media .sn { position: absolute; top: 4px; left: 4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: rgba(0, 0, 0, .72); color: #fff; font: 800 10.5px/18px var(--ui); text-align: center; }
.cs-media .sd { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 0 3px; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); color: #fff; font: 700 10.5px/1 var(--ui); text-align: center; font-variant-numeric: tabular-nums; }
.cs-t { min-width: 0; display: grid; gap: 4px; }
.cs-t b { font: 600 13px/1.3 var(--ui); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cs-t small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font: 400 11.5px/1.3 var(--ui); color: var(--text-3); font-variant-numeric: tabular-nums; }
.st { height: 18px; padding: 0 6px; border-radius: 6px; background: var(--fill-2); color: var(--text-2); font: 600 10.5px/18px var(--ui); }
.st.old { background: rgba(245, 158, 11, .18); color: #b45309; }
:root[data-theme="dark"] .st.old { color: #fbbf24; }
.cslots-more summary { cursor: pointer; padding: 8px 0 4px; font: 600 13.5px/1.2 var(--ui); color: var(--accent-fg); list-style: none; }
.cslots-more summary::-webkit-details-marker { display: none; }
.cslots-more .cslots { margin-top: 8px; }
.film-list { border-radius: var(--r); background: var(--fill); padding: 0 14px; }
.film-list summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 46px; cursor: pointer; list-style: none; font: 600 14px/1 var(--ui); }
.film-list summary::-webkit-details-marker { display: none; }
.film-list summary svg { color: var(--text-2); transition: transform .2s var(--ease); }
.film-list[open] summary svg { transform: rotate(180deg); }
.film-list ol { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 5px; font-size: 13.5px; color: var(--text-2); }
.film-list .tc { color: var(--text); margin-right: 6px; }
@media (min-width: 900px) {
  .pvw { grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: start; }
  .pv-player { height: min(68vh, 600px); }
  .pv-info { padding-right: 40px; }
}

/* ================================ FREE WITH ALPHA (qrfree.js) — the website's .qrfree: hot pink → orange ================================ */
.qrfree { display: inline-flex; align-items: stretch; white-space: nowrap; font: 700 11px/1 var(--ui); }
.qrfree .pp { display: inline-flex; align-items: center; padding: 6px 8px; background: #ffd60a; color: #111214; font-weight: 800; font-variant-numeric: tabular-nums; }
.qrfree .pf { position: relative; overflow: hidden; display: inline-flex; align-items: center; padding: 6px 10px 6px 8px; color: #fff;
  background: linear-gradient(120deg, #fb7185 0%, #f43f5e 45%, #f97316 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38); }
.qrfree .pf b { font-weight: 900; letter-spacing: .06em; text-shadow: 0 1px 0 rgba(190, 18, 60, .55); }
.qrfree .pf i { font-style: normal; font-weight: 600; opacity: .92; margin-left: .32em; }
.qrfree .pf svg { width: 1em; height: 1em; margin-right: .3em; fill: #fef08a; flex: none; }
.qrfree .pf::after { content: ""; position: absolute; inset: 0; transform: translateX(-120%); pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .5) 50%, transparent 70%); animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
/* on a thumbnail: bottom-left, one pill */
.qrfree.oncard { border-radius: 8px; overflow: hidden; max-width: calc(100% - 16px); box-shadow: 0 4px 14px rgba(244, 63, 94, .4); }
.tcard .qrfree.oncard.pb { top: auto; bottom: 8px; left: 8px; font-size: 10px; }
.tcard .qrfree.oncard .pp { padding: 5px 6px; }
.tcard .qrfree.oncard .pf { padding: 5px 7px 5px 6px; }
.tcard .qrfree.oncard .pf i { margin-left: .28em; }
.tcard .media:has(.qrfree.oncard) .dur { bottom: auto; top: 8px; right: auto; left: 8px; }
.tcard .media:has(.qrfree.oncard) .afx { display: none; }
/* in a list row */
.qrfree.sm { align-self: flex-start; border-radius: 7px; overflow: hidden; font-size: 10.5px; }
.qrfree.sm .pp, .qrfree.sm .pf { padding: 4px 7px; }
/* a price line (Preview, the export popup): the price muted, then a large pill */
.qrfree.big { align-items: center; gap: 10px; font-size: 14px; }
.qrfree.big .pp { padding: 0; background: none; color: var(--text-3); font-size: 15px; }
.qrfree.big .pf { padding: 8px 16px 9px 12px; border-radius: 999px; font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -2px 0 rgba(0, 0, 0, .12), 0 8px 22px rgba(244, 63, 94, .35); }
.facts .qrfree.big { height: 34px; }
@media (prefers-reduced-motion: reduce) { .qrfree .pf::after { animation: none; display: none; } }

/* the free-with-QR export popup (premium.js qrSheet) */
.x-name { margin: -4px 0 14px; font: 600 14px/1.3 var(--ui); color: var(--text-2); }
.xopts { display: grid; gap: 12px; }
.xopt { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border-radius: 20px; background: var(--card); border: 1.5px solid var(--line-2);
  color: var(--text); text-align: left; transition: transform .12s var(--ease), border-color .15s, box-shadow .2s; }
.xopt:hover { border-color: var(--line-3); box-shadow: var(--shadow-1); }
.xopt:active { transform: scale(.985); }
.xopt:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.xopt > svg { flex: none; color: var(--text-2); }
.xt { flex: 1; min-width: 0; display: grid; gap: 6px; justify-items: start; }
.xt b { font: 700 17px/1.2 var(--head); letter-spacing: -.015em; }
.xt span:not(.qrfree):not(.pf):not(.pp) { font: 400 13.5px/1.4 var(--ui); color: var(--text-2); }
.xopt.free { border-color: rgba(244, 63, 94, .5); background: linear-gradient(160deg, rgba(244, 63, 94, .09), rgba(249, 115, 22, .03) 70%), var(--card); }
.xopt.buy { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 10px 26px -14px rgba(242, 194, 0, .9); }
.xopt.buy .xt span { color: rgba(17, 18, 20, .72) !important; }
.xopt.buy > svg { color: var(--brand-ink); }
.xopt.plan > svg { color: var(--accent-fg); }
.xopt.busy { opacity: .6; pointer-events: none; }
/* the sample: a mini phone with the template's cover, the QR popping in at 0:03, then the end card */
.xsample { position: relative; flex: none; width: 90px; height: 160px; border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 0 0 3px #111, 0 10px 24px -10px rgba(0, 0, 0, .55); }
.xsample img { position: absolute; display: block; }
.xsample .cv { inset: 0; width: 100%; height: 100%; object-fit: cover; }
.xsample .qt { left: 6%; top: 36%; width: 40%; transform: translateY(-50%) scale(.6); opacity: 0; transform-origin: 50% 50%; animation: xqr 4.6s var(--ease) infinite; }
.xsample .dim { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; animation: xend 4.6s linear infinite; }
.xsample .ec { left: 10%; top: 47%; width: 80%; transform: translateY(-50%); opacity: 0; animation: xend 4.6s linear infinite; }
@keyframes xqr { 0%, 17% { opacity: 0; transform: translateY(-50%) scale(.6); } 22% { opacity: 1; transform: translateY(-50%) scale(1); } 50% { opacity: 1; transform: translateY(-50%) scale(1); } 56%, 100% { opacity: 0; transform: translateY(-50%) scale(1); } }
@keyframes xend { 0%, 60% { opacity: 0; } 65%, 87% { opacity: 1; } 94%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .xsample .qt { animation: none; opacity: 1; transform: translateY(-50%); } .xsample .dim, .xsample .ec { animation: none; } }
@media (min-width: 900px) { .xsheet-panel.modal-panel { width: min(600px, calc(100% - 48px)); } }

/* ================================ USE TEMPLATE (usesheet.js) ================================ */
.use { display: grid; gap: 14px; }
.u-head { display: flex; align-items: center; gap: 14px; }
.u-th { flex: none; width: 54px; aspect-ratio: 9 / 16; border-radius: 11px; overflow: hidden; background: var(--fill); box-shadow: 0 0 0 1px var(--line); }
.u-th img { width: 100%; height: 100%; object-fit: cover; }
.u-tt { display: grid; gap: 7px; min-width: 0; }
.u-tt b { font: 700 18px/1.25 var(--head); letter-spacing: -.02em; text-wrap: balance; }
.u-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font: 400 13.5px/1.2 var(--ui); color: var(--text-2); font-variant-numeric: tabular-nums; }
.u-tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 7px; background: var(--fill); color: var(--text-2); font: 600 12px/1 var(--ui); }
.u-tag.prem { background: var(--accent-soft); color: var(--accent-fg); }
.u-tag.prem b { margin-left: 3px; color: var(--text); font-weight: 700; }
.u-tag.own { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.u-tag.qrf { background: var(--brand); color: var(--brand-ink); }
.u-lead { margin: 6px 0 0; font: 600 13.5px/1.2 var(--ui); color: var(--text-2); }
.uopts { display: grid; gap: 12px; }
.uopt { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 14px; padding: 14px; border-radius: 20px;
  background: var(--card); border: 1.5px solid var(--line-2); color: var(--text); text-align: left; text-decoration: none;
  transition: transform .12s var(--ease), border-color .15s, background .15s, box-shadow .2s; }
a.uopt:hover, button.uopt:hover { border-color: var(--line-3); box-shadow: var(--shadow-1); }
a.uopt:active, button.uopt:active { transform: scale(.98); }
.uopt:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.u-ic { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; background: var(--fill); color: var(--text); }
.u-ic:has(.u-app) { background: none !important; }
.u-app { display: block; width: 44px; height: 44px; border-radius: 12px; }
:root[data-theme="light"] .u-app.vnic { box-shadow: 0 0 0 1px rgba(16, 19, 26, .14); }
.uopt.off .u-app { opacity: .7; }
.u-txt { display: grid; gap: 4px; min-width: 0; }
.u-t { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.u-t b { font: 700 16px/1.2 var(--head); letter-spacing: -.015em; }
.u-t small { font: 500 12.5px/1.2 var(--ui); color: var(--text-3); }
.u-b { font: 400 13.5px/1.4 var(--ui); color: var(--text-2); }
.u-chev { display: grid; place-items: center; color: var(--text-3); transition: transform .2s var(--ease); }
.u-chev { align-self: start; margin-top: 16px; }                         /* level with the icon's middle, on every card */
.uopt:not(:has(.u-cant)) .u-txt { align-self: center; }
a.uopt:hover .u-chev, button.uopt:hover .u-chev { transform: translateX(3px); color: var(--text); }
/* Edit here: the primary card, in the brand yellow */
.uopt.main { background: linear-gradient(160deg, rgba(255, 214, 10, .2), rgba(255, 214, 10, .05) 70%), var(--card); border-color: var(--brand-line);
  box-shadow: 0 10px 26px -16px rgba(242, 194, 0, .85); }
.uopt.main .u-ic { background: var(--brand); color: var(--brand-ink); }
.uopt.main .u-chev { color: var(--text); }
/* the Studio's checkout (checkout.js): what it gets, the total with the gateway charge, Pay */
.co { display: grid; gap: 14px; }
.co-head { display: flex; align-items: center; gap: 12px; }
.co-th { flex: none; width: 46px; aspect-ratio: 9 / 16; border-radius: 9px; overflow: hidden; background: var(--fill); box-shadow: 0 0 0 1px var(--line); }
.co-th img { width: 100%; height: 100%; object-fit: cover; }
.co-tt { display: grid; gap: 3px; min-width: 0; }
.co-tt b { font: 700 17px/1.25 var(--head); letter-spacing: -.02em; }
.co-tt span { font: 500 12.5px/1.2 var(--ui); color: var(--text-2); }
.co-get { display: grid; gap: 8px; margin: 0; padding: 12px 14px; list-style: none; border-radius: 14px; background: var(--fill); }
.co-get li { display: flex; align-items: flex-start; gap: 9px; font: 500 13.5px/1.4 var(--ui); }
.co-get svg { flex: none; margin-top: 2px; color: var(--ok); stroke-width: 2.6; }
.co-rows { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; margin: 0; font: 400 14px/1.3 var(--ui); font-variant-numeric: tabular-nums; }
.co-rows dt { color: var(--text-2); }
.co-rows dd { margin: 0; text-align: right; }
.co-rows .tot { padding-top: 9px; border-top: 1px solid var(--line); color: var(--text); font: 700 16px/1.3 var(--head); }
.co-msg { margin: 0; font: 500 13px/1.4 var(--ui); color: var(--text-2); }
.co-msg.err { color: var(--danger); }
.co-fine { display: flex; align-items: center; gap: 6px; margin: 0; font: 400 12px/1.4 var(--ui); color: var(--text-3); }
.co-fine svg { flex: none; }
.co-pay.busy { opacity: .7; pointer-events: none; }
/* "It's yours" (checkout.js showOwned): the payment confirmed, the file, the purchase QR, where it lives now */
.own { display: grid; gap: 14px; }
.own-done { display: flex; align-items: flex-start; gap: 9px; margin: 0; font: 400 14.5px/1.4 var(--ui); }
.own-done svg { flex: none; margin-top: 2px; color: var(--ok); stroke-width: 2.6; }
.own-dl { display: flex; align-items: center; gap: 8px; margin: 0; font: 500 13.5px/1.35 var(--ui); color: var(--text-2); }
.own-dl b { color: var(--text); overflow-wrap: anywhere; }
.own-dl svg { flex: none; }
.own-row { display: flex; align-items: flex-start; gap: 14px; }
.own-qr { flex: none; width: 132px; height: 132px; border-radius: 12px; background: #fff; padding: 6px; box-shadow: 0 0 0 1px var(--line-2); image-rendering: pixelated; }
.own-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font: 400 13.5px/1.45 var(--ui); color: var(--text-2); }
.own-steps b { color: var(--text); font-weight: 600; }
.own-where { display: flex; align-items: center; gap: 9px; margin: 0; padding: 11px 13px; border-radius: 13px; background: var(--accent-soft); font: 400 13.5px/1.35 var(--ui); }
.own-where svg { flex: none; color: var(--accent-fg); }
.own-sheet .modal-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
@media (max-width: 420px) { .own-row { flex-direction: column; align-items: center; } }
.uopt.vn.buy .u-b { color: var(--text); font-weight: 600; }
.lrow .acts.own-acts { gap: 6px; }
.lrow .own-acts .btn.xs { padding: 0 10px; gap: 5px; }
.keep-card { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 12px; border-radius: 14px; background: var(--accent-soft); font: 400 13.5px/1.35 var(--ui); }
.keep-card > span { flex: 1; min-width: 0; }
.keep-card > svg { flex: none; color: var(--accent-fg); }

/* the VN project downloaded (vnget.js): what came down, how to open it, a button per file */
.uopt.vn[aria-busy="true"] { opacity: .7; pointer-events: none; }
.vng { display: grid; gap: 14px; }
.vng-done { display: flex; align-items: center; gap: 8px; margin: 0; font: 500 15px/1.35 var(--ui); }
.vng-done svg { flex: none; color: var(--ok); }
.vng-done b { font-weight: 700; overflow-wrap: anywhere; }
.vng-row { display: flex; align-items: flex-start; gap: 14px; }
.vng-qr { flex: none; width: 112px; height: 112px; border-radius: 12px; background: #fff; padding: 4px; box-shadow: 0 0 0 1px var(--line-2); image-rendering: pixelated; }
.vng-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font: 400 13.5px/1.45 var(--ui); color: var(--text-2); }
.vng-steps b { color: var(--text); font-weight: 600; }
.vng-note { margin: 0; font: 400 12.5px/1.4 var(--ui); color: var(--text-3); }
.vng-sheet .modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .vng-row { flex-direction: column; align-items: center; } .vng-sheet .modal-actions { grid-template-columns: 1fr; } }
.u-chip { justify-self: start; display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font: 600 11.5px/1 var(--ui); white-space: nowrap; }
.u-chip.best { position: absolute; top: -10px; right: 16px; background: var(--brand); color: var(--brand-ink); box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .3); }
.u-chip.soon { background: var(--fill-2); color: var(--text-2); margin-top: 2px; }
.u-chip.warn { background: var(--warn-bg); color: var(--warn-fg); }
.u-chip.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
/* the VN app: muted, with what VN can't do */
.uopt.vn { background: var(--bg-1); border-style: dashed; }
.uopt.vn .u-ic { background: var(--fill-2); color: var(--text-2); }
.uopt.vn .u-t b { color: var(--text-2); }
.uopt.off { cursor: default; }
.uopt.off .u-ic { opacity: .6; }
.u-cant { display: grid; gap: 8px; margin-top: 6px; }
.u-cant ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 5px; }
.u-cant li { font: 500 12px/1 var(--ui); padding: 5px 8px; border-radius: 7px; background: var(--fill); color: var(--text-2); }
.u-cant li.more { background: none; color: var(--text-3); }
@media (min-width: 900px) {
  .use-sheet.modal-panel { width: min(960px, calc(100% - 48px)); }
  .uopts { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .uopt { grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; align-content: start; align-items: start; gap: 16px; padding: 20px; border-radius: 22px; }
  .uopt .u-ic { grid-column: 1; grid-row: 1; width: 54px; height: 54px; }
  .uopt .u-chev { grid-column: 2; grid-row: 1; align-self: center; margin-top: 0; }
  .uopt .u-txt { grid-column: 1 / -1; grid-row: 2; align-self: start; }
  .u-t b { font-size: 17px; }
}

/* ================================ LOADING SCREEN (loader.js) ================================ */
.loader { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; overflow: hidden; padding: calc(24px + var(--safe-t)) 24px calc(24px + var(--safe-b));
  background: var(--bg); color: var(--text); opacity: 0; transition: opacity .22s var(--ease); }
.loader.in { opacity: 1; }
.loader.out { opacity: 0; pointer-events: none; }
html.ld-open, html.ld-open body { overflow: hidden; }
.ld-bg { position: absolute; inset: -14%; background: center / cover no-repeat; filter: blur(60px) saturate(1.5); opacity: .4; transform: scale(1.15); pointer-events: none; }
:root[data-theme="light"] .ld-bg { opacity: .26; }
.loader.tinted::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 45% at 50% 40%, color-mix(in srgb, var(--c0) 22%, transparent), transparent 70%); }
.ld-col { position: relative; display: grid; justify-items: center; gap: 18px; width: min(340px, 100%); text-align: center; }
.ld-logo { animation: rise .5s var(--ease) both; }
.ld-th { position: relative; height: min(36vh, 340px); aspect-ratio: 9 / 16; border-radius: 22px; overflow: hidden; background: var(--fill);
  box-shadow: 0 0 0 1px var(--line), 0 30px 60px -22px rgba(0, 0, 0, .55); animation: rise .5s .05s var(--ease) both; }
.ld-th img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ld-scan { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, .28) 50%, transparent 65%) 0 0 / 250% 100%;
  animation: shimmer 1.8s infinite linear; }
.ld-err-i { position: absolute; inset: 0; display: none; place-items: center; color: var(--danger); }
.loader.err .ld-th img { filter: grayscale(1); opacity: .35; }
.loader.err .ld-scan { display: none; }
.loader.err .ld-err-i { display: grid; }
.ld-txt { display: grid; gap: 6px; }
.ld-title { margin: 0; font: 800 22px/1.2 var(--head); letter-spacing: -.025em; text-wrap: balance; }
.ld-tag { margin: -2px 0 2px; font: 500 13px/1.35 var(--ui); color: var(--text-3); }
.loader.err .ld-tag { display: none; }
.ld-step { margin: 0; min-height: 20px; font: 400 14px/1.45 var(--ui); color: var(--text-2); font-variant-numeric: tabular-nums; text-wrap: balance; }
.ld-prog { display: flex; align-items: center; gap: 12px; width: min(280px, 100%); }
.ld-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--fill-2); overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--accent-strong); transition: width .35s var(--ease); }
.ld-pct { min-width: 40px; text-align: right; font: 600 13px/1 var(--ui); color: var(--text-2); font-variant-numeric: tabular-nums; }
.loader.err .ld-prog { display: none; }
.ld-acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; min-height: 44px; }
.ld-cancel { color: var(--text-2); }

/* ---- modal ---- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: transparent; transition: background .25s; }
.modal.open { background: var(--scrim); }
/* a sheet is a column: the grabber and head stay, ONLY the body scrolls, the actions sit below it — so nothing in the
   body is ever drawn under the actions (11 Oct 2026: the export sheet's chips showed through its footer) */
.modal-panel { position: relative; width: 100%; max-height: calc(100% - 24px - var(--safe-t)); display: flex; flex-direction: column; overflow: hidden; background: var(--sheet);
  border-radius: var(--r-xl) var(--r-xl) 0 0; border: 1px solid var(--line); border-bottom: 0; padding: 6px 18px calc(18px + var(--safe-b));
  transform: translateY(105%); transition: transform .3s var(--ease); outline: none; box-shadow: 0 -20px 60px rgba(0, 0, 0, .3); }
.modal.open .modal-panel { transform: none; }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line-3); margin: 6px auto 8px; touch-action: none; cursor: grab; }
.grabber::before { content: ""; display: block; height: 28px; margin-top: -12px; }
.modal-head { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; }
.modal-title { flex: 1; margin: 0; font: 700 19px/1.25 var(--head); letter-spacing: -.02em; }
.modal-panel > .grabber, .modal-panel > .modal-head { flex: none; }
.modal-body { flex: 0 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; margin: 0 -18px; padding: 0 18px; }
.modal-actions { flex: none; display: flex; gap: 10px; margin: 0 -18px; padding: 16px 18px 2px; position: relative; z-index: 2; background: var(--sheet); }
.modal-panel.scrolls .modal-actions { box-shadow: 0 -1px 0 var(--line); padding-top: 12px; margin-top: 4px; }
.modal-actions .btn { flex: 1; }
.modal-panel.confirm p { margin: 0; }
@media (min-width: 900px) {
  .modal { align-items: center; }
  .modal-panel { width: min(560px, calc(100% - 48px)); border-radius: var(--r-xl); border-bottom: 1px solid var(--line); padding: 18px 24px 22px; transform: translateY(16px) scale(.98); opacity: 0;
    transition: transform .25s var(--ease), opacity .2s; box-shadow: var(--shadow-2); }
  .modal-body { margin: 0 -24px; padding: 0 24px; }
  .modal-actions { margin: 0 -24px; padding: 16px 24px 2px; }
  .modal-panel.wide { width: min(900px, calc(100% - 48px)); }
  .modal.open .modal-panel { transform: none; opacity: 1; }
  .modal-panel .grabber { display: none; }
}

/* ---- toasts ---- */
.toasts { position: fixed; z-index: 200; left: var(--toast-x, 50%); bottom: calc(92px + var(--safe-b)); transform: translateX(-50%); display: grid; gap: 8px; justify-items: center;
  pointer-events: none; width: max-content; max-width: var(--toast-w, calc(100% - 32px)); }
.toast { display: flex; gap: 8px; align-items: center; padding: 11px 16px; border-radius: 14px; background: var(--toast-bg); color: var(--toast-fg); font: 600 14px/1.35 var(--ui);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3); opacity: 0; transform: translateY(10px); transition: all .25s var(--ease); }
.toast.in { opacity: 1; transform: none; }
/* a sheet, dialog, docked panel or render screen is up: above its top edge, or at the top of the screen (ui.js placeToasts) */
.toasts.top { top: max(calc(12px + var(--safe-t)), var(--toast-top, 0px)); bottom: auto; }
.toasts.top .toast { transform: translateY(-10px); }
.toasts.top .toast.in { transform: none; }
.toast.t-error { background: var(--danger); color: #fff; }
.toast.t-success svg { color: var(--toast-ok); }

/* ================================ EDITOR ================================ */
.editor { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }
.ed-top { flex: none; display: flex; align-items: center; gap: 4px; height: calc(56px + var(--safe-t)); padding: var(--safe-t) max(12px, var(--safe-r)) 0 max(4px, var(--safe-l));
  border-bottom: 1px solid var(--line); background: var(--bar); }
.ed-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.ed-title strong { font: 700 15px/1.2 var(--head); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-title span { font: 400 12.5px/1.2 var(--ui); color: var(--text-2); font-variant-numeric: tabular-nums; }
.ed-top .btn.accent { min-height: 40px; padding: 0 16px; }
.ed-main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ed-col { flex: 1 1 0; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.stage { flex: 1 1 0; min-height: 0; overflow: hidden; position: relative; display: grid; place-items: center; padding: 10px 12px 4px; background: var(--stage); }
.frame { position: relative; border-radius: 12px; overflow: hidden; background: #000; box-shadow: var(--frame-shadow); touch-action: manipulation; color: #fff; }
.frame canvas { width: 100%; height: 100%; cursor: pointer; }
.frame .bigplay { position: absolute; inset: 0; margin: auto; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #fff; pointer-events: none; opacity: 0; transform: scale(.9); transition: all .2s var(--ease); }
.frame.paused .bigplay { opacity: 1; transform: none; }
.frame.empty-state .bigplay, .frame.fitting .bigplay { opacity: 0 !important; }
.frame .slotlabel { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; align-items: center; pointer-events: none; }
.frame .slotlabel span { height: 24px; padding: 0 8px; border-radius: 7px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: #fff; font: 600 12.5px/24px var(--ui); font-variant-numeric: tabular-nums; }
.frame .slotlabel span.warn { background: var(--accent); color: var(--accent-ink); }
.cta { position: absolute; inset: 0; display: grid; place-content: center; gap: 10px; justify-items: center; text-align: center; padding: 20px;
  background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, .25), rgba(0, 0, 0, .65)); }
.cta .btn { box-shadow: 0 10px 30px rgba(var(--accent-rgb), .28); }
.cta .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .35); }
.cta p { margin: 0; max-width: 240px; font-size: 13.5px; color: #ddd; text-shadow: 0 1px 6px #000; }
/* ================================ ALPHA Video AI (vai.js): raw clips → AI → the reel, from the template's own data ================
   The story rail (.vai2): in the frame on phones and narrow stages (.cta.vai-in), a panel beside the frame on a wide desktop
   stage (.vai2[data-place=side]). The frame layer (.vai-screen): the template's own preview — the reel — with its tags and
   the "Ready" ring. A phase attribute (clips · cut · fx · ready · out · rest · board) drives every animation; transforms
   and opacity only. */
.vai2, .cta.vai-in, .vai-screen, .vck, .vck-ready, .vck-sweep { --vy: #ffd60a; --vink: #111214; --vspring: cubic-bezier(.22, 1.28, .36, 1); --vout: cubic-bezier(.16, 1, .3, 1); }
.cta.vai-in, .vai2[data-place="frame"] { --v-fg: #fff; --v-fg2: rgba(255, 255, 255, .74); --v-chip: rgba(255, 255, 255, .09); --v-line: rgba(255, 255, 255, .16); --v-acc: #ffd60a; }
.vai2[data-place="side"] { --v-fg: var(--text); --v-fg2: var(--text-2); --v-chip: var(--fill); --v-line: var(--line-2); --v-acc: var(--accent-strong); }
.vai2 { display: grid; gap: 12px; min-width: 0; color: var(--v-fg); font: 400 13px/1.4 var(--ui); text-align: left; }
.vai2[data-place="side"] { position: absolute; z-index: 2; width: 380px; padding: 18px 18px 14px; border-radius: 26px; background: var(--card);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 0 0 1px var(--line), 0 24px 60px -24px rgba(0, 0, 0, .45); }
:root[data-theme="light"] .vai2[data-place="side"] { box-shadow: 0 0 0 1px var(--line), 0 22px 54px -26px rgba(16, 24, 40, .35); }

/* head: the badge and where the story is */
.v-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.v-badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px 0 8px; border-radius: 999px; background: var(--vy); color: var(--vink);
  font: 600 12px/1 var(--head); letter-spacing: -.005em; white-space: nowrap; box-shadow: 0 6px 18px -10px rgba(255, 214, 10, .9); }
.v-badge b { font-weight: 800; letter-spacing: .03em; }
.v-badge > i { display: grid; width: 15px; height: 15px; }
.v-badge svg { width: 100%; height: 100%; fill: currentColor; }
.v-ind { display: flex; gap: 4px; }
.v-ind i { position: relative; width: 18px; height: 4px; border-radius: 2px; background: var(--v-line); overflow: hidden; }
.v-ind i::after { content: ""; position: absolute; inset: 0; background: var(--v-acc); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--vout); }
.vai2[data-phase="clips"] .v-ind i:nth-child(1)::after, .vai2[data-phase="cut"] .v-ind i:nth-child(-n+2)::after,
.vai2[data-phase="fx"] .v-ind i:nth-child(-n+3)::after, .vai2:is([data-phase="ready"], [data-phase="out"], [data-phase="rest"], [data-phase="board"]) .v-ind i::after { transform: none; }
.v-title { display: grid; min-height: 1.25em; font: 700 19px/1.25 var(--head); letter-spacing: -.02em; }
.v-title span { grid-area: 1 / 1; opacity: 0; transform: translateY(7px); transition: opacity .22s ease, transform .4s var(--vout); }
.vai2[data-phase="clips"] .v-title [data-s="clips"], .vai2[data-phase="cut"] .v-title [data-s="cut"], .vai2[data-phase="fx"] .v-title [data-s="fx"],
.vai2:is([data-phase="ready"], [data-phase="out"], [data-phase="rest"]) .v-title [data-s="ready"] { opacity: 1; transform: none; }
.vai2[data-phase="board"] .v-title { display: none; }

/* the stage: a dark monitor in both themes; everything inside is laid out in container units (16:10) */
.v-stage { position: relative; aspect-ratio: 16 / 10; container: vst / size; border-radius: 16px; overflow: hidden; isolation: isolate;
  transition: opacity .3s ease; }
.v-stage-bg { position: absolute; inset: 0; background: radial-gradient(130% 95% at 50% 0%, #20242c 0%, #0e1014 72%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); border-radius: inherit; }
.v-cards, .v-pieces, .v-lane { position: absolute; inset: 0; }
.v-card { position: absolute; top: 7cqh; width: 25cqw; height: 53.33cqh; border-radius: 2.2cqw; opacity: 0; color: #fff;
  background: var(--img) center / cover, #23262d; filter: saturate(.7) brightness(.86) contrast(.96);
  box-shadow: 0 1.6cqw 3.6cqw rgba(0, 0, 0, .55), 0 0 0 .3cqw rgba(255, 255, 255, .1); }
.v-card:nth-child(1) { --mx: -4cqw; --my: 7cqh; --mr: -8deg; }
.v-card:nth-child(2) { --mx: 1cqw; --my: -3cqh; --mr: 4deg; }
.v-card:nth-child(3) { --mx: 4cqw; --my: 8cqh; --mr: -5deg; }
.v-card::before, .v-card::after { content: ""; position: absolute; left: 0; right: 0; height: 3.4cqh; background: radial-gradient(circle, rgba(255, 255, 255, .55) 30%, transparent 34%) 0 50% / 3.2cqw 100% repeat-x, rgba(10, 11, 13, .82); }
.v-card::before { top: 0; border-radius: 2.2cqw 2.2cqw 0 0; }
.v-card::after { bottom: 0; border-radius: 0 0 2.2cqw 2.2cqw; }
.v-play { position: absolute; left: 50%; top: 50%; width: 8.4cqw; height: 8.4cqw; margin: -4.2cqw 0 0 -4.2cqw; display: grid; place-items: center;
  border-radius: 50%; background: rgba(0, 0, 0, .42); box-shadow: inset 0 0 0 .25cqw rgba(255, 255, 255, .35); }
.v-play svg { width: 3.8cqw; height: 3.8cqw; margin-left: .45cqw; fill: currentColor; stroke: none; }
.v-dur { position: absolute; right: 1.4cqw; bottom: 5.4cqh; padding: .45cqw 1.1cqw; border-radius: 1cqw; background: rgba(0, 0, 0, .66);
  font: 600 clamp(8px, 2.6cqw, 11px)/1 var(--ui); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.v-piece { position: absolute; opacity: 0; transform-origin: 0 0; background-image: var(--img); background-size: 25cqw 53.33cqh; background-repeat: no-repeat;
  filter: saturate(.7) brightness(.86) contrast(.96); box-shadow: 0 0 0 .15cqw rgba(0, 0, 0, .5); }
.v-scan { position: absolute; left: 0; top: 2.5cqh; height: 63cqh; width: .7cqw; margin-left: -.35cqw; opacity: 0; border-radius: 1cqw;
  background: linear-gradient(#fff6c2, #ffd60a 22%, rgba(255, 214, 10, .08)); box-shadow: 0 0 2.6cqw .7cqw rgba(255, 214, 10, .42); }
.v-scan > i { position: absolute; left: 50%; top: -2.6cqw; width: 6cqw; height: 6cqw; margin-left: -3cqw; }
.v-scan svg { width: 100%; height: 100%; fill: #ffe766; filter: drop-shadow(0 0 1cqw rgba(255, 214, 10, .9)); }
.v-lane { opacity: 0; transition: transform .6s var(--vout); }
.v-cap { position: absolute; left: 4cqw; right: 4cqw; top: 70cqh; margin: 0; text-align: center; opacity: 0; color: rgba(255, 255, 255, .78);
  font: 600 clamp(10px, 3.4cqw, 13px)/1.3 var(--ui); font-variant-numeric: tabular-nums; }
.v-cap b { color: #fff; font-weight: 700; }
.vai2[data-place="side"]:is([data-phase="fx"], [data-phase="ready"], [data-phase="out"]) .v-lane, .vai2[data-phase="rest"] .v-lane { transform: translateY(-30cqh); }
.vai2[data-place="side"]:is([data-phase="fx"], [data-phase="ready"]) .v-cap { animation: vIn .4s ease .25s both; }
.vai2[data-phase="rest"] .v-cap { opacity: 1; }
.vai2[data-place="side"][data-phase="out"] .v-cap { opacity: 1; animation: vOut .25s ease both; }
.v-track { position: absolute; left: 3cqw; right: 3cqw; top: 64.5cqh; height: 30cqh; border-radius: 2.2cqw; background: rgba(255, 255, 255, .045); box-shadow: inset 0 0 0 .25cqw rgba(255, 255, 255, .07); }
.v-wave i { position: absolute; top: 82.5cqh; height: 8.5cqh; width: .9cqw; border-radius: .5cqw; background: rgba(255, 255, 255, .3); transform: scaleY(var(--a)); }
.v-ticks i { position: absolute; top: 81cqh; height: 11.5cqh; width: .22cqw; background: rgba(255, 255, 255, .13); }
.v-seg { position: absolute; top: 68cqh; height: 12cqh; border-radius: 1.1cqw; opacity: 0; overflow: hidden; background: var(--img) center / cover, #2a2e36;
  box-shadow: inset 0 0 0 .25cqw rgba(255, 255, 255, .18); }
.v-seg b { position: absolute; left: .8cqw; bottom: .9cqh; padding: .35cqw .7cqw; border-radius: .7cqw; background: rgba(0, 0, 0, .62); color: #fff;
  font: 700 clamp(7px, 2.2cqw, 10px)/1 var(--ui); font-variant-numeric: tabular-nums; }
.v-mark { position: absolute; top: 64.5cqh; height: 30cqh; width: .7cqw; margin-left: -.35cqw; opacity: 0; }
.v-mark::before { content: ""; position: absolute; inset: 0; border-radius: .5cqw; background: var(--vy); box-shadow: 0 0 1.6cqw rgba(255, 214, 10, .7); }
.v-playhead { position: absolute; top: 62.5cqh; height: 34cqh; width: .5cqw; margin-left: -.25cqw; border-radius: .4cqw; opacity: 0; background: #fff; box-shadow: 0 0 1.2cqw rgba(255, 255, 255, .85); }

/* chips: this template's own effects; each ticks when the story shows it */
.v-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.v-chips li { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 6px; border-radius: 999px;
  background: var(--v-chip); box-shadow: inset 0 0 0 1px var(--v-line); font: 600 11.5px/1 var(--ui); white-space: nowrap; color: var(--v-fg); }
.v-chips li::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1.5px var(--v-acc); opacity: 0; transition: opacity .3s ease; }
.v-ci { position: relative; display: grid; place-items: center; width: 16px; height: 16px; }
.v-ci > svg { width: 13px; height: 13px; color: var(--v-fg2); transition: opacity .2s ease, transform .3s var(--vout); }
.v-ck { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; background: var(--vy); color: var(--vink); opacity: 0; transform: scale(.3); }
.v-ck svg { width: 10px; height: 10px; stroke-width: 3; }
.v-line { margin: 0; color: var(--v-fg2); font: 400 13.5px/1.45 var(--ui); text-wrap: pretty; }
.v-line b { color: var(--v-fg); font-weight: 650; }
.v-steps { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; padding: 0; }
.v-ctl { display: flex; justify-content: center; gap: 8px; }
.vai2[data-place="side"] .v-ctl { justify-content: flex-end; margin-top: -2px; }
.v-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px; border-radius: 999px; color: var(--v-fg); font: 600 13px/1 var(--ui);
  background: transparent; box-shadow: inset 0 0 0 1px var(--v-line); transition: background .15s ease; }
.v-btn:hover { background: var(--v-chip); }
.v-btn svg { width: 15px; height: 15px; }
.v-btn[hidden] { display: none; }

/* ---- phases (rail) ---- */
.vai2[data-phase="clips"] .v-card { animation: vCardIn .78s var(--vspring) calc(var(--c) * 130ms) both; }
.vai2[data-phase="cut"] .v-card { animation: vCardSquare .34s var(--vout) both, vGone .12s linear calc(430ms + var(--c) * 168ms) forwards; }
.vai2[data-phase="cut"] .v-piece { animation: vPieceCut .22s var(--vout) calc(430ms + var(--c) * 168ms) both, vPieceFly .46s cubic-bezier(.55, 0, .18, 1) calc(880ms + var(--d)) forwards; }
.vai2[data-phase="cut"] .v-scan { animation: vScan .66s cubic-bezier(.45, 0, .22, 1) .28s both; }
.vai2[data-phase="cut"] .v-lane { animation: vLaneIn .38s var(--vout) both; }
.vai2[data-phase="cut"] .v-seg { animation: vSegIn .3s var(--vspring) calc(1240ms + var(--d)) both; }
.vai2[data-phase="cut"] .v-mark { animation: vMarkIn .28s var(--vspring) calc(1260ms + var(--d)) both; }
.vai2:is([data-phase="cut"], [data-phase="fx"], [data-phase="ready"]) .v-mark::before { animation: vBeat var(--beat) cubic-bezier(.2, .8, .2, 1) 1.75s infinite; }
.vai2:is([data-phase="fx"], [data-phase="ready"], [data-phase="rest"]) :is(.v-lane, .v-seg, .v-mark) { opacity: 1; }
.vai2[data-phase="fx"] .v-playhead { animation: vHead 1.8s linear both; }
.vai2[data-phase="out"] :is(.v-lane, .v-seg, .v-mark) { opacity: 1; animation: vOut .25s ease both; }
/* ticks: "beat cuts" as the pieces land, the rest on the template's cut in the frame (.hit) */
.vai2[data-phase="cut"] .v-chips li[data-k="cuts"] :is(.v-ck) { animation: vTick .4s var(--vspring) 1.5s both; }
.vai2[data-phase="cut"] .v-chips li[data-k="cuts"] .v-ci > svg { animation: vIconOut .2s ease 1.5s both; }
.vai2[data-phase="cut"] .v-chips li[data-k="cuts"]::after { animation: vIn .3s ease 1.5s both; }
.vai2.hit .v-chips li:not([data-k="cuts"]) .v-ck { animation: vTick .4s var(--vspring) calc((var(--k) - 1) * 140ms) both; }
.vai2.hit .v-chips li:not([data-k="cuts"]) .v-ci > svg { animation: vIconOut .2s ease calc((var(--k) - 1) * 140ms) both; }
.vai2.hit .v-chips li:not([data-k="cuts"])::after { animation: vIn .3s ease calc((var(--k) - 1) * 140ms) both; }
.vai2:is([data-phase="fx"], [data-phase="ready"]) .v-chips li[data-k="cuts"] .v-ck,
.vai2:is([data-phase="ready"], [data-phase="rest"], [data-phase="board"]) .v-chips li .v-ck { opacity: 1; transform: none; }
.vai2:is([data-phase="fx"], [data-phase="ready"]) .v-chips li[data-k="cuts"] .v-ci > svg,
.vai2:is([data-phase="ready"], [data-phase="rest"], [data-phase="board"]) .v-chips li .v-ci > svg { opacity: 0; }
.vai2:is([data-phase="fx"], [data-phase="ready"]) .v-chips li[data-k="cuts"]::after,
.vai2:is([data-phase="ready"], [data-phase="rest"], [data-phase="board"]) .v-chips li::after { opacity: 1; }
.vai2[data-phase="out"] .v-chips li .v-ck { opacity: 1; animation: vOut .25s ease both; }
.vai2.v-paused *, .vai2.v-paused *::before, .vai2.v-paused *::after, .vai-screen.v-paused *, .vai-screen.v-paused { animation-play-state: paused !important; }

@keyframes vCardIn { from { opacity: 0; transform: translate(var(--mx), calc(var(--my) + 70cqh)) rotate(calc(var(--mr) * 2.4)) scale(.86); }
  to { opacity: 1; transform: translate(var(--mx), var(--my)) rotate(var(--mr)); } }
@keyframes vCardSquare { from { opacity: 1; transform: translate(var(--mx), var(--my)) rotate(var(--mr)); } to { opacity: 1; transform: none; } }
@keyframes vGone { from { opacity: 1; } to { opacity: 0; } }
@keyframes vPieceCut { 0% { opacity: 0; transform: none; } 1% { opacity: 1; transform: none; } 100% { opacity: 1; transform: translateX(var(--sep)); } }
@keyframes vPieceFly { 0% { opacity: 1; transform: translateX(var(--sep)); } 82% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(var(--tx) * 1cqw), calc(var(--ty) * 1cqh)) scale(var(--sx), var(--sy)); } }
@keyframes vScan { 0% { opacity: 0; transform: translateX(6cqw); } 12%, 86% { opacity: 1; } 100% { opacity: 0; transform: translateX(94cqw); } }
@keyframes vLaneIn { from { opacity: 0; transform: translateY(5cqh); } to { opacity: 1; transform: none; } }
@keyframes vSegIn { 0% { opacity: 0; transform: scale(.55, .35); } 60% { opacity: 1; transform: scale(1.05, 1.12); } 100% { opacity: 1; transform: none; } }
@keyframes vMarkIn { 0% { opacity: 0; transform: scaleY(.2); } 60% { opacity: 1; transform: scaleY(1.25); } 100% { opacity: 1; transform: none; } }
@keyframes vBeat { 0% { transform: scaleY(1.32); opacity: 1; } 38%, 100% { transform: scaleY(1); opacity: .62; } }
@keyframes vHead { from { opacity: 1; transform: translateX(0); } to { opacity: 1; transform: translateX(var(--pt)); } }
@keyframes vOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes vIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes vTick { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }
@keyframes vIconOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(.5); } }

/* ---- in the frame (phones, narrow stages): the story above the CTA, the CTA and Got it at the bottom ---- */
.frame.vai-frame { container: vframe / size; }
.frame.vai-frame .slotlabel, .frame.vai-frame .busy { opacity: 0; }
.cta.vai-in { place-content: stretch; justify-items: stretch; align-items: start; grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "rail" "." "btn" "ctl"; gap: 10px; padding: 12px; text-align: left; background: none; }
.cta.vai-in::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 12, 15, .9), rgba(10, 12, 15, .72) 56%, rgba(10, 12, 15, .86));
  transition: opacity .35s ease; }
.cta.vai-in:is([data-vphase="fx"], [data-vphase="ready"], [data-vphase="out"])::before { opacity: 0; }
.cta.vai-in > * { position: relative; }
.cta.vai-in > .vai2 { grid-area: rail; }
.cta.vai-in > .btn { grid-area: btn; justify-self: center; }
.cta.vai-in > .v-ctl { grid-area: ctl; }
.vai2[data-place="frame"] { gap: 9px; }
.vai2[data-place="frame"] .v-title { font-size: 16px; }
.vai2[data-place="frame"] .v-stage { border-radius: 14px; aspect-ratio: 16 / 9; }
.vai2[data-place="frame"] .v-chips { gap: 5px; }
.vai2[data-place="frame"] .v-chips li { height: 24px; font-size: 11px; padding-right: 9px; }
.vai2[data-place="frame"] .v-line { font-size: 12.5px; }
.vai2[data-place="frame"] .v-line, .vai2[data-place="frame"] .v-chips { transition: opacity .3s ease; }
.vai2[data-place="frame"]:is([data-phase="fx"], [data-phase="ready"], [data-phase="out"]) :is(.v-stage, .v-title) { opacity: 0; }
.vai2[data-place="frame"] .v-title { transition: opacity .25s ease; }
.vai2[data-place="frame"]:is([data-phase="ready"], [data-phase="out"]) .v-chips,
.vai2[data-place="frame"]:is([data-phase="fx"], [data-phase="ready"], [data-phase="out"]) .v-line { opacity: 0; }
.vai2[data-place="frame"] .v-chips li { --v-chip: rgba(14, 16, 20, .66); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.cta.vai-in .v-btn { background: rgba(10, 12, 15, .4); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@container vframe (max-height: 505px) { .vai2[data-place="frame"] .v-line { display: none; } }
@container vframe (max-height: 425px) { .vai2[data-place="frame"] .v-chips { display: none; } }
@container vframe (max-height: 370px) { .vai2[data-place="frame"] .v-title { display: none; } .vai2[data-place="frame"] .v-ind { display: none; } }
@container vframe (max-height: 300px) { .cta.vai-in > .vai2, .frame.vai-frame .vai-screen { display: none; } }
@container vframe (max-width: 250px) { .vai2[data-place="frame"] .v-ind { display: none; } .vai2[data-place="frame"] .v-badge { height: 24px; font-size: 11px; } }

/* ---- beside the frame (a wide desktop stage) ---- */
.stage.vai-stage { container: vstage / size; }
.cta.vai-side { place-content: end center; padding-bottom: 26px; background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, .55)); }
.vai2[data-place="side"].v-tight .v-line { display: none; }
.vai2[data-place="side"].v-tight { gap: 10px; padding-top: 14px; }
.vai2[data-place="side"].v-tighter .v-title { display: none; }
.vai2[data-place="side"].v-tighter .v-stage { aspect-ratio: 16 / 9; }

/* ---- the reduced-motion storyboard ---- */
.v-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.vb { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: radial-gradient(130% 95% at 50% 0%, #20242c, #0e1014 72%); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); }
.vb1 i { position: absolute; width: 46%; aspect-ratio: 3 / 4; border-radius: 6px; background: var(--img) center / cover; filter: saturate(.7) brightness(.86); box-shadow: 0 5px 12px rgba(0, 0, 0, .55); }
.vb1 i:nth-child(1) { left: 6%; top: 22%; transform: rotate(-8deg); }
.vb1 i:nth-child(2) { left: 29%; top: 12%; transform: rotate(4deg); }
.vb1 i:nth-child(3) { left: 50%; top: 28%; transform: rotate(-5deg); }
.vb1 i b { position: absolute; right: 4px; bottom: 4px; padding: 2px 4px; border-radius: 4px; background: rgba(0, 0, 0, .66); font: 600 9px/1 var(--ui); font-variant-numeric: tabular-nums; }
.vb-lane { position: absolute; left: 8%; right: 8%; top: 38%; height: 20%; }
.vb-lane i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--img) center / cover; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.vb-lane u { position: absolute; top: -22%; bottom: -22%; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--vy); box-shadow: 0 0 6px rgba(255, 214, 10, .7); }
.vb2 > b { position: absolute; left: 6%; right: 6%; bottom: 14%; text-align: center; font: 600 10.5px/1.25 var(--ui); color: rgba(255, 255, 255, .8); }
.vb3 > i { position: absolute; inset: 8% 20% 22%; border-radius: 10px; background: var(--img) center / cover; box-shadow: 0 0 0 2px rgba(255, 255, 255, .14); }
.vb-ready { position: absolute; left: 50%; bottom: 8%; translate: -50% 0; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 999px;
  background: var(--vy); color: var(--vink); font: 700 11px/1 var(--head); white-space: nowrap; }
.vb-ready svg { width: 12px; height: 12px; stroke-width: 3; }
.vai2[data-phase="board"] .v-steps { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; list-style: none; counter-reset: vstep; font: 500 12px/1.4 var(--ui); color: var(--v-fg2); }
.vai2[data-phase="board"] .v-steps li { counter-increment: vstep; }
.vai2[data-phase="board"] .v-steps li::before { content: counter(vstep); display: inline-grid; place-items: center; width: 18px; height: 18px; margin: 0 6px 4px 0; border-radius: 50%;
  background: var(--vy); color: var(--vink); font: 700 11px/1 var(--head); vertical-align: middle; }
.vai2[data-place="frame"][data-phase="board"] .v-steps { grid-template-columns: 1fr; gap: 6px; }
@container vframe (max-height: 560px) { .vai2[data-place="frame"][data-phase="board"] .v-steps { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }

/* ---- the frame layer: the template's own preview, its tags, Ready ---- */
.vai-screen { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; color: #fff; opacity: 0; visibility: hidden; }
.vai-screen:is([data-phase="fx"], [data-phase="ready"], [data-phase="out"]) { visibility: visible; opacity: 1; }
.vs-zoom, .vs-vid, .vs-still { position: absolute; inset: 0; width: 100%; height: 100%; }
.vs-vid, .vs-still { object-fit: cover; }
.vs-still { opacity: 0; }
.vai-screen.still .vs-still { opacity: 1; }
.vai-screen.still .vs-vid { display: none; }
.vs-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent 24%, transparent 50%, rgba(0, 0, 0, .86)); }
.vs-dim { position: absolute; inset: 0; background: rgba(8, 9, 12, .68); opacity: 0; }
.vs-flash { position: absolute; inset: 0; background: #fff; opacity: 0; }
.vs-tags { position: absolute; inset: 0; }
.vs-stack { position: absolute; left: 6%; top: var(--sy, 40%); display: grid; justify-items: start; gap: 6px; max-width: 88%; }
.vs-tag { position: relative; display: inline-flex; align-items: center; gap: 6px; max-width: 86%; padding: 7px 11px 7px 8px; border-radius: 12px;
  background: rgba(12, 14, 17, .74); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(255, 255, 255, .14);
  font: 600 12px/1.15 var(--ui); white-space: nowrap; max-width: 100%; opacity: 0; transform: translateY(8px) scale(.9); }
.vs-tag > svg, .vs-sfx svg { flex: none; width: 14px; height: 14px; color: var(--vy); }
.vs-tag > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.vs-sfx { position: relative; display: grid; place-items: center; }
.vs-sfx i { position: absolute; width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--vy); opacity: 0; }
.vs-ready { position: absolute; left: 0; right: 0; top: var(--ry, 30%); display: grid; justify-items: center; gap: 12px; padding: 0 9%; text-align: center; }
.vs-ring { position: relative; width: 74px; height: 74px; border-radius: 50%; opacity: 0; box-shadow: inset 0 0 0 5px rgba(255, 255, 255, .2); }
.vs-h { position: absolute; inset: 0; }
.vs-h.r { clip-path: inset(0 0 0 50%); }
.vs-h.l { clip-path: inset(0 50% 0 0); }
.vs-h i { position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 5px var(--vy); }
.vs-h.r i { clip-path: inset(0 50% 0 0); }
.vs-h.l i { clip-path: inset(0 0 0 50%); }
.vs-ring-ic { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; opacity: 0; transform: scale(.6); }
.vs-badge { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 13px 0 10px; border-radius: 999px; background: var(--vy); color: var(--vink);
  font: 700 13.5px/1 var(--head); opacity: 0; transform: translateY(6px) scale(.9); box-shadow: 0 8px 22px -10px rgba(255, 214, 10, .8); }
.vs-badge svg { width: 14px; height: 14px; stroke-width: 3; }
.vs-tagline { margin: 0; max-width: 15em; font: 800 19px/1.2 var(--head); letter-spacing: -.02em; text-wrap: balance; text-shadow: 0 2px 14px rgba(0, 0, 0, .65); opacity: 0; transform: translateY(8px); }
.vai-screen[data-phase="fx"] { animation: vIn .26s var(--vout) both; }
.vai-screen[data-phase="fx"] .vs-zoom { animation: vPunch .62s var(--vspring) both; }
.vai-screen[data-phase="fx"] .vs-flash { animation: vFlash .44s ease-out both; }
.vai-screen.still[data-phase="fx"] .vs-still, .vai-screen.still[data-phase="ready"] .vs-still { animation: vPush 3.6s linear both; }
.vai-screen[data-phase="fx"] .t-text { animation: vTagIn .46s var(--vspring) .22s both; }
.vai-screen.hit .t-slow { animation: vTagIn .46s var(--vspring) both; }
.vai-screen.hit .t-sfx { animation: vTagIn .46s var(--vspring) .12s both; }
.vai-screen.hit .vs-sfx i { animation: vRipple .9s ease-out .12s both; }
.vai-screen.hit .vs-sfx i + i { animation-delay: .32s; }
.vai-screen[data-phase="ready"] .vs-tag { animation: vOut .2s ease both; }
.vai-screen[data-phase="ready"] .vs-dim { animation: vIn .3s ease both; }
.vai-screen[data-phase="ready"] .vs-ring { animation: vIn .2s ease .05s both; }
.vai-screen[data-phase="ready"] .vs-h.r i { animation: vHalf .3s linear .12s both; }
.vai-screen[data-phase="ready"] .vs-h.l i { animation: vHalf .3s linear .42s both; }
.vai-screen[data-phase="ready"] .vs-ring-ic { animation: vPop .4s var(--vspring) .7s both; }
.vai-screen[data-phase="ready"] .vs-badge { animation: vPop .42s var(--vspring) .76s both; }
.vai-screen[data-phase="ready"] .vs-tagline { animation: vRise .5s var(--vout) .86s both; }
.vai-screen[data-phase="out"] { animation: vOut .25s ease both; }
.vai-screen[data-phase="out"] :is(.vs-dim, .vs-ring, .vs-ring-ic, .vs-badge, .vs-tagline) { opacity: 1; transform: none; }
.vai-screen[data-phase="out"] .vs-h i { transform: rotate(180deg); }
@keyframes vPunch { from { transform: scale(1.12); } to { transform: none; } }
@keyframes vFlash { 0% { opacity: 0; } 14% { opacity: .78; } 100% { opacity: 0; } }
@keyframes vPush { from { transform: scale(1); } to { transform: scale(1.08); } }
@keyframes vTagIn { from { opacity: 0; transform: translateY(8px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes vRipple { from { opacity: .95; transform: scale(.5); } to { opacity: 0; transform: scale(2.3); } }
@keyframes vHalf { from { transform: rotate(0deg); } to { transform: rotate(180deg); } }
@keyframes vPop { from { opacity: 0; transform: translateY(6px) scale(.6); } to { opacity: 1; transform: none; } }
@keyframes vRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@container vframe (max-width: 300px) { .vs-ring { width: 60px; height: 60px; } .vs-tagline { font-size: 16px; } .vs-tag { font-size: 11px; padding: 6px 9px 6px 7px; } }

/* folded ("Got it"): one pill under the CTA brings it back */
.v-how { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 10px; border-radius: 999px; color: #fff; font: 600 12.5px/1 var(--ui);
  background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.v-how:hover { background: rgba(255, 255, 255, .18); }
.v-how svg { width: 14px; height: 14px; color: #ffd60a; }

/* ---- the checklist while the picked clips load (startChecklist): each row ticks when its work is done ---- */
.vck { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: 14px; background: rgba(9, 11, 14, .74); opacity: 0; transition: opacity .25s ease; }
.vck.in { opacity: 1; }
.vck.out { opacity: 0; transition-duration: .4s; }
.vck-card { width: min(100%, 300px); display: grid; gap: 12px; padding: 16px 16px 18px; border-radius: 20px; color: #fff; background: rgba(22, 25, 30, .94);
  box-shadow: 0 22px 48px -20px rgba(0, 0, 0, .85), inset 0 0 0 1px rgba(255, 255, 255, .1); transform: translateY(10px) scale(.97); transition: transform .5s var(--vout); }
.vck.in .vck-card { transform: none; }
.vck-h { margin: 0; font: 700 18px/1.2 var(--head); letter-spacing: -.02em; }
.vck-list { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.vck-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 10px; color: rgba(255, 255, 255, .46); font: 500 13.5px/1.3 var(--ui); transition: color .25s ease; }
.vck-row:is([data-state="doing"], [data-state="done"]) { color: #fff; }
.vck-ic { position: relative; display: grid; place-items: center; width: 20px; height: 20px; }
.vck-row[data-state="todo"] .vck-ic::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .28); }
.vck-spin { position: absolute; inset: 1px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .16); border-top-color: var(--vy); opacity: 0; }
.vck-row[data-state="doing"] .vck-spin { opacity: 1; animation: spin .8s linear infinite; }
.vck-row[data-state="later"] { color: #fff; }
.vck-row[data-state="later"] .vck-spin { opacity: .8; animation: spin 1.6s linear infinite; }
.vck-tick { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; background: var(--vy); color: var(--vink); opacity: 0; transform: scale(.3);
  transition: opacity .15s ease, transform .4s var(--vspring); }
.vck-tick svg { width: 12px; height: 12px; stroke-width: 3; }
.vck-row[data-state="done"] .vck-tick { opacity: 1; transform: none; }
.vck-n { font: 600 12.5px/1 var(--ui); font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .72); }
.vck-sweep { position: absolute; inset: -10% -70%; z-index: 3; pointer-events: none; transform: translateX(-62%);
  background: linear-gradient(100deg, transparent 38%, rgba(255, 214, 10, 0) 42%, rgba(255, 236, 150, .5) 50%, rgba(255, 214, 10, 0) 58%, transparent 62%); }
.vck-sweep.go { transform: translateX(62%); transition: transform .8s cubic-bezier(.45, 0, .2, 1); }
.vck-ready { position: absolute; left: 50%; bottom: 17%; z-index: 4; translate: -50% 0; display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 10px 15px 10px 12px;
  border-radius: 999px; background: var(--vy); color: var(--vink); font: 700 13.5px/1 var(--head); white-space: nowrap; pointer-events: none;
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .7); opacity: 0; transform: translateY(8px) scale(.94); transition: opacity .3s ease, transform .5s var(--vspring); }
.vck-ready svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.vck-ready.in { opacity: 1; transform: none; transition-delay: .4s; }

.fitguide { position: absolute; inset: 0; pointer-events: none; display: none; }
.frame.fitting .fitguide { display: block; }
.fitguide::before { content: ""; position: absolute; inset: 0; border: 2px solid var(--accent-strong); border-radius: 12px; }
.fitguide::after { content: ""; position: absolute; inset: 0; background:
  linear-gradient(90deg, transparent calc(33.33% - .5px), rgba(255, 255, 255, .35) calc(33.33% - .5px), rgba(255, 255, 255, .35) calc(33.33% + .5px), transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), rgba(255, 255, 255, .35) calc(66.66% - .5px), rgba(255, 255, 255, .35) calc(66.66% + .5px), transparent calc(66.66% + .5px)),
  linear-gradient(180deg, transparent calc(33.33% - .5px), rgba(255, 255, 255, .35) calc(33.33% - .5px), rgba(255, 255, 255, .35) calc(33.33% + .5px), transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), rgba(255, 255, 255, .35) calc(66.66% - .5px), rgba(255, 255, 255, .35) calc(66.66% + .5px), transparent calc(66.66% + .5px)); }
.frame.fitting canvas { cursor: grab; touch-action: none; }
.frame .busy { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; padding: 7px 12px; border-radius: 999px;
  background: rgba(0, 0, 0, .65); color: #fff; font: 500 12.5px/1.2 var(--ui); white-space: nowrap; }

/* transport */
.transport { flex: none; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 max(14px, var(--safe-r)) 0 max(8px, var(--safe-l)); }
.transport .time { font: 500 13.5px/1 var(--ui); font-variant-numeric: tabular-nums; color: var(--text); min-width: 46px; }
.transport .time.total { color: var(--text-3); text-align: right; min-width: 34px; }
.scrub { flex: 1; position: relative; height: 44px; cursor: pointer; touch-action: none; }
.scrub .track { position: absolute; left: 0; right: 0; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.scrub .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--text); width: 0; }
.scrub .ticks { position: absolute; inset: 0; }
.scrub .ticks i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bg); }
.scrub .knob { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px var(--line-2), 0 2px 8px rgba(0, 0, 0, .35); left: 0; transition: transform .12s; }
.scrub.drag .knob { transform: scale(1.25); }

/* slot strip */
.strip { flex: none; display: flex; gap: 8px; overflow-x: auto; padding: 8px max(12px, var(--safe-r)) 10px max(12px, var(--safe-l)); scrollbar-width: none; scroll-padding: 0 40px; }
.strip::-webkit-scrollbar { display: none; }
.slot { flex: none; position: relative; width: 56px; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; background: var(--surface-2); color: #fff;
  box-shadow: inset 0 0 0 1px var(--line); transition: transform .15s var(--ease), box-shadow .15s; }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot.empty { box-shadow: inset 0 0 0 1.5px var(--line-3); }
.slot.empty img { opacity: .28; filter: grayscale(1); }
.slot.empty::after { content: "+"; position: absolute; inset: 0; display: grid; place-items: center; font: 300 26px/1 var(--ui); color: var(--text); }
.slot .no { position: absolute; z-index: 1; left: 4px; top: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 5px; background: rgba(0, 0, 0, .65); color: #fff;
  font: 600 11px/17px var(--ui); text-align: center; font-variant-numeric: tabular-nums; }
.slot .sec { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; padding: 10px 4px 3px; background: linear-gradient(transparent, rgba(0, 0, 0, .8)); color: #fff;
  font: 600 11px/1 var(--ui); text-align: center; font-variant-numeric: tabular-nums; }
.slot .kind { position: absolute; z-index: 1; right: 3px; top: 3px; color: #fff; filter: drop-shadow(0 1px 2px #000); }
.slot.now { outline: 2px solid rgba(255, 255, 255, .6); outline-offset: -2px; }
.slot.sel { outline: 3px solid var(--sel-ring, var(--accent)); outline-offset: -3px; box-shadow: 0 0 0 2px var(--accent), 0 6px 18px rgba(var(--accent-rgb), .3); transform: translateY(-2px); }
.slot.short::before { content: ""; position: absolute; z-index: 2; right: 4px; bottom: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-strong); box-shadow: 0 0 0 2px rgba(0, 0, 0, .6); }
/* a resumed draft's slot whose clip has to be picked again */
.slot.relink { box-shadow: inset 0 0 0 1.5px var(--accent-strong); }
.slot.relink .no { background: var(--accent); color: var(--accent-ink); }
.relink > p { margin: 0; }
.relink-list { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 6px; }
.relink-list li { display: flex; align-items: baseline; gap: 10px; min-width: 0; padding: 10px 12px; border-radius: 12px; background: var(--fill); font-size: 14px; }
.relink-list b { flex: none; font-weight: 600; }
.relink-list span:not(.tc) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.relink-list .tc { flex: none; color: var(--text-3); }
.slotinfo .tx .hint.again { color: var(--accent-fg); }

/* toolbar */
.toolbar { flex: none; display: grid; grid-template-columns: repeat(5, 1fr); padding: 4px max(6px, var(--safe-r)) calc(6px + var(--safe-b)) max(6px, var(--safe-l)); border-top: 1px solid var(--line); background: var(--bar); }
.tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 58px; border-radius: 12px; color: var(--text-2); font: 500 11.5px/1 var(--ui); transition: color .15s, background .15s; }
.tool:hover { color: var(--text); background: var(--fill); }
.tool[aria-pressed="true"] { color: var(--accent-fg); }
.tool[disabled] { opacity: .35; pointer-events: none; }

/* tool panel (docked) */
.panel-host { display: none; }
.panel-host.has-panel { display: block; flex: none; }
/* never wider than its column: a flex item's automatic minimum is its widest unwrapped line (a nowrap subtitle, a long file
   name), which pushed the desktop panel past its 400 px column and the editor clipped it (11 Oct 2026). min-width: 0 here
   and on the flex/grid children that hold text; long names ellipsise. */
.panel { display: flex; flex-direction: column; min-width: 0; background: var(--sheet); border-top: 1px solid var(--line-2); max-height: min(50vh, 440px); min-height: 0;
  padding-bottom: var(--safe-b); animation: panelin .25s var(--ease); }
@keyframes panelin { from { transform: translateY(24px); opacity: 0; } }
.panel-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px 8px 16px; }
.panel-titles { flex: 1; min-width: 0; }
.panel-title { margin: 0; font: 700 16px/1.25 var(--head); letter-spacing: -.015em; }
.panel-sub { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-body { flex: 1; min-height: 0; min-width: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 4px 16px 16px; }
.panel-body > *, .panel .card, .panel .field { min-width: 0; }
html.panel-open .strip, html.panel-open .toolbar { display: none; }
@media (min-width: 900px) {
  .ed-main { flex-direction: row; }
  .panel-host.has-panel { width: 400px; min-width: 0; border-left: 1px solid var(--line); background: var(--sheet); display: flex; }
  .panel { max-height: none; flex: 1 1 0; border-top: 0; animation: none; }
  html.panel-open .strip, html.panel-open .toolbar { display: flex; }
  html.panel-open .toolbar { display: grid; }
  .toolbar { max-width: 560px; width: 100%; margin: 0 auto; border-top: 0; background: transparent; }
  .ed-col { background: var(--bar); }
  .strip { justify-content: safe center; }
}

/* controls */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--fill); }
.seg-opt { flex: 1; min-height: 44px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-2); font: 600 14px/1 var(--ui); transition: all .15s; }
.seg-opt .seg-label { display: inline-flex; align-items: center; gap: 6px; font: 600 14px/1 var(--ui); font-variant-numeric: tabular-nums; }
.seg-opt .seg-sub { font: 500 10.5px/1 var(--ui); color: var(--text-3); }
.seg-opt.on { background: var(--seg-on); color: var(--text); box-shadow: var(--shadow-1); }
.seg-opt.on .seg-label { color: var(--accent-fg); }
.seg-opt:disabled { opacity: .3; cursor: not-allowed; }
.theme-seg .seg-opt.on .seg-label { color: var(--text); }
.field { display: grid; gap: 9px; margin-bottom: 18px; }
.field > .lbl { display: flex; justify-content: space-between; align-items: baseline; font: 600 13.5px/1.2 var(--ui); color: var(--text); }
.field > .lbl small { font: 400 12.5px/1.2 var(--ui); color: var(--text-3); font-variant-numeric: tabular-nums; }
.slider { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 6px 0; }
.slider-label { display: flex; align-items: center; gap: 8px; min-width: 0; font: 500 14px/1.2 var(--ui); }
.slider input[type="range"] { min-width: 0; }
.slider-label svg { color: var(--text-2); }
.slider-val { font: 500 13.5px/1 var(--ui); color: var(--text-2); font-variant-numeric: tabular-nums; }
.range { grid-column: 1 / -1; -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; --fill: 50%; }
.range::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--text) var(--fill), var(--surface-3) var(--fill)); }
.range::-moz-range-track { height: 5px; border-radius: 3px; background: var(--surface-3); }
.range::-moz-range-progress { height: 5px; border-radius: 3px; background: var(--text); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; margin-top: -8.5px; box-shadow: 0 0 0 1px var(--line-2), 0 2px 8px rgba(0, 0, 0, .3); }
.range::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px var(--line-2), 0 2px 8px rgba(0, 0, 0, .3); }
.toggle { display: flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; position: relative; }
.toggle-text { flex: 1; display: grid; gap: 2px; font: 500 14.5px/1.3 var(--ui); }
.toggle-text small { font-weight: 400; font-size: 12.5px; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-ui { width: 46px; height: 28px; border-radius: 999px; background: var(--surface-3); position: relative; transition: background .2s; flex: none; }
.toggle-ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.toggle input:checked + .toggle-ui { background: var(--accent); }
.toggle input:checked + .toggle-ui::after { transform: translateX(18px); background: var(--accent-ink); }
.toggle input:focus-visible + .toggle-ui { outline: 2px solid var(--ring); outline-offset: 2px; }
.card { background: var(--fill); border-radius: var(--r); padding: 14px; }
.card + .card { margin-top: 12px; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.card-h h3 { flex: 1; min-width: 0; margin: 0; font: 600 14.5px/1.25 var(--ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-h > :not(h3) { flex: none; }
.empty { text-align: center; padding: 56px 16px; color: var(--text-2); }
.empty strong { display: block; color: var(--text); font: 700 20px/1.2 var(--head); margin-bottom: 8px; }
.note { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-2); padding: 10px 12px; border-radius: 12px; background: var(--bg-1); border: 1px solid var(--line); }
.note svg { flex: none; margin-top: 1px; color: var(--accent-fg); }
.note.warn { border-color: var(--accent-line); }
.note b { color: var(--text); }

/* media panel */
.slotinfo { display: flex; gap: 14px; align-items: flex-start; }
.slotinfo .th { width: 64px; flex: none; aspect-ratio: 9 / 16; border-radius: 9px; overflow: hidden; background: var(--fill); position: relative; }
.slotinfo .th img { width: 100%; height: 100%; object-fit: cover; }
.slotinfo .tx { display: grid; gap: 4px; font-size: 14px; }
.slotinfo .tx b { font-size: 15px; font-weight: 600; }
.slotinfo .tx .hint { color: var(--text-2); font-size: 13px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.row-actions .btn { flex: 1 1 140px; }

/* trim panel */
.trim { display: grid; gap: 12px; }
.film { position: relative; height: 64px; border-radius: 10px; overflow: hidden; background: var(--fill); touch-action: none; user-select: none; cursor: grab; }
.film .tiles { position: absolute; inset: 0; display: flex; }
.film .tiles canvas { height: 100%; flex: 1 1 0; min-width: 0; object-fit: cover; }
.film .shade { position: absolute; top: 0; bottom: 0; background: rgba(0, 0, 0, .62); pointer-events: none; }
.film .win { position: absolute; top: 0; bottom: 0; border: 3px solid var(--accent-strong); border-radius: 10px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); pointer-events: none; }
.film .win::before, .film .win::after { content: ""; position: absolute; top: 50%; width: 4px; height: 22px; margin-top: -11px; border-radius: 2px; background: var(--accent-ink); }
.film .win::before { left: 3px; } .film .win::after { right: 3px; }
.film .head { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #fff; box-shadow: 0 0 4px #000; pointer-events: none; }
/* AI picks (Auto Trim, tools.js trimPanel): three moments over the filmstrip, the chosen one ringed */
.ai-picks { display: grid; gap: 9px; margin-bottom: 14px; padding: 12px; border-radius: 16px; background: var(--fill); }
.ai-h { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font: 400 12.5px/1.3 var(--ui); color: var(--text-2); }
.ai-h svg { align-self: center; color: var(--accent-fg); }
.ai-h b { font: 700 14px/1.2 var(--head); color: var(--text); margin-right: 2px; }
.ai-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ai-pick { position: relative; display: grid; gap: 5px; justify-items: center; padding: 0; border-radius: 12px; color: var(--text); text-align: center; }
.ai-th { display: block; width: 100%; aspect-ratio: 9 / 16; max-height: 132px; border-radius: 11px; overflow: hidden; background: var(--fill-2); box-shadow: 0 0 0 1px var(--line); }
.ai-th canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.ai-pick[aria-checked="true"] .ai-th { box-shadow: 0 0 0 3px var(--accent-strong); }
.ai-best { position: absolute; left: 6px; top: 6px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 700 10.5px/18px var(--ui); font-style: normal; }
.ai-t { font: 600 12px/1 var(--ui); font-variant-numeric: tabular-nums; color: var(--text-2); }
.ai-pick[aria-checked="true"] .ai-t { color: var(--text); }
.ai-wait { display: flex; align-items: center; gap: 8px; font: 500 13px/1.3 var(--ui); color: var(--text-2); }
.ai-find, .ai-find.btn.tonal { justify-self: start; background: var(--card); border-color: var(--line-2); }
.ai-find.btn.tonal:hover { background: var(--fill-2); }
.ai-note { margin: 0; font: 400 12px/1.3 var(--ui); color: var(--text-3); }
.trim-meta { display: flex; justify-content: space-between; gap: 10px; min-width: 0; font: 500 13.5px/1 var(--ui); color: var(--text-2); font-variant-numeric: tabular-nums; }
.trim-meta > * { white-space: nowrap; }
.trim-meta b { color: var(--text); font-weight: 600; }

/* text panel */
.tlist { display: grid; gap: 8px; }
.trow { display: grid; grid-template-columns: 66px 1fr auto; gap: 10px; align-items: center; padding: 8px 8px 8px 10px; border-radius: 12px; background: var(--fill); border: 1px solid transparent; transition: border-color .15s; }
.trow.active { border-color: var(--accent-line); }
.trow .at { font: 600 13.5px/1 var(--ui); color: var(--text-2); font-variant-numeric: tabular-nums; }
.trow .at small { display: block; font: 500 11px/1.4 var(--ui); color: var(--text-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow input { width: 100%; min-height: 44px; border-radius: 9px; border: 1px solid var(--line); background: var(--sheet); padding: 0 12px; font: 600 16px/1 var(--ui); letter-spacing: .01em; text-transform: uppercase; outline: none; }
.trow input:focus { border-color: var(--accent-line); }
.trow .icon-btn { width: 44px; height: 44px; }

/* music panel: the sound of the video */
.field.snd { margin-bottom: 14px; }
.snd-opts { display: grid; gap: 8px; }
.snd-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 14px; background: var(--fill); border: 1.5px solid transparent;
  color: var(--text); text-align: left; transition: border-color .15s, background .15s; }
.snd-opt:hover:not(:disabled) { background: var(--fill-2); }
.snd-opt .ro { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-3); display: grid; place-items: center; }
.snd-opt .so-t { display: grid; gap: 2px; min-width: 0; }
.snd-opt b { font: 600 14.5px/1.25 var(--ui); }
.snd-opt small { font: 400 12.5px/1.3 var(--ui); color: var(--text-2); }
.snd-opt[aria-checked="true"] { border-color: var(--accent-strong); background: var(--accent-soft); }
.snd-opt[aria-checked="true"] .ro { border-color: var(--accent-strong); }
.snd-opt[aria-checked="true"] .ro::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-strong); }
.snd-opt:disabled { opacity: .45; cursor: default; }
.snd-note { margin-top: 10px; }
.snd-mine { margin-bottom: 12px; }

/* music panel */
.wave { position: relative; width: 100%; min-width: 0; height: 72px; border-radius: 10px; background: var(--bg-1); overflow: hidden; touch-action: none; cursor: grab; user-select: none; box-shadow: inset 0 0 0 1px var(--line); }
.wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.wave .win { position: absolute; top: 0; bottom: 0; left: 50%; border: 2px solid var(--accent-strong); border-radius: 10px; background: rgba(var(--accent-rgb), .07); pointer-events: none; }
.musicrow { display: flex; gap: 10px; align-items: center; }
.musicrow .name { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* export sheet: a radio list (Instagram · Small file · Max quality · Custom while used), Custom settings in place,
   one line about the sound, the button with the time */
.xsheet2 { display: grid; gap: 4px; }
.xlist { display: grid; gap: 2px; }
.xrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; width: 100%; padding: 12px 12px; border-radius: 14px;
  color: var(--text); text-align: left; transition: background .15s; }
.xrow:hover { background: var(--fill); }
.xrow[aria-checked="true"] { background: var(--accent-soft); }
.xrow:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent-strong); }   /* keyboard focus: a soft yellow edge */
.xr-radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-3); display: grid; place-items: center; transition: border-color .15s; }
.xrow[aria-checked="true"] .xr-radio { border-color: var(--accent-strong); background: var(--accent); }
.xrow[aria-checked="true"] .xr-radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-ink); }
.xr-main { display: grid; gap: 3px; min-width: 0; }
.xr-name { display: flex; align-items: center; gap: 8px; font: 600 16px/1.2 var(--ui); }
.xr-tag { height: 19px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 700 10.5px/19px var(--ui); white-space: nowrap; }
.xr-spec { font: 400 13px/1.25 var(--ui); color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xr-size { font: 600 15px/1 var(--ui); font-variant-numeric: tabular-nums; white-space: nowrap; }
details.xcustom { margin-top: 6px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
details.xcustom summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 50px; padding: 0 12px; cursor: pointer; list-style: none;
  font: 600 15px/1.2 var(--ui); }
details.xcustom summary::-webkit-details-marker { display: none; }
details.xcustom summary svg { color: var(--text-2); transition: transform .2s var(--ease); }
details.xcustom[open] summary svg { transform: rotate(90deg); }
.xcustom-in { padding: 4px 12px 8px; }
.xcustom-in .field { margin-bottom: 14px; }
/* the rows (Resolution, Frame rate, Bitrate): a 52 px track with equal cells; every cell centres its content — a plain
   number in the exact centre, a number with a second line ("Template", "Full HD", Mbps) as a centred pair; the chosen
   cell is a yellow pill of the same height */
.xcustom .seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; height: 52px; padding: 4px; }
.xcustom .seg-opt { display: grid; place-items: center; align-content: center; gap: 2px; height: 100%; min-height: 0; padding: 0 2px; }
.xcustom .seg-opt .seg-label, .xcustom .seg-opt .seg-sub { line-height: 1.1; white-space: nowrap; }
.xcustom .seg { container-type: inline-size; }
.xcustom .seg-opt .seg-label { font-size: clamp(10px, 4.1cqi, 13.5px); letter-spacing: -.01em; }
.xcustom .seg-opt .seg-sub { font-size: clamp(9px, 3.3cqi, 11px); }
.xcustom .seg-opt.on { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.xcustom .seg-opt.on .seg-label { color: var(--accent-ink); }
.xcustom .seg-opt.on .seg-sub { color: var(--accent-ink); opacity: .72; }
.why-off { margin: 2px 2px 0; font: 400 12px/1.35 var(--ui); color: var(--text-3); }
.x-warn { display: flex; align-items: flex-start; gap: 8px; margin: 10px 12px 0; font: 500 13px/1.4 var(--ui); color: var(--warn-fg); }
.x-warn svg { flex: none; margin-top: 1px; }
.exp-sheet .modal-actions { flex-direction: column; gap: 10px; }
.x-note { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 2px; font: 500 13.5px/1.3 var(--ui); color: var(--text-2); font-variant-numeric: tabular-nums; }
.x-note svg { flex: none; color: var(--accent-fg); }
.x-note span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 900px) { .exp-sheet.modal-panel { width: min(480px, calc(100% - 48px)); } }

/* export sheet */
.est { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--fill); margin: 4px 0 16px; }
.est span { color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.est b { flex: none; font: 700 18px/1 var(--head); font-variant-numeric: tabular-nums; }

/* ================================ RENDER ================================ */
.render { position: fixed; inset: 0; z-index: 150; background: radial-gradient(800px 500px at 50% 20%, rgba(var(--accent-rgb), .08), transparent 65%), var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: calc(20px + var(--safe-t)) 20px calc(24px + var(--safe-b)); overflow: auto; }
.render .shot { position: relative; height: min(46vh, 460px); aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; background: #000; box-shadow: var(--frame-shadow); flex: none; }
.render .shot canvas, .render .shot video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.render .pct { font: 800 54px/1 var(--head); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.render .bar { width: min(340px, 86vw); height: 6px; border-radius: 3px; background: var(--fill-2); overflow: hidden; }
.render .bar i { display: block; height: 100%; width: 0; background: var(--accent-strong); transition: width .25s linear; }
.render .stats { font: 500 14px/1.4 var(--ui); color: var(--text-2); text-align: center; min-height: 20px; font-variant-numeric: tabular-nums; }
.render .hint { font-size: 13px; color: var(--text-3); text-align: center; max-width: 320px; }
.render .acts { display: flex; gap: 10px; width: min(380px, 100%); flex-wrap: wrap; }
.render .acts .btn { flex: 1 1 140px; }
.render h2 { font: 800 26px/1.15 var(--head); letter-spacing: -.025em; margin: 0; text-align: center; }
.render .done-meta { font: 500 14px/1.3 var(--ui); color: var(--text-2); text-align: center; font-variant-numeric: tabular-nums; }
.render .err { max-width: 420px; text-align: center; display: grid; gap: 10px; }
.render .err p { margin: 0; color: var(--text-2); }
.render .err details { text-align: left; font-size: 12px; color: var(--text-3); }
.render .err pre { white-space: pre-wrap; word-break: break-word; }
.render .notes { display: grid; gap: 6px; width: min(380px, 100%); }
/* "Want faster renders?" (apppromo.js): from 25 %, at the bottom of the render screen */
.render.has-promo { padding-bottom: calc(210px + var(--safe-b)); }
.render.has-promo .shot { height: min(34vh, 340px); }
.app-promo { position: absolute; z-index: 2; left: 16px; right: 16px; bottom: calc(16px + var(--safe-b)); max-width: 440px; margin: 0 auto; display: grid; gap: 10px;
  padding: 16px 16px 14px; border-radius: 22px; background: var(--sheet); border: 1px solid var(--line-2); box-shadow: var(--shadow-2); text-align: left;
  transform: translateY(calc(100% + 40px)); opacity: 0; transition: transform .45s var(--spring), opacity .3s; }
.app-promo.in { transform: none; opacity: 1; }
.ap-x { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); }
.ap-x:hover { background: var(--fill); color: var(--text); }
.ap-t { display: grid; gap: 4px; padding-right: 30px; }
.ap-t b { font: 700 16px/1.25 var(--head); letter-spacing: -.015em; }
.ap-t span { font: 400 13.5px/1.4 var(--ui); color: var(--text-2); }
.btn.ap-btn { width: 100%; min-height: 46px; background: var(--brand); color: var(--brand-ink); border-color: transparent; font-weight: 700; }
.btn.ap-btn:hover { background: #ffe14d; }
.ap-note { margin: 0; font: 400 12.5px/1.4 var(--ui); color: var(--text-3); text-align: center; }
.ap-soon { justify-self: start; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--fill); color: var(--text-2); font: 600 14px/1 var(--ui); }
.ap-desk { display: flex; align-items: center; gap: 18px; }
.ap-qr { flex: none; width: 112px; height: 112px; padding: 6px; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.ap-qr svg { display: block; width: 100%; height: 100%; }
.ap-desk-r { display: grid; gap: 10px; min-width: 0; }
.ap-desk-r .ap-note { text-align: left; }
.ap-stores { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ap-stores .btn.ap-btn { width: auto; min-height: 40px; padding: 0 16px; }
.ap-store { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; background: var(--fill); color: var(--text); font: 600 13px/1 var(--ui); }
.ap-store.off { color: var(--text-3); }
.ap-store small { font-weight: 500; }
@media (min-width: 900px) { .app-promo { max-width: 580px; } }
/* a sheet opened while the render screen is up (Cancel → "Stop the export?", sign-in before Download) sits above it */
.render ~ .modal { z-index: 160; }

/* ================================ PREMIUM GATE (premium.js) ================================ */
.prem-head { display: flex; align-items: center; gap: 12px; }
.prem-head .th { flex: none; width: 46px; aspect-ratio: 9 / 16; border-radius: 9px; overflow: hidden; background: var(--fill); display: grid; place-items: center; color: var(--accent-fg); }
.prem-head .th img { width: 100%; height: 100%; object-fit: cover; }
.prem-head .tt { flex: 1; min-width: 0; display: grid; gap: 6px; }
.prem-head .tt b { font: 700 17px/1.25 var(--head); letter-spacing: -.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prem-head .k { display: inline-flex; align-items: center; gap: 5px; font: 500 12.5px/1.2 var(--ui); color: var(--text-2); }
.prem-head .k svg { color: var(--accent-fg); flex: none; }
.prem-head .amt { flex: none; font: 800 30px/1 var(--head); letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.prem-text { margin: 16px 0 0; color: var(--text-2); font-size: 14.5px; text-wrap: pretty; }
.prem-note { margin-top: 12px; }
.prem-msg { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--fill); font-size: 14px; color: var(--text); }
.prem-msg.err { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.prem-extra { display: flex; flex-wrap: wrap; gap: 0 18px; margin-top: 8px; }
.prem-extra:empty { display: none; }
.prem-acts { display: contents; }
.prem-sheet .modal-actions { flex-wrap: wrap; }
/* the long "Unlock with your plan · N left this month" gets its own row, on top; it may wrap on the narrowest phones */
.prem-sheet .modal-actions .btn.wide { flex: 1 1 100%; order: -1; white-space: normal; text-align: center; line-height: 1.2; padding-top: 8px; padding-bottom: 8px; }
.prem-sheet.qr .modal-actions { flex-direction: column; }
.prem-fine { margin: 2px 0 0; font: 400 12.5px/1.4 var(--ui); color: var(--text-3); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ================================ ACCOUNT (account.js) ================================ */
.acct-slot { display: inline-flex; }
.acct-av { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; flex: none; box-shadow: 0 0 0 1px var(--line-2); }
.acct-av img, .acct-big img { width: 100%; height: 100%; object-fit: cover; }
.acct-ini { width: 100%; height: 100%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 700 17px/1 var(--head); }
.acct-gbtn { display: flex; justify-content: center; align-items: center; min-height: 48px; margin: 18px 0 8px; color-scheme: light; }
.acct-sign > p.muted { margin: 0; text-align: center; text-wrap: pretty; }
.acct-msg { min-height: 1.4em; margin: 0; text-align: center; font-size: 14px; color: var(--text-2); }
.acct-msg.err { color: var(--danger); }
.acct-fine { margin: 16px 0 0; font-size: 12.5px; color: var(--text-3); text-align: center; }
.acct-fine a { color: var(--text-2); }
.acct-who { display: flex; align-items: center; gap: 14px; }
.acct-who b { display: block; font: 700 17px/1.25 var(--head); letter-spacing: -.015em; }
.acct-who span { color: var(--text-2); font-size: 14px; word-break: break-all; }
.acct-big { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex: none; }
.acct-sec { margin-top: 22px; }
.acct-h { margin: 0 0 10px; font: 600 13.5px/1.2 var(--ui); color: var(--text-2); }
.acct-buys { display: grid; gap: 8px; }
.acct-buy { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: var(--r); background: var(--fill); }
.acct-buy b { flex: 1; min-width: 0; font: 600 14px/1.3 var(--ui); }
.acct-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.acct-row .btn { flex: 1 1 140px; }
.btn.acct-del { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.acct-signcard { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; padding: 16px; border-radius: 18px; background: var(--fill); }
.acct-signcard .bi { margin: 0; width: 48px; height: 48px; border-radius: 15px; }
.acct-signcard strong { display: block; font: 700 17px/1.25 var(--head); letter-spacing: -.015em; }
.acct-signcard p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }
.acct-signcard .btn { grid-column: 1 / -1; margin-top: 10px; }
