:root {
  --bg: #0e0f13;
  --panel: #16181f;
  --panel-2: #1d2029;
  --border: #2a2e3a;
  --text: #e9eaf0;
  --muted: #9097a8;
  --accent: #8b5cf6;
  --accent-2: #f59e0b;
  --ok: #22c55e;
  --err: #ef4444;
  --warn: #f59e0b;
  --info: #38bdf8;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6fa; --panel: #ffffff; --panel-2: #f0f1f6; --border: #dfe2ea;
    --text: #171923; --muted: #5f6678; color-scheme: light;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
[hidden] { display: none !important; }
code { font-family: var(--mono); font-size: 12px; }
h3 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
h3 small { color: var(--muted); font-weight: 400; font-size: 12px; }
.muted { color: var(--muted); }

/* ---------- top & layout ---------- */
.topbar { height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
  border-bottom: 1px solid var(--border); background: var(--panel); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { font-size: 26px; }
.brand b { display: block; font-size: 16px; }
.brand small { color: var(--muted); font-size: 12px; }
.health { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }

.layout { display: grid; grid-template-columns: 76px 1fr; min-height: calc(100vh - 60px); }
.rail { display: flex; flex-direction: column; gap: 4px; padding: 12px 8px; background: var(--panel); border-right: 1px solid var(--border);
  position: sticky; top: 60px; height: calc(100vh - 60px); align-self: start; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.rail button { flex: none; }
.rail button { font: inherit; font-size: 11px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px;
  border: 1px solid transparent; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.rail button span { font-size: 20px; }
.rail button:hover { background: var(--panel-2); color: var(--text); }
.rail button.on { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--text); }
main { padding: 20px 24px 60px; min-width: 0; }

/* ---------- buttons & fields ---------- */
.btn { font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px; text-align: center; }
.btn:hover { filter: brightness(1.12); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent { background: color-mix(in srgb, var(--accent-2) 18%, var(--panel-2)); border-color: color-mix(in srgb, var(--accent-2) 55%, transparent); }
.btn.danger { color: var(--err); }
.btn.danger:not(.ghost) { background: color-mix(in srgb, var(--err) 14%, var(--panel-2)); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.field { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12px; color: var(--muted); font-weight: 600; }
input[type=text], input[type=password], input[type=number], input[type=url], input[type=search], input:not([type]), textarea, select {
  font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 10px; width: 100%; }
textarea { resize: vertical; }
/* angka: tombol panah bawaan browser (kotak putih) disembunyikan, muncul samar saat hover/fokus; ↑ ↓ di keyboard tetap jalan */
input[type=number] { font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { opacity: 0; margin: 0; }
input[type=number]:hover::-webkit-inner-spin-button, input[type=number]:focus::-webkit-inner-spin-button { opacity: .45; }
input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 0; }

/* ---------- project header & tabs ---------- */
.project-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.title-input { font-size: 22px !important; font-weight: 700; background: transparent !important; border-color: transparent !important; padding: 2px 6px !important; margin-left: -6px; }
.title-input:hover { border-color: var(--border) !important; }
.ws-line { color: var(--muted); font-size: 12px; margin-top: 2px; word-break: break-all; }
.head-actions { display: flex; gap: 8px; align-items: center; }
.badge { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--border); }
.badge.running { color: var(--info); border-color: var(--info); }
.badge.awaiting_review { color: var(--warn); border-color: var(--warn); }
.badge.ready_to_render { color: var(--ok); border-color: var(--ok); }
.badge.completed { color: var(--ok); border-color: var(--ok); }
.badge.error { color: var(--err); border-color: var(--err); }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs button { font: inherit; font-weight: 600; background: none; border: none; color: var(--muted); padding: 10px 14px;
  border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--panel-2); font-size: 11px; margin-right: 4px; border: 1px solid var(--border); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs button.active span { background: var(--accent); color: #fff; border-color: var(--accent); }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-3 .card { margin: 0; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.grid-5 .field { margin-top: 0; }
.next-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---------- media ---------- */
.dropzone { display: grid; place-items: center; text-align: center; min-height: 110px; padding: 14px; border: 2px dashed var(--border);
  border-radius: 10px; cursor: pointer; color: var(--muted); transition: .15s; position: relative; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone small { font-size: 12px; }
.dropzone .progress { width: 100%; height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; margin-top: 8px; }
.dropzone .progress i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.file-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.file-list li { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; align-items: center; background: var(--panel-2);
  border-radius: 9px; padding: 6px; }
.file-list .thumb { width: 96px; height: 54px; border-radius: 6px; background: #000; object-fit: cover; display: grid; place-items: center; font-size: 22px; }
.file-list .meta { min-width: 0; }
.file-list .meta b { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .meta small { color: var(--muted); font-size: 11px; }
.icon-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 4px 8px; border-radius: 6px; }
.icon-btn:hover { color: var(--err); background: var(--panel); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 12px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--border); background: var(--panel-2);
  color: var(--text); cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: color-mix(in srgb, var(--accent) 22%, transparent); border-color: var(--accent); }

/* ---------- style ---------- */
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.style-card { text-align: left; font: inherit; color: var(--text); background: var(--panel-2); border: 2px solid var(--border);
  border-radius: 12px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: .15s; }
.style-card:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); transform: translateY(-1px); }
.style-card.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--panel-2)); }
.style-card .em { font-size: 26px; }
.style-card b { font-size: 14px; }
.style-card .tag { font-size: 11px; color: var(--accent-2); font-weight: 600; }
.style-card small { color: var(--muted); font-size: 12px; }
.style-card.mine { border-style: dashed; }
/* preview gaya: kiri asli, kanan hasil look (lib/stylepreview.js) */
.style-preview { position: relative; display: block; box-sizing: border-box; width: 100%; margin-bottom: 4px; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--panel); }
.style-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.style-preview::before, .style-preview::after { position: absolute; bottom: 4px; padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 600;
  color: #fff; background: rgb(0 0 0 / .55); }
.style-preview::before { content: 'Asli'; left: 4px; }
.style-preview::after { content: 'Gaya'; right: 4px; }
.style-preview.big { max-width: 420px; margin-top: 8px; }
.hint.err { color: var(--err); }
.look-row { display: flex; gap: 8px; flex-wrap: wrap; }
.look-row { margin-bottom: 8px; }
#styleLook { font-family: ui-monospace, monospace; font-size: 12px; }
.style-preview.no-preview { display: grid; place-items: center; font-size: 12px; color: var(--muted); border: 1px dashed var(--border); }
.style-preview.no-preview button { position: absolute; inset: 0; font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.style-preview.no-preview:has(button):hover { color: var(--text); border-color: var(--accent); }
.style-preview.no-preview::before, .style-preview.no-preview::after, .style-preview.photo::before, .style-preview.photo::after { content: none; }
.style-card.off { opacity: .5; }
.style-active-count { margin: -6px 0 14px; }
.style-card.lib { position: relative; }
.style-card.lib.off:hover { opacity: .8; }
/* sakelar on/off */
.switch { position: absolute; top: 12px; right: 12px; width: 38px; height: 22px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 11px; background: var(--border); transition: background .15s; pointer-events: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.style-card.lib { cursor: default; display: flex; flex-direction: column; gap: 4px; }
.style-card.lib:hover { transform: none; }
.style-card.lib details { font-size: 12px; margin-top: 4px; }
.style-card.lib details p { margin: 6px 0 0; white-space: pre-wrap; color: var(--text); }
.style-card.lib .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
#myStyles, #builtinStyles { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.style-dialog { width: min(720px, calc(100vw - 32px)); }
.style-ref { margin-bottom: 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.style-ref summary { cursor: pointer; font-weight: 600; }
.style-ref summary small { font-weight: 400; }
.style-ref > :not(summary) { margin-top: 10px; }
.style-ref .dropzone { min-height: 80px; }
/* selama analisis referensi hanya judul & status yang tampil; form muncul lagi berisi hasilnya */
#styleForm.analyzing > :not(.lib-head, .style-ref-status) { display: none; }
#styleForm.analyzing .style-ref-status { padding: 24px 0; text-align: center; font-size: 14px; white-space: pre-line; }
.style-form-row { display: grid; grid-template-columns: 90px 1fr 1fr; gap: 0 12px; }
@media (max-width: 600px) { .style-form-row { grid-template-columns: 1fr; } }
#styleSnippets, .snippet-chips { margin-bottom: 6px; }
.field > label small { font-weight: 400; }

/* ---------- steps ---------- */
.suggest-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.suggest-row .btn { line-height: 1.25; }
.step-list { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; gap: 8px; counter-reset: step; }
.step-list li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: start; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px; counter-increment: step; }
.step-list li::before { content: counter(step); width: 30px; height: 30px; border-radius: 50%; background: var(--accent);
  color: #fff; display: grid; place-items: center; font-weight: 700; }
.step-list textarea { background: var(--panel); min-height: 42px; }
.step-list .ops { display: flex; flex-direction: column; gap: 2px; }
.step-list .ops button { background: none; border: 1px solid transparent; color: var(--muted); cursor: pointer; border-radius: 6px; padding: 2px 7px; }
.step-list .ops button:hover { color: var(--text); border-color: var(--border); }
.step-list .empty-steps { display: block; text-align: center; color: var(--muted); padding: 20px; border: 1px dashed var(--border); }
.step-list .empty-steps::before { display: none; }

/* ---------- run ---------- */
.run-controls { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.mode { display: flex; gap: 10px; flex-wrap: wrap; }
.run-choice-title { flex-basis: 100%; margin: 0; font-weight: 600; font-size: 14px; }
.phases { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.phase { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; }
.phase .btn { margin-top: auto; }
.phase small { margin-bottom: 8px; }
.phase small { display: block; color: var(--muted); font-size: 12px; }
.phase.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.phase.ok { border-color: var(--ok); }
.preview-frame { display: block; width: 100%; height: 520px; margin-top: 8px; border: 1px solid var(--border); border-radius: 8px; background: #000; }
.preview-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.run-item.approved .st { background: var(--ok); color: #fff; border-color: var(--ok); }
.run-item.awaiting { border-color: var(--warn); }
.run-item.awaiting .st { border-color: var(--warn); color: var(--warn); }
.run-item .render-state { display: block; margin-top: 2px; }
.radio { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.radio input { margin-top: 3px; accent-color: var(--accent); }
.radio small { display: block; color: var(--muted); font-size: 12px; }
.actions { display: flex; gap: 8px; }
.run-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.run-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.run-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--panel-2); }
.run-item .row { display: flex; gap: 10px; align-items: flex-start; }
.run-item .st { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: 13px;
  border: 1px solid var(--border); background: var(--panel); }
.run-item.running { border-color: var(--info); }
.run-item.running .st { border-color: var(--info); animation: pulse 1.2s infinite; }
.run-item.done .st { background: var(--ok); color: #fff; border-color: var(--ok); }
.run-item.error .st, .run-item.stopped .st { background: var(--err); color: #fff; border-color: var(--err); }
.run-item .txt { flex: 1; min-width: 0; }
.run-item .txt small { color: var(--muted); }
.run-item video { width: 100%; max-height: 320px; border-radius: 8px; background: #000; margin-top: 8px; }
.run-item details { margin-top: 6px; font-size: 13px; }
.run-item details summary { cursor: pointer; color: var(--muted); }
.run-item .summary { white-space: pre-wrap; background: var(--panel); border-radius: 8px; padding: 8px 10px; margin-top: 6px; }
.run-item .err { color: var(--err); font-size: 12px; margin-top: 4px; white-space: pre-wrap; }
.revise { display: flex; gap: 6px; margin-top: 8px; }
.revise input { font-size: 13px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--info) 20%, transparent); } }
#finalVideo { width: 100%; border-radius: 10px; background: #000; margin-bottom: 10px; max-height: 420px; }

.log-card { position: sticky; top: 76px; }
.log-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.log-head h3 { margin: 0; flex: 1; }
.small-check { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.log { height: calc(100vh - 270px); min-height: 320px; overflow-y: auto; background: #0a0b0e; border-radius: 10px; padding: 10px;
  font: 12px/1.55 var(--mono); color: #cfd3dc; }
.log .e { padding: 3px 6px; border-radius: 5px; white-space: pre-wrap; word-break: break-word; margin-bottom: 2px; }
.log .t { color: #5b6273; margin-right: 6px; }
.log .step { color: #fff; background: color-mix(in srgb, var(--accent) 35%, transparent); font-weight: 700; margin-top: 8px; }
.log .assistant { color: #f3f4f8; font-family: var(--font); font-size: 13px; }
.log .tool { color: var(--info); }
.log .tool b { color: #7dd3fc; }
.log .result { color: #7d8597; }
.log .error, .log .stderr { color: #fca5a5; }
.log .guard { color: #fecaca; background: rgba(239, 68, 68, .15); border-left: 3px solid var(--err); }
.log .done { color: #86efac; font-weight: 600; }
.log .warn { color: #fcd34d; }
.log .info { color: #a5b4fc; }
.log.hide-results .result { display: none; }

/* ---------- dialogs & toast ---------- */
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 14px; padding: 20px; width: min(480px, 92vw); }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
#guardDialog { width: min(820px, 94vw); }
dialog h3 { font-size: 17px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.guard-log { max-height: 60vh; overflow: auto; font: 12px/1.5 var(--mono); }
.guard-log div { padding: 4px 8px; border-left: 3px solid var(--ok); margin-bottom: 4px; background: var(--panel-2); border-radius: 4px; word-break: break-all; }
.guard-log div.blocked { border-left-color: var(--err); color: #fca5a5; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--border);
  padding: 10px 18px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); z-index: 100; max-width: 90vw; }
.toast.err { border-color: var(--err); color: #fca5a5; }

.empty { display: grid; place-items: center; min-height: 70vh; }
.empty-card { max-width: 560px; text-align: center; }
.empty-card .big { font-size: 56px; }
.empty-card p { color: var(--muted); }
.howto { text-align: left; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 14px 14px 34px; }
.howto li { margin: 4px 0; }

@media (max-width: 1100px) {
  .grid-3, .run-grid { grid-template-columns: 1fr; }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .log-card { position: static; }
  .log { height: 420px; }
}
@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
  .rail { flex-direction: row; border-right: none; border-bottom: 1px solid var(--border); position: static; height: auto; overflow-x: auto; overflow-y: hidden; }
  .rail button { flex: 1 0 auto; }
  main { padding: 16px; }
  .topbar small { display: none; }
  .project-head, .suggest-row { grid-template-columns: 1fr; flex-direction: column; }
}

/* ---------- referensi tanpa upload ---------- */
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; margin-bottom: 10px; }
.seg button { font: inherit; font-size: 12px; font-weight: 600; background: none; border: none; color: var(--muted); padding: 5px 12px; border-radius: 7px; cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; }
.inline-form { display: flex; gap: 6px; }
.inline-form input { flex: 1; min-width: 0; }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.link-list, .track-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.link-list li { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; background: var(--panel-2); border-radius: 9px; padding: 8px 10px; font-size: 12px; }
.link-list a { color: var(--text); word-break: break-all; }
.link-list small { display: block; color: var(--muted); }
.link-list small.err { color: var(--err); }
.link-list small.ok { color: var(--ok); }
.link-list .acts { display: flex; gap: 4px; }

/* ---------- musik ---------- */
.music-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.music-modes .radio b { font-size: 13px; }
.music-ai { margin-top: 12px; padding: 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 8%, var(--panel-2)); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.music-ai .field:first-child { margin-top: 0; }
.music-ai .small-check { margin: 10px 0 0; }
.music-ai .btn { margin-top: 10px; }
#libraryDialog { width: min(1100px, 96vw); max-height: 92vh; }
.lib-head { display: flex; justify-content: space-between; align-items: flex-start; }
.lib-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lib-grid .card { margin-bottom: 12px; }
.track-list li { background: var(--panel-2); border-radius: 9px; padding: 8px 10px; display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; }
.track-list li b { font-size: 13px; }
.track-list li small { color: var(--muted); font-size: 11px; display: block; }
.track-list audio { grid-column: 1 / -1; width: 100%; height: 32px; }
.track-list .tags-input { grid-column: 1 / -1; font-size: 12px; padding: 4px 8px; }
.track-list .acts { display: flex; gap: 4px; align-items: center; }
#libTracks { max-height: 62vh; overflow: auto; }
#jamendoResults { max-height: 40vh; overflow: auto; }
@media (max-width: 900px) { .lib-grid, .music-modes { grid-template-columns: 1fr; } }

/* ---------- draft ---------- */
.import-btn { font-size: 13px; }
.filter-seg { display: flex; flex-wrap: wrap; gap: 4px; margin: 16px 0 8px; }
.filter-seg button { font: inherit; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; border: 1px solid var(--border);
  background: none; color: var(--muted); cursor: pointer; }
.filter-seg button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
/* ---------- galeri proyek ---------- */
.project-home-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.project-home-head h2 { margin: 0; }
.project-home-head .filter-seg { margin: 0; flex: 1; }
.project-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.project-grid li[data-id] { cursor: pointer; user-select: none; }
.project-grid li[data-id]:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.project-grid .group { grid-column: 1 / -1; background: none; border: none; padding: 10px 0 0; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.project-grid .thumb { pointer-events: none; }
#backToProjectsBtn { display: block; margin-bottom: 6px; }
.st-tag { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 99px; margin-right: 4px; border: 1px solid var(--border); }
.st-tag.draft { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.st-tag.processing, .st-tag.in_progress { color: var(--info); border-color: color-mix(in srgb, var(--info) 50%, transparent); }
.st-tag.completed { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.save-state { font-size: 12px; color: var(--muted); white-space: nowrap; }
.save-state.saving { color: var(--info); }
.save-state.dirty { color: var(--warn); }
.save-state.error { color: var(--err); }
.head-actions { flex-wrap: wrap; justify-content: flex-end; }
#draftDialog { width: min(640px, 94vw); }
.draft-list { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.draft-list li { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; background: var(--panel-2); border-radius: 9px; padding: 8px 10px; }
.draft-list li.auto b { color: var(--muted); font-weight: 500; }
.draft-list small { display: block; color: var(--muted); font-size: 11px; }
.draft-list .acts { display: flex; gap: 4px; }

/* ---------- preflight & unchanged ---------- */
.preflight { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.pf { border-radius: 10px; padding: 9px 12px; font-size: 13px; border: 1px solid var(--border); background: var(--panel); border-left-width: 4px; }
.pf.error { border-left-color: var(--err); }
.pf.warn { border-left-color: var(--warn); }
.pf.info { border-left-color: var(--info); }
.pf small { display: block; color: var(--muted); margin-top: 2px; }
.pf code { background: var(--panel-2); padding: 1px 6px; border-radius: 5px; user-select: all; }
.run-item.unchanged { border-color: var(--warn); }
.run-item .unch { color: var(--warn); font-size: 12px; font-weight: 600; margin-top: 4px; }

/* ---------- user ---------- */
.top-right { display: flex; align-items: center; gap: 14px; }
.user-box { display: flex; align-items: center; gap: 8px; padding-left: 14px; border-left: 1px solid var(--border); font-size: 13px; font-weight: 600; white-space: nowrap; }
.user-box span::before { content: '👤 '; }

/* ---------- halaman Assets / Referensi / Setting ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h2 { margin: 0; font-size: 20px; }
.page-head h2 small { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 6px; }
.lib-project h3 .btn { margin-left: auto; }
.file-grid { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.file-grid li { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.file-grid .thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: #000; display: grid; place-items: center; font-size: 28px; }
.file-grid audio { width: 100%; }
.file-grid .meta b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-grid .meta small { color: var(--muted); font-size: 11px; }
.ref-text { margin: 8px 0 0; font-size: 13px; white-space: pre-wrap; }
.chk { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); }
.chk .mark { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; border: 1px solid var(--border); color: var(--muted); }
.chk.ok .mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.chk.bad .mark { background: var(--err); border-color: var(--err); color: #fff; }
.chk b { display: block; }
.chk small { color: var(--muted); font-size: 12px; word-break: break-all; }
.file-grid .acts { display: flex; gap: 6px; align-items: center; margin-top: auto; }
.file-grid .acts .btn { flex: 1; }
.file-grid .empty-tile { grid-column: 1 / -1; background: none; border: none; }
#assetCats { margin: 14px 0 10px; }
.ref-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
.ref-form .field:nth-child(3) { grid-row: span 2; }
.ref-form .btn { grid-column: 1 / -1; justify-self: start; margin-top: 12px; }
.ref-url { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ref-desc { margin: 0; font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 720px) { .ref-form { grid-template-columns: 1fr; } }
.step-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.step-action { align-self: flex-start; width: auto; font-weight: 600; }
.skill-list { display: flex; flex-direction: column; gap: 10px; }
.skill-item { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); }
.skill-item .hint { margin: 4px 0 8px; }
.skill-item.off .hint, .skill-item.off .chips { opacity: .4; pointer-events: none; }

/* ---------- tipe video & storyboard ---------- */
dialog.wide { width: min(760px, 94vw); }
.url-import { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 16px; }
.url-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.url-row input[type=url] { flex: 1; }
.url-pick { list-style: none; margin: 0; padding: 0; max-height: 46vh; overflow: auto; display: grid; gap: 6px; }
.url-pick li { display: flex; gap: 6px; align-items: center; }
.url-pick li[hidden] { display: none; }
.url-pick li label { flex: 1; min-width: 0; display: grid; grid-template-columns: auto 56px 1fr; gap: 10px; align-items: center; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.url-pick li label:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.url-pick .pv { width: 56px; height: 40px; object-fit: cover; border-radius: 4px; background: var(--panel-2); display: grid; place-items: center; font-size: 20px; }
.url-pick .meta { min-width: 0; display: flex; flex-direction: column; }
.url-pick .meta b, .url-pick .meta small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url-pick .meta small { color: var(--muted); }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin: 12px 0 14px; }
.type-card { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 2px solid var(--border); border-radius: 10px; background: var(--panel-2); cursor: pointer; }
.type-card:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--panel-2)); }
.type-card input { position: absolute; opacity: 0; pointer-events: none; }
.type-card small { color: var(--muted); font-size: 12px; }
.type-badge { margin-left: 4px; }
.sb-list { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 8px; }
.sb-list li { display: grid; grid-template-columns: 120px 1fr auto; gap: 12px; align-items: start; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.sb-list li.empty-steps { display: block; text-align: center; color: var(--muted); padding: 20px; border-style: dashed; background: none; }
.sb-thumb { width: 120px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: #000; display: grid; place-items: center; font-size: 28px; }
.sb-fields { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sb-row { display: flex; gap: 8px; align-items: center; }
.sb-row select { flex: 1; min-width: 0; }
.sb-dur { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.sb-dur input { width: 70px; font-size: 14px; }
.sb-list .ops { display: flex; flex-direction: column; gap: 2px; }
.sb-list .ops button { background: none; border: 1px solid transparent; color: var(--muted); cursor: pointer; border-radius: 6px; padding: 2px 7px; }
.sb-list .ops button:hover { color: var(--text); border-color: var(--border); }
@media (max-width: 720px) { .sb-list li { grid-template-columns: 1fr auto; } .sb-thumb { display: none; } }

/* ---------- folder library aset ---------- */
.asset-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.asset-bar .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13px; }
.crumbs span { color: var(--muted); }
.crumbs button { font: inherit; background: none; border: 1px solid transparent; border-radius: 6px; padding: 3px 8px; color: var(--muted); cursor: pointer; }
.crumbs button:last-child { color: var(--text); font-weight: 600; }
.crumbs button:hover { border-color: var(--border); color: var(--text); }
.file-grid .folder-tile { cursor: pointer; }
.file-grid .folder-tile:hover { border-color: var(--accent); }
.file-grid .folder-tile .thumb { font-size: 42px; background: color-mix(in srgb, var(--accent-2) 12%, var(--panel)); }
.file-grid li[draggable] { cursor: grab; }
.move-select { font-size: 12px; padding: 4px 6px; }

/* ---------- update dari GitHub ---------- */
.update-btn { position: relative; }
.update-dot { position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); }
.update-body p { margin: 0 0 10px; }
.update-msg { padding: 8px 12px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--border); }
.update-msg.ok { border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.update-msg.err { border-color: color-mix(in srgb, var(--err) 50%, transparent); color: var(--err); }
.update-commits { margin: 0 0 12px; padding-left: 18px; max-height: 260px; overflow: auto; font-size: 13px; }
.update-commits li { margin-bottom: 4px; }

/* ---------- penggunaan Claude ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-tile { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat-tile small { color: var(--muted); font-size: 12px; }
.stat-tile b { font-size: 26px; font-variant-numeric: tabular-nums; }
.stat-tile span { color: var(--muted); font-size: 12px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.usage-chart { width: 100%; overflow: hidden; }
.usage-chart svg { display: block; }
.usage-chart .grid { stroke: var(--border); stroke-width: 1; }
.usage-chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.usage-chart .bar { fill: var(--accent); }
.usage-chart .hit { fill: transparent; cursor: default; outline: none; }
.usage-chart .hit:hover, .usage-chart .hit:focus-visible { fill: color-mix(in srgb, var(--text) 6%, transparent); }
.chart-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); display: flex; flex-direction: column; font-size: 12px; }
.chart-tip b { font-size: 14px; font-variant-numeric: tabular-nums; }
.chart-tip span { color: var(--muted); }
.usage-table-wrap { overflow-x: auto; }
.usage-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.usage-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.usage-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; white-space: nowrap; }
.usage-table tr:last-child td { border-bottom: none; }
.usage-table.with-bars td:nth-child(2) { width: 45%; min-width: 140px; }
.bar-cell { display: flex; align-items: center; gap: 8px; }
.bar-cell .bar { height: 10px; border-radius: 0 4px 4px 0; background: var(--accent); flex: none; max-width: calc(100% - 64px); }
.link-btn { background: none; border: none; padding: 0; color: var(--text); font: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: var(--border); }
.st-ok { color: var(--ok); }
.st-err { color: var(--err); }
@media (max-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Library Karakter */
.char-grid .thumb { aspect-ratio: 1; object-fit: contain; background: var(--panel); }
.char-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; margin-bottom: 16px; }
.char-form .btn { grid-column: 1 / -1; justify-self: start; margin-top: 12px; }
#charFilesBox .inline-form { margin: 8px 0; }
#charFiles { margin-top: 10px; }
#charFiles .thumb { aspect-ratio: 1; object-fit: contain; background: var(--panel); }
.swatches { display: flex; gap: 4px; margin-top: 6px; }
.swatches i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border); }
@media (max-width: 720px) { .char-form { grid-template-columns: 1fr; } }

/* ---------- Naskah (dari video, suara, manual) */
.naskah-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.naskah-layout .card { margin: 0 0 16px; }
/* daftar naskah tetap di tempat dengan scroll sendiri; 80px = topbar 60px + padding atas main 20px */
.naskah-side { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.naskah-side .card { margin: 0; }
#naskahForm .dropzone { margin: 8px 0 12px; }
.naskah-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.naskah-list li { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); cursor: pointer; }
.naskah-list li.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--panel-2)); }
.naskah-list b { display: block; font-size: 13px; }
.naskah-list small { color: var(--muted); font-size: 11px; }
.naskah-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.naskah-media { flex: none; display: grid; gap: 8px; width: 260px; max-width: 100%; }
.naskah-media.audio { width: 320px; }
.naskah-media video { width: 100%; max-height: 420px; border-radius: 8px; background: #000; object-fit: contain; }
.naskah-media audio { width: 100%; }
.naskah-info { flex: 1 1 280px; min-width: 0; }
.naskah-info h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 4px; }
.naskah-info > small { display: block; overflow-wrap: anywhere; }
.naskah-head .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
#naskahDetail .log { height: 360px; min-height: 0; }
.naskah-project { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.scene-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.scene-list li { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--panel-2); }
.scene-list h4 { margin: 0 0 6px; font-size: 13px; color: var(--accent); }
.scene-list p { margin: 4px 0; font-size: 13px; }
.scene-list blockquote { margin: 6px 0 0; padding: 6px 10px; border-left: 3px solid var(--accent-2); background: var(--panel); border-radius: 0 6px 6px 0; font-size: 13px; }
.naskah-transcript { white-space: pre-wrap; font-size: 13px; }
.naskah-transcript-box { margin-bottom: 12px; }
.naskah-transcript-box summary { cursor: pointer; font-weight: 600; }
.naskah-transcript-box summary .btn { margin-left: 8px; }
.naskah-transcript-box textarea { width: 100%; }
.scene-bar-acts, .scene-acts { display: flex; gap: 6px; flex-wrap: wrap; flex: none; }
.scene-tabs button.new { border-style: dashed; }
@media (max-width: 900px) {
  .naskah-layout, .naskah-project { grid-template-columns: minmax(0, 1fr); }
  .naskah-side { position: static; max-height: none; }
}
.err-text { color: var(--err); font-size: 13px; }
.subtitle-list { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; font-size: 13px; }
.subtitle-list li { padding: 5px 8px; border-bottom: 1px solid var(--border); }
.subtitle-list .t { color: var(--muted); font-family: var(--mono, monospace); font-size: 12px; margin-right: 10px; }
.naskah-modes { display: flex; margin-bottom: 12px; }
.naskah-or { margin: 14px 0 6px; }
.naskah-tabs .tabs { margin: -4px 0 14px; }
.naskah-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.scene-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.scene-tabs button { font: inherit; font-size: 12px; font-weight: 600; min-width: 32px; height: 30px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); cursor: pointer; font-variant-numeric: tabular-nums; }
.scene-tabs button:hover { color: var(--text); }
.scene-tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.scene-detail article { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--panel-2); }
.scene-detail h4 { margin: 0 0 8px; font-size: 14px; color: var(--accent); }
.scene-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.scene-bar .scene-tabs { margin: 0; }
.scene-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.scene-detail-head h4 { margin: 0; }
.scene-edit .field label small { font-weight: 400; }
.scene-detail h4 small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.scene-detail p { margin: 4px 0; font-size: 13px; }
.scene-detail blockquote { margin: 8px 0 0; padding: 6px 10px; border-left: 3px solid var(--accent-2); background: var(--panel); border-radius: 0 6px 6px 0; font-size: 13px; }
.naskah-tabs .tabs small { color: var(--muted); font-weight: 400; margin-left: 2px; }
.naskah-tabs > [role=tabpanel] > .hint:first-child, #voCard > .hint:first-child { margin-top: 0; }
.rec-dialog { width: min(820px, calc(100vw - 32px)); }
.rec-dots { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.rec-dot { font: inherit; font-size: 11px; min-width: 26px; height: 26px; border-radius: 13px; border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); cursor: pointer; }
.rec-dot.done { background: color-mix(in srgb, var(--ok, #22c55e) 25%, var(--panel-2)); color: var(--text); }
.rec-dot.stale { background: color-mix(in srgb, var(--err) 25%, var(--panel-2)); color: var(--text); }
.rec-dot.skip { opacity: .45; }
.rec-dot.on { border-color: var(--accent); outline: 2px solid var(--accent); }
.prompter { max-height: 42vh; overflow-y: auto; padding: 18px 22px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border);
  font-size: clamp(20px, 2.6vw, 30px); line-height: 1.5; scrollbar-width: thin; }
.prompter p { margin: 0 0 .6em; }
.prompter small { display: block; font-size: 13px; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.rec-dialog.is-recording .prompter { border-color: var(--err); box-shadow: 0 0 0 2px color-mix(in srgb, var(--err) 40%, transparent); }
.rec-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 8px; }
.rec-toggle { min-width: 150px; }
.rec-clock { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.rec-mic { display: flex; align-items: center; gap: 8px; }
.rec-mic select { flex: 0 1 280px; min-width: 0; }
.rec-meter { flex: 1; height: 8px; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--border); overflow: hidden; }
.rec-meter div { height: 100%; width: 0; background: var(--accent); transition: width .08s linear; }
.rec-take { display: grid; gap: 6px; justify-items: start; margin-top: 10px; }
.rec-take audio { width: 100%; }
.vo-speakers { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 16px; }
.vo-pick { display: flex; gap: 6px; }
.vo-pick select { flex: 1; min-width: 0; }
.vo-result { display: grid; gap: 6px; margin-bottom: 14px; padding: 12px; border: 1px solid var(--ok); border-radius: 10px; justify-items: start;
  background: color-mix(in srgb, var(--ok) 7%, transparent); }
.vo-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.vo-choice { display: grid; gap: 4px; justify-items: start; text-align: left; padding: 14px; font: inherit; color: var(--text); cursor: pointer;
  background: var(--panel-2); border: 2px solid var(--border); border-radius: 12px; }
.vo-choice:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.vo-choice.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel-2)); }
.vo-choice .em { font-size: 26px; }
.vo-choice small { color: var(--muted); font-size: 12px; }
.vo-panel { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.vo-panel .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.vo-rec-list { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.vo-rec-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; }
.vo-rec-list li > span { min-width: 80px; font-weight: 600; }
.vo-rec-list li.ok { border-color: color-mix(in srgb, var(--ok) 50%, var(--border)); }
.vo-rec-list li.stale { border-color: var(--warn); }
.vo-rec-list audio { height: 32px; flex: 1 1 180px; }
.vo-result audio { width: 100%; }
.vo-result .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.ai-brief { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.ai-brief .wide { grid-column: 1 / -1; }
@media (max-width: 900px) { .ai-brief { grid-template-columns: minmax(0, 1fr); } }
#naskahDialog:has(#naskahAiForm:not([hidden])) { width: min(760px, calc(100vw - 32px)); }
.brief-list { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.brief-list li { margin: 2px 0; white-space: pre-wrap; }
.naskah-modes button { flex: 1; white-space: nowrap; padding: 5px 6px; }
.naskah-editor .ed-scenes { margin: 12px 0; }
.naskah-editor .sb-row input:not([type=number]) { flex: 1; }
.ed-scenes li { grid-template-columns: 32px 1fr auto; }
.ed-scenes .sb-thumb { width: 32px; aspect-ratio: 1; font-size: 13px; font-weight: 700; background: var(--accent); color: #fff; border-radius: 50%; }
a.icon-btn { text-decoration: none; }
a.icon-btn:hover { color: var(--accent); }

/* ---------- popup preview langkah (Proses & Hasil) ---------- */
.preview-dialog { width: min(1280px, 96vw); height: 92vh; max-height: 92vh; padding: 0; display: none; flex-direction: column; overflow: hidden; }
.preview-dialog[open] { display: flex; }
.pv-head { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.pv-head > div { flex: 1; min-width: 0; }
.pv-head h3 { margin: 0; }
.pv-head p { margin: 2px 0 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-head .link-btn, .pv-head .btn { flex: none; margin-top: 4px; white-space: nowrap; }
.naskah-dialog { width: min(880px, 94vw); max-height: 92vh; padding: 24px 28px; }
.naskah-dialog #naskahDrop { min-height: 180px; }
.naskah-dialog .studio-browser { max-height: 42vh; }
.asset-preview { width: min(1100px, 96vw); padding: 0; }
.ap-body { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 14px; }
.ap-stage { display: grid; place-items: center; min-height: 240px; max-height: 76vh; overflow: auto; }
.ap-stage img, .ap-stage video { max-width: 100%; max-height: 74vh; border-radius: 8px; background: #000; }
.ap-stage audio { width: min(520px, 100%); }
.ap-nav { font-size: 28px; line-height: 1; padding: 10px 12px; color: var(--text); background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.ap-nav:disabled { opacity: .3; cursor: default; }
.ap-font { font-size: 48px; line-height: 1.3; text-align: center; outline: none; }
.ap-text { justify-self: stretch; margin: 0; padding: 12px; font-size: 13px; white-space: pre-wrap; background: var(--panel-2); border-radius: 8px; }
.file-grid img.thumb, .file-grid span.thumb { cursor: zoom-in; }
.pv-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 18px; display: grid; gap: 14px; align-content: start; }
.pv-body .preview-frame { height: min(68vh, 760px); margin: 0; }
.pv-notes h4 { margin: 0 0 6px; font-size: 14px; }
.pv-notes .summary { white-space: pre-wrap; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.pv-foot { display: flex; gap: 8px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--panel-2); }
.pv-foot input { flex: 1; min-width: 0; }
/* layar lebar: catatan di samping preview, masing-masing scroll sendiri */
@media (min-width: 1000px) {
  .pv-body:has(.pv-notes:not([hidden])) { grid-template-columns: minmax(0, 1fr) 340px; overflow: hidden; }
  .pv-body:has(.pv-notes:not([hidden])) .preview-frame { height: 100%; }
  .pv-body { align-content: stretch; }
  .pv-body .preview-frame { min-height: 0; height: 100%; }
  .pv-notes { display: flex; flex-direction: column; min-height: 0; }
  .pv-notes .summary { flex: 1; overflow-y: auto; }
}
@media (max-width: 640px) {
  .pv-foot { flex-wrap: wrap; }
  .pv-foot input { flex-basis: 100%; }
  .pv-body .preview-frame { height: 56vh; }
}

/* ---------- dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dash-grid .card { margin: 0; min-width: 0; }
.dash-grid .card h3 small { color: var(--muted); font-weight: 400; font-size: 13px; }
.dash-grid h3 .link-btn { font-size: 12px; font-weight: 400; margin-left: 6px; }
.dash-grid h4 { margin: 16px 0 6px; font-size: 13px; color: var(--muted); }
.dash-wide { grid-column: 1 / -1; }
.dash-tile { text-align: left; color: inherit; font: inherit; cursor: pointer; }
.dash-tile:hover { border-color: var(--accent); }
.dash-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.dash-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.dash-list li:last-child { border-bottom: none; }
.dash-list .link-btn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; text-align: left; }
.dash-list .badge, .dash-when { margin-left: auto; flex: none; }
.dash-stack { display: flex; height: 14px; border-radius: 99px; overflow: hidden; gap: 2px; }
.seg.draft { background: var(--warn); }
.seg.in_progress, .seg.processing { background: var(--info); }
.seg.completed { background: var(--ok); }
.dash-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; padding: 0; font-size: 13px; }
.dash-legend li { display: flex; align-items: center; gap: 6px; }
.dash-legend i { width: 10px; height: 10px; border-radius: 50%; }
.dash-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.dash-videos figure { margin: 0; min-width: 0; }
.dash-videos video { width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; background: #000; }
.dash-videos figcaption { display: grid; gap: 2px; margin-top: 4px; font-size: 13px; }
.dash-videos figcaption .link-btn { text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-videos small { color: var(--muted); }
.dash-lib { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.dash-lib button { width: 100%; display: grid; gap: 2px; padding: 10px 12px; text-align: left; color: inherit; font: inherit; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.dash-lib button:hover { border-color: var(--accent); }
.dash-lib b { font-size: 20px; font-variant-numeric: tabular-nums; }
.dash-lib small { color: var(--muted); font-size: 12px; }
.dash-health { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.dash-health li { padding: 4px 10px; border-radius: 99px; border: 1px solid var(--border); font-size: 12px; font-weight: 600; }
.dash-health .ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.dash-health .bad { color: var(--err); border-color: color-mix(in srgb, var(--err) 50%, transparent); }
.dash-health .opt { color: var(--muted); }
@media (max-width: 900px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- studio (rekam multi-sumber) ---------- */
.studio-settings { flex-wrap: wrap; align-items: center; }
.studio-settings select { width: auto; }
/* baris atas: preview · rekam · properti; tinggi kolom samping mengikuti preview, isinya scroll sendiri */
.studio-top { display: grid; grid-template-columns: minmax(0, 720px) minmax(250px, 1fr) minmax(300px, 1.2fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.studio-top > .card { margin: 0; min-width: 0; max-height: max(var(--studio-top-h, 60vh), 420px); overflow-y: auto; }
.studio-props-card h3 { margin-top: 0; }
/* area kerja di luar kanvas: abu-abu bertitik, beda jelas dengan kanvas (yang terekam) */
.studio-stage-col { min-width: 0; }
.studio-preview-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.studio-preview-bar .filter-seg { margin: 0; }
/* ukuran tampilan preview saja: kanvas & rekaman tetap beresolusi penuh */
.studio-stage-wrap[data-preview="sm"] { --studio-max-h: 28vh; --studio-max-w: 480px; }
.studio-stage-wrap[data-preview="md"] { --studio-max-h: 40vh; --studio-max-w: 100%; }
.studio-stage-wrap[data-preview="lg"] { --studio-max-h: 58vh; --studio-max-w: 100%; }
.studio-stage-wrap { --studio-max-h: 40vh; --studio-max-w: 100%; display: grid; place-items: center; min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: radial-gradient(circle, rgb(255 255 255 / .09) 1px, transparent 1.5px) 0 0 / 16px 16px, #2a2d36; }
/* lebar mengikuti rasio kanvas: penuh bila landscape, dibatasi tinggi layar bila portrait (9:16) */
.studio-stage { position: relative; aspect-ratio: var(--studio-ratio, 16 / 9); width: min(100%, var(--studio-max-w), calc(var(--studio-max-h) * var(--studio-ratio, 16 / 9))); }
.studio-stage canvas { display: block; width: 100%; height: 100%; background: #000; outline: 1px solid rgb(255 255 255 / .35); box-shadow: 0 8px 30px rgb(0 0 0 / .55); }
.studio-bg-pick input[type=color] { width: 28px; height: 24px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; cursor: pointer; }
.studio-overlay { position: absolute; inset: 0; touch-action: none; cursor: default; }
.studio-sel { position: absolute; outline: 2px solid var(--accent); outline-offset: -1px; pointer-events: none; }
.studio-sel i { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; border-radius: 3px; background: var(--accent); border: 2px solid #fff; }
.studio-sel.locked { outline-style: dashed; }
.studio-sel.locked i { display: none; } /* terkunci: tanpa pegangan ubah ukuran */
.studio-ph { position: absolute; display: grid; place-items: center; border: 2px dashed rgb(255 255 255 / .35); background: rgb(255 255 255 / .04); }
.studio-off { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.studio-controls { margin: 0; display: grid; gap: 8px; }
.studio-controls h3 { margin: 6px 0 0; }
.studio-controls .hint { margin: 0; }
.btn.block { width: 100%; justify-content: center; }
.studio-rec-info { margin: 0; display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; font-weight: 600; }
.studio-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--err); animation: pulse 1.2s infinite; }
.studio-dot.paused { background: var(--warn); animation: none; }
.studio-live-targets { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 12px; }
.studio-live-targets:empty { display: none; }
.studio-live-targets .studio-on { color: var(--ok); }
.studio-live-targets .studio-err, .studio-rec-info .studio-err { color: var(--err); }
.live-platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin: 10px 0; }
.live-platform { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px 10px; display: grid; gap: 6px; min-width: 0; }
.live-platform legend { padding: 0 4px; }
.live-platform .hint { margin: 0; }
.live-key { display: flex; gap: 4px; align-items: center; }
.live-key input { flex: 1; min-width: 0; }
.studio-add { display: flex; flex-wrap: wrap; gap: 6px; }
.studio-docks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.studio-docks .card { min-width: 0; margin: 0; }
.studio-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow-y: auto; }
.studio-list li { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 13px; min-width: 0; }
.studio-list li.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.studio-list li.off .studio-name { opacity: .45; text-decoration: line-through; }
.studio-grip { flex: none; cursor: grab; color: var(--muted); letter-spacing: -3px; padding: 0 4px 0 0; touch-action: none; user-select: none; }
.studio-grip:hover { color: var(--text); }
.studio-list li.dragging { position: relative; z-index: 2; opacity: .9; background: var(--panel); box-shadow: 0 6px 18px rgb(0 0 0 / .4); }
.studio-list li.dragging .studio-grip { cursor: grabbing; }
.studio-list li.drop-before { box-shadow: 0 -3px 0 -1px var(--accent); }
.studio-list li.drop-after { box-shadow: 0 3px 0 -1px var(--accent); }
.studio-list li small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.studio-list li.muted { cursor: default; }
.studio-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-list [data-scene] small { margin-left: auto; }
.studio-key { flex: none; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 4px; background: var(--panel-2); font-size: 11px; color: var(--muted); }
.studio-item-acts { display: flex; flex: none; }
.studio-item-acts .icon-btn { padding: 2px 4px; font-size: 12px; }
.studio-panel-acts, .studio-existing { display: flex; gap: 6px; margin-top: 8px; }
.studio-existing select { flex: 1; min-width: 0; }
.studio-mix { padding: 8px 0; border-bottom: 1px solid var(--border); }
.studio-mix:last-child { border-bottom: none; }
.studio-mix-head { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.studio-mix-head > .studio-name { flex: 1; }
.studio-rename { flex: 1; min-width: 0; padding: 2px 6px; font-size: 13px; height: auto; }
[data-rename] { cursor: text; }
.studio-meter { height: 6px; border-radius: 99px; background: var(--panel-2); overflow: hidden; margin: 6px 0; }
.studio-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ok) 60%, var(--warn) 85%, var(--err)); transition: width 60ms linear; }
.studio-meter.muted i { opacity: .25; }
.studio-vol { display: flex; align-items: center; gap: 8px; }
.studio-vol input { flex: 1; }
.studio-vol small { width: 38px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
#studioProps { display: grid; gap: 8px; }
.studio-field { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.studio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.studio-row > .studio-field { flex: 1; min-width: 90px; }
.studio-layouts { display: flex; flex-wrap: wrap; gap: 4px; }
.studio-takes { display: grid; gap: 12px; }
.studio-take { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 12px; align-items: start; }
.studio-take video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; }
.studio-take-meta { display: grid; gap: 4px; min-width: 0; }
.studio-take-meta b { overflow-wrap: anywhere; }
.studio-take-meta small { color: var(--muted); }
.studio-take-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.studio-take-acts a.btn { text-decoration: none; }
#studioTakeForm .radio { margin-bottom: 8px; }
#studioTakeForm .radio > span { display: grid; gap: 6px; flex: 1; }
#studioTakeForm .radio:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.studio-pool { position: fixed; left: -10px; top: 0; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.studio-pool video { width: 1px; height: 1px; }
#rail button.recording { position: relative; color: var(--err); }
#rail button.recording::after { content: 'REC'; position: absolute; top: 4px; right: 4px; font-size: 8px; font-weight: 800; color: #fff; background: var(--err); border-radius: 3px; padding: 0 3px; }
/* layar sedang: preview selebar penuh, rekam & properti berdampingan di bawahnya */
@media (max-width: 1200px) {
  .studio-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .studio-top > .studio-stage-col { grid-column: 1 / -1; }
  .studio-top > .card { max-height: none; }
  .studio-docks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .studio-top { grid-template-columns: minmax(0, 1fr); }
  .studio-take { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) { .studio-docks { grid-template-columns: minmax(0, 1fr); } }
.studio-list li small.studio-on, .studio-mix small.studio-on { color: var(--ok); }
.studio-list li small.studio-err, .studio-mix small.studio-err { color: var(--err); }
.studio-res { margin: 0; font-size: 12px; color: var(--muted); }
.studio-file-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-top: 10px; max-height: 50vh; overflow-y: auto; }
.studio-file { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px; align-items: center; padding: 8px 10px; text-align: left; font: inherit; color: inherit;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.studio-file:hover { border-color: var(--accent); }
.studio-file span { grid-row: span 2; font-size: 20px; }
.studio-file b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-file small { color: var(--muted); font-size: 11px; }
.studio-player { align-items: center; }
/* teleprompter (editor; tampilan prompter punya CSS sendiri di studioprompter.js) */
.tp-editor { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; }
.tp-scripts { display: grid; gap: 8px; align-content: start; }
.tp-scripts .studio-list li small { margin-left: auto; }
.tp-edit { display: grid; gap: 8px; min-width: 0; }
.tp-edit textarea { width: 100%; min-height: 180px; resize: vertical; font-size: 15px; line-height: 1.5; }
.tp-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tp-meta #tpDelete { margin-left: auto; }
@media (max-width: 700px) { .tp-editor { grid-template-columns: minmax(0, 1fr); } }
/* workspace Studio */
.studio-ws-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -4px 0 14px; padding: 8px 12px; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); }
.studio-ws-pick { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.studio-ws-pick select { width: auto; min-width: 180px; max-width: 320px; }
.studio-ws-status { margin-left: auto; color: var(--muted); font-size: 12px; }
.studio-ws-status.err { color: var(--err); }
#studioWsDialog input { width: 100%; margin-top: 8px; }
@media (max-width: 560px) { .studio-ws-pick, .studio-ws-pick select { width: 100%; max-width: none; } .studio-ws-status { margin-left: 0; } }
/* dialog tambah file Studio: upload & penjelajah folder Library Aset */
.studio-upload-to { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.studio-upload-to select { width: auto; min-width: 200px; }
.studio-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; font-size: 13px; }
.studio-crumbs button { font: inherit; color: var(--accent); background: none; border: none; padding: 2px 4px; border-radius: 6px; cursor: pointer; }
.studio-crumbs button:last-child { color: var(--text); font-weight: 600; }
.studio-crumbs button:hover { background: var(--panel-2); }
.studio-crumbs span { color: var(--muted); }
.studio-browser { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; max-height: 52vh; overflow-y: auto;
  padding: 8px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; min-height: 140px; align-content: start; }
.studio-entry { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; font: inherit; color: inherit; text-align: center;
  background: none; border: 1px solid transparent; border-radius: 10px; cursor: pointer; user-select: none; min-width: 0; }
.studio-entry:hover { background: var(--panel); }
.studio-entry.on, .studio-entry:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); outline: none; }
.studio-entry b { font-size: 12px; font-weight: 600; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-entry small { color: var(--muted); font-size: 11px; }
.studio-entry-icon { font-size: 34px; line-height: 56px; height: 56px; }
.studio-entry-thumb { width: 100%; height: 56px; object-fit: cover; border-radius: 6px; background: #000; }
.studio-entry-empty { grid-column: 1 / -1; margin: 8px; }
.studio-browser-hint { margin-right: auto; }
.studio-take-status { font-size: 12px; color: var(--muted); }
.studio-take-status.server { color: var(--ok); }
.studio-take-status.uploading, .studio-take-status.waiting { color: var(--info); }
.studio-take-status.error { color: var(--err); }
/* halaman pembuka Studio: kartu workspace */
.studio-home .actions input[type=search] { width: 220px; }
.studio-home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.studio-home-card { position: relative; display: grid; grid-template-rows: auto 1fr; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s; }
.studio-home-card:hover, .studio-home-card:focus-visible { border-color: var(--accent); transform: translateY(-2px); outline: none; }
.studio-home-thumb { aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle, rgb(255 255 255 / .08) 1px, transparent 1.5px) 0 0 / 14px 14px, #23262e; }
.studio-home-thumb img { width: 100%; height: 100%; object-fit: contain; }
.studio-home-thumb span { font-size: 40px; opacity: .6; }
.studio-home-info { display: grid; gap: 2px; padding: 10px 12px 12px; min-width: 0; }
.studio-home-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-home-info small { color: var(--muted); font-size: 12px; }
.studio-home-badge { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700;
  background: var(--accent); color: #fff; }
.studio-home-acts { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.studio-home-card:hover .studio-home-acts, .studio-home-card:focus-within .studio-home-acts { opacity: 1; }
.studio-home-acts button { font: inherit; font-size: 13px; line-height: 1; padding: 6px 7px; border-radius: 8px; border: 1px solid rgb(255 255 255 / .15);
  background: rgb(0 0 0 / .65); color: #fff; cursor: pointer; }
.studio-home-acts button:hover { background: var(--accent); }
.studio-home-new { display: grid; place-items: center; gap: 6px; min-height: 200px; border: 2px dashed var(--border); border-radius: var(--radius);
  background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.studio-home-new:hover { border-color: var(--accent); color: var(--text); }
.studio-home-new span { font-size: 32px; }
@media (hover: none) { .studio-home-acts { opacity: 1; } }
@media (max-width: 560px) { .studio-home .actions input[type=search] { width: 100%; } }
.studio-home .actions { flex-wrap: wrap; }
@media (max-width: 560px) {
  .studio-home .actions > * { flex: 1 1 auto; }
  .studio-home-new { min-height: 72px; display: flex; align-items: center; justify-content: center; gap: 10px; }
  .studio-home-new span { font-size: 24px; }
}
/* timeline video di Properti Studio */
.studio-seek { display: grid; gap: 4px; }
.studio-seek input[type=range] { width: 100%; accent-color: var(--accent); cursor: pointer; }
.studio-seek input[type=range]:disabled { cursor: not-allowed; opacity: .4; }
.studio-seek small { font-variant-numeric: tabular-nums; }
.studio-player { gap: 6px; }
.studio-player .studio-play { min-width: 84px; justify-content: center; }
.studio-jump { display: flex; align-items: center; gap: 6px; }
.studio-jump label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.studio-jump input { flex: 1; min-width: 0; padding: 6px 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
#studioJumpHint { font-size: 11px; margin-top: -4px; }
/* waktu video di layar kerja: lapisan overlay, tidak ikut terekam */
.studio-vtime { position: absolute; pointer-events: none; display: flex; flex-direction: column; justify-content: flex-end; }
.studio-vtime span { align-self: flex-start; margin: 0 0 4px 4px; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: #fff; background: rgb(0 0 0 / .7); }
.studio-vtime i { display: block; height: 3px; background: rgb(255 255 255 / .25); }
.studio-vtime b { display: block; height: 100%; width: 0; background: var(--accent); }

/* ---------- naskah: video / gambar per adegan ---------- */
.scene-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin: 8px 0; }
.scene-media:empty { display: none; }
.scene-media-item { margin: 0; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px; min-width: 0; }
.scene-media-item video, .scene-media-item img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: #000; }
.scene-media-item figcaption { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); margin-top: 4px; }
.scene-media-item figcaption span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene-media-item .icon-btn { padding: 0 4px; font-size: 12px; }

/* ---------- naskah: preview slide per adegan ---------- */
.naskah-slides { width: min(1100px, 96vw); padding: 0; }
.slide-keys { flex: none; margin-top: 6px; }
.slide-body { padding: 14px 18px; max-height: 72vh; overflow-y: auto; }
/* area preview bertinggi pasti (16:9 dari lebar dialog, maks 56vh): media di-contain di dalamnya, jadi landscape
   tidak lebih tinggi dan portrait tidak lebih lebar dari area preview */
.slide-stage { position: relative; display: flex; align-items: center; justify-content: center; height: min(56vh, calc((min(1100px, 96vw) - 36px) * 9 / 16));
  margin: 0 auto; background: #000; border-radius: 10px; overflow: hidden; }
.slide-stage img, .slide-stage video { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.slide-empty { padding: 24px; color: var(--muted); font-size: 18px; text-align: center; }
.slide-ost { position: absolute; left: 6%; right: 6%; bottom: 8%; text-align: center; font-size: clamp(16px, 2.6vw, 30px); font-weight: 700; color: #fff;
  text-shadow: 0 2px 8px rgb(0 0 0 / .8); pointer-events: none; }
.slide-text { margin-top: 12px; }
.slide-text p { margin: 6px 0; }
.slide-nav { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); }
.slide-dots { flex: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.slide-dots button { font: inherit; font-size: 12px; min-width: 28px; padding: 3px 6px; border-radius: 99px; border: 1px solid var(--border); background: none; color: var(--muted); cursor: pointer; }
.slide-dots button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
