/* Reel overlay preview + export use these bundled faces (see script_quote_renderer). */
@font-face {
  font-family: "MemeStudio-Jost";
  src: url("/bundled-fonts/Jost-VF.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "MemeStudio-Bebas";
  src: url("/bundled-fonts/BebasNeue-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "MemeStudio-Lora";
  src: url("/bundled-fonts/Lora-Italic.ttf") format("truetype");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

/* Meme Studio — soft UI / rounded dashboard feel */
:root {
  --mr-bg: #f4f5f7;
  --mr-surface: #ffffff;
  --mr-purple: #6d28d9;
  --mr-purple-dark: #5b21b6;
  --mr-purple-soft: #ede9fe;
  --mr-accent: #facc15;
  --mr-text: #1a1a1e;
  --mr-text-muted: #6b7280;
  --mr-radius-lg: 28px;
  --mr-radius-md: 20px;
  --mr-radius-pill: 999px;
  --mr-shadow: 0 8px 32px rgba(17, 24, 39, 0.06);
  --mr-shadow-nav: 0 4px 24px rgba(17, 24, 39, 0.05);
  --font-sans: "Plus Jakarta Sans", system-ui, sans-serif;
}

/* —— Dark theme —— */
[data-bs-theme="dark"] {
  --mr-bg: #0f0d1a;
  --mr-surface: #1a1726;
  --mr-purple: #8b5cf6;
  --mr-purple-dark: #a78bfa;
  --mr-purple-soft: #2a2440;
  --mr-accent: #facc15;
  --mr-text: #e8e6f0;
  --mr-text-muted: #a5a0b8;
  --mr-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --mr-shadow-nav: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* Content Studio — Suggest & generate busy panel (readable on light + dark) */
.cs-suggest-busy-panel {
  background: var(--mr-purple-soft);
  color: var(--mr-text);
  border-color: color-mix(in srgb, var(--mr-purple) 45%, transparent) !important;
}
.cs-suggest-busy-panel .text-body,
.cs-suggest-busy-panel #cs-suggest-busy-title {
  color: var(--mr-text) !important;
}
.cs-suggest-busy-panel .text-body-secondary,
.cs-suggest-busy-panel #cs-suggest-busy-detail {
  color: var(--mr-text-muted) !important;
}
.cs-suggest-busy-panel .spinner-border {
  color: var(--mr-purple) !important;
}

[data-bs-theme="dark"] .card {
  background: var(--mr-surface);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .mr-pre,
[data-bs-theme="dark"] .story-module,
[data-bs-theme="dark"] .story-module__head,
[data-bs-theme="dark"] .story-module__subpanel,
[data-bs-theme="dark"] .mr-variant-block,
[data-bs-theme="dark"] .mr-chip,
[data-bs-theme="dark"] .story-stat-chip,
[data-bs-theme="dark"] .results-output-tile,
[data-bs-theme="dark"] .mr-video-assets-list,
[data-bs-theme="dark"] .reels-line-editor__row {
  background: var(--mr-surface) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: var(--mr-text);
}

[data-bs-theme="dark"] .results-output-tile__preview,
[data-bs-theme="dark"] .results-grid-card__thumb-wrap,
[data-bs-theme="dark"] .mr-upload-zone,
[data-bs-theme="dark"] .mr-upload-preview-wrap,
[data-bs-theme="dark"] .mr-placeholder-card,
[data-bs-theme="dark"] .mr-subtle-panel {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: var(--mr-text);
}

[data-bs-theme="dark"] .results-output-tile__preview--audio {
  background: linear-gradient(160deg, #1f2937 0%, #0b1220 100%) !important;
}

[data-bs-theme="dark"] .site-footer {
  background: var(--mr-surface);
  border-top-color: rgba(255, 255, 255, 0.08);
}

body {
  font-family: var(--font-sans);
  background: var(--mr-bg) !important;
  color: var(--mr-text);
  -webkit-font-smoothing: antialiased;
}

.app-nav {
  background: #16123a;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.22);
  padding: 0.65rem 0;
}

.app-nav .navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff !important;
  letter-spacing: -0.02em;
}

.app-nav__logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--mr-purple) 0%, var(--mr-purple-dark) 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.45);
}

.app-nav .nav-link {
  color: rgba(255, 255, 255, 0.72) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.45rem 1rem !important;
  border-radius: var(--mr-radius-pill);
  transition: background 0.15s, color 0.15s;
}

.app-nav .nav-link:hover,
.app-nav .nav-link:focus {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1);
}

.app-nav .nav-link.text-dark {
  color: #fff !important;
}

.app-nav__credits {
  font-size: 0.8rem !important;
  background: rgba(255, 255, 255, 0.12);
  color: #fff !important;
  font-weight: 600;
  margin-right: 0.25rem;
}

.app-nav__credits:empty {
  display: none !important;
}

.app-nav__jobs-activity {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9) !important;
  max-width: 16rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.35rem 0.65rem;
  border-radius: var(--mr-radius-pill);
  background: rgba(250, 204, 21, 0.2);
  border: 1px solid rgba(250, 204, 21, 0.35);
}

.app-nav__admin {
  font-weight: 600 !important;
  border: 1px solid rgba(250, 204, 21, 0.55) !important;
  color: #fde68a !important;
}

.app-nav__admin:hover,
.app-nav__admin:focus {
  color: #fff !important;
  background: rgba(250, 204, 21, 0.18) !important;
  border-color: rgba(250, 204, 21, 0.85) !important;
}

/* Admin: sidebar submenu */
.admin-submenu .nav-link {
  border-radius: 10px;
  color: var(--mr-text-muted);
  font-weight: 500;
  padding: 0.5rem 0.85rem;
}

.admin-submenu .nav-link:hover {
  background: rgba(109, 40, 217, 0.08);
  color: var(--mr-purple-dark);
}

.admin-submenu .nav-link.active {
  background: var(--mr-purple) !important;
  color: #fff !important;
}

.app-main {
  padding-top: 1.75rem;
  padding-bottom: 3rem;
}

/* Wide workspace for creation flows (incl. Reels). */
.app-main--wide {
  max-width: 1680px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 1200px) {
  .app-main--wide {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* Landing: full-width sections */
.page-landing .app-main {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
}

.landing-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

@media (min-width: 768px) {
  .landing-wrap {
    padding: 0 2rem 4rem;
  }
}

.landing-hero {
  position: relative;
  border-radius: var(--mr-radius-lg);
  background: linear-gradient(135deg, var(--mr-purple) 0%, #8b5cf6 48%, var(--mr-purple-dark) 100%);
  color: #fff;
  padding: 2.5rem 2rem;
  margin: 1.5rem 0 2.5rem;
  box-shadow: 0 16px 48px rgba(109, 40, 217, 0.28);
  overflow: hidden;
}

@media (min-width: 768px) {
  .landing-hero {
    padding: 3rem 3.25rem;
    margin: 2rem 0 3rem;
  }
}

.landing-hero::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -60px;
  top: -80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.landing-hero__title {
  font-weight: 800;
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 1;
}

.landing-hero__lead {
  font-size: 1.05rem;
  opacity: 0.95;
  max-width: 32rem;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.landing-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  color: var(--mr-purple-dark) !important;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: var(--mr-radius-pill);
  border: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  z-index: 1;
}

.landing-hero__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
  color: var(--mr-purple) !important;
}

.landing-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.35rem;
  position: relative;
  z-index: 1;
}

.landing-tag {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: var(--mr-radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
}

.landing-section-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  color: var(--mr-text);
}

.landing-cards {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .landing-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

.landing-card {
  background: var(--mr-surface);
  border-radius: var(--mr-radius-md);
  box-shadow: var(--mr-shadow);
  padding: 1.5rem 1.35rem;
  border: 1px solid rgba(17, 24, 39, 0.04);
  height: 100%;
  transition: transform 0.2s, box-shadow 0.2s;
}

.landing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(17, 24, 39, 0.09);
}

.landing-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--mr-text);
}

.landing-card__icon--upload {
  background: #fef3c7;
  color: #b45309;
}
.landing-card__icon--preset {
  background: var(--mr-purple-soft);
  color: var(--mr-purple-dark);
}
.landing-card__icon--export {
  background: #d1fae5;
  color: #047857;
}

.landing-card__title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.landing-card__text {
  color: var(--mr-text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0;
}

.landing-card__badge {
  display: inline-block;
  margin-top: 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.6rem;
  border-radius: var(--mr-radius-pill);
  background: #fee2e2;
  color: #b91c1c;
}

.landing-footnote {
  text-align: center;
  color: var(--mr-text-muted);
  font-size: 0.9rem;
  margin-top: 2rem;
}

/* —— App pages: results + create —— */
.page-results .btn-primary,
.page-create .btn-primary,
.page-workflows .btn-primary {
  --bs-btn-bg: var(--mr-purple);
  --bs-btn-border-color: var(--mr-purple);
  --bs-btn-hover-bg: var(--mr-purple-dark);
  --bs-btn-hover-border-color: var(--mr-purple-dark);
  --bs-btn-active-bg: var(--mr-purple-dark);
  --bs-btn-active-border-color: var(--mr-purple-dark);
  --bs-btn-focus-shadow-rgb: 109, 40, 217;
}

/* Outline buttons on the app pages pick up the brand purple too — the raw
   bootstrap-blue outline reads as a foreign element, worst on the dark shell. */
.page-results .btn-outline-primary,
.page-create .btn-outline-primary,
.page-workflows .btn-outline-primary {
  --bs-btn-color: var(--mr-purple);
  --bs-btn-border-color: color-mix(in srgb, var(--mr-purple) 55%, transparent);
  --bs-btn-hover-bg: var(--mr-purple);
  --bs-btn-hover-border-color: var(--mr-purple);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--mr-purple);
  --bs-btn-active-border-color: var(--mr-purple);
  --bs-btn-active-color: #fff;
  --bs-btn-focus-shadow-rgb: 109, 40, 217;
}

/* Segmented pill toggles (Single/Bulk, AI writes/Paste, box kind, test kind).
   These are .btn-check radio groups; unstyled they rendered as bootstrap-blue
   outline buttons that clashed with the purple shell. A soft track with a
   filled purple thumb matches the rest of the surface in both themes. */
.mr-mode-toggle {
  background: var(--mr-purple-soft);
  border-radius: var(--mr-radius-pill);
  padding: 0.25rem;
  gap: 0.25rem;
}
.mr-mode-toggle > .btn {
  color: var(--mr-text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--mr-radius-pill) !important;
  font-weight: 600;
  padding-inline: 0.9rem;
  margin-left: 0 !important;
}
.mr-mode-toggle > .btn:hover {
  color: var(--mr-text);
  background: color-mix(in srgb, var(--mr-purple) 14%, transparent);
}
.mr-mode-toggle > .btn:focus-visible {
  box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--mr-purple) 30%, transparent);
}
.mr-mode-toggle > .btn-check:checked + .btn {
  color: #fff;
  background: var(--mr-purple);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--mr-purple) 40%, transparent);
}

/* Bulk download selection box on results cards (shown in select mode only). */
.results-grid-card {
  position: relative;
}
.results-select-box {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 5;
  margin: 0;
  padding: 0.3rem 0.45rem;
  background: var(--mr-surface);
  border-radius: 12px;
  box-shadow: var(--mr-shadow);
  cursor: pointer;
}
.results-select-box .form-check-input {
  margin: 0;
  width: 1.15rem;
  height: 1.15rem;
  cursor: pointer;
}

.page-results .btn.rounded-pill,
.page-results .rounded-pill,
.page-create .btn.rounded-pill,
.page-create .rounded-pill {
  padding-left: 1rem;
  padding-right: 1rem;
}

.mr-page-head {
  margin-bottom: 1.75rem;
}

.mr-page-title {
  font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  letter-spacing: -0.03em;
  color: var(--mr-text);
  margin-bottom: 0.35rem;
}

.mr-page-lead {
  color: var(--mr-text-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
  max-width: 40rem;
}

.page-results .card,
.page-create .card {
  border: none;
  border-radius: var(--mr-radius-md);
  box-shadow: var(--mr-shadow);
  background: var(--mr-surface);
  border: 1px solid rgba(17, 24, 39, 0.05);
  overflow: hidden;
}

/* Sticky caption preview needs a non-clipping ancestor */
.page-create #section-nostalgic.card {
  overflow: visible;
}

.page-results .card .card-title,
.page-results .card h6,
.page-create .card .card-title,
.page-create .card h6 {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--mr-text);
}

.page-results .card-body,
.page-create .card-body {
  padding: 1.25rem 1.35rem;
}

.results-grid-card__thumb-wrap {
  background: linear-gradient(180deg, #fafafa 0%, #f0f1f4 100%);
  min-height: 168px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  border-bottom: 1px solid rgba(17, 24, 39, 0.06);
}

.results-grid-card__thumb {
  max-width: 100%;
  max-height: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
}

.results-grid-card__meta {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mr-text-muted);
  margin-bottom: 0.5rem;
}

.results-grid-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.results-grid-card__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.results-grid-card__top .results-grid-card__meta {
  margin-bottom: 0;
}

.results-grid-card__models {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  margin: 0.15rem 0 0.35rem 0;
}

.results-model-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(17, 24, 39, 0.10);
  background: var(--bs-tertiary-bg, #f8f9fa);
  max-width: 100%;
}

.results-model-chip__label {
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mr-text-muted);
}

.results-model-chip > span.js-job-model-image,
.results-model-chip > span.js-job-model-video {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--mr-text, #111827);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 11rem;
}

.mr-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.65rem;
  border-radius: var(--mr-radius-pill);
}

.mr-badge--ok {
  background: #d1fae5;
  color: #047857;
}

.mr-badge--bad {
  background: #fee2e2;
  color: #b91c1c;
}

.mr-badge--run {
  background: #fef3c7;
  color: #b45309;
}

.mr-badge--wait {
  background: #e5e7eb;
  color: #4b5563;
}

.mr-badge--muted {
  background: var(--mr-purple-soft);
  color: var(--mr-purple-dark);
}

.mr-pre {
  background: #f9fafb !important;
  border: 1px solid rgba(17, 24, 39, 0.08) !important;
  border-radius: 14px !important;
  padding: 0.85rem 1rem !important;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--mr-text);
}

.results-meme-img {
  width: auto;
  max-width: 100%;
  max-height: 140px;
  height: auto;
  object-fit: contain;
}

.page-results .mr-page-head--compact {
  margin-bottom: 1rem;
}

.page-results .mr-page-head--compact .mr-page-lead {
  font-size: 0.9rem;
}

.results-bulk-download {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.results-bulk-download__label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mr-text-muted);
  margin-right: 0.15rem;
}

.results-prompt-details {
  border: none;
  box-shadow: var(--mr-shadow);
  background: var(--mr-surface);
  border: 1px solid rgba(17, 24, 39, 0.05);
  border-radius: var(--mr-radius-md);
  overflow: hidden;
}

.results-prompt-details__summary {
  cursor: pointer;
  list-style: none;
}

.results-prompt-details__summary::-webkit-details-marker {
  display: none;
}

.results-prompt-details__pre {
  white-space: pre-wrap;
  max-height: 12rem;
  overflow: auto;
  font-size: 0.92rem;
  line-height: 1.6;
}

.ai-prompt-log__item {
  position: relative;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.6rem;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.5rem;
  background: var(--bs-tertiary-bg, #f8f9fa);
}

.ai-prompt-log__item:last-child {
  margin-bottom: 0;
}

.ai-prompt-log__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
  padding-right: 3.5rem;
}

.ai-prompt-log__op {
  font-weight: 600;
}

.ai-prompt-log__prompt,
.ai-prompt-log__system {
  white-space: pre-wrap;
  max-height: 16rem;
  overflow: auto;
  margin-bottom: 0;
}

.ai-prompt-log__system {
  color: var(--bs-secondary-color, #6c757d);
  font-style: italic;
}

.ai-prompt-log__copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.results-output-sections {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.results-output-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}

.results-output-nav__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: #fff;
  color: var(--mr-text, #111827);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
}

.results-output-nav__chip:hover,
.results-output-nav__chip:focus-visible {
  border-color: rgba(17, 24, 39, 0.28);
  color: var(--mr-text, #111827);
}

.results-output-nav__chip--image {
  border-color: rgba(14, 165, 233, 0.35);
  background: rgba(14, 165, 233, 0.08);
}

.results-output-nav__chip--video {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.08);
}

.results-output-nav__chip--audio {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.1);
}

[data-bs-theme="dark"] .results-output-nav__chip {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--mr-text);
}

.results-output-section {
  padding: 0.85rem 0.9rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(255, 255, 255, 0.55);
  scroll-margin-top: 5rem;
}

.results-output-section--images,
.results-output-section--image {
  border-left: 3px solid #0ea5e9;
}

.results-output-section--videos,
.results-output-section--video {
  border-left: 3px solid #6366f1;
}

.results-output-section--voice,
.results-output-section--audio {
  border-left: 3px solid #f59e0b;
}

.results-output-section--original {
  border-left: 3px solid #94a3b8;
}

/* The finished reel leads the page, so it gets one tall tile instead of sitting
   in the thumbnail row with the scene clips. The extra selector outranks the
   dark-theme border-color reset below. */
.results-output-sections .results-output-section[data-section="final"] {
  border-left: 4px solid #6366f1;
  background: rgba(99, 102, 241, 0.07);
}

[data-bs-theme="dark"] .results-output-sections .results-output-section[data-section="final"] {
  background: rgba(99, 102, 241, 0.14);
}

.results-output-section[data-section="final"]
  .results-output-grid:not(.results-output-grid--list) {
  grid-template-columns: minmax(0, 220px);
}

/* Let the 9/16 aspect ratio set the height instead of the thumbnail cap. */
.results-output-section[data-section="final"]
  .results-output-grid:not(.results-output-grid--list)
  .results-output-tile__preview {
  max-height: none;
}

/* One column on phones, where a fixed 220px hero would end up narrower than the
   full-width clip tiles under it. Cap the height so it doesn't eat the screen. */
@media (max-width: 575.98px) {
  .results-output-section[data-section="final"]
    .results-output-grid:not(.results-output-grid--list) {
    grid-template-columns: minmax(0, 1fr);
  }

  .results-output-section[data-section="final"]
    .results-output-grid:not(.results-output-grid--list)
    .results-output-tile__preview {
    max-height: 340px;
  }
}

[data-bs-theme="dark"] .results-output-section {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.results-output-section__head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}

.results-output-section__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--mr-text, #111827);
}

.results-output-section__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--mr-text-muted, #6b7280);
  background: rgba(17, 24, 39, 0.06);
}

[data-bs-theme="dark"] .results-output-section__count {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}

.results-output-section__lead {
  margin: 0 0 0.7rem;
  font-size: 0.78rem;
  color: var(--mr-text-muted, #6b7280);
}

.results-output-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.65rem;
}

.results-output-grid--video {
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}

.results-output-grid--audio {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.results-output-tile {
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 12px;
  background: #fff;
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.results-output-tile--audio {
  min-height: 100%;
}

.results-output-tile__head {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--mr-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.results-output-tile__preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  background: #f8fafc;
  border-radius: 8px;
  padding: 0.25rem;
  overflow: hidden;
}

.results-output-tile__preview--image,
.results-output-tile__preview--video {
  aspect-ratio: 9 / 16;
  min-height: 0;
  max-height: 220px;
}

.results-output-tile__preview--audio {
  aspect-ratio: auto;
  min-height: 72px;
  padding: 0.75rem 0.65rem;
  background: linear-gradient(160deg, #1f2937 0%, #111827 100%);
}

.results-output-tile__preview--audio audio {
  width: 100%;
  filter: none;
}

.results-output-tile__preview img,
.results-output-tile__preview video,
.results-output-tile__preview .results-meme-img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

.results-output-tile__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.results-output-tile__actions .btn {
  font-size: 0.68rem;
  padding: 0.15rem 0.55rem;
  transition: transform 90ms ease, background-color 150ms ease, color 150ms ease;
}

/* The click has to register even when the download itself is instant. */
.results-output-tile__actions .btn:active {
  transform: scale(0.93);
}

.results-output-tile__actions .btn.is-working {
  animation: mr-btn-pulse 900ms ease-in-out infinite;
}

@keyframes mr-btn-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.62; }
}

@media (prefers-reduced-motion: reduce) {
  .results-output-tile__actions .btn,
  .results-output-tile__actions .btn.is-working {
    transition: none;
    animation: none;
  }

  .results-output-tile__actions .btn:active {
    transform: none;
  }
}

/* A tile whose bytes are gone: say so instead of showing an empty frame. */
.results-output-tile__preview-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  border: 1px dashed rgba(220, 53, 69, 0.5);
  border-radius: 8px;
  background: rgba(220, 53, 69, 0.06);
}

.results-output-tile__details summary {
  cursor: pointer;
  color: var(--mr-text-muted);
  font-weight: 600;
}

.results-output-tile__details pre {
  max-height: 5rem;
  overflow: auto;
  white-space: pre-wrap;
  margin-top: 0.25rem;
}

.results-view-toggle {
  gap: 0.35rem;
}

.results-view-toggle .btn {
  margin-left: 0;
}

.results-view-toggle .btn.active {
  background: var(--mr-text, #111827);
  border-color: var(--mr-text, #111827);
  color: var(--mr-surface, #fff);
}

.results-output-grid--list {
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.results-output-grid--list.results-output-grid--audio {
  grid-template-columns: 1fr;
}

.results-output-grid--list .results-output-tile {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  grid-template-areas:
    "preview head"
    "preview actions"
    "details details";
  align-items: center;
  column-gap: 0.85rem;
  row-gap: 0.35rem;
}

.results-output-grid--list .results-output-tile--audio {
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
}

.results-output-grid--list .results-output-tile__preview {
  grid-area: preview;
  min-height: 84px;
  max-height: 140px;
  aspect-ratio: auto;
  align-self: stretch;
}

.results-output-grid--list .results-output-tile__head {
  grid-area: head;
  align-self: end;
  white-space: normal;
}

.results-output-grid--list .results-output-tile__actions {
  grid-area: actions;
  align-self: start;
}

.results-output-grid--list .results-output-tile__details {
  grid-area: details;
}

@media (max-width: 575.98px) {
  .results-output-grid--list .results-output-tile,
  .results-output-grid--list .results-output-tile--audio {
    grid-template-columns: 110px minmax(0, 1fr);
  }
}

.page-results .card-body.py-3 {
  padding-top: 0.85rem !important;
  padding-bottom: 0.85rem !important;
}

.page-results .mr-footer-links {
  margin-top: 1.25rem;
  padding-top: 0.85rem;
}

.results-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.08);
}

.results-progress-bar .progress-bar {
  border-radius: 999px;
}

.results-progress-log {
  max-height: 120px;
  overflow: auto;
}

.story-caption-preview-wrap {
  display: flex;
  justify-content: flex-start;
}

.story-caption-preview-frame {
  position: relative;
  width: min(300px, 100%);
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  background: linear-gradient(165deg, #1f2937 0%, #111827 55%, #374151 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

/* Slide-text scrim: the dark band slide_cards burns behind the words so they stay
   readable over moving AI footage. Absolutely positioned so it never joins the
   frame's flex layout; slide_preview.js paints the gradient. */
.mr-slide-scrim {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

/* Background-dim scrim burned under the captions; sits below the sample text. */
.story-caption-preview-dim {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.story-caption-preview-sample {
  position: absolute;
  left: 8%;
  right: 8%;
  text-align: center;
  color: #fff;
  font-size: clamp(0.68rem, 2.4vw, 0.88rem);
  font-weight: 700;
  line-height: 1.25;
  pointer-events: none;
}

.story-caption-preview-frame[data-position="bottom"] .story-caption-preview-sample {
  bottom: 10%;
}

.story-caption-preview-frame[data-position="top"] .story-caption-preview-sample {
  top: 10%;
}

.story-caption-preview-frame[data-position="center"] .story-caption-preview-sample {
  top: 50%;
  transform: translateY(-50%);
}

.page-results .story-phase-pill,
.page-create .story-phase-pill {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Storytelling reel — modular settings flow */
.story-reel-panel {
  padding-top: 1.25rem;
}

.story-reel-flow-hint__pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--mr-purple-dark);
  background: var(--mr-purple-soft);
  border: 1px solid rgba(109, 40, 217, 0.15);
  border-radius: var(--mr-radius-pill);
  padding: 0.35rem 0.75rem;
}

.story-reel-flow-hint__pill--accent {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}

.story-module {
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 16px;
  background: #fff;
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

.story-module--content {
  border-color: rgba(180, 83, 9, 0.22);
  background: linear-gradient(180deg, #fffbeb 0%, #fff 2.5rem);
}

.story-module--voice {
  border-left: 3px solid rgba(109, 40, 217, 0.35);
}

.story-module--music {
  border-left: 3px solid rgba(14, 165, 233, 0.45);
}

.story-module--captions {
  border-left: 3px solid rgba(16, 185, 129, 0.4);
}

.story-module--disabled .story-module__body {
  opacity: 0.45;
  pointer-events: none;
}

.story-module__head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.15rem 0.85rem;
  border-bottom: 1px solid rgba(17, 24, 39, 0.06);
  background: rgba(248, 250, 252, 0.85);
}

.story-module__step {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  background: var(--mr-purple);
  box-shadow: 0 2px 6px rgba(109, 40, 217, 0.25);
}

.story-module__step--accent {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
}

.story-module__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.15rem;
  line-height: 1.3;
}

.story-module__lead {
  font-size: 0.8125rem;
  color: var(--mr-text-muted);
  margin: 0;
  line-height: 1.45;
}

.story-module__body {
  padding: 1rem 1.15rem 1.15rem;
}

.story-module__subpanel {
  border: 1px dashed rgba(17, 24, 39, 0.12);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.65);
  padding: 0.85rem 1rem;
}

.story-module__subpanel-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mr-text-muted);
  margin-bottom: 0.35rem;
}

.story-module__details {
  border-top: 1px solid rgba(17, 24, 39, 0.06);
  padding-top: 0.75rem;
}

.story-module__details-summary {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--mr-purple-dark);
  cursor: pointer;
  user-select: none;
}

.story-stat-chip {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--mr-text);
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.9);
  padding: 0.55rem 0.75rem;
  min-height: 2.375rem;
  display: flex;
  align-items: center;
}

.story-cost-banner {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--mr-purple-dark);
  background: var(--mr-purple-soft);
  border: 1px solid rgba(109, 40, 217, 0.15);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  min-height: 0;
}

.story-cost-banner:empty {
  display: none;
}

.story-reel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 2px solid var(--mr-purple-soft);
}

.story-scene-upload-tile img {
  display: block;
}

.story-scene-upload-tile .story-scene-remove {
  line-height: 1;
  padding: 0.1rem 0.45rem;
}

.story-caption-preview-wrap--module {
  justify-content: center;
}

@media (min-width: 992px) {
  .story-caption-preview-wrap--module {
    justify-content: flex-end;
  }
}

/* Nostalgic Stories — split studio layout */
.page-create .nostalgic-studio-layout {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

@media (min-width: 992px) {
  .page-create .nostalgic-studio-layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr);
  }
}

.page-create .nostalgic-studio-main {
  min-width: 0;
}

/* Nostalgic setup — 2×2 grid: voice | models, start | music+captions */
.page-create .nostalgic-setup-grid {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  grid-template-columns: 1fr;
  grid-template-areas:
    "voice"
    "models"
    "start"
    "finish";
}

@media (min-width: 768px) {
  .page-create .nostalgic-setup-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "voice models"
      "start finish";
    align-items: stretch;
  }

  .page-create .nostalgic-setup-grid--no-models {
    grid-template-areas:
      "voice finish"
      "start finish";
  }
}

.page-create #nostalgic-voice-section { grid-area: voice; }
.page-create #nostalgic-models-section { grid-area: models; }
.page-create #nostalgic-start-section { grid-area: start; }
.page-create #nostalgic-finish-section { grid-area: finish; }

.page-create #story-voice-section { grid-area: voice; }
.page-create #story-models-section { grid-area: models; }
.page-create #story-timeline-section { grid-area: start; }
.page-create #story-finish-section { grid-area: finish; }

.page-create #reels-lines-section-body .form-control,
.page-create #reels-lines-section-body .form-select {
  font-size: 0.875rem;
}

.page-create #reels-lines-section-body textarea.form-control {
  min-height: 5.5rem;
}

.page-create #reels-start-actions .btn-lg {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.page-create #reels-voice-section { grid-area: voice; }
.page-create #reels-videos-section { grid-area: models; }
.page-create #reels-music-section { grid-area: start; }
.page-create #reels-style-section { grid-area: finish; }

.page-create #story-finish-section .story-module__body,
.page-create #reels-style-section .story-module__body {
  overflow-y: auto;
  max-height: min(42vh, 420px);
}

@media (min-width: 768px) {
  .page-create #story-finish-section .story-module__body,
  .page-create #reels-style-section .story-module__body {
    max-height: none;
    overflow-y: visible;
  }
}

.page-create .nostalgic-storyboard-panel {
  margin-bottom: 0.75rem;
}

.page-create .nostalgic-storyboard-panel .nostalgic-scenes-scroll {
  max-height: min(58vh, 640px);
}

@media (min-width: 1200px) {
  .page-create .nostalgic-storyboard-panel .nostalgic-scenes-scroll {
    max-height: min(62vh, 720px);
  }
}

.page-create .nostalgic-setup-grid__cell {
  min-width: 0;
  margin-bottom: 0;
}

.page-create .nostalgic-setup-grid__cell.story-module {
  height: 100%;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.page-create .nostalgic-setup-grid__cell .story-module__body {
  flex: 1 1 auto;
  min-height: 0;
}

.page-create #nostalgic-finish-section .story-module__body {
  overflow-y: auto;
  max-height: min(42vh, 420px);
}

@media (min-width: 768px) {
  .page-create #nostalgic-finish-section .story-module__body {
    max-height: none;
    overflow-y: visible;
  }
}

.page-create .nostalgic-studio-preview {
  min-width: 0;
}

@media (min-width: 992px) {
  .page-create .nostalgic-studio-preview {
    position: sticky;
    top: 5rem;
    align-self: start;
    z-index: 8;
    min-height: 0;
    max-height: calc(100vh - 6rem);
  }
}

.page-create .story-caption-preview-wrap--studio {
  justify-content: center;
}

.page-create .nostalgic-studio-preview .story-caption-preview-frame {
  width: min(420px, 100%);
  margin-left: auto;
  margin-right: auto;
}

/* Large (double-size) preview toggle — widen the aside column so the doubled
   frame is actually visible instead of being clamped by the grid track. */
.page-create .nostalgic-studio-preview .story-caption-preview-frame.is-large {
  width: min(840px, 100%);
}

@media (min-width: 992px) {
  .page-create .nostalgic-studio-layout:has(.story-caption-preview-frame.is-large) {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 900px);
  }
}

.page-create .story-module--compact {
  margin-bottom: 0.75rem;
}

.page-create .story-module--compact .story-module__head {
  padding: 0.65rem 0.85rem 0.55rem;
}

.page-create .story-module--compact .story-module__body {
  padding: 0.65rem 0.85rem 0.85rem;
}

.page-create .story-module--compact .story-module__step {
  width: 1.65rem;
  height: 1.65rem;
  font-size: 0.75rem;
}

.page-create .nostalgic-scenes-scroll {
  max-height: 45vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.page-create .nostalgic-scenes-scroll .card {
  margin-bottom: 0.65rem;
}

.page-create .nostalgic-scenes-scroll .card-body {
  padding: 0.65rem 0.75rem;
}

@media (max-width: 991.98px) {
  .page-create .nostalgic-studio-preview {
    order: -1;
    margin-bottom: 0.5rem;
  }

  .page-create .nostalgic-studio-preview .story-caption-preview-frame {
    width: min(320px, 100%);
  }

  .page-create .nostalgic-studio-preview .story-caption-preview-frame.is-large {
    width: min(640px, 100%);
  }
}

.mr-job-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.mr-job-meta__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mr-text-muted);
  margin-right: 0.25rem;
}

.page-results #job-model-image,
.page-results #job-model-video {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--mr-radius-pill);
  background: var(--bs-tertiary-bg, #f8f9fa);
  border: 1px solid rgba(17, 24, 39, 0.08);
  font-weight: 800;
  max-width: 22rem;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: baseline;
}

.mr-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
  font-size: 0.9rem;
}

.mr-footer-links a {
  color: var(--mr-purple-dark);
  font-weight: 600;
  text-decoration: none;
  padding: 0.35rem 0.85rem;
  border-radius: var(--mr-radius-pill);
  transition: background 0.15s;
}

.mr-footer-links a:hover {
  background: var(--mr-purple-soft);
  color: var(--mr-purple);
}

.mr-footer-links .text-danger,
.mr-footer-links a.text-danger {
  color: #dc2626 !important;
}

.mr-footer-links .text-danger:hover,
.mr-footer-links a.text-danger:hover {
  background: #fef2f2;
  color: #b91c1c !important;
}

.mr-footer-links .mx-1 {
  color: var(--mr-text-muted);
  user-select: none;
  padding: 0 0.15rem;
}

.results-empty {
  background: var(--mr-surface);
  border-radius: var(--mr-radius-md);
  box-shadow: var(--mr-shadow);
  border: 1px solid rgba(17, 24, 39, 0.05);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--mr-text-muted);
}

.results-empty a {
  font-weight: 600;
  color: var(--mr-purple-dark);
}

/* —— Create flow —— */
.page-create .text-primary {
  color: var(--mr-purple-dark) !important;
}

/* Reels (video overlay) — same studio split as Nostalgic: 2×2 grid + sticky preview */
.page-create .video-overlay-layout.nostalgic-studio-layout {
  align-items: start;
}

.page-create .video-overlay-preview-stage {
  width: 100%;
  max-width: min(420px, 100%);
  margin-left: auto;
  margin-right: auto;
  aspect-ratio: 9 / 16;
}

.page-create .video-overlay-preview-card {
  min-width: 0;
}

@media (min-width: 992px) {
  .page-create .video-overlay-layout__preview-col {
    position: sticky;
    top: 5rem;
    align-self: start;
    z-index: 8;
    min-height: 0;
    max-height: calc(100vh - 6rem);
  }

  .page-create .video-overlay-layout--reels-editing .reels-preview-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
  }

  .page-create .video-overlay-layout--reels-editing .reels-preview-split__stage {
    position: sticky;
    top: 5rem;
    align-self: start;
  }

  .page-create .video-overlay-layout--reels-editing .video-overlay-preview-stage {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: min(72vh, 720px);
    margin-left: 0;
    margin-right: 0;
  }

  .page-create .video-overlay-layout--reels-mode:not(.video-overlay-layout--reels-editing) .video-overlay-preview-stage {
    max-width: 100%;
    height: auto;
    max-height: min(72vh, 720px);
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 991.98px) {
  .page-create .video-overlay-layout__preview-col {
    order: -1;
    margin-bottom: 0.5rem;
  }

  .page-create .video-overlay-layout--reels-editing .reels-preview-split {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .page-create .video-overlay-layout--reels-editing .video-overlay-preview-stage,
  .page-create .video-overlay-layout--reels-mode:not(.video-overlay-layout--reels-editing) .video-overlay-preview-stage {
    max-width: min(320px, 100%);
    margin-left: auto;
    margin-right: auto;
  }
}

.page-create #story-final-video {
  max-height: min(72vh, 640px);
  aspect-ratio: 9 / 16;
  object-fit: contain;
  background: #000;
}

.page-create .reels-preview-split__editor {
  min-height: 0;
  min-width: 0;
}

.page-create .video-overlay-preview-card #video-overlay-preview-stage {
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.12);
}

/* Script quote image batch — live preview panel */
.page-create #section-batch.batch-image-wide .card-body {
  padding: 1.5rem 1.75rem;
}

.page-create .batch-image-layout {
  max-width: none;
}

.page-create .batch-image-section {
  padding-top: 0.25rem;
}

.page-create .batch-image-section__title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(17, 24, 39, 0.55);
  margin-bottom: 0.85rem;
}

.page-create .batch-paste-area {
  min-height: 12rem;
  font-size: 0.95rem;
  line-height: 1.45;
}

.page-create .batch-preview-scroll {
  max-height: 320px;
  overflow: auto;
}

.page-create #batch-setup-row .card {
  height: 100%;
}

.page-create .batch-setup-row--solo > .col-md-6:first-child {
  flex: 0 0 100%;
  max-width: 100%;
}

.page-create #batch-setup-row .mr-upload-zone .form-control {
  min-height: 2.75rem;
}

.page-create .batch-image-start {
  border-top: 1px solid rgba(17, 24, 39, 0.08);
  padding-top: 1.25rem;
  margin-top: 0.5rem;
}

.page-create .script-quote-studio-layout {
  margin-top: 0.25rem;
}

.page-create .script-quote-preview-card {
  border-color: rgba(17, 24, 39, 0.12);
}

.page-create .script-quote-preview-wrap {
  max-width: min(100%, 340px);
}

.page-create .script-quote-preview-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #111;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.12);
}

.page-create .script-quote-preview-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
  transition: opacity 0.15s ease;
}

.page-create .script-quote-preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  z-index: 0;
}

.page-create .script-quote-preview-safe-zone {
  position: absolute;
  pointer-events: none;
  z-index: 2;
  background: repeating-linear-gradient(
    -45deg,
    rgba(255, 193, 7, 0.12),
    rgba(255, 193, 7, 0.12) 6px,
    rgba(255, 193, 7, 0.22) 6px,
    rgba(255, 193, 7, 0.22) 12px
  );
  border: 1px dashed rgba(255, 193, 7, 0.55);
}

.page-create .script-quote-preview-safe-zone--left {
  top: 0;
  left: 0;
  bottom: 0;
}

.page-create .script-quote-preview-safe-zone--right {
  top: 0;
  right: 0;
  bottom: 0;
}

.page-create .script-quote-preview-safe-zone--bottom {
  left: 0;
  right: 0;
  bottom: 0;
}

/* Reels: make the video upload/list area visually wider and boxed, similar to
   the other panels in the create flow. */
.page-create #section-batch .card-body {
  padding: 1.35rem 1.45rem;
}

.page-create .mr-video-assets-list {
  width: 100%;
  min-height: 120px;
  max-height: 340px;
  overflow: auto;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.65);
  padding: 0.6rem 0.7rem;
}

.page-create .reels-line-editor {
  max-height: min(82vh, 760px);
  overflow-y: auto;
  padding-right: 0.25rem;
}

.page-create .reels-line-editor__row {
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.65rem;
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.page-create .reels-line-editor__row--active {
  border-color: var(--mr-purple, #7c3aed);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
}

.page-create .reels-line-editor__row textarea {
  cursor: text;
}

.mr-panel-header {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mr-purple-dark);
  margin: -0.15rem 0 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--mr-purple-soft);
}

.mr-panel-header--accent {
  color: #b45309;
  border-bottom-color: #fde68a;
}

.page-create .form-control,
.page-create .form-select {
  border-radius: 12px;
  border-color: rgba(17, 24, 39, 0.1);
}

.page-create .form-control:focus,
.page-create .form-select:focus {
  border-color: var(--mr-purple);
  box-shadow: 0 0 0 0.2rem rgba(109, 40, 217, 0.12);
}

.page-create .form-select-lg {
  border-radius: 14px;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.mr-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.page-create .mr-chip {
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--mr-radius-pill);
  padding: 0.4rem 0.85rem;
  border: 1px solid rgba(17, 24, 39, 0.1);
  background: #f9fafb;
  color: var(--mr-text);
  line-height: 1.3;
}

/* Create flow: mode picker */
.mr-flow-pick .mr-flow-option {
  display: block;
  border: 2px solid #e5e7eb;
  border-radius: var(--mr-radius-md);
  padding: 1rem 1.25rem;
  cursor: pointer;
  height: 100%;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  margin-bottom: 0;
}
.mr-flow-pick .mr-flow-option:hover {
  border-color: #d1d5db;
}
.mr-flow-pick .mr-flow-option:has(input:checked) {
  border-color: var(--mr-purple);
  background: var(--mr-purple-soft);
  box-shadow: 0 0 0 1px rgba(109, 40, 217, 0.12);
}
.mr-flow-pick .mr-flow-option input {
  margin-top: 0.35rem;
}

.page-create .mr-chip:hover {
  background: var(--mr-purple-soft);
  border-color: rgba(109, 40, 217, 0.25);
  color: var(--mr-purple-dark);
}

.mr-upload-zone {
  background: linear-gradient(180deg, #fafafa 0%, #f4f5f7 100%);
  border: 2px dashed rgba(109, 40, 217, 0.22);
  border-radius: 16px;
  padding: 1rem;
}

.mr-upload-preview-wrap {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  text-align: center;
}

.mr-upload-preview-wrap img {
  max-height: 280px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.mr-placeholder-card {
  border: 2px dashed rgba(17, 24, 39, 0.1) !important;
  background: linear-gradient(165deg, #fafbfc 0%, #f0f1f4 100%) !important;
  box-shadow: none !important;
}

.mr-placeholder-card .card-body {
  padding: 2.5rem 1.5rem;
}

.mr-variant-block {
  background: #f9fafb !important;
  border: 1px solid rgba(17, 24, 39, 0.07) !important;
  border-radius: 14px !important;
  padding: 1rem !important;
}

.page-create .form-check-input:checked {
  background-color: var(--mr-purple);
  border-color: var(--mr-purple);
}

.page-create .form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(109, 40, 217, 0.15);
}

.page-create hr {
  border-color: rgba(17, 24, 39, 0.08);
  opacity: 1;
}

.mr-paywall {
  border: none !important;
  border-radius: var(--mr-radius-md) !important;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
  color: #92400e !important;
  box-shadow: var(--mr-shadow);
  font-weight: 600;
}

.page-create .btn-success {
  --bs-btn-bg: #059669;
  --bs-btn-border-color: #059669;
  --bs-btn-hover-bg: #047857;
  --bs-btn-hover-border-color: #047857;
  border-radius: var(--mr-radius-pill);
  font-weight: 600;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* —— Site footer —— */
.site-footer {
  margin-top: 4rem;
  padding: 1.75rem 0;
  background: var(--mr-surface);
  border-top: 1px solid rgba(17, 24, 39, 0.07);
  font-size: 0.85rem;
  color: var(--mr-text-muted);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
}

.site-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--mr-text);
  letter-spacing: -0.01em;
  margin-right: auto;
}

.site-footer__logo {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--mr-purple) 0%, var(--mr-purple-dark) 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.site-footer__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-footer__links a {
  color: var(--mr-purple-dark);
  font-weight: 600;
  text-decoration: none;
  padding: 0.2rem 0.6rem;
  border-radius: var(--mr-radius-pill);
  transition: background 0.15s, color 0.15s;
}

.site-footer__links a:hover {
  background: var(--mr-purple-soft);
  color: var(--mr-purple);
}

.site-footer__sep {
  color: var(--mr-text-muted);
  user-select: none;
  padding: 0 0.1rem;
}

.site-footer__copy {
  color: var(--mr-text-muted);
}

/* —— Pricing cards —— */
.landing-pricing {
  margin-top: 3rem;
}

.pricing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.pricing-card {
  background: var(--mr-surface);
  border-radius: var(--mr-radius-lg);
  padding: 2rem 1.75rem;
  box-shadow: var(--mr-shadow);
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: transform 0.18s, box-shadow 0.18s;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(17, 24, 39, 0.1);
}

.pricing-card--highlight {
  border-color: var(--mr-purple);
  background: linear-gradient(160deg, #faf7ff 0%, #f5f0ff 100%);
}

.pricing-card__badge {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--mr-text-muted);
  margin-bottom: 0.75rem;
}

.pricing-card__badge--pro {
  color: var(--mr-purple-dark);
}

.pricing-card__price {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--mr-text);
  margin-bottom: 1.25rem;
}

.pricing-card__price span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--mr-text-muted);
}

.pricing-card__features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.75rem;
  flex: 1;
}

.pricing-card__features li {
  padding: 0.35rem 0;
  color: #374151;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(17, 24, 39, 0.05);
}

.pricing-card__features li::before {
  content: "✓ ";
  color: var(--mr-purple);
  font-weight: 700;
}

/* —— Nav CTA button —— */
.app-nav__cta {
  background: var(--mr-purple) !important;
  color: #fff !important;
  font-weight: 600 !important;
  padding: 0.45rem 1.1rem !important;
}

.app-nav__cta:hover,
.app-nav__cta:focus {
  background: #7c3aed !important;
  color: #fff !important;
}

.app-nav__register {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
  font-weight: 600 !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
}

.app-nav__register:hover,
.app-nav__register:focus {
  background: var(--mr-purple) !important;
  color: #fff !important;
  border-color: transparent !important;
}

/* —— Legal pages (privacy / terms) —— */
.page-legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.page-legal h1 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--mr-text);
  margin-bottom: 0.35rem;
}

.page-legal .legal-meta {
  font-size: 0.83rem;
  color: var(--mr-text-muted);
  margin-bottom: 2.5rem;
}

.page-legal h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--mr-purple-dark);
  margin-top: 2.25rem;
  margin-bottom: 0.6rem;
}

.page-legal p,
.page-legal li {
  line-height: 1.75;
  color: #374151;
}

.page-legal ul {
  padding-left: 1.25rem;
}

.page-legal a {
  color: var(--mr-purple-dark);
  font-weight: 600;
  text-decoration: none;
}

.page-legal a:hover {
  text-decoration: underline;
}

/* —— Conversion landings /lp/1–5 (1 meme → 4 platform variants) —— */
.page-lp .app-main {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
}

.conv-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.15rem 3.5rem;
}

@media (min-width: 768px) {
  .conv-shell {
    padding: 0 1.75rem 4rem;
  }
}

.conv-section {
  padding: 2.5rem 0;
}

.conv-section-title {
  font-weight: 800;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}

.conv-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mr-text-muted);
  margin-bottom: 0.5rem;
}

.conv-lead {
  color: var(--mr-text-muted);
  font-size: 1.05rem;
  max-width: 38rem;
  line-height: 1.5;
}

.conv-cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  padding: 0.75rem 1.65rem;
  border-radius: var(--mr-radius-pill);
  background: var(--mr-purple);
  color: #fff !important;
  border: none;
  text-decoration: none;
  box-shadow: 0 6px 24px rgba(109, 40, 217, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.conv-cta-primary:hover {
  transform: translateY(-2px);
  color: #fff !important;
  box-shadow: 0 10px 32px rgba(109, 40, 217, 0.42);
}

.conv-cta-ghost {
  font-weight: 600;
  color: var(--mr-purple-dark) !important;
  text-decoration: none;
  padding: 0.75rem 1.25rem;
}

.conv-cta-ghost:hover {
  text-decoration: underline;
}

/* Mock meme tiles: 1 source + 4 variants */
.conv-meme {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 36px rgba(17, 24, 39, 0.1);
  border: 1px solid rgba(17, 24, 39, 0.06);
  background: #1e1b4b;
}

.conv-meme__bg {
  position: absolute;
  inset: 0;
}

.conv-meme__cap {
  position: absolute;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%);
  width: 90%;
  text-align: center;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(0.65rem, 2vw, 0.95rem);
  line-height: 1.08;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
}

.conv-meme__tag {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}

.conv-grid-1-4 {
  display: grid;
  gap: 0.75rem;
  align-items: start;
}

@media (min-width: 992px) {
  .conv-grid-1-4 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  }
}

.conv-grid-1-4__src .conv-meme {
  aspect-ratio: 1 / 1;
}

.conv-grid-1-4__four {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.conv-grid-1-4__four .conv-meme {
  aspect-ratio: 1 / 1;
}

.conv-benefit-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.conv-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--mr-purple-soft);
  color: var(--mr-purple-dark);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.65rem;
}

.conv-quote {
  background: var(--mr-surface);
  border-radius: var(--mr-radius-md);
  padding: 1.25rem;
  border: 1px solid rgba(17, 24, 39, 0.06);
  height: 100%;
}

.conv-quote .small {
  color: var(--mr-text-muted);
}

.conv-pricing-card {
  border-radius: var(--mr-radius-md);
  padding: 1.5rem;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: var(--mr-surface);
  height: 100%;
}

.conv-pricing-card--pro {
  border-color: var(--mr-purple);
  box-shadow: 0 12px 40px rgba(109, 40, 217, 0.15);
}

.conv-final {
  border-radius: var(--mr-radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
}

/* P1 — Speed */
.page-conv-p1 {
  background: var(--mr-bg);
}

.page-conv-p1 .conv-hero {
  padding: 2.5rem 0 1rem;
}

@media (min-width: 992px) {
  .page-conv-p1 .conv-hero .row {
    align-items: center;
  }
}

.page-conv-p1 .conv-hero h1 {
  font-weight: 800;
  font-size: clamp(2rem, 4.5vw, 3rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.page-conv-p1 .conv-badge-speed {
  display: inline-block;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--mr-radius-pill);
  background: #fef08a;
  color: #713f12;
  margin-bottom: 1rem;
}

.page-conv-p1 .conv-final {
  background: linear-gradient(135deg, var(--mr-purple) 0%, #7c3aed 100%);
  color: #fff;
}

.page-conv-p1 .conv-final .conv-cta-primary {
  background: #fff;
  color: var(--mr-purple-dark) !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
}

.page-conv-p1 .conv-final .conv-cta-primary:hover {
  color: var(--mr-purple) !important;
}

/* P2 — Feed / algorithm */
.page-conv-p2 {
  background: #f8fafc;
}

.page-conv-p2 .conv-hero-band {
  background: #0f172a;
  color: #f8fafc;
  padding: 2.75rem 0 2rem;
  margin-bottom: 0;
}

.page-conv-p2 .conv-hero-band h1 {
  font-weight: 800;
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.page-conv-p2 .conv-hero-band .conv-lead {
  color: #94a3b8;
}

.page-conv-p2 .conv-cta-primary {
  background: #f8fafc;
  color: #0f172a !important;
  box-shadow: none;
}

.page-conv-p2 .conv-cta-primary:hover {
  color: #0f172a !important;
  background: #e2e8f0;
}

.page-conv-p2 .conv-cta-ghost {
  color: #e2e8f0 !important;
}

.page-conv-p2 .conv-final {
  background: #0f172a;
  color: #f8fafc;
}

.page-conv-p2 .conv-final .conv-lead {
  color: #94a3b8;
}

.page-conv-p2 .conv-final .conv-cta-primary {
  background: #f8fafc;
  color: #0f172a !important;
}

/* P3 — Volume */
.page-conv-p3 .conv-hero {
  background: linear-gradient(180deg, #fff 0%, var(--mr-bg) 100%);
  padding: 2.5rem 0 2rem;
  border-bottom: 4px solid #111827;
}

.page-conv-p3 .conv-hero h1 {
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: -0.045em;
  line-height: 0.98;
  text-transform: uppercase;
}

.page-conv-p3 .conv-stat {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
}

.page-conv-p3 .conv-final {
  background: #111827;
  color: #fff;
}

.page-conv-p3 .conv-final .conv-cta-primary {
  background: #facc15;
  color: #111827 !important;
  box-shadow: none;
}

.page-conv-p3 .conv-final .conv-cta-primary:hover {
  color: #111827 !important;
  background: #fde047;
}

/* P4 — Creator lifestyle */
.page-conv-p4 {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 12%, var(--mr-bg) 45%);
}

.page-conv-p4 .conv-hero {
  padding: 3rem 0 2rem;
}

.page-conv-p4 .conv-hero h1 {
  font-weight: 800;
  font-size: clamp(1.9rem, 4.2vw, 2.85rem);
  letter-spacing: -0.035em;
  line-height: 1.12;
  max-width: 16ch;
}

.page-conv-p4 .conv-soft-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-radius: var(--mr-radius-lg);
  padding: 1.5rem;
  border: 1px solid rgba(251, 191, 36, 0.35);
  box-shadow: var(--mr-shadow);
}

.page-conv-p4 .conv-final {
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
  color: #fff;
}

.page-conv-p4 .conv-final .conv-lead {
  color: rgba(255, 255, 255, 0.9);
}

.page-conv-p4 .conv-final .conv-cta-primary {
  background: #fff;
  color: #b45309 !important;
}

/* P5 — AI dark */
.page-conv-p5 {
  background: #07060d !important;
  color: #e8e6f0;
}

.page-conv-p5 .app-nav {
  background: #07060d;
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.page-conv-p5 .site-footer {
  background: #05040a;
  border-top: 1px solid rgba(139, 92, 246, 0.12);
}

.page-conv-p5 .site-footer__copy,
.page-conv-p5 .site-footer__brand {
  color: #9ca3af;
}

.page-conv-p5 .site-footer__links a {
  color: #a78bfa;
}

.page-conv-p5 .site-footer__links a:hover {
  color: #e9d5ff;
}

.page-conv-p5 .conv-section-title {
  color: #f3f4f6;
}

.page-conv-p5 .conv-lead,
.page-conv-p5 .text-muted {
  color: #a5a0b8 !important;
}

.page-conv-p5 .conv-meme {
  border-color: rgba(167, 139, 250, 0.25);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.12), 0 16px 48px rgba(0, 0, 0, 0.4);
}

.page-conv-p5 .conv-quote,
.page-conv-p5 .conv-pricing-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: #e8e6f0;
}

.page-conv-p5 .conv-pricing-card--pro {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.3);
}

.page-conv-p5 .conv-hero-glass {
  margin-top: 1.5rem;
  padding: 2.25rem 1.5rem;
  border-radius: var(--mr-radius-lg);
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.15) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 1px solid rgba(167, 139, 250, 0.25);
  text-align: center;
}

.page-conv-p5 .conv-hero-glass h1 {
  font-weight: 800;
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #fff 0%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-conv-p5 .conv-step-num {
  background: rgba(139, 92, 246, 0.25);
  color: #e9d5ff;
}

.page-conv-p5 .conv-final {
  background: radial-gradient(ellipse 80% 80% at 50% 0%, rgba(139, 92, 246, 0.35) 0%, transparent 50%),
    linear-gradient(180deg, #120a1c 0%, #07060d 100%);
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.page-conv-p5 .conv-benefit-icon {
  background: rgba(139, 92, 246, 0.2);
}

/* LP index */
.page-lp-index .lp-index-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin-top: 1.5rem;
}

@media (min-width: 640px) {
  .page-lp-index .lp-index-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .page-lp-index .lp-index-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.page-lp-index .lp-index-card {
  display: block;
  background: var(--mr-surface);
  border-radius: var(--mr-radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--mr-shadow);
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(17, 24, 39, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

.page-lp-index .lp-index-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(109, 40, 217, 0.12);
  color: inherit;
}

.page-lp-index .lp-index-card strong {
  display: block;
  font-size: 1.05rem;
  color: var(--mr-purple-dark);
  margin-bottom: 0.35rem;
}

.page-lp-index .lp-index-card span {
  font-size: 0.88rem;
  color: var(--mr-text-muted);
}

/* ==========================================================================
   Workflow Studio (/workflows) — saved-workflow list + step-based editor
   ========================================================================== */

.page-workflows .app-main {
  padding-bottom: 5rem;
}

/* —— Layout —— */
.wf-layout {
  display: grid;
  /* minmax(0, …) not 1fr: a plain `1fr` track floors at its content width, which lets the
     horizontally-scrolling style pickers push the whole page sideways on narrow screens. */
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.wf-sidebar,
.wf-editor {
  min-width: 0;
}

@media (min-width: 992px) {
  .wf-layout {
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 1.75rem;
  }
  .wf-sidebar {
    position: sticky;
    top: 1.25rem;
    max-height: calc(100vh - 2.5rem);
    overflow-y: auto;
    padding-right: 0.25rem;
  }
}

/* —— Sidebar: saved workflow list —— */
.wf-sidebar__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.wf-sidebar__title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--mr-text-muted);
  margin: 0;
}

.wf-filter {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.wf-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.wf-item {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 14px;
  background: var(--mr-surface);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.wf-item:hover {
  border-color: rgba(109, 40, 217, 0.35);
  box-shadow: 0 6px 18px rgba(109, 40, 217, 0.1);
  transform: translateY(-1px);
}

.wf-item.is-active {
  border-color: var(--mr-purple);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.14);
}

.wf-item__top {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.wf-item__swatch {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(150deg, var(--mr-purple), var(--mr-purple-dark));
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.06);
  position: relative;
  overflow: hidden;
}

.wf-item__name {
  font-weight: 700;
  font-size: 0.925rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--mr-text);
  margin: 0 0 0.1rem;
  word-break: break-word;
}

.wf-item__desc {
  font-size: 0.78rem;
  color: var(--mr-text-muted);
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wf-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.55rem;
}

.wf-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(109, 40, 217, 0.09);
  color: var(--mr-purple-dark);
}

.wf-tag--muted {
  background: rgba(17, 24, 39, 0.06);
  color: var(--mr-text-muted);
}

.wf-item__delete {
  flex-shrink: 0;
  margin-left: auto;
  border: 0;
  background: none;
  padding: 0 0.15rem;
  line-height: 1;
  font-size: 0.95rem;
  color: var(--mr-text-muted);
  opacity: 0.5;
  transition: color 0.15s, opacity 0.15s;
}

.wf-item:hover .wf-item__delete,
.wf-item__delete:focus-visible {
  opacity: 1;
}

.wf-item__delete:hover {
  color: var(--bs-danger, #dc3545);
}

.wf-item__use {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--mr-purple-dark);
  text-decoration: none;
}

.wf-item__use:hover {
  text-decoration: underline;
}

.wf-empty {
  border: 1px dashed rgba(17, 24, 39, 0.16);
  border-radius: 14px;
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--mr-text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* —— Editor —— */
.wf-editor__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.wf-editor__name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

.wf-editor__id {
  font-size: 0.72rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--mr-text-muted);
  background: rgba(17, 24, 39, 0.05);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.page-workflows .story-module {
  margin-bottom: 1.25rem;
}

.page-workflows .story-module__body {
  padding: 1.25rem 1.35rem 1.4rem;
}

/* Labels: readable, spaced, consistent. */
.wf-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--mr-text);
  letter-spacing: -0.005em;
  margin-bottom: 0.35rem;
}

.wf-hint {
  display: block;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--mr-text-muted);
  line-height: 1.45;
  margin-top: 0.3rem;
}

.page-workflows .form-control {
  border-radius: 11px;
  border-color: rgba(17, 24, 39, 0.14);
  padding: 0.55rem 0.75rem;
}

/* Same shape as the inputs, but keep Bootstrap's right gutter — that is the space
   the caret background-image is drawn into, so a padding shorthand here would put
   the option text underneath the arrow. */
.page-workflows .form-select {
  border-radius: 11px;
  border-color: rgba(17, 24, 39, 0.14);
  padding: 0.55rem 2.25rem 0.55rem 0.75rem;
}

/* Trailing unit picker in an input-group (words|seconds). Bootstrap gives grouped
   selects `flex: 1 1 auto; width: 1%`, so pairing it with .flex-grow-0 collapses the
   select to a sliver and clips the caret. Size it to its widest option instead. */
.wf-unit-select.form-select {
  flex: 0 0 auto;
  width: auto;
}

.page-workflows .form-control:focus,
.page-workflows .form-select:focus {
  border-color: var(--mr-purple);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.13);
}

.wf-info {
  cursor: help;
  color: var(--mr-text-muted);
  font-size: 0.85rem;
  margin-left: 3px;
}

.wf-info:hover,
.wf-info:focus {
  color: var(--mr-purple);
  outline: none;
}

/* —— Style pickers (art style + title frame) —— */
.wf-picker {
  display: flex;
  gap: 0.7rem;
  overflow-x: auto;
  padding: 0.85rem;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(17, 24, 39, 0.07);
  border-radius: 14px;
  scroll-padding: 0.85rem;
}

/* Art styles: two horizontal-scrolling rows so more looks fit without a taller page. */
.wf-picker--art-rows {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, auto);
  grid-auto-columns: max-content;
  align-content: start;
  column-gap: 0.7rem;
  row-gap: 0.7rem;
}

/* Firefox has no ::-webkit-scrollbar, so it gets the standard properties instead.
   Chromium ignores the pseudo-elements entirely once scrollbar-width is set, which is
   why this is gated rather than declared alongside them. */
@supports not selector(::-webkit-scrollbar) {
  .wf-picker {
    scrollbar-width: thin;
    scrollbar-color: rgba(17, 24, 39, 0.45) rgba(17, 24, 39, 0.1);
  }

  [data-bs-theme="dark"] .wf-picker {
    scrollbar-color: rgba(255, 255, 255, 0.42) rgba(255, 255, 255, 0.1);
  }
}

/* These rows always overflow — art styles, title frames, transitions and effects all
   run past the edge — so the horizontal bar is a navigation cue, not decoration.
   Track and thumb are both painted; a faint thumb on an unpainted track read as
   "this row ends here". */
.wf-picker::-webkit-scrollbar {
  height: 12px;
}

.wf-picker::-webkit-scrollbar-track {
  background: rgba(17, 24, 39, 0.1);
  border-radius: 999px;
}

.wf-picker::-webkit-scrollbar-thumb {
  background: rgba(17, 24, 39, 0.45);
  border-radius: 999px;
  /* Transparent border + padding-box clip insets the thumb so the track stays visible. */
  border: 3px solid transparent;
  background-clip: padding-box;
}

.wf-picker::-webkit-scrollbar-thumb:hover,
.wf-picker::-webkit-scrollbar-thumb:active {
  background: rgba(17, 24, 39, 0.65);
  background-clip: padding-box;
}

.wf-card {
  flex: 0 0 auto;
  /* Card size is a base (--wf-card-w/h) times a zoom the picker's data-zoom sets, so a
     1×/2×/3× toggle can enlarge the preview cards without touching each render. */
  --wf-card-w: 120px;
  --wf-card-h: 204px;
  --wf-zoom: 1;
  width: calc(var(--wf-card-w) * var(--wf-zoom));
  height: calc(var(--wf-card-h) * var(--wf-zoom));
  position: relative;
  cursor: pointer;
  border: 3px solid transparent;
  border-radius: 14px;
  overflow: hidden;
  padding: 0;
  background-color: #2b2f3a;
  background-size: cover;
  background-position: center;
  transition: transform 0.15s, box-shadow 0.15s;
}

.wf-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.18);
}

.wf-card:focus-visible {
  outline: 2px solid var(--mr-purple);
  outline-offset: 2px;
}

.wf-card.active {
  border-color: var(--mr-purple);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.2);
}

/* Unsaved moodboard preview in the My styles picker — dashed border until named + saved. */
.wf-card.wf-card--draft {
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.85);
}

.wf-card.wf-card--draft.active {
  border-style: dashed;
  border-color: var(--mr-purple);
}

.wf-card-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.1rem 0.25rem 0.35rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.82) 45%);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.25;
}

.wf-card-check {
  position: absolute;
  /* Above preview faces (title frames, slide minis) that fill the card after it. */
  z-index: 1;
  top: 7px;
  right: 7px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: var(--mr-purple);
  color: #fff;
  font-size: 0.76rem;
  line-height: 23px;
  text-align: center;
  display: none;
  box-shadow: 0 2px 6px rgba(17, 24, 39, 0.3);
}

.wf-card.active .wf-card-check {
  display: block;
}

.wf-tf-frame {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #4a5568, #232936);
  padding: 9px;
}

.wf-picker-empty {
  color: var(--mr-text-muted);
  font-size: 0.85rem;
  padding: 0.4rem;
}

/* Caption under a picker describing the current choice. */
.wf-picked {
  margin-top: 0.65rem;
  font-size: 0.8rem;
  color: var(--mr-text-muted);
  line-height: 1.5;
}

.wf-picked strong {
  color: var(--mr-text);
  font-weight: 700;
}

/* —— Block (step) cards —— */
.wf-blocks {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.wf-block {
  border: 1px solid rgba(17, 24, 39, 0.09);
  border-radius: 14px;
  background: var(--mr-surface);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
  overflow: hidden;
  transition: border-color 0.15s, opacity 0.15s;
}

.wf-block:hover {
  border-color: rgba(109, 40, 217, 0.28);
}

.wf-block--off {
  opacity: 0.62;
  background: rgba(248, 250, 252, 0.7);
}

.wf-block__head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 0.95rem;
}

.wf-block__num {
  flex-shrink: 0;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--mr-purple-dark);
  background: var(--mr-purple-soft);
}

.wf-block--off .wf-block__num {
  color: var(--mr-text-muted);
  background: rgba(17, 24, 39, 0.07);
}

.wf-block__text {
  flex: 1 1 auto;
  min-width: 0;
}

.wf-block__name {
  font-size: 0.925rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.wf-block__desc {
  font-size: 0.78rem;
  color: var(--mr-text-muted);
  line-height: 1.45;
  margin: 0.1rem 0 0;
}

.wf-block__controls {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
}

.wf-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

.wf-switch .form-check-input {
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.wf-switch .form-check-input:checked {
  background-color: var(--mr-purple);
  border-color: var(--mr-purple);
}

.wf-switch__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--mr-text-muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.wf-order {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wf-order button {
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: var(--mr-surface);
  color: var(--mr-text-muted);
  border-radius: 6px;
  width: 1.5rem;
  height: 1.05rem;
  line-height: 1;
  font-size: 0.62rem;
  padding: 0;
  cursor: pointer;
}

.wf-order button:hover:not(:disabled) {
  color: var(--mr-purple-dark);
  border-color: var(--mr-purple);
}

.wf-order button:disabled {
  opacity: 0.35;
  cursor: default;
}

.wf-block__config {
  padding: 0.9rem 0.95rem 1rem;
  border-top: 1px dashed rgba(17, 24, 39, 0.1);
}

/* —— Music library picker (compact chips + scroll) —— */
.wf-music-picker {
  margin-top: 0.65rem;
}

.wf-music-specials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.wf-music-special {
  text-align: left;
}

.wf-music-list {
  max-height: 16.5rem;
  overflow-y: auto;
  padding-right: 0.25rem;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.015);
  padding: 0.45rem 0.5rem 0.55rem;
}

.wf-music-mood {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--mr-text-muted);
  margin: 0.45rem 0 0.3rem;
  letter-spacing: 0.01em;
}

.wf-music-mood:first-child {
  margin-top: 0;
}

.wf-music-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

@media (max-width: 991.98px) {
  .wf-music-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .wf-music-grid {
    grid-template-columns: 1fr;
  }
}

.wf-music-track {
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.wf-music-track.active {
  border-color: var(--mr-purple, #6d28d9);
  box-shadow: 0 0 0 1px var(--mr-purple, #6d28d9);
}

.wf-music-track.is-playing {
  border-color: rgba(109, 40, 217, 0.45);
}

.wf-music-play {
  flex: 0 0 1.7rem;
  border: 0;
  border-right: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(17, 24, 39, 0.03);
  color: var(--mr-text-muted);
  font-size: 0.65rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.wf-music-play:hover {
  background: rgba(109, 40, 217, 0.08);
  color: var(--mr-purple-dark, #5b21b6);
}

.wf-music-track.is-playing .wf-music-play {
  background: rgba(109, 40, 217, 0.12);
  color: var(--mr-purple-dark, #5b21b6);
}

.wf-music-pick {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  background: transparent;
  padding: 0.28rem 0.45rem;
  text-align: left;
  cursor: pointer;
}

.wf-music-pick:disabled {
  cursor: default;
}

.wf-music-track.active .wf-music-pick {
  background: var(--mr-purple, #6d28d9);
  color: #fff;
}

.wf-music-track.active .wf-music-dur {
  color: rgba(255, 255, 255, 0.8);
}

.wf-music-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 550;
  line-height: 1.2;
}

.wf-music-dur {
  flex: 0 0 auto;
  font-size: 0.68rem;
  color: var(--mr-text-muted);
  white-space: nowrap;
}

[data-bs-theme="dark"] .wf-music-list {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .wf-music-track {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .wf-music-play {
  background: rgba(255, 255, 255, 0.04);
  border-right-color: rgba(255, 255, 255, 0.08);
}

.wf-block__config .wf-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--mr-text-muted);
  text-transform: capitalize;
}

/* —— Collapsible sections, pipeline steps and run-screen task cards —— */
.mr-caret-btn {
  border: 0;
  background: none;
  color: var(--mr-text-muted);
  font-size: 0.8rem;
  line-height: 1;
  padding: 0.2rem 0.35rem;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  align-self: center;
}

.mr-caret-btn:hover {
  color: var(--mr-purple-dark);
  background: rgba(109, 40, 217, 0.08);
}

.mr-caret {
  display: inline-block;
  transition: transform 0.15s ease;
}

.story-module--collapsed .mr-caret,
.wf-block--collapsed .mr-caret,
.wfr-task--collapsed .mr-caret {
  transform: rotate(-90deg);
}

/* Glanceable per-task emoji before each card/step title (run screen + editor). */
.wfr-task__icon {
  margin-right: 0.45rem;
}

/* Classic-quotes picker on the run screen: scrollable list of tappable passages. */
.wfr-quote-list {
  max-height: 16rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.wfr-quote {
  text-align: left;
  border: 1px solid var(--mr-border, #dee2e6);
  border-radius: 0.5rem;
  background: transparent;
  padding: 0.5rem 0.7rem;
  display: block;
  cursor: pointer;
}

.wfr-quote:hover,
.wfr-quote:focus-visible {
  border-color: var(--mr-purple-dark, #6d28d9);
}

.wfr-quote__text {
  display: block;
  font-size: 0.85rem;
  font-style: italic;
}

.wfr-quote__author {
  display: block;
  font-size: 0.72rem;
  color: var(--mr-text-muted, #6c757d);
  margin-top: 0.15rem;
}

.story-module__head--toggle {
  cursor: pointer;
}

.story-module__head--toggle .mr-caret-btn {
  margin-left: auto;
}

.story-module--collapsed .story-module__body {
  display: none;
}

/* The head's divider would float above the rounded bottom edge once the body hides. */
.story-module--collapsed .story-module__head {
  border-bottom: 0;
}

.wf-block__head--toggle {
  cursor: pointer;
}

.wf-block--collapsed .wf-block__config {
  display: none;
}

/* "Collapse all / Expand all" — the small control row at the top of a pipeline list. */
.mr-collapse-all {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
}

.mr-collapse-all button {
  border: 0;
  background: none;
  color: var(--mr-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.mr-collapse-all button:hover {
  color: var(--mr-purple-dark);
  background: rgba(109, 40, 217, 0.08);
}

/* —— Sticky action bar —— */
.wf-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.1rem;
  margin-top: 1.5rem;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 16px;
  background: var(--mr-surface);
  box-shadow: 0 -4px 24px rgba(17, 24, 39, 0.09);
}

.wf-actions__hint {
  font-size: 0.78rem;
  color: var(--mr-text-muted);
  margin: 0;
}

/* Save result shown in the sticky bar, since the page banner is off-screen from here. */
.wf-actions__msg {
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0;
}

.wf-actions__msg--warning { color: #b45309; }
.wf-actions__msg--danger { color: #b91c1c; }
.wf-actions__msg--success { color: #15803d; }
.wf-actions__msg--info { color: var(--mr-text-muted); }

[data-bs-theme="dark"] .wf-actions__msg--warning { color: #fbbf24; }
[data-bs-theme="dark"] .wf-actions__msg--danger { color: #f87171; }
[data-bs-theme="dark"] .wf-actions__msg--success { color: #4ade80; }

/* Highlights the field that blocked a save after we scroll it into view. */
.wf-flash {
  animation: wf-flash 1.8s ease-out;
  border-radius: 12px;
}

@keyframes wf-flash {
  0%, 60% { box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.55); }
  100% { box-shadow: 0 0 0 3px rgba(249, 115, 22, 0); }
}

.page-workflows .btn {
  border-radius: 11px;
  font-weight: 600;
}

/* —— Read-only (built-in) state —— */
.wf-readonly-note {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(250, 204, 21, 0.14);
  border: 1px solid rgba(202, 138, 4, 0.28);
  font-size: 0.83rem;
  color: #854d0e;
  margin-bottom: 1.25rem;
}

/* —— Dark theme —— */
[data-bs-theme="dark"] .wf-item,
[data-bs-theme="dark"] .wf-block,
[data-bs-theme="dark"] .wf-actions {
  background: var(--mr-surface);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .wf-block--off {
  background: rgba(255, 255, 255, 0.03);
}

[data-bs-theme="dark"] .wf-picker {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .wf-picker::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .wf-picker::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.42);
  background-clip: padding-box;
}

[data-bs-theme="dark"] .wf-picker::-webkit-scrollbar-thumb:hover,
[data-bs-theme="dark"] .wf-picker::-webkit-scrollbar-thumb:active {
  background: rgba(255, 255, 255, 0.62);
  background-clip: padding-box;
}

[data-bs-theme="dark"] .wf-empty {
  border-color: rgba(255, 255, 255, 0.18);
}

[data-bs-theme="dark"] .wf-editor__id,
[data-bs-theme="dark"] .wf-tag--muted {
  background: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .wf-tag {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
}

[data-bs-theme="dark"] .wf-block__num {
  color: #c4b5fd;
}

[data-bs-theme="dark"] .wf-order button {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.16);
}

[data-bs-theme="dark"] .wf-readonly-note {
  background: rgba(250, 204, 21, 0.1);
  color: #fde68a;
}

[data-bs-theme="dark"] .page-workflows .form-control,
[data-bs-theme="dark"] .page-workflows .form-select {
  border-color: rgba(255, 255, 255, 0.14);
}

/* "None" title-frame card: an empty frame reads as broken, so label it. */
.wf-tf-frame--none {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0 8px, rgba(255, 255, 255, 0) 8px 16px),
    linear-gradient(160deg, #4a5568, #232936);
}


/* Captions block: range value readout + "captions off" preview state. */
.wf-range__value {
  float: right;
  font-weight: 600;
  color: var(--mr-text-muted);
  font-variant-numeric: tabular-nums;
}

.story-caption-preview-frame.is-disabled .story-caption-preview-sample {
  opacity: 0.25;
}

.story-caption-preview-frame.is-disabled::after {
  content: "captions off";
  position: absolute;
  inset: auto 0 46%;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.page-workflows .story-caption-preview-frame {
  width: min(240px, 100%);
}

.page-workflows .form-range {
  padding: 0;
}

.page-workflows .form-range::-webkit-slider-thumb {
  background: var(--mr-purple);
}

.page-workflows .form-range::-moz-range-thumb {
  background: var(--mr-purple);
}

.page-workflows .form-control-color {
  height: 2.5rem;
  padding: 0.25rem;
  border-radius: 11px;
}

/* Title-frame preview card — shared by the picker thumbnails and the hook block. */
.mr-title-card {
  display: inline-block;
  word-break: break-word;
  max-width: 92%;
}

.mr-title-card--none {
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  border: 1px dashed rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  padding: 0.25rem 0.4rem;
  text-align: center;
  line-height: 1.2;
}

/* The 9:16 frame the hook-block preview draws into. */
.mr-title-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  /* No percentage padding here: CSS resolves padding-% against the *containing block's*
     width, not the frame's, which on a wide column crushed the card to a sliver. The
     card's own max-width (the style's width_pct) already keeps it clear of the edges. */
}

.page-workflows .mr-title-frame {
  width: min(240px, 100%);
}

/* Compact picker used inside a block's config panel. */
.wf-picker--compact {
  padding: 0.6rem;
  gap: 0.5rem;
}

.wf-picker--compact .wf-card {
  --wf-card-w: 96px;
  --wf-card-h: 164px;
}

/* Slide-text style picker: the card face is a live mini slide preview
   (MRSlidePreview.createStyleCard) filling the tile like .wf-tf-frame does. */
.mr-slide-mini {
  position: absolute;
  inset: 0;
}

.mr-slide-mini .story-caption-preview-frame {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  border-radius: 11px;
}

/* Preview-size toggle (1×/2×/3×) — the picker's data-zoom scales its cards. */
.wf-picker[data-zoom="2"] .wf-card { --wf-zoom: 2; }
.wf-picker[data-zoom="3"] .wf-card { --wf-zoom: 3; }

.wf-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.wf-size-toggle .btn {
  padding: 0.05rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.5;
}

.wf-picker--compact .wf-card-label {
  font-size: 0.55rem;
  padding-top: 0.9rem;
}

/* Images block: model ⇄ Starting-point mismatch note. */
.wf-image-warn {
  margin-top: 0.3rem;
  line-height: 1.35;
}

.wf-image-warn--danger {
  color: #b42318;
}

[data-bs-theme="dark"] .wf-image-warn--danger {
  color: #ffa39e;
}

.wf-image-warn--info {
  color: var(--mr-text-muted);
}

/* Transition / cut picker — each card loops its pre-rendered preview clip. */
.wf-trans-card__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #2b2f3a;
}

/* Art style ⇄ model comparison grid. */
.wf-variants {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

@media (min-width: 576px) {
  .wf-variants { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 992px) {
  .wf-variants { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.wf-variant {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
  border: 3px solid transparent;
  border-radius: 14px;
  background: var(--mr-surface);
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.08);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.wf-variant:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.16);
  border-color: rgba(109, 40, 217, 0.4);
}

.wf-variant.is-current {
  border-color: var(--mr-purple);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.18);
}

.wf-variant__img {
  display: block;
  width: 100%;
  aspect-ratio: 300 / 510;
  object-fit: cover;
  background: linear-gradient(160deg, #4a5568, #232936);
}

.wf-variant__missing {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 300 / 510;
  background: repeating-linear-gradient(45deg, #3a4050, #3a4050 10px, #333846 10px, #333846 20px);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  padding: 0.5rem;
}

.wf-variant__meta {
  padding: 0.55rem 0.65rem 0.65rem;
}

.wf-variant__name {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--mr-text);
  margin: 0;
  line-height: 1.25;
}

.wf-variant__vendor {
  font-size: 0.7rem;
  color: var(--mr-text-muted);
  margin: 0.05rem 0 0;
}

.wf-variant__price {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--mr-purple-dark);
  margin: 0.3rem 0 0;
  font-variant-numeric: tabular-nums;
}

.wf-variant__price small {
  font-weight: 500;
  color: var(--mr-text-muted);
}

.wf-variant__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.78);
  color: #fff;
}

.wf-variant__badge--tier-budget { background: rgba(22, 163, 74, 0.9); }
.wf-variant__badge--tier-mid { background: rgba(37, 99, 235, 0.9); }
.wf-variant__badge--tier-premium { background: rgba(217, 119, 6, 0.92); }
.wf-variant__badge--tier-ultra { background: rgba(190, 24, 93, 0.92); }

.wf-variant__check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--mr-purple);
  color: #fff;
  font-size: 0.78rem;
  line-height: 24px;
  text-align: center;
  display: none;
  box-shadow: 0 2px 6px rgba(17, 24, 39, 0.35);
}

.wf-variant.is-current .wf-variant__check { display: block; }

.wf-variant.is-selected {
  border-color: var(--mr-purple);
  box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.22);
}
.wf-variant.is-selected .wf-variant__check { display: block; }

/* Test mode: compact model picker (large result tiles stay on .wf-variants--results). */
.wf-variants--compact {
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 0.45rem;
}

@media (min-width: 768px) {
  .wf-variants--compact {
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  }
}

.wf-variant--compact {
  border-width: 2px;
  border-radius: 10px;
  min-height: 0;
}

.wf-variant--compact .wf-variant__body {
  padding: 0.45rem 0.5rem 0.5rem;
  padding-right: 1.6rem;
}

.wf-variant--compact .wf-variant__name {
  font-size: 0.72rem;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wf-variant--compact .wf-variant__vendor {
  font-size: 0.62rem;
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wf-variant--compact .wf-variant__price {
  font-size: 0.68rem;
  margin-top: 0.2rem;
  margin-bottom: 0;
}

.wf-variant--compact .wf-variant__check {
  top: 5px;
  right: 5px;
  width: 18px;
  height: 18px;
  font-size: 0.65rem;
  line-height: 18px;
}

.wf-variant--compact:hover {
  transform: none;
}

.wf-variants--results .wf-variant__img,
.wf-variants--results .wf-variant__video,
.wf-variants--results .wf-variant__missing {
  aspect-ratio: 300 / 510;
}

.wf-variant__video {
  display: block;
  width: 100%;
  aspect-ratio: 300 / 510;
  object-fit: cover;
  background: #111;
}

.wf-variant--failed {
  border-color: rgba(220, 38, 38, 0.65);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.12);
  cursor: default;
}

.wf-variant--failed:hover {
  transform: none;
  border-color: rgba(220, 38, 38, 0.65);
}

.wf-variant__status {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  color: #fff;
  line-height: 1.2;
}

.wf-variant__status--ok { background: rgba(22, 163, 74, 0.92); }
.wf-variant__status--fail { background: rgba(220, 38, 38, 0.92); }

.wf-variant__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.45rem 0.55rem 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.18);
}

.wf-variant__head .wf-variant__name {
  margin: 0;
  font-size: 0.82rem;
  flex: 1;
  min-width: 0;
}

.wf-variant__error {
  font-size: 0.68rem;
  color: #fca5a5;
  margin: 0.35rem 0 0;
  line-height: 1.35;
  word-break: break-word;
}

.wf-variants--results .wf-variant--failed .wf-variant__missing {
  aspect-ratio: 16 / 9;
  min-height: 72px;
  background: repeating-linear-gradient(
    45deg,
    rgba(127, 29, 29, 0.35),
    rgba(127, 29, 29, 0.35) 10px,
    rgba(91, 20, 20, 0.35) 10px,
    rgba(91, 20, 20, 0.35) 20px
  );
  color: #fecaca;
}
  content: '…';
  animation: wfr-test-pulse 1s ease-in-out infinite;
}

@keyframes wfr-test-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* The model shown next to the art style picker. */
.wf-model-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--mr-purple-soft);
  color: var(--mr-purple-dark);
  margin-left: 0.35rem;
}

[data-bs-theme="dark"] .wf-variant {
  background: var(--mr-surface);
}

[data-bs-theme="dark"] .wf-model-chip {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
}

/* —— Use-workflow: AI topic ideas —— */
.wfr-ideas {
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: 14px;
  background: rgba(139, 92, 246, 0.06);
}

.wfr-idea {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.7rem;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 11px;
  background: var(--mr-surface);
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.wfr-idea + .wfr-idea {
  margin-top: 0.45rem;
}

.wfr-idea:hover,
.wfr-idea:focus-visible {
  border-color: rgba(139, 92, 246, 0.6);
  transform: translateY(-1px);
}

.wfr-idea__topic {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
}

.wfr-idea__angle {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(139, 92, 246, 0.14);
  color: #7c3aed;
}

.wfr-idea__why {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.76rem;
  color: var(--mr-text-muted);
}

[data-bs-theme="dark"] .wfr-idea {
  border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .wfr-idea__angle {
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.2);
}

/* —— Use-workflow: the locked look, shown once above the scene list —— */
.wfr-style-lock {
  padding: 0.5rem 0.7rem;
  margin-bottom: 0.5rem;
  border-radius: 10px;
  border: 1px dashed rgba(17, 24, 39, 0.18);
  background: rgba(17, 24, 39, 0.03);
  color: var(--mr-text-muted);
}

.wfr-style-lock__label {
  font-weight: 600;
  margin-right: 0.3rem;
}

[data-bs-theme="dark"] .wfr-style-lock {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
}
