:root {
  color-scheme: dark;
  --bg: #050811;
  --sidebar: rgba(9, 13, 24, 0.92);
  --card: rgba(15, 22, 38, 0.78);
  --card-elevated: rgba(20, 29, 50, 0.9);
  --input-bg: rgba(4, 8, 18, 0.85);
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --indigo: #6366f1;
  --violet: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --fb: #1877f2;
  --yt: #ef4444;
  --tt: #2dd4bf;
  --shadow-card: 0 18px 40px -24px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

* { box-sizing: border-box; }

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.38); }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background:
    radial-gradient(900px circle at 12% -5%, rgba(56, 189, 248, 0.14), transparent 55%),
    radial-gradient(800px circle at 88% 8%, rgba(99, 102, 241, 0.14), transparent 52%),
    radial-gradient(700px circle at 50% 100%, rgba(139, 92, 246, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Be Vietnam Pro", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

code, .time-label, .job-badge, .lib-meta {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.layout {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}

/* SIDEBAR */
.sidebar {
  background: var(--sidebar);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 8px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.09);
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #38bdf8, #6366f1 65%, #a855f7);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  box-shadow: 0 8px 20px -6px rgba(56, 189, 248, 0.55);
}

.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand-sub { font-size: 10.5px; color: var(--muted); margin-top: 1px; }

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
}

.nav-ico {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.78;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}

.nav-item:hover .nav-ico { opacity: 1; transform: translateX(1px); }

.nav-item.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(99, 102, 241, 0.14));
  border-color: rgba(56, 189, 248, 0.34);
  color: #f0f9ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-item.active .nav-ico { color: #38bdf8; opacity: 1; }

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.09);
}

.sys-pill {
  background: rgba(5, 9, 20, 0.75);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 8px 11px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sys-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.sys-pill strong {
  font-size: 11.5px;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* MAIN WORKSPACE */
.main-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 20px 26px;
  gap: 18px;
  overflow-y: auto;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.11);
  padding-bottom: 14px;
}

.topbar h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: linear-gradient(90deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.topbar p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.32);
  color: #bae6fd;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#globalStatusBadge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
}

.view { display: none; flex: 1 0 auto; min-height: 0; }
.view.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 36px;
  animation: viewFade 0.18s ease-out;
}

@keyframes viewFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* CARDS */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  position: relative;
}

.card-accent-sky { border-top: 2px solid rgba(56, 189, 248, 0.65); }
.card-accent-indigo { border-top: 2px solid rgba(129, 140, 248, 0.65); }
.card-accent-fb { border-top: 2px solid rgba(24, 119, 242, 0.8); }
.card-accent-yt { border-top: 2px solid rgba(239, 68, 68, 0.8); }
.card-accent-tt { border-top: 2px solid rgba(45, 212, 191, 0.8); }

.card h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #e0f2fe;
  letter-spacing: -0.01em;
}

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

.section-pill {
  font-size: 10.5px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}

.platform-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-svg { width: 17px; height: 17px; flex-shrink: 0; }
.brand-svg.fb { color: #3b82f6; }
.brand-svg.yt { color: #ef4444; }
.brand-svg.tt { color: #2dd4bf; }

/* GRIDS */
.batch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
  gap: 18px;
  flex: 1;
  min-height: 0;
}

.admin-section-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.2), transparent);
}

.admin-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 16px;
  align-items: stretch;
}

.admin-social-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

/* INPUTS & FIELDS */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field span { font-size: 11.5px; font-weight: 500; color: #cbd5e1; }

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

.create-link {
  font-size: 10.5px;
  font-weight: 600;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 999px;
  padding: 2px 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.create-link:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.5);
  color: #fff;
}

select, input[type="text"], input[type="password"], input[type="datetime-local"], textarea {
  width: 100%;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

select:hover, input[type="text"]:hover, input[type="password"]:hover, textarea:hover {
  border-color: var(--border-strong);
}

select:focus, input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
  background: rgba(6, 12, 26, 0.96);
}

input[type="datetime-local"] {
  color-scheme: dark;
  cursor: pointer;
}
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.92;
  filter: invert(0.9) sepia(0.15) hue-rotate(180deg) brightness(1.15);
}
.sched-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.sched-input-row input { flex: 1; min-width: 0; }
.sched-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

textarea#batchIdeasInput {
  line-height: 1.55;
  min-height: 122px;
}

/* CUSTOM VOICE FILE DROPZONE */
.sr-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-drop {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px dashed rgba(129, 140, 248, 0.42);
  background: rgba(4, 8, 18, 0.68);
  color: #cbd5e1;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.file-drop:hover {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.1);
  color: #fff;
}

.file-drop span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* TOGGLES & MULTI-PLATFORM CHIPS */
.batch-footer-opts {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #cbd5e1;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  accent-color: #38bdf8;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.toggle-pill {
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(5, 9, 20, 0.65);
  border: 1px solid var(--border);
}

.muted-inline {
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
}

.batch-auto-pub {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(5, 9, 20, 0.65);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.batch-auto-pub-title { font-size: 11.5px; color: #cbd5e1; font-weight: 600; }

.pub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pub-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: all 0.16s ease;
}

.pub-chip input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: #38bdf8;
}

.chip-ico { width: 14px; height: 14px; flex-shrink: 0; }

.pub-chip:hover { border-color: var(--border-strong); color: #e2e8f0; }
.pub-chip.fb:has(input:checked) { background: rgba(24, 119, 242, 0.2); border-color: rgba(59, 130, 246, 0.7); color: #dbeafe; }
.pub-chip.yt:has(input:checked) { background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.65); color: #fee2e2; }
.pub-chip.tt:has(input:checked) { background: rgba(45, 212, 191, 0.16); border-color: rgba(45, 212, 191, 0.65); color: #ccfbf1; }

.audio-checks { display: flex; flex-wrap: wrap; gap: 14px; }

/* BUTTONS */
.btn {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: transform 0.14s ease, filter 0.14s ease, box-shadow 0.14s ease;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); }
.btn:active:not(:disabled) { transform: translateY(0); }

.btn-lg { padding: 13px 18px; font-size: 13.5px; }
.btn-sm { padding: 8px 11px; font-size: 12px; }

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(14, 165, 233, 0.65);
}

.btn-accent {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-success { background: #10b981; color: #022c22; font-weight: 700; }
.btn-danger { background: rgba(239, 68, 68, 0.2); color: #fecaca; border: 1px solid rgba(239, 68, 68, 0.4); }
.btn-fb { background: linear-gradient(135deg, #1877f2, #1d4ed8); color: #fff; }
.btn-yt { background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff; }
.btn-tt {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #f8fafc;
  border: 1px solid rgba(45, 212, 191, 0.55);
}
.btn:disabled { opacity: 0.52; cursor: not-allowed; }

.mini-btn {
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid var(--border);
  color: #e2e8f0;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.14s ease;
}

.mini-btn:hover {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
  color: #fff;
}

.mini-btn.mini-primary {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.38);
  color: #bae6fd;
}

.mini-btn.mini-danger:hover {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.15);
  color: #fecaca;
}

/* JOB QUEUE */
.job-queue {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 580px;
  padding-right: 4px;
}

.job-item {
  background: rgba(4, 8, 18, 0.78);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.job-item:hover {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(8, 14, 29, 0.9);
}

.job-thumb {
  width: 48px;
  height: 70px;
  border-radius: 8px;
  object-fit: cover;
  background: linear-gradient(145deg, #0f172a, #1e1b4b);
  border: 1px solid rgba(148, 163, 184, 0.18);
  flex-shrink: 0;
}

.job-thumb-placeholder {
  width: 48px;
  height: 70px;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.12), rgba(99, 102, 241, 0.14));
  border: 1px solid rgba(56, 189, 248, 0.22);
  display: grid;
  place-items: center;
  color: #7dd3fc;
  flex-shrink: 0;
}

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

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

.job-title {
  font-weight: 700;
  font-size: 13px;
  color: #f1f5f9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-badge {
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #7dd3fc;
}

.job-badge.done {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.32);
  color: #6ee7b7;
}

.job-badge.error {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.job-stage { font-size: 11.5px; color: var(--muted); }
.job-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.progress-fill.active {
  background: linear-gradient(90deg, #0ea5e9, #818cf8, #38bdf8);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

.progress-fill.done { background: linear-gradient(90deg, #10b981, #34d399); }
.progress-fill.error { background: #ef4444; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* PREVIEW VIEW */
.preview-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.stage-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.stage-header {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

.chapter-pill {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.32);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.viewport-frame {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #000;
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.9);
}

.viewport-frame.portrait { aspect-ratio: 9 / 16; height: calc(100vh - 236px); max-height: 680px; }
.viewport-frame.landscape { aspect-ratio: 16 / 9; width: 560px; max-width: 100%; }

#glCanvas, #hudCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#hudCanvas { pointer-events: none; }

.render-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 14, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.render-card {
  width: 268px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.spinner {
  width: 30px; height: 30px;
  border: 3px solid rgba(56, 189, 248, 0.25);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.timeline-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--border);
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-icon.active { background: rgba(16, 185, 129, 0.22); border-color: rgba(52, 211, 153, 0.5); }
.time-label { font-size: 11px; color: var(--muted); min-width: 40px; text-align: center; }
#timelineSlider { flex: 1; accent-color: var(--accent); }

.editor-card { overflow-y: auto; max-height: calc(100vh - 125px); padding-bottom: 24px; }
.editor-meta-strip {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 12px;
  align-items: center;
  background: rgba(4, 8, 18, 0.72);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}
.editor-cover-thumb {
  width: 62px;
  height: 86px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: #0f172a;
}
.editor-meta-fields { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.editor-guide-line { font-size: 11px; color: #94a3b8; line-height: 1.4; }
.editor-guide-line b { color: #bae6fd; }
.editor-btn-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chapter-list { display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }

.ch-card {
  background: rgba(4, 8, 18, 0.78);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 11px;
  transition: border-color 0.15s ease;
}
.ch-card:hover { border-color: rgba(56, 189, 248, 0.3); }

.ch-thumb {
  width: 66px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.2);
  cursor: pointer;
}
.ch-thumb:hover { border-color: var(--accent); }
.ch-meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ch-head { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: #fde68a; font-weight: 700; gap: 6px; }
.ch-head select { width: auto; padding: 3px 8px; font-size: 11px; }
.ch-prompt-input { font-size: 11px !important; padding: 6px 9px !important; color: #94a3b8 !important; }
.ch-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* LIBRARY VIEW */
.library-header { display: flex; justify-content: space-between; align-items: center; }
.library-header h2 { margin: 0; font-size: 16px; }
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 16px;
}

.lib-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 15px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.lib-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.35);
}

.lib-cover-wrap {
  position: relative;
  width: 100%;
  height: 185px;
  background: #020617;
  overflow: hidden;
}

.lib-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lib-cover-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(5, 8, 17, 0.92) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 10px 12px;
}

.lib-badge-float {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(5, 8, 17, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 3px 8px;
  border-radius: 999px;
}

.lib-body { padding: 13px; display: flex; flex-direction: column; gap: 9px; }
.lib-title { font-weight: 700; font-size: 13.5px; line-height: 1.35; }
.lib-meta { font-size: 11px; color: var(--muted); }
.lib-pub-tags { display: flex; flex-wrap: wrap; gap: 5px; }

/* ADMIN & MODAL */
.redirect-tip { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.redirect-row { display: flex; gap: 6px; align-items: center; min-width: 0; }
.redirect-row code {
  flex: 1;
  min-width: 0;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  color: #7dd3fc;
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-fb {
  font-size: 11.5px;
  color: var(--muted);
  background: rgba(5, 9, 20, 0.5);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}
.manual-fb summary { cursor: pointer; font-weight: 600; color: #cbd5e1; }
.manual-fb-body { margin-top: 9px; display: flex; flex-direction: column; gap: 7px; }
.mini-note { font-size: 11.5px; color: var(--muted); line-height: 1.45; }

.duration-hint {
  font-size: 11.5px;
  color: #bae6fd;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.12), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  padding: 8px 11px;
  line-height: 1.45;
}

.empty-state {
  font-size: 13px;
  color: var(--muted);
  padding: 32px 20px;
  text-align: center;
  border: 1px dashed rgba(148, 163, 184, 0.22);
  border-radius: 13px;
  background: rgba(4, 8, 18, 0.45);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.86);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 20px;
}

.modal-card {
  width: min(1040px, 94vw);
  background: #0c1324;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 30px 70px -18px rgba(0, 0, 0, 0.92), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 700; color: #f1f5f9; }
.modal-body {
  display: grid;
  grid-template-columns: minmax(270px, 330px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.modal-video-col { display: flex; flex-direction: column; gap: 10px; }
#modalVideoPlayer {
  width: 100%;
  height: 520px;
  object-fit: contain;
  border-radius: 14px;
  background: #030610;
  border: 1px solid var(--border);
}
.modal-pub { display: flex; flex-direction: column; gap: 13px; min-width: 0; }
#modalFbDesc {
  min-height: 155px;
  line-height: 1.55;
  font-size: 13px;
}
.modal-status-box {
  background: rgba(4, 8, 18, 0.72);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  min-height: 36px;
  color: #cbd5e1;
}
.modal-status-box:empty { display: none; }

.hidden { display: none !important; }

@media (max-width: 1200px) {
  .admin-top-row, .admin-social-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; height: auto; }
  html, body { overflow: auto; }
  .batch-grid, .admin-top-row, .admin-social-row, .preview-grid, .modal-body { grid-template-columns: 1fr; }
  #modalVideoPlayer { height: auto; max-height: 320px; }
}
