:root {
  --bg: #0a0b0f;
  --bg-soft: #101218;
  --panel: #12141b;
  --panel-2: rgba(255, 255, 255, 0.035);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --ink: #f4f2ee;
  --ink-dim: rgba(244, 242, 238, 0.62);
  --ink-faint: rgba(244, 242, 238, 0.38);
  --accent: #ff6a2b;
  --accent-2: #2ed3b7;
  --green: #4ade80;
  --amber: #fbbf24;
  --red: #f87171;
  --radius: 16px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at 8% -10%, rgba(255, 106, 43, 0.16), transparent 62%),
    radial-gradient(800px 600px at 100% 110%, rgba(46, 211, 183, 0.12), transparent 60%);
}

h1, h2, h3, p {
  margin: 0;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 11, 15, 0.82);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark,
.placeholder-mark {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 24px;
}

.mark i,
.placeholder-mark i {
  display: block;
  width: 4px;
  border-radius: 3px;
  background: var(--accent);
}

.mark i:nth-child(1) { height: 10px; }
.mark i:nth-child(2) { height: 20px; background: var(--accent-2); }
.mark i:nth-child(3) { height: 15px; }
.mark i:nth-child(4) { height: 23px; background: var(--accent-2); }

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-text strong {
  font-size: 18px;
  letter-spacing: 0.01em;
}

.brand-text small {
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.engine {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-dim);
  font-size: 12.5px;
  white-space: nowrap;
}

.engine .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
}

.engine.ok .dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.13);
}

.engine.bad .dot {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.13);
}

.root-path {
  max-width: 38vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-faint);
  font-size: 12px;
  font-family: Consolas, "Cascadia Mono", monospace;
}

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 318px minmax(0, 1fr);
  gap: 18px;
  width: min(1400px, 100%);
  margin: 0 auto;
  padding: 20px 24px 40px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 20px;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 40px);
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  backdrop-filter: blur(10px);
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.side-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.count {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0;
}

.job-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
  margin-right: -4px;
}

.job {
  display: block;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  transition: background 140ms ease, border-color 140ms ease;
}

.job:hover {
  background: rgba(255, 255, 255, 0.045);
}

.job.active {
  border-color: rgba(255, 106, 43, 0.45);
  background: rgba(255, 106, 43, 0.075);
}

.job-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.job-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.job-meta,
.job-sub {
  display: block;
  margin-top: 5px;
  color: var(--ink-dim);
  font-size: 12px;
}

.job-sub {
  margin-top: 2px;
  color: var(--ink-faint);
  font-family: Consolas, "Cascadia Mono", monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink-dim);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.pill.done { color: var(--green); border-color: rgba(74, 222, 128, 0.28); }
.pill.ready { color: var(--accent-2); border-color: rgba(46, 211, 183, 0.3); }
.pill.stale { color: var(--amber); border-color: rgba(251, 191, 36, 0.3); }
.pill.rendering { color: var(--accent); border-color: rgba(255, 106, 43, 0.35); }
.pill.queued { color: var(--amber); border-color: rgba(251, 191, 36, 0.3); }
.pill.processing { color: var(--accent-2); border-color: rgba(46, 211, 183, 0.32); }
.pill.error { color: var(--red); border-color: rgba(248, 113, 113, 0.32); }
.pill.incomplete { color: var(--ink-faint); }

.pill.rendering::before {
  animation: blink 1.2s ease-in-out infinite;
}

.mini-bar {
  display: block;
  height: 3px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.mini-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 180ms linear;
}

@keyframes blink {
  50% { opacity: 0.25; }
}

.panel {
  min-width: 0;
  min-height: calc(100vh - 108px);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012) 55%);
  backdrop-filter: blur(10px);
}

.placeholder {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
  min-height: 60vh;
  max-width: 460px;
  margin: 0 auto;
}

.placeholder-mark {
  height: 34px;
  gap: 4px;
  opacity: 0.85;
}

.placeholder-mark i {
  width: 5px;
}

.placeholder-mark i:nth-child(1) { height: 14px; }
.placeholder-mark i:nth-child(2) { height: 30px; }
.placeholder-mark i:nth-child(3) { height: 21px; }
.placeholder-mark i:nth-child(4) { height: 34px; }

.placeholder h1 {
  font-size: 30px;
  letter-spacing: -0.02em;
}

.placeholder p {
  color: var(--ink-dim);
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.kicker {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.detail-head h1 {
  max-width: 780px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.16;
  letter-spacing: -0.025em;
}

.sub {
  margin-top: 8px;
  color: var(--ink-dim);
  font-size: 13px;
}

.files {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 12px;
  font-family: Consolas, "Cascadia Mono", monospace;
}

.head-actions {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.action-row {
  display: flex;
  gap: 8px;
}

/* Pilihan mesin video: satu baris chip, aktif = aksen. */
.engine-pick {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
}

.engine-chip {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-dim);
  font: 600 12.5px/1 var(--font);
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.engine-chip:hover {
  color: var(--ink);
}

.engine-chip.active {
  background: var(--accent);
  color: #150a04;
}

.engine-chip:disabled {
  opacity: 0.55;
  cursor: default;
}

/* Pemilih "Gaya video": muncul sebelum video dibuat, jadi tiap gaya terlihat
   sebagai opsi yang bisa diklik (bukan dropdown tersembunyi). */
.field-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 2px 0;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.gaya-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Pemilih tema di panel detail: satu dropdown kecil, bukan chip 40 butir. */
.theme-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-dim);
  font: 600 12px/1 var(--font);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.theme-pick select {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--ink);
  font: 600 13px/1 var(--font);
  text-transform: none;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.theme-pick select:disabled {
  opacity: 0.55;
  cursor: progress;
}

.gaya-chip {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--ink-dim);
  font: 600 13px/1 var(--font);
  letter-spacing: 0.02em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.chip-label {
  font-size: 12px;
  font-weight: 500;
  margin-left: 6px;
  color: var(--ink-dim);
}

.gaya-hint-visible {
  font-size: 11.5px;
  color: var(--ink-faint);
  margin-left: 12px;
  font-style: italic;
}

.gaya-chip:hover {
  color: var(--ink);
}

.gaya-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #150a04;
}

.gaya-chip:disabled {
  opacity: 0.55;
  cursor: default;
}

.gaya-chip:hover {
  color: var(--ink);
}

.gaya-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #150a04;
}

.gaya-chip:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.btn.primary {
  background: var(--accent);
  color: #1b0d06;
}

.btn.primary:hover:not(:disabled) {
  background: #ff7d44;
}

.btn.ghost {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
}

.btn.ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.075);
}

.btn.danger {
  background: #5c1a12;
  border-color: #8f2f20;
  color: #ffb4a4;
}

.btn.danger:hover:not(:disabled) {
  background: #7a2418;
  border-color: #b03a28;
}

.btn.small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
}

/* Tombol tenang: tanpa kotak, cuma teks. Dipakai untuk aksi sekunder
   (ubah nama / hapus) supaya tidak menyaingi tombol render utama. */
.btn.link {
  min-height: 26px;
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--ink-dim);
  font-size: 12.5px;
}

.btn.link:hover:not(:disabled) {
  color: var(--ink);
}

.btn.link.danger-text {
  color: #e8836f;
}

.btn.link.danger-text:hover:not(:disabled) {
  color: #ff9d88;
}

.link {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-dim);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link:hover {
  color: var(--ink);
}

/* Baris aksi sekunder: lebih rapat dan tenang dari .action-row utama. */
.action-row.quiet {
  gap: 14px;
  margin-top: 10px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 11px;
  background: rgba(251, 191, 36, 0.07);
  color: #f8dfa3;
  font-size: 13px;
}

.notice.error {
  border-color: rgba(248, 113, 113, 0.32);
  background: rgba(248, 113, 113, 0.08);
  color: #fecaca;
}

.notice strong {
  display: block;
  margin-bottom: 2px;
  color: inherit;
}

.notice .notice-body {
  min-width: 0;
}

.notice pre {
  max-height: 180px;
  margin: 8px 0 0;
  overflow: auto;
  color: rgba(254, 202, 202, 0.85);
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 11.5px;
  white-space: pre-wrap;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 1px;
  margin: 22px 0 0;
  border: 1px solid var(--border);
  border-radius: 13px;
  overflow: hidden;
  background: var(--border);
}

.stat {
  padding: 13px 15px 14px;
  background: var(--panel);
}

.stat dt {
  color: var(--ink-faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stat dd {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.card {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-2);
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.card-head h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.card-head .muted {
  font-size: 12px;
}

.muted {
  color: var(--ink-faint);
}

.warnings {
  margin: 0;
  padding-left: 18px;
  color: #f8dfa3;
  font-size: 13px;
}

.warnings li + li {
  margin-top: 4px;
}

.scenes {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scene {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
}

.scene-no {
  padding-top: 2px;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.scene-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.scene-head strong {
  font-size: 14.5px;
  font-weight: 600;
}

.scene-time {
  color: var(--ink-faint);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.scene-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.caption-line {
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--ink-dim);
  font-size: 12px;
}

.note {
  margin-top: 6px;
  color: var(--ink-faint);
  font-size: 12px;
  font-style: italic;
}

.bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 180ms linear;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
  color: var(--ink-dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.progress-meta .grow {
  flex: 1;
  text-align: center;
}

.output-body {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.output-body video {
  flex: none;
  width: auto;
  height: 420px;
  max-width: 100%;
  aspect-ratio: 9 / 16;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #000;
}

.output-body video.square {
  height: 360px;
  aspect-ratio: 1 / 1;
}

.output-body video.wide {
  width: 100%;
  height: auto;
  max-width: 100%;
  aspect-ratio: 16 / 9;
}

.output-meta {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.output-meta .file {
  font-size: 14px;
  font-weight: 600;
  word-break: break-all;
}

.output-meta .path {
  color: var(--ink-faint);
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 11.5px;
  word-break: break-all;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}

.skeleton span {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(255,255,255,0.11), rgba(255,255,255,0.05));
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}

.skeleton span:nth-child(1) { width: 58%; height: 22px; }
.skeleton span:nth-child(2) { width: 84%; }
.skeleton span:nth-child(3) { width: 72%; }

@keyframes shimmer {
  to { background-position: -220% 0; }
}

.new-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
}

.new-form label {
  color: var(--ink-dim);
  font-size: 12px;
  font-weight: 600;
}

.new-form input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 13.5px;
}

.new-form input:focus {
  border-color: rgba(255, 106, 43, 0.55);
  outline: none;
}

.hint {
  color: var(--ink-faint);
  font-size: 11.5px;
  line-height: 1.45;
}

.empty-jobs {
  color: var(--ink-faint);
  font-size: 13px;
}

.preview-dialog {
  width: min(560px, 92vw);
  max-height: 90vh;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--panel);
  color: var(--ink);
}

.preview-dialog::backdrop {
  background: rgba(4, 5, 8, 0.72);
  backdrop-filter: blur(4px);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.dialog-head h2 {
  font-size: 15px;
}

.dialog-head .muted {
  margin-top: 3px;
  font-size: 12px;
}

.dialog-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 18px;
  overflow: auto;
}

.dialog-body img {
  display: block;
  max-width: 100%;
  max-height: 68vh;
  border-radius: 9px;
  background: #000;
}

.preview-loading {
  color: var(--ink-dim);
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 10;
  max-width: min(520px, 90vw);
  transform: translateX(-50%);
  padding: 11px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #1a1d25;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  font-size: 13px;
}

.toast.error {
  border-color: rgba(248, 113, 113, 0.4);
  background: #2a1517;
}

.narasi-cta {
  width: 100%;
}

.narasi-dialog {
  width: min(640px, 94vw);
}

.narasi-dialog form {
  display: flex;
  flex-direction: column;
}

.narasi-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  min-height: 0;
  padding: 18px;
  overflow: auto;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 188px;
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.dropzone:hover,
.dropzone.drag {
  border-color: rgba(255, 106, 43, 0.6);
  background: rgba(255, 106, 43, 0.06);
}

.dropzone.filled {
  border-style: solid;
  border-color: rgba(46, 211, 183, 0.45);
  background: rgba(46, 211, 183, 0.05);
}

.dropzone strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.dropzone span {
  color: var(--ink-faint);
  font-size: 12px;
}

.narasi-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.narasi-fields label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--ink-dim);
  font-size: 12px;
  font-weight: 600;
}

.narasi-fields .muted {
  font-weight: 400;
}

.narasi-fields input,
.narasi-fields select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: #0d0f14;
  color: var(--ink);
  font-size: 13.5px;
}

.narasi-fields input:focus,
.narasi-fields select:focus {
  border-color: rgba(255, 106, 43, 0.55);
  outline: none;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 4px;
}
.radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 400;
  color: var(--ink-dim);
}
.radio-row input[type="radio"] {
  accent-color: var(--accent);
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 4px;
}
.checkbox-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 400;
  color: var(--ink-dim);
}
.checkbox-row input[type="checkbox"] {
  accent-color: var(--accent);
}

.field-block fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0;
}
.field-block legend {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 0 6px;
}

.upload-progress {
  grid-column: 1 / -1;
}

.upload-progress .bar {
  margin-bottom: 7px;
}

.dialog-foot {
  display: flex;
  justify-content: flex-end;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

.warn-text {
  color: #f8dfa3;
}

.narasi-audio {
  margin-top: 16px;
}

.narasi-audio audio {
  width: 100%;
  height: 40px;
}

.stage-label {
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.summary {
  color: var(--ink-dim);
  font-size: 13.5px;
  line-height: 1.6;
}

.facts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.facts li {
  position: relative;
  padding: 9px 12px 9px 28px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
}

.facts li::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 15px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.fact-source {
  display: block;
  margin-top: 3px;
  color: var(--accent-2);
  font-size: 11.5px;
  text-decoration: none;
}

.fact-source:hover {
  text-decoration: underline;
}

.sources {
  margin-top: 12px;
  color: var(--ink-dim);
  font-size: 12.5px;
}

.sources summary {
  cursor: pointer;
  color: var(--ink-dim);
}

.sources ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.sources li + li {
  margin-top: 4px;
}

.sources a {
  color: var(--ink);
  text-decoration: none;
}

.sources a:hover {
  text-decoration: underline;
}

.transcript summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.segments {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.segments li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  font-size: 13px;
}

.seg-time {
  color: var(--ink-faint);
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 11.5px;
  padding-top: 2px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}

.media-item {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #000;
  color: inherit;
  text-decoration: none;
  transition: border-color 140ms ease, transform 140ms ease;
}

.media-item:hover {
  border-color: rgba(255, 106, 43, 0.5);
  transform: translateY(-1px);
}

.media-item img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #101218;
}

.media-fallback {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(120px 90px at 25% 30%, rgba(255, 106, 43, 0.35), transparent 70%),
    radial-gradient(140px 100px at 80% 75%, rgba(46, 211, 183, 0.28), transparent 70%),
    #101218;
}

.media-tag {
  position: absolute;
  top: 7px;
  left: 7px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(6, 7, 10, 0.78);
  color: var(--ink);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.media-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px 9px;
  background: rgba(10, 11, 15, 0.9);
}

.media-info strong {
  font-size: 12px;
  font-weight: 600;
}

.media-info span {
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-do {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.mini {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-dim);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}

.mini:hover:not(:disabled) {
  border-color: rgba(255, 106, 43, 0.5);
  background: rgba(255, 106, 43, 0.14);
  color: var(--ink);
}

.mini:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Editor naskah */
.naskah-edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.naskah-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}

.naskah-row textarea {
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
}

.naskah-row textarea:focus {
  border-color: rgba(255, 106, 43, 0.55);
  outline: none;
}

.naskah-row textarea:disabled {
  opacity: 0.55;
}

/* Storyboard filmstrip */
.filmstrip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.filmstrip img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #101218;
}

/* Logo & musik */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.asset-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
}

.asset-box strong {
  font-size: 13px;
}

/* Preset */
.text-input {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
}

.text-input:focus {
  border-color: rgba(255, 106, 43, 0.55);
  outline: none;
}

.text-input:disabled {
  opacity: 0.55;
}

/* Riwayat versi */
.versions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
}

.versions li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
}

.ver-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.ver-body strong {
  font-size: 12.5px;
  font-weight: 600;
}

.ver-body span {
  font-size: 11px;
}

/* Varian rasio */
.variants {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.variants ul {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.variants li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.variants li span:first-child {
  min-width: 84px;
}

.variants li .btn {
  margin-left: auto;
}

.row.quiet {
  margin-top: 8px;
}


@media (max-width: 980px) {
  .topbar {
    padding: 12px 16px;
  }

  .root-path {
    display: none;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px 14px 30px;
  }

  .detail-head h1 {
    overflow-wrap: anywhere;
  }

  .sidebar {
    position: static;
    max-height: none;
  }

  .job-list {
    max-height: 280px;
  }

  .panel {
    min-height: 60vh;
    padding: 20px;
  }

  .detail-head {
    flex-direction: column;
  }

  .head-actions {
    width: 100%;
  }

  .theme-pick {
    width: 100%;
    justify-content: space-between;
  }

  .theme-pick select {
    flex: 1;
    min-width: 0;
  }

  .head-actions .btn {
    flex: 1;
  }

  .output-body {
    flex-direction: column;
  }

  .output-body video {
    width: 100%;
  }

  .output-body video.portrait {
    width: auto;
    height: min(420px, 62vh);
    max-width: 100%;
  }

  .output-body video.square {
    width: min(100%, 360px);
    height: auto;
  }

  .output-body video.wide {
    width: 100%;
    height: auto;
  }

  .dialog-body img {
    max-height: 58vh;
  }

  .narasi-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .dropzone {
    min-height: 140px;
  }

  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }

  .narasi-audio audio {
    width: 100%;
  }

  .narasi-dialog .dialog-head {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
