/* edit. — a CapCut-style editor: near-black by default, a light theme (html[data-theme="light"]),
   one accent colour, quiet surfaces and motion that follows the finger. Every colour is a variable
   below; canvases read the ones they need through themeColor() (util.js). */

@font-face { font-family: "Inter"; src: url("../fonts/Inter.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("../fonts/Montserrat.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("../fonts/PlayfairDisplay.ttf") format("truetype"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Bebas Neue"; src: url("../fonts/BebasNeue.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Great Vibes"; src: url("../fonts/GreatVibes.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "UnifrakturMaguntia"; src: url("../fonts/Blackletter.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Pinyon Script"; src: url("../fonts/PinyonScript.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Pirata One"; src: url("../fonts/PirataOne.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("../fonts/Caveat.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }

/* ------------------------------------------------------------ theme */
:root {
  color-scheme: dark;
  --bg: #09090b;          /* page */
  --bg-2: #111114;        /* panels, sheets, bars */
  --surface: #151518;     /* cards on the page */
  --surface-2: #1e1e23;
  --surface-3: #2a2a31;
  --fill: #1b1b20;        /* controls and rows inside panels */
  --fill-2: #25252b;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --text: #f5f5f7;
  --text-2: #b4b4bd;
  --text-3: #7b7b85;
  --accent: #22d3ee;
  --accent-2: #67e8f9;
  --accent-ink: #031418;
  --accent-soft: rgba(34, 211, 238, .14);
  --accent-glow: rgba(34, 211, 238, .38);
  --ok: #34d399;
  --err: #fb7185;
  --warn: #fbbf24;
  --danger: #fda4af;
  --warn-soft: rgba(251, 191, 36, .12);
  --warn-ink: #fcd98b;
  --ok-soft: rgba(52, 211, 153, .12);
  --stage: #000;          /* behind the picture in the editors */
  --stage-2: #0e0e11;
  --scrim: rgba(0, 0, 0, .7);
  --glass: rgba(17, 17, 20, .74);
  --on-media: rgba(8, 8, 10, .72);   /* labels over pictures (both themes); no live blur behind them */
  --checker-a: #2a2a30;
  --checker-b: #202025;
  --sel: #ffffff;         /* the picked clip on a timeline */
  --sel-ink: #111114;
  --tl-ruler: #6e6e78;
  --tl-clip: #26262c;
  --sheet-shadow: 0 -18px 50px rgba(0, 0, 0, .4);
  --toast-bg: rgba(38, 38, 44, .96);
  --toast-ink: #f5f5f7;
  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, .35);
  --r-xs: 8px;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.5, 0, .75, 0);
  --spring: linear(0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1);
  --tabbar-h: 62px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f2f5;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f1f4;
  --surface-3: #e2e2e8;
  --fill: #f1f1f4;
  --fill-2: #e7e7ec;
  --line: rgba(12, 12, 24, .08);
  --line-2: rgba(12, 12, 24, .15);
  --text: #0c0c10;
  --text-2: #4a4a55;
  --text-3: #85858f;
  --accent: #0891b2;
  --accent-2: #0e7490;
  --accent-ink: #ffffff;
  --accent-soft: rgba(8, 145, 178, .11);
  --accent-glow: rgba(8, 145, 178, .28);
  --ok: #059669;
  --err: #e11d48;
  --warn: #b45309;
  --danger: #be123c;
  --warn-soft: rgba(217, 119, 6, .1);
  --warn-ink: #92400e;
  --ok-soft: rgba(5, 150, 105, .1);
  --stage: #e6e6eb;
  --stage-2: #dcdce2;
  --scrim: rgba(18, 18, 30, .42);
  --glass: rgba(255, 255, 255, .8);
  --checker-a: #e4e4ea;
  --checker-b: #f4f4f7;
  --sel: #0c0c10;
  --sel-ink: #ffffff;
  --tl-ruler: #8a8a94;
  --tl-clip: #dcdce3;
  --sheet-shadow: 0 -8px 30px rgba(20, 20, 40, .1);
  --toast-bg: rgba(24, 24, 28, .95);
  --toast-ink: #f5f5f7;
  --shadow: 0 16px 44px rgba(20, 20, 40, .14);
  --shadow-sm: 0 3px 12px rgba(20, 20, 40, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--accent-soft); }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }

/* ------------------------------------------------------------ icons, buttons, fields */
.ico { width: 20px; height: 20px; flex: none; display: block; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 12px;
  background: var(--fill); border: 1px solid transparent; color: var(--text);
  font-weight: 600; font-size: 14.5px; letter-spacing: -0.005em; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s, transform .3s var(--spring), opacity .2s, box-shadow .25s;
}
.btn:hover { background: var(--fill-2); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .42; cursor: default; transform: none; }
.btn > span:first-child:has(.ico) { display: contents; }
.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 20px -8px var(--accent-glow); }
.btn--primary:hover { background: var(--accent-2); }
.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--fill); }
.btn--danger { color: var(--danger); }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn--xs { min-height: 30px; padding: 0 8px; font-size: 13px; border-radius: 9px; }
.btn--lg { min-height: 52px; font-size: 16px; border-radius: 14px; }
.btn--block { width: 100%; }
.btn.is-on { background: var(--accent-soft); color: var(--accent); }
.icon-only { width: 42px; padding: 0; }
.icon-only.btn--sm { width: 34px; }
.icon-only.btn--xs { width: 30px; }
.btn--tile { flex-direction: column; gap: 4px; min-height: 64px; border-radius: var(--r-sm); font-size: 12.5px; padding: 8px 4px; }
.btn--tile.is-on { color: var(--accent); background: var(--accent-soft); }

.input {
  width: 100%; min-height: 44px; padding: 10px 13px; border-radius: 12px;
  background: var(--fill); border: 1px solid transparent; color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .2s, background .15s;
}
.input::placeholder { color: var(--text-3); }
.input:hover { background: var(--fill-2); }
.input:focus { border-color: var(--accent); background: var(--fill); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 56px; line-height: 1.35; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }

.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* a progress bar with a light running over it while it works */
.bar { position: relative; height: 5px; border-radius: 5px; background: var(--fill-2); overflow: hidden; }
.bar i { position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(0); transition: transform .35s var(--ease); border-radius: inherit; overflow: hidden; }
.bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); transform: translateX(-100%); animation: sheen 1.6s var(--ease) infinite; }
@keyframes sheen { to { transform: translateX(100%); } }

.badge { flex: none; font-size: 11.5px; font-weight: 650; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--you { background: var(--fill-2); color: var(--text-2); }

/* ------------------------------------------------------------ app bar (top) and tab bar (phones: bottom) */
.appbar {
  display: flex; align-items: center; gap: 16px;
  padding: max(12px, env(safe-area-inset-top)) clamp(16px, 4vw, 40px) 12px;
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  view-transition-name: appbar;
}
.appbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); opacity: 0; transition: opacity .25s; }
.appbar.is-scrolled::after { opacity: 1; }
.appbar__sp { flex: 1; }
.logo { display: inline-flex; align-items: baseline; text-decoration: none; font-weight: 800; font-size: 24px; letter-spacing: -0.045em; line-height: 1; }
.logo__dot { color: var(--accent); display: inline-block; transform-origin: 50% 80%; animation: dot-in .9s .15s var(--spring) both; }
.logo:hover .logo__dot { animation: dot-bounce .7s var(--spring); }
@keyframes dot-in { from { transform: translateY(-14px) scale(.4); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes dot-bounce { 0% { transform: translateY(0) } 35% { transform: translateY(-6px) scale(1.12) } 100% { transform: none } }
.logo--big { font-size: 54px; }
/* the links: in the bar on wide screens */
.nav { position: relative; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 14px; background: var(--fill); }
.nav__item { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; text-decoration: none; color: var(--text-2); font-weight: 600; font-size: 14px; transition: color .2s; }
.nav__item .ico { width: 18px; height: 18px; }
.nav__item:hover { color: var(--text); }
.nav__item.is-on { color: var(--text); }
.nav__ind { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 10px; background: var(--surface-3); box-shadow: var(--shadow-sm);
  transition: transform .5s var(--spring), width .5s var(--spring); }
:root[data-theme="light"] .nav__ind { background: var(--bg-2); }
.theme-btn { position: relative; overflow: hidden; }
.theme-btn .ico { transition: transform .6s var(--spring), opacity .3s; }
.theme-btn:active .ico { transform: rotate(-30deg) scale(.85); }
/* phones: the same links as a tab bar at the bottom */
.tabbar { display: none; }
@media (max-width: 899px) {
  .appbar .nav { display: none; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    padding: 6px 10px max(8px, env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg-2) 86%, transparent);
    backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-top: 1px solid var(--line); view-transition-name: tabbar;
  }
  :root[data-theme="light"] .tabbar { background: color-mix(in srgb, var(--bg-2) 94%, transparent); }
  .tabbar__item { position: relative; display: grid; justify-items: center; gap: 3px; padding: 6px 4px 4px; text-decoration: none; color: var(--text-3); font-size: 11px; font-weight: 650; letter-spacing: .01em; }
  .tabbar__item .ico { width: 23px; height: 23px; transition: transform .45s var(--spring); }
  .tabbar__item.is-on { color: var(--text); }
  .tabbar__item.is-on .ico { color: var(--accent); transform: translateY(-1px) scale(1.06); }
  .tabbar__item:active .ico { transform: scale(.86); }
  /* a small bar under the picked tab slides between them */
  .tabbar__ind { position: absolute; top: 0; left: 0; width: 22px; height: 3px; margin-left: -11px; border-radius: 0 0 3px 3px; background: var(--accent);
    box-shadow: 0 2px 10px var(--accent-glow); transition: transform .55s var(--spring); }
  body:has(.tabbar:not([hidden])) .home, body:has(.tabbar:not([hidden])) .page { padding-bottom: calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom)); }
}
::view-transition-group(tabbar), ::view-transition-group(appbar) { animation: none; }
::view-transition-old(tabbar), ::view-transition-old(appbar) { display: none; }
::view-transition-new(tabbar), ::view-transition-new(appbar) { animation: none; }

/* ------------------------------------------------------------ files (home) */
.home, .page { max-width: 1180px; margin: 0 auto; padding: 6px clamp(16px, 4vw, 40px) 80px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 10px 0 18px; }
.hero h1 { margin: 0; font-size: clamp(30px, 5vw, 40px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02; }
.hero p { margin: 6px 0 0; color: var(--text-3); font-size: 13.5px; }
.hero__actions { display: flex; gap: 6px; }
/* new project + shortcuts */
.quick { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 10px; }
.newproj {
  position: relative; isolation: isolate; display: flex; align-items: center; gap: 14px; min-height: 92px; padding: 16px 18px;
  border: 0; border-radius: 18px; cursor: pointer; text-align: left; color: var(--text); overflow: hidden;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .45s var(--spring), box-shadow .3s;
}
/* a light that runs around its edge (a turning square behind it: the compositor moves it, nothing repaints) */
.newproj::before { content: ""; position: absolute; left: 50%; top: 50%; width: 150%; aspect-ratio: 1; translate: -50% -50%; z-index: -2;
  background: conic-gradient(transparent 0 70%, var(--accent) 82%, transparent 92%); animation: spin 5.5s linear infinite; opacity: .9; will-change: transform; }
.newproj::after { content: ""; position: absolute; inset: 1.5px; z-index: -1; border-radius: 16.5px;
  background: radial-gradient(120% 140% at 0% 0%, var(--accent-soft), transparent 55%), var(--surface); }
.newproj:hover { transform: translateY(-2px); }
.newproj:active { transform: scale(.98); }
.newproj.is-over { transform: scale(1.015); box-shadow: 0 0 0 6px var(--accent-soft), var(--shadow); }
.newproj.is-sent { animation: sent .6s var(--spring); }
@keyframes sent { 0% { transform: scale(1.015) } 40% { transform: scale(.975) } 100% { transform: none } }
.newproj__icon { flex: none; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 10px 26px -10px var(--accent-glow); transition: transform .5s var(--spring); }
.newproj__icon .ico { width: 28px; height: 28px; stroke-width: 2.2; }
.newproj:hover .newproj__icon, .newproj.is-over .newproj__icon { transform: rotate(90deg) scale(1.05); }
.newproj__text { display: grid; gap: 2px; min-width: 0; }
.newproj__text strong { font-size: 18px; font-weight: 750; letter-spacing: -0.02em; }
.newproj__text span { color: var(--text-3); font-size: 13px; }
.qtile { display: grid; align-content: space-between; gap: 10px; min-height: 92px; padding: 14px; border: 0; border-radius: 18px; cursor: pointer; text-align: left; color: var(--text);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: transform .45s var(--spring), background .2s; }
.qtile:hover { transform: translateY(-2px); background: var(--surface-2); }
.qtile:active { transform: scale(.97); }
.qtile .ico { width: 24px; height: 24px; color: var(--accent); }
.qtile strong { display: block; font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.qtile__sub { font-size: 12px; color: var(--text-3); }

.uploads { margin-top: 14px; padding: 14px 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--r); animation: rise .45s var(--ease-out) both; }
.uploads__head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 14.5px; }
.uploads__list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.up { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--text-2); }
.up__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up__state { font-variant-numeric: tabular-nums; color: var(--text-3); flex: none; }
.up--err .up__state { color: var(--err); }
.uploads__keep { margin: -4px 0 8px; }
.uploads__choice { display: grid; gap: 10px; margin: 0 0 12px; padding: 12px; border-radius: 12px; background: var(--fill); animation: rise .4s var(--ease-out) both; }
.uploads__choice:last-child { margin-bottom: 0; }
/* only the question left (the files were quick): no card around the card */
.uploads:has(> .uploads__choice:only-child) { padding: 0; background: none; box-shadow: none; }
.uploads:has(> .uploads__choice:only-child) .uploads__choice { padding: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.uploads__choice .btn:not(.btn--primary) { background: var(--fill-2); }

.recent { margin-top: 28px; }
.recent__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.recent__head h2 { margin: 0; font-size: 20px; font-weight: 750; letter-spacing: -0.025em; }
.recent__head h2 small { margin-left: 8px; font-size: 13px; font-weight: 600; color: var(--text-3); letter-spacing: 0; }
.recent__note { margin: 0 0 6px; max-width: 640px; }
.empty { color: var(--text-3); text-align: center; padding: 28px 0; }
.empty-state { display: grid; justify-items: center; gap: 6px; padding: 44px 16px 24px; text-align: center; color: var(--text-3); animation: rise .6s var(--ease-out) both; }
.empty-state strong { color: var(--text); font-size: 16px; font-weight: 700; }
.empty-state p { margin: 0; max-width: 34ch; font-size: 13.5px; }
.empty-art { width: 128px; height: 96px; margin-bottom: 8px; animation: float 5s ease-in-out infinite; }
.empty-art svg { width: 100%; height: 100%; overflow: visible; }
@keyframes float { 50% { transform: translateY(-6px) } }
.da-back { fill: var(--surface-3); stroke: var(--line-2); stroke-width: 1.5; }
.da-front { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1.5; }
.da-sun { fill: var(--accent); }
.da-hill { stroke: var(--text-3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.da-mark circle { fill: var(--accent); }
.da-mark path { stroke: var(--accent-ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.group { margin-top: 16px; }
.group__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 13.5px; color: var(--text-2); }
.group__head strong { color: var(--text); font-weight: 650; }
.group__actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
/* the file grid: three across on a phone */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.card { position: relative; display: block; text-decoration: none; border-radius: var(--r); color: inherit;
  animation: card-in .55s var(--ease-out) both; animation-delay: calc(min(var(--i, 0), 14) * 28ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(12px) scale(.97) } to { opacity: 1; transform: none } }
.card.is-disabled { cursor: default; }
.card__img { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r); background: var(--surface-2); overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line); transition: transform .5s var(--spring), box-shadow .3s; }
/* a soft shimmer until the picture is in */
.card__img::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--text) 6%, transparent) 50%, transparent 70%);
  transform: translateX(-100%); animation: shimmer 1.4s infinite; transition: opacity .3s; }
.card__img.is-loaded::before { opacity: 0; animation: none; }
@keyframes shimmer { to { transform: translateX(100%); } }
.card__img img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.04); transition: opacity .45s var(--ease), transform .7s var(--ease-out); }
.card__img.is-loaded img { opacity: 1; transform: none; }
.card:hover .card__img { box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow); transform: translateY(-3px); }
.card:hover .card__img.is-loaded img { transform: scale(1.035); }
.card:active .card__img { transform: scale(.97); }
.card.is-disabled:hover .card__img { transform: none; box-shadow: inset 0 0 0 1px var(--line); }
.card__ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); }
.card__ph .ico { width: 30px; height: 30px; }
.card__dur { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 3px; padding: 3px 7px 3px 5px; border-radius: 8px; background: var(--on-media); color: #fff; font-size: 11.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.card__dur .ico { width: 12px; height: 12px; }
.card__status { position: absolute; top: 6px; left: 6px; right: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 8px; border-radius: 8px; background: var(--on-media); color: #fff; font-size: 11.5px; font-weight: 650; white-space: nowrap; overflow: hidden; }
.chip .ico { width: 13px; height: 13px; }
.chip .spin { width: 10px; height: 10px; }
.chip--ok { color: #6ee7b7; }
.chip--err { color: #fda4af; }
.chip--warn { color: #fcd34d; }
.card__meta { padding: 8px 2px 0; display: grid; gap: 1px; }
.card__name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__left { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__left.is-soon { color: var(--warn); }
.is-armed, .btn.is-armed { background: var(--err) !important; color: #fff !important; }
/* picking several (Select) */
.card__check { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid rgba(255, 255, 255, .9); background: rgba(0, 0, 0, .25); color: transparent; box-shadow: 0 1px 6px rgba(0, 0, 0, .35);
  animation: pop .35s var(--spring) both; transition: background .2s, border-color .2s, color .2s; }
.card__check .ico { width: 15px; height: 15px; stroke-width: 3; }
.card.is-picked .card__check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.card.is-picked .card__img { transform: scale(.94); box-shadow: 0 0 0 2.5px var(--accent); }
.cards.is-selecting .card__status { right: 38px; }
.selbar { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 45; transform: translate(-50%, 0);
  display: flex; align-items: center; gap: 6px; width: min(560px, calc(100vw - 24px)); padding: 8px 8px 8px 16px; border-radius: 18px;
  background: var(--glass); box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  animation: selbar-in .5s var(--spring) both; }
@keyframes selbar-in { from { transform: translate(-50%, 140%); opacity: 0 } to { transform: translate(-50%, 0); opacity: 1 } }
.selbar__n { flex: 1; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 899px) { .selbar { bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); } }
/* room under the last row for the bar while picking */
.home:has(.selbar) { padding-bottom: calc(var(--tabbar-h) + 120px + env(safe-area-inset-bottom)) !important; }
/* an admin's files page: whose each file is */
.who { margin: 6px 0 4px; }
.who-tag { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; margin-left: 8px; padding: 2px 8px; border-radius: 7px; background: var(--fill-2); color: var(--text-2); font-size: 12px; font-weight: 650; vertical-align: 1px; }
/* on a card: the owner's initial in a small circle (the name is in the filters and on hover) */
.card__who { position: absolute; right: 6px; bottom: 6px; width: 24px; height: 24px; margin: 0; padding: 0; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #a78bfa, #f472b6); color: #fff; font-size: 11.5px; font-weight: 800; box-shadow: 0 0 0 2px rgba(0, 0, 0, .35); }
/* dropping files anywhere on the page */
.dropzone { position: fixed; inset: 0; z-index: 70; display: grid; place-content: center; justify-items: center; gap: 10px; pointer-events: none;
  background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(6px);
  color: var(--text); font-size: 20px; font-weight: 750; opacity: 0; transition: opacity .2s; }
.dropzone::before { content: ""; position: absolute; inset: 12px; border-radius: 24px; border: 2px dashed var(--accent); transform: scale(1.02); transition: transform .4s var(--spring); }
.dropzone.is-on::before { transform: none; }
.dropzone .ico { width: 42px; height: 42px; color: var(--accent); animation: bob 1.2s ease-in-out infinite; }
.dropzone.is-on { opacity: 1; }

@keyframes rise { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
@keyframes pop { from { transform: scale(.4); opacity: 0 } to { transform: none; opacity: 1 } }

/* ------------------------------------------------------------ editor shell */
body[data-view="editor"] { overflow: hidden; }
/* no pull-to-refresh or rubber-banding while editing */
html:has(body[data-view="editor"]), body[data-view="editor"] { overscroll-behavior: none; }
/* taps on buttons act at once (no double-tap zoom wait) */
button, .btn, a, [role="button"], [role="tab"] { touch-action: manipulation; }
.editor {
  height: 100dvh; display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(300px, var(--side, 380px), max(380px, 100vw - 520px));
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas: "top top" "center tabs" "center side";
  background: var(--bg);
}
.ed-top { grid-area: top; display: flex; align-items: center; gap: 4px; padding: max(10px, env(safe-area-inset-top)) 14px 10px; min-width: 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.ed-top__sp { flex: 1; }
.ed-title { display: flex; align-items: center; gap: 10px; min-width: 0; margin-left: 2px; }
.ed-title__col { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.ed-title__name { font-weight: 700; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34vw; }
.ed-title__nav { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-variant-numeric: tabular-nums; }
.ed-saved { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; animation: rise .3s var(--ease-out); }
.ed-saved:empty { display: none; }
.ed-saved .ico { width: 14px; height: 14px; }
.ed-saved[data-state="saved"] .ico { color: var(--ok); }
.ed-saved[data-state="saving"] .ico { animation: bob 1s ease-in-out infinite; }
.ed-saved[data-state="error"] { color: var(--warn); }
@keyframes bob { 50% { transform: translateY(-2px) } }
.ed-export { margin-left: 6px; }
.ed-center { grid-area: center; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ed-tabs { grid-area: tabs; display: flex; gap: 2px; padding: 10px 10px 0; border-left: 1px solid var(--line); background: var(--bg-2); overflow-x: auto; scrollbar-width: none; }
.ed-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px 9px; border: 0; background: none; border-radius: var(--r-sm); color: var(--text-3); font-size: 11.5px; font-weight: 650; cursor: pointer; position: relative; transition: color .2s, background .2s; }
.ed-tab:hover { color: var(--text-2); background: var(--fill); }
.ed-tab.is-on { color: var(--text); background: var(--fill); }
.ed-tab.is-on .ico { color: var(--accent); }
.ed-tab .ico { transition: transform .45s var(--spring); }
.ed-tab.is-on .ico { transform: translateY(-1px) scale(1.08); }
.ed-tab:active .ico { transform: scale(.86); }
.ed-panel { grid-area: side; border-left: 1px solid var(--line); background: var(--bg-2); min-height: 0; display: flex; flex-direction: column; position: relative; }
/* its left edge, dragged: the panel wider or narrower (a PC; double-click: back to its usual width) */
.ed-resize { position: absolute; left: -5px; top: 0; bottom: 0; width: 10px; padding: 0; border: 0; background: none; cursor: col-resize; z-index: 5; touch-action: none; }
.ed-resize::after { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 2px; background: transparent; transition: background .15s; }
.ed-resize:hover::after, .ed-resize.is-drag::after, .ed-resize:focus-visible::after { background: var(--accent); }
.ed-panel__body { overflow-y: auto; padding: 4px 18px 28px; flex: 1; overscroll-behavior: contain; }
.ed-panel__body.is-in > .panel > * { animation: panel-in .38s var(--ease-out) both; }
.ed-panel__body.is-in > .panel > :nth-child(2) { animation-delay: .03s; }
.ed-panel__body.is-in > .panel > :nth-child(3) { animation-delay: .06s; }
.ed-panel__body.is-in > .panel > :nth-child(n+4) { animation-delay: .09s; }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
.editor.is-loading .ed-tabs, .editor.is-loading .ed-panel__body { opacity: 0; }
.editor .ed-tabs, .editor .ed-panel__body { transition: opacity .35s var(--ease); }

/* stage */
.stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(120% 120% at 50% 40%, var(--stage-2), var(--stage) 70%); }
.stage__frame { position: absolute; left: 0; top: 0; box-shadow: 0 18px 60px rgba(0, 0, 0, .5); transition: width .3s var(--ease), height .3s var(--ease), left .3s var(--ease), top .3s var(--ease); }
.stage.is-gesture .stage__frame { transition: none; }
.stage.is-morph .stage__frame { animation: morph .38s var(--ease); }
@keyframes morph { from { opacity: .4; transform: scale(.985) } to { opacity: 1; transform: none } }
.stage__gl, .stage__ov { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage__ov { touch-action: none; z-index: 1; }
.stage__before, .stage__hint, .stage__loading, .stage__fit { z-index: 2; }
.stage__fit, .stage__before { position: absolute; top: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px 7px 9px; border-radius: 11px; border: 0;
  background: var(--on-media); color: #fff; font-size: 12.5px; font-weight: 650; cursor: pointer; box-shadow: 0 0 0 1px rgba(255, 255, 255, .1); }
.stage__fit { left: 12px; animation: rise .25s var(--ease) both; }
.stage__fit[hidden] { display: none; }
.stage__fit .ico, .stage__before .ico { width: 16px; height: 16px; }
.stage__before { right: 12px; user-select: none; -webkit-user-select: none; touch-action: none; transition: background .15s, color .15s, transform .3s var(--spring); }
.stage__before:active { background: var(--accent); color: var(--accent-ink); transform: scale(.95); }
.stage__hint { position: absolute; left: 50%; bottom: 12px; transform: translate(-50%, 6px); padding: 7px 12px; border-radius: 11px; background: var(--on-media); color: #fff; font-size: 12.5px; font-weight: 550; opacity: 0; pointer-events: none; transition: opacity .3s, transform .45s var(--spring); white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.stage__hint.is-on { opacity: 1; transform: translate(-50%, 0); }
.stage__loading { position: absolute; inset: 0; display: grid; place-items: center; grid-auto-flow: column; gap: 10px; color: var(--text-3); font-size: 14px; pointer-events: none; transition: opacity .3s; }
.editor:not(.is-loading) .stage__loading { opacity: 0; }

/* timeline */
.timeline { border-top: 1px solid var(--line); padding: 6px 14px 12px; background: var(--bg-2); user-select: none; -webkit-user-select: none; }
.tl__bar { display: flex; align-items: center; gap: 2px; min-height: 42px; }
.tl__play .ico { width: 22px; height: 22px; }
.tl__time { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 550; color: var(--text-2); margin-left: 8px; }
.tl__trim { font-size: 12.5px; margin-right: 6px; }
.tl__scrub { touch-action: none; cursor: grab; }
.tl__scrub:active { cursor: grabbing; }
.tl__view { position: relative; overflow: hidden; margin: 0 -14px; padding: 7px 0 3px; }
.tl__thumbs { position: absolute; left: 0; top: 7px; width: 100%; opacity: .95; display: block; pointer-events: none; }
.tl__content { position: relative; will-change: transform; }
.tl__track { position: relative; height: 54px; }
.tl__dim { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--bg-2) 72%, transparent); pointer-events: none; }
.tl__dim--l { left: 0; border-radius: 10px 0 0 10px; }
.tl__dim--r { right: 0; border-radius: 0 10px 10px 0; }
.tl__handle { position: absolute; top: -3px; bottom: -3px; width: 14px; margin-left: -7px; border-radius: 6px; background: var(--sel); cursor: ew-resize; box-shadow: 0 2px 8px rgba(0, 0, 0, .45); z-index: 2; }
.tl__handle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 2px; height: 16px; margin: -8px 0 0 -1px; border-radius: 2px; background: var(--text-3); }
.tl__head { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--sel); z-index: 3; pointer-events: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); border-radius: 1px; }
.tl__head::before { content: ""; position: absolute; top: -2px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 4px 4px 50% 50%; background: var(--sel); box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.tl__lanes { display: grid; gap: 4px; margin-top: 8px; }
.tl__lanes:empty { display: none; }
.tl__lane { position: relative; height: 16px; border-radius: 8px; background: var(--fill); cursor: pointer; overflow: visible; }
.tl__lane.is-sel { box-shadow: 0 0 0 1.5px var(--accent); }
.tl__lane.is-off { opacity: .4; }
.tl__span { position: absolute; top: 3px; bottom: 3px; border-radius: 5px; background: #6f7a8c; }
.tl__span--pixelate { background: repeating-linear-gradient(90deg, #7b8698 0 6px, #66717f 6px 12px); }
.tl__span--solid { background: #3b3f47; }
.tl__span--heal { background: linear-gradient(90deg, #a98a78, #c9a48c); }
.tl__lost { position: absolute; top: 3px; bottom: 3px; background: var(--err); opacity: .9; }
.tl__key { position: absolute; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; padding: 0; border: 1.5px solid var(--bg); transform: rotate(45deg); background: var(--sel); border-radius: 2px; cursor: grab; z-index: 2; transition: transform .25s var(--spring), background .15s; }
.tl__key::before { content: ""; position: absolute; inset: -9px; }
.tl__key:hover { transform: rotate(45deg) scale(1.25); }
.tl__key.is-on { background: var(--accent); transform: rotate(45deg) scale(1.3); }
.tl__key:active { cursor: grabbing; }
.tl__bar .btn:disabled { opacity: .35; }
/* fingers: sliders are dragged sideways (panels.js); scrolling past them or tapping does nothing */
@media (pointer: coarse) {
  .sl { touch-action: pan-y; }
  .sl__input { pointer-events: none; }
  .sl.is-drag .sl__input::-webkit-slider-thumb { transform: scale(1.25); }
}
/* fingers: bigger keyframes, lanes and trim handles */
@media (pointer: coarse) {
  .tl__lane { height: 22px; border-radius: 9px; }
  .tl__key { width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px; }
  .tl__key::before { inset: -11px; }
  .tl__handle { width: 18px; margin-left: -9px; }
  .tl__handle::before { content: ""; position: absolute; inset: -4px -12px; }
}
.tl__unsure { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(251, 191, 36, .75) 0 4px, rgba(251, 191, 36, .35) 4px 8px); }
.tl__busy { position: absolute; left: 0; top: 3px; bottom: 3px; background: linear-gradient(90deg, transparent, var(--accent-glow)); transition: width .3s var(--ease); }

/* filmstrip */
.filmstrip { display: flex; gap: 6px; padding: 8px 14px; border-top: 1px solid var(--line); background: var(--bg-2); overflow-x: auto; scrollbar-width: thin; }
.filmstrip__item { position: relative; flex: none; width: 54px; height: 54px; padding: 0; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--fill); cursor: pointer; opacity: .7; transition: opacity .15s, border-color .15s, transform .3s var(--spring); }
.filmstrip__item img { width: 100%; height: 100%; object-fit: cover; }
.filmstrip__item:hover { opacity: 1; }
.filmstrip__item:active { transform: scale(.94); }
.filmstrip__item.is-on { border-color: var(--accent); opacity: 1; }
.filmstrip__ok { position: absolute; right: 2px; bottom: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ok); color: #06150e; display: grid; place-items: center; }
.filmstrip__ok .ico { width: 11px; height: 11px; stroke-width: 3; }

/* ------------------------------------------------------------ panels */
.panel { display: grid; grid-template-columns: minmax(0, 1fr); }
.psec { padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.btn--block { white-space: normal; text-align: center; }  /* (a long label wraps instead of widening the panel) */
.psec:last-child { border-bottom: 0; }
.psec__title { margin: 0; font-size: 11.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.psec__sub { margin: 6px 0 -2px; font-size: 13px; font-weight: 650; color: var(--text-2); }
.field-label { font-size: 13px; color: var(--text-2); font-weight: 600; margin-bottom: -4px; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.note { margin: 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--fill); color: var(--text-2); font-size: 13px; line-height: 1.4; }
.note--warn { background: var(--warn-soft); color: var(--warn-ink); }
.note--lock { display: flex; align-items: center; gap: 10px; }
.note--lock > span:first-child .ico { color: var(--accent); }
.note--lock > span:nth-child(2) { flex: 1; }
.btn.is-locked { color: var(--accent); }
.psec__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.note--draw { display: flex; align-items: center; gap: 10px; background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--accent); animation: rise .3s var(--ease-out) both; }
.note--draw > span:first-child .ico { color: var(--accent); }
.note--draw > span:nth-child(2) { flex: 1; }

/* slider */
.sl { display: grid; gap: 2px; }
.sl__top { display: flex; justify-content: space-between; align-items: baseline; }
.sl__label { font-size: 13.5px; font-weight: 550; color: var(--text-2); cursor: default; user-select: none; }
.sl.is-set .sl__label { color: var(--text); }
.sl__val { font-size: 12.5px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; transition: color .2s; }
.sl.is-set .sl__val { color: var(--accent); }
.sl__hint { margin: 0; font-size: 12px; color: var(--text-3); }
.sl__input { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; cursor: pointer; --a: 50%; --b: 50%; }
.sl__input::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--fill-2) var(--a), var(--accent) var(--a) var(--b), var(--fill-2) var(--b)); }
.sl__input::-moz-range-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--fill-2) var(--a), var(--accent) var(--a) var(--b), var(--fill-2) var(--b)); }
.sl__input::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 2px 8px rgba(0, 0, 0, .3); transition: transform .3s var(--spring); }
.sl__input::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 2px 8px rgba(0, 0, 0, .3); }
.sl__input:active::-webkit-slider-thumb { transform: scale(1.2); }

/* segmented */
.seg { display: flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--fill); }
.seg--wrap { flex-wrap: wrap; }
.seg__btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .25s var(--ease), color .2s, box-shadow .25s, transform .3s var(--spring); white-space: nowrap; }
.seg__btn:hover { color: var(--text); }
.seg__btn:active { transform: scale(.96); }
.seg__btn.is-on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
:root[data-theme="light"] .seg__btn.is-on { background: var(--bg-2); box-shadow: 0 1px 3px rgba(20, 20, 40, .14); }
.seg--sm .seg__btn { min-height: 34px; padding: 0 6px; font-size: 12.5px; }

/* toggle */
.tog { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.tog__text { display: grid; gap: 2px; }
.tog__label { font-size: 14px; font-weight: 600; }
.tog__sub { font-size: 12.5px; color: var(--text-3); line-height: 1.35; }
.tog__sw { position: relative; flex: none; width: 48px; height: 29px; border-radius: 999px; border: 0; background: var(--fill-2); cursor: pointer; transition: background .3s var(--ease); }
.tog__sw i { position: absolute; top: 3px; left: 3px; width: 23px; height: 23px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 2px 6px rgba(0, 0, 0, .25); transition: transform .5s var(--spring), width .2s; }
.tog__sw:active i { width: 27px; }
.tog__sw.is-on { background: var(--accent); }
.tog__sw.is-on i { transform: translateX(19px); }
.tog__sw.is-on:active i { transform: translateX(15px); }

/* chips */
.looks, .rates { display: flex; flex-wrap: wrap; gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0; }
.chip-btn { min-height: 34px; padding: 0 13px; border-radius: 10px; border: 0; background: var(--fill); color: var(--text-2); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .2s var(--ease), color .2s, transform .3s var(--spring); font-variant-numeric: tabular-nums; }
.chip-btn:hover { color: var(--text); background: var(--fill-2); }
.chip-btn.is-on { background: var(--accent); color: var(--accent-ink); }
.chip-btn:active { transform: scale(.94); }

/* crop shapes */
.shapes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.shape { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 9px; border-radius: 12px; border: 1.5px solid transparent; background: var(--fill); cursor: pointer; color: var(--text-2); transition: border-color .2s, background .2s, color .2s, transform .3s var(--spring); }
.shape:hover { color: var(--text); background: var(--fill-2); }
.shape:active { transform: scale(.94); }
.shape.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.shape__icon { height: 26px; display: grid; place-items: center; }
.shape__icon i { display: block; border: 2px solid currentColor; border-radius: 3px; }
.shape__icon i.is-free { border-style: dashed; }
.shape.is-on .shape__icon i { border-color: var(--accent); }
.shape__label { font-size: 12.5px; font-weight: 650; }
.shape__sub { font-size: 10.5px; color: var(--text-3); margin-top: -3px; white-space: nowrap; }

/* lists */
.rlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rrow { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 10px; border-radius: 12px; background: var(--fill); border: 1.5px solid transparent; cursor: pointer; transition: border-color .15s, background .15s; min-height: 46px; animation: rise .3s var(--ease-out) both; }
.rrow:hover { background: var(--fill-2); }
.rrow.is-sel { border-color: var(--accent); background: var(--accent-soft); }
.rrow.is-off .rrow__name { opacity: .45; text-decoration: line-through; }
.rrow__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.rrow__sw { width: 18px; height: 18px; border-radius: 5px; flex: none; background: #7b8698; filter: blur(.4px); }
.rrow__sw--blur { background: radial-gradient(circle at 40% 40%, #c8ced8, #5b6472); filter: blur(1.2px); }
.rrow__sw--pixelate { background: conic-gradient(#8e98a8 25%, #5d6675 0 50%, #8e98a8 0 75%, #5d6675 0) 0 0 / 9px 9px; filter: none; }
.rrow__sw--solid { background: #000; border: 1px solid var(--line-2); filter: none; }
.rrow__sw--heal { background: radial-gradient(circle at 50% 50%, #d9b49b 35%, #b98f77 70%); filter: none; }
.rrow__logo { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; background: repeating-conic-gradient(var(--checker-a) 0 25%, var(--checker-b) 0 50%) 0 0 / 10px 10px; flex: none; }
.rrow__t { color: var(--text-3); display: grid; place-items: center; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line-2); cursor: pointer; padding: 0; transition: transform .35s var(--spring), box-shadow .2s; }
.swatch:hover { transform: scale(1.1); }
.swatch:active { transform: scale(.92); }
.swatch.is-on { box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 4px var(--accent); }
.swatch--custom { -webkit-appearance: none; appearance: none; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); overflow: hidden; }
.swatch--custom::-webkit-color-swatch-wrapper { padding: 0; opacity: 0; }
.swatch--custom::-moz-color-swatch { opacity: 0; }

/* AI fill (Remove areas done by the PC) */
.ai-box { display: grid; gap: 10px; padding: 12px; border-radius: var(--r); background: var(--fill); transition: box-shadow .3s; }
.ai-box.is-on { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--accent-soft); }
.ai-line { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-2); line-height: 1.35; animation: rise .3s var(--ease-out) both; }
.ai-line > span:first-child .ico { width: 20px; height: 20px; color: var(--text-3); }
.ai-line--ok { color: var(--text); }
.ai-line--ok > span:first-child .ico { color: var(--ok); }
.ai-line--err { color: var(--danger); flex-wrap: wrap; }
.ai-line--err > span:first-child .ico { color: var(--danger); }
.ai-line__col { flex: 1; display: grid; gap: 5px; min-width: 0; }
.ai-ring { width: 20px; height: 20px; display: grid; place-items: center; color: var(--accent); flex: none; }
.eyes-box { display: grid; gap: 10px; padding: 12px; border-radius: var(--r); background: var(--fill); }
.eyes-box__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.eyes-box__head .ico { color: var(--accent); }
.eyes-box .seg { background: var(--bg-2); }

.task { display: grid; gap: 6px; align-content: center; padding: 6px 10px; border-radius: var(--r-sm); background: var(--fill); }
.task__label { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.task .btn { justify-self: start; }

.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.preset { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 10px; border: 1.5px solid transparent; background: var(--fill); color: var(--text-2); font-weight: 600; font-size: 13.5px; cursor: pointer; transition: background .2s var(--ease), color .2s, border-color .2s, transform .3s var(--spring); }
.preset:hover { color: var(--text); background: var(--fill-2); }
.preset:active { transform: scale(.95); }
.preset.is-on { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.preset__star .ico { width: 14px; height: 14px; color: var(--accent); fill: var(--accent); }
.namerow { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; }
.empty-wm { padding: 16px; border-radius: var(--r); border: 1.5px dashed var(--line-2); text-align: center; color: var(--text-2); }
.empty-wm p { margin: 0; }

.posgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 132px; padding: 4px; border-radius: 12px; background: var(--fill); }
.posgrid__cell { aspect-ratio: 1.4; border: 0; border-radius: 8px; background: var(--bg-2); cursor: pointer; display: grid; place-items: center; transition: background .15s; }
.posgrid__cell i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); transition: transform .35s var(--spring), background .2s; }
.posgrid__cell:hover i { background: var(--text-3); }
.posgrid__cell.is-on { background: var(--accent-soft); }
.posgrid__cell.is-on i { background: var(--accent); transform: scale(1.35); }

/* watermark movement picker */
.moves { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.move { display: grid; justify-items: center; gap: 2px; padding: 8px 4px 9px; border-radius: 12px; border: 1.5px solid transparent; background: var(--fill); color: var(--text-2); cursor: pointer; text-align: center; transition: border-color .2s, background .2s, color .2s, transform .3s var(--spring); }
.move:hover { color: var(--text); background: var(--fill-2); }
.move:active { transform: scale(.94); }
.move.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.move__stage { position: relative; width: 58px; height: 36px; border-radius: 7px; background: linear-gradient(135deg, #2c323c, #1b1e24); overflow: hidden; margin-bottom: 4px; }
.move__dot { position: absolute; left: 70%; top: 72%; width: 14px; height: 5px; border-radius: 3px; background: #fff; box-shadow: 0 0 6px rgba(255, 255, 255, .35); }
.move.is-on .move__dot { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.move__label { font-size: 12.5px; font-weight: 650; }
.move__sub { font-size: 10.5px; color: var(--text-3); line-height: 1.25; }
.move__dot--hop { animation: mv-hop 4.8s infinite; }
.move__dot--glide { animation: mv-glide 6s ease-in-out infinite alternate; }
.move__dot--bounce { animation: mv-bounce-x 2.2s linear infinite alternate, mv-bounce-y 1.6s linear infinite alternate; }
.move__dot--scroll { top: 72%; animation: mv-scroll 3s linear infinite; }
.move__dot--jump { animation: mv-jump 4s infinite; }
@keyframes mv-hop { 0%, 21% { left: 70%; top: 72%; opacity: 1 } 23% { opacity: 0 } 25%, 46% { left: 6%; top: 72%; opacity: 1 } 48% { opacity: 0 } 50%, 71% { left: 6%; top: 12%; opacity: 1 } 73% { opacity: 0 } 75%, 96% { left: 70%; top: 12%; opacity: 1 } 98% { opacity: 0 } }
@keyframes mv-glide { 0% { left: 70%; top: 72% } 30% { left: 40%; top: 20% } 60% { left: 8%; top: 55% } 100% { left: 55%; top: 15% } }
@keyframes mv-bounce-x { from { left: 2% } to { left: 74% } }
@keyframes mv-bounce-y { from { top: 8% } to { top: 80% } }
@keyframes mv-scroll { from { left: 105% } to { left: -30% } }
@keyframes mv-jump { 0%, 22% { left: 70%; top: 72%; opacity: 1 } 24% { opacity: 0 } 26%, 47% { left: 20%; top: 30%; opacity: 1 } 49% { opacity: 0 } 51%, 72% { left: 55%; top: 10%; opacity: 1 } 74% { opacity: 0 } 76%, 97% { left: 10%; top: 75%; opacity: 1 } 99% { opacity: 0 } }

.logo-pick { display: flex; gap: 12px; align-items: center; }
.logo-pick__img { width: 76px; height: 76px; object-fit: contain; border-radius: 12px; background: repeating-conic-gradient(var(--checker-a) 0 25%, var(--checker-b) 0 50%) 0 0 / 14px 14px; padding: 6px; flex: none; }
.logo-pick__btns { display: grid; gap: 6px; }

.keybar { display: grid; grid-template-columns: auto 1fr auto; gap: 6px; align-items: center; }
/* Smart selection: the brush, where it's at, the frames painted on */
.sel-box { display: grid; gap: 10px; }
.sel-box .seg__btn:first-child.is-on { color: var(--ok); }
.sel-box .seg__btn:last-child.is-on { color: var(--err); }
.sel-frames { display: flex; flex-wrap: wrap; gap: 6px; }
.tl__span--tat { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.tat-text { display: grid; gap: 10px; }
.tat-text textarea { resize: vertical; min-height: 64px; }
.fontchips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.fontchip { appearance: none; border: 1px solid var(--line); background: var(--fill); color: var(--text); border-radius: var(--r-sm); padding: 9px 8px; font-size: 19px; line-height: 1.1; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fontchip.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.inks { display: flex; gap: 8px; flex-wrap: wrap; }
.inks .swatch { width: 34px; height: 34px; }
.tat-add { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tat-jumps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
/* a tattoo's shape locked for a stretch (panels.js holdParts; the timeline: .tl__hold) */
.hold { display: grid; gap: 6px; padding: 8px; border-radius: 12px; border: 1px solid var(--line-2); }
.hold.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 .5px var(--accent); }
.hold__head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hold__ico { display: inline-flex; color: var(--accent); }
.hold__when { flex: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.hold .row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hold .btn { white-space: normal; line-height: 1.15; padding: 4px 6px; }
.tl__hold { position: absolute; top: 3px; bottom: 3px; border-radius: 5px; pointer-events: none;
  background: repeating-linear-gradient(135deg, var(--accent) 0 3px, transparent 3px 7px); opacity: .85; }
.rrow__thumb { width: 28px; height: 28px; flex: none; object-fit: contain; border-radius: 6px; background: var(--checker-a); }
.brush-row { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.brush-dot { display: inline-block; flex: none; border-radius: 50%; background: currentColor; opacity: .8; }
.brush-row .seg__btn > span { display: inline-flex; align-items: center; gap: 6px; }
.sel-chip { display: inline-flex; align-items: center; border-radius: 999px; background: var(--fill); border: 1px solid var(--line); overflow: hidden; transition: border-color .15s; }
.sel-chip.is-here { border-color: var(--accent); background: var(--accent-soft); }
.sel-chip__go { appearance: none; border: 0; background: none; cursor: pointer; padding: 6px 2px 6px 11px; font: 600 12.5px/1 inherit; font-family: inherit; color: var(--text); font-variant-numeric: tabular-nums; }
.sel-chip__go small { font-weight: 500; font-size: 11.5px; color: var(--text-2); margin-left: 3px; }
.sel-chip__x { appearance: none; border: 0; background: none; cursor: pointer; display: grid; place-items: center; width: 30px; height: 28px; color: var(--text-3); }
.sel-chip__x:hover { color: var(--err); }
.sel-chip__x svg { width: 13px; height: 13px; }
.tl__fix { position: absolute; top: 2px; bottom: 2px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: #2fd27a; box-shadow: 0 0 0 1px var(--bg); pointer-events: none; z-index: 1; }
.keybar__main { width: 100%; }
.keybar__dia { width: 9px; height: 9px; transform: rotate(45deg); background: currentColor; border-radius: 1.5px; flex: none; }
.keybar__dia.is-on { background: var(--accent); }
/* the picked thing's keyframes, above the timeline (always at hand on a phone, without scrolling the panel) */
.keystrip-wrap { padding: 6px 12px 0; }
.keystrip-wrap[hidden] { display: none; }
.keystrip { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.keystrip .keybar__main { justify-content: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; }
.keystrip .keybar__main.is-on { box-shadow: inset 0 0 0 1.5px var(--accent); }
.keystrip__x { display: inline-flex; margin-left: 4px; opacity: .8; }
.keystrip__x svg { width: 16px; height: 16px; }
.keystrip__what { font-size: 12px; color: var(--text-3); max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.trimrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--fill); }
.trimrow > div { display: grid; }
.trimrow strong { font-variant-numeric: tabular-nums; }

.summary { font-size: 19px; font-weight: 650; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.meta { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.meta li { display: grid; grid-template-columns: 110px 1fr 18px; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--fill); font-size: 13px; }
.meta li > span:first-child { color: var(--text-3); }
.meta__v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta__x { color: var(--ok); }
.meta__x .ico { width: 16px; height: 16px; }
.meta--warn li:first-child { background: var(--warn-soft); }

.export-box { display: grid; gap: 10px; }
.progress { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: var(--r); background: var(--fill); animation: rise .35s var(--ease-out) both; }
.progress > div { display: grid; gap: 2px; }
.ring { width: 44px; height: 44px; display: block; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring__bg { fill: none; stroke: var(--fill-2); stroke-width: 4; }
.ring__fg { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .5s var(--ease); filter: drop-shadow(0 0 4px var(--accent-glow)); }
.done { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--r); background: var(--ok-soft); }
.done > div { display: grid; gap: 1px; min-width: 0; }
.done .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.done__check { width: 40px; height: 40px; border-radius: 50%; background: var(--ok); color: #06150e; display: grid; place-items: center; flex: none; }
.done__check .ico { width: 22px; height: 22px; stroke-width: 3; }
.done.is-new .done__check { animation: pop .6s var(--spring); }
.done.is-new .done__check path { stroke-dasharray: 24; animation: draw .5s .12s var(--ease) both; }
@keyframes draw { from { stroke-dashoffset: 24 } to { stroke-dashoffset: 0 } }

.batch { display: grid; gap: 8px; }
.blist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow: auto; }
.brow { display: flex; align-items: center; gap: 10px; padding: 4px; border-radius: 10px; background: var(--fill); font-size: 13px; }
.brow img { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; flex: none; }
.brow__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apply-all { color: var(--text-2); }

/* sheets (logo picker, preview) */
.sheet { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: var(--scrim); opacity: 0; transition: opacity .25s var(--ease); }
.sheet.in { opacity: 1; }
.sheet.out { opacity: 0; }
.sheet__card { width: min(520px, 100%); max-height: 86dvh; overflow: auto; padding: 18px; border-radius: var(--r-lg); background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); transform: translateY(18px) scale(.97); transition: transform .5s var(--spring); display: grid; gap: 12px; }
.sheet.in .sheet__card { transform: none; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; font-size: 16px; font-weight: 700; }
.logos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.logos__add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed var(--line-2); background: transparent; color: var(--text-2); font-weight: 600; font-size: 13px; cursor: pointer; transition: border-color .2s, color .2s, transform .3s var(--spring); }
.logos__add:hover { border-color: var(--accent); color: var(--text); }
.logos__add:active { transform: scale(.95); }
.logos__item { position: relative; animation: pop .35s var(--spring) both; }
.logos__pick { width: 100%; aspect-ratio: 1; padding: 10px; border-radius: 12px; border: 1.5px solid transparent; background: repeating-conic-gradient(var(--checker-a) 0 25%, var(--checker-b) 0 50%) 0 0 / 14px 14px; cursor: pointer; display: grid; place-items: center; transition: border-color .2s; }
.logos__pick img { max-width: 100%; max-height: 100%; object-fit: contain; }
button.logos__pick:hover { border-color: var(--accent); }
.logos__del { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); display: grid; place-items: center; cursor: pointer; padding: 0; opacity: 0; transition: opacity .15s, transform .3s var(--spring); }
.logos__del .ico { width: 14px; height: 14px; }
.logos__del:active { transform: scale(.85); }
.logos__item:hover .logos__del, .logos__del:focus-visible { opacity: 1; }
@media (pointer: coarse) { .logos__del { opacity: 1; } }
.sheet--dark { background: rgba(0, 0, 0, .86); }
/* what's new (once) */
.wn { gap: 16px; padding: 22px; }
.wn__head { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.wn__spark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); animation: pop .6s .1s var(--spring) both; }
.wn__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.wn__row { display: flex; gap: 12px; align-items: flex-start; animation: rise .5s var(--ease-out) both; }
.wn__row:nth-child(2) { animation-delay: .06s; } .wn__row:nth-child(3) { animation-delay: .12s; } .wn__row:nth-child(4) { animation-delay: .18s; }
.wn__icon { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--fill-2); color: var(--accent); }
.wn__icon .ico { width: 18px; height: 18px; }
.wn__row strong { display: block; font-size: 15px; font-weight: 700; }
.wn__row span span { display: block; color: var(--text-3); font-size: 13.5px; line-height: 1.4; }
.pv { display: grid; gap: 12px; justify-items: center; max-width: 100%; }
.pv__video { max-width: min(92vw, 1000px); max-height: 78dvh; border-radius: var(--r); background: #000; }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
body:has(.tabbar:not([hidden])) .toasts { bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 12px 11px 13px; border-radius: 16px; background: var(--toast-bg); color: var(--toast-ink); font-size: 14px; font-weight: 550; line-height: 1.35;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), var(--shadow); pointer-events: auto; opacity: 0; transform: translateY(16px) scale(.96); transition: opacity .25s var(--ease), transform .5s var(--spring); }
.toast.in { opacity: 1; transform: none; }
.toast.out { opacity: 0; transform: translateY(8px) scale(.98); transition-duration: .2s; }
.toast__icon { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(52, 211, 153, .18); color: #6ee7b7; }
.toast__icon .ico { width: 15px; height: 15px; stroke-width: 2.6; }
.toast--error .toast__icon { background: rgba(251, 113, 133, .2); color: #fda4af; }
.toast__icon--busy { background: rgba(255, 255, 255, .1); color: #fff; }
.toast__icon--busy .spin { width: 13px; height: 13px; }
.confetti { position: fixed; z-index: 100; width: 7px; height: 7px; border-radius: 2px; pointer-events: none; }
.toast__msg { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast__btn { border: 0; background: rgba(255, 255, 255, .14); color: #fff; border-radius: 10px; padding: 7px 12px; font-weight: 700; font-size: 13px; cursor: pointer; flex: none; transition: background .2s; }
.toast__btn:hover { background: rgba(255, 255, 255, .22); }

/* ------------------------------------------------------------ pages (watermarks, account) */
.page__head h1 { margin: 12px 0 6px; font-size: clamp(30px, 5vw, 40px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.04; }
.page__head p { margin: 0 0 22px; max-width: 60ch; color: var(--text-3); }
.page__h2 { margin: 36px 0 6px; font-size: 20px; font-weight: 750; letter-spacing: -0.025em; }
.page > p.muted { margin: 0 0 16px; }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pcard { border-radius: var(--r); overflow: hidden; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: transform .45s var(--spring), box-shadow .3s; }
.pcard.is-new { animation: card-in .55s var(--ease-out) both; animation-delay: calc(min(var(--i, 0), 10) * 40ms); }
.pcard:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow); }
.pcard.is-default { outline: 2px solid var(--accent); outline-offset: -2px; }
.pcard__canvas { width: 100%; height: auto; display: block; aspect-ratio: 16 / 10; }
.pcard__row { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 12px; }
.pcard__name { flex: 1; min-width: 0; border: 0; background: transparent; font-weight: 650; padding: 6px 0; outline: none; border-bottom: 1.5px solid transparent; transition: border-color .2s; }
.pcard__name:focus { border-bottom-color: var(--accent); }
.is-star { color: var(--accent); }
.is-star .ico { fill: var(--accent); }
.empty-card { grid-column: 1 / -1; padding: 28px; text-align: center; border: 1.5px dashed var(--line-2); border-radius: var(--r); color: var(--text-2); display: grid; gap: 12px; justify-items: center; }
.empty-card p { margin: 0; }
.logos--page { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.pwform { display: grid; gap: 8px; max-width: 420px; }
.pwform .btn { justify-self: start; }
.pwform__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* account: grouped rows, like a phone's settings */
.page--narrow { max-width: 680px; }
.profile { display: flex; align-items: center; gap: 14px; margin: 14px 0 24px; animation: rise .5s var(--ease-out) both; }
.avatar { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 22px; color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #7c3aed)); box-shadow: 0 8px 24px -8px var(--accent-glow); }
.avatar--sm { width: 36px; height: 36px; font-size: 15px; box-shadow: none; }
.avatar--muted { background: var(--fill-2); color: var(--text-2); }
.profile > div { min-width: 0; }
.profile h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; overflow-wrap: anywhere; }
.profile p { margin: 2px 0 0; color: var(--text-3); font-size: 13.5px; }
.lgroup { margin-top: 22px; animation: rise .5s var(--ease-out) both; }
.lgroup:nth-of-type(2) { animation-delay: .04s; } .lgroup:nth-of-type(3) { animation-delay: .08s; } .lgroup:nth-of-type(n+4) { animation-delay: .12s; }
.lgroup__title { margin: 0 0 8px 4px; font-size: 12px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.lgroup__note { margin: 8px 4px 0; font-size: 12.5px; color: var(--text-3); }
.list { border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.lrow { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; width: 100%; border: 0; background: none; color: var(--text); text-align: left; font-size: 15px; }
.lrow + .lrow, .lrow + .lrow-more, .lrow-more + .lrow { border-top: 1px solid var(--line); }
button.lrow { cursor: pointer; transition: background .15s; }
button.lrow:hover { background: var(--fill); }
button.lrow:active { background: var(--fill-2); }
.lrow__icon { flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--fill-2); color: var(--text-2); }
.lrow__icon .ico { width: 18px; height: 18px; }
.lrow__text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.lrow__text strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow__text span { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow__end { flex: none; display: flex; align-items: center; gap: 6px; color: var(--text-3); }
.lrow__chev { transition: transform .35s var(--spring); }
.lrow.is-open .lrow__chev { transform: rotate(90deg); }
.lrow--danger { color: var(--danger); }
.lrow--danger .lrow__icon { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--danger); }
.lrow--theme .seg { flex: none; }
.lrow__icon.is-ok { background: var(--ok-soft); color: var(--ok); }
.key-field { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13px; letter-spacing: .02em; }
.lrow-more { padding: 4px 14px 14px; display: grid; gap: 10px; animation: open .35s var(--ease-out) both; }
@keyframes open { from { opacity: 0; transform: translateY(-6px) } to { opacity: 1; transform: none } }
.people .lrow__text strong { display: flex; align-items: center; gap: 6px; }
.person__name { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; background: var(--fill); color: var(--text); font: inherit; font-size: 15px; font-weight: 650; }
.person__name:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.person__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.person__pw { display: flex; gap: 6px; }
.person__pw .input { flex: 1; min-width: 0; }
.person__del { color: var(--danger); }

/* ------------------------------------------------------------ sign in */
body.auth { min-height: 100dvh; display: grid; place-items: center; padding: 20px; overflow: hidden; position: relative; }
.auth__bg { position: fixed; inset: -20%; z-index: -1; pointer-events: none; filter: blur(60px); opacity: .7;
  background: radial-gradient(40% 35% at 30% 30%, var(--accent-soft), transparent 70%), radial-gradient(35% 30% at 70% 65%, color-mix(in srgb, #7c3aed 22%, transparent), transparent 70%);
  animation: aurora 16s ease-in-out infinite alternate; }
@keyframes aurora { 50% { transform: translate(4%, -3%) rotate(8deg) scale(1.08); } 100% { transform: translate(-3%, 4%) rotate(-6deg) scale(1); } }
.auth__card { width: min(380px, 100%); display: grid; gap: 6px; justify-items: center; text-align: center; animation: rise .7s var(--ease-out) both; }
body.auth.is-leaving .auth__card { opacity: 0; transform: scale(.97); transition: all .28s var(--ease); }
.auth__sub { margin: 4px 0 26px; color: var(--text-3); }
.auth__form { width: 100%; display: grid; gap: 14px; text-align: left; padding: 20px; border-radius: 22px; background: color-mix(in srgb, var(--surface) 88%, transparent); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); backdrop-filter: blur(20px); }
.auth__field { display: grid; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.auth__err { margin: 0; min-height: 20px; color: var(--danger); font-size: 13.5px; }
.auth__err:empty { min-height: 0; margin-top: -8px; }
.auth__theme { position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; }
.pw { position: relative; }
.pw .input { padding-right: 46px; }
.pw__eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: none; color: var(--text-3); cursor: pointer; border-radius: 9px; display: grid; place-items: center; }
.pw__eye svg { width: 20px; height: 20px; }
.pw__eye:hover { color: var(--text); }
.shake { animation: shake .4s var(--ease); }
@keyframes shake { 20% { transform: translateX(-8px) } 40% { transform: translateX(7px) } 60% { transform: translateX(-4px) } 80% { transform: translateX(2px) } }

/* ------------------------------------------------------------ moving between screens; switching light / dark */
::view-transition-old(root) { animation: vt-out .16s var(--ease-in) both; }
::view-transition-new(root) { animation: vt-in .34s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
/* the new theme grows as a circle (util.js setTheme), over the old one standing still */
html.is-theming::view-transition-old(root), html.is-theming::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.is-theming::view-transition-new(root) { z-index: 2; }

/* ------------------------------------------------------------ phones + small tablets */
@media (max-width: 899px) {
  .editor {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "top" "center" "side" "tabs";
  }
  .ed-top { padding: max(8px, env(safe-area-inset-top)) 8px 8px; gap: 2px; }
  .ed-title__name { max-width: 34vw; font-size: 14.5px; }
  .ed-export { padding: 0 14px; }
  .ed-tabs { border-left: 0; border-top: 1px solid var(--line); padding: 4px 6px max(6px, env(safe-area-inset-bottom)); background: var(--bg); }
  .ed-tab { font-size: 10.5px; padding: 7px 2px 6px; }
  .ed-tab.is-on { background: none; }
  .ed-tab.is-on::after { content: ""; position: absolute; left: 50%; bottom: 1px; width: 16px; height: 3px; margin-left: -8px; border-radius: 3px; background: var(--accent); animation: pop .4s var(--spring) both; }
  .ed-panel { border-left: 0; border-top: 1px solid var(--line); max-height: 36dvh; }
  .ed-resize { display: none; }
  .ed-panel.is-collapsed { display: none; }
  .ed-panel__body { padding: 0 14px 20px; }
  .psec { padding: 12px 0; }
  .timeline { padding: 0 10px 6px; }
  .tl__view { margin: 0 -10px; }
  .tl__bar { min-height: 36px; }
  .tl__bar .btn { min-height: 34px; }
  .tl__track { height: 38px; }
  .filmstrip { display: none; }
  .stage__before span:not(:first-child), .stage__before { font-size: 0; gap: 0; padding: 8px; }
  .stage__before .ico { width: 18px; height: 18px; }
  .tl__trim { display: none; }
  .stage__before { top: 8px; right: 8px; }
  .stage__fit { top: 8px; left: 8px; padding: 8px 11px 8px 9px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px 8px; }
  .card__name { font-size: 12.5px; }
  .card__left { font-size: 11.5px; }
  .hero { margin: 4px 0 14px; }
  .quick { grid-template-columns: minmax(0, 1fr) 118px; }
  .newproj { min-height: 84px; padding: 14px; gap: 12px; }
  .newproj__icon { width: 48px; height: 48px; border-radius: 14px; }
  .newproj__text strong { font-size: 17px; }
  .qtile { min-height: 84px; padding: 12px; }
}
@media (max-width: 420px) {
  .ed-export span:last-child { display: none; }
  .ed-export { width: 42px; padding: 0; }
  .shapes { grid-template-columns: repeat(4, 1fr); }
  .shape__sub { display: none; }
  .group__actions .btn span:not(:first-child) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
}

/* ------------------------------------------------------------ one video from several clips (CapCut style) */
body[data-view="seq"] { overflow: hidden; }
html:has(body[data-view="seq"]), body[data-view="seq"] { overscroll-behavior: none; }
.sq-ed { position: relative; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto auto; background: var(--bg); overflow: hidden; }
.sq-ed > .ed-top { grid-area: auto; }
.sq-stage { position: relative; min-height: 0; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(120% 120% at 50% 40%, var(--stage-2), var(--stage) 70%); transition: padding .3s var(--ease); }
.sq-cv { display: block; border-radius: 4px; box-shadow: 0 18px 60px rgba(0, 0, 0, .5); touch-action: none; }
.sq-ed:not(.is-loading) .stage__loading { opacity: 0; }
.sq-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--text-3); text-align: center; animation: rise .5s var(--ease-out) both; }
.sq-empty[hidden] { display: none; }
.sq-empty > span .ico { width: 34px; height: 34px; }
.sq-empty p { margin: 0 0 6px; }
.sq-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 2px 10px; min-height: 46px; background: var(--bg); }
.sq-time { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 550; color: var(--text-2); }
.sq-play .ico { width: 24px; height: 24px; }
.sq-bar__r { justify-self: end; display: flex; gap: 2px; }
.sq-tl { position: relative; height: 94px; background: var(--bg-2); border-top: 1px solid var(--line); touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; overflow: hidden; }
.sq-tl:active { cursor: grabbing; }
.sq-tl__cv { position: absolute; left: 0; top: 0; display: block; }
.sq-tl__head { position: absolute; left: 50%; top: 21px; bottom: 6px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--sel); box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); pointer-events: none; z-index: 2; }
.sq-tl__add { position: absolute; right: 10px; top: 35px; z-index: 3; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 11px;
  background: var(--sel); color: var(--sel-ink); cursor: pointer; box-shadow: -16px 0 18px 4px var(--bg-2); transition: transform .3s var(--spring); }
.sq-tl__add .ico { width: 22px; height: 22px; stroke-width: 2.4; }
.sq-tl__add:active { transform: scale(.9); }
.sq-tools { display: flex; gap: 0; padding: 6px 6px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); overflow-x: auto; scrollbar-width: none; }
.sq-tool { flex: 1 0 auto; min-width: 48px; white-space: nowrap; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px 7px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text-2); font-size: 11px; font-weight: 650; cursor: pointer; transition: color .2s, background .2s; }
.sq-tool:hover { color: var(--text); background: var(--fill); }
.sq-tool:disabled { opacity: .35; pointer-events: none; }
.sq-tool .ico { transition: transform .4s var(--spring); }
.sq-tool:active .ico { transform: scale(.84); }
.sq-tool--done { flex: 0 0 46px; justify-content: center; color: var(--text); }
.sq-tools.is-fresh .sq-tool { animation: rise .32s var(--ease-out) both; }
.sq-tools.is-fresh .sq-tool:nth-child(2) { animation-delay: .02s; } .sq-tools.is-fresh .sq-tool:nth-child(3) { animation-delay: .04s; } .sq-tools.is-fresh .sq-tool:nth-child(4) { animation-delay: .06s; }
.sq-tools.is-fresh .sq-tool:nth-child(5) { animation-delay: .08s; } .sq-tools.is-fresh .sq-tool:nth-child(n+6) { animation-delay: .1s; }
.sq-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; width: min(600px, 100%); margin: 0 auto; max-height: 60%; display: flex; flex-direction: column;
  padding: 8px 16px max(14px, env(safe-area-inset-bottom)); background: var(--bg-2); border-radius: 22px 22px 0 0;
  box-shadow: 0 0 0 1px var(--line), var(--sheet-shadow); animation: sheet-up .5s var(--spring) both; }
.sq-sheet::before { content: ""; width: 36px; height: 4px; margin: 0 auto 6px; border-radius: 4px; background: var(--line-2); flex: none; }
@keyframes sheet-up { from { opacity: .4; transform: translateY(70px) } to { opacity: 1; transform: none } }
.sq-sheet__head { display: flex; align-items: center; justify-content: space-between; font-size: 17px; font-weight: 750; letter-spacing: -0.015em; margin-bottom: 6px; }
.sq-sheet__body { overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 10px; padding-bottom: 4px; }
.sq-sheet__body .field-label { margin: 4px 0 -4px; }
.sq-note { margin: 0; }
.sq-incoming { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px);
  padding: 8px 14px; border-radius: 999px; background: var(--toast-bg); color: var(--toast-ink); font-size: 13px; box-shadow: var(--shadow-sm); }
.sq-incoming[hidden] { display: none; }
.pick__up { margin-bottom: 4px; }
.pick__grid > .empty { grid-column: 1 / -1; }
/* transitions: a little picture of each (A grey, B the accent colour) */
.sq-trans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 520px) { .sq-trans { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.sq-trans__b { display: grid; justify-items: center; gap: 5px; padding: 8px 2px 7px; border-radius: var(--r-sm); background: var(--fill); color: var(--text-2);
  font: inherit; font-size: 11.5px; line-height: 1.15; text-align: center; border: 0; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; min-width: 0; }
.sq-trans__b.is-on { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 2px var(--accent); }
.sq-trans__ic { position: relative; width: 40px; height: 26px; border-radius: 5px; overflow: hidden; background: var(--fill-2);
  box-shadow: inset 0 0 0 1px var(--line-2); color: var(--accent-ink); font-size: 15px; font-weight: 800; line-height: 26px; }
.sq-trans__ic--cut { background: linear-gradient(90deg, var(--fill-2) 50%, var(--accent) 50%); }
.sq-trans__ic--fade { background: linear-gradient(90deg, var(--fill-2), var(--accent)); }
.sq-trans__ic--blur { background: linear-gradient(90deg, var(--fill-2) 25%, var(--accent) 75%); filter: blur(2.5px); }
.sq-trans__ic--fadeblack { background: linear-gradient(90deg, var(--fill-2), #000 50%, var(--accent)); }
.sq-trans__ic--fadewhite { background: linear-gradient(90deg, var(--fill-2), #fff 50%, var(--accent)); }
.sq-trans__ic--slideleft, .sq-trans__ic--wipeleft { background: linear-gradient(90deg, var(--fill-2) 45%, var(--accent) 45%); }
.sq-trans__ic--slideright, .sq-trans__ic--wiperight { background: linear-gradient(90deg, var(--accent) 55%, var(--fill-2) 55%); }
.sq-trans__ic--slideup { background: linear-gradient(180deg, var(--fill-2) 45%, var(--accent) 45%); }
.sq-trans__ic--slidedown { background: linear-gradient(180deg, var(--accent) 55%, var(--fill-2) 55%); }
.sq-trans__ic--circleopen { background: radial-gradient(circle, var(--accent) 38%, var(--fill-2) 40%); }
.sq-trans__ic--zoomin { background: radial-gradient(circle, var(--fill-2) 22%, var(--accent) 24%, var(--accent) 34%, var(--fill-2) 36%); }
.sq-trans__ic--slideleft::after { content: "\2190"; } .sq-trans__ic--slideright::after { content: "\2192"; }
.sq-trans__ic--slideup::after { content: "\2191"; } .sq-trans__ic--slidedown::after { content: "\2193"; }
.sq-trans__ic--wipeleft::after, .sq-trans__ic--wiperight::after { content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); }
.sq-trans__ic--wipeleft::after { left: 45%; } .sq-trans__ic--wiperight::after { left: 55%; }
@media (max-width: 420px) { .sq-ed .ed-export span:last-child { display: none; } .sq-ed .ed-export { width: 42px; padding: 0; } }

/* picking clips */
.pick { position: fixed; inset: 0; z-index: 90; display: grid; align-items: end; justify-items: center; background: var(--scrim); animation: fade .25s var(--ease) both; }
@keyframes fade { from { opacity: 0 } }
.pick__panel { width: min(720px, 100%); max-height: 88dvh; display: flex; flex-direction: column; background: var(--bg-2); box-shadow: 0 0 0 1px var(--line), var(--shadow);
  border-radius: 22px 22px 0 0; padding: 14px 14px max(14px, env(safe-area-inset-bottom)); animation: sheet-up .5s var(--spring) both; }
.pick__head { display: flex; align-items: center; justify-content: space-between; font-size: 17px; font-weight: 750; }
.pick__note { margin: 2px 0 10px; }
.pick__grid { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; padding-bottom: 8px; }
.pick__card { position: relative; display: grid; padding: 0; border: 0; border-radius: 12px; background: var(--fill); overflow: hidden; cursor: pointer; text-align: left; color: var(--text); box-shadow: inset 0 0 0 2px transparent; transition: transform .3s var(--spring), box-shadow .2s; animation: pop .35s var(--spring) both; }
.pick__card:active { transform: scale(.95); }
.pick__card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.pick__card.is-on { box-shadow: 0 0 0 2.5px var(--accent); }
.pick__num { position: absolute; top: 6px; right: 6px; min-width: 26px; height: 26px; display: grid; place-items: center; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 13px; animation: pop .35s var(--spring) both; }
.pick__meta { position: absolute; left: 6px; top: 6px; padding: 2px 7px; border-radius: 7px; background: var(--on-media); color: #fff; font-size: 11.5px; font-weight: 650; }
.pick__name { padding: 6px 8px 7px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick__foot { padding-top: 10px; }
@media (min-width: 900px) { .pick { align-items: center; } .pick__panel { border-radius: 22px; } }

/* Snap (admins only): a card per caption */
.snap-cap { display: grid; gap: 8px; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-2); }
.snap-cap__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.snap-cap .sl { margin: 0; }
