/* ---------- theme tokens ---------- */
:root, [data-theme="studio"] {
  --bg: #0d0e12; --bg-2: #13151b; --surface: #191c24; --surface-2: #20242e; --line: #2a2e3a; --line-2: #383d4c;
  --text: #eceef3; --muted: #9aa0ae; --faint: #6b7180;
  --accent: #8b7bff; --accent-2: #4fd1c5; --accent-ink: #0d0e12;
  --ok: #3ecf8e; --warn: #f5b84a; --danger: #ff5d5d; --info: #6aa8ff;
  --radius: 12px; --radius-sm: 8px;
  --font-body: "Inter", system-ui, sans-serif; --font-head: "Inter", system-ui, sans-serif; --head-weight: 700;
  --pattern: none; --card-border: 1px solid var(--line); --card-shadow: 0 1px 0 rgba(255,255,255,.03) inset;
  --btn-shadow: none; --glow: none; --tc: var(--accent-2); --stage: #000;
  color-scheme: dark;
}

/* Studio: the default look. Deep ink, violet + teal aurora, soft glass, glow on the things that matter. */
:root:not([data-theme]), [data-theme="studio"] {
  --bg: #0a0b10; --bg-2: #11131a; --surface: #161923; --surface-2: #1e222e; --line: #232736; --line-2: #343a4f;
  --text: #f1f2f8; --muted: #9ca3b4; --faint: #6b7384;
  --radius: 14px; --radius-sm: 9px; --head-weight: 800;
  --pattern:
    radial-gradient(900px 520px at 12% -8%, rgba(139,123,255,.20), transparent 65%),
    radial-gradient(800px 520px at 92% 0%, rgba(79,209,197,.11), transparent 65%),
    radial-gradient(1000px 600px at 50% 125%, rgba(139,123,255,.09), transparent 70%);
  --card-border: 1px solid #232736;
  --card-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 20px 44px -28px rgba(0,0,0,.9);
  --btn-shadow: 0 10px 30px -12px rgba(139,123,255,.85);
}
:root:not([data-theme]) h1, :root:not([data-theme]) h2, [data-theme="studio"] h1, [data-theme="studio"] h2 { letter-spacing: -.025em; }
[data-theme="studio"] .btn { transition: transform .18s, box-shadow .2s, filter .2s, border-color .2s; }
[data-theme="studio"] .btn:hover { transform: translateY(-1px); }
[data-theme="studio"] .btn.primary { background: linear-gradient(180deg, #a094ff, #8b7bff 55%, #7260f2); color: #0a0b10; box-shadow: var(--btn-shadow), 0 0 0 1px rgba(255,255,255,.14) inset; }
[data-theme="studio"] .btn.primary:hover { box-shadow: 0 14px 38px -10px rgba(139,123,255,.95), 0 0 0 1px rgba(255,255,255,.2) inset; filter: brightness(1.06); }
[data-theme="studio"] .topbar, [data-theme="studio"] .appbar { background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid transparent; border-image: linear-gradient(90deg, transparent, rgba(139,123,255,.45), rgba(79,209,197,.35), transparent) 1; }
[data-theme="studio"] .rail { background: color-mix(in srgb, var(--bg-2) 80%, transparent); backdrop-filter: blur(14px); }
[data-theme="studio"] .card { background: linear-gradient(165deg, color-mix(in srgb, var(--surface) 94%, #8b7bff), var(--surface) 55%); transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .25s, box-shadow .25s; }
[data-theme="studio"] .ptile:hover, [data-theme="studio"] .pcard:hover { border-color: rgba(139,123,255,.6); box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 28px 60px -26px rgba(139,123,255,.55); }
[data-theme="studio"] .tabs button.on { background: linear-gradient(180deg, rgba(139,123,255,.28), rgba(139,123,255,.14)); box-shadow: 0 0 0 1px rgba(139,123,255,.45) inset; color: var(--text); }
[data-theme="studio"] .modal { border: 1px solid #343a4f; box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 40px 120px -30px rgba(0,0,0,.9), 0 0 80px -40px rgba(139,123,255,.55); }
[data-theme="studio"] .menu { backdrop-filter: blur(18px) saturate(1.4); background: color-mix(in srgb, var(--surface) 86%, transparent); box-shadow: 0 24px 60px -20px rgba(0,0,0,.85); }
[data-theme="studio"] :focus-visible { outline: 2px solid rgba(139,123,255,.9); outline-offset: 2px; }
[data-theme="studio"] ::selection { background: rgba(139,123,255,.45); }
[data-theme="studio"] .proj-count, [data-theme="studio"] .page-head h1 { letter-spacing: -.02em; }
[data-theme="studio"] ::-webkit-scrollbar { width: 10px; height: 10px; } [data-theme="studio"] ::-webkit-scrollbar-thumb { background: #2b3045; border-radius: 10px; border: 2px solid var(--bg); } [data-theme="studio"] ::-webkit-scrollbar-thumb:hover { background: #3a4160; }

/* Web Slinger: night-city navy, signal red and electric blue, hand-drawn web lines. Original artwork, no characters or logos. */
[data-theme="webslinger"] {
  --bg: #080c1d; --bg-2: #0d1330; --surface: #111a3d; --surface-2: #17224d; --line: #22306a; --line-2: #2f4190;
  --text: #f2f4ff; --muted: #a6b0d6; --faint: #6f7bab;
  --accent: #e5232f; --accent-2: #3d7bff; --accent-ink: #fff;
  --font-head: "Anton", "Inter", sans-serif; --head-weight: 400;
  --pattern:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='520' viewBox='0 0 520 520'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.13' stroke-width='1.4'%3E%3Cpath d='M260 0V520M0 260H520M76 76L444 444M444 76L76 444'/%3E%3Cpath d='M260 60Q300 120 401 119Q380 210 460 260Q380 310 401 401Q300 400 260 460Q220 400 119 401Q140 310 60 260Q140 210 119 119Q220 120 260 60Z'/%3E%3Cpath d='M260 130Q285 170 352 168Q338 225 390 260Q338 295 352 352Q285 350 260 390Q235 350 168 352Q182 295 130 260Q182 225 168 168Q235 170 260 130Z'/%3E%3Cpath d='M260 195Q272 215 306 214Q299 240 325 260Q299 280 306 306Q272 305 260 325Q248 305 214 306Q221 280 195 260Q221 240 214 214Q248 215 260 195Z'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(1200px 700px at 90% -10%, rgba(229,35,47,.38), transparent 60%),
    radial-gradient(1000px 700px at -10% 110%, rgba(61,123,255,.36), transparent 60%);
  --card-border: 1px solid var(--line); --card-shadow: 0 10px 30px -18px rgba(229,35,47,.6);
  --btn-shadow: 0 6px 18px -8px rgba(229,35,47,.8); --tc: #7fb0ff;
}

/* Comic Vault: printed-comic paper, halftone dots, heavy ink panels and offset shadows. Light theme. */
[data-theme="comicvault"] {
  --bg: #f4ecdc; --bg-2: #fff8ea; --surface: #fffdf6; --surface-2: #f6edda; --line: #141414; --line-2: #141414;
  --text: #141414; --muted: #514a3d; --faint: #85796a;
  --accent: #e3222b; --accent-2: #1660d6; --accent-ink: #fff;
  --ok: #0f9d58; --warn: #f2b705; --danger: #e3222b; --info: #1660d6;
  --radius: 4px; --radius-sm: 3px;
  --font-head: "Bangers", "Impact", sans-serif; --head-weight: 400;
  --pattern:
    radial-gradient(circle at 1px 1px, rgba(227,34,43,.16) 1.4px, transparent 1.6px) 0 0 / 11px 11px,
    linear-gradient(180deg, #f8f0df, #efe3c9);
  --card-border: 3px solid #141414; --card-shadow: 5px 5px 0 #141414;
  --btn-shadow: 3px 3px 0 #141414; --tc: #1660d6; --stage: #141414;
  color-scheme: light;
}

/* Armor HUD: hot-rod red and gold plating with a cyan heads-up display. */
[data-theme="armorhud"] {
  --bg: #090506; --bg-2: #120809; --surface: #1a0b0d; --surface-2: #241012; --line: #4a2a18; --line-2: #7a5326;
  --text: #fbefe3; --muted: #c9ab8f; --faint: #8a6f58;
  --accent: #c8102e; --accent-2: #f2c14e; --accent-ink: #fff;
  --ok: #4ff0c0; --info: #5ee7ff;
  --radius: 6px; --radius-sm: 4px;
  --font-body: "Rajdhani", "Inter", sans-serif; --font-head: "Orbitron", "Inter", sans-serif; --head-weight: 700;
  --pattern:
    linear-gradient(rgba(94,231,255,.05) 1px, transparent 1px) 0 0 / 100% 4px,
    linear-gradient(90deg, rgba(94,231,255,.045) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(rgba(94,231,255,.045) 1px, transparent 1px) 0 0 / 48px 48px,
    radial-gradient(800px 500px at 50% -10%, rgba(200,16,46,.28), transparent 70%);
  --card-border: 1px solid #6b4520; --card-shadow: 0 0 0 1px rgba(242,193,78,.08) inset, 0 12px 30px -20px rgba(94,231,255,.5);
  --btn-shadow: 0 0 18px -4px rgba(200,16,46,.9); --glow: 0 0 12px rgba(94,231,255,.55); --tc: #5ee7ff;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--pattern), var(--bg); background-attachment: fixed;
  color: var(--text); font: 15px/1.5 var(--font-body); -webkit-font-smoothing: antialiased;
}
[data-theme="armorhud"] body { font-size: 16px; font-weight: 500; }
h1, h2, h3 { font-family: var(--font-head); font-weight: var(--head-weight); margin: 0; line-height: 1.15; letter-spacing: 0; }
[data-theme="comicvault"] h1, [data-theme="comicvault"] h2 { letter-spacing: .01em; }
[data-theme="armorhud"] h1, [data-theme="armorhud"] h2, [data-theme="armorhud"] h3 { text-transform: uppercase; font-size: .92em; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.row { display: flex; align-items: center; gap: 10px; } .grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px;
  border-radius: var(--radius-sm); border: var(--card-border); background: var(--surface); cursor: pointer;
  font-weight: 600; font-size: 14px; white-space: nowrap; transition: transform .12s, background .15s, border-color .15s; text-decoration: none;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: var(--btn-shadow); }
[data-theme="comicvault"] .btn.primary { border: 3px solid #141414; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface); }
.btn.danger { color: var(--danger); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 17px; height: 17px; flex: none; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 600; }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--radius-sm); border: var(--card-border);
  background: var(--bg-2); outline: none;
}
textarea.input { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
[data-theme="comicvault"] .topbar { border-bottom: 3px solid #141414; background: #fff8ea; }
[data-theme="armorhud"] .topbar { border-bottom: 1px solid #6b4520; box-shadow: 0 1px 0 rgba(94,231,255,.25); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-head); font-size: 20px; font-weight: var(--head-weight); }
.brand .mark { width: 30px; height: 30px; flex: none; }
.nav { display: flex; gap: 4px; margin-left: 10px; }
.nav a { padding: 7px 12px; border-radius: var(--radius-sm); text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.nav a.on, .nav a:hover { color: var(--text); background: var(--surface); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-weight: 700; font-size: 13px; color: #fff; background: var(--accent-2); overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 24px; height: 24px; font-size: 11px; }
.page { max-width: 1320px; margin: 0 auto; padding: 28px 20px 80px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; }
[data-theme="comicvault"] .page-head h1 { font-size: 40px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { text-decoration: none; } .crumbs a:hover { color: var(--text); }

.trial-bar {
  display: flex; align-items: center; gap: 14px; padding: 6px 20px; min-height: 44px; font-size: 14px;
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-2)); border-bottom: 1px solid var(--line);
}

/* menus, modals, toasts */
.menu {
  position: absolute; z-index: 60; min-width: 200px; padding: 6px; border-radius: var(--radius); border: var(--card-border);
  background: var(--surface); box-shadow: 0 18px 50px -12px rgba(0,0,0,.6);
}
[data-theme="comicvault"] .menu { box-shadow: 5px 5px 0 #141414; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: var(--radius-sm); cursor: pointer; text-align: left; font-size: 14px; text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--surface-2); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .label { padding: 6px 10px 4px; font-size: 12px; color: var(--faint); font-weight: 600; }
.backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal {
  width: min(540px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: calc(var(--radius) + 4px); border: var(--card-border);
  background: var(--bg-2); padding: 24px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.7); display: grid; gap: 16px;
}
[data-theme="comicvault"] .modal { box-shadow: 8px 8px 0 #141414; }
.modal h2 { font-size: 22px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; }
.toast { padding: 10px 16px; border-radius: var(--radius-sm); background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: rise .2s; }
.toast.err { background: var(--danger); color: #fff; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* cards & grids */
.card { background: var(--surface); border: var(--card-border); border-radius: var(--radius); box-shadow: var(--card-shadow); }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pcard { display: block; text-decoration: none; overflow: hidden; transition: transform .15s, border-color .15s; }
.pcard:hover { transform: translateY(-2px); border-color: var(--accent); }
.pcard .cover { aspect-ratio: 16/9; background: var(--bg-2) center/cover no-repeat; display: grid; place-items: center; color: var(--faint); position: relative; }
[data-theme="comicvault"] .pcard .cover { border-bottom: 3px solid #141414; }
.pcard .body { padding: 14px 16px 16px; display: grid; gap: 6px; }
.pcard h3 { font-size: 17px; }
.stats { display: flex; gap: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.stats b { color: var(--text); font-weight: 700; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); display: grid; gap: 14px; justify-items: center; }
.empty h2 { color: var(--text); font-size: 22px; }

/* asset cards */
.acard { overflow: hidden; position: relative; }
.acard .thumb { aspect-ratio: 16/9; background: #000 center/contain no-repeat; position: relative; cursor: pointer; display: grid; place-items: center; color: #888; }
[data-theme="comicvault"] .acard .thumb { border-bottom: 3px solid #141414; }
.acard .scrub { position: absolute; inset: 0; background-repeat: no-repeat; background-color: #000; opacity: 0; }
.acard .thumb:hover .scrub { opacity: 1; }
.acard .scrubline { position: absolute; bottom: 0; width: 2px; top: 0; background: var(--accent); opacity: 0; pointer-events: none; }
.acard .thumb:hover .scrubline { opacity: 1; }
.badge { position: absolute; padding: 2px 7px; border-radius: 5px; font-size: 12px; font-weight: 700; background: rgba(0,0,0,.72); color: #fff; }
.badge.tl { top: 8px; left: 8px; } .badge.br { bottom: 8px; right: 8px; } .badge.tr { top: 8px; right: 8px; }
.badge.accent { background: var(--accent); color: var(--accent-ink); }
.acard .body { padding: 12px 14px 14px; display: grid; gap: 8px; }
.acard .name { font-weight: 700; font-size: 15px; }
.acard.dropping { outline: 3px dashed var(--accent); outline-offset: 3px; position: relative; }
.acard.dropping::after { content: attr(data-drop); position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 30%, transparent); color: #fff; font-weight: 700; border-radius: inherit; pointer-events: none; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.acard.dragging { opacity: .45; }
.progress { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }

.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.in_progress::before { background: var(--info); }
.status.needs_review::before { background: var(--warn); }
.status.changes_requested::before { background: var(--danger); }
.status.approved::before { background: var(--ok); }
select.status-select { height: 30px; padding: 0 8px; border-radius: var(--radius-sm); border: var(--card-border); background: var(--bg-2); font-size: 13px; font-weight: 600; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 7px 12px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 600; cursor: pointer; font-size: 14px; }
.tabs button.on { background: var(--surface); color: var(--text); }
[data-theme="comicvault"] .tabs button.on { background: #141414; color: #fff; }

.dropzone-overlay {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; pointer-events: none;
  background: color-mix(in srgb, var(--accent) 18%, rgba(0,0,0,.6)); border: 4px dashed var(--accent);
  font-family: var(--font-head); font-size: 34px; color: #fff;
}

.uploads { position: fixed; right: 18px; bottom: 18px; z-index: 50; width: 340px; max-height: 50vh; overflow: auto; padding: 12px; display: grid; gap: 10px; }
.uploads .item { display: grid; gap: 6px; font-size: 13px; }

/* ---------- review ---------- */
.review { display: grid; grid-template-columns: minmax(0, 1fr) 380px; height: calc(100vh - 60px); }
.review.share-mode { height: calc(100vh - 60px); }
.has-trial .review { height: calc(100vh - 104px); }
.rv-main { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; min-width: 0; min-height: 0; }
.rv-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rv-head h2 { font-size: 18px; }
.stage { position: relative; background: var(--stage); min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); overflow: hidden; }
.stage.split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2px; }
.pane { position: relative; min-width: 0; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.pane video, .pane > img, .zoomer > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.pane audio { width: 100%; }
.pane .tag { position: absolute; top: 10px; left: 10px; z-index: 4; }
.stage.wipe .pane { grid-area: 1 / 1; }
.stage.wipe .pane.b { clip-path: inset(0 0 0 var(--wipe, 50%)); }
.wipe-handle { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; z-index: 6; left: var(--wipe, 50%); cursor: ew-resize; }
.wipe-handle::after { content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; background: #fff; color: #000; display: grid; place-items: center; font-weight: 700; }
.draw-layer, .show-layer { position: absolute; z-index: 3; pointer-events: none; }
.draw-layer.active { pointer-events: auto; cursor: crosshair; }
.guides { position: absolute; z-index: 2; pointer-events: none; }
.guides .safe { position: absolute; border: 1px dashed rgba(255,255,255,.55); }
.guides .shade { position: absolute; background: rgba(255,60,60,.18); }
.guides .glabel { position: absolute; top: auto; bottom: calc(100% + 4px); left: 0; white-space: nowrap; z-index: 2; font: 600 11px var(--font-body); color: #fff; background: rgba(0,0,0,.55); padding: 2px 6px; border-radius: 4px; }
.audio-art { display: grid; gap: 18px; place-items: center; color: #aaa; padding: 30px; width: 100%; }
.unplayable { display: grid; gap: 12px; place-items: center; text-align: center; padding: 30px; color: #ccc; max-width: 460px; }

.controls { display: flex; align-items: center; gap: 6px; padding: 8px 12px 4px; flex-wrap: wrap; }
.controls .tc { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; color: var(--tc); text-shadow: var(--glow); min-width: 110px; }
.controls .spacer { flex: 1; }
.controls select { height: 30px; border-radius: var(--radius-sm); border: var(--card-border); background: var(--bg-2); font-size: 13px; padding: 0 6px; }
.timeline-wrap { padding: 6px 16px 14px; }
.timeline { position: relative; height: 34px; cursor: pointer; touch-action: none; }
.timeline .track { position: absolute; left: 0; right: 0; top: 20px; height: 6px; border-radius: 3px; background: var(--line); }
.timeline .buffered { position: absolute; left: 0; top: 20px; height: 6px; border-radius: 3px; background: var(--line-2); }
.timeline .played { position: absolute; left: 0; top: 20px; height: 6px; border-radius: 3px; background: var(--accent); }
.timeline .loop { position: absolute; top: 18px; height: 10px; border: 2px solid var(--accent-2); border-radius: 4px; pointer-events: none; }
.timeline .head { position: absolute; top: 14px; width: 14px; height: 18px; margin-left: -7px; border-radius: 4px; background: var(--text); box-shadow: 0 0 0 2px var(--bg); pointer-events: none; }
.timeline .mk { position: absolute; top: 0; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; border: 2px solid var(--bg); cursor: pointer; z-index: 2; }
.timeline .mk.resolved { opacity: .35; }
.timeline .mkr { position: absolute; top: 5px; height: 4px; border-radius: 2px; opacity: .65; pointer-events: none; }
.timeline .hover-prev { position: absolute; bottom: 40px; transform: translateX(-50%); z-index: 10; pointer-events: none; display: grid; gap: 4px; justify-items: center; }
.timeline .hover-prev .img { width: 180px; aspect-ratio: 16/9; border-radius: 6px; background: #000 no-repeat; border: 2px solid var(--line-2); }
.timeline .hover-prev span { font: 12px ui-monospace, Menlo, monospace; background: rgba(0,0,0,.8); color: #fff; padding: 2px 6px; border-radius: 4px; }

.rv-side { border-left: 1px solid var(--line); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; background: color-mix(in srgb, var(--bg-2) 85%, transparent); }
[data-theme="comicvault"] .rv-side { border-left: 3px solid #141414; }
.rv-side .side-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.clist { overflow: auto; padding: 8px; display: grid; align-content: start; gap: 6px; }
.cmt { padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid transparent; display: grid; gap: 6px; cursor: pointer; }
.cmt:hover { background: var(--surface); }
.cmt.on { background: var(--surface); border-color: var(--accent); }
.cmt.resolved .text { opacity: .55; text-decoration: line-through; text-decoration-color: var(--faint); }
.cmt .meta { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.cmt .meta b { font-weight: 700; }
.cmt .meta svg { width: 14px; height: 14px; }
.cmt .text { white-space: pre-wrap; word-wrap: break-word; font-size: 14px; }
.cmt .tcchip { font: 600 12px ui-monospace, Menlo, monospace; color: var(--tc); background: color-mix(in srgb, var(--tc) 14%, transparent); padding: 1px 6px; border-radius: 4px; }
.cmt .client { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 24%, var(--surface)); color: var(--text); }
[data-theme="comicvault"] .cmt .client { color: #fff; background: var(--accent); }
.cmt .acts { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.cmt:hover .acts, .cmt.on .acts { opacity: 1; }
.cmt .replies { display: grid; gap: 8px; margin: 4px 0 0 12px; padding-left: 12px; border-left: 2px solid var(--line); }
.cmt .reply-box { display: flex; gap: 6px; margin-top: 4px; }
.composer { border-top: 1px solid var(--line); padding: 12px; display: grid; gap: 8px; }
.composer .chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--muted); }
.chip.on { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: var(--accent); color: var(--text); }
.drawbar { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--surface); }
.drawbar .btn.on { background: var(--accent); color: var(--accent-ink); }
.swatch { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch.on { border-color: var(--text); }
.kbd { font: 600 12px ui-monospace, Menlo, monospace; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--surface); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }

/* settings */
.settings { display: grid; gap: 22px; max-width: 860px; }
.section { padding: 22px; display: grid; gap: 16px; }
.section h2 { font-size: 19px; }
.theme-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.theme-card { border-radius: var(--radius); overflow: hidden; cursor: pointer; border: 2px solid var(--line); background: none; padding: 0; text-align: left; }
.theme-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.theme-card .sw { height: 84px; position: relative; }
.theme-card .nm { padding: 9px 12px; font-weight: 700; font-size: 14px; background: var(--surface); }
.member { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.feed { display: grid; gap: 2px; }
.feed .ev { display: flex; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; align-items: baseline; }
.feed .ev:hover { background: var(--surface); }
.share-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); align-items: center; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.assetpick { max-height: 190px; overflow: auto; display: grid; gap: 6px; padding: 10px; border: var(--card-border); border-radius: var(--radius-sm); background: var(--bg-2); }

/* share hero */
.share-hero { padding: 34px 20px 10px; max-width: 1320px; margin: 0 auto; display: grid; gap: 6px; }
.share-hero h1 { font-size: clamp(30px, 5vw, 52px); }
.lock { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 20px; }

@media (max-width: 980px) {
  .review { grid-template-columns: 1fr; height: auto; }
  .rv-main { grid-template-rows: auto 56vw auto auto; }
  .rv-side { border-left: 0; border-top: 1px solid var(--line); min-height: 60vh; }
  .nav { display: none; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .page { padding: 20px 16px 60px; }
  .uploads { left: 12px; right: 12px; width: auto; }
}

/* standalone icons outside buttons */
.lock svg, .empty > svg, .unplayable > svg, .pcard .cover > svg, .acard .thumb > svg, .audio-art > svg { width: 40px; height: 40px; opacity: .7; }

/* Mock Reels overlay. Sizes use container units so it scales with the video. */
.guides { container-type: size; }
.igui { position: absolute; inset: 0; color: #fff; font-family: -apple-system, "Inter", sans-serif; text-shadow: 0 1px 3px rgba(0,0,0,.6); pointer-events: none; }
.igui svg { width: 100%; height: 100%; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.ig-top { position: absolute; top: 3.2cqh; left: 4.5cqw; right: 4.5cqw; display: flex; justify-content: space-between; align-items: center; font-size: 4.2cqw; }
.ig-top span { width: 6cqw; height: 6cqw; }
.ig-rail { position: absolute; right: 2.6cqw; bottom: 13cqh; width: 10cqw; display: flex; flex-direction: column; align-items: center; gap: 2.4cqh; }
.ig-btn { display: grid; justify-items: center; gap: .5cqh; }
.ig-btn span { width: 7.2cqw; height: 7.2cqw; }
.ig-btn small { font-size: 2.6cqw; font-weight: 600; }
.ig-audio-sq { width: 7cqw; height: 7cqw; border-radius: 1.4cqw; border: .5cqw solid #fff; background: linear-gradient(135deg, #888, #333); }
.ig-bottom { position: absolute; left: 4cqw; right: 17cqw; bottom: 4.6cqh; display: grid; gap: 1.1cqh; font-size: 3.3cqw; }
.ig-user { display: flex; align-items: center; gap: 2.2cqw; }
.ig-av { width: 7cqw; height: 7cqw; border-radius: 50%; background: linear-gradient(135deg, #f9a, #a7f); border: .4cqw solid #fff; flex: none; }
.ig-follow { border: .3cqw solid rgba(255,255,255,.85); border-radius: 1.5cqw; padding: .3cqh 2.2cqw; font-weight: 600; font-size: 3cqw; }
.ig-cap { line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ig-music { font-size: 2.9cqw; opacity: .95; }
.ig-progress { position: absolute; left: 0; right: 0; bottom: 0; height: .35cqh; background: rgba(255,255,255,.35); }
.guides .safe { border-color: rgba(255,255,255,.7); }

/* Batch 1: reactions, mentions, team-only notes, reference images */
.cmt .text .mention { color: var(--accent); font-weight: 600; }
.cmt.internal { background: color-mix(in srgb, var(--warn) 9%, transparent); }
.teamonly { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--warn); }
.teamonly svg { width: 12px !important; height: 12px !important; }
.reacts { display: flex; gap: 4px; flex-wrap: wrap; }
.react { height: 24px; padding: 0 7px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; font-size: 12.5px; cursor: pointer; display: inline-flex; align-items: center; color: var(--text); }
.react.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.react.add { opacity: 0; transition: opacity .15s; padding: 0 5px; }
.react.add svg { width: 14px; height: 14px; }
.cmt:hover .react.add, .cmt.on .react.add { opacity: .8; }
.cfiles { display: flex; gap: 6px; flex-wrap: wrap; }
.cfiles img { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line-2); display: block; }
.pending-img { position: relative; }
.pending-img button { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; }
.mentions { position: absolute; left: 0; right: 0; bottom: calc(100% + 4px); z-index: 20; background: var(--surface); border: var(--card-border); border-radius: var(--radius-sm); padding: 4px; box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.mentions button { display: flex; width: 100%; gap: 8px; align-items: center; padding: 6px 8px; border: 0; background: none; border-radius: 6px; cursor: pointer; text-align: left; font-size: 13px; }
.mentions button:hover { background: var(--surface-2); }
.chip svg { width: 14px; height: 14px; }

/* Batch 2: folders, selection, bulk actions, labels */
.folders { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-bottom: 18px; }
.folder { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; cursor: pointer; transition: border-color .15s; }
.folder:hover, .folder.dropping { border-color: var(--accent); }
.folder > svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.selbox { position: absolute; top: 8px; left: 8px; z-index: 3; width: 20px; height: 20px; accent-color: var(--accent); opacity: 0; transition: opacity .15s; cursor: pointer; }
.acard:hover .selbox, .acard.selecting .selbox, .acard.selected .selbox { opacity: 1; }
.acard.selected { outline: 3px solid var(--accent); outline-offset: -1px; }
.acard.selecting .thumb .badge.tl { left: 36px; }
.bulkbar { position: sticky; top: 70px; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: 16px; flex-wrap: wrap; }
.labels { display: flex; gap: 4px; flex-wrap: wrap; }
.label { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; color: var(--lc); background: color-mix(in srgb, var(--lc) 16%, transparent); border: 1px solid color-mix(in srgb, var(--lc) 45%, transparent); }
.results { display: grid; gap: 22px; }
.results h3 { font-size: 15px; margin-bottom: 8px; }
.result { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); text-decoration: none; }
.result:hover { background: var(--surface); }
.result .rthumb { width: 64px; height: 36px; border-radius: 4px; background: #000 center/contain no-repeat; flex: none; }
.topsearch { width: 240px; height: 34px; }
@media (max-width: 760px) { .topsearch { display: none; } }

.cover-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.cover-opt { width: 128px; aspect-ratio: 16/9; border-radius: var(--radius-sm); border: 2px solid var(--line); background: var(--bg-2) center/cover no-repeat; cursor: pointer; display: grid; place-items: center; color: var(--muted); font-size: 12px; font-weight: 600; }
.cover-opt.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }

/* Batch 3: bell, notifications */
.bell { position: relative; }
.bell-count { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: color-mix(in srgb, var(--danger) 78%, #000); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.notif-panel { width: min(380px, calc(100vw - 16px)); max-height: 70vh; overflow: auto; }
.notif { display: grid !important; gap: 2px; padding: 9px 10px !important; font-size: 13.5px !important; }
.notif.unread { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.notif.unread span:first-child { font-weight: 600; }

/* client page: logo, message, presentation, watermark */
.studio-logo { height: 30px; max-width: 120px; object-fit: contain; border-radius: 4px; }
.share-msg { padding: 14px 16px; margin-top: 10px; max-width: 720px; white-space: pre-wrap; }
.present { display: grid; gap: 40px; max-width: 1100px; margin: 0 auto; }
.present-item { display: grid; gap: 12px; }
.present-item h2 { font-size: 22px; }
.present-stage { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; display: grid; }
.present-stage video, .present-stage img { width: 100%; max-height: 80vh; object-fit: contain; display: block; }
.watermark { position: absolute; inset: -40%; z-index: 4; pointer-events: none; display: flex; flex-wrap: wrap; gap: 90px 140px; align-content: center; justify-content: center;
  transform: rotate(-24deg); transition: transform 4s linear; color: rgba(255,255,255,.16); font: 700 18px var(--font-body); text-shadow: 0 0 2px rgba(0,0,0,.25); user-select: none; }

/* zoom, PDF, waveform */
.zoomer { position: absolute; inset: 0; transform-origin: 0 0; }
.pane:has(.zoomer) { cursor: zoom-in; }
.wave-box { position: relative; width: min(92%, 1100px); display: grid; gap: 10px; justify-items: center; }
.wave { width: 100%; height: 160px; cursor: pointer; }
.wave-head { position: absolute; top: 0; height: 160px; width: 2px; background: var(--text); pointer-events: none; }
.wave-name { font-size: 13px; }
.wave-fallback { max-height: 200px; border-radius: 10px; }

/* Phone layout */
.draw-layer.active { touch-action: none; }
@media (max-width: 980px) {
  .rv-main { grid-template-rows: auto 58vw auto auto; }
  .review.is-vertical .rv-main { grid-template-rows: auto 68vh auto auto; }
  .review.is-portrait .rv-main { grid-template-rows: auto min(118vw, 64vh) auto auto; }
  .review.is-square .rv-main { grid-template-rows: auto min(96vw, 60vh) auto auto; }
  .rv-side .composer { position: sticky; bottom: 0; z-index: 5; background: var(--bg-2); box-shadow: 0 -8px 20px rgba(0,0,0,.25); }
}
@media (max-width: 600px) {
  .hide-sm { display: none !important; }
  .controls { gap: 2px; padding: 6px 8px 2px; }
  .controls .tc { min-width: 0; font-size: 13px; }
  .rv-head { padding: 8px 10px; gap: 6px; }
  .rv-head h2 { font-size: 16px; }
  .timeline-wrap { padding: 4px 10px 10px; }
  .page-head h1 { font-size: 24px; }
  .page-head .btn { height: 34px; padding: 0 10px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .acard .body { padding: 8px 10px 10px; }
  .acard .name { font-size: 13px; }
  .brand { font-size: 17px; }
  .topbar > .muted, .topbar > .btn.ghost.sm { display: none; }
  .modal { padding: 18px; }
}

.more-opts { border: var(--card-border); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; gap: 12px; }
.more-opts[open] { gap: 12px; }
.more-opts summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
.more-opts > *:not(summary) { margin-top: 12px; }
.guide { padding: 18px 20px; margin-bottom: 22px; display: grid; gap: 10px; }
.guide h2 { font-size: 18px; }
.guide ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.guide li { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.guide li svg { width: 18px; height: 18px; color: var(--ok); }
.guide li .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); margin: 0 2px; }
.guide li.done span, .guide li.done { color: var(--muted); text-decoration: line-through; }
.guide li a { font-weight: 600; color: var(--accent); }
.review { position: relative; }
.client-tip { position: absolute; top: 0; left: 0; right: 0; z-index: 25; display: flex; gap: 12px; align-items: center; padding: 10px 14px; background: var(--accent); color: var(--accent-ink); font-size: 14px; }
.client-tip .btn { background: rgba(255,255,255,.9); color: #111; border: 0; }

/* ===== Gen Z + pop-culture-inspired themes (original designs, no third-party marks) ===== */

/* Cyber Neon: black, hot pink + cyan glow, grid floor. */
[data-theme="cyberneon"] {
  --bg: #07020f; --bg-2: #0e0620; --surface: #140a2b; --surface-2: #1c0f3a; --line: #33175c; --line-2: #ff2bd6;
  --text: #f4ecff; --muted: #b9a6e0; --faint: #7d6aa8;
  --accent: #ff2bd6; --accent-2: #00f0ff; --accent-ink: #07020f; --ok: #00ff9c; --warn: #ffe600; --danger: #ff3860; --info: #00f0ff;
  --radius: 8px; --radius-sm: 6px;
  --font-head: "Audiowide", "Inter", sans-serif; --head-weight: 400;
  --pattern:
    linear-gradient(rgba(0,240,255,.07) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(255,43,214,.07) 1px, transparent 1px) 0 0 / 40px 40px,
    radial-gradient(900px 500px at 80% -10%, rgba(255,43,214,.30), transparent 65%),
    radial-gradient(900px 500px at 10% 110%, rgba(0,240,255,.25), transparent 65%);
  --card-border: 1px solid #3d1a6e; --card-shadow: 0 0 0 1px rgba(0,240,255,.12), 0 0 30px -12px rgba(255,43,214,.6);
  --btn-shadow: 0 0 18px rgba(255,43,214,.75); --glow: 0 0 10px rgba(0,240,255,.8); --tc: #00f0ff;
}

/* Coquette: blush, cream, ribbons, elegant serif. Light theme. */
[data-theme="coquette"] {
  --bg: #fbefef; --bg-2: #fff7f5; --surface: #fffdfb; --surface-2: #f9eeec; --line: #ecd3d3; --line-2: #d9a5ad;
  --text: #4b2b33; --muted: #7a525d; --faint: #b8979e;
  --accent: #c9707f; --accent-2: #e8b4bc; --accent-ink: #fff; --ok: #6aa57a; --warn: #c9953a; --danger: #c0485a; --info: #a37db8;
  --radius: 22px; --radius-sm: 14px;
  --font-head: "Playfair Display", Georgia, serif; --head-weight: 600;
  --pattern:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cg fill='none' stroke='%23d9a5ad' stroke-opacity='.35' stroke-width='1.2'%3E%3Cpath d='M45 45c-8-10-20-12-20-4s12 8 20 4c8-4 20-4 20 4s-12 6-20-4M45 45l-6 14M45 45l6 14'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 90px 90px,
    linear-gradient(180deg, #fff6f3, #f8e6e8);
  --card-border: 1px solid #ecd3d3; --card-shadow: 0 10px 30px -18px rgba(201,112,127,.5);
  --btn-shadow: 0 6px 16px -8px rgba(201,112,127,.7); --tc: #b05565;
  color-scheme: light;
}
[data-theme="coquette"] h1, [data-theme="coquette"] h2 { font-style: italic; }

/* ===== More fun themes (original designs) ===== */

/* Matcha Latte: Sage, cream, calm. Light theme. */
[data-theme="matcha"] {
  --bg: #eef2e3; --bg-2: #f7f9ef; --surface: #fcfdf7; --surface-2: #e6ecd6; --line: #d3dcb8; --line-2: #aebd86;
  --text: #26331d; --muted: #5f7050; --faint: #93a483;
  --accent: #5f8f3d; --accent-2: #c9a25a; --accent-ink: #fff; --ok: #3aa86a; --warn: #d99a2b; --danger: #d63a52; --info: #c9a25a;
  --radius: 20px; --radius-sm: 13px;
  --font-head: "Fraunces", "Inter", sans-serif; --head-weight: 600;
  --pattern: radial-gradient(circle at 12% 18%, rgba(95,143,61,.14) 0 90px, transparent 91px), radial-gradient(circle at 88% 82%, rgba(201,162,90,.18) 0 120px, transparent 121px), linear-gradient(180deg,#f3f6e8,#e9eedb);
  --card-border: 1px solid #d3dcb8; --card-shadow: 0 12px 32px -18px rgba(70,100,40,.5);
  --btn-shadow: 0 6px 16px -8px rgba(95,143,61,.8); --tc: #4a7a2c; --stage: #1c2615;
  color-scheme: light;
}

/* Lo-fi Sunset: Dusk purple, warm glow. Dark theme. */
[data-theme="lofi"] {
  --bg: #1a1028; --bg-2: #231634; --surface: #2a1b3d; --surface-2: #33224a; --line: #4a3366; --line-2: #6a4a8c;
  --text: #fbeedd; --muted: #d0b3c4; --faint: #9a7f9c;
  --accent: #ff8a5b; --accent-2: #ff5d8f; --accent-ink: #1a1028; --ok: #3aa86a; --warn: #d99a2b; --danger: #d63a52; --info: #ff5d8f;
  --radius: 18px; --radius-sm: 12px;
  --font-head: "DM Serif Display", "Inter", sans-serif; --head-weight: 400;
  --pattern: radial-gradient(700px 420px at 50% 115%, rgba(255,138,91,.38), transparent 70%), radial-gradient(600px 400px at 90% -10%, rgba(255,93,143,.22), transparent 70%), radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,.5), transparent 60%) 0 0/160px 160px, radial-gradient(1.5px 1.5px at 70% 60%, rgba(255,255,255,.35), transparent 60%) 0 0/120px 120px;
  --card-border: 1px solid #4a3366; --card-shadow: 0 14px 40px -20px rgba(255,138,91,.45);
  --btn-shadow: 0 8px 22px -8px rgba(255,138,91,.7); --tc: #ff9a72; --stage: #0f0819;
  color-scheme: dark;
}

/* Y2K Chrome: Periwinkle, stars, shine. Light theme. */
[data-theme="y2k"] {
  --bg: #e6e9ff; --bg-2: #f4f5ff; --surface: #ffffff; --surface-2: #eceeff; --line: #c7cdf5; --line-2: #9aa5ee;
  --text: #1b1d4a; --muted: #555b9c; --faint: #8f95c9;
  --accent: #3d5afe; --accent-2: #ff6ad5; --accent-ink: #fff; --ok: #3aa86a; --warn: #d99a2b; --danger: #d63a52; --info: #ff6ad5;
  --radius: 22px; --radius-sm: 14px;
  --font-head: "Unbounded", "Inter", sans-serif; --head-weight: 700;
  --pattern: radial-gradient(circle at 18% 20%, rgba(255,255,255,.95) 0 3px, transparent 4px) 0 0/90px 90px, radial-gradient(circle at 70% 60%, rgba(255,106,213,.35) 0 2px, transparent 3px) 0 0/130px 130px, linear-gradient(160deg,#dfe4ff,#f3e8ff 55%,#dff6ff);
  --card-border: 1.5px solid #c7cdf5; --card-shadow: 0 14px 34px -18px rgba(61,90,254,.5), inset 0 1px 0 #fff;
  --btn-shadow: 0 8px 20px -8px rgba(61,90,254,.8); --tc: #2a43d6; --stage: #12143a;
  color-scheme: light;
}
[data-theme="y2k"] .btn.primary { background: linear-gradient(180deg,#7d92ff,#3d5afe 55%,#2a43d6); }
[data-theme="y2k"] h1, [data-theme="y2k"] h2 { letter-spacing: -.02em; }

/* Retro Arcade: Pixels, scanlines, high score. Dark theme. */
[data-theme="arcade"] {
  --bg: #0a0a14; --bg-2: #11112a; --surface: #12122c; --surface-2: #161638; --line: #2d2d6b; --line-2: #4747b0;
  --text: #f2f2ff; --muted: #a9a9e0; --faint: #6e6eb0;
  --accent: #ffe600; --accent-2: #00ffa3; --accent-ink: #0a0a14; --ok: #3aa86a; --warn: #d99a2b; --danger: #d63a52; --info: #00ffa3;
  --radius: 0px; --radius-sm: 2px;
  --font-head: "Silkscreen", "Inter", sans-serif; --head-weight: 700;
  --pattern: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 4px), linear-gradient(rgba(71,71,176,.18) 1px, transparent 1px) 0 0/32px 32px, linear-gradient(90deg, rgba(71,71,176,.18) 1px, transparent 1px) 0 0/32px 32px, radial-gradient(800px 500px at 50% -10%, rgba(255,46,99,.22), transparent 70%);
  --card-border: 2px solid #4747b0; --card-shadow: 4px 4px 0 #ff2e63;
  --btn-shadow: 3px 3px 0 #ff2e63; --tc: #00ffa3; --stage: #000;
  color-scheme: dark;
}
[data-theme="arcade"] .btn.primary { border: 2px solid #ffe600; }
[data-theme="arcade"] .menu, [data-theme="arcade"] .modal { box-shadow: 5px 5px 0 #ff2e63; }

/* Vaporwave: Pink sun, cyan grid. Dark theme. */
[data-theme="vapor"] {
  --bg: #1b0b3a; --bg-2: #26104d; --surface: #2d1558; --surface-2: #371a68; --line: #5a2f9a; --line-2: #8a4fd8;
  --text: #fff0ff; --muted: #d3b2f0; --faint: #9b7fc4;
  --accent: #ff71ce; --accent-2: #01cdfe; --accent-ink: #1b0b3a; --ok: #3aa86a; --warn: #d99a2b; --danger: #d63a52; --info: #01cdfe;
  --radius: 14px; --radius-sm: 9px;
  --font-head: "Righteous", "Inter", sans-serif; --head-weight: 400;
  --pattern: radial-gradient(circle at 50% 0%, #ff71ce 0 150px, rgba(255,113,206,.25) 151px 260px, transparent 261px), linear-gradient(rgba(1,205,254,.16) 1px, transparent 1px) 0 0/44px 44px, linear-gradient(90deg, rgba(1,205,254,.16) 1px, transparent 1px) 0 0/44px 44px, linear-gradient(180deg,#24104a,#1b0b3a 55%,#3a0f5a);
  --card-border: 1px solid #5a2f9a; --card-shadow: 0 0 0 1px rgba(1,205,254,.15), 0 0 34px -14px rgba(255,113,206,.6);
  --btn-shadow: 0 0 20px rgba(255,113,206,.65); --tc: #01cdfe; --stage: #0e0522;
  color-scheme: dark;
}

/* Neo Brutal: Bold black outlines, hard shadows. Light theme. */
[data-theme="neobrut"] {
  --bg: #fff7da; --bg-2: #ffffff; --surface: #ffffff; --surface-2: #fff1b8; --line: #111111; --line-2: #111111;
  --text: #111111; --muted: #4a4a4a; --faint: #7a7a7a;
  --accent: #ff5c8a; --accent-2: #2d6bff; --accent-ink: #111111; --ok: #3aa86a; --warn: #d99a2b; --danger: #d63a52; --info: #2d6bff;
  --radius: 6px; --radius-sm: 4px;
  --font-head: "Space Grotesk", "Inter", sans-serif; --head-weight: 700;
  --pattern: radial-gradient(circle at 1px 1px, rgba(17,17,17,.14) 1.2px, transparent 1.6px) 0 0/16px 16px, linear-gradient(180deg,#fff7da,#ffeeb0);
  --card-border: 3px solid #111; --card-shadow: 6px 6px 0 #111;
  --btn-shadow: 3px 3px 0 #111; --tc: #2d6bff; --stage: #111;
  color-scheme: light;
}
[data-theme="neobrut"] .btn.primary { border: 3px solid #111; }
[data-theme="neobrut"] .topbar { border-bottom: 3px solid #111; background: #fff; }
[data-theme="neobrut"] .menu { box-shadow: 5px 5px 0 #111; }
[data-theme="neobrut"] .modal { box-shadow: 8px 8px 0 #111; }
[data-theme="neobrut"] .tabs button.on { background: #111; color: #fff; }
[data-theme="neobrut"] .rv-side { border-left: 3px solid #111; }

/* Forest Cabin: Pine green, lantern gold. Dark theme. */
[data-theme="forest"] {
  --bg: #0e1a14; --bg-2: #14241b; --surface: #1a2d22; --surface-2: #213a2b; --line: #2f5240; --line-2: #467a5e;
  --text: #e8f3e6; --muted: #a9c4b0; --faint: #6f9279;
  --accent: #7bd88f; --accent-2: #e8b867; --accent-ink: #0e1a14; --ok: #3aa86a; --warn: #d99a2b; --danger: #d63a52; --info: #e8b867;
  --radius: 14px; --radius-sm: 9px;
  --font-head: "Lora", "Inter", sans-serif; --head-weight: 600;
  --pattern: radial-gradient(600px 380px at 85% -10%, rgba(232,184,103,.22), transparent 70%), radial-gradient(700px 480px at 0% 110%, rgba(123,216,143,.16), transparent 70%), radial-gradient(1.5px 1.5px at 30% 40%, rgba(232,184,103,.45), transparent 60%) 0 0/140px 140px;
  --card-border: 1px solid #2f5240; --card-shadow: 0 14px 36px -20px rgba(0,0,0,.7);
  --btn-shadow: 0 8px 20px -8px rgba(123,216,143,.6); --tc: #7bd88f; --stage: #08110c;
  color-scheme: dark;
}

/* Peach Fizz: Warm peach, sunny orange. Light theme. */
[data-theme="peach"] {
  --bg: #ffe9dc; --bg-2: #fff4ec; --surface: #fffaf6; --surface-2: #ffe3d2; --line: #f6cdb8; --line-2: #eaa98a;
  --text: #4a2417; --muted: #7d4a37; --faint: #c29683;
  --accent: #ff7a59; --accent-2: #ffb347; --accent-ink: #fff; --ok: #3aa86a; --warn: #d99a2b; --danger: #d63a52; --info: #ffb347;
  --radius: 24px; --radius-sm: 16px;
  --font-head: "Poppins", "Inter", sans-serif; --head-weight: 700;
  --pattern: radial-gradient(circle at 15% 20%, rgba(255,179,71,.35) 0 120px, transparent 121px), radial-gradient(circle at 85% 75%, rgba(255,122,89,.25) 0 160px, transparent 161px), linear-gradient(180deg,#ffeee2,#ffe0cf);
  --card-border: 1px solid #f6cdb8; --card-shadow: 0 14px 34px -18px rgba(255,122,89,.55);
  --btn-shadow: 0 8px 20px -8px rgba(255,122,89,.8); --tc: #d9532f; --stage: #2a120a;
  color-scheme: light;
}

/* Shinobi: night-blue village, orange sunset, chakra-blue glow. Anime-ninja mood, original artwork. Dark theme. */
[data-theme="shinobi"] {
  --bg: #0e1530; --bg-2: #141d40; --surface: #18224d; --surface-2: #1f2b5e; --line: #2c3b82; --line-2: #4558b8;
  --text: #fff4e6; --muted: #c3cbe8; --faint: #8590c4;
  --accent: #ff8a1f; --accent-2: #3aa0ff; --accent-ink: #1a0f00; --ok: #4cd08a; --warn: #ffc233; --danger: #ff5a5f; --info: #3aa0ff;
  --radius: 12px; --radius-sm: 8px;
  --font-head: "Dela Gothic One", "Inter", sans-serif; --head-weight: 400;
  --pattern: repeating-radial-gradient(circle at 88% 6%, transparent 0 16px, rgba(255,138,31,.13) 16px 18px), repeating-linear-gradient(115deg, transparent 0 46px, rgba(58,160,255,.05) 46px 48px), radial-gradient(900px 520px at 50% 125%, rgba(255,138,31,.38), transparent 70%), radial-gradient(700px 420px at 0% 0%, rgba(58,160,255,.16), transparent 70%), linear-gradient(180deg,#0e1530,#121b3f);
  --card-border: 2px solid #2c3b82; --card-shadow: 0 0 0 1px rgba(255,138,31,.12), 0 16px 40px -22px rgba(255,138,31,.55);
  --btn-shadow: 0 0 22px rgba(255,138,31,.55); --glow: 0 0 10px rgba(58,160,255,.7); --tc: #3aa0ff; --stage: #060a1c;
  color-scheme: dark;
}
[data-theme="shinobi"] h1, [data-theme="shinobi"] h2, [data-theme="shinobi"] h3 { font-size: .94em; letter-spacing: .01em; }
[data-theme="shinobi"] .btn.primary { background: linear-gradient(180deg,#ffa23d,#ff8a1f 55%,#e86a00); box-shadow: var(--btn-shadow); }
[data-theme="shinobi"] .topbar { border-bottom: 2px solid #2c3b82; box-shadow: 0 1px 0 rgba(255,138,31,.25); }
[data-theme="shinobi"] .tabs button.on { background: #ff8a1f; color: #1a0f00; }

/* Sketchbook: cream paper, graphite pencil lines, red + blue pencil, highlighter yellow. Hand-drawn feel. Light theme. */
[data-theme="sketch"] {
  --bg: #f4eddb; --bg-2: #fbf7ea; --surface: #fffdf5; --surface-2: #f1e9d2; --line: #6f6a5d; --line-2: #2b2a27;
  --text: #2b2a27; --muted: #655f52; --faint: #968f7c;
  --accent: #d94f3d; --accent-2: #2f64b8; --accent-ink: #fff; --ok: #3f8f55; --warn: #e0a100; --danger: #c4382a; --info: #2f64b8;
  --radius: 10px; --radius-sm: 6px;
  --font-body: "Patrick Hand", "Inter", sans-serif; --font-head: "Caveat", "Patrick Hand", cursive; --head-weight: 700;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .25 0 0 0 0 .15 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E") 0 0/160px 160px, linear-gradient(90deg, transparent 0 63px, rgba(217,79,61,.4) 63px 65px, transparent 65px), repeating-linear-gradient(180deg, transparent 0 31px, rgba(47,100,184,.2) 31px 32px), linear-gradient(180deg,#f7f1e1,#f1e9d3);
  --card-border: 2px solid #2b2a27; --card-shadow: 3px 4px 0 rgba(43,42,39,.88);
  --btn-shadow: 2px 3px 0 rgba(43,42,39,.88); --tc: #2f64b8; --stage: #2b2a27;
  color-scheme: light;
}
[data-theme="sketch"] body { font-size: 17px; }
[data-theme="sketch"] h1, [data-theme="sketch"] h2, [data-theme="sketch"] h3, [data-theme="sketch"] .brand { font-size: 1.28em; letter-spacing: .01em; }
[data-theme="sketch"] .card, [data-theme="sketch"] .modal, [data-theme="sketch"] .menu, [data-theme="sketch"] .qmenu, [data-theme="sketch"] .appsearch { border-radius: 14px 6px 16px 5px / 6px 16px 5px 14px; }
[data-theme="sketch"] .btn, [data-theme="sketch"] .chip, [data-theme="sketch"] .input, [data-theme="sketch"] input, [data-theme="sketch"] select, [data-theme="sketch"] textarea, [data-theme="sketch"] .tabs button, [data-theme="sketch"] .badge { border-radius: 255px 14px 225px 14px / 14px 225px 14px 255px; }
[data-theme="sketch"] .btn { font-family: var(--font-head); font-size: 1.2em; font-weight: 700; border: 2px solid #2b2a27; box-shadow: var(--btn-shadow); }
[data-theme="sketch"] .btn.primary { background: var(--accent); color: #fff; }
[data-theme="sketch"] .btn:hover { transform: translate(-1px,-1px) rotate(-.6deg); box-shadow: 3px 4px 0 rgba(43,42,39,.88); }
[data-theme="sketch"] .btn:active { transform: translate(1px,2px); box-shadow: 0 0 0 rgba(0,0,0,0); }
[data-theme="sketch"] .input, [data-theme="sketch"] input, [data-theme="sketch"] select, [data-theme="sketch"] textarea { border: 2px solid #2b2a27; background: #fffdf5; font-family: var(--font-body); }
[data-theme="sketch"] .topbar, [data-theme="sketch"] .appbar { border-bottom: 2px solid #2b2a27; background: rgba(251,247,234,.92); }
[data-theme="sketch"] .rail { border-right: 2px solid #2b2a27; background: #fbf7ea; }
[data-theme="sketch"] .rv-side { border-left: 2px solid #2b2a27; }
[data-theme="sketch"] .tabs button.on { background: #ffe26a; color: #2b2a27; box-shadow: inset 0 -3px 0 rgba(217,79,61,.7); }
[data-theme="sketch"] .menu, [data-theme="sketch"] .qmenu { box-shadow: 4px 5px 0 rgba(43,42,39,.88); backdrop-filter: none; background: #fffdf5; }
[data-theme="sketch"] .modal { box-shadow: 6px 7px 0 rgba(43,42,39,.88); }
[data-theme="sketch"] .pcard .cover, [data-theme="sketch"] .acard .thumb { border-bottom: 2px solid #2b2a27; }
[data-theme="sketch"] .pcard:nth-child(3n+1), [data-theme="sketch"] .ptile:nth-child(3n+1), [data-theme="sketch"] .acard:nth-child(3n+1) { rotate: -.5deg; }
[data-theme="sketch"] .pcard:nth-child(3n+2), [data-theme="sketch"] .ptile:nth-child(3n+2), [data-theme="sketch"] .acard:nth-child(3n+2) { rotate: .4deg; }
[data-theme="sketch"] .qico { border-radius: 8px 4px 9px 4px; box-shadow: 2px 2px 0 rgba(43,42,39,.8); }
[data-theme="sketch"] ::selection { background: #ffe26a; color: #2b2a27; }

/* Project card hover preview */
.pcard .kinds { font-size: 13px; color: var(--muted); }
.pv { position: absolute; inset: 0; display: grid; gap: 2px; background: #000; }
.pv-2 { grid-template-columns: 1fr 1fr; }
.pv-3, .pv-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.pv-3 .pv-tile:first-child { grid-row: span 2; }
.pv-tile { background-color: #000; background-repeat: no-repeat; min-width: 0; min-height: 0; }
.pv .scrubline { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); pointer-events: none; }

/* Show the whole frame (no crop/zoom); a blurred copy fills the empty sides */
.fit { position: relative; overflow: hidden; background: #000 !important; isolation: isolate; }
.fit::before { content: ""; position: absolute; inset: -24px; z-index: -2; background: var(--cover) center / cover no-repeat; filter: blur(18px) brightness(.55) saturate(1.2); }
.fit::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--cover) center / contain no-repeat; }
.fit .scrub, .fit .pv { z-index: 1; }

.present-stage video, .present-stage img { max-height: 80vh; }

/* Hover scrub: exactly one frame, centred */
.acard .scrub { display: grid; place-items: center; background: #000; }
.scrub-frame { background-repeat: no-repeat; flex: none; }
.pv-tile { display: grid; place-items: center; overflow: hidden; }

/* Card text never spills outside the card */
.acard .body, .pcard .body { min-width: 0; }
.acard .body .row { min-width: 0; }
.acard .name { display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal !important; text-overflow: ellipsis; word-break: break-word; line-height: 1.3; min-width: 0; flex: 1; }
.acard .body > .row:last-child { gap: 8px; flex-wrap: nowrap; }
.acard .body > .row:last-child .status { flex: none; }
.acard .body > .row:last-child .faint { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.pcard h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; word-break: break-word; }

/* ===== Familiar pro layout: left icon rail + centred search ===== */
#app.with-rail { display: grid; grid-template-columns: 56px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0;
  background: color-mix(in srgb, var(--bg) 70%, #000 30%); border-right: 1px solid var(--line); }
.rail-brand { margin-bottom: 10px; display: grid; }
.rail-brand .mark { width: 30px; height: 30px; }
.rail-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: var(--muted); border: 0; background: none; cursor: pointer; text-decoration: none; }
.rail-btn svg { width: 20px; height: 20px; }
.rail-btn:hover, .rail-btn.on { background: var(--surface); color: var(--text); }
.rail-bell .bell { width: 40px; height: 40px; color: var(--muted); }
.rail-me { padding: 0; }
.app-main { min-width: 0; }
.appbar { height: 52px; padding: 0 16px; }
.appsearch { display: flex; align-items: center; gap: 8px; width: min(480px, 100%); height: 34px; padding: 0 14px; border-radius: 99px; border: var(--card-border); background: var(--bg-2); color: var(--muted); }
.appsearch svg { width: 16px; height: 16px; flex: none; }
.appsearch input { border: 0; outline: none; background: none; width: 100%; font-size: 14px; color: var(--text); }
.review, .review.share-mode { height: calc(100vh - 52px); }
.has-trial .review { height: calc(100vh - 96px); }
@media (max-width: 760px) {
  #app.with-rail { grid-template-columns: minmax(0, 1fr); padding-bottom: 58px; }
  .rail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: 58px; flex-direction: row; justify-content: space-around; padding: 0 8px; border-right: 0; border-top: 1px solid var(--line); }
  .rail .grow, .rail-brand { display: none; }
  .review, .review.share-mode, .has-trial .review { height: auto; }
}

/* Home: account header, toolbar, project tiles */
.home { max-width: 1500px; }
.acct-head { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.acct-head h1 { font-size: 24px; }
.acct-badge { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 14px; flex: none; }
.home-tools { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface); border: var(--card-border); }
.seg button { width: 32px; height: 28px; display: grid; place-items: center; border: 0; background: none; border-radius: 7px; color: var(--muted); cursor: pointer; }
.seg button svg { width: 15px; height: 15px; }
.seg button.on { background: var(--surface-2); color: var(--text); }
.tool { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; cursor: pointer; font-size: 14px; color: var(--text); padding: 4px 2px; }
.tool svg { width: 16px; height: 16px; color: var(--muted); }
.pgrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.ptile { padding: 4px; display: grid; gap: 4px; transition: transform .15s, border-color .15s; }
.ptile:hover { transform: translateY(-2px); border-color: var(--accent); }
.ptile-cover { position: relative; display: block; border-radius: calc(var(--radius) - 3px); overflow: hidden; text-decoration: none; }
.ptile-cover .cover { aspect-ratio: 1 / 1; display: grid; place-items: center; color: var(--faint); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 55%, #000), color-mix(in srgb, var(--accent-2) 55%, #000)); }
.ptile-title { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 26px 12px 10px; display: grid; gap: 1px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.78)); pointer-events: none; }
.ptile-title b { font-size: 15px; font-family: var(--font-head); font-weight: var(--head-weight); }
.ptile-title span { font-size: 12px; opacity: .8; }
.ptile-foot { display: flex; align-items: center; gap: 6px; padding: 2px 4px 2px 8px; font-size: 12.5px; min-width: 0; }
.ptile-new { min-height: 100%; aspect-ratio: auto; border-radius: var(--radius); border: 2px dashed var(--line-2); background: color-mix(in srgb, var(--surface) 50%, transparent); display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); font-weight: 600; cursor: pointer; }
.ptile-new:hover { border-color: var(--accent); color: var(--text); }
.ptile-new .plus { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
.ptile-new .plus svg { width: 20px; height: 20px; }
.ptile .cover .badge.br { z-index: 3; bottom: auto; top: 8px; right: 8px; }
.plist { padding: 4px; }
.plist-row { display: grid; grid-template-columns: 64px 2fr 1.4fr .6fr .8fr 1fr 36px; gap: 12px; align-items: center; padding: 8px 10px; border-radius: var(--radius-sm); text-decoration: none; font-size: 14px; }
.plist-row:hover:not(.head) { background: var(--surface-2); }
.plist-row.head { font-size: 12px; color: var(--faint); font-weight: 600; }
.plist-thumb { width: 64px; height: 40px; border-radius: 6px; background: var(--surface-2); }
@media (max-width: 760px) {
  .pgrid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .plist-row { grid-template-columns: 56px 1fr 36px; }
  .plist-row > :nth-child(3), .plist-row > :nth-child(4), .plist-row > :nth-child(5), .plist-row > :nth-child(6) { display: none; }
  .acct-head h1 { font-size: 19px; }
}

/* Project page: sidebar + main, folder collages */
.proj-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 52px); }
.has-trial .proj-layout { min-height: calc(100vh - 96px); }
.proj-side { border-right: 1px solid var(--line); padding: 12px 10px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 52px; height: calc(100vh - 52px); overflow: auto; background: color-mix(in srgb, var(--bg-2) 70%, transparent); }
.proj-switch { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); border: 0; background: none; cursor: pointer; width: 100%; color: var(--text); }
.proj-switch:hover { background: var(--surface); }
.proj-switch > svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
.proj-av { width: 36px; height: 36px; border-radius: 8px; flex: none; display: grid; place-items: center; font-weight: 800; background: var(--accent); color: var(--accent-ink); }
.tree { display: grid; gap: 1px; }
.tree-row { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13.5px; text-decoration: none; min-width: 0; }
.tree-row:hover { background: var(--surface); }
.tree-row.on { background: var(--surface-2); font-weight: 600; }
.tree-row > svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.tree-caret { width: 16px; height: 16px; border: 0; background: none; padding: 0; display: grid; place-items: center; color: var(--faint); cursor: pointer; flex: none; transition: transform .15s; }
.tree-caret svg { width: 12px; height: 12px; }
.tree-caret.open { transform: rotate(90deg); }
.tree-caret.none { visibility: hidden; }
.tree-more { border: 0; background: none; color: var(--muted); opacity: 0; cursor: pointer; padding: 0 2px; }
.tree-more svg { width: 15px; height: 15px; }
.tree-row:hover .tree-more { opacity: 1; }
.side-sec { display: grid; gap: 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.side-label { font-size: 12px; font-weight: 700; color: var(--faint); padding-left: 8px; }
.share-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13px; min-width: 0; }
.share-item:hover { background: var(--surface); }
.share-ic { width: 26px; height: 20px; border-radius: 5px; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.share-ic svg { width: 12px; height: 12px; }
.proj-main { min-width: 0; }
.proj-tools { position: sticky; top: 52px; z-index: 15; display: flex; align-items: center; gap: 14px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); flex-wrap: wrap; }
.proj-body { padding: 16px 20px 80px; }
.proj-crumbs { margin-bottom: 8px; }
.proj-count { font-size: 13px; font-weight: 600; color: var(--muted); padding: 3px 8px; border-radius: 6px; background: var(--surface); }
.fgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-bottom: 18px; }
.fcard { padding: 6px; cursor: pointer; transition: border-color .15s, transform .15s; position: relative; }
.fcard::before { content: ""; position: absolute; top: -7px; left: 10px; width: 38%; height: 8px; border-radius: 6px 6px 0 0; background: inherit; border: inherit; border-bottom: 0; }
.fcard:hover, .fcard.dropping { border-color: var(--accent); transform: translateY(-2px); }
.fc-collage { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px; aspect-ratio: 16 / 9; border-radius: calc(var(--radius) - 4px); overflow: hidden; }
.fc-collage.n3 > :first-child { grid-row: span 2; }
.fc-collage.n0, .fc-collage.n1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.fc-collage.n2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
.fc-collage.n0 .fc-img svg { width: 34px; height: 34px; }
.fc-img { display: grid; place-items: center; background: var(--surface-2); color: var(--faint); min-height: 0; }
.fc-img svg { width: 20px; height: 20px; opacity: .6; }
.fc-body { display: flex; align-items: center; gap: 8px; padding: 10px 6px 4px; }
.grid.size-s { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.grid.size-l { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.fgrid.size-s { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.fgrid.size-l { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
@media (max-width: 900px) {
  .proj-layout { grid-template-columns: minmax(0, 1fr); }
  .proj-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); max-height: 42vh; }
  .proj-tools { top: 0; padding: 8px 12px; gap: 8px; }
  .proj-body { padding: 12px; }
  .psearch { width: 140px !important; }
}

.pane video { will-change: transform; transform: translateZ(0); }
.igui svg { filter: none; }

.btn.quality { min-width: 58px; font-variant-numeric: tabular-nums; }
.btn.quality.hq { border-color: var(--accent); color: var(--accent); }

.kind-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.kind { height: 38px; border-radius: var(--radius-sm); border: var(--card-border); background: var(--bg-2); font-weight: 600; font-size: 14px; cursor: pointer; color: var(--text); }
.kind.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.signin-cta { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 10px; font-size: 14px; }
@media (max-width: 560px) { .kind-row { grid-template-columns: 1fr 1fr; } }

/* Keyboard shortcuts panel */
.modal.keys-modal { width: min(820px, 100%); height: min(720px, calc(100vh - 32px)); display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
.keys-wrap { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 18px; min-height: 0; }
.keys-nav { display: flex; flex-direction: column; gap: 2px; }
.keys-nav button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text); text-align: left; }
.keys-nav button:hover { background: var(--surface); }
.keys-nav svg { width: 17px; height: 17px; color: var(--muted); }
.keys-body { overflow: auto; padding-right: 6px; display: grid; gap: 18px; align-content: start; }
.keys-body h3 { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.keys-list { border-radius: var(--radius); background: var(--surface); border: var(--card-border); padding: 4px; }
.keys-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 14px; min-height: 40px; }
.keys-row:hover { background: var(--surface-2); }
.keys-row.capturing { outline: 2px solid var(--accent); box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 40%, transparent); }
.keycaps { display: flex; gap: 4px; }
.keys-acts { display: none; gap: 2px; }
.keys-row:hover .keys-acts, .keys-row.capturing .keys-acts { display: flex; }
#app.no-side .proj-side { display: none; }
#app.no-side .proj-layout { grid-template-columns: minmax(0, 1fr); }
.review.no-notes { grid-template-columns: minmax(0, 1fr); }
.review.no-notes .rv-side { display: none; }
@media (max-width: 640px) { .keys-wrap { grid-template-columns: 1fr; } .keys-nav { flex-direction: row; overflow-x: auto; } }

.rail-btn { position: relative; }
.rail-dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--bg); }
.rail-badge { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 12.5px; color: #fff; background: linear-gradient(135deg, #ef6a1f, #d4470e); box-shadow: 0 4px 14px -4px rgba(255,90,31,.7); }
.rail { background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 70%, #000 30%) 55%, color-mix(in srgb, var(--accent) 22%, color-mix(in srgb, var(--bg) 70%, #000 30%))); }
.news { display: grid; gap: 14px; }
.news-item { display: grid; gap: 2px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.qguide { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.qguide li { display: grid; gap: 2px; font-size: 14px; }

/* Settings with left menu */
.set-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 52px); }
.set-nav { border-right: 1px solid var(--line); padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 52px; height: calc(100vh - 52px); overflow: auto; }
.set-group { font-size: 12px; font-weight: 700; color: var(--faint); padding: 14px 10px 6px; }
.set-group:first-child { padding-top: 2px; }
.set-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; font-size: 14px; }
.set-link svg { width: 17px; height: 17px; color: var(--muted); }
.set-link:hover { background: var(--surface); }
.set-link.on { background: var(--surface-2); font-weight: 600; }
.set-body { padding: 26px 32px 80px; max-width: 920px; display: grid; gap: 26px; align-content: start; }
.set-sec { display: grid; gap: 10px; }
.set-sec h2 { font-size: 17px; }
.set-card { padding: 6px 18px; display: grid; }
.set-card > .field, .set-card > .theme-pick, .set-card > .stats-grid, .set-card > .profile-hero, .set-card > .row { margin: 12px 0; }
.set-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); min-width: 0; }
.set-card > .set-row:first-child { border-top: 0; }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: background .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:disabled + span { opacity: .55; cursor: default; }
.profile-hero { display: flex; align-items: center; gap: 22px; padding: 18px 6px; }
.big-av { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #e8553f, #d03449); box-shadow: 0 0 40px -6px rgba(255,90,95,.7); overflow: hidden; flex: none; }
.big-av img { width: 100%; height: 100%; object-fit: cover; }
.profile-hero h3 { font-size: 19px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat { display: grid; gap: 2px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.stat b { font-size: 22px; }
@media (max-width: 800px) {
  .set-layout { grid-template-columns: minmax(0, 1fr); }
  .set-nav { position: static; height: auto; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .set-group { display: none; }
  .set-link { white-space: nowrap; }
  .set-body { padding: 16px; }
}

/* Menu icons: always small */
.menu svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.menu button, .menu a { white-space: nowrap; }

.pro-tag { display:inline-flex; align-items:center; gap:5px; font-size:13px; font-weight:700; letter-spacing:0; padding:3px 10px 3px 7px; border-radius:999px; color:var(--text); background:color-mix(in srgb, var(--accent) 22%, transparent); vertical-align:middle; }

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tpl { text-align: left; display: grid; gap: 3px; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.tpl span { font-size: 12px; color: var(--faint); line-height: 1.35; }
.tpl.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ptile-cover { position: relative; }
.ptile-chips { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 2; }
.chip { font-size: 11.5px; font-weight: 650; padding: 3px 9px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; backdrop-filter: blur(6px); }
.chip.danger { background: var(--danger); color: #fff; }
.chip.warn { background: var(--warn); color: #111; }

/* Script / copy review */
.stage.script-stage { display: block; overflow: auto; background: var(--bg-2); position: relative; padding: 32px 20px 80px; }
.script-page { max-width: 760px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 48px; box-shadow: 0 10px 40px rgba(0,0,0,.18); }
.script-title { font-weight: 700; font-size: 18px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.script-title .faint { font-weight: 500; font-size: 13px; }
.script-doc { white-space: pre-wrap; font-size: 16.5px; line-height: 1.75; color: var(--text); user-select: text; cursor: text; }
.script-doc mark { background: color-mix(in srgb, var(--warn) 32%, transparent); color: inherit; border-radius: 3px; padding: 1px 0; cursor: pointer; border-bottom: 2px solid var(--warn); }
.script-doc mark.sg { background: color-mix(in srgb, var(--info) 26%, transparent); border-bottom-color: var(--info); }
.script-doc mark.done { background: color-mix(in srgb, var(--ok) 18%, transparent); border-bottom-color: var(--ok); }
.script-doc mark.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.sel-bubble { position: absolute; z-index: 20; display: flex; gap: 6px; padding: 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: 0 8px 28px rgba(0,0,0,.3); }
.sel-bubble.hidden { display: none; }
.script-pick { display: grid; gap: 6px; padding: 10px; border-radius: 10px; background: var(--surface-2); margin-bottom: 8px; }
.script-pick q, .anchor-q q { font-style: italic; color: var(--muted); display: block; border-left: 3px solid var(--warn); padding-left: 8px; }
.anchor-q { margin: 2px 0 6px; font-size: 13.5px; }
.anchor-q .sugg { display: grid; gap: 4px; border-left: 3px solid var(--info); padding-left: 8px; }
.anchor-q del { color: var(--faint); }
.anchor-q ins { text-decoration: none; color: var(--text); font-weight: 600; }
@media (max-width: 700px) { .script-page { padding: 24px 18px; } .stage.script-stage { padding: 14px 8px 60px; } }
.tree-row.dropping { background: color-mix(in srgb, var(--accent) 22%, transparent); outline: 2px dashed var(--accent); }

.vpick { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; font-size: 13px; transition: border-color .2s, box-shadow .2s, transform .15s; }
.vpick:hover { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.vpick:active { transform: scale(.97); }
.vpick b { font-size: 14px; }
.vpick .vlatest { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--accent); color: var(--bg); }
.vpick .vold { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--warn); color: #111; }
.vpick .vcount { color: var(--faint); font-size: 12px; }
.vpick svg { width: 14px; height: 14px; transform: rotate(90deg); color: var(--muted); }
.vdrop { position: fixed; z-index: 90; width: 320px; max-height: 60vh; overflow: auto; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 24px 60px rgba(0,0,0,.35);
  transform-origin: top left; animation: dropIn .28s cubic-bezier(.2,.9,.25,1.15) both; }
.vdrop.out { animation: dropOut .18s ease-in both; }
.vdrop-head { display: flex; justify-content: space-between; padding: 8px 10px 6px; font-weight: 700; font-size: 13px; }
.vdrop-head span { color: var(--faint); font-weight: 500; font-size: 12px; }
.vrow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; text-align: left; font: inherit;
  opacity: 0; animation: rowIn .32s cubic-bezier(.2,.8,.2,1) forwards; animation-delay: calc(var(--i) * 35ms + 60ms); transition: background .15s; }
.vrow:hover { background: var(--surface-2); }
.vrow.on { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.vnum { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); font-weight: 800; font-size: 13px; flex: none; }
.vrow.on .vnum { background: var(--accent); color: var(--bg); }
.vmeta { display: grid; flex: 1; min-width: 0; } .vmeta b { font-size: 13.5px; } .vmeta small { color: var(--faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vst { font-size: 11.5px; font-weight: 650; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.vst.clear { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
@keyframes dropIn { from { opacity: 0; transform: translateY(-8px) scale(.96); clip-path: inset(0 0 100% 0 round 14px); } to { opacity: 1; transform: none; clip-path: inset(0 0 0 0 round 14px); } }
@keyframes dropOut { to { opacity: 0; transform: translateY(-6px) scale(.97); } }
@keyframes rowIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Motion system: one easing family, short durations, nothing in the way ---------- */
:root { --ease-out: cubic-bezier(.2,.8,.2,1); --ease-spring: cubic-bezier(.3,1.35,.5,1); }
/* Drag & merge */
.acard[draggable="true"] { cursor: grab; }
.acard.dragging { opacity: .35; transform: scale(.96); filter: saturate(.6); }
.acard, .fcard, .ptile { transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), border-color .2s, opacity .2s; }
.acard:hover, .ptile:hover { transform: translateY(-3px); box-shadow: 0 14px 34px -12px rgba(0,0,0,.45); }
.acard.dropping, .fcard.dropping { transform: scale(1.03); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent), 0 18px 40px -12px rgba(0,0,0,.5); }
.acard.dropping::after { animation: pulseDrop 1s ease-in-out infinite; }
@keyframes pulseDrop { 50% { background: color-mix(in srgb, var(--accent) 42%, transparent); } }
.merge-ghost { border-radius: var(--radius); box-shadow: 0 30px 60px -10px rgba(0,0,0,.6); }
.merge-ring { position: absolute; inset: -4px; border-radius: inherit; border: 3px solid var(--accent); pointer-events: none; animation: ring .8s var(--ease-out) forwards; z-index: 5; }
@keyframes ring { from { opacity: 1; transform: scale(.96); } to { opacity: 0; transform: scale(1.12); } }
.merge-pop { position: absolute; top: 12px; left: 50%; z-index: 6; padding: 5px 12px; border-radius: 999px; background: var(--accent); color: var(--bg); font-weight: 800; font-size: 14px; pointer-events: none;
  animation: pop 1.4s var(--ease-spring) forwards; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.5); } 18% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 30% { transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -14px); } }
/* Grids enter with a soft stagger */
.grid > *, .pgrid > *, .fgrid > *, .plist-row:not(.head) { animation: cardIn .45s var(--ease-out) both; }
.grid > :nth-child(1), .pgrid > :nth-child(1), .fgrid > :nth-child(1) { animation-delay: 35ms; }
.grid > :nth-child(2), .pgrid > :nth-child(2), .fgrid > :nth-child(2) { animation-delay: 70ms; }
.grid > :nth-child(3), .pgrid > :nth-child(3), .fgrid > :nth-child(3) { animation-delay: 105ms; }
.grid > :nth-child(4), .pgrid > :nth-child(4), .fgrid > :nth-child(4) { animation-delay: 140ms; }
.grid > :nth-child(5), .pgrid > :nth-child(5), .fgrid > :nth-child(5) { animation-delay: 175ms; }
.grid > :nth-child(6), .pgrid > :nth-child(6), .fgrid > :nth-child(6) { animation-delay: 210ms; }
.grid > :nth-child(7), .pgrid > :nth-child(7), .fgrid > :nth-child(7) { animation-delay: 245ms; }
.grid > :nth-child(8), .pgrid > :nth-child(8), .fgrid > :nth-child(8) { animation-delay: 280ms; }
.grid > :nth-child(9), .pgrid > :nth-child(9), .fgrid > :nth-child(9) { animation-delay: 315ms; }
.grid > :nth-child(10), .pgrid > :nth-child(10), .fgrid > :nth-child(10) { animation-delay: 350ms; }
.grid > :nth-child(11), .pgrid > :nth-child(11), .fgrid > :nth-child(11) { animation-delay: 385ms; }
.grid > :nth-child(12), .pgrid > :nth-child(12), .fgrid > :nth-child(12) { animation-delay: 420ms; }

@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
/* Modals, menus, toasts */
.backdrop { animation: fade .2s ease both; backdrop-filter: blur(4px); }
.backdrop .modal { animation: modalIn .32s var(--ease-spring) both; }
.backdrop.out { animation: fadeOut .18s ease both; }
.backdrop.out .modal { animation: modalOut .18s ease both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes fadeOut { to { opacity: 0; } }
.menu { animation: dropIn .22s var(--ease-out) both; transform-origin: top right; }
.toast { animation: toastIn .38s var(--ease-spring) both; }
.toast.out { animation: toastOut .22s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.92); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.96); } }
/* Buttons and controls */
.btn, .chip, .tool, .rail-btn, .kind, .tpl { transition: transform .15s var(--ease-out), background .2s, border-color .2s, box-shadow .2s, color .2s; }
.btn:active, .chip:active, .rail-btn:active, .kind:active, .tpl:active { transform: scale(.96); }
.tabs button { transition: background .2s, color .2s; }
/* Notes slide in */
.cmt { animation: cardIn .35s var(--ease-out) both; transition: background .2s, border-color .2s; }
/* Views fade up when you navigate */
.app-main > .view-in { animation: viewIn .35s var(--ease-out) backwards; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }
.uploads .item { animation: cardIn .3s var(--ease-out) both; }
.progress i { transition: width .35s var(--ease-out); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}

/* Phone review: video on top, notes scroll, composer pinned above the tab bar (iPhone safe area aware) */
@media (max-width: 760px) {
  .rail { height: calc(58px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
  #app.with-rail { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .rv-main, .review.is-vertical .rv-main { grid-template-rows: auto min(46svh, 520px) auto auto; }
  .rv-side { min-height: 0; }
  .review { padding-bottom: 150px; }
  .review .composer { position: fixed; left: 0; right: 0; z-index: 40; bottom: calc(58px + env(safe-area-inset-bottom)); padding: 8px 10px; gap: 6px; background: var(--bg-2); box-shadow: 0 -10px 30px rgba(0,0,0,.35); }
  #app:not(.with-rail) .review .composer { bottom: 0; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .review .composer textarea { font-size: 16px; min-height: 44px; height: 44px; max-height: 30svh; transition: height .2s; }
  .review .composer textarea:focus { height: 96px; }
  .review .composer .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .review .composer .chips::-webkit-scrollbar { display: none; }
  .review .composer .btn { min-height: 36px; }
  .review .composer .chip { padding: 0 9px; font-size: 12px; white-space: nowrap; flex: none; }
  .review .composer .chips .btn.primary { position: sticky; right: 0; flex: none; padding: 0 16px; box-shadow: -14px 0 14px var(--bg-2); }
  .review .drawbar { overflow-x: auto; flex-wrap: nowrap; }
  #app.with-rail:has(.composer textarea:focus) .rail { display: none; }
  #app.with-rail:has(.composer textarea:focus) .review .composer { bottom: 0; }
  .draw-layer.active { touch-action: none; overscroll-behavior: contain; }
}

/* Connect Google Drive step after sign-in */
.modal.drive-modal { width: min(440px, 100%); display: grid; gap: 20px; }
.drive-modal .dg-head { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.drive-modal .dg-logo { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; }
.drive-modal .dg-logo svg { width: 22px; height: 22px; display: block; }
.drive-modal h2 { font-size: 18px; line-height: 1.3; margin: 0 0 4px; }
.drive-modal .dg-head p { margin: 0; font-size: 14px; line-height: 1.5; }
.drive-modal .dg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.drive-modal .dg-list li { display: grid; grid-template-columns: 16px 1fr; gap: 10px; align-items: start; font-size: 14px; line-height: 1.5; color: var(--muted); }
.drive-modal .dg-list li svg { width: 16px; height: 16px; margin-top: 3px; color: var(--accent); }
.drive-modal .dg-list b { color: var(--text); font-weight: 600; }
.drive-modal .dg-go { width: 100%; height: 44px; justify-content: center; }
.drive-modal .dg-foot { display: flex; align-items: center; justify-content: space-between; margin-top: -8px; font-size: 13.5px; }
.drive-modal .dg-foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.drive-modal .dg-foot a:hover { color: var(--text); }

/* Quick menu on empty project space */
.qripple { position: fixed; z-index: 199; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; pointer-events: none; background: color-mix(in srgb, var(--accent) 55%, transparent); animation: qrip .6s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes qrip { to { transform: scale(9); opacity: 0; } }
.qmenu { position: fixed; z-index: 200; width: 272px; padding: 7px; border-radius: 16px; display: grid; gap: 2px;
  background: color-mix(in srgb, var(--bg-2) 78%, transparent); backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6);
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 24px 60px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.2);
  opacity: 0; transform: scale(.6); filter: blur(6px); transition: opacity .18s ease, transform .38s cubic-bezier(.2,1.3,.3,1), filter .25s ease; }
.qmenu.in { opacity: 1; transform: scale(1); filter: none; }
.qmenu.out { opacity: 0; transform: scale(.92); transition-duration: .15s; }
.qitem { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; border: 0; background: none; color: var(--text); padding: 8px 9px; border-radius: 11px; cursor: pointer; font: inherit; outline: none;
  opacity: 0; transform: translateY(6px); transition: background .15s, transform .15s; }
.qmenu.in .qitem { animation: qitemIn .34s cubic-bezier(.2,.9,.3,1) both; animation-delay: calc(var(--i) * 45ms + 60ms); }
@keyframes qitemIn { from { opacity: 0; transform: translateY(8px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
.qitem:hover, .qitem:focus-visible { background: color-mix(in srgb, var(--text) 8%, transparent); }
.qitem:hover .qico, .qitem:focus-visible .qico { transform: scale(1.08) rotate(-4deg); }
.qitem:active { transform: scale(.98); }
.qico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #fff; transition: transform .25s cubic-bezier(.2,1.4,.3,1); box-shadow: 0 6px 14px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.25); }
.qico svg { width: 17px; height: 17px; }
.tone-a .qico { background: linear-gradient(135deg, #8b7bff, #5b4bff); }
.tone-b .qico { background: linear-gradient(135deg, #3ee08a, #12a868); }
.tone-c .qico { background: linear-gradient(135deg, #ffb547, #ff7a3d); }
.tone-d .qico { background: linear-gradient(135deg, #4fc3ff, #2f7bff); }
.qtxt { display: grid; gap: 1px; min-width: 0; }
.qtxt b { font-size: 14px; font-weight: 600; }
.qtxt small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qsep { height: 1px; margin: 4px 8px; background: color-mix(in srgb, var(--text) 10%, transparent); }
@media (prefers-reduced-motion: reduce) { .qmenu, .qmenu.in .qitem, .qripple { animation: none; transition: none; opacity: 1; transform: none; filter: none; } }
.proj-body { min-height: calc(100vh - 120px); }

/* readability: quality / speed pills in the player bar */
.controls .btn { color: var(--text); }
.controls .btn:hover { color: var(--text); }

/* Claude connect banner (top of the app) */
.claude-bar { display:flex; align-items:center; gap:14px; margin:12px 16px 0; padding:12px 14px; border-radius:14px; border:1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); background:linear-gradient(100deg, color-mix(in srgb, var(--accent) 16%, var(--bg2)), var(--bg2)); }
.claude-bar .cb-ic { width:34px; height:34px; border-radius:10px; display:grid; place-items:center; background:color-mix(in srgb, var(--accent) 22%, transparent); color:var(--accent); flex:none; }
.claude-bar .cb-ic svg { width:18px; height:18px; }
.claude-bar .cb-t { flex:1; min-width:0; display:grid; gap:2px; }
.claude-bar .cb-t b { font-size:14.5px; }
.claude-bar .cb-t span { font-size:13px; color:var(--muted); }
@media (max-width:560px) { .claude-bar { flex-wrap:wrap; } .claude-bar .cb-t { flex-basis:100%; } }

/* Keyboard seek / speed badge on the player */
.seek-flash { position: absolute; inset: 0; z-index: 6; pointer-events: none; display: flex; align-items: center; padding: 0 9%; opacity: 0; }
.seek-flash.left { justify-content: flex-start; } .seek-flash.right { justify-content: flex-end; } .seek-flash.mid { justify-content: center; }
.seek-flash.in { animation: sfIn .16s ease-out both; } .seek-flash.out { animation: sfOut .28s ease-in both; }
.seek-flash .sf-pill { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); color: #fff; font-size: 15px; }
.seek-flash .sf-pill b { font-weight: 600; font-variant-numeric: tabular-nums; }
.seek-flash .sf-arrows { display: flex; }
.seek-flash .sf-arrows svg { width: 16px; height: 16px; margin: 0 -3px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; animation: sfArrow .6s ease both; }
.seek-flash.left .sf-arrows svg:nth-child(3), .seek-flash.right .sf-arrows svg:nth-child(1) { animation-delay: 0s; }
.seek-flash .sf-arrows svg:nth-child(2) { animation-delay: .1s; }
.seek-flash.left .sf-arrows svg:nth-child(1), .seek-flash.right .sf-arrows svg:nth-child(3) { animation-delay: .2s; }
@keyframes sfIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes sfOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes sfArrow { 0% { opacity: .25; } 50% { opacity: 1; } 100% { opacity: .25; } }

/* Done tick on each note */
.cmt { position: relative; transition: opacity .35s ease; }
.cmt.resolved { opacity: .6; }
.cmt.resolved:hover, .cmt.resolved.on { opacity: 1; }
.cmt > .tick { position: absolute; right: 12px; bottom: 12px; z-index: 1; flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--muted); background: transparent; display: grid; place-items: center; padding: 0; cursor: pointer; color: var(--muted); opacity: .7; transition: background .15s, border-color .15s, color .15s; }
.cmt > .tick svg { width: 14px; height: 14px; }
.cmt > .tick:hover { border-color: #3ecf8e; color: #3ecf8e; opacity: 1; }
.cmt > .tick.on { background: #3ecf8e; border-color: #3ecf8e; color: #0d0e12; opacity: 1; animation: tickPop .25s ease; }
@keyframes tickPop { 50% { transform: scale(1.18); } }

.cmt:has(> .tick) .acts { padding-right: 32px; }
