@font-face { font-family: 'Vazirmatn'; src: url('fonts/Vazirmatn.woff2') format('woff2'); font-weight: 100 900; font-display: block; }
@font-face { font-family: 'JetBrains Mono'; src: url('fonts/JetBrainsMono.woff2') format('woff2'); font-weight: 500; font-display: block; }

:root {
  /* Graphite design language (after vibefarsi.ir, MIT): near-black, white primary,
     hairline borders, inset top highlight. DilmajPro's lime is the brand accent. */
  --bg: oklch(0.115 0.002 285);
  --panel: oklch(0.14 0.002 285);
  --line: oklch(1 0 0 / 8%);
  --line2: oklch(1 0 0 / 11%);
  --card: oklch(0.16 0.002 285);
  --card2: oklch(0.2 0.002 285);
  --text: oklch(0.975 0 0);
  --muted: oklch(0.63 0.004 285);
  --dim: oklch(0.52 0.004 285);
  --primary: oklch(0.975 0 0);
  --primary-fg: oklch(0.13 0 0);
  --lime: #D4FF3A;
  --lime-soft: rgba(212, 255, 58, 0.12);
  --violet: #8B7CFF;
  --cyan: #3DD9FF;
  --orange: #FF8A3D;
  --red: oklch(0.65 0.2 25);
  --radius: 22px;
  --control: 8px;
  --depth: 0 1px 0 0 oklch(1 0 0 / 6%) inset;
  --overlay-depth: 0 20px 50px -20px oklch(0 0 0 / 80%);
  --motion: 200ms cubic-bezier(0.2, 0, 0, 1);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --clip-h: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: Vazirmatn, Tahoma, sans-serif; font-size: 14.5px; line-height: 1.7; letter-spacing: 0; overflow: hidden; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: rgba(212, 255, 58, 0.3); }
button { transition: transform var(--motion), background var(--motion), border-color var(--motion), filter var(--motion); }
button:active:not(:disabled) { transform: scale(0.98); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.45; }
:focus-visible { outline: 2px solid oklch(0.7 0 0 / 60%); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.dim { color: var(--dim); }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: oklch(1 0 0 / 12%); border-radius: 10px; border: 2px solid var(--panel); }
::-webkit-scrollbar-track { background: transparent; }

.app { height: 100vh; display: flex; flex-direction: column; }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; flex: 0 0 auto; }
.top-start, .top-end { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand { gap: 10px; }
.brand-logo { height: 27px; width: auto; display: block; }
.brand-word { font-weight: 800; font-size: 19px; letter-spacing: -0.5px; }
.brand-word b { color: var(--lime); font-weight: 800; }
.nav { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line); padding: 4px; border-radius: 999px; }
.nav-item { border: 0; background: transparent; color: var(--muted); padding: 7px 14px; border-radius: 999px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.nav-item.is-on { background: var(--text); color: var(--bg); font-weight: 700; }
.soon { font-size: 10px; background: var(--card2); color: var(--muted); padding: 1px 6px; border-radius: 999px; }
.project-name input { background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 6px 10px; font-weight: 700; font-size: 15px; width: 220px; }
.project-name input:hover { border-color: var(--line2); }
.project-name input:focus { border-color: var(--lime); outline: none; background: var(--panel); }
.save-state { font-size: 12px; color: var(--dim); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.save-state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.save-state.is-saved::before { background: var(--lime); }
.save-state.is-dirty::before { background: var(--orange); }

.btn { height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card); font-size: 13px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: oklch(1 0 0 / 20%); }
.btn.lime { background: var(--primary); color: var(--primary-fg); border: 0; font-weight: 700; font-size: 14px; padding: 0 22px; }
.btn.lime:hover:not(:disabled) { filter: brightness(1.06); }
.btn.danger { background: var(--red); color: var(--bg); border: 0; font-weight: 800; }
.btn.small { height: 34px; padding: 0 14px; font-size: 12px; }
.pill { height: 32px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--card2); font-size: 12px; white-space: nowrap; }
.pill:hover:not(:disabled) { background: oklch(0.24 0.002 285); }
.pill.icon { width: 32px; padding: 0; font-size: 16px; }
.pill.lime { background: var(--primary); color: var(--primary-fg); font-weight: 700; }
.chip { font-size: 12px; background: var(--card2); color: var(--text); border-radius: 999px; padding: 6px 12px; display: inline-flex; align-items: center; gap: 6px; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.chip.on .dot { background: var(--lime); }

/* ---------- work area ---------- */
.work { flex: 1 1 auto; min-height: 0; display: flex; gap: 0; padding: 0 10px 10px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--depth); min-width: 0; }
.media-panel { flex: 0 0 var(--left-w, 320px); display: flex; flex-direction: column; overflow: hidden; }
.inspector { flex: 0 0 var(--right-w, 290px); overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.preview-panel { flex: 1 1 auto; display: flex; flex-direction: column; overflow: hidden; }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 16px 10px; }
.panel-head h2, .inspector h2, .tl-title h2 { margin: 0; font-size: 17px; font-weight: 900; }
.count { font-size: 12px; color: var(--dim); margin-inline-start: 6px; font-weight: 500; }

/* media */
.media-actions { display: flex; gap: 6px; padding: 0 16px 10px; flex-wrap: wrap; }
.media-list { flex: 1; overflow-y: auto; padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.dropzone { margin: 6px 16px 16px; flex: 1; border: 1.5px dashed var(--line2); border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; color: var(--muted); line-height: 1.9; }
.dropzone svg { color: var(--lime); }
.dropzone b { color: var(--text); font-size: 15px; }
.mcard { display: flex; gap: 10px; padding: 8px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); cursor: grab; position: relative; }
.mcard:hover { border-color: var(--line2); }
.mcard.missing { border-color: var(--red); }
.mthumb { flex: 0 0 96px; height: 54px; border-radius: 10px; background: var(--card2) center / cover no-repeat; position: relative; overflow: hidden; }
.mthumb .dur { position: absolute; bottom: 4px; left: 4px; font-family: var(--mono); font-size: 10px; background: rgba(10, 10, 11, 0.75); padding: 1px 5px; border-radius: 5px; direction: ltr; }
.mbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mname { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; text-align: right; }
.mtags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag { font-size: 10px; padding: 1px 6px; border-radius: 6px; background: var(--card2); color: var(--muted); white-space: nowrap; }
.tag.cam { color: var(--bg); font-weight: 800; }
.mprog { height: 4px; border-radius: 4px; background: var(--card2); overflow: hidden; margin-top: 2px; }
.mprog i { display: block; height: 100%; background: var(--lime); border-radius: 4px; transition: width 0.2s; }
.mstatus { font-size: 10.5px; color: var(--dim); }
.mstatus.err { color: var(--red); }
.mbtns { display: flex; flex-direction: column; gap: 4px; }
.mbtn { width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--card2); color: var(--lime); font-size: 16px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.mbtn.rm { color: var(--muted); font-size: 14px; }
.mbtn:hover { background: oklch(0.24 0.002 285); }

/* preview */
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; flex-wrap: wrap; }
.seg { display: flex; gap: 2px; background: var(--bg); border: 1px solid var(--line); padding: 4px; border-radius: 999px; }
.seg button { height: 30px; padding: 0 14px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; }
.seg button.is-on { background: var(--text); color: var(--bg); font-weight: 800; }
.stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 6px 16px; background: radial-gradient(circle at 50% 40%, oklch(0.17 0.002 285) 0%, var(--panel) 70%); }
.frame { position: relative; background: #000; border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--line2); }
.frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; background: #000; }
.frame.can-reframe { cursor: ew-resize; }
.placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; color: var(--muted); padding: 20px; background: #101012 center / cover no-repeat; line-height: 1.8; }
.placeholder .ph-inner { background: rgba(10, 10, 11, 0.78); padding: 14px 18px; border-radius: 14px; }
.placeholder .bar { width: 140px; height: 4px; border-radius: 4px; background: var(--card2); overflow: hidden; margin: 8px auto 0; }
.placeholder .bar i { display: block; height: 100%; background: var(--lime); }
.reframe-hint { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); font-size: 11px; background: rgba(10, 10, 11, 0.8); padding: 4px 10px; border-radius: 999px; white-space: nowrap; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.frame.can-reframe:hover .reframe-hint { opacity: 1; }
.transport { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 16px 14px; }
.round { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--card2); display: inline-flex; align-items: center; justify-content: center; }
.round:hover { background: oklch(0.24 0.002 285); }
.round.play { width: 52px; height: 52px; background: var(--primary); color: var(--primary-fg); }
.timecode { font-family: var(--mono); font-size: 14px; min-width: 210px; }

/* inspector */
.ins-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ins-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.ins-row .k { color: var(--muted); }
.ins-row .v { font-weight: 700; }
.ins-row .v.mono { font-family: var(--mono); font-weight: 500; direction: ltr; }
.ins-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.range { width: 100%; accent-color: var(--lime); }
.select { background: var(--card2); border: 1px solid var(--line2); border-radius: 10px; padding: 6px 10px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; font-size: 12.5px; align-items: center; }
.keys kbd { font-family: var(--mono); font-size: 11px; background: var(--card2); border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; direction: ltr; justify-self: start; white-space: nowrap; }
.keys span { color: var(--muted); }
.hint { font-size: 12px; color: var(--dim); line-height: 1.9; margin: 0; }

/* ---------- timeline ---------- */
.timeline-panel { flex: 0 0 auto; margin: 0 10px 10px; display: flex; flex-direction: column; overflow: hidden; }
.tl-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; flex-wrap: wrap; }
.tl-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.seq-tabs { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.seq-tabs::-webkit-scrollbar { display: none; }
.seq-tab { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 6px 0 12px; border-radius: 10px; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; white-space: nowrap; user-select: none; border: 1px solid transparent; transition: background var(--motion), color var(--motion); }
.seq-tab:hover { background: var(--card2); color: var(--text); }
.seq-tab.is-on { background: var(--card2); color: var(--text); font-weight: 800; border-color: var(--line2); box-shadow: inset 0 -2px 0 var(--lime); }
.seq-tab .seq-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.seq-tab .seq-asp { font-family: var(--mono); font-size: 10px; color: var(--dim); font-weight: 400; }
.seq-tab .seq-x { width: 20px; height: 20px; border: 0; border-radius: 6px; background: transparent; color: var(--dim); font-size: 14px; line-height: 1; padding: 0; opacity: 0; }
.seq-tab:hover .seq-x, .seq-tab.is-on .seq-x { opacity: 1; }
.seq-tab .seq-x:hover { background: oklch(1 0 0 / 10%); color: var(--text); }
.seq-add { flex: 0 0 auto; width: 30px; height: 30px; border: 1px dashed var(--line2); border-radius: 10px; background: transparent; color: var(--muted); font-size: 17px; line-height: 1; padding: 0; }
.seq-add:hover { color: var(--text); border-color: var(--muted); }
.tl-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.zoom { display: inline-flex; gap: 4px; margin-inline-start: 6px; }
.tl-scroll { overflow-x: auto; overflow-y: auto; max-height: var(--tl-h, 34vh); padding: 0 14px 12px; }
.tl-inner { position: relative; height: calc(var(--clip-h) + 38px); min-width: 100%; }
.ruler { position: absolute; top: 0; left: 0; right: 0; height: 24px; cursor: col-resize; }
.tick { position: absolute; top: 0; height: 24px; border-left: 1px solid var(--line2); padding-left: 4px; font-family: var(--mono); font-size: 10px; color: var(--dim); white-space: nowrap; pointer-events: none; }
.tick.minor { height: 8px; top: 16px; }
.track { position: absolute; top: 30px; left: 0; right: 0; height: var(--clip-h); background: var(--bg); border-radius: 12px; }
.track-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--dim); font-size: 13px; direction: rtl; pointer-events: none; }
.clip { position: absolute; top: 0; height: var(--clip-h); border-radius: 10px; overflow: hidden; background: var(--card2) left center / auto 100% repeat-x; border: 2px solid transparent; cursor: grab; user-select: none; }
.clip:active, .item:active { cursor: grabbing; }
input[type=range] { cursor: ew-resize; }
input[type=number], input[type=text], textarea { cursor: text; }
select, label.check, .sw-btn { cursor: pointer; }
.clip::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 10, 11, 0.15), rgba(10, 10, 11, 0.7)); pointer-events: none; }
.clip.is-sel { border-color: var(--lime); }
.clip .cbar { position: absolute; top: 0; left: 0; right: 0; height: 4px; z-index: 1; }
.clip .clabel { position: absolute; left: 10px; right: 10px; bottom: 6px; z-index: 1; font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 6px; }
.clip .clabel .d { font-family: var(--mono); font-weight: 500; color: var(--muted); }
.clip .h { position: absolute; top: 0; bottom: 0; width: 10px; z-index: 2; cursor: ew-resize; }
.clip .h::before { content: ''; position: absolute; top: 20px; bottom: 20px; left: 4px; width: 2px; border-radius: 2px; background: rgba(244, 244, 245, 0.5); }
.clip .h.in { left: 0; }
.clip .h.out { right: 0; }
.clip.is-sel .h::before { background: var(--lime); }
.clip.is-ghost { opacity: 0.4; }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--lime); box-shadow: 0 0 10px var(--lime); pointer-events: none; z-index: 5; transform: translateX(-1px); }
.playhead span { position: absolute; top: 0; left: -6px; width: 14px; height: 12px; background: var(--lime); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.drop-marker { position: absolute; top: 26px; height: calc(var(--clip-h) + 8px); width: 4px; margin-left: -2px; border-radius: 4px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); z-index: 6; pointer-events: none; }

/* ---------- overlays ---------- */
.drop-overlay { position: fixed; inset: 0; z-index: 40; background: rgba(5, 5, 6, 0.82); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.drop-overlay > div { border: 2px dashed var(--lime); border-radius: 28px; padding: 48px 64px; text-align: center; color: var(--lime); }
.drop-overlay p { margin: 12px 0 0; font-size: 20px; font-weight: 800; color: var(--text); }
.modal-back { position: fixed; inset: 0; z-index: 30; background: rgba(5, 5, 6, 0.78); display: flex; align-items: flex-start; justify-content: center; padding: 80px 16px 16px; overflow-y: auto; }
.modal { width: 100%; max-width: 600px; background: oklch(0.16 0.002 285); border: 1px solid var(--line2); border-radius: 26px; box-shadow: var(--overlay-depth), var(--depth); padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.modal h2 { margin: 0; font-size: 24px; font-weight: 900; }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal p { margin: 0; color: var(--muted); line-height: 1.9; }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.opt { text-align: right; display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 16px; border: 2px solid var(--line2); background: var(--card); }
.opt b { font-size: 15px; }
.opt span { font-size: 12px; color: var(--muted); direction: ltr; text-align: right; font-family: var(--mono); }
.opt.is-on { border-color: var(--lime); background: rgba(212, 255, 58, 0.06); }
.field { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--card); border-radius: 14px; font-size: 13px; }
.field .path { direction: ltr; font-family: var(--mono); font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; text-align: left; }
.row-end { display: flex; gap: 8px; justify-content: flex-start; flex-wrap: wrap; }
.big { height: 52px; font-size: 16px; justify-content: center; flex: 1; }
.prog-list { display: flex; flex-direction: column; gap: 10px; }
.prog-item { padding: 12px 14px; background: var(--card); border-radius: 14px; display: flex; flex-direction: column; gap: 8px; }
.prog-item .top-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.prog-bar { height: 6px; border-radius: 6px; background: var(--card2); overflow: hidden; }
.prog-bar i { display: block; height: 100%; background: var(--lime); border-radius: 6px; transition: width 0.25s; }
.ok { color: var(--lime); font-weight: 700; }
.bad { color: var(--red); font-weight: 700; }
.err-detail { font-family: var(--mono); font-size: 10.5px; color: var(--muted); direction: ltr; text-align: left; white-space: pre-wrap; max-height: 90px; overflow: auto; }

.toasts { position: fixed; bottom: 20px; left: 20px; z-index: 50; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.toast { background: oklch(0.16 0.002 285); border: 1px solid var(--line2); border-radius: 14px; padding: 12px 16px; font-size: 13px; line-height: 1.8; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); animation: toast-in 0.2s ease; }
.toast.ok { border-color: rgba(212, 255, 58, 0.5); color: var(--text); font-weight: 500; }
.toast.err { border-color: rgba(255, 92, 122, 0.6); color: var(--text); font-weight: 500; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 1280px) {
  .media-panel { flex-basis: 270px; }
  .inspector { flex-basis: 250px; }
  .project-name input { width: 150px; }
  #btnOpen { display: none; }
}

/* ---------- session: user, task timer, login ---------- */
.session { display: flex; align-items: center; gap: 8px; }
.timer-chip { height: 40px; max-width: 320px; padding: 0 14px; border-radius: 999px; border: 1px dashed var(--line2); background: transparent; color: var(--muted); font-size: 12.5px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.timer-chip .tdot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: 0 0 auto; }
.timer-chip.on { border: 1px solid rgba(212, 255, 58, 0.45); color: var(--text); background: rgba(212, 255, 58, 0.06); }
.timer-chip.on .tdot { background: var(--lime); box-shadow: 0 0 8px var(--lime); animation: tpulse 1.6s ease-in-out infinite; }
.timer-chip.paused { border: 1px solid rgba(255, 138, 61, 0.5); color: var(--text); }
.timer-chip.paused .tdot { background: var(--orange); }
.timer-chip .ttl { overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.timer-chip .tclock { font-family: var(--mono); color: var(--muted); }
@keyframes tpulse { 50% { opacity: 0.35; } }
.user-chip { height: 40px; padding: 0 6px 0 14px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card); display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.user-chip .av { width: 28px; height: 28px; border-radius: 50%; background: var(--lime); color: var(--bg); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.user-chip .un { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login { display: flex; flex-direction: column; gap: 14px; text-align: center; align-items: stretch; }
.login-logo { height: 44px; width: auto; align-self: center; }
.login h2 { margin: 0; }
.login p { margin: 0; }
.login form { display: flex; flex-direction: column; gap: 10px; text-align: right; }
.login label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.login input, .search, .field-input { height: 44px; border-radius: 12px; border: 1px solid var(--line2); background: oklch(0.115 0.002 285 / 60%); padding: 0 14px; font-size: 15px; }
.login input:focus, .search:focus, .field-input:focus { outline: none; border-color: oklch(1 0 0 / 30%); }
.login .adv summary { font-size: 12px; color: var(--dim); cursor: pointer; }
.login .adv input { margin-top: 8px; width: 100%; }
.login .or { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 12px; }
.login .or::before, .login .or::after { content: ''; flex: 1; height: 1px; background: var(--line2); }
.form-err { background: rgba(255, 92, 122, 0.12); border: 1px solid rgba(255, 92, 122, 0.4); border-radius: 12px; padding: 10px 12px; font-size: 13px; text-align: right; }
.search { width: 100%; }
.task-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.task-item { text-align: right; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
.task-item:hover { border-color: oklch(1 0 0 / 20%); }
.task-item.is-on { border-color: var(--lime); }
.task-item .ti-main { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.task-item .ti-sub { font-size: 12px; color: var(--muted); }
.task-item .ti-meta { display: flex; gap: 6px; }
.tag.ok { background: rgba(212, 255, 58, 0.14); color: var(--lime); }
.tag.warn { background: rgba(255, 138, 61, 0.16); color: var(--orange); }
.check { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.check input { width: 18px; height: 18px; accent-color: var(--lime); }
.field-input.mini { height: 32px; width: 150px; font-size: 13px; padding: 0 10px; border-radius: 10px; }
.login form .big { flex: 0 0 auto; }

/* ---------- 0.2: library panel ---------- */
.lib-tabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin: 12px 12px 4px; background: var(--bg); border: 1px solid var(--line); padding: 4px; border-radius: 999px; flex: 0 0 auto; }
.lib-tabs button { height: 30px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; padding: 0; }
.lib-tabs button.is-on { background: var(--text); color: var(--bg); font-weight: 800; }
.lib-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.lib-body.media-host { padding: 0; overflow: hidden; }
.media-host .media-list { flex: 1; }
.lib-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px 0; }
.lib-head h2 { margin: 0; font-size: 17px; font-weight: 900; }
.lib-hint { font-size: 11.5px; color: var(--dim); line-height: 1.8; margin: 0 4px; }
.lib-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip-btn { height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; color: var(--muted); font-size: 11.5px; }
.chip-btn.is-on { background: var(--lime-soft); border-color: rgba(212, 255, 58, 0.5); color: var(--lime); font-weight: 700; }
.lib-search { height: 36px; font-size: 13px; }
.lib-row { display: flex; gap: 6px; flex-wrap: wrap; }
.lib-section { display: flex; flex-direction: column; gap: 8px; }
.lib-section h3 { margin: 4px 4px 0; font-size: 13px; font-weight: 800; }
.full { width: 100%; justify-content: center; }
.seg.small button { height: 26px; padding: 0 10px; font-size: 11.5px; }
.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 0; padding: 0; border-radius: 14px; border: 1px solid var(--line); background: var(--card); overflow: hidden; text-align: right; cursor: grab; }
.tile:hover:not(:disabled) { border-color: oklch(1 0 0 / 22%); }
.tile.is-on { border-color: var(--lime); }
.tile-stage { display: block; position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: radial-gradient(circle at 50% 35%, #2a2a30, #0d0d10 75%); pointer-events: none; }
.tile-name { font-size: 11.5px; font-weight: 700; padding: 6px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-tile { cursor: pointer; }
.tr-ico { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; font-size: 26px; color: var(--lime); background: radial-gradient(circle at 50% 40%, #25252b, #0d0d10 80%); }
.tr-flash, .tr-flash-soft { color: #fff; }
.sfx-list { display: flex; flex-direction: column; gap: 4px; }
.sfx-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.sfx-name { flex: 1; font-size: 12.5px; font-weight: 600; }
.sfx-dur { font-family: var(--mono); font-size: 10.5px; color: var(--dim); }
.look-list { display: flex; flex-direction: column; gap: 4px; }
.look-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); text-align: right; }
.look-row.is-on { border-color: var(--lime); background: rgba(212, 255, 58, 0.06); }
.look-row .sw { display: flex; height: 24px; width: 96px; flex: 0 0 auto; border-radius: 7px; overflow: hidden; }
.look-row .sw i { flex: 1; }
.look-row .sw.none { width: auto; align-items: center; font-size: 12px; color: var(--muted); padding: 0 4px; }
.look-name { font-size: 12.5px; font-weight: 600; }

/* ---------- 0.2: preview compositor ---------- */
.glc { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; visibility: hidden; }
.frame .placeholder { z-index: 2; }
.tr-flash { position: absolute; inset: 0; z-index: 3; opacity: 0; pointer-events: none; background: #fff; }
.ov-wrap { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
#ovStage { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
/* behind the subject: overlays under a cut-out of the person */
.behind-wrap { z-index: 1; }
#ovBehind { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.fgc { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; visibility: hidden; }
.frame video.matte-vid { display: none; }
/* on-image transform box (like Photoshop's free transform) */
/* lives in the stage (not the frame) so it stays visible when the picture is bigger than the frame;
   handles are placed by script and kept inside the stage */
.stage { position: relative; overflow: hidden; }
.tf-layer { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.tf-box { position: absolute; border: 1.5px dashed var(--lime); transform-origin: 50% 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); }
.tf-layer i, .tf-layer b, .tf-layer u { position: absolute; pointer-events: auto; background: var(--lime); border: 1px solid #111; transform: translate(-50%, -50%); }
.tf-layer i { width: 13px; height: 13px; border-radius: 3px; cursor: nwse-resize; }
.tf-layer i[data-h="ne"], .tf-layer i[data-h="sw"] { cursor: nesw-resize; }
.tf-layer b { width: 15px; height: 15px; border-radius: 50%; cursor: grab; }
.tf-layer u { width: 26px; height: 26px; border-radius: 50%; cursor: move; text-decoration: none; color: #111; font-size: 15px; line-height: 24px; text-align: center; }
/* manual roto */
.roto-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; }
.frame.roto-drawing { cursor: crosshair; box-shadow: 0 0 0 2px #ff9f1c, 0 30px 80px rgba(0, 0, 0, 0.6); }
.roto-bar { position: absolute; top: 50%; left: 10px; transform: translateY(-50%); z-index: 7; display: flex; flex-direction: column; gap: 6px; align-items: stretch; width: 170px; padding: 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); font-size: 12px; }
.roto-bar .pill.is-on { background: var(--lime); color: #111; }
.roto-bar .hint { color: var(--muted); font-size: 11px; }
/* right-click menu */
.ctx-menu, .ctx-sub { position: fixed; z-index: 10000; min-width: 210px; padding: 5px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line2, var(--line)); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55); direction: rtl; }
.ctx-menu button { display: block; width: 100%; text-align: right; padding: 7px 10px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; font-size: 12.5px; }
.ctx-menu button:hover:not(:disabled) { background: var(--card); }
.ctx-menu button.has-sub::after { content: '‹'; float: left; opacity: 0.6; }
.ctx-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.ctx-subwrap { position: relative; }
.ctx-sub { position: absolute; top: -5px; right: 100%; display: none; }
.ctx-subwrap:hover > .ctx-sub { display: block; }
/* keyframes on the timeline + record button */
.kfm { position: absolute; bottom: 3px; width: 9px; height: 9px; margin-left: -4.5px; background: var(--lime); border: 1px solid #111; transform: rotate(45deg); z-index: 3; cursor: pointer; }
.rec-btn { width: 100%; margin: 6px 0 4px; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.rec-btn.on { background: #ff3d55; border-color: #ff3d55; color: #fff; }
.fx-card .fx-presets { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 8px; }
.fx-card .fx-presets .pill { font-size: 11.5px; padding: 4px 9px; }
/* effect controls */
.fx-card .fx-ctl { display: grid; grid-template-columns: 74px 22px 1fr 58px 14px; align-items: center; gap: 6px; padding: 3px 0; }
.fx-card .fx-ctl .k { font-size: 12px; }
.fx-card .kf-btn { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; padding: 0; }
.fx-card .kf-btn.anim { color: var(--lime); }
.fx-card .kf-btn.on { background: var(--lime); color: #111; border-color: var(--lime); }
.fx-card .fx-num { width: 58px; background: var(--card); color: inherit; border: 1px solid var(--line); border-radius: 7px; padding: 3px 5px; font: inherit; font-size: 12px; }
.fx-card .u { font-size: 11px; color: var(--muted); }
.fx-card .fx-nav { display: flex; gap: 6px; align-items: center; margin: 4px 0 6px; }
.fx-card .fx-nav .select { flex: 1; }
.fx-card .fx-flips { display: flex; gap: 14px; margin: 6px 0; }
.frame.picking { cursor: crosshair; box-shadow: 0 0 0 2px var(--lime), 0 30px 80px rgba(0, 0, 0, 0.6); }
.frame .reframe-hint { z-index: 5; }
.frame.can-move .ov-item[data-ov] { outline: none; }

/* ---------- 0.2: timeline lanes ---------- */
.lanes { position: absolute; left: 0; right: 0; top: 0; height: 0; }
.lane-bg { position: absolute; left: 0; right: 0; background: oklch(0.115 0.002 285 / 70%); border-radius: 10px; }
.lane-name { position: sticky; left: 0; display: inline-block; font-size: 10px; color: var(--dim); padding: 6px 8px; direction: rtl; pointer-events: none; }
.item { position: absolute; height: 28px; border-radius: 8px; overflow: hidden; cursor: grab; user-select: none; border: 1.5px solid transparent; display: flex; align-items: center; z-index: 2; }
.item .ilabel { flex: 1; font-size: 11px; font-weight: 700; padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--bg); }
.item .h { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.item .h.in { left: 0; }
.item .h.out { right: 0; }
.item.is-sel { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25); }
.ovi { background: var(--lime); }
.ovi.cat-logo { background: var(--violet); }
.ovi.cat-logo .ilabel { color: #fff; }
.ovi.cat-sticker { background: var(--orange); }
.aui.music { background: var(--cyan); }
.aui.sfx { background: oklch(0.75 0.13 160); }
.cut { position: absolute; top: 18px; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; border: 1px solid var(--line2); background: var(--panel); color: var(--muted); font-size: 12px; z-index: 3; padding: 0; display: flex; align-items: center; justify-content: center; opacity: 0.85; }
.cut:hover { color: var(--lime); border-color: var(--lime); opacity: 1; }
.cut.has { color: var(--lime); border-color: rgba(212, 255, 58, 0.6); background: #1a1d10; }
.clip .cb { font-style: normal; color: var(--lime); font-weight: 800; }
.track { z-index: 1; }

/* ---------- 0.2: inspector controls ---------- */
.ins-row.col { flex-direction: column; align-items: stretch; gap: 6px; }
.ins-row.col .k { display: flex; justify-content: space-between; }
.ins-row .k .v { font-weight: 700; color: var(--text); font-size: 12px; }
.field-input.area { height: auto; min-height: 60px; padding: 8px 12px; resize: vertical; font-size: 14px; line-height: 1.7; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sw-btn { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line2); padding: 0; }
.sw-btn.is-on { border-color: var(--lime); box-shadow: 0 0 0 2px rgba(212, 255, 58, 0.3); }
.swatches input[type=color] { width: 30px; height: 26px; border: 0; background: none; padding: 0; cursor: pointer; }
.pos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 120px; align-self: center; direction: ltr; }
.pos-grid button { height: 26px; border-radius: 6px; border: 1px solid var(--line2); background: var(--card2); }
.pos-grid button.is-on { background: var(--lime); border-color: var(--lime); }
.fx-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.fx-row span { flex: 0 0 80px; }
.keys-box summary { font-size: 12px; color: var(--dim); cursor: pointer; margin-bottom: 8px; }
.kit-mini { height: 28px; max-width: 90px; object-fit: contain; }
.kit-colors { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.kit-colors i { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line2); }
.warn-text { color: var(--orange); }

/* ---------- 0.2: client style form ---------- */
.kit-form { display: flex; flex-direction: column; gap: 14px; }
.kit-logo { display: flex; align-items: center; justify-content: center; min-height: 70px; padding: 12px; border-radius: 14px; background: repeating-conic-gradient(#1b1b1f 0 25%, #141417 0 50%) 0 0 / 16px 16px; }
.kit-logo img { max-height: 70px; max-width: 70%; object-fit: contain; }
.kit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kit-grid label, .kit-row { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.kit-grid input[type=color] { width: 100%; height: 38px; border: 1px solid var(--line2); border-radius: 10px; background: var(--card2); padding: 3px; }
.ins-row .select { max-width: 62%; min-width: 0; }
.ins-row > .pill { max-width: 62%; overflow: hidden; text-overflow: ellipsis; }

.grade-card .grade-row { gap: 2px; }
.grade-card .range { height: 18px; }
.pill.snap.is-on { background: var(--lime-soft); color: var(--lime); box-shadow: inset 0 0 0 1px rgba(212, 255, 58, 0.45); }
.marquee { position: absolute; z-index: 8; border: 1px solid var(--lime); background: rgba(212, 255, 58, 0.08); border-radius: 4px; pointer-events: none; }
.tools { display: flex; gap: 6px; }
.tools .pill.is-on { background: var(--lime); color: var(--bg); }
.frame.tool-text { cursor: text; }

/* ---------- workspace: resizable panels, swapped sides, themes ---------- */
.split { flex: 0 0 10px; position: relative; z-index: 3; }
.split.v { cursor: col-resize; }
.split.h { height: 10px; margin: -4px 10px 0; cursor: row-resize; flex: 0 0 auto; }
.split::after { content: ''; position: absolute; border-radius: 4px; background: transparent; transition: background var(--motion); }
.split.v::after { top: 30%; bottom: 30%; left: 4px; width: 2px; }
.split.h::after { left: 45%; right: 45%; top: 4px; height: 2px; }
.split:hover::after, .split.is-drag::after { background: var(--lime); }
.work.swapped { flex-direction: row-reverse; }
.nav-item.icon { padding: 7px 10px; }
.ws-menu { position: fixed; z-index: 45; min-width: 240px; background: var(--card); border: 1px solid var(--line2); border-radius: 16px; padding: 10px; box-shadow: var(--overlay-depth); display: flex; flex-direction: column; gap: 6px; }
.ws-menu h4 { margin: 4px 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.ws-menu .row { display: flex; gap: 6px; flex-wrap: wrap; }
.ws-menu button { text-align: right; }
.theme-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; vertical-align: middle; margin-inline-start: 6px; border: 1px solid var(--line2); }

:root[data-theme="midnight"] {
  --bg: oklch(0.15 0.03 265); --panel: oklch(0.19 0.035 265); --card: oklch(0.22 0.035 265); --card2: oklch(0.26 0.04 265);
  --line: oklch(1 0 0 / 9%); --line2: oklch(1 0 0 / 13%);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: oklch(0.955 0.003 285); --panel: oklch(0.99 0 0); --card: oklch(0.975 0.002 285); --card2: oklch(0.93 0.003 285);
  --line: oklch(0 0 0 / 8%); --line2: oklch(0 0 0 / 13%);
  --text: oklch(0.2 0.005 285); --muted: oklch(0.45 0.005 285); --dim: oklch(0.55 0.005 285);
  --primary: oklch(0.2 0.005 285); --primary-fg: oklch(0.98 0 0);
  --lime: #6E8F00; --lime-soft: rgba(110, 143, 0, 0.12);
  --depth: 0 1px 2px 0 oklch(0 0 0 / 6%);
}
:root[data-theme="light"] .clip .clabel, :root[data-theme="light"] .tick { color: var(--text); }
:root[data-theme="light"] .nav-item.is-on, :root[data-theme="light"] .seg button.is-on { background: var(--text); color: var(--panel); }
:root[data-theme="light"] .stage { background: radial-gradient(circle at 50% 40%, oklch(0.9 0.003 285) 0%, var(--panel) 70%); }
.stage { overflow: hidden; }
.stage.can-pan, .stage.can-pan * { cursor: grab !important; }
.zoomctl { display: flex; gap: 4px; align-items: center; }
.zoomctl #zoomLabel { min-width: 78px; font-family: var(--mono); font-size: 11.5px; }
.ovi.cat-video { background: oklch(0.72 0.12 200); }
.icon-opts { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.icon-tile { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: inherit; padding: 9px; cursor: grab; display: flex; align-items: center; justify-content: center; }
.icon-tile:hover { border-color: var(--lime); background: var(--card2); }
.icon-tile svg { width: 100%; height: 100%; }
.ovi.cat-icon { background: oklch(0.78 0.14 75); }

/* ---------- graphics editor ---------- */
.gfx { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 78px 1fr 320px; gap: 10px; padding: 0 10px 10px; }
.gfx[hidden] { display: none; }
.gfx-tools { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 6px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.gfx-tools button { border: 0; background: transparent; color: var(--text); border-radius: 12px; padding: 8px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--muted); }
.gfx-tools button b { font-size: 20px; color: var(--text); line-height: 1; }
.gfx-tools button:hover { background: var(--card2); }
.gfx-sep { height: 1px; background: var(--line2); margin: 6px 8px; }
.gfx-stage { position: relative; background: radial-gradient(circle at 50% 40%, oklch(0.17 0.002 285) 0%, var(--panel) 70%); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; display: flex; align-items: center; justify-content: center; min-width: 0; }
.gfx-paper { position: relative; flex: 0 0 auto; box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 1px var(--line2); margin: 30px; }
.gfx-paper.transparent { background: repeating-conic-gradient(#2a2a2e 0 25%, #1c1c1f 0 50%) 0 0 / 20px 20px; }
.gfx-paper canvas { width: 100%; height: 100%; display: block; }
.gfx-sel { position: absolute; border: 1.5px solid var(--lime); pointer-events: none; transform-origin: center; }
.gfx-sel i { position: absolute; width: 12px; height: 12px; background: var(--lime); border-radius: 3px; pointer-events: auto; }
.gfx-sel i[data-h="nw"] { left: -7px; top: -7px; cursor: nwse-resize; }
.gfx-sel i[data-h="ne"] { right: -7px; top: -7px; cursor: nesw-resize; }
.gfx-sel i[data-h="sw"] { left: -7px; bottom: -7px; cursor: nesw-resize; }
.gfx-sel i[data-h="se"] { right: -7px; bottom: -7px; cursor: nwse-resize; }
.gfx-sel i.rot { left: 50%; top: -30px; margin-left: -7px; border-radius: 50%; cursor: grab; }
.gfx-zoom { position: absolute; bottom: 10px; left: 10px; display: flex; gap: 4px; align-items: center; background: var(--card); border-radius: 999px; padding: 4px; }
.gfx-zoom button { border: 0; background: var(--card2); color: var(--text); border-radius: 999px; height: 26px; min-width: 26px; padding: 0 8px; }
.gfx-zoom span { font-family: var(--mono); font-size: 11px; min-width: 44px; text-align: center; }
.gfx-side { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.gfx-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.gfx-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.gfx-row.col { flex-direction: column; align-items: stretch; gap: 2px; }
.gfx-row.col span { display: flex; justify-content: space-between; color: var(--muted); }
.gfx-row.col b { color: var(--text); font-weight: 700; font-size: 11.5px; }
.gfx-layers { display: flex; flex-direction: column; gap: 3px; max-height: 240px; overflow-y: auto; }
.gfx-layer { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; background: var(--card2); cursor: pointer; font-size: 12.5px; }
.gfx-layer span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gfx-layer.is-on { outline: 1.5px solid var(--lime); }
.gfx-layer .eye { border: 0; background: transparent; color: var(--muted); width: 22px; font-size: 12px; }
.gfx-pop { position: absolute; z-index: 30; top: 70px; right: 100px; width: 420px; max-height: 70vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line2); border-radius: 18px; padding: 12px; box-shadow: var(--overlay-depth); display: flex; flex-direction: column; gap: 10px; }
.gfx-pop-head { display: flex; gap: 8px; }
.nav-item.gfx-nav.is-on { background: var(--lime); color: #0a0a0b; font-weight: 800; }
.gfx { position: relative; }

/* ---------- docked panels ---------- */
.dock-r { flex: 0 0 var(--right-w, 290px); display: flex; flex-direction: column; overflow: hidden; }
.dock-r .inspector { flex: 1 1 auto; min-height: 0; border: 0; }
.lib2 { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; overflow: hidden; }
.lib2.only-head { flex: 0 0 auto; }
.lib-tabs button[draggable="true"] { cursor: grab; }
.lib-tabs.drop-here { box-shadow: 0 0 0 2px var(--lime); }
.lib-tabs.empty { display: flex; justify-content: center; color: var(--dim); font-size: 12px; padding: 6px; }

/* video layer: split-screen places */
.slot-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; direction: ltr; margin: 6px 0 8px; }
.slot-grid .slot { position: relative; width: 100%; border-radius: 5px; border: 1px solid var(--line2); background: var(--card2); padding: 0; cursor: pointer; overflow: hidden; justify-self: center; }
.slot-grid .slot i { position: absolute; background: var(--text-3, #6b6b72); border-radius: 2px; opacity: 0.55; }
.slot-grid .slot:hover i { opacity: 0.85; }
.slot-grid .slot.is-on { border-color: var(--lime); }
.slot-grid .slot.is-on i { background: var(--lime); opacity: 1; }

/* subtitle editor */
.sub-edit-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.sub-edit-tools .search { width: 140px; }
.sub-edit-list { max-height: 52vh; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding-inline-end: 4px; }
.sub-edit-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.sub-edit-row textarea { min-height: 36px; resize: vertical; }
.row.sub-opts { padding-top: 0; }
.pill.full { width: 100%; margin-bottom: 8px; }

/* Premiere-like docking: whole panel lights up as a drop target; floating panels */
.dock-drop { outline: 2px solid var(--lime); outline-offset: -2px; box-shadow: inset 0 0 0 9999px rgba(212, 255, 58, 0.06); }
body.tab-dragging .preview-panel, body.tab-dragging .timeline-panel { outline: 2px dashed rgba(212, 255, 58, 0.35); outline-offset: -4px; }
.float-panel { position: fixed; z-index: 60; display: flex; flex-direction: column; resize: both; overflow: hidden; min-width: 240px; min-height: 200px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.5); border: 1px solid var(--line2); }
.float-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; cursor: move; border-bottom: 1px solid var(--line); flex: 0 0 auto; user-select: none; }
.float-head .float-title { flex: 1; font-size: 12px; color: var(--muted, #9a9aa2); }
.float-grip { opacity: 0.6; }
.float-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.ws-menu .row.wrap { flex-wrap: wrap; }
.ws-custom { display: inline-flex; align-items: center; gap: 2px; }
.round.small { width: 22px; height: 22px; font-size: 12px; }

.lib-chips.icat { flex-wrap: wrap; max-height: 86px; overflow: auto; }
.ic-menu { position: fixed; display: flex; flex-direction: column; gap: 6px; padding: 8px; width: 190px; }

/* empty space on the main track */
.clip.gap { background: repeating-linear-gradient(135deg, rgba(255,255,255,0.035) 0 8px, transparent 8px 16px) !important; border: 1px dashed var(--line2); box-shadow: none; }
.clip.gap .clabel { opacity: 0.6; }

/* typing on the picture */
.canvas-edit { position: fixed; z-index: 80; background: rgba(0,0,0,0.35); border: 1.5px dashed var(--lime); border-radius: 8px; padding: 2px 8px;
  text-align: center; resize: none; overflow: hidden; outline: none; text-shadow: 0 1px 6px rgba(0,0,0,0.6); }
