/* Studio: same design language as the landing page (paper, ink, one accent), built for editing. */
:root {
  --paper: #f4f2ec; --paper-2: #ebe8df; --ink: #0f0f12; --ink-2: #4a4a52; --ink-3: #8a8a94;
  --line: rgba(15, 15, 18, 0.1); --line-2: rgba(15, 15, 18, 0.18);
  --accent: #ff4d1c; --accent-soft: rgba(255, 77, 28, 0.12); --lime: #d8ff3e; --ok: #1f9d55; --warn: #b7791f; --err: #d23f31;
  --card: #fff; --dark: #121216; --r: 20px; --r-s: 12px;
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif; --body: "Inter", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1); --shadow: 0 20px 50px rgba(15, 15, 18, 0.1);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; font-family: var(--display); letter-spacing: -0.03em; line-height: 1.05; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--ink-2); } .dim { color: var(--ink-3); } .small { font-size: 13px; } .hidden { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; border: none; font-size: 14px; white-space: nowrap; transition: transform 0.2s var(--ease), background 0.2s, opacity 0.2s; }
.btn:hover { background: #26262c; transform: translateY(-1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.acc { background: var(--accent); } .btn.acc:hover { background: #ff5f33; }
.btn.lite { background: #fff; color: var(--ink); border: 1px solid var(--line-2); } .btn.lite:hover { background: var(--paper-2); }
.btn.ghost { background: transparent; color: var(--ink-2); } .btn.ghost:hover { background: var(--paper-2); color: var(--ink); }
.btn.danger { color: var(--err); }
.btn.sm { padding: 7px 12px; font-size: 13px; } .btn.xs { padding: 5px 10px; font-size: 12px; gap: 5px; } .btn.lg { padding: 15px 26px; font-size: 16px; } .btn.block { width: 100%; }
.icon { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; font-size: 13px; color: var(--ink-2); padding: 0; }
.icon:hover { background: var(--paper-2); color: var(--ink); }
.icon.danger:hover { color: var(--err); }

/* inputs */
.field { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; letter-spacing: 0.01em; }
input[type=text], input[type=number], select, textarea { width: 100%; background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 10px 12px; outline: none; transition: 0.15s; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(15, 15, 18, 0.08); }
textarea { resize: none; line-height: 1.5; }
input[type=color] { width: 36px; height: 36px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; padding: 3px; }
input[type=range] { width: 100%; accent-color: var(--ink); }
.pills { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--paper-2); }
.pill { padding: 7px 14px; border-radius: 999px; border: none; background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 600; transition: 0.2s; }
.pill:hover { color: var(--ink); } .pill.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(15, 15, 18, 0.1); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #fff; border: 1px solid var(--line); color: var(--ink-2); }
.chip.ok { color: var(--ok); } .chip.warn { color: var(--warn); } .chip.err { color: var(--err); } .chip.acc { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.drop { border: 1.5px dashed var(--line-2); border-radius: var(--r-s); padding: 14px; text-align: center; color: var(--ink-3); font-size: 13px; cursor: pointer; transition: 0.2s; background: #fff; }
.drop:hover, .drop.over { border-color: var(--ink); color: var(--ink); background: var(--paper-2); }
.drop img { max-height: 90px; border-radius: 8px; display: block; margin: 0 auto 6px; }

/* layout */
.top { position: sticky; top: 0; z-index: 20; background: rgba(244, 242, 236, 0.85); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top .in { max-width: 1280px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 800; font-size: 17px; }
.brand i { width: 22px; height: 22px; border-radius: 7px; background: var(--ink); position: relative; display: inline-block; }
.brand i::after { content: ""; position: absolute; left: 7px; top: 5px; border-left: 9px solid var(--lime); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.top .tabs { display: flex; gap: 2px; margin-left: 10px; }
.top .tabs a { padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.top .tabs a.active, .top .tabs a:hover { background: var(--paper-2); color: var(--ink); }
.spacer { flex: 1; }
.sys { display: flex; gap: 6px; }
main { max-width: 1280px; margin: 0 auto; padding: 32px 24px 100px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .stack { display: flex; flex-direction: column; gap: 12px; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; box-shadow: var(--shadow); z-index: 100; max-width: 90vw; font-size: 14px; animation: up 0.35s var(--ease); }
.toast.err { background: var(--err); }
@keyframes up { from { transform: translate(-50%, 12px); opacity: 0; } }
.rv { animation: fadeup 0.6s var(--ease) both; }
@keyframes fadeup { from { opacity: 0; transform: translateY(14px); } }

/* ---------- new video */
.new { max-width: 820px; margin: 30px auto 0; }
.new h1 { font-size: clamp(34px, 5vw, 52px); letter-spacing: -0.04em; margin-bottom: 8px; }
.new .lead { color: var(--ink-2); font-size: 17px; margin-bottom: 26px; }
.composer { background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 8px; }
.composer textarea { border: none; box-shadow: none; padding: 18px 18px 8px; font-size: 17px; min-height: 130px; background: transparent; }
.composer textarea:focus { box-shadow: none; }
.composer .bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.composer .bar .spacer { flex: 1; }
.opt { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.opt:hover { background: var(--paper-2); color: var(--ink); }
.opt b { color: var(--ink); }
.more { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.more .card { padding: 16px 18px; }
.voices { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: 380px; overflow: auto; padding-right: 4px; }
.voice { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; transition: 0.15s; }
.voice:hover { border-color: var(--line-2); } .voice.active { border-color: var(--ink); background: var(--paper); }
.voice .play { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); background: #fff; display: grid; place-items: center; font-size: 10px; padding: 0; flex: none; }
.voice .play.on { background: var(--ink); color: #fff; }
.voice b { font-size: 13.5px; display: block; } .voice span { font-size: 12px; color: var(--ink-3); }
.examples { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.examples button { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-size: 13px; color: var(--ink-2); }
.examples button:hover { background: #fff; color: var(--ink); border-color: var(--ink); }
.notice { border-radius: 14px; padding: 12px 16px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.notice.err { background: rgba(210, 63, 49, 0.08); color: #8a2a21; } .notice.warn { background: rgba(183, 121, 31, 0.1); color: #7a4f0f; } .notice.info { background: #fff; border: 1px solid var(--line); color: var(--ink-2); }

/* ---------- video page */
.vhead { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.vhead .back { color: var(--ink-3); font-weight: 600; font-size: 14px; }
.vhead .title { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -0.03em; border: 1px solid transparent; border-radius: 10px; padding: 4px 8px; background: transparent; flex: 1 1 220px; max-width: 560px; }
.vhead .title:hover { border-color: var(--line); } .vhead .title:focus { background: #fff; border-color: var(--ink); box-shadow: none; }
.vhead .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.vhead .actions { display: flex; gap: 8px; margin-left: auto; }

/* progress */
.making { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 26px; }
.making .card { padding: 26px; }
.making h2 { font-size: 26px; margin-bottom: 4px; }
.timeline { margin-top: 18px; display: flex; flex-direction: column; }
.tstep { display: flex; align-items: center; gap: 12px; padding: 9px 0; color: var(--ink-3); font-size: 15px; position: relative; }
.tstep .k { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; font-size: 11px; flex: none; background: #fff; transition: 0.3s; }
.tstep.running { color: var(--ink); font-weight: 600; } .tstep.running .k { border-color: var(--accent); color: var(--accent); animation: ring 1.4s infinite; }
.tstep.done { color: var(--ink-2); } .tstep.done .k { background: var(--ink); border-color: var(--ink); color: #fff; }
.tstep.error .k { background: var(--err); border-color: var(--err); color: #fff; } .tstep.skipped { opacity: 0.4; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(255, 77, 28, 0.35); } 100% { box-shadow: 0 0 0 10px rgba(255, 77, 28, 0); } }
.pbar { height: 6px; border-radius: 3px; background: var(--paper-2); overflow: hidden; margin-top: 18px; }
.pbar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width 0.6s var(--ease); }
.pbar.indet i { width: 40%; animation: indet 1.6s infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.preview-ph { border-radius: var(--r); background: var(--dark); color: #fff; min-height: 300px; display: grid; place-items: center; text-align: center; padding: 30px; position: relative; overflow: hidden; }
.preview-ph .sk { position: absolute; inset: 0; background: linear-gradient(120deg, #17171c 30%, #23232a 50%, #17171c 70%); background-size: 200% 100%; animation: shimmer 2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.preview-ph > div { position: relative; }
pre.log { background: var(--dark); color: #c9c9d1; border-radius: 14px; padding: 14px; max-height: 300px; overflow: auto; font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; margin: 14px 0 0; }
.runbar { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 8px 8px 16px; margin-bottom: 18px; font-size: 14px; }
.runbar .sp { width: 14px; height: 14px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* editor */
.editor { display: grid; grid-template-columns: 340px 1fr; gap: 28px; align-items: start; }
.editor.solo { grid-template-columns: 1fr; }
.editor.busy .scenes { opacity: 0.6; pointer-events: none; }
.player { position: sticky; top: 80px; }
.player video { width: 100%; border-radius: 22px; background: #000; display: block; box-shadow: var(--shadow); max-height: 72vh; }
.player .ph { border-radius: 22px; background: var(--dark); aspect-ratio: 9/16; display: grid; place-items: center; color: #8a8a94; text-align: center; padding: 24px; font-size: 14px; overflow: hidden; position: relative; }
.player .ph.l { aspect-ratio: 16/9; } .player .ph.s { aspect-ratio: 1; }
.player .ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.35; }
.player .ph > span { position: relative; }
.player .stage { position: relative; }
.player .updating { position: absolute; inset: 0; border-radius: 22px; background: rgba(15, 15, 18, 0.55); backdrop-filter: blur(2px); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 20px; pointer-events: none; overflow: hidden; }
.player .updating .sp { width: 22px; height: 22px; border: 2.5px solid rgba(255, 255, 255, 0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.9s linear infinite; }
.player .updating i { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--accent); transition: width 0.6s var(--ease); }
.switch { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 36px; height: 20px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line-2); position: relative; transition: 0.2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: 0.2s; }
.switch input:checked + .track { background: var(--ink); border-color: var(--ink); }
.switch input:checked + .track::after { left: 18px; }
.capbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; margin-bottom: 12px; }
.capfield { display: flex; align-items: center; gap: 8px; }
.capfield .tag { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 4px 8px; border-radius: 6px; flex: none; }
.capfield input { font-weight: 600; }
.player .cta { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.player .versions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.player .versions button { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.player .versions button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.scenes { display: flex; flex-direction: column; }
.shead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.shead h2 { font-size: 20px; }
.scene { display: grid; grid-template-columns: 96px 1fr; gap: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; position: relative; transition: box-shadow 0.25s, transform 0.25s var(--ease); }
.scene:hover { box-shadow: var(--shadow); }
.scene.dragging { opacity: 0.4; } .scene.over { box-shadow: 0 -3px 0 0 var(--accent); }
.scene .grip { position: absolute; left: -22px; top: 50%; transform: translateY(-50%); color: var(--ink-3); cursor: grab; font-size: 18px; opacity: 0; transition: 0.2s; padding: 6px; }
.scene:hover .grip { opacity: 1; }
.scene .thcol { display: flex; flex-direction: column; gap: 6px; }
.scene .shots { display: flex; gap: 4px; }
.scene .shot { position: relative; flex: 1; aspect-ratio: 9/16; border-radius: 6px; overflow: hidden; background: var(--paper-2); cursor: pointer; opacity: 0.85; transition: 0.2s; }
.scene .shot:hover { opacity: 1; outline: 2px solid var(--accent, #4f7cff); }
.scene .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scene .shot span { position: absolute; left: 3px; top: 3px; font-size: 9px; font-weight: 700; padding: 1px 4px; border-radius: 4px; background: rgba(15, 15, 18, 0.7); color: #fff; }
.scene .th { position: relative; aspect-ratio: 9/16; border-radius: 12px; overflow: hidden; background: var(--paper-2); cursor: pointer; }
.scene .th.l { aspect-ratio: 16/9; } .scene .th.s { aspect-ratio: 1; }
.scene .th img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s var(--ease); }
.scene .th:hover img { transform: scale(1.05); }
.scene .th .n { position: absolute; left: 8px; top: 8px; width: 22px; height: 22px; border-radius: 50%; background: rgba(15, 15, 18, 0.7); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.scene .th .src { position: absolute; left: 6px; right: 6px; bottom: 6px; font-size: 10px; padding: 3px 6px; border-radius: 6px; background: rgba(15, 15, 18, 0.65); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene .th .hover { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(15, 15, 18, 0.45); color: #fff; font-size: 12px; font-weight: 600; opacity: 0; transition: 0.2s; }
.scene .th:hover .hover { opacity: 1; }
.scene .th .textcard { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; text-align: center; color: #fff; font-family: var(--display); font-weight: 800; font-size: 13px; text-transform: uppercase; line-height: 1.1; }
.scene .body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.scene .meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
.scene .meta b { color: var(--ink-2); font-weight: 600; }
.scene textarea.line { border: 1px solid transparent; background: transparent; padding: 6px 8px; margin: 0 -8px; font-size: 16px; line-height: 1.45; border-radius: 10px; }
.scene textarea.line:hover { background: var(--paper); } .scene textarea.line:focus { background: #fff; border-color: var(--ink); box-shadow: none; }
.scene .tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; opacity: 0.55; transition: 0.2s; }
.scene:hover .tools, .scene:focus-within .tools { opacity: 1; }
.scene .tools .spacer { flex: 1; }
.scene .adv { display: none; grid-template-columns: 1fr 1fr 1fr; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); margin-top: 4px; }
.scene.open .adv { display: grid; }
.scene .adv select { padding: 7px 10px; font-size: 13px; }
.between { height: 26px; display: grid; place-items: center; position: relative; }
.between button { opacity: 0; transition: 0.2s; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); background: #fff; font-size: 14px; line-height: 1; padding: 0; color: var(--ink-2); }
.between:hover button, .between button:focus { opacity: 1; }
.between::before { content: ""; position: absolute; left: 20%; right: 20%; top: 50%; height: 1px; background: transparent; }
.between:hover::before { background: var(--line-2); }
.inline-add { background: #fff; border: 1px dashed var(--line-2); border-radius: var(--r); padding: 14px; display: grid; gap: 8px; }
.skeleton { background: linear-gradient(120deg, #eeece5 30%, #f7f6f1 50%, #eeece5 70%); background-size: 200% 100%; animation: shimmer 1.6s infinite; border-radius: 10px; }

/* panels */
.overlay { position: fixed; inset: 0; background: rgba(15, 15, 18, 0.35); z-index: 50; display: flex; justify-content: flex-end; animation: fade 0.25s; }
@keyframes fade { from { opacity: 0; } }
.panel { width: min(480px, 100%); height: 100%; background: var(--paper); box-shadow: -20px 0 60px rgba(0, 0, 0, 0.2); overflow: auto; padding: 22px; animation: slide 0.35s var(--ease); display: flex; flex-direction: column; gap: 14px; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.panel .ph { display: flex; align-items: center; justify-content: space-between; }
.panel h2 { font-size: 22px; }
.modal { position: fixed; inset: 0; background: rgba(15, 15, 18, 0.45); z-index: 60; display: grid; place-items: center; padding: 20px; animation: fade 0.2s; }
.modal .box { width: min(760px, 100%); max-height: 90vh; overflow: auto; background: var(--paper); border-radius: 24px; padding: 22px; animation: up2 0.35s var(--ease); display: flex; flex-direction: column; gap: 14px; }
@keyframes up2 { from { transform: translateY(16px); opacity: 0; } }
.modal .box h2 { font-size: 22px; }
.tabs2 { display: inline-flex; gap: 4px; padding: 4px; background: var(--paper-2); border-radius: 999px; }
.tabs2 button { padding: 7px 14px; border-radius: 999px; border: none; background: transparent; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.tabs2 button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(15, 15, 18, 0.1); }
.cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.cand { position: relative; aspect-ratio: 9/16; border-radius: 12px; overflow: hidden; background: var(--paper-2); cursor: pointer; border: 2px solid transparent; transition: 0.2s; }
.cand.l { aspect-ratio: 16/9; } .cand:hover { transform: translateY(-3px); border-color: var(--ink); } .cand.current { border-color: var(--accent); }
.cand img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cand .m { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px; font-size: 10px; background: rgba(15, 15, 18, 0.65); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cand .cur { position: absolute; top: 6px; left: 6px; font-size: 10px; background: var(--accent); color: #fff; padding: 2px 6px; border-radius: 6px; font-weight: 700; }
.setting { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: grid; gap: 8px; }
.setting .field { margin: 0; }
.swatches { display: flex; gap: 10px; align-items: center; }

/* library */
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.lib a.card { padding: 0; overflow: hidden; transition: transform 0.3s var(--ease), box-shadow 0.3s; display: block; }
.lib a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.lib .pv { aspect-ratio: 4/3; background: var(--dark); position: relative; overflow: hidden; display: grid; place-items: center; color: #8a8a94; font-size: 13px; }
.lib .pv img, .lib .pv video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lib .pv .st { position: absolute; left: 10px; top: 10px; }
.lib .meta { padding: 12px 14px; }
.lib .meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--display); font-size: 16px; }
.empty { text-align: center; padding: 70px 20px; }
.empty h2 { font-size: 28px; margin-bottom: 8px; }

@media (max-width: 980px) {
  .editor { grid-template-columns: 1fr; } .player { position: static; max-width: 360px; }
  .making { grid-template-columns: 1fr; } .more { grid-template-columns: 1fr; }
  .scene .grip { display: none; } .scene .tools { opacity: 1; }
  main { padding: 20px 16px 80px; }
}
@media (max-width: 560px) {
  .scene { grid-template-columns: 1fr; } .scene .th { max-width: 150px; }
  .scene .adv { grid-template-columns: 1fr; } .voices { grid-template-columns: 1fr; }
  .vhead .actions { margin-left: 0; width: 100%; }
}

.credit-bar { padding: 14px 20px 22px; text-align: center; font-size: 12px; color: var(--ink-3, #6b7280); }
.credit-bar a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* voice control on the storyboard */
.voicechip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-size: 13px; transition: 0.2s; }
.voicechip:hover { border-color: var(--ink); background: var(--paper); }
.voicechip .avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--lime); font-family: var(--display); font-weight: 800; font-size: 12px; display: grid; place-items: center; }
.linkbtn { background: none; border: none; padding: 0; font: inherit; color: var(--ink-2); text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.linkbtn:hover { color: var(--ink); }

/* publish page */
.pubgrid { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }
.pubgrid .pills { flex-wrap: wrap; border-radius: 16px; }
.pubgrid .pill { white-space: nowrap; }
.avatar-ig { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #f9ce34, #ee2a7b, #6228d7); color: #fff; font-weight: 800; display: grid; place-items: center; }
.qlist { display: flex; flex-direction: column; gap: 10px; }
.qitem { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.qitem .qpv { aspect-ratio: 9/16; border-radius: 8px; overflow: hidden; background: var(--dark); }
.qitem .qpv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qitem .qbody { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.qitem textarea.line { font-size: 13.5px; margin: 0; padding: 6px 8px; }
@media (max-width: 980px) { .pubgrid { grid-template-columns: 1fr; } }

/* generation view while making */
.live { display: flex; flex-direction: column; align-items: stretch; }
.glive { position: relative; border-radius: var(--r); background: radial-gradient(120% 90% at 20% 0%, #2a2532 0%, #121216 55%, #0c0c0f 100%); color: #fff; padding: 18px 18px 16px; box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.06); display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.glive::before { content: ""; position: absolute; inset: -40% -20% auto -20%; height: 70%; background: radial-gradient(closest-side, rgba(255,77,28,0.28), transparent 70%); filter: blur(40px); pointer-events: none; animation: gglow 9s ease-in-out infinite alternate; }
@keyframes gglow { from { transform: translateX(-8%) } to { transform: translateX(10%) } }
.ghead { position: relative; display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(255,255,255,0.8); }
.ghead b { color: #fff; font-family: var(--display); font-size: 15px; letter-spacing: -0.01em; }
.gdot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 rgba(216,255,62,0.6); animation: gpulse 1.6s infinite; }
@keyframes gpulse { 0% { box-shadow: 0 0 0 0 rgba(216,255,62,0.55) } 70% { box-shadow: 0 0 0 9px rgba(216,255,62,0) } 100% { box-shadow: 0 0 0 0 rgba(216,255,62,0) } }
.gtime { font-variant-numeric: tabular-nums; color: rgba(255,255,255,0.55); font-size: 12px; }
.gstage { position: relative; width: 100%; max-width: 236px; margin: 0 auto; aspect-ratio: 9 / 16; border-radius: 26px; overflow: hidden; background: #000; box-shadow: 0 30px 60px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.08); }
.live.l .gstage { max-width: 100%; aspect-ratio: 16 / 9; }
.live.s .gstage { max-width: 300px; aspect-ratio: 1 / 1; }
.glayer { position: absolute; inset: 0; animation: greveal 0.7s var(--ease) both; }
@keyframes greveal { from { opacity: 0; filter: blur(14px); transform: scale(1.06) } to { opacity: 1; filter: blur(0); transform: scale(1) } }
.glayer img { width: 100%; height: 100%; object-fit: cover; animation: gkb 7s ease-out forwards; }
@keyframes gkb { from { transform: scale(1) } to { transform: scale(1.09) } }
.gcard { position: absolute; inset: 0; background: var(--p, #121216); overflow: hidden; }
.gcard i { position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; filter: blur(40px); opacity: 0.55; background: var(--a, #ff4d1c); animation: gblob 10s ease-in-out infinite alternate; }
.gcard i:nth-child(1) { left: -20%; top: -10%; }
.gcard i:nth-child(2) { right: -25%; top: 30%; opacity: 0.35; animation-delay: -3s; background: #fff; mix-blend-mode: overlay; }
.gcard i:nth-child(3) { left: 10%; bottom: -30%; opacity: 0.4; animation-delay: -6s; }
@keyframes gblob { from { transform: translate(0,0) scale(1) } to { transform: translate(12%, 8%) scale(1.15) } }
.gshade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0.15) 60%, rgba(0,0,0,0.75) 100%); }
.gsweep { position: absolute; inset: -20% -60%; background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.14) 50%, transparent 60%); animation: gsweep 2.8s ease-in-out infinite; pointer-events: none; }
@keyframes gsweep { from { transform: translateX(-45%) } to { transform: translateX(45%) } }
.gtop { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: 6px; }
.gpill { font-size: 11px; font-weight: 600; padding: 5px 9px; border-radius: 999px; background: rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.12); backdrop-filter: blur(8px); color: rgba(255,255,255,0.85); display: inline-flex; gap: 2px; align-items: baseline; }
.gpill b { color: #fff; } .gpill span { color: rgba(255,255,255,0.55); }
.gpill.ok { background: rgba(31,157,85,0.35); border-color: rgba(31,157,85,0.5); color: #dfffe9; }
.gpill.mid { background: rgba(255,77,28,0.3); border-color: rgba(255,77,28,0.5); color: #ffe1d6; }
.gline { position: absolute; left: 14px; right: 14px; bottom: 16%; text-align: center; font-family: var(--display); font-weight: 800; font-size: 19px; line-height: 1.12; letter-spacing: -0.02em; text-shadow: 0 2px 0 rgba(0,0,0,0.7), 0 6px 22px rgba(0,0,0,0.6); animation: greveal 0.7s var(--ease) both; }
.live.l .gline { font-size: 24px; bottom: 12%; }
.gline.dim { color: rgba(255,255,255,0.7); font-weight: 600; font-size: 15px; }
.gline span { transition: color 0.2s; } .gline span.on { color: var(--lime); }
.gmeta { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font-size: 11px; color: rgba(255,255,255,0.65); }
.gtl { position: relative; display: flex; gap: 4px; height: 38px; }
.gseg { position: relative; border: none; padding: 0; border-radius: 9px; background: rgba(255,255,255,0.08) center/cover no-repeat; cursor: pointer; overflow: hidden; min-width: 12px; transition: transform 0.25s var(--ease), box-shadow 0.25s; }
.gseg.voiced { background-color: rgba(255,255,255,0.16); }
.gseg.has::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.35)); }
.gseg .ph { position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent); transform: translateX(-100%); }
.gseg.on { box-shadow: 0 0 0 2px var(--lime), 0 0 18px rgba(216,255,62,0.35); transform: translateY(-2px); }
.gseg.on .ph { animation: gph 3.6s linear infinite; }
@keyframes gph { to { transform: translateX(100%) } }
.gtally { display: flex; gap: 6px; font-size: 11px; }
.gtally span { flex: 1; text-align: center; padding: 6px 4px; border-radius: 8px; background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.45); border: 1px solid rgba(255,255,255,0.06); }
.gtally span.part { color: #fff; border-color: rgba(255,77,28,0.5); background: rgba(255,77,28,0.15); }
.gtally span.done { color: #dfffe9; border-color: rgba(31,157,85,0.5); background: rgba(31,157,85,0.18); }
