:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1d2433;
  --muted: #667085;
  --line: #d8dde6;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --danger: #b42318;
  --warn: #a15c07;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  padding: 24px 16px;
  background: #111827;
  color: #f9fafb;
}
.brand { font-size: 18px; font-weight: 800; margin-bottom: 28px; }
.account-box {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid #374151;
  border-radius: 8px;
  color: #d1d5db;
}
.account-box span { font-weight: 700; color: #fff; }
.account-box button {
  width: fit-content;
  border: 0;
  padding: 0;
  background: transparent;
  color: #9ca3af;
  font: inherit;
  cursor: pointer;
}
.account-box button:hover { color: #fff; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar a { padding: 10px 12px; border-radius: 6px; color: #d1d5db; }
.sidebar a:hover { background: #1f2937; color: #fff; }
.main { margin-left: 240px; padding: 32px; min-height: 100vh; }
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
h1, h2 { margin: 0; }
h1 { font-size: 34px; line-height: 1.15; }
h2 { font-size: 18px; margin-bottom: 14px; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 13px; text-transform: uppercase; font-weight: 700; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-strong); }
.button.danger { color: var(--danger); border-color: #f0b8b3; }
.button.is-loading { opacity: 0.72; cursor: wait; }
.button.is-loading::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  margin-right: 7px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.actions.vertical { align-items: stretch; flex-direction: column; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card, .panel, .metric, .scene-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.card-top { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.status, .tag {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e7f8f5;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}
.status.missing {
    background: #fef3f2;
    color: var(--danger);
  }
  .status.neutral {
    background: #f3f4f6;
    color: var(--muted);
  }
.status-failed {
  background: #fef3f2;
  color: var(--danger);
}
.status-ready {
  background: #e7f8f5;
  color: var(--accent-strong);
}
.status-generating,
.status-running,
.status-pending {
  background: #fff7ed;
  color: #9a3412;
}
.status-published,
.status-scheduled {
  background: #eff6ff;
  color: #1d4ed8;
}
.status-interrupted { background: #f3f4f6; color: #4b5563; }
.tag.warn { background: #fff4e5; color: var(--warn); }
.toast-container { position: fixed; right: 22px; bottom: 22px; display: grid; gap: 10px; z-index: 1000; max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 12px 14px; border-radius: 8px; background: #0f766e; color: #fff; box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22); font-weight: 700; }
.toast.error { background: #b42318; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.metric { display: grid; gap: 8px; }
.metric span { color: var(--muted); }
.metric strong { font-size: 32px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 0.7fr); gap: 24px; align-items: start; }
.form-stack { display: grid; gap: 16px; }
.series-builder,
.series-builder .panel {
  min-width: 0;
  max-width: 100%;
}
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; align-items: end; }
.field { display: grid; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.conditional-field[hidden] { display: none; }
.field-block { display: grid; gap: 10px; margin-top: 16px; }
.field-label { font-weight: 800; color: #344054; }
.field-help { margin: 0; color: var(--muted); }
.narrow-field { max-width: 240px; margin-top: 14px; }
label { font-weight: 700; font-size: 13px; color: #344054; }
input, select, textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; min-height: 38px; }
.check input { width: auto; }
.weekday-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.weekday-grid label { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.weekday-grid input { width: auto; }
.footer-actions { display: flex; gap: 8px; margin-bottom: 40px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 0; }
dt { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
dd { margin: 4px 0 0; }
.table { display: grid; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.table-row { display: grid; grid-template-columns: 1.3fr 1fr 0.8fr 0.7fr; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: center; }
.table-row.episode-row { grid-template-columns: minmax(220px, 1.4fr) minmax(140px, 0.8fr) minmax(110px, 0.6fr) auto minmax(320px, 1.1fr); }
.table-row:last-child { border-bottom: 0; }
.table-row.linked:hover { background: #f9fafb; }
.publishable-row { background: #fff7ed; }
.row-title { display: block; font-weight: 800; margin-bottom: 5px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.row-actions form { margin: 0; }
.button.small { padding: 7px 10px; font-size: 12px; }
.publishable-panel { display: flex; justify-content: space-between; align-items: center; gap: 18px; border-color: #fed7aa; background: #fff7ed; }
.metadata-copy-preview { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; background: #0b1220; color: #e5e7eb; padding: 16px; border-radius: 8px; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.list li { padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.job-list-item,
.job-card { display: grid; gap: 9px; }
.job-card { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.cost-summary-panel { gap: 14px; }
.cost-total {
  display: grid;
  gap: 2px;
  text-align: right;
  font-size: 18px;
}
.cost-total span {
  color: var(--muted);
  font-size: 12px;
}
.cost-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.cost-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.cost-row div {
  display: grid;
  gap: 3px;
}
.cost-row span {
  color: var(--muted);
  font-size: 12px;
}
.cost-details { margin-top: 4px; }
.compact-table .row {
  grid-template-columns: 1fr 1fr 1.2fr 1.4fr 0.8fr;
}
.failed-job-list { display: grid; gap: 10px; margin-top: 16px; }
.failed-job-list h3 { margin: 0; font-size: 15px; }
.failed-stage-card { border-color: #f0b8b3; background: #fffafa; }
.job-card-header,
.job-list-heading,
.job-progress-meta { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.job-card-header div { display: grid; gap: 3px; }
.job-card-header span,
.job-progress-meta { color: var(--muted); font-size: 13px; }
.progress-bar { height: 9px; overflow: hidden; border-radius: 999px; background: #e5e7eb; }
.progress-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.25s ease; }
.video-preview, .empty-preview {
  background: #0b1220;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #cbd5e1;
  margin-bottom: 18px;
}
.video-preview {
  width: 100%;
  overflow: hidden;
}
.video-preview.aspect-vertical {
  aspect-ratio: 9 / 16;
  max-width: 390px;
}
.video-preview.aspect-horizontal {
  aspect-ratio: 16 / 9;
  max-width: 900px;
}
.video-preview.aspect-square {
  aspect-ratio: 1 / 1;
  max-width: 560px;
}
.video-preview video,
.video-preview .empty-preview {
  width: 100%;
  height: 100%;
  min-height: 0;
}
.video-preview video {
  display: block;
  background: #000;
  object-fit: contain;
}
.editor-layout { display: grid; grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1fr); gap: 24px; align-items: start; }
.scene-list { display: grid; gap: 12px; }
.scene-thumb {
  width: 120px;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0b1220;
}
.scene-card p { color: var(--muted); }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.messages { margin-bottom: 16px; display: grid; gap: 8px; }
.message { background: #ecfdf3; color: #05603a; padding: 10px 12px; border-radius: 6px; border: 1px solid #abefc6; }
.message.error { background: #fef3f2; color: #b42318; border-color: #fecdca; }
.empty { padding: 18px; color: var(--muted); }
.narrow { max-width: 560px; }
code { background: #eef2f6; padding: 2px 5px; border-radius: 4px; }
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #eef2f6;
}
.auth-shell {
  width: min(420px, calc(100vw - 32px));
}
.auth-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(17, 24, 39, 0.08);
}
.auth-panel h1 { margin-bottom: 18px; }
.choice-cards,
.format-grid,
.style-grid,
.voice-grid,
.title-frame-grid,
.destination-grid,
.settings-cards {
  display: grid;
  gap: 12px;
}
.choice-cards.compact { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.choice-card,
.format-card,
.style-card,
.voice-card,
.title-frame-card,
.destination-card,
.settings-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.choice-card input,
.format-card input,
.style-card input,
.voice-card input,
.title-frame-card input,
.destination-card input,
.settings-card > input {
  position: absolute;
  inset: 10px 10px auto auto;
  width: auto;
  min-height: auto;
}
.choice-card:has(input:checked),
.format-card:has(input:checked),
.style-card:has(input:checked),
.voice-card:has(input:checked),
.title-frame-card:has(input:checked),
.destination-card:has(input:checked),
.settings-card:has(> input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.disabled-card {
  opacity: 0.72;
  cursor: not-allowed;
}
.choice-card span,
.format-card small,
.destination-card small,
.settings-card small,
.voice-card small {
  color: var(--muted);
  font-weight: 500;
}
.format-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.format-card {
  align-items: center;
  justify-items: center;
  text-align: center;
  min-height: 220px;
}
.ratio-preview {
  display: block;
  border: 2px solid #111827;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.20), rgba(29, 36, 51, 0.08)),
    repeating-linear-gradient(0deg, transparent, transparent 13px, rgba(17, 24, 39, 0.08) 14px);
}
.ratio-preview.vertical { width: 78px; height: 138px; }
.ratio-preview.horizontal { width: 150px; height: 84px; }
.ratio-preview.square { width: 116px; height: 116px; }
.voice-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  min-width: 0;
  max-width: 100%;
}
.voice-card {
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 76px;
  padding-right: 44px;
}
.voice-card span { display: grid; gap: 4px; }
.delivery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.voice-advanced-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.voice-slider-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.slider-heading,
.slider-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.slider-heading output {
  min-width: 34px;
  text-align: center;
  padding: 3px 7px;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.slider-labels small {
  color: var(--muted);
  font-size: 12px;
}
.voice-slider-card input[type="range"] {
  width: 100%;
}
.delivery-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 8px 10px;
  min-height: 84px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.delivery-card:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.delivery-card strong,
.delivery-card span {
  grid-column: 2;
}
.delivery-card span {
  color: var(--muted);
  font-size: 12px;
}
.icon-button {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fafb;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.icon-button:disabled { opacity: 0.6; cursor: progress; }
.inline-status { color: var(--danger); margin: 8px 0 0; }
.style-scroller {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  padding: 4px 4px 12px;
  scrollbar-width: thin;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
}
.style-grid {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 12px;
  width: max-content;
  min-width: 0;
  padding: 8px;
}
.style-card {
  flex: 0 0 132px;
  min-height: 246px;
  padding: 8px;
  align-content: start;
}
.style-preview {
  display: block;
  width: 116px;
  aspect-ratio: 9 / 16;
  height: auto;
  border-radius: 7px;
  border: 1px solid rgba(17, 24, 39, 0.10);
  background: linear-gradient(135deg, #d1d5db, #f9fafb);
  overflow: hidden;
}
.style-preview.image-preview {
  display: grid;
  place-items: center;
  background: #0b1220;
}
.style-preview.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.style-card:has(.image-preview) { min-height: 246px; }
.style-card strong {
  min-height: 32px;
  font-size: 12px;
  line-height: 1.1;
  text-transform: uppercase;
}
.style-photo-realism .style-preview { background: linear-gradient(135deg, #94a3b8, #e5e7eb 45%, #0f766e); }
.style-cinematic .style-preview { background: linear-gradient(135deg, #111827, #7c2d12 55%, #fbbf24); }
.style-documentary .style-preview { background: linear-gradient(135deg, #d6d3d1, #57534e); }
.style-dark-mystery .style-preview { background: linear-gradient(135deg, #020617, #334155 55%, #7f1d1d); }
.style-science-visualization .style-preview { background: radial-gradient(circle at 30% 35%, #22d3ee, transparent 20%), linear-gradient(135deg, #0f172a, #1d4ed8); }
.style-3d .style-preview { background: radial-gradient(circle at 35% 40%, #f8fafc, #60a5fa 35%, #1e3a8a); }
.style-illustration .style-preview { background: linear-gradient(135deg, #fde68a, #fca5a5 50%, #93c5fd); }
.style-anime .style-preview { background: linear-gradient(135deg, #fbcfe8, #c4b5fd 55%, #67e8f9); }
.style-custom .style-preview { background: repeating-linear-gradient(45deg, #f3f4f6, #f3f4f6 12px, #e5e7eb 12px, #e5e7eb 24px); }
.style-auto .style-preview { background: linear-gradient(135deg, #0f766e, #1d4ed8 55%, #facc15); }
.style-lego .style-preview { background: linear-gradient(135deg, #facc15, #dc2626 48%, #2563eb); }
.style-comic-book .style-preview { background: radial-gradient(circle, #facc15 0 12%, transparent 13%), linear-gradient(135deg, #dc2626, #111827); }
.style-disney-toon .style-preview { background: linear-gradient(135deg, #93c5fd, #f9a8d4 50%, #fde68a); }
.style-pixelated .style-preview { background: repeating-linear-gradient(90deg, #0f172a 0 12px, #22c55e 12px 24px, #38bdf8 24px 36px); image-rendering: pixelated; }
.style-creepy-toon .style-preview { background: linear-gradient(135deg, #312e81, #111827 52%, #84cc16); }
.style-claymation .style-preview { background: linear-gradient(135deg, #fca5a5, #fcd34d 50%, #a78bfa); }
.style-childrens-book .style-preview { background: linear-gradient(135deg, #fde68a, #bbf7d0 50%, #bfdbfe); }
.style-minecraft .style-preview { background: repeating-linear-gradient(0deg, #166534 0 16px, #854d0e 16px 32px, #3f6212 32px 48px); image-rendering: pixelated; }
.style-watercolor .style-preview { background: radial-gradient(circle at 40% 35%, rgba(96, 165, 250, .8), transparent 34%), radial-gradient(circle at 60% 65%, rgba(244, 114, 182, .7), transparent 34%), #f8fafc; }
.style-expressionism .style-preview { background: linear-gradient(135deg, #dc2626, #7c3aed 45%, #f97316 78%); }
.style-charcoal .style-preview { background: linear-gradient(135deg, #111827, #6b7280 52%, #e5e7eb); }
.style-film-noir .style-preview { background: linear-gradient(135deg, #030712, #374151 52%, #f9fafb); filter: grayscale(1); }
.destination-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.destination-card {
  min-height: 132px;
  align-content: start;
  padding-top: 16px;
}
.destination-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #fff;
  font-weight: 900;
}
.destination-youtube .destination-icon { background: #dc2626; }
.destination-youtube .destination-icon::before { content: "YT"; }
.destination-tiktok .destination-icon { background: #111827; }
.destination-tiktok .destination-icon::before { content: "TT"; }
.destination-instagram .destination-icon { background: linear-gradient(135deg, #f97316, #db2777 50%, #7c3aed); }
.destination-instagram .destination-icon::before { content: "IG"; }
.destination-facebook .destination-icon { background: #2563eb; }
.destination-facebook .destination-icon::before { content: "FB"; }
.destination-manual_download .destination-icon { background: var(--accent); }
.destination-manual_download .destination-icon::before { content: "MP4"; font-size: 12px; }
.settings-cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
.settings-card {
  grid-template-columns: auto 1fr;
  align-items: start;
  cursor: default;
}
.settings-card span { display: grid; gap: 5px; }
.compact-card { min-height: auto; }
.brand-settings-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.brand-preview {
  display: grid;
  place-items: center;
  min-height: 300px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
}
.brand-preview .preview-caption {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.phone-frame {
  position: relative;
  width: 118px;
  height: 210px;
  border: 3px solid #111827;
  border-radius: 18px;
  background: linear-gradient(180deg, #111827, #334155);
  --watermark-opacity: 0.6;
  --watermark-font-size: 11px;
  --watermark-logo-width: 34px;
}
.safe-zone {
  position: absolute;
  inset: 26px 12px 32px;
  border: 1px dashed rgba(255, 255, 255, 0.45);
  border-radius: 8px;
}
.watermark-dot {
  position: absolute;
  right: 18px;
  bottom: 42px;
  max-width: 74px;
  padding: 3px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.82);
  color: #111827;
  font-size: var(--watermark-font-size);
  opacity: var(--watermark-opacity);
  overflow: hidden;
  text-overflow: ellipsis;
}
.watermark-preview-logo {
  position: absolute;
  right: 18px;
  bottom: 42px;
  width: var(--watermark-logo-width);
  max-height: 42px;
  object-fit: contain;
  opacity: var(--watermark-opacity);
}
.phone-frame.watermark-disabled .watermark-dot,
.phone-frame.watermark-disabled .watermark-preview-logo {
  display: none;
}
.watermark-preview-logo:not([hidden]) + .watermark-dot {
  bottom: 88px;
}
.native-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.file-picker-button {
  width: fit-content;
}
.current-file-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fafb;
  color: var(--muted);
  font-size: 13px;
}
.current-file-preview img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
  background: #111827;
}
.current-file-preview.empty {
  justify-content: center;
  border-style: dashed;
}
.selected-file-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px;
  border: 1px solid #abefc6;
  border-radius: 6px;
  background: #ecfdf3;
  color: #05603a;
  font-size: 13px;
}
.selected-file-preview img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 4px;
  background: #111827;
}
.caption-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.thumbnail-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.thumbnail-preview {
  display: grid;
  place-items: center;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
}
.thumbnail-frame {
  position: relative;
  width: 190px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(135deg, #0f172a, #0f766e);
}
.thumbnail-subject {
  position: absolute;
  right: 18px;
  bottom: 12px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
}
.thumbnail-frame strong {
  position: absolute;
  left: 12px;
  right: 48px;
  bottom: 12px;
  color: #fff;
  font-size: 16px;
  line-height: 1.05;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.75);
}
.thumbnail-preview.hide-title strong { display: none; }
.thumbnail-preview[data-thumbnail-style="clean_photo"] .thumbnail-frame strong { display: none; }
.thumbnail-preview[data-thumbnail-style="cinematic"] .thumbnail-frame {
  background: linear-gradient(160deg, #020617, #7f1d1d 62%, #f59e0b);
}
.thumbnail-preview[data-thumbnail-style="rounded_white"] .thumbnail-frame strong,
.thumbnail-preview[data-thumbnail-style="rounded_black"] .thumbnail-frame strong {
  right: 12px;
  padding: 7px 8px;
  border-radius: 9px;
  text-shadow: none;
}
.thumbnail-preview[data-thumbnail-style="rounded_white"] .thumbnail-frame strong {
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
}
.thumbnail-preview[data-thumbnail-style="rounded_black"] .thumbnail-frame strong {
  background: rgba(17, 24, 39, 0.88);
  color: #fff;
}
.thumbnail-detail {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(180px, 1fr);
  gap: 16px;
  align-items: start;
}
.thumbnail-detail img,
.thumbnail-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: #0f172a;
}
.thumbnail-detail.aspect-vertical img,
.thumbnail-detail.aspect-vertical .thumbnail-placeholder {
  aspect-ratio: 9 / 16;
  max-height: 520px;
}
.thumbnail-detail.aspect-square img,
.thumbnail-detail.aspect-square .thumbnail-placeholder {
  aspect-ratio: 1 / 1;
}
.thumbnail-detail.aspect-horizontal img,
.thumbnail-detail.aspect-horizontal .thumbnail-placeholder {
  aspect-ratio: 16 / 9;
}
.thumbnail-placeholder {
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
  background: #f9fafb;
  color: var(--muted);
}
.caption-preview-shell {
  display: grid;
  place-items: center;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
}
.caption-phone-preview {
  --caption-size: 20px;
  --caption-text-color: #fff;
  --caption-highlight-color: #facc15;
  --caption-bg-color: #111827;
  position: relative;
  width: 170px;
  height: 302px;
  overflow: hidden;
  border: 3px solid #111827;
  border-radius: 22px;
  background:
    radial-gradient(circle at 40% 22%, rgba(255, 255, 255, 0.95), transparent 10%),
    linear-gradient(160deg, #0f172a 0%, #164e63 44%, #111827 100%);
}
.caption-phone-preview::after {
  content: "";
  position: absolute;
  inset: 30px 14px 34px;
  border: 1px dashed rgba(255, 255, 255, 0.34);
  border-radius: 12px;
  pointer-events: none;
}
.title-frame-preview {
  position: absolute;
  top: 24px;
  left: 14px;
  right: 14px;
  z-index: 2;
  padding: 7px 9px;
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  text-align: center;
}
.caption-preview-text {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 54px;
  z-index: 2;
  color: var(--caption-text-color);
  font-size: var(--caption-size);
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
}
.caption-phone-preview[data-caption-position="middle"] .caption-preview-text { bottom: 132px; }
.caption-phone-preview[data-caption-position="upper_safe"] .caption-preview-text,
.caption-phone-preview[data-caption-position="upper"] .caption-preview-text { bottom: 210px; }
.caption-phone-preview.has-shadow .caption-preview-text { text-shadow: 0 3px 10px rgba(0, 0, 0, 0.82); }
.caption-phone-preview.has-outline .caption-preview-text { -webkit-text-stroke: 1px #111827; }
.caption-phone-preview.has-highlight .caption-preview-text span:first-child {
  color: var(--caption-highlight-color);
}
.caption-phone-preview[data-caption-style="minimal"] .caption-preview-text {
  font-weight: 600;
  font-size: calc(var(--caption-size) * 0.82);
}
.caption-phone-preview[data-caption-style="karaoke"] .caption-preview-text span:first-child {
  display: inline-block;
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--caption-highlight-color);
  color: #111827;
  -webkit-text-stroke: 0;
}
.caption-phone-preview[data-caption-style="word-highlight"] .caption-preview-text span:first-child {
  display: inline-block;
  transform: scale(1.08);
  color: var(--caption-highlight-color);
}
.caption-phone-preview[data-caption-style="rounded-white"] .caption-preview-text,
.caption-phone-preview[data-caption-style="rounded-black"] .caption-preview-text {
  padding: 7px 9px;
  border-radius: 10px;
  -webkit-text-stroke: 0;
}
.caption-phone-preview[data-caption-style="rounded-white"] .caption-preview-text {
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
}
.caption-phone-preview[data-caption-style="rounded-black"] .caption-preview-text {
  background: color-mix(in srgb, var(--caption-bg-color) 88%, transparent);
  color: #fff;
}
.caption-phone-preview[data-caption-style="cinematic"] .caption-preview-text {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: 0;
}
.caption-phone-preview[data-caption-animation="none"] .caption-preview-text {
  transform: none;
}
.caption-phone-preview[data-caption-animation="pop"] .caption-preview-text {
  transform: scale(1.04);
}
.caption-phone-preview[data-caption-animation="bounce"] .caption-preview-text {
  transform: translateY(-8px) scale(1.03);
}
.caption-phone-preview[data-caption-animation="slide_up"] .caption-preview-text {
  transform: translateY(-16px);
}
.caption-phone-preview[data-caption-animation="karaoke"] .caption-preview-text::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -8px;
  height: 4px;
  border-radius: 999px;
  background: var(--caption-highlight-color);
}
.caption-phone-preview[data-title-frame="none"] .title-frame-preview {
  display: none;
}
.caption-phone-preview[data-title-frame="caption"] .title-frame-preview {
  top: 74px;
  transform: rotate(-3deg);
  background: transparent;
  font-size: 14px;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}
.caption-phone-preview[data-title-frame="classic"] .title-frame-preview {
  top: 78px;
  left: 18px;
  right: 18px;
  transform: rotate(-6deg);
  background: #fff;
  color: #111827;
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}
.caption-phone-preview[data-title-frame="rounded-white"] .title-frame-preview {
  top: 76px;
  transform: rotate(-5deg);
  color: #111827;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.38);
}
.caption-phone-preview[data-title-frame="rounded-black"] .title-frame-preview {
  top: 76px;
  transform: rotate(-5deg);
  color: #fff;
  background: color-mix(in srgb, var(--caption-bg-color) 88%, transparent);
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.38);
}
.caption-phone-preview[data-title-frame="custom"] .title-frame-preview {
  top: 72px;
  left: 10px;
  right: 10px;
  transform: rotate(-4deg);
  color: #fff;
  background: linear-gradient(135deg, var(--caption-bg-color), var(--caption-highlight-color));
  border-radius: 10px;
  text-transform: uppercase;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}
.title-frame-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.title-frame-card {
  min-height: 124px;
}
.mini-title-frame {
  display: grid;
  place-items: center;
  min-height: 58px;
  padding: 8px;
  border-radius: 8px;
  background: linear-gradient(160deg, #0f172a, #164e63);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}
.title-frame-classic .mini-title-frame,
.title-frame-rounded-white .mini-title-frame {
  transform: rotate(-5deg);
  background: #fff;
  color: #111827;
  box-shadow: 0 8px 16px rgba(17, 24, 39, 0.18);
}
.title-frame-caption .mini-title-frame {
  background: transparent;
  color: #111827;
  text-shadow: 0 2px 0 #fff;
}
.title-frame-rounded-black .mini-title-frame {
  transform: rotate(-5deg);
  background: #111827;
  color: #fff;
}
.title-frame-custom .mini-title-frame {
  transform: rotate(-4deg);
  background: linear-gradient(135deg, #0f766e, #facc15);
  color: #fff;
}
.color-control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.color-control {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.color-control input {
  width: 44px;
  height: 38px;
  min-height: 38px;
  padding: 3px;
}
.color-control span { display: grid; gap: 4px; }
.color-control small { color: var(--muted); font-weight: 500; }
.settings-hero {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.settings-hero p,
.section-heading p,
.provider-card p,
.provider-status-row span,
.settings-note,
.muted {
  color: var(--muted);
}
.settings-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.settings-summary span {
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef8f7;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}
.provider-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.provider-card {
  display: grid;
  gap: 12px;
  min-height: 178px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.provider-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}
.provider-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.provider-card strong { font-size: 18px; text-align: right; }
.provider-card code {
  width: fit-content;
  max-width: 100%;
  white-space: normal;
}
.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.provider-status-list {
  display: grid;
  gap: 10px;
}
.provider-status-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 0.8fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.provider-status-row div {
  display: grid;
  gap: 4px;
}
.provider-status-row code {
  overflow-wrap: anywhere;
}
.settings-note {
  margin: 14px 0 0;
}

@media (max-width: 900px) {
  .sidebar { position: static; width: auto; }
  .main { margin-left: 0; padding: 20px; }
  .page-header, .split, .editor-layout { grid-template-columns: 1fr; display: grid; }
  .metric-grid { grid-template-columns: 1fr; }
  .table-row,
  .table-row.episode-row { grid-template-columns: 1fr; }
  .row-actions { justify-content: flex-start; }
  .publishable-panel { display: grid; }
  .settings-hero { display: grid; }
  .settings-summary { justify-content: flex-start; }
  .provider-grid { grid-template-columns: 1fr; }
  .provider-status-row { grid-template-columns: 1fr; }
  .format-grid,
  .settings-cards.two,
  .settings-cards.three,
  .caption-layout,
  .color-control-grid,
  .thumbnail-layout,
  .thumbnail-detail,
  .brand-settings-layout {
    grid-template-columns: 1fr;
  }
}
