/**
 * MyVideoStudio — Video Generator (v1.44.0)
 *
 * Fash Studio inspired 3-column layout with all the upgrades.
 * TailAdmin palette + Plus Jakarta + Instrument Serif italic accents.
 */

.mvs-vidgen {
  display: grid;
  grid-template-columns: 370px 1fr 280px;
  gap: 16px;
  min-height: calc(100vh - 120px);
  align-items: start;
}

/* SVG safety — some WP themes inject inline svg styles that collapse our icons */
.mvs-vidgen svg {
  display: inline-block;
  flex-shrink: 0;
}

/* =====================================================================
   LEFT: CONFIG SIDEBAR
   ===================================================================== */

.mvs-vidgen__config {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.mvs-vidgen__config::-webkit-scrollbar { width: 0; height: 0; display: none; }

.mvs-vidgen__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mvs-vidgen__label {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  letter-spacing: -0.005em;
}
.mvs-vidgen__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mvs-vidgen__row--three {
  grid-template-columns: repeat(3, 1fr);
}

/* Quality preset — segmented 3-tab control (Draft / Standard / Premium)
   v1.45.14 — Compacted to fit a 370px sidebar (was overflowing) */
.mvs-vidgen__quality {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.mvs-vidgen__quality-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.mvs-vidgen__quality-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  letter-spacing: -0.005em;
  flex-shrink: 0;
}
.mvs-vidgen__quality-hint {
  font-size: 11px;
  color: #94A3B8;
  font-weight: 500;
  letter-spacing: -0.005em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  text-align: right;
}
.mvs-vidgen__quality-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3px;
  background: #F1F5F9;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.mvs-vidgen__quality-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  background: transparent;
  border: none;
  border-radius: 7px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  letter-spacing: -0.005em;
  padding: 0 4px;
  min-width: 0;
  overflow: hidden;
  transition: background 130ms ease, color 130ms ease, box-shadow 130ms ease;
}
.mvs-vidgen__quality-tab span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.mvs-vidgen__quality-tab svg {
  width: 12px !important;
  height: 12px !important;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 130ms ease;
}
.mvs-vidgen__quality-tab:hover { color: #1C2434; }
.mvs-vidgen__quality-tab:hover svg { opacity: 1; }
.mvs-vidgen__quality-tab.is-active {
  background: #FFFFFF;
  color: #1C2434;
  box-shadow:
    0 1px 3px rgba(28, 36, 52, 0.08),
    0 0 0 1px rgba(60, 80, 224, 0.12);
}
.mvs-vidgen__quality-tab.is-active svg {
  opacity: 1;
  color: #3C50E0;
}

/* Start + End frames */
.mvs-vidgen__frames {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mvs-vidgen__frame {
  position: relative;
  background: #F7F9FC;
  border: 1px dashed #CBD5E1;
  border-radius: 12px;
  height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color 130ms ease, background 130ms ease;
  overflow: hidden;
}
.mvs-vidgen__frame:hover {
  border-color: #3C50E0;
  background: #EFF4FB;
}
.mvs-vidgen__frame.is-loaded {
  border-style: solid;
  border-color: #3C50E0;
}
.mvs-vidgen__frame-pill {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94A3B8;
  background: rgba(255, 255, 255, 0.7);
  padding: 2px 7px;
  border-radius: 999px;
  z-index: 2;
}
.mvs-vidgen__frame-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
}
.mvs-vidgen__frame-thumb svg { width: 18px; height: 18px; }
.mvs-vidgen__frame-thumb.has-image {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.mvs-vidgen__frame-thumb.has-image svg { display: none; }
.mvs-vidgen__frame-label {
  font-size: 12px;
  font-weight: 600;
  color: #1C2434;
}
.mvs-vidgen__frame.is-loaded .mvs-vidgen__frame-label,
.mvs-vidgen__frame.is-loaded .mvs-vidgen__frame-pill {
  display: none;
}

/* Model picker */
.mvs-vidgen__model-picker {
  position: relative;
  min-width: 0;
}
.mvs-vidgen__model-current {
  width: 100%;
  height: 42px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: #1C2434;
  transition: border-color 130ms ease, background 130ms ease;
  min-width: 0;
  box-sizing: border-box;
}
.mvs-vidgen__model-current:hover {
  border-color: #CBD5E1;
  background: #F7F9FC;
}
.mvs-vidgen__model-icon {
  color: #3C50E0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}
.mvs-vidgen__model-icon svg { width: 15px !important; height: 15px !important; flex-shrink: 0; }
.mvs-vidgen__model-name {
  flex: 1 1 auto;
  text-align: left;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mvs-vidgen__chevron {
  width: 14px !important;
  height: 14px !important;
  color: #64748B;
  flex-shrink: 0;
  transition: transform 130ms ease;
}
.mvs-vidgen__model-picker.is-open .mvs-vidgen__chevron { transform: rotate(180deg); }

.mvs-vidgen__model-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 6px;
  z-index: 20;
  max-height: 380px;
  overflow-y: auto;
  box-shadow: 0 12px 32px rgba(28, 36, 52, 0.12);
}
.mvs-vidgen__model-option {
  width: 100%;
  background: transparent;
  border: none;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  border-radius: 8px;
  text-align: left;
  transition: background 100ms ease;
}
.mvs-vidgen__model-option:hover { background: #F7F9FC; }
.mvs-vidgen__model-option.is-selected { background: #EFF4FB; }
.mvs-vidgen__model-option-body { flex: 1; min-width: 0; }
.mvs-vidgen__model-option-name {
  font-size: 13px;
  font-weight: 600;
  color: #1C2434;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.mvs-vidgen__model-option-premium {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  background: linear-gradient(135deg, #F0950C, #F59E0B);
  color: #FFFFFF;
  padding: 1px 6px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mvs-vidgen__model-option-needs-img {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
  padding: 1px 6px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mvs-vidgen__model-option-desc {
  font-size: 11.5px;
  color: #64748B;
  line-height: 1.4;
}
.mvs-vidgen__model-option-meta {
  display: flex;
  gap: 4px;
  margin-top: 5px;
  flex-wrap: wrap;
}
.mvs-vidgen__model-option-meta span {
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  background: #F1F5F9;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.01em;
}

/* Textarea + selects */
.mvs-vidgen__textarea,
.mvs-vidgen__select {
  width: 100%;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13.5px;
  color: #1C2434;
  letter-spacing: -0.005em;
  outline: none;
  transition: border-color 130ms ease, box-shadow 130ms ease;
}
.mvs-vidgen__textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}
.mvs-vidgen__textarea:focus,
.mvs-vidgen__select:focus {
  border-color: #3C50E0;
  box-shadow: 0 0 0 3px rgba(60, 80, 224, 0.12);
}
.mvs-vidgen__select {
  height: 38px;
  padding-right: 28px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

/* Toggles */
.mvs-vidgen__toggles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mvs-vidgen__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: #1C2434;
  cursor: pointer;
  letter-spacing: -0.005em;
}
.mvs-vidgen__toggle input { display: none; }
.mvs-vidgen__toggle-track {
  width: 32px;
  height: 18px;
  background: #CBD5E1;
  border-radius: 999px;
  position: relative;
  transition: background 150ms ease;
  flex-shrink: 0;
}
.mvs-vidgen__toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #FFFFFF;
  border-radius: 50%;
  transition: transform 150ms ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.mvs-vidgen__toggle input:checked + .mvs-vidgen__toggle-track {
  background: #3C50E0;
}
.mvs-vidgen__toggle input:checked + .mvs-vidgen__toggle-track::after {
  transform: translateX(14px);
}

/* Advanced details */
.mvs-vidgen__advanced { margin: 4px 0; }
.mvs-vidgen__advanced-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.mvs-vidgen__advanced-summary::-webkit-details-marker { display: none; }
.mvs-vidgen__advanced-summary svg { width: 13px; height: 13px; }
.mvs-vidgen__advanced[open] .mvs-vidgen__advanced-summary { color: #3C50E0; }

/* Run block */
.mvs-vidgen__run-wrap {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid #F1F5F9;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mvs-vidgen__cost-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #64748B;
}
.mvs-vidgen__cost-line strong {
  color: #1C2434;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}
.mvs-vidgen__run {
  height: 48px;
  background: #1C2434;
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: -0.005em;
  transition: background 130ms ease, transform 80ms ease;
}
.mvs-vidgen__run:hover { background: #000000; }
.mvs-vidgen__run:active { transform: translateY(0.5px); }
.mvs-vidgen__run:disabled { background: #94A3B8; cursor: not-allowed; }
.mvs-vidgen__run-icon { width: 16px !important; height: 16px !important; }
.mvs-vidgen__run-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: mvs-vidgen-spin 0.7s linear infinite;
}
.mvs-vidgen__run.is-loading .mvs-vidgen__run-icon { display: none; }

/* =====================================================================
   CENTRE: PLAYER + GRID
   ===================================================================== */

.mvs-vidgen__main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.mvs-vidgen__player-wrap {
  background: #0F172A;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mvs-vidgen__player-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}
.mvs-vidgen__player-empty {
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.mvs-vidgen__player-empty svg { width: 48px; height: 48px; opacity: 0.5; }
.mvs-vidgen__player-empty p { margin: 0; max-width: 280px; }
.mvs-vidgen__player-queued {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #FFFFFF;
  font-size: 14px;
}
.mvs-vidgen__spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: mvs-vidgen-spin 0.8s linear infinite;
}
@keyframes mvs-vidgen-spin { to { transform: rotate(360deg); } }

/* Gallery — single vertical column of video thumbnails in the right rail */
.mvs-vidgen__gallery {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100px;
  overflow-y: auto;
  flex: 1;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 transparent;
}
.mvs-vidgen__gallery::-webkit-scrollbar { width: 6px; }
.mvs-vidgen__gallery::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
.mvs-vidgen__gallery-loading {
  text-align: center;
  padding: 40px 20px;
  color: #64748B;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.mvs-vidgen__gallery-loading .mvs-vidgen__spinner {
  border-color: #E2E8F0;
  border-top-color: #3C50E0;
}

.mvs-vidgen__card {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #0F172A;
  position: relative;
  cursor: pointer;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.mvs-vidgen__card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(28, 36, 52, 0.08);
}
.mvs-vidgen__card.is-active {
  outline: 2px solid #3C50E0;
  outline-offset: 2px;
}
.mvs-vidgen__card img,
.mvs-vidgen__card video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mvs-vidgen__card-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: #1C2434;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.mvs-vidgen__card-play svg { width: 18px; height: 18px; margin-left: 2px; }
.mvs-vidgen__card--queued {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mvs-vidgen__card--failed {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #FEF2F2, #FEE2E2);
  border: 1px solid #FCA5A5;
  color: #991B1B;
  font-size: 12.5px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}
.mvs-vidgen__card-failed-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 220px;
  line-height: 1.45;
}
.mvs-vidgen__card-failed-msg {
  font-weight: 500;
  letter-spacing: -0.005em;
}

/* Small × erase button (top-right of failed / queued cards) */
.mvs-vidgen__card-erase {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: #991B1B;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 4;
  transition: background 130ms ease, transform 130ms ease;
}
.mvs-vidgen__card-erase:hover {
  background: #DC2626;
  color: #FFFFFF;
  border-color: #DC2626;
  transform: scale(1.05);
}
.mvs-vidgen__card-erase--on-dark {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
}
.mvs-vidgen__card-erase--on-dark:hover {
  background: rgba(220, 38, 38, 0.85);
  color: #FFFFFF;
}

/* Vertical hover toolbar on completed video cards (matches image generator) */
.mvs-vidgen__card-tools {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 6px;
  padding: 5px;
  background: rgba(28, 36, 52, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 180ms ease, transform 180ms cubic-bezier(0.2, 0.7, 0.2, 1);
  z-index: 3;
}
.mvs-vidgen__card:hover .mvs-vidgen__card-tools {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.mvs-vidgen__card-tool {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 130ms ease, color 130ms ease, transform 130ms ease;
}
.mvs-vidgen__card-tool svg {
  width: 14px !important;
  height: 14px !important;
  display: inline-block;
}
.mvs-vidgen__card-tool:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
}
.mvs-vidgen__card-tool:active { transform: scale(0.94); }
.mvs-vidgen__card-tool.is-danger:hover { background: rgba(220, 38, 38, 0.7); }

/* Failed bar — bulk clear pill above the grid */
.mvs-vidgen__failed-bar {
  column-span: all;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 10px;
  margin: 0 0 12px;
  break-inside: avoid;
}
.mvs-vidgen__failed-bar-text {
  font-size: 12.5px;
  color: #991B1B;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.mvs-vidgen__failed-bar-btn {
  background: #DC2626;
  color: #FFFFFF;
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 130ms ease;
}
.mvs-vidgen__failed-bar-btn:hover { background: #991B1B; }
.mvs-vidgen__failed-bar-btn:disabled { background: #94A3B8; cursor: not-allowed; }

.mvs-vidgen__empty {
  column-span: all;
  text-align: center;
  padding: 60px 24px;
  color: #64748B;
}
.mvs-vidgen__empty-icon { font-size: 36px; opacity: 0.5; margin-bottom: 10px; }

/* =====================================================================
   RIGHT: DETAILS SIDEBAR
   ===================================================================== */

/* =====================================================================
   CENTER: INFO BAR (below the big screen) — horizontal layout
   The JS injects .mvs-vidgen__details-* nodes here; we lay them out as a
   horizontal info strip instead of a vertical sidebar.
   ===================================================================== */
.mvs-vidgen__info {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mvs-vidgen__info-empty {
  color: #94A3B8;
  text-align: center;
  font-size: 13px;
  padding: 18px 12px;
}
/* Top row: model chip (left) + action buttons (right) */
.mvs-vidgen__info .mvs-vidgen__details-model {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  background: #F7F9FC;
  border-radius: 999px;
  align-self: flex-start;
}
.mvs-vidgen__details-model-thumb {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3C50E0, #5B6EF0);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  flex-shrink: 0;
}
.mvs-vidgen__details-model-thumb svg { width: 16px; height: 16px; }
.mvs-vidgen__details-model-name {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mvs-vidgen__details-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: #1C2434;
  letter-spacing: -0.01em;
  margin: 0;
}
.mvs-vidgen__details-prompt {
  font-size: 13px;
  color: #475569;
  line-height: 1.55;
  background: #F8FAFC;
  border: 1px solid #EEF2F7;
  border-radius: 10px;
  padding: 10px 12px;
  max-height: 120px;
  overflow-y: auto;
}
.mvs-vidgen__details-refs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.mvs-vidgen__details-refs img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #E2E8F0;
}
/* Badges sit inline as a meta row */
.mvs-vidgen__details-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.mvs-vidgen__details-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.mvs-vidgen__details-date {
  font-size: 11.5px;
  color: #94A3B8;
}
/* Actions become a horizontal row aligned right */
.mvs-vidgen__details-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #F1F5F9;
}
.mvs-vidgen__details-iconbtn {
  width: 38px;
  height: 38px;
  background: #F7F9FC;
  border: 1px solid #E2E8F0;
  border-radius: 9px;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 130ms ease, color 130ms ease, border-color 130ms ease;
}
.mvs-vidgen__details-iconbtn:hover {
  background: #EFF4FB;
  border-color: #3C50E0;
  color: #3C50E0;
}
.mvs-vidgen__details-iconbtn.is-danger:hover {
  background: #FEE2E2;
  border-color: #DC2626;
  color: #DC2626;
}
.mvs-vidgen__details-iconbtn.is-active {
  color: #DC2626;
  background: #FEE2E2;
  border-color: #FCA5A5;
}
.mvs-vidgen__details-iconbtn.is-active svg { fill: currentColor; }
.mvs-vidgen__details-iconbtn svg {
  width: 15px !important;
  height: 15px !important;
}

/* =====================================================================
   RIGHT: VIDEO THUMBNAILS RAIL (vertical column of past videos)
   ===================================================================== */
.mvs-vidgen__rail {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 12px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
.mvs-vidgen__rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 4px;
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */

@media (max-width: 1180px) {
  .mvs-vidgen {
    grid-template-columns: 360px 1fr;
  }
  .mvs-vidgen__rail {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
  }
}
@media (max-width: 860px) {
  .mvs-vidgen {
    grid-template-columns: 1fr;
  }
  .mvs-vidgen__config {
    position: static;
    max-height: none;
  }
}

/* ===================================================================
 * Reference elements library (v1.58.0)
 * =================================================================== */
.mvs-vidgen__refs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.mvs-vidgen__refs.is-required {
  border-color: #C7CEFF;
  box-shadow: 0 0 0 3px rgba(60, 80, 224, 0.06);
}
.mvs-vidgen__refs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mvs-vidgen__refs-count {
  font-size: 11px;
  font-weight: 700;
  color: #94A3B8;
  font-variant-numeric: tabular-nums;
}
.mvs-vidgen__refs-hint {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: #94A3B8;
}
.mvs-vidgen__refs-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.mvs-vidgen__ref-tile,
.mvs-vidgen__ref-add {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #E2E8F0;
  background: #F1F5F9;
  cursor: pointer;
  padding: 0;
}
.mvs-vidgen__ref-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-style: dashed;
  color: #3C50E0;
  font-size: 10px;
  font-weight: 700;
  transition: background .15s, border-color .15s;
}
.mvs-vidgen__ref-add svg { width: 18px; height: 18px; }
.mvs-vidgen__ref-add:hover { background: #EEF1FF; border-color: #C7CEFF; }
.mvs-vidgen__ref-add.is-hidden { display: none; }
.mvs-vidgen__ref-add:disabled { opacity: .4; cursor: default; }
.mvs-vidgen__ref-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.mvs-vidgen__ref-tile.is-uploading .mvs-vidgen__ref-img { filter: blur(1px) brightness(.7); }
.mvs-vidgen__ref-spin {
  position: absolute;
  top: 50%; left: 50%;
  width: 20px; height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: mvs-vg-spin .7s linear infinite;
}
.mvs-vidgen__ref-del {
  position: absolute;
  top: 4px; right: 4px;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 6px;
  background: rgba(16,24,40,.62);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, background .15s;
}
.mvs-vidgen__ref-tile:hover .mvs-vidgen__ref-del { opacity: 1; }
.mvs-vidgen__ref-del:hover { background: #DC2626; }
.mvs-vidgen__ref-del svg { width: 12px; height: 12px; }

/* ===================================================================
 * Audio prompt field (v1.58.0)
 * =================================================================== */
.mvs-vidgen__audio-prompt { margin-top: 4px; }
.mvs-vidgen__input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  font-size: 13px;
  color: #1C2434;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.mvs-vidgen__input:focus {
  outline: none;
  border-color: #3C50E0;
  box-shadow: 0 0 0 3px rgba(60, 80, 224, 0.10);
}
.mvs-vidgen__input::placeholder { color: #94A3B8; }
.mvs-vidgen__field-hint {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.4;
  color: #94A3B8;
}

/* ===================================================================
 * Model dropdown — Recommandé badge (v1.58.0)
 * =================================================================== */
.mvs-vidgen__model-option-reco {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #3C50E0, #6D5BE0);
  vertical-align: middle;
}
.mvs-vidgen__model-option.is-recommended {
  background: #F7F8FF;
}
.mvs-vidgen__model-option.is-recommended:hover {
  background: #EEF1FF;
}

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

/* v1.67.0 — "Choisir dans mes photos" button (reuses the global media picker) */
.mvs-vidgen__ref-gallery {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px;
  padding: 9px 15px; border: 1px solid #E2E8F0; border-radius: 10px;
  background: #fff; color: #3C50E0; font-size: 13px; font-weight: 600;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.mvs-vidgen__ref-gallery svg { width: 16px; height: 16px; }
.mvs-vidgen__ref-gallery:hover { border-color: #3C50E0; background: #EEF1FE; }
