:root {
  --bg: #0e0f11;
  --bg2: #141518;
  --panel: #18191d;
  --panel2: #1f2025;
  --panel3: #26272d;
  --line: #2a2b31;
  --line2: #34353d;
  --text: #ececf0;
  --dim: #a1a2ad;
  --faint: #6c6d78;
  --accent: #6e5bff;
  --accent2: #8b7bff;
  --accent-ink: #ffffff;
  --yellow: #f5dc00;
  --red: #ff5a5f;
  --green: #35d07f;
  --blue: #4aa3ff;
  --orange: #ffa53d;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 13px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", system-ui, sans-serif; }
body { overflow: hidden; }
#app { height: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
.boot { display: grid; place-items: center; height: 100%; color: var(--faint); }
.hidden { display: none !important; }
.mono { font-family: var(--mono); }
.dim { color: var(--dim); } .faint { color: var(--faint); }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.wrap { flex-wrap: wrap; }
.sp { justify-content: space-between; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
::selection { background: rgba(110, 91, 255, .45); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2c2d34; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); white-space: nowrap;
  transition: background .12s, border-color .12s; }
.btn:hover:not(:disabled) { background: var(--panel3); border-color: #44454f; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--accent2); border-color: var(--accent2); }
.btn.danger { color: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--panel2); border-color: var(--line2); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; }
.btn.icon { width: 32px; padding: 0; }
.btn.sm.icon { width: 26px; }
.btn.on { background: rgba(110, 91, 255, .18); border-color: var(--accent); color: #fff; }
.btn svg, .ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.btn.sm svg { width: 14px; height: 14px; }
.input, .select, .textarea { width: 100%; background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px;
  padding: 7px 10px; outline: none; transition: border-color .12s; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); }
.textarea { resize: vertical; min-height: 70px; line-height: 1.45; }
.select { appearance: none; padding-right: 26px; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%),
  linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%;
  background-size: 4px 4px; background-repeat: no-repeat; }
label.field { display: grid; gap: 5px; font-size: 12px; color: var(--dim); }
label.check { display: flex; gap: 8px; align-items: center; cursor: pointer; color: var(--text); }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
input[type=range] { accent-color: var(--accent); }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 99px;
  font-size: 11px; font-weight: 600; background: var(--panel3); color: var(--dim); white-space: nowrap; }
.pill.accent { background: rgba(110, 91, 255, .2); color: #c9c1ff; }
.pill.green { background: rgba(53, 208, 127, .15); color: var(--green); }
.pill.red { background: rgba(255, 90, 95, .15); color: var(--red); }
.pill.orange { background: rgba(255, 165, 61, .15); color: var(--orange); }
.pill.blue { background: rgba(74, 163, 255, .15); color: var(--blue); }
.pill.yellow { background: rgba(245, 220, 0, .14); color: var(--yellow); }
.kbd { font: 10px var(--mono); border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; color: var(--dim); }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700;
  color: #fff; flex: none; }
.avatar.ai { background: linear-gradient(135deg, #d97757, #b85c3c); }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .2); border-top-color: currentColor;
  animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { height: 4px; border-radius: 4px; background: var(--panel3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.empty { border: 1px dashed var(--line2); border-radius: 12px; padding: 36px 20px; text-align: center; color: var(--faint); }
.empty b { display: block; color: var(--dim); font-size: 14px; margin-bottom: 4px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-rows: 52px 1fr; height: 100%; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--bg2);
  min-width: 0; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: .1px; white-space: nowrap; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand i { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); position: relative; flex: none; }
.brand i::after { content: ""; position: absolute; left: 8px; top: 6px; border-left: 8px solid #fff; border-top: 5px solid transparent;
  border-bottom: 5px solid transparent; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--dim); }
.crumbs a { color: var(--dim); }
.crumbs b { color: var(--text); font-weight: 600; }
.crumbs .sep { color: var(--faint); }
.page { overflow: auto; padding: 28px 32px 80px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: -.2px; }
.page-head p { margin: 4px 0 0; color: var(--dim); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button { background: none; border: 0; padding: 9px 12px; color: var(--dim); border-bottom: 2px solid transparent; margin-bottom: -1px;
  display: flex; gap: 6px; align-items: center; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs .count { font-size: 10.5px; background: var(--panel3); border-radius: 99px; padding: 0 6px; color: var(--dim); }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; position: relative;
  transition: border-color .12s, transform .12s; }
.card.link { cursor: pointer; }
.card.link:hover { border-color: #43444e; }
.thumb { aspect-ratio: 16/9; background: #0a0a0c center/cover no-repeat; position: relative; overflow: hidden; }
.thumb .scrub { position: absolute; inset: 0; background-repeat: no-repeat; display: none; }
.thumb:hover .scrub { display: block; }
.thumb .scrubline { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); display: none; }
.thumb:hover .scrubline { display: block; }
.thumb .tl { position: absolute; left: 8px; top: 8px; display: flex; gap: 5px; }
.thumb .br { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .72); font: 11px var(--mono); padding: 1px 6px; border-radius: 4px; }
.thumb .center { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-size: 12px; text-align: center; padding: 10px; }
.thumb .progress { position: absolute; left: 0; right: 0; bottom: 0; }
.card .meta { padding: 11px 12px 12px; display: grid; gap: 4px; }
.card .title { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.card .sub { color: var(--faint); font-size: 12px; display: flex; gap: 10px; align-items: center; }
.card .menu-btn { position: absolute; right: 8px; top: 8px; opacity: 0; background: rgba(0, 0, 0, .65); border-color: transparent; }
.card:hover .menu-btn { opacity: 1; }
.dropzone { position: fixed; inset: 0; background: rgba(110, 91, 255, .12); border: 2px dashed var(--accent); z-index: 50; display: grid;
  place-items: center; font-size: 18px; font-weight: 600; pointer-events: none; }

/* ---------- menus, modals, toasts ---------- */
.menu { position: fixed; z-index: 90; min-width: 180px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 10px;
  box-shadow: var(--shadow); padding: 5px; }
.menu button { display: flex; width: 100%; gap: 8px; align-items: center; background: none; border: 0; text-align: left; padding: 7px 10px;
  border-radius: 7px; }
.menu button:hover { background: var(--panel3); }
.menu button.danger { color: var(--red); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 80; display: grid; place-items: center; padding: 16px;
  animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow); width: min(520px, 100%);
  max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal.wide { width: min(820px, 100%); }
.modal-h { padding: 16px 18px 6px; display: flex; align-items: center; gap: 8px; }
.modal-h h3 { margin: 0; font-size: 16px; }
.modal-b { padding: 10px 18px 16px; overflow: auto; display: grid; gap: 12px; }
.modal-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; }
.toast { background: var(--panel3); border: 1px solid #44454f; border-radius: 9px; padding: 9px 14px; box-shadow: var(--shadow);
  animation: rise .18s; max-width: 90vw; }
.toast.error { border-color: rgba(255, 90, 95, .6); }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
.upload-tray { position: fixed; right: 16px; bottom: 16px; width: 320px; background: var(--panel2); border: 1px solid var(--line2);
  border-radius: 12px; box-shadow: var(--shadow); z-index: 70; overflow: hidden; }
.upload-tray .h { padding: 10px 12px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); font-weight: 600; }
.upload-tray .item { padding: 9px 12px; display: grid; gap: 5px; border-bottom: 1px solid var(--line); }
.upload-tray .item:last-child { border-bottom: 0; }

/* ---------- auth ---------- */
.auth { display: grid; place-items: center; height: 100%; padding: 16px; background:
  radial-gradient(1200px 600px at 50% -10%, rgba(110, 91, 255, .18), transparent 60%), var(--bg); }
.auth .box { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; padding: 28px;
  display: grid; gap: 14px; box-shadow: var(--shadow); }
.auth h1 { margin: 0; font-size: 20px; }
.auth p { margin: 0; color: var(--dim); }
.err { color: var(--red); font-size: 12.5px; min-height: 18px; }

/* ---------- review ---------- */
.review { display: grid; grid-template-rows: 52px 1fr; height: 100%; }
.review-main { display: grid; grid-template-columns: 1fr 400px; min-height: 0; }
.viewer { display: grid; grid-template-rows: 1fr auto auto; min-width: 0; min-height: 0; background: #000; }
.stage { position: relative; min-height: 0; display: grid; place-items: center; overflow: hidden; background: #000; }
.stage video { max-width: 100%; max-height: 100%; display: block; }
.stage .frame { position: relative; }
.stage canvas.ann { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stage canvas.ann.drawing { pointer-events: auto; cursor: crosshair; }
.stage .processing { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--dim); gap: 10px;
  align-content: center; }
.stage .bigplay { position: absolute; width: 64px; height: 64px; border-radius: 50%; background: rgba(0, 0, 0, .55); display: grid;
  place-items: center; pointer-events: none; opacity: 0; transition: opacity .2s; }
.stage .bigplay.show { opacity: 1; }
.drawbar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; padding: 5px;
  background: rgba(22, 23, 27, .92); border: 1px solid var(--line2); border-radius: 11px; box-shadow: var(--shadow); z-index: 5;
  align-items: center; }
.drawbar .sw { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.drawbar .sw.on { border-color: #fff; }
.drawbar .divider { width: 1px; height: 20px; background: var(--line2); margin: 0 4px; }
.cut-flash { position: absolute; top: 12px; right: 12px; background: rgba(255, 90, 95, .9); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 6px; padding: 3px 8px; }
.transport { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--bg2); border-top: 1px solid var(--line); }
.transport .tc { font: 13px var(--mono); min-width: 150px; cursor: pointer; user-select: none; }
.transport .tc .d { color: var(--faint); }
.transport .vol { width: 80px; }
.timeline { background: var(--bg2); padding: 6px 12px 12px; user-select: none; }
.tl-markers { position: relative; height: 28px; }
.tl-marker { position: absolute; top: 3px; transform: translateX(-50%); cursor: pointer; z-index: 2; }
.tl-marker .avatar { width: 20px; height: 20px; font-size: 9px; border: 2px solid var(--bg2); }
.tl-marker.resolved { opacity: .35; }
.tl-marker.sel .avatar { box-shadow: 0 0 0 2px #fff; }
.tl-track { position: relative; height: 46px; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; cursor: pointer; overflow: hidden; }
.tl-track canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.tl-range { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.tl-range.comment { background: rgba(110, 91, 255, .22); border-left: 1px solid var(--accent); border-right: 1px solid var(--accent); }
.tl-range.cut { background: repeating-linear-gradient(45deg, rgba(255, 90, 95, .45) 0 5px, rgba(255, 90, 95, .2) 5px 10px); }
.tl-range.broll { background: rgba(74, 163, 255, .35); border-top: 3px solid var(--blue); }
.tl-range.inout { background: rgba(245, 220, 0, .15); border-left: 2px solid var(--yellow); border-right: 2px solid var(--yellow); }
.tl-range.plan-cut { background: repeating-linear-gradient(-45deg, rgba(255, 165, 61, .5) 0 4px, transparent 4px 8px); border-top: 2px solid var(--orange); }
.tl-range.plan-op { top: auto; height: 6px; bottom: 0; background: var(--orange); opacity: .8; }
.tl-ph { position: absolute; top: -1px; bottom: -1px; width: 2px; background: #fff; pointer-events: none; z-index: 3; }
.tl-hover { position: absolute; bottom: 64px; transform: translateX(-50%); pointer-events: none; z-index: 20; display: none;
  background: #000; border: 1px solid var(--line2); border-radius: 7px; overflow: hidden; box-shadow: var(--shadow); }
.tl-hover .img { background-repeat: no-repeat; }
.tl-hover .t { font: 11px var(--mono); text-align: center; padding: 2px 6px; }
.tl-wrap { position: relative; }
.tl-tip { position: absolute; bottom: 34px; transform: translateX(-50%); background: var(--panel3); border: 1px solid var(--line2);
  border-radius: 8px; padding: 6px 9px; max-width: 260px; font-size: 12px; pointer-events: none; z-index: 21; box-shadow: var(--shadow); }

.side { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-left: 1px solid var(--line); }
.side .tabs { margin: 0; padding: 0 10px; }
.side-body { flex: 1; min-height: 0; overflow: auto; }
.side-tools { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }

.comments { padding: 8px; display: grid; gap: 8px; align-content: start; }
.cmt { border: 1px solid var(--line); border-radius: 11px; background: var(--bg2); padding: 10px 11px; cursor: pointer; }
.cmt:hover { border-color: var(--line2); }
.cmt.sel { border-color: var(--accent); background: #17162a; }
.cmt.resolved { opacity: .62; }
.cmt.live { border-color: rgba(110, 91, 255, .5); }
.cmt-h { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.cmt-h .name { font-weight: 600; }
.cmt-h .when { color: var(--faint); font-size: 11.5px; }
.cmt-h .acts { margin-left: auto; display: flex; gap: 2px; opacity: .0; transition: opacity .1s; }
.cmt:hover .cmt-h .acts, .cmt.sel .cmt-h .acts { opacity: 1; }
.tcode { font: 11.5px var(--mono); color: var(--yellow); font-weight: 700; background: rgba(245, 220, 0, .08); border-radius: 5px; padding: 1px 6px; }
.cmt-body { white-space: pre-wrap; word-wrap: break-word; }
.cmt-body .quote { display: block; color: var(--dim); border-left: 2px solid var(--line2); padding-left: 8px; margin: 2px 0 6px; font-style: italic; }
.cmt-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.resolve { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--faint); display: grid; place-items: center; background: none;
  padding: 0; flex: none; }
.resolve.on { background: var(--green); border-color: var(--green); }
.resolve svg { width: 12px; height: 12px; stroke: #000; stroke-width: 3; fill: none; opacity: 0; }
.resolve.on svg { opacity: 1; }
.resolve:hover svg { opacity: .6; stroke: var(--green); }
.resolve.on:hover svg { opacity: 1; stroke: #000; }
.replies { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--line); display: grid; gap: 8px; }
.reply .cmt-h { margin-bottom: 2px; }
.reply-box { margin-top: 8px; display: flex; gap: 6px; }
.reply-box .input { height: 30px; padding: 4px 9px; }
.ai-note { margin-top: 8px; border-left: 2px solid #d97757; padding: 3px 0 3px 9px; font-size: 12px; color: var(--dim); }

.composer { border-top: 1px solid var(--line); padding: 10px 12px 12px; display: grid; gap: 8px; background: var(--panel); }
.composer .textarea { min-height: 62px; max-height: 200px; resize: none; }
.composer .chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chipbtn { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--line2);
  background: var(--bg2); font-size: 12px; color: var(--dim); }
.chipbtn.on { color: var(--text); border-color: var(--accent); background: rgba(110, 91, 255, .14); }
.chipbtn.on.tc { color: var(--yellow); border-color: rgba(245, 220, 0, .5); background: rgba(245, 220, 0, .06); font-family: var(--mono); }
.chipbtn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.transcript { padding: 12px 16px 120px; line-height: 1.85; font-size: 14.5px; user-select: none; }
.tseg { display: grid; grid-template-columns: 54px 1fr; gap: 10px; margin-bottom: 12px; }
.tseg .ts { font: 11px var(--mono); color: var(--faint); padding-top: 4px; cursor: pointer; }
.tseg .ts:hover { color: var(--yellow); }
.w { border-radius: 3px; cursor: text; padding: 1px 0; }
.w:hover { background: rgba(255, 255, 255, .07); }
.w.cur { background: rgba(110, 91, 255, .35); color: #fff; }
.w.sel { background: rgba(245, 220, 0, .28); color: #fff; }
.w.cut { text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 2px; color: #ff9b9e; opacity: .75; }
.w.broll { box-shadow: inset 0 -3px 0 var(--blue); }
.w.cmted { box-shadow: inset 0 -2px 0 rgba(110, 91, 255, .7); }
.w.match { outline: 1px solid var(--yellow); }
.selbar { position: sticky; bottom: 0; margin: 0 -16px -120px; padding: 10px 12px; background: var(--panel2); border-top: 1px solid var(--line2);
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap; box-shadow: 0 -8px 20px rgba(0, 0, 0, .35); }

.ai-panel { padding: 12px; display: grid; gap: 12px; align-content: start; }
.ai-head { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 12px; border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(217, 119, 87, .14), rgba(110, 91, 255, .08)); }
.ai-logo { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, #d97757, #b85c3c);
  font-weight: 800; color: #fff; flex: none; }
.fb-list { display: grid; gap: 4px; max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--bg2); }
.fb-item { display: flex; gap: 8px; align-items: flex-start; padding: 5px 6px; border-radius: 7px; font-size: 12.5px; }
.fb-item:hover { background: var(--panel2); }
.plan { border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); overflow: hidden; }
.plan-h { padding: 10px 12px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.plan-b { padding: 10px 12px; display: grid; gap: 10px; }
.op { display: grid; grid-template-columns: 18px 64px 1fr; gap: 8px; align-items: start; padding: 7px 8px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel); font-size: 12.5px; }
.op.off { opacity: .45; }
.op .type { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }
.op .type.cut { color: var(--red); } .op .type.broll { color: var(--blue); } .op .type.zoom { color: var(--yellow); }
.op .type.text { color: #ff8bd0; } .op .type.blur, .op .type.highlight { color: var(--green); } .op .type.volume { color: var(--orange); }
.resp { font-size: 12.5px; padding: 7px 9px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); }

.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.lib-item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg2); cursor: pointer; position: relative; }
.lib-item:hover { border-color: #43444e; }
.lib-item.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.lib-item .thumb { aspect-ratio: 16/9; }
.lib-item .nm { padding: 6px 8px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-item video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.share-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); }
.share-row.revoked { opacity: .5; }
.share-url { font: 11.5px var(--mono); color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice { border: 1px solid rgba(255, 165, 61, .35); background: rgba(255, 165, 61, .08); color: #ffd3a1; border-radius: 10px; padding: 9px 11px; font-size: 12.5px; }
.notice.info { border-color: rgba(110, 91, 255, .4); background: rgba(110, 91, 255, .08); color: #d6d0ff; }

.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 12.5px; }

@media (max-width: 1000px) {
  body { overflow: auto; }
  .review { height: auto; min-height: 100%; }
  .review-main { grid-template-columns: 1fr; }
  .viewer { min-height: 56vw; }
  .side { border-left: 0; border-top: 1px solid var(--line); min-height: 70vh; }
  .transport .keys, .transport .vol { display: none; }
  .page { padding: 20px 16px 80px; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 10px; gap: 8px; }
  .hide-sm { display: none !important; }
  .transport .tc { min-width: 0; }
}
.side .tabs { overflow-x: auto; scrollbar-width: none; }
.side .tabs button { padding: 10px 8px; white-space: nowrap; font-size: 12.5px; flex: none; }
.side .tabs button .ico { width: 14px; height: 14px; }
.side-body { overflow-x: hidden; }
.op > div, .resp, .plan-b > div, .cmt-body, .fb-item span { min-width: 0; overflow-wrap: anywhere; }

/* ---------- small screens ---------- */
@media (max-width: 1000px) {
  .review-main { grid-template-columns: minmax(0, 1fr); }
  .viewer { grid-template-rows: auto auto auto; min-height: 0; }
  .stage { height: min(56.25vw, 62vh); }
  .transport { flex-wrap: wrap; row-gap: 4px; }
  .timeline, .transport, .side { min-width: 0; }
}
@media (max-width: 640px) {
  .topbar .btn.sm > span { display: none; }
  .topbar .btn.sm { width: 30px; padding: 0; }
  .topbar .select { max-width: 120px; }
  .crumbs b { max-width: 38vw; }
  .transport .btn.sm > span { display: none; }
  .transport .btn.sm { width: 30px; padding: 0; }
  .transport .tc { font-size: 12px; }
  .drawbar { flex-wrap: wrap; max-width: calc(100% - 16px); justify-content: center; }
  .modal-b .row { flex-wrap: wrap; }
}

/* ---------- short-form (vertical) videos ---------- */
.thumb.portrait { background-size: contain; background-color: #050506; }
.thumb .scrub { inset: auto; }
.review.portrait .review-main { grid-template-columns: minmax(0, 1fr) minmax(400px, 38vw); }
.review.portrait .stage { padding: 14px 0 10px; background: radial-gradient(ellipse at center, #15151a 0%, #000 70%); }
.review.portrait .stage .frame { border-radius: 16px; overflow: hidden; box-shadow: 0 0 0 1px #26272d, 0 18px 50px rgba(0, 0, 0, .6); }
@media (max-width: 1000px) {
  .review.portrait .review-main { grid-template-columns: minmax(0, 1fr); }
  .review.portrait .stage { height: min(78vh, 160vw); }
}

/* ---------- motion templates ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 10px; max-height: 52vh; min-height: 0; overflow: auto; padding: 2px; }
.tpl-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg2); cursor: pointer; }
.tpl-card:hover { border-color: #43444e; }
.tpl-card.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tpl-card .thumb { aspect-ratio: 16/9; background-color: #f2f2f4; }
.tpl-card .tl-pill { position: absolute; left: 6px; top: 6px; }
.tpl-meta { padding: 7px 9px 9px; display: grid; gap: 2px; }
.tpl-purpose { font-size: 11.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tpl-detail { font-size: 12.5px; min-height: 20px; }
.tpl-uses { margin: 4px 0 0; padding-left: 18px; color: var(--dim); }
.tpl-chip-thumb { width: 26px; height: 15px; border-radius: 3px; background: #f2f2f4 center/cover; flex: none; }
.op-preview { width: 100%; border-radius: 8px; margin-top: 6px; border: 1px solid var(--line); background: #f2f2f4; }
.op .err { color: var(--red); font-size: 11.5px; margin-top: 4px; }
.op .type.motion { color: #c9c1ff; }
.tpl-card .thumb { background-size: contain; background-repeat: no-repeat; background-position: center; }

/* long, unbroken names (e.g. file names with underscores) must wrap, not stretch the card */
.auth .box { min-width: 0; }
.auth .box > * { min-width: 0; }
.auth h1, .auth p, .page-head h1, .card .title, .modal-h h3 { overflow-wrap: anywhere; word-break: break-word; }
.auth h1 { line-height: 1.25; }
.pw-row { display: grid; gap: 6px; }
.thumb.tpl-thumb { background-color: #f2f2f4; background-size: contain; }

/* full screen player: fill the screen whatever the page layout says */
.stage.is-full, .stage:fullscreen { width: 100vw !important; height: 100vh !important; height: 100dvh !important; padding: 0 !important; background: #000; }
.stage:-webkit-full-screen { width: 100vw; height: 100vh; padding: 0; background: #000; }
