* { 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; }

/* Шаг баланса: выбор фонового трека */
.mix-music-picker {
  margin: 20px 0 8px;
  padding: 16px 18px 18px;
  border-radius: 14px;
  border: 1px solid #243041;
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.95), rgba(11, 18, 32, 0.98));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}
.mix-music-picker__head { margin-bottom: 14px; }
.mix-music-picker__title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #e2e8f0;
}
.mix-music-picker__sub {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #94a3b8;
  max-width: 52rem;
}
.mix-music-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.mix-music-grid[aria-busy="true"] { opacity: 0.55; pointer-events: none; }
.mix-music-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  padding: 12px 12px 12px 10px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: rgba(30, 41, 59, 0.55);
  color: #e2e8f0;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
  font: inherit;
}
.mix-music-card:hover {
  border-color: #64748b;
  background: rgba(51, 65, 85, 0.65);
  transform: translateY(-1px);
}
.mix-music-card:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}
.mix-music-card.is-current {
  border-color: #22c55e;
  background: rgba(22, 101, 52, 0.22);
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.25);
}
.mix-music-card__badge {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: #475569;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.25);
}
.mix-music-card.is-current .mix-music-card__badge {
  background: #4ade80;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.35);
}
.mix-music-card__body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mix-music-card__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
}
.mix-music-card__hint {
  font-size: 11px;
  color: #94a3b8;
}
.mix-music-picker__status { margin: 10px 0 0; }
.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;
  color: #e2e8f0;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.35;
  color-scheme: dark;
}
.st-form select {
  cursor: pointer;
  appearance: auto;
}
.st-form select option,
.st-form select optgroup {
  background: #0f172a;
  color: #e2e8f0;
}
.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: minmax(0, 1fr) auto 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-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dash-job-title {
  font-weight: 600;
  font-size: 14px;
  color: #e2e8f0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.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: minmax(0, 1fr) auto auto auto; }
  .dash-job-title { white-space: normal; }
}

.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-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.montage-video-pane {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.montage-video-caption {
  font-size: 12px;
  color: #94a3b8;
  letter-spacing: 0.01em;
}
@media (max-width: 980px) {
  .montage-compare-grid {
    grid-template-columns: 1fr;
  }
}

.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;
}

/* === Player controls bar ============================================ */
.montage-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(51, 65, 85, 0.55);
  border-radius: 10px;
}
.montage-ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(14, 116, 144, 0.22);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.montage-ctrl-btn:hover { background: rgba(14, 116, 144, 0.45); }
.montage-ctrl-btn:active { transform: scale(0.96); }
.montage-ctrl-play { display: inline-block; }
.montage-ctrl-pause { display: none; }
.montage-ctrl-btn.is-playing .montage-ctrl-play { display: none; }
.montage-ctrl-btn.is-playing .montage-ctrl-pause { display: inline-block; }
.montage-ctrl-inpoint, .montage-ctrl-outpoint {
  border-color: rgba(45, 212, 191, 0.38);
  background: rgba(15, 118, 110, 0.2);
  color: #5eead4;
}
.montage-ctrl-inpoint:hover, .montage-ctrl-outpoint:hover {
  background: rgba(15, 118, 110, 0.4);
}
.montage-controls .montage-time-readout { margin-left: auto; margin-right: auto; }

/* === Timeline enhancements ========================================= */
.montage-timeline-track { height: 14px; }

/* Range band (current In..Out selection) */
.montage-timeline-range {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 0%;
  width: 0%;
  background: rgba(56, 189, 248, 0.25);
  border: 1px solid rgba(56, 189, 248, 0.75);
  border-radius: 6px;
  pointer-events: none;
}

/* Saved interval markers on track */
.montage-timeline-marker {
  position: absolute;
  top: -3px;
  bottom: -3px;
  background: rgba(99, 102, 241, 0.5);
  border: 1px solid rgba(165, 180, 252, 0.85);
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.montage-timeline-marker.is-selected {
  background: rgba(236, 72, 153, 0.55);
  border-color: rgba(244, 114, 182, 0.95);
  box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.25);
}

/* Handles */
.montage-timeline-handle {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 28px;
  margin-left: -9px;
  margin-top: -14px;
  border-radius: 5px;
  background: #0ea5e9;
  border: 2px solid #f0f9ff;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.55), 0 0 0 1px rgba(2, 6, 23, 0.8);
  cursor: ew-resize;
  touch-action: none;
  z-index: 3;
}
.montage-timeline-handle:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
.montage-timeline-handle::before {
  content: '';
  position: absolute;
  top: 5px; bottom: 5px;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: rgba(240, 249, 255, 0.75);
  border-radius: 1px;
}
.montage-timeline-handle-in {
  background: #22d3ee;
  border-radius: 5px 1px 1px 5px;
}
.montage-timeline-handle-out {
  background: #38bdf8;
  border-radius: 1px 5px 5px 1px;
}
.montage-handle-bubble {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #f0f9ff;
  background: rgba(2, 6, 23, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
}
.montage-timeline-handle:hover .montage-handle-bubble,
.montage-timeline-handle:focus-visible .montage-handle-bubble,
.montage-timeline-handle:active .montage-handle-bubble { opacity: 1; }

.montage-hero-shortcut {
  margin: 10px 0 0;
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.6;
}
.montage-hero-shortcut kbd {
  display: inline-block;
  padding: 1px 6px;
  margin: 0 2px;
  font-size: 10.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 4px;
  line-height: 1.1;
}

/* Pause badge hint over video */
.montage-pause-badge {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  font-size: 11.5px;
  color: #cbd5e1;
  background: rgba(2, 6, 23, 0.82);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 999px;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  white-space: nowrap;
  max-width: 90%;
  text-overflow: ellipsis;
  overflow: hidden;
}
.montage-video-stack.montage-paused .montage-pause-badge { opacity: 1; }
.montage-video-stack.montage-paused { cursor: crosshair; box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35), 0 16px 48px rgba(14, 116, 144, 0.3); }
.montage-video-stack.montage-paused .montage-draw-canvas { pointer-events: auto; }

/* Stat grid in sidebar */
.montage-stat-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  margin: 4px 0 10px;
  font-size: 13px;
  color: #94a3b8;
}
.montage-stat-grid dt { color: #64748b; font-weight: 500; text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.08em; align-self: center; }
.montage-stat-grid dd { margin: 0; color: #e2e8f0; font-variant-numeric: tabular-nums; font-size: 13px; }
.montage-stat-grid dd strong { color: #67e8f9; font-size: 14px; font-weight: 700; }

/* Add button disabled styling */
.montage-btn-add:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.3);
}
.montage-add-note {
  margin: 4px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: #64748b;
}

/* Annotation edit button */
.montage-ann-edit {
  flex: 1;
  min-width: 0;
  display: block;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
}
.montage-ann-item.is-selected {
  border-color: rgba(236, 72, 153, 0.55);
  background: rgba(236, 72, 153, 0.08);
}

.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-skip {
  margin-top: 8px;
  background: linear-gradient(180deg, #3f3f46 0%, #27272a 100%);
  color: #f4f4f5;
  border-color: #52525b;
}
.montage-btn-add-skip:hover {
  box-shadow: 0 6px 18px rgba(82, 82, 91, 0.45);
}
.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;
}

.montage-frame-panel {
  margin-bottom: 12px;
}
.montage-frame-stack {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(51, 65, 85, 0.8);
  background: #020617;
}
.montage-frame-canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
}
.montage-frame-hint {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #bae6fd;
  font-size: 11px;
  line-height: 1.35;
}
.montage-frame-controls {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: end;
}
.montage-range-wrap {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.montage-range-wrap input[type=\"range\"] {
  width: 100%;
}
.montage-ann-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.montage-ann-kind {
  color: #fde68a;
  font-weight: 700;
}
.btn-small {
  border: 1px solid #334155;
  background: rgba(15, 23, 42, 0.7);
  color: #e2e8f0;
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 12px;
  cursor: pointer;
}
.btn-small:hover {
  border-color: #0ea5e9;
  color: #bae6fd;
}

.tpl-editor-wrap {
  border: 1px solid #334155;
  border-radius: 12px;
  background: #020617;
  padding: 8px;
}
.tpl-canvas {
  width: 100%;
  max-width: 560px;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  cursor: crosshair;
}
.tpl-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 10px;
  align-items: center;
}
.tpl-list-row {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(51, 65, 85, 0.55);
  background: rgba(15, 23, 42, 0.45);
}
.tpl-thumb-btn {
  display: block;
  width: 64px;
  height: 64px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  background: #020617;
  cursor: zoom-in;
  line-height: 0;
  box-shadow: none;
}
.tpl-thumb-btn:focus {
  outline: none;
}
.tpl-thumb-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}
.tpl-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
  border: none;
}
.tpl-rename-form {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.tpl-rename-form input {
  min-width: 220px;
}
.tpl-inline-preview {
  margin-top: 12px;
  border: 1px solid #334155;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.5);
  padding: 10px;
}
.tpl-inline-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 10px;
}
.tpl-preview-wrap {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}
.tpl-preview-wrap img {
  width: 100%;
  display: block;
}
#tpl-preview-rect,
#tpl-inline-rect {
  position: absolute;
  border: 2px solid #22d3ee;
  background: rgba(34, 211, 238, 0.14);
  z-index: 3;
  box-shadow: 0 0 0 9999px rgba(2, 6, 23, 0.42);
  pointer-events: none;
}

.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; }
}

/* ═══ Admin: Выкладка YouTube (как дашборд / медиатека) ═══ */
.pub-page { max-width: 1120px; margin-left: auto; margin-right: auto; }
.pub-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding: 22px 22px 20px;
  border-radius: 16px;
  border: 1px solid #1e293b;
  background: linear-gradient(145deg, rgba(79, 70, 229, 0.14) 0%, #0f172a 42%, #0b1020 100%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
.pub-hero-slim { padding: 18px 20px; margin-bottom: 16px; }
.pub-hero-main { min-width: 0; flex: 1; }
.pub-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #818cf8;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pub-kicker-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.65);
}
.pub-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #f8fafc;
  line-height: 1.15;
}
.pub-hero .pub-sub {
  margin: 8px 0 0;
  max-width: 52ch;
  font-size: 14px;
  line-height: 1.5;
  color: #94a3b8;
}
.pub-callout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.pub-callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #273449;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: border-color 0.15s, transform 0.15s;
}
.pub-callout:hover {
  border-color: #4338ca;
  transform: translateY(-1px);
}
.pub-callout-ico {
  font-size: 22px;
  line-height: 1.2;
  flex-shrink: 0;
}
.pub-callout strong { color: #e2e8f0; font-size: 13px; }
.pub-callout-p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: #94a3b8;
}
.pub-callout-p a { color: #a5b4fc; }
.pub-callout-p a:hover { text-decoration: underline; }

.pub-form-studio .pub-studio-intro { margin-bottom: 4px; }
.pub-studio-lead { margin: 0 0 14px; font-size: 13px; line-height: 1.55; color: #94a3b8; }
.pub-fieldset {
  border: none;
  margin: 0 0 8px;
  padding: 16px 0 4px;
  border-top: 1px solid #1e293b;
}
.pub-fieldset:first-of-type {
  border-top: none;
  padding-top: 0;
}
.pub-legend {
  padding: 0;
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #818cf8;
}
.pub-form-grid .pub-field-span2 { grid-column: 1 / -1; }
.pub-field-note {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: #64748b;
  line-height: 1.45;
}
.pub-field-note a { color: #818cf8; }
.pub-field-note a:hover { text-decoration: underline; }
.pub-hint-inline { font-weight: 500; color: #64748b; font-size: 12px; }
.pub-select-lg { font-size: 14px; }
.pub-check-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #273449;
  background: rgba(30, 41, 59, 0.4);
  margin-top: 10px;
}
.pub-actions-sticky {
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid #1e293b;
}
.pub-btn-lg { padding: 11px 20px; font-size: 15px; font-weight: 700; }
.pub-btn-ico { margin-right: 6px; }
.pub-actions-hint { display: inline-block; font-size: 12px; color: #64748b; max-width: 42ch; vertical-align: middle; margin-left: 10px; line-height: 1.4; }
@media (max-width: 560px) {
  .pub-actions-hint { display: block; margin-left: 0; margin-top: 8px; }
}
.pub-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.pub-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pub-ico { flex-shrink: 0; opacity: 0.95; }
.pub-flash { margin-bottom: 16px; }

.pub-stat-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #1e293b;
  background: rgba(15, 23, 42, 0.65);
}
.pub-stat { display: flex; flex-direction: column; gap: 2px; }
.pub-stat-val { font-size: 22px; font-weight: 800; color: #e0e7ff; font-variant-numeric: tabular-nums; }
.pub-stat-lbl { font-size: 12px; color: #64748b; }
.pub-stat-div { width: 1px; height: 28px; background: #334155; align-self: center; }

.pub-main-grid {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 300px);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}
.pub-card-title-tight { margin-bottom: 6px; }
.pub-card-head { margin-bottom: 12px; }
.pub-card-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.pub-req { font-size: 11px; font-weight: 700; color: #fb923c; margin-left: 4px; }
.pub-form-actions { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pub-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 720px) {
  .pub-form-grid { grid-template-columns: 1fr; }
  .pub-main-grid { grid-template-columns: 1fr; }
}

.pub-card-hint {
  background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
}
.pub-aside-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: #cbd5e1;
}
.pub-step-list {
  margin: 0 0 16px;
  padding-left: 18px;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.55;
}
.pub-step-list li { margin-bottom: 8px; }
.pub-step-list strong { color: #e2e8f0; }
.pub-hint-box {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #312e81;
  background: rgba(49, 46, 129, 0.2);
}
.pub-hint-ico { font-size: 18px; line-height: 1.2; }
.pub-hint-p { margin: 4px 0 0; font-size: 12px; color: #94a3b8; line-height: 1.45; }
.pub-hint-box strong { color: #c7d2fe; font-size: 13px; }

.pub-card-accounts { margin-bottom: 16px; }
.pub-acc-list { display: flex; flex-direction: column; gap: 10px; }
.pub-acc {
  border-radius: 14px;
  border: 1px solid #1e293b;
  background: #0f172a;
  overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.pub-acc[open] {
  border-color: #4338ca;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25), 0 12px 40px rgba(0, 0, 0, 0.35);
}
.pub-acc-summary {
  list-style: none;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 12px 14px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}
.pub-acc-summary::-webkit-details-marker { display: none; }
.pub-acc-chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(-45deg);
  transition: transform 0.2s;
  margin-top: -2px;
}
.pub-acc[open] .pub-acc-chevron { transform: rotate(45deg); margin-top: 2px; }
.pub-acc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #312e81 0%, #1e1b4b 100%);
  color: #a5b4fc;
  border: 1px solid #3730a3;
}
.pub-acc-titles { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pub-acc-name { font-weight: 700; font-size: 15px; color: #f1f5f9; }
.pub-acc-channel { font-size: 12px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pub-acc-channel-muted { color: #64748b; font-style: italic; }
.pub-acc-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.pub-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #94a3b8;
}
.pub-pill-muted { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pub-acc-body {
  padding: 0 16px 18px;
  border-top: 1px solid #1e293b;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.4) 0%, #0b1120 100%);
}
.pub-acc-body .pub-sub {
  padding: 16px 0 18px;
  border-left: 3px solid #4f46e5;
  padding-left: 16px;
  margin-left: 4px;
}
.pub-acc-body .pub-sub + .pub-sub { border-top: 1px solid #1e293b; margin-top: 0; padding-top: 18px; }
.pub-sub-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.pub-sub-icon { font-size: 16px; line-height: 1; }
.pub-sub-title { margin: 0; font-size: 14px; font-weight: 700; color: #e2e8f0; }
.pub-sub-desc { margin: 0 0 12px !important; }
.pub-code {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #1e293b;
  color: #c4b5fd;
}

.pub-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #cbd5e1;
  cursor: pointer;
  margin-top: 4px;
}
.pub-check input { margin-top: 3px; accent-color: #6366f1; width: 16px; height: 16px; flex-shrink: 0; }

.pub-sub-chart .pub-chart-wrap {
  position: relative;
  height: 220px;
  margin: 12px 0 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #1e293b;
  background: radial-gradient(ellipse 80% 80% at 50% 0%, rgba(99, 102, 241, 0.08), transparent 55%), #080c18;
}
.pub-chart-canvas { width: 100% !important; height: 100% !important; }

.pub-analytics-mount { margin-top: 16px; }
.pub-analytics-block { margin-top: 18px; }
.pub-analytics-block:first-child { margin-top: 4px; }
.pub-analytics-table-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
}
.pub-table-scroll {
  overflow: auto;
  max-height: 240px;
  border-radius: 12px;
  border: 1px solid #1e293b;
  background: rgba(8, 12, 24, 0.55);
}
.pub-table-scroll--tall { max-height: 380px; }
.pub-analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: #cbd5e1;
}
.pub-analytics-table th,
.pub-analytics-table td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid #1e293b;
  vertical-align: top;
}
.pub-analytics-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #0f172a;
  font-weight: 700;
  color: #94a3b8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pub-analytics-table tbody tr:hover { background: rgba(49, 46, 129, 0.15); }
.pub-analytics-table a { color: #a5b4fc; text-decoration: none; word-break: break-all; }
.pub-analytics-table a:hover { text-decoration: underline; }
.pub-analytics-cell-title {
  max-width: 280px;
  word-break: break-word;
  line-height: 1.35;
}
@media (max-width: 720px) {
  .pub-analytics-cell-title { max-width: 160px; }
}

.pub-acc-danger-zone {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px dashed #334155;
}
.pub-del-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pub-del-hint { margin: 0 !important; }

.pub-empty {
  text-align: center;
  padding: 36px 20px 28px;
  border-radius: 14px;
  border: 1px dashed #334155;
  background: rgba(15, 23, 42, 0.5);
}
.pub-empty-tight { padding: 28px 18px; }
.pub-empty-icon { display: flex; justify-content: center; margin-bottom: 10px; color: #475569; }
.pub-empty-title { margin: 0 0 6px; font-weight: 700; font-size: 16px; color: #e2e8f0; }

.pub-card-queue .pub-queue-list { display: flex; flex-direction: column; gap: 10px; }
.pub-queue-row {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #1e293b;
  background: #0f172a;
  transition: border-color 0.15s, background 0.15s;
}
.pub-queue-row:hover { border-color: #334155; background: #121c31; }
.pub-queue-main { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 6px; }
.pub-queue-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; font-size: 12px; color: #64748b; }
.pub-queue-job {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: #818cf8;
  text-decoration: none;
  word-break: break-all;
}
.pub-queue-job:hover { text-decoration: underline; color: #a5b4fc; }
.pub-queue-when { color: #64748b; }
.pub-queue-global-hint {
  margin: 0 0 14px !important;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #273449;
  background: rgba(30, 41, 59, 0.35);
  line-height: 1.5;
}
.pub-queue-vid-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.pub-queue-studio {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #818cf8;
  text-decoration: none;
}
.pub-queue-studio:hover { text-decoration: underline; color: #a5b4fc; }
.pub-queue-privacy { font-size: 11px; color: #94a3b8; text-transform: lowercase; }
.pub-queue-vid {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: #38bdf8;
  text-decoration: none;
}
.pub-queue-vid:hover { text-decoration: underline; }
.pub-queue-dash { color: #475569; }
.pub-queue-err {
  margin: 8px 0 0;
  font-size: 12px;
  color: #fca5a5;
  line-height: 1.4;
}
.pub-pill-status { text-transform: lowercase; }
.pub-pill--scheduled { border-color: #854d0e; background: rgba(120, 53, 15, 0.35); color: #fcd34d; }
.pub-pill--uploading { border-color: #1e3a8a; background: rgba(30, 58, 138, 0.45); color: #93c5fd; }
.pub-pill--done { border-color: #166534; background: rgba(22, 101, 52, 0.35); color: #86efac; }
.pub-pill--failed { border-color: #991b1b; background: rgba(127, 29, 29, 0.35); color: #fecaca; }

/* Compose */
.pub-crumb-link { color: #a5b4fc; text-decoration: none; font-weight: 700; letter-spacing: 0.06em; }
.pub-crumb-link:hover { text-decoration: underline; color: #c7d2fe; }
.pub-crumb-sep { color: #475569; margin: 0 6px; font-weight: 400; }
.pub-compose-steps {
  margin-bottom: 20px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid #1e293b;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.25) 0%, rgba(15, 23, 42, 0.9) 100%);
}
.pub-step-track {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  flex-wrap: wrap;
  max-width: 560px;
}
.pub-step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.pub-step-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}
.pub-step-node:has(.pub-step-done) .pub-step-label {
  color: #a5b4fc;
}
.pub-step-dot {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  border: 2px solid #334155;
  background: #1e293b;
  color: #64748b;
}
.pub-step-dot.pub-step-done {
  border-color: #818cf8;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.35);
}
.pub-step-line {
  flex: 1;
  min-width: 24px;
  max-width: 72px;
  height: 3px;
  border-radius: 999px;
  background: #273449;
  margin: 0 6px;
  margin-bottom: 26px;
  align-self: center;
}
.pub-step-line.pub-step-line-done {
  background: linear-gradient(90deg, #6366f1, #4338ca);
}
.pub-step-hint {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}

.pub-compose-layout {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 300px);
  gap: 18px;
  align-items: start;
}
@media (max-width: 900px) {
  .pub-compose-layout { grid-template-columns: 1fr; }
}
.pub-compose-card {
  border: 1px solid #2f3f5a;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.32);
  background: linear-gradient(165deg, rgba(67, 56, 202, 0.14) 0%, #0f172a 38%, #080c16 100%);
}
.pub-compose-card-head {
  margin-bottom: 6px;
  padding: 4px 4px 14px;
  border-bottom: 1px solid #1e293b;
}
.pub-compose-card-lead { margin: 8px 0 0 !important; line-height: 1.5; }
.pub-compose-form { padding-top: 4px; }
.pub-compose-field-group {
  padding: 14px 0 16px;
  border-bottom: 1px solid #1e293b;
}
.pub-compose-field-group:last-of-type {
  border-bottom: none;
  padding-bottom: 8px;
}
.pub-compose-group-lbl {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #818cf8;
  margin-bottom: 10px;
}
.pub-time-block-card {
  padding: 14px 14px 10px;
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid #273449;
  background: radial-gradient(ellipse 100% 80% at 50% 0%, rgba(99, 102, 241, 0.12), transparent 55%), rgba(8, 12, 24, 0.75);
}
.pub-check-pill {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: rgba(30, 41, 59, 0.55);
}
.pub-select-focus:focus {
  outline: none;
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.28);
}
.pub-compose-aside {
  border-radius: 16px;
  border: 1px solid #2f3f5a;
  background: linear-gradient(180deg, #111827 0%, #0a0f1c 100%);
}
.pub-compose-card .pub-compose-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.pub-compose-submit { display: inline-flex; align-items: center; gap: 8px; }
.pub-job-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #312e81;
  background: rgba(49, 46, 129, 0.2);
  margin-bottom: 4px;
}
.pub-job-chip-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #818cf8; }
.pub-job-chip-link code { font-size: 12px; color: #e0e7ff; }
.pub-opt { font-size: 11px; font-weight: 600; color: #64748b; margin-left: 6px; }
.pub-time-block { margin-top: 4px; }
.pub-time-label { display: block; font-size: 13px; font-weight: 600; color: #cbd5e1; margin-bottom: 8px; }
.pub-time-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.pub-datetime { flex: 1; min-width: 200px; max-width: 320px; }
.pub-check-inline { margin: 0; align-items: center; }
.pub-time-hint { margin-top: 8px !important; }

.pub-compose-aside .pub-aside-list {
  margin: 0;
  padding-left: 18px;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.55;
}
.pub-compose-aside .pub-aside-list li { margin-bottom: 10px; }
.pub-compose-aside .pub-aside-list strong { color: #e2e8f0; }

@media (max-width: 640px) {
  .pub-hero { padding: 18px 16px; }
  .pub-title { font-size: 24px; }
  .pub-acc-summary {
    grid-template-columns: auto auto 1fr;
    grid-template-rows: auto auto;
  }
  .pub-acc-tags { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ═══ Шаг «текст»: вырезка интервалов из оригинального рилса ═══ */
.reel-cut-shell {
  margin: 20px 0 24px;
  padding: 20px 22px 22px;
  border-radius: 16px;
  border: 1px solid #1e293b;
  background: linear-gradient(155deg, rgba(30, 27, 75, 0.55) 0%, #0f172a 55%, #0b1020 100%);
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.28);
}
.reel-cut-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.reel-cut-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: -0.3px;
}
.reel-cut-sub { margin: 0; max-width: 62ch; line-height: 1.45; }
.reel-cut-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fde68a;
  background: rgba(120, 53, 15, 0.45);
  border: 1px solid #b45309;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.reel-cut-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .reel-cut-grid { grid-template-columns: 1fr; }
}
.reel-cut-video-frame {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #312e81;
  background: #000;
  max-height: min(72vh, 520px);
  margin: 0 auto;
  max-width: 340px;
}
.reel-cut-video {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: bottom;
}
.reel-cut-timebar-wrap { margin-top: 12px; }
.reel-cut-timebar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: #1e293b;
  border: 1px solid #334155;
  cursor: pointer;
  overflow: hidden;
}
.reel-cut-timebar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  pointer-events: none;
}
.reel-cut-timebar-markers {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  pointer-events: none;
}
.reel-cut-marker {
  position: absolute;
  top: 1px;
  bottom: 1px;
  background: rgba(248, 113, 113, 0.55);
  border-left: 1px solid #f87171;
  border-right: 1px solid #f87171;
  border-radius: 2px;
}
.reel-cut-time-readout {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #94a3b8;
}
.reel-cut-time-sep { color: #475569; font-weight: 400; }

.reel-cut-controls-col { display: flex; flex-direction: column; gap: 16px; }
.reel-cut-mark-panel {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: rgba(15, 23, 42, 0.75);
}
.reel-cut-mark-label { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: #cbd5e1; }
.reel-cut-mark-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.reel-cut-btn { flex: 1; min-width: 140px; }
.reel-cut-btn-wide { width: 100%; margin-top: 4px; }
.reel-cut-mark-readout {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 10px;
}
.reel-cut-list-wrap {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #1e293b;
  background: #0b1120;
}
.reel-cut-list-title { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: #e2e8f0; }
.reel-cut-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.reel-cut-li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #111827;
  font-size: 13px;
}
.reel-cut-li-range { font-family: ui-monospace, monospace; color: #e2e8f0; }
.reel-cut-li-dur { color: #64748b; font-size: 12px; }
.reel-cut-li-del { margin-left: auto; color: #fca5a5; font-size: 13px; }
.reel-cut-li-del:hover { color: #fecaca; }
.reel-cut-list-empty { margin: 0; font-size: 12px; }
.reel-cut-status { margin: 0; font-size: 13px; padding: 10px 12px; border-radius: 10px; border: 1px solid #334155; }
.reel-cut-status-ok { background: #0f1d3a; color: #93c5fd; border-color: #1d4ed8; }
.reel-cut-status-err { background: #2d0a0a; color: #fecaca; border-color: #991b1b; }
.reel-cut-apply { width: 100%; padding: 12px 18px; font-weight: 700; }
.reel-cut-foot { margin: 0; font-size: 12px; line-height: 1.45; }

/* Live montage progress — компактный зелёный троббер (шаг ~5) */
@keyframes montage-throbber-soft {
  0%,
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 0 transparent);
  }
  50% {
    opacity: 0.92;
    filter: drop-shadow(0 0 5px rgba(74, 222, 128, 0.25));
  }
}
.montage-live-card {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #2d3b4f;
  background: rgba(15, 23, 42, 0.88);
}
.montage-live-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.montage-throbber {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin-top: 2px;
  animation: montage-throbber-soft 2.2s ease-in-out infinite;
}
.montage-throbber-svg {
  display: block;
  width: 32px;
  height: 32px;
}
.montage-ring-bg {
  fill: none;
  stroke: #273549;
  stroke-width: 2.75;
}
.montage-ring-fg {
  fill: none;
  stroke: #4ade80;
  stroke-width: 2.75;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.35s ease;
}
.montage-live-text {
  flex: 1;
  min-width: 0;
}
.montage-live-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-bottom: 4px;
}
.montage-live-title-row strong {
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
}
.montage-pct-inline {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #86efac;
  letter-spacing: 0.02em;
}
.montage-live-detail {
  margin: 0 0 3px;
  line-height: 1.4;
  font-size: 12px;
  max-width: 56ch;
}
.montage-live-eta {
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
}

/* Publish: audience radios + quiet hero */
.pub-sub-quiet { color: #94a3b8; font-size: 14px; max-width: 44rem; line-height: 1.45; }
.pub-fieldset-lead { margin: 0 0 12px !important; }
.pub-radio-group {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #1e293b;
  background: rgba(15, 23, 42, 0.55);
}
.pub-radio-title {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pub-radio {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 6px 0;
  font-size: 14px;
  color: #e2e8f0;
  cursor: pointer;
}
.pub-radio input { margin-top: 3px; flex-shrink: 0; }

/* Сворачиваемые блоки (<details>) — дашборд, страница задачи */
.ui-collapsible > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.ui-collapsible > summary::-webkit-details-marker {
  display: none;
}
.ui-collapsible > summary:focus {
  outline: none;
}
.ui-collapsible > summary:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 3px;
  border-radius: 10px;
}
.ui-collapsible-chevron {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  margin-top: 2px;
  border-radius: 9px;
  border: 1px solid #334155;
  background: rgba(15, 23, 42, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.ui-collapsible > summary:hover .ui-collapsible-chevron {
  border-color: #475569;
  background: rgba(30, 41, 59, 0.9);
}
.ui-collapsible-chevron::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid #94a3b8;
  transform: rotate(-90deg);
  margin-left: 2px;
  transition: transform 0.2s ease;
}
.ui-collapsible[open] > summary .ui-collapsible-chevron::before {
  transform: rotate(0deg);
  margin-left: 0;
  margin-top: 2px;
}

/* Dashboard: теги (карточка + чипы как в современных UI) */
details.dash-tags-panel {
  margin-bottom: 16px;
  padding-bottom: 4px;
}
.dash-tags-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.dash-tags-summary-text {
  flex: 1;
  min-width: 0;
}
.dash-tags-details-body {
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid #1a2236;
}
.dash-tags-panel-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.02em;
}
.dash-tags-panel-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
  max-width: 52ch;
}
.dash-tags-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  min-height: 2px;
}
.dash-tags-panel a.dash-filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  border: 1px solid #273349;
  background: #0f172a;
  color: #94a3b8 !important;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.dash-tags-panel a.dash-filter-pill:hover {
  border-color: #4f46e5;
  color: #e2e8f0 !important;
}
.dash-tags-panel a.dash-filter-pill.is-active {
  border-color: #6366f1;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.35) 0%, rgba(99, 102, 241, 0.12) 100%);
  color: #eef2ff !important;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.35);
}
.dash-tag-chip {
  --tag-accent: #6366f1;
  display: inline-flex;
  align-items: stretch;
  border-radius: 999px;
  border: 1px solid #273349;
  background: #0c1222;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
.dash-tags-panel .dash-tag-chip-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px 6px 12px;
  text-decoration: none !important;
  color: #e2e8f0 !important;
  font-size: 13px;
  font-weight: 600;
  max-width: 200px;
  transition: background 0.12s;
}
.dash-tags-panel .dash-tag-chip-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc !important;
}
.dash-tags-panel .dash-tag-chip-link.is-active {
  background: rgba(99, 102, 241, 0.18);
  color: #eef2ff !important;
}
.dash-tag-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--tag-accent);
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.9);
}
.dash-tag-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-tag-chip-del {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: stretch;
}
.dash-tag-chip-x {
  margin: 0;
  padding: 0 11px;
  border: none;
  border-left: 1px solid #1e293b;
  background: transparent;
  color: #64748b;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.12s, background 0.12s;
}
.dash-tag-chip-x:hover {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.35);
}
.dash-tags-panel .dash-tag-create {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px 18px;
  padding-top: 16px;
  border-top: 1px solid #1a2236;
}
.dash-tags-panel .dash-tag-create-label {
  flex: 1 1 200px;
  min-width: 180px;
  max-width: 360px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dash-tag-create-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}
.dash-tag-create-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #f1f5f9;
  font-size: 14px;
  color-scheme: dark;
}
.dash-tag-create-input::placeholder {
  color: #475569;
}
.dash-tag-create-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.dash-tag-create-colors {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-tag-create-colors-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}
.dash-tag-swatch-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
/* Глобально label { flex-direction: column } — ломает чипы цвета; переопределяем */
.dash-tags-panel .dash-swatch {
  position: relative;
  cursor: pointer;
  line-height: 0;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0;
  padding: 0;
  width: 28px;
  height: 28px;
}
.dash-tags-panel .dash-swatch input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: none;
}
.dash-swatch-dot {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--sw, #6366f1);
  box-shadow: 0 0 0 2px #111827, 0 0 0 3px #334155;
  transition: transform 0.15s, box-shadow 0.15s;
}
.dash-swatch:hover .dash-swatch-dot {
  transform: scale(1.06);
}
.dash-swatch input:checked + .dash-swatch-dot {
  box-shadow: 0 0 0 2px #111827, 0 0 0 3px #e0e7ff, 0 0 12px rgba(99, 102, 241, 0.45);
  transform: scale(1.08);
}
.dash-tags-panel .dash-tag-create-btn {
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: #fff !important;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #7c3aed 100%) !important;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
  transition: transform 0.12s, box-shadow 0.12s;
}
.dash-tags-panel .dash-tag-create-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(79, 70, 229, 0.45);
  background: linear-gradient(135deg, #5b52f0 0%, #7c74f5 50%, #8b4df0 100%) !important;
}
@media (max-width: 560px) {
  .dash-tags-panel .dash-tag-create {
    flex-direction: column;
    align-items: stretch;
  }
  .dash-tags-panel .dash-tag-create-label { max-width: none; }
  .dash-tags-panel .dash-tag-create-btn { width: 100%; }
}
.dash-job-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.dash-job-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.dash-publish-btn { text-transform: none; letter-spacing: 0; }

/* Job page: сворачиваемый блок названия и тегов */
.job-meta-details {
  margin: 12px 0 18px;
  max-width: 560px;
  border-radius: 14px;
  border: 1px solid #273349;
  background: rgba(15, 23, 42, 0.45);
  overflow: hidden;
}
.job-meta-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}
.job-meta-summary-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.job-meta-summary-title {
  font-size: 14px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.01em;
}
.job-meta-summary-preview {
  font-size: 12px;
  line-height: 1.35;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.job-meta-details-inner {
  padding: 14px 16px 16px;
  border-top: 1px solid #1e293b;
  background: rgba(11, 15, 20, 0.35);
}
.job-meta-title-form {
  margin: 0 0 4px;
  max-width: 520px;
}
.job-meta-details-inner .job-tags-card {
  margin-top: 14px;
  margin-bottom: 0;
}

/* Job page: tags + publish CTA */
.job-tags-card {
  margin: 12px 0 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #312e81;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(15, 23, 42, 0.5) 100%);
}
.job-tags-title { margin: 0 0 10px; font-size: 15px; color: #c7d2fe; }
.job-tags-form { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.job-tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.job-tag-chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #e2e8f0;
  cursor: pointer;
}
.job-publish-cta { margin-top: 16px; }
.job-publish-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-radius: 14px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #5b21b6 100%);
  box-shadow: 0 8px 28px rgba(79, 70, 229, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.job-publish-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 36px rgba(79, 70, 229, 0.45);
  color: #fff;
}
.job-publish-btn-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 14px;
}
.job-publish-btn-text { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.job-publish-btn-text strong { font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }
.job-publish-btn-text small { font-size: 12px; font-weight: 400; opacity: 0.88; color: #e0e7ff; }

/* Admin: uniquifier (UTM → short redirect) */
.uniq-hero {
  margin: 0 0 24px;
  padding: 28px 24px 26px;
  border-radius: 18px;
  border: 1px solid #312e81;
  background: linear-gradient(135deg, rgba(67, 56, 202, 0.35) 0%, rgba(15, 23, 42, 0.92) 45%, rgba(15, 23, 42, 0.98) 100%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.uniq-hero__inner { max-width: 820px; }
.uniq-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a5b4fc;
}
.uniq-title {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #f8fafc;
}
.uniq-lead {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.55;
  color: #cbd5e1;
  max-width: 52rem;
}
.uniq-breadcrumb a {
  color: #93c5fd;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.uniq-breadcrumb a:hover { text-decoration: underline; }
.uniq-two-links {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.55);
  font-size: 14px;
  line-height: 1.55;
  color: #cbd5e1;
  max-width: 52rem;
}
.uniq-two-links p { margin: 0 0 10px; }
.uniq-two-links p:last-child { margin-bottom: 0; }
.uniq-two-links code { font-size: 12px; color: #fde68a; }
.uniq-flash { margin: 0 0 16px; padding: 12px 14px; border-radius: 10px; }
.uniq-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 18px;
  margin-bottom: 28px;
}
@media (max-width: 900px) {
  .uniq-grid { grid-template-columns: 1fr; }
}
.uniq-card {
  border-radius: 16px;
  border: 1px solid #1e293b;
  background: rgba(17, 24, 39, 0.85);
  padding: 20px 20px 22px;
}
.uniq-card-title {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 700;
  color: #e2e8f0;
}
.uniq-label-text {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 8px;
}
.uniq-textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  border-radius: 12px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #f1f5f9;
  padding: 12px 14px;
}
.uniq-select {
  width: 100%;
  max-width: 100%;
  font-size: 14px;
  line-height: 1.4;
  border-radius: 12px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #f1f5f9;
  padding: 10px 12px;
}
.uniq-submit { margin-top: 6px; align-self: flex-start; padding: 12px 20px; border-radius: 12px; }
.uniq-hint-box {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px dashed #334155;
}
.uniq-hint-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #cbd5e1;
}
.uniq-hint-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.55;
  color: #94a3b8;
}
.uniq-hint-list code { font-size: 12px; color: #fcd34d; }
.uniq-status { margin: 12px 0 0; font-size: 13px; }
.uniq-steps {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.uniq-steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.45;
  color: #cbd5e1;
}
.uniq-step-num {
  flex: 0 0 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #4f46e5;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.uniq-table-section { margin-top: 8px; }
.uniq-table-title {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  color: #e2e8f0;
}
.uniq-table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid #1e293b;
  background: #0f172a;
}
.uniq-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
.uniq-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  padding: 12px 14px;
  border-bottom: 1px solid #1e293b;
  background: rgba(30, 41, 59, 0.5);
}
.uniq-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #1e293b;
  vertical-align: top;
  font-size: 13px;
}
.uniq-table tr:last-child td { border-bottom: none; }
.uniq-cell-alias { min-width: 240px; }
.uniq-code {
  display: block;
  word-break: break-all;
  font-size: 12px;
  color: #86efac;
  margin-bottom: 8px;
  line-height: 1.4;
}
.uniq-copy {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}
.uniq-cell-target { max-width: 280px; }
.uniq-ellipsis {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
  color: #cbd5e1;
}
.uniq-empty { padding: 16px; border-radius: 12px; border: 1px dashed #334155; }
