* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Arial, sans-serif; background: #0b0e14; color: #e8ecf1; }
.topbar { border-bottom: 1px solid #1f2937; background: linear-gradient(180deg, #111827 0%, #0f172a 100%); position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.brand { font-weight: 800; letter-spacing: .3px; font-size: 17px; }
.nav { display: flex; gap: 8px 16px; align-items: center; flex-wrap: wrap; }
.nav a, .linkbtn { color: #93c5fd; text-decoration: none; background: none; border: none; cursor: pointer; font: inherit; font-size: 14px; padding: 6px 4px; border-radius: 6px; }
.nav a:hover { color: #bfdbfe; background: rgba(59, 130, 246, 0.08); }
.nav-logout-form { margin: 0; display: inline; }
.nav-menu-btn {
  display: none;
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.container { max-width: 1200px; margin: 22px auto; padding: 0 16px 48px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { background: #111827; border: 1px solid #1f2937; border-radius: 12px; padding: 16px; }
.narrow { max-width: 440px; margin: 40px auto; }
.stack { display: flex; flex-direction: column; gap: 10px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
input, textarea, button { border-radius: 8px; border: 1px solid #374151; background: #0f172a; color: #e8ecf1; padding: 10px; }
button { background: #2563eb; border: none; font-weight: 600; cursor: pointer; }
button:hover { background: #1d4ed8; }
.hint { color: #9ca3af; font-size: 13px; }
.ok { color: #86efac; }
.error { color: #fca5a5; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; border-bottom: 1px solid #1f2937; padding: 8px 6px; font-size: 14px; }
.status { padding: 2px 8px; border-radius: 999px; font-size: 12px; border: 1px solid #374151; }
.status.preparing, .status.downloading, .status.transcribing, .status.generating_avatar, .status.compositing { background: #1e3a8a; }
.status.awaiting_generate_confirm, .status.awaiting_composite_confirm { background: #78350f; }
.status.awaiting_mix_confirm { background: #0e7490; }
.status.awaiting_montage_review { background: #0f766e; }
.status.awaiting_offer { background: #5b21b6; }
.status.attaching_offer { background: #4c1d95; }
.status.completed { background: #14532d; }
.status.failed { background: #7f1d1d; }
.pre { white-space: pre-wrap; background: #0b1220; padding: 12px; border-radius: 8px; border: 1px solid #233045; }
.textarea-transcript {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  line-height: 1.5;
}
.transcript-edit { margin-bottom: 8px; }
.roadmap-card { margin: 18px 0 20px; padding: 16px; border-radius: 12px; border: 1px solid #243041; background: linear-gradient(180deg, #0e1628 0%, #0b1220 100%); }
.roadmap-header { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 14px; }
.roadmap-header h3 { margin: 0; font-size: 18px; }
.roadmap { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.roadmap-step { position: relative; min-height: 132px; padding: 14px; border-radius: 14px; border: 1px solid #233045; background: rgba(15, 23, 42, 0.95); overflow: hidden; }
.roadmap-step::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 1px 0 rgba(255,255,255,0.04); }
.roadmap-step-pending { opacity: 0.68; }
.roadmap-step-current { border-color: #60a5fa; box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.35), 0 18px 34px rgba(37, 99, 235, 0.18); }
.roadmap-step-completed { border-color: #1f7a46; background: rgba(9, 34, 22, 0.95); }
.roadmap-step-failed { border-color: #b91c1c; background: rgba(55, 18, 25, 0.96); }
.roadmap-dot { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-size: 13px; font-weight: 700; margin-bottom: 12px; border: 1px solid #334155; background: #111827; color: #cbd5e1; }
.roadmap-step-current .roadmap-dot { background: #2563eb; border-color: #60a5fa; color: #eff6ff; }
.roadmap-step-completed .roadmap-dot { background: #166534; border-color: #22c55e; color: #ecfdf5; }
.roadmap-step-failed .roadmap-dot { background: #991b1b; border-color: #ef4444; color: #fff1f2; }
.roadmap-title { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.roadmap-code { font-size: 12px; color: #93c5fd; text-transform: lowercase; letter-spacing: 0.03em; margin-bottom: 8px; }
.roadmap-step-completed .roadmap-code { color: #86efac; }
.roadmap-step-failed .roadmap-code { color: #fca5a5; }
.roadmap-desc { font-size: 13px; color: #cbd5e1; line-height: 1.45; }
.tab-btn { background: #1f2937; color: #9ca3af; font-size: 13px; padding: 7px 14px; }
.tab-btn.active-tab { background: #2563eb; color: #fff; }
.tab-btn:hover { background: #374151; }
.tab-btn.active-tab:hover { background: #1d4ed8; }
.checkbox-label { flex-direction: row; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.checkbox-label input[type=checkbox] { width: 16px; height: 16px; flex-shrink: 0; }
.result-block { display: flex; flex-direction: column; gap: 14px; margin: 18px 0; }
.result-player { width: 100%; max-height: 70vh; border-radius: 12px; background: #000; }
.btn-download { display: block; text-align: center; background: #16a34a; color: #fff; font-weight: 700; font-size: 18px; padding: 14px 24px; border-radius: 12px; text-decoration: none; letter-spacing: 0.02em; }
.btn-download:hover { background: #15803d; }
.btn-primary { background: #2563eb; color: #fff; font-weight: 600; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #374151; }
.btn-secondary:hover { background: #4b5563; }
.offer-processing-banner {
  margin: 12px 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #6d28d9;
  background: #2e1065;
  color: #ede9fe;
  font-size: 14px;
  line-height: 1.45;
}
.offer-processing-banner p { margin: 0; }
.offer-step-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 8px; }
.offer-step-block h3 { margin: 0 0 8px; font-size: 17px; }
.mix-step-block h3 { margin: 0 0 8px; font-size: 17px; }
.mix-preview-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 720px) { .mix-preview-row { grid-template-columns: 1fr; } }
.mix-preview-col .mix-label { margin: 0 0 6px; font-size: 14px; }
.mix-mixed-player-wrap { margin: 12px 0 8px; }
.mix-mixed-player-wrap .mix-label { margin: 0 0 8px; font-size: 14px; }
.mix-audio-el { width: 100%; max-width: 420px; }
.mix-video-el { width: 100%; max-width: 280px; border-radius: 8px; background: #111; }
/* Off-screen but non-zero box: clip(0,0,0,0) / 1×1px often stops <video> audio decode in Web Audio. */
.mix-hidden-sources {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 320px;
  height: 180px;
  overflow: hidden;
  opacity: 0.02;
  pointer-events: none;
  z-index: -1;
}
.mix-hidden-sources audio,
.mix-hidden-sources video {
  display: block;
  width: 100%;
  height: 100%;
}
.mix-sliders label { display: block; font-size: 14px; margin-top: 10px; }
.mix-sliders input[type="range"] { width: 100%; max-width: 420px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.offers-settings .offers-note { max-width: 900px; line-height: 1.5; margin-bottom: 16px; }
.offers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin: 16px 0; }
.offer-slot-card { border: 1px solid #243041; border-radius: 12px; padding: 12px; background: #0b1220; display: flex; flex-direction: column; gap: 10px; }
.offer-slot-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.offer-slot-title { font-weight: 700; }
.offer-slot-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid #374151; }
.badge-ok { border-color: #166534; color: #86efac; }
.badge-warn { border-color: #b45309; color: #fdba74; }
.badge-muted { opacity: 0.75; color: #9ca3af; }
.offer-slot-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form { display: inline; margin: 0; }
.inline-form button { font-size: 13px; padding: 8px 12px; }
.btn-save-offers { margin-top: 4px; }
.offer-action-form { margin-top: 10px; padding-top: 10px; border-top: 1px solid #243041; }
.offer-form-buttons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.offer-montage-only { opacity: 0.95; }
.offer-variant-list { margin: 6px 0 10px; padding-left: 18px; font-size: 13px; color: #cbd5e1; }
.offer-variant-list li { margin: 4px 0; }
.offer-avatar-id { font-size: 11px; word-break: break-all; }
.admin-flags-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.admin-flags-form select { min-width: 140px; }
table.admin-user-flags td { vertical-align: middle; }
/* ══════════════════════════════════════════════════════════════
   Медиатека
══════════════════════════════════════════════════════════════ */

/* Header */
.ml-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.ml-header-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ml-title { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.3px; }
.ml-stat { font-size: 13px; color: #4b5563; }
.ml-stat-sep { color: #1f2937; }
.ml-stat-used { color: #6366f1; font-weight: 600; }

/* Toggle switch */
.ml-controls { display: flex; align-items: center; gap: 12px; }
.ml-toggle-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: #9ca3af;
  cursor: pointer;
  user-select: none;
}
.ml-toggle-label input { display: none; }
.ml-toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 999px;
  transition: background .2s, border-color .2s;
  flex-shrink: 0;
}
.ml-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #4b5563;
  transition: transform .2s, background .2s;
}
.ml-toggle-label input:checked ~ .ml-toggle-track { background: #4f46e5; border-color: #6366f1; }
.ml-toggle-label input:checked ~ .ml-toggle-track .ml-toggle-thumb { transform: translateX(16px); background: #fff; }

/* Toolbar */
.ml-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 10px;
  min-height: 38px;
  flex-wrap: wrap;
}
.ml-toolbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.ml-sel-info { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #a5b4fc; }
.ml-sel-count { font-size: 20px; font-weight: 800; color: #818cf8; line-height: 1; }
.ml-sel-limit { font-size: 12px; color: #4b5563; }

.ml-btn-ghost {
  background: transparent;
  color: #6b7280;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid #1f2937;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.ml-btn-ghost:hover { color: #e5e7eb; border-color: #374151; }

.ml-btn-batch {
  display: flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  padding: 9px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99,102,241,.35);
  transition: opacity .15s, box-shadow .15s;
  white-space: nowrap;
}
.ml-btn-batch:hover:not(:disabled) { box-shadow: 0 4px 20px rgba(99,102,241,.55); }
.ml-btn-batch:disabled { opacity: .38; cursor: default; box-shadow: none; }

/* Messages */
.ml-msg {
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  margin-bottom: 12px;
  border: 1px solid transparent;
}
.ml-msg-info { background: #0f1d3a; border-color: #1d4ed8; color: #93c5fd; }
.ml-msg-ok   { background: #052e16; border-color: #15803d; color: #86efac; }
.ml-msg-warn { background: #2d1600; border-color: #b45309; color: #fcd34d; }
.ml-msg-err  { background: #2d0a0a; border-color: #b91c1c; color: #fca5a5; }

/* List */
.ml-list { display: flex; flex-direction: column; gap: 5px; }

/* Row */
.ml-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #111827;
  border: 1px solid #1a2236;
  border-radius: 12px;
  padding: 11px 14px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.ml-row:hover { border-color: #2d3f5e; background: #0f1929; }
.ml-row-used { background: #0d1520; border-color: #1a2236; opacity: .8; }
.ml-row-used:hover { opacity: 1; }
.ml-row-sel {
  border-color: #6366f1 !important;
  background: #12103a !important;
  box-shadow: 0 0 0 1px rgba(99,102,241,.25);
  opacity: 1 !important;
}

/* Checkbox */
.ml-cb-wrap {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ml-cb { display: none; }
.ml-cb-ui {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1.5px solid #2d3748;
  border-radius: 6px;
  background: #0d1520;
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}
.ml-cb:checked ~ .ml-cb-ui { background: #6366f1; border-color: #818cf8; }
.ml-cb-check { opacity: 0; transition: opacity .1s; }
.ml-cb:checked ~ .ml-cb-ui .ml-cb-check { opacity: 1; }

/* Thumbnail icon */
.ml-thumb {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #0f172a;
  border: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60a5fa;
}
.ml-row-used .ml-thumb { color: #4b5563; }

/* Body */
.ml-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ml-url {
  color: #60a5fa;
  text-decoration: none;
  font-size: 13.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  transition: color .12s;
}
.ml-url:hover { color: #a5b4fc; }
.ml-row-used .ml-url { color: #475569; }
.ml-row-used .ml-url:hover { color: #60a5fa; }

.ml-used-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ml-used-label { font-size: 11px; color: #374151; }

.ml-job-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  text-decoration: none;
  letter-spacing: .02em;
  transition: opacity .15s;
}
.ml-job-badge:hover { opacity: .8; }
.ml-badge-completed   { background: #052e16; color: #4ade80; border: 1px solid #166534; }
.ml-badge-failed      { background: #2d0a0a; color: #f87171; border: 1px solid #991b1b; }
.ml-badge-compositing,
.ml-badge-generating_avatar,
.ml-badge-transcribing,
.ml-badge-downloading,
.ml-badge-preparing   { background: #0f1d3a; color: #93c5fd; border: 1px solid #1e3a6e; }
.ml-badge-awaiting_generate_confirm { background: #1c1200; color: #fbbf24; border: 1px solid #78350f; }

/* Buttons in row */
.ml-btn-view {
  flex-shrink: 0;
  display: inline-block;
  font-size: 12px;
  color: #4b5563;
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid #1f2937;
  border-radius: 8px;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.ml-btn-view:hover { color: #93c5fd; border-color: #374151; }

.ml-btn-shorts {
  flex-shrink: 0;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 9px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, box-shadow .15s;
  letter-spacing: .01em;
}
.ml-btn-shorts:hover:not(:disabled) { background: #1d4ed8; box-shadow: 0 3px 10px rgba(37,99,235,.4); }
.ml-btn-shorts:disabled { opacity: .5; cursor: default; }
.ml-btn-shorts-dup { background: #1e293b; color: #64748b; }
.ml-btn-shorts-dup:hover:not(:disabled) { background: #273549; box-shadow: none; }
.ml-btn-shorts-done { background: #15803d !important; }

/* Empty */
.ml-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 80px 20px;
  color: #374151;
  text-align: center;
}
.ml-empty-icon { margin-bottom: 8px; }
.ml-empty p { margin: 0; }
.ml-empty code { background: #111827; padding: 2px 7px; border-radius: 5px; font-size: 12px; color: #6b7280; }

/* Responsive */
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .roadmap-header { flex-direction: column; align-items: flex-start; }
  .ml-header { flex-direction: column; align-items: flex-start; }
  .ml-toolbar { flex-direction: column; align-items: flex-start; }
  .ml-toolbar-right { width: 100%; }
  .ml-btn-batch { width: 100%; justify-content: center; }
  .ml-row { flex-wrap: wrap; }
  .ml-body { width: calc(100% - 120px); }
  .ml-btn-shorts { flex: 1; text-align: center; }
}

@media (max-width: 768px) {
  .nav-menu-btn { display: inline-block; }
  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0 4px;
    border-top: 1px solid #1f2937;
    margin-top: 4px;
  }
  .nav.nav-open { display: flex; }
  .nav a { padding: 10px 8px; }
  .nav-logout-form .linkbtn { padding: 10px 8px; width: 100%; text-align: left; }
  .topbar-inner { flex-direction: row; flex-wrap: wrap; }
  .brand { flex: 1; }
}

/* ═══ Settings / Dashboard (как медиатека) ═══ */
.st-page { margin-bottom: 32px; }
.st-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.st-title { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.4px; }
.st-sub { display: block; font-size: 13px; color: #64748b; margin-top: 4px; }
.st-card {
  background: #111827;
  border: 1px solid #1a2236;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}
.st-card-title { margin: 0 0 14px; font-size: 17px; font-weight: 700; }
.st-form label { color: #cbd5e1; }
.st-form input, .st-form textarea, .st-form select { border-radius: 10px; border: 1px solid #334155; background: #0f172a; }
.st-btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  border: none;
  color: #fff;
  font-weight: 700;
  padding: 11px 20px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.st-btn-primary:hover { filter: brightness(1.06); }
.st-btn-secondary {
  background: #334155;
  color: #f1f5f9;
  border: none;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
}
.st-btn-secondary:hover { background: #475569; }
.st-btn-ghost {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #334155;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
}
.st-btn-ghost:hover { color: #e2e8f0; border-color: #475569; }
.st-btn-danger {
  background: rgba(127, 29, 29, 0.35);
  color: #fecaca;
  border: 1px solid #991b1b;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
}
.st-btn-danger:hover { background: rgba(153, 27, 27, 0.5); }
.st-btn-sm { padding: 6px 12px; font-size: 12px; }
.st-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.st-tab {
  background: #1e293b;
  color: #94a3b8;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid #334155;
  cursor: pointer;
  font-weight: 600;
}
.st-tab.active-tab {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  border-color: transparent;
}
.st-pane { margin-top: 4px; }
.st-form-status { font-size: 13px; color: #94a3b8; margin-top: 8px; }
.st-inline-hint { margin-top: 12px; }
.st-mini-hint { margin: 0 0 8px; font-size: 12px; }
.st-select { width: 100%; }
.st-toast {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 14px;
  border: 1px solid #334155;
  background: #0f1d3a;
  color: #93c5fd;
}
.st-toast-err { background: #2d0a0a; border-color: #991b1b; color: #fecaca; }

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 960px) {
  .dash-grid { grid-template-columns: 1fr; }
}
.dash-job-list { display: flex; flex-direction: column; gap: 8px; }
.dash-job-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #1e293b;
  background: #0f172a;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.dash-job-row:hover { border-color: #4f46e5; background: #12103a; }
.dash-job-id { font-family: ui-monospace, monospace; font-size: 11px; color: #64748b; word-break: break-all; }
.dash-job-date { font-size: 12px; color: #64748b; }
.dash-job-arrow { color: #6366f1; font-weight: 700; }
@media (max-width: 520px) {
  .dash-job-row { grid-template-columns: 1fr auto; }
  .dash-job-date { grid-column: 1 / -1; }
}

.offer-roadmaps-wrap { margin: 16px 0; }
.offer-roadmaps-heading { margin: 0 0 8px; font-size: 15px; color: #cbd5e1; }
#offer-roadmaps .offer-roadmap.offer-roadmap-item {
  margin: 0 0 14px;
}
#offer-roadmaps .offer-roadmap.offer-roadmap-item:last-child {
  margin-bottom: 0;
}

.offer-roadmap {
  margin: 16px 0 20px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #312e81;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12) 0%, rgba(15, 23, 42, 0.95) 100%);
}
.offer-roadmap-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.offer-roadmap-title { font-weight: 800; font-size: 14px; color: #a5b4fc; }
.offer-roadmap-slot { font-size: 12px; color: #818cf8; }
.offer-roadmap-track { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 10px; }
.offer-roadmap-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 72px;
  opacity: 0.45;
  transition: opacity 0.2s;
}
.offer-roadmap-step span {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  background: #1e293b;
  border: 2px solid #334155;
}
.offer-roadmap-step small { font-size: 10px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; }
.offer-roadmap-step-active { opacity: 1; }
.offer-roadmap-step-active span { border-color: #818cf8; background: #312e81; color: #e0e7ff; }
.offer-roadmap-step-done { opacity: 1; }
.offer-roadmap-step-done span { border-color: #166534; background: #14532d; color: #bbf7d0; }
.offer-roadmap-step-error span { border-color: #dc2626; background: #7f1d1d; color: #fecaca; }
.offer-roadmap-line { flex: 1; max-width: 48px; height: 2px; background: #334155; margin: 0 4px; margin-bottom: 18px; }
.offer-roadmap-label { margin: 0; font-size: 13px; color: #cbd5e1; text-align: center; }

.offer-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.offer-lib-card {
  border: 1px solid #1e293b;
  border-radius: 14px;
  overflow: hidden;
  background: #0f172a;
  display: flex;
  flex-direction: column;
}
.offer-lib-video-wrap { background: #000; aspect-ratio: 9 / 16; max-height: 420px; }
.offer-lib-video { width: 100%; height: 100%; object-fit: contain; vertical-align: middle; }
.offer-lib-meta { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.offer-lib-slot { font-size: 12px; font-weight: 700; color: #818cf8; text-transform: uppercase; letter-spacing: 0.06em; }
.offer-lib-aid { font-size: 11px; word-break: break-all; color: #94a3b8; }
.offer-lib-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.ml-title { color: #f1f5f9; }
.ml-stat { color: #64748b; }
.ml-stat-used { color: #a5b4fc; }

/* ── Montage review (step 7) — full layout ─────────────────── */
.montage-step {
  margin: 20px 0 28px;
  padding: 0;
  border-radius: 16px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.98) 0%, rgba(8, 12, 22, 0.99) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 24px 48px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.montage-hero {
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.65);
  background: linear-gradient(180deg, rgba(30, 58, 95, 0.35) 0%, transparent 100%);
}
.montage-step-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #38bdf8;
  background: rgba(14, 116, 144, 0.35);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.montage-hero-title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f1f5f9;
}
.montage-hero-sub {
  margin: 0;
  max-width: 52rem;
  font-size: 14px;
  line-height: 1.55;
  color: #94a3b8;
}

.montage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 0;
  align-items: stretch;
}
@media (max-width: 900px) {
  .montage-layout { grid-template-columns: 1fr; }
}

.montage-col-player {
  padding: 18px 20px 22px;
  border-right: 1px solid rgba(51, 65, 85, 0.5);
}
@media (max-width: 900px) {
  .montage-col-player { border-right: none; border-bottom: 1px solid rgba(51, 65, 85, 0.5); }
}

.montage-player-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.montage-video-stack {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  line-height: 0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}
.montage-review-video {
  position: relative;
  z-index: 0;
  width: 100%;
  display: block;
  margin: 0;
  max-height: min(52vh, 520px);
}
.montage-video-stack.montage-draw-on {
  cursor: crosshair;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.55), 0 16px 48px rgba(14, 116, 144, 0.35);
}
.montage-video-stack.montage-draw-on .montage-review-video {
  pointer-events: none;
  max-height: min(72vh, 640px);
}
.montage-draw-canvas {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
  pointer-events: none;
  box-sizing: border-box;
}
.montage-video-stack.montage-draw-on .montage-draw-canvas { pointer-events: auto; }

.montage-idle-hint {
  display: flex;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 10px 14px;
  z-index: 1;
  pointer-events: none;
  justify-content: center;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.75) 0%, transparent 100%);
}
.montage-idle-hint-inner {
  font-size: 12px;
  color: #cbd5e1;
  text-align: center;
  line-height: 1.4;
  max-width: 26rem;
}

.montage-draw-hint {
  display: none;
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.92);
  color: #7dd3fc;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.montage-timeline-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.montage-time-readout {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #94a3b8;
  letter-spacing: 0.02em;
}
.montage-time-readout #montage-cur-time { color: #e2e8f0; }
.montage-time-sep { margin: 0 4px; opacity: 0.5; }
.montage-timeline {
  outline: none;
}
.montage-timeline-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #334155;
  cursor: pointer;
  overflow: visible;
}
.montage-timeline-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0e7490, #38bdf8);
  pointer-events: none;
  opacity: 0.85;
}
.montage-timeline-markers {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  pointer-events: none;
}
.montage-timeline-marker {
  position: absolute;
  top: -2px;
  bottom: -2px;
  background: rgba(99, 102, 241, 0.55);
  border: 1px solid rgba(165, 180, 252, 0.85);
  border-radius: 4px;
  pointer-events: auto;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.montage-timeline-marker:hover {
  background: rgba(129, 140, 248, 0.75);
  transform: scaleY(1.15);
}
.montage-timeline-playhead {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 3px;
  margin-left: -1.5px;
  background: #f8fafc;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9);
  pointer-events: none;
  left: 0%;
}
.montage-timeline-caption {
  margin: 0;
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
}

.montage-col-panel {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(2, 6, 23, 0.35);
}

.montage-panel {
  padding: 16px 16px 14px;
  border-radius: 12px;
  border: 1px solid rgba(51, 65, 85, 0.85);
  background: rgba(15, 23, 42, 0.65);
}
.montage-panel-accent {
  border-color: rgba(45, 212, 191, 0.28);
  background: linear-gradient(165deg, rgba(19, 78, 74, 0.25) 0%, rgba(15, 23, 42, 0.5) 100%);
}
.montage-panel-head { margin-bottom: 10px; }
.montage-panel-kicker {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
}
.montage-panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
}
.montage-panel-desc {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #94a3b8;
}

.montage-time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}
.montage-field { gap: 6px; }
.montage-field-label {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}
.montage-field input[type="number"] {
  width: 100%;
  max-width: none;
  padding: 10px 12px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0f172a;
}

.montage-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.montage-chip {
  flex: 1;
  min-width: 120px;
  background: #0f1d3a;
  color: #93c5fd;
  border: 1px solid #1e3a6e;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.montage-chip:hover {
  background: #172a50;
  border-color: #3b82f6;
  color: #bfdbfe;
}

.montage-draw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.montage-btn-draw {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  min-width: 200px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #cbd5e1;
  border: 1px solid #475569;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, border-color 0.15s, color 0.15s;
}
.montage-btn-draw:hover {
  border-color: #64748b;
  color: #f1f5f9;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.montage-btn-draw.active {
  background: linear-gradient(180deg, #164e63 0%, #0c4a6e 100%);
  color: #e0f2fe;
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4), 0 8px 24px rgba(14, 116, 144, 0.35);
}

.montage-btn-clear {
  background: transparent;
  color: #64748b;
  border: 1px dashed #334155;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.montage-btn-clear:hover {
  color: #f87171;
  border-color: #991b1b;
  border-style: solid;
}

.montage-btn-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: linear-gradient(180deg, #115e59 0%, #0d4f4a 100%);
  color: #ccfbf1;
  border: 1px solid #14b8a6;
  padding: 13px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: box-shadow 0.15s, transform 0.1s;
}
.montage-btn-add:hover {
  box-shadow: 0 6px 22px rgba(20, 184, 166, 0.35);
  transform: translateY(-1px);
}
.montage-btn-add-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 18px;
  line-height: 1;
}

.montage-mini-steps {
  margin: 0;
  padding: 12px 14px 12px 28px;
  font-size: 12px;
  line-height: 1.55;
  color: #64748b;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px dashed #334155;
}
.montage-mini-steps strong { color: #94a3b8; }

.montage-ann-section {
  margin: 0;
  padding: 16px 22px 20px;
  border-top: 1px solid rgba(51, 65, 85, 0.5);
  background: rgba(2, 6, 23, 0.25);
}
.montage-ann-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.montage-ann-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}
.montage-btn-clear-all {
  background: transparent;
  color: #64748b;
  border: 1px solid #334155;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.montage-btn-clear-all:hover {
  color: #fca5a5;
  border-color: #7f1d1d;
}

.montage-ann-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.montage-ann-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(17, 24, 39, 0.95);
  border-radius: 10px;
  border: 1px solid #334155;
  transition: border-color 0.15s;
}
.montage-ann-item:hover {
  border-color: #475569;
}
.montage-ann-item-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.montage-ann-time { font-size: 14px; font-weight: 700; color: #e2e8f0; font-variant-numeric: tabular-nums; }
.montage-ann-box { font-size: 11px; color: #64748b; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.montage-rm-btn {
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.8);
  color: #94a3b8;
  border: 1px solid #334155;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.montage-rm-btn:hover {
  color: #fecaca;
  border-color: #b91c1c;
}

.montage-foot {
  padding: 18px 22px 22px;
  border-top: 1px solid rgba(51, 65, 85, 0.5);
  background: rgba(2, 6, 23, 0.4);
}
.montage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.montage-form-approve { display: inline; margin: 0; }
.montage-btn-approve {
  padding: 12px 22px !important;
  border-radius: 12px !important;
  font-size: 15px !important;
}
.montage-foot-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}
.montage-redo-status {
  margin-top: 10px !important;
}

.montage-btn-redo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #312e81 0%, #1e1b4b 100%);
  color: #c7d2fe;
  border: 1px solid #4f46e5;
  padding: 11px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow 0.15s, opacity 0.15s;
}
.montage-btn-redo:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(79, 70, 229, 0.45);
}
.montage-btn-redo:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.admin-heygen-consent-help {
  margin: 14px 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: rgba(15, 23, 42, 0.65);
}
.admin-heygen-consent-help summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  color: #e2e8f0;
  list-style-position: outside;
}
.admin-heygen-consent-body {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.55;
  color: #cbd5e1;
}
.admin-heygen-consent-body ol { margin: 8px 0 8px 1.1rem; padding: 0; }
.admin-heygen-consent-body li { margin-bottom: 6px; }
.admin-heygen-consent-body a { color: #93c5fd; }

.admin-heygen-create { margin-bottom: 8px; }
.admin-heygen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.admin-heygen-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #93c5fd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.admin-step-card {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #243041;
  background: #0b1220;
}
.admin-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.admin-step-head h3 {
  margin: 0;
  font-size: 15px;
}
.admin-step-num {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #334155;
  background: #172554;
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 700;
}
.admin-heygen-form label { margin-bottom: 8px; }
.admin-verif-create-form { margin-top: 6px; }
.admin-verif-auto {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #334155;
}
.admin-compact-details {
  margin-top: 8px;
  border: 1px dashed #334155;
  border-radius: 10px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.4);
}
.admin-compact-details summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: #cbd5e1;
}
.admin-verif-table { margin-top: 8px; }
.admin-verif-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0; }
.admin-verif-inline input[type="url"] { min-width: 220px; }
.admin-verify-step {
  margin: 8px 0 2px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: rgba(15, 23, 42, 0.7);
}
.admin-verify-step-title { margin: 0 0 8px; font-size: 14px; color: #e2e8f0; }
.admin-heygen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) {
  .admin-heygen-grid { grid-template-columns: 1fr; }
}
.admin-heygen-sub { margin: 18px 0 8px; font-size: 15px; }
.admin-heygen-table { width: 100%; margin-top: 8px; font-size: 13px; }
.admin-heygen-table th, .admin-heygen-table td { vertical-align: top; }

.admin-consent-recorder {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: rgba(15, 23, 42, 0.55);
}
.admin-consent-recorder-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.admin-consent-recorder-title { font-weight: 800; font-size: 13px; color: #e2e8f0; }
.admin-consent-recorder-sub { font-size: 12px; color: #94a3b8; line-height: 1.4; }
.admin-consent-recorder-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0; }
.admin-consent-preview {
  width: 100%;
  max-height: 260px;
  border-radius: 10px;
  background: #000;
  border: 1px solid #1f2937;
}

@media (max-width: 520px) {
  .st-title { font-size: 22px; }
  .offers-grid { grid-template-columns: 1fr; }
  .offer-library-grid { grid-template-columns: 1fr; }
  .montage-hero { padding: 18px 16px 14px; }
  .montage-col-player,
  .montage-col-panel,
  .montage-ann-section,
  .montage-foot { padding-left: 16px; padding-right: 16px; }
  .montage-time-grid { grid-template-columns: 1fr; }
}
